am c3db771c: am 578a9efd: Merge "Raise API level to 23." into mnc-dev

* commit 'c3db771cac9a2d448f4f624ac410377c30fc6158':
  Raise API level to 23.
diff --git a/CleanSpec.mk b/CleanSpec.mk
index c95ae05..2f2d07e 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -354,7 +354,7 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/default.prop)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/default.prop)
 
-# Change PLATFORM_VERSION from MNC to M
+# New York, New York!
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
diff --git a/core/base_rules.mk b/core/base_rules.mk
index ea64cc6..9c85e5b 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -549,7 +549,7 @@
   LOCAL_ACP_UNAVAILABLE := $(strip $(HOST_ACP_UNAVAILABLE))
 endif
 
-ifndef LOCAL_UNINSTALLABLE_MODULE
+ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
   # Define a copy rule to install the module.
   # acp and libraries that it uses can't use acp for
   # installation;  hence, LOCAL_ACP_UNAVAILABLE.
@@ -596,6 +596,34 @@
 endif
 
 ###########################################################
+## Compatibiliy suite files.
+###########################################################
+ifdef LOCAL_COMPATIBILITY_SUITE
+ifneq ($(words $(LOCAL_COMPATIBILITY_SUITE)),1)
+$(error $(LOCAL_PATH):$(LOCAL_MODULE) LOCAL_COMPATIBILITY_SUITE can be only one name)
+endif
+
+cts_testcase_file := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem)
+$(cts_testcase_file) : $(LOCAL_BUILT_MODULE) | $(ACP)
+	$(copy-file-to-new-target)
+
+cts_testcase_config :=
+android_test_xml := $(wildcard $(LOCAL_PATH)/AndroidTest.xml)
+ifdef android_test_xml
+cts_testcase_config := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).config
+$(cts_testcase_config) : $(android_test_xml) | $(ACP)
+	$(copy-file-to-new-target)
+endif
+
+COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \
+  $(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \
+  $(cts_testcase_file) $(cts_testcase_config)
+
+# Copy over the compatibility files when user runs mm/mmm.
+$(my_register_name) : $(cts_testcase_file) $(cts_testcase_config)
+endif  # LOCAL_COMPATIBILITY_SUITE
+
+###########################################################
 ## Register with ALL_MODULES
 ###########################################################
 
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 7373764..57bb4d0 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -146,6 +146,7 @@
 LOCAL_ODM_MODULE:=
 LOCAL_PRIVILEGED_MODULE:=
 LOCAL_MODULE_OWNER:=
+LOCAL_COMPATIBILITY_SUITE:=
 LOCAL_CTS_TEST_PACKAGE:=
 LOCAL_CTS_TEST_RUNNER:=
 LOCAL_CLANG:=
@@ -180,6 +181,7 @@
 LOCAL_DPI_FILE_STEM:=
 LOCAL_SANITIZE:=
 LOCAL_SANITIZE_RECOVER:=
+LOCAL_DATA_BINDING:=
 
 # arch specific variables
 LOCAL_SRC_FILES_$(TARGET_ARCH):=
diff --git a/core/config.mk b/core/config.mk
index f0ff5a1..54f1679 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -31,6 +31,11 @@
 # only has an effect on python 2.6 and above.
 export PYTHONDONTWRITEBYTECODE := 1
 
+ifneq ($(GREP_OPTIONS),)
+$(warning The build system needs unmodified output of grep.)
+$(error Please unset your $$GREP_OPTIONS.)
+endif
+
 # Standard source directories.
 SRC_DOCS:= $(TOPDIR)docs
 # TODO: Enforce some kind of layering; only add include paths
@@ -430,6 +435,7 @@
 TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX)
 E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX)
 JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
+DATA_BINDING_COMPILER := $(HOST_OUT_JAVA_LIBRARIES)/databinding-compiler.jar
 
 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
 DEFAULT_JACK_ENABLED:=full
@@ -465,7 +471,7 @@
 # Turn off jack warnings by default.
 DEFAULT_JACK_EXTRA_ARGS += --verbose error
 
-JILL := java -Xmx3500m -jar $(JILL_JAR)
+JILL := java -jar $(JILL_JAR)
 PROGUARD := external/proguard/bin/proguard.sh
 JAVATAGS := build/tools/java-event-log-tags.py
 LLVM_RS_CC := $(HOST_OUT_EXECUTABLES)/llvm-rs-cc$(HOST_EXECUTABLE_SUFFIX)
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 23648c1..305468a 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -204,6 +204,24 @@
 
 rs_compatibility_jni_libs :=
 
+ifeq ($(LOCAL_DATA_BINDING),true)
+data_binding_intermediates := $(intermediates.COMMON)/data-binding
+
+LOCAL_JAVACFLAGS += -processorpath $(DATA_BINDING_COMPILER) -s $(data_binding_intermediates)/anno-src
+LOCAL_JACK_FLAGS += --processorpath $(DATA_BINDING_COMPILER)
+
+LOCAL_STATIC_JAVA_LIBRARIES += databinding-baselibrary
+LOCAL_STATIC_JAVA_AAR_LIBRARIES += databinding-library databinding-adapters
+
+data_binding_res_in := $(LOCAL_RESOURCE_DIR)
+data_binding_res_out := $(data_binding_intermediates)/res
+
+# Replace with the processed merged res dir.
+LOCAL_RESOURCE_DIR := $(data_binding_res_out)
+
+LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.databinding.library
+endif  # LOCAL_DATA_BINDING
+
 include $(BUILD_SYSTEM)/android_manifest.mk
 
 #################################
@@ -225,6 +243,34 @@
     PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
 endif
 
+ifeq ($(LOCAL_DATA_BINDING),true)
+data_binding_stamp := $(data_binding_intermediates)/data-binding.stamp
+$(data_binding_stamp): PRIVATE_INTERMEDIATES := $(data_binding_intermediates)
+$(data_binding_stamp): PRIVATE_MANIFEST := $(full_android_manifest)
+# Generate code into $(LOCAL_INTERMEDIATE_SOURCE_DIR) so that the generated .java files
+# will be automatically picked up by function compile-java.
+$(data_binding_stamp): PRIVATE_SRC_OUT := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/data-binding
+$(data_binding_stamp): PRIVATE_XML_OUT := $(data_binding_intermediates)/xml
+$(data_binding_stamp): PRIVATE_RES_OUT := $(data_binding_res_out)
+$(data_binding_stamp): PRIVATE_RES_IN := $(data_binding_res_in)
+$(data_binding_stamp): PRIVATE_ANNO_SRC_DIR := $(data_binding_intermediates)/anno-src
+
+$(data_binding_stamp) : $(all_res_assets) $(full_android_manifest) \
+    $(DATA_BINDING_COMPILER)
+	@echo "Data-binding process: $@"
+	@rm -rf $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) && \
+	  mkdir -p $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) \
+	      $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_ANNO_SRC_DIR)
+	$(hide) java -classpath $(DATA_BINDING_COMPILER) android.databinding.tool.MakeCopy \
+	  $(PRIVATE_MANIFEST) $(PRIVATE_SRC_OUT) $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_RES_IN)
+	$(hide) touch $@
+
+# Make sure the data-binding process happens before javac and generation of R.java.
+$(R_file_stamp) $(full_classes_compiled_jar) : $(data_binding_stamp)
+# The dependency path when jack is enabled
+$(built_dex_intermediate) : $(data_binding_stamp)
+endif  # LOCAL_DATA_BINDING
+
 ifeq ($(need_compile_res),true)
 
 # Since we don't know where the real R.java file is going to end up,
@@ -498,6 +544,18 @@
 
 # Make sure to install the splits when you run "make <module_name>".
 $(my_register_name): $(installed_apk_splits)
+
+ifdef LOCAL_COMPATIBILITY_SUITE
+cts_testcase_file := $(foreach s,$(my_split_suffixes),$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE)_$(s).apk)
+$(cts_testcase_file) : $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE)_$(s).apk : $(built_module_path)/package_%.apk | $(ACP)
+	$(copy-file-to-new-target)
+
+COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \
+  $(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \
+  $(cts_testcase_file)
+
+$(my_register_name) : $(cts_testcase_file)
+endif # LOCAL_COMPATIBILITY_SUITE
 endif # LOCAL_PACKAGE_SPLITS
 
 # Save information about this package
diff --git a/core/product_config.mk b/core/product_config.mk
index 5240ae7..64ac03a 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -149,7 +149,7 @@
 unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
 ifdef unbundled_goals
   ifneq ($(words $(unbundled_goals)),1)
-    $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
+    $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)")
   endif
   TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
   ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
diff --git a/core/tasks/cts_v2.mk b/core/tasks/cts_v2.mk
new file mode 100644
index 0000000..76a4d02
--- /dev/null
+++ b/core/tasks/cts_v2.mk
@@ -0,0 +1,23 @@
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+test_suite_name := cts_v2
+test_suite_tradefed := cts-tradefed_v2
+test_suite_readme := cts/tools/cts-tradefed/README
+
+include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
+
+.PHONY: cts_v2
+cts_v2: $(compatibility_zip)
+$(call dist-for-goals, cts_v2, $(compatibility_zip))
diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk
new file mode 100644
index 0000000..415ad7f
--- /dev/null
+++ b/core/tasks/tools/compatibility.mk
@@ -0,0 +1,43 @@
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Package up a compatibility test suite in a zip file.
+#
+# Input variables:
+#   test_suite_name: the name of this test suite eg. cts
+#   test_suite_tradefed: the name of this test suite's tradefed wrapper
+#   test_suite_readme: the path to a README file for this test suite
+# Output variables:
+#   compatibility_zip: the path to the output zip file.
+
+out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)
+test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES)
+test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/compatibility-common-util-hostsidelib.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/compatibility-tradefed.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar \
+  $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed) \
+  $(test_suite_readme)
+
+compatibility_zip := $(out_dir).zip
+$(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
+$(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
+$(compatibility_zip): PRIVATE_TOOLS := $(test_tools)
+$(compatibility_zip): $(test_artifacts) $(test_tools) | $(ADB) $(ACP)
+# Make dir structure
+	$(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
+# Copy tools
+	$(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
+	$(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index e384526..28178fe 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -41,7 +41,7 @@
   # which is the version that we reveal to the end user.
   # Update this value when the platform version changes (rather
   # than overriding it somewhere else).  Can be an arbitrary string.
-  PLATFORM_VERSION := M
+  PLATFORM_VERSION := NYC
 endif
 
 ifeq "" "$(PLATFORM_SDK_VERSION)"
@@ -59,12 +59,12 @@
 ifeq "" "$(PLATFORM_VERSION_CODENAME)"
   # This is the current development code-name, if the build is not a final
   # release build.  If this is a final release build, it is simply "REL".
-  PLATFORM_VERSION_CODENAME := MNC
+  PLATFORM_VERSION_CODENAME := NYC
 
   # This is all of the development codenames that are active.  Should be either
   # the same as PLATFORM_VERSION_CODENAME or a comma-separated list of additional
   # codenames after PLATFORM_VERSION_CODENAME.
-  PLATFORM_VERSION_ALL_CODENAMES := $(PLATFORM_VERSION_CODENAME)
+  PLATFORM_VERSION_ALL_CODENAMES := $(PLATFORM_VERSION_CODENAME),MNC
 endif
 
 ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
diff --git a/target/product/base.mk b/target/product/base.mk
index 1699156..b52695f 100644
--- a/target/product/base.mk
+++ b/target/product/base.mk
@@ -39,6 +39,9 @@
     hid \
     ime \
     input \
+    input.evdev.default \
+    inputflinger \
+    inputflingerhost \
     javax.obex \
     libandroid \
     libandroid_runtime \
@@ -56,6 +59,7 @@
     libeffects \
     libinput \
     libinputflinger \
+    libinputflingerhost \
     libiprouteutil \
     libjnigraphics \
     libldnhncr \
@@ -111,6 +115,7 @@
     run-as \
     schedtest \
     sdcard \
+    secdiscard \
     services \
     settings \
     sgdisk \
diff --git a/tools/droiddoc/templates-sac/assets/css/default.css b/tools/droiddoc/templates-sac/assets/css/default.css
index ca998f1..f5dd624 100644
--- a/tools/droiddoc/templates-sac/assets/css/default.css
+++ b/tools/droiddoc/templates-sac/assets/css/default.css
@@ -4555,3 +4555,7 @@
 .fullpage #footer {
   margin-top: -40px;
 }
+
+.annotation-message {
+  display: block;
+}
diff --git a/tools/droiddoc/templates-sac/class.cs b/tools/droiddoc/templates-sac/class.cs
index 0461af6..4003ff5 100644
--- a/tools/droiddoc/templates-sac/class.cs
+++ b/tools/droiddoc/templates-sac/class.cs
@@ -123,6 +123,7 @@
   <?cs /if ?>
   <?cs set:colspan = colspan-1 ?>
 <?cs /each ?>
+<?cs call:show_annotations_list(class, "<span class='annotation-message'>", "</span><span class='annotation-message'>", "</span>") ?>
 
 </div><!-- end header -->
 
@@ -210,7 +211,10 @@
           <?cs var:field.final ?>
           <?cs call:type_link(field.type) ?></nobr></td>
           <td class="jd-linkcol"><?cs call:cond_link(field.name, toroot, field.href, included) ?></td>
-          <td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?></td>
+          <td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?>
+              <?cs each:anno = field.showAnnotations ?>
+                  <?cs call:show_annotations_list(field, "<span class='annotation-message'>", "</span><span class='annotation-message'>", "</span>") ?>
+              <?cs /each ?></td>
       </tr>
       <?cs set:count = count + #1 ?>
     <?cs /each ?>