merge in jb-release history after reset to jb-dev
diff --git a/core/build_id.mk b/core/build_id.mk
index 4d3e2f2..40bb35d 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -1,4 +1,3 @@
-
 #
 # Copyright (C) 2008 The Android Open Source Project
 #
@@ -14,9 +13,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+#
+# Defines branch-specific values.
+#
+
 # BUILD_ID is usually used to specify the branch name
 # (like "MAIN") or a branch name and a release candidate
-# (like "CRB01").  It must be a single word, and is
+# (like "TC1-RC5").  It must be a single word, and is
 # capitalized by convention.
+#
+BUILD_ID := MASTER
 
-export BUILD_ID=JRN80C
+# DISPLAY_BUILD_NUMBER should only be set for development branches,
+# If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for
+# a more descriptive BUILD_ID_DISPLAY, otherwise BUILD_ID_DISPLAY
+# is the same as BUILD_ID
+DISPLAY_BUILD_NUMBER := true
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index f3929ad..5209a04 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -122,9 +122,7 @@
 LOCAL_CTS_TEST_RUNNER:=
 LOCAL_CLANG:=
 LOCAL_ADDRESS_SANITIZER:=
-# Whether to keep the generated R/Manifest classes when building static Java library
-# with Android resource. false(default), or true
-LOCAL_KEEP_R_CLASS_IN_STATIC_JAVA_LIBRARY:=
+LOCAL_JAR_EXCLUDE_FILES:=
 
 # Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
 # iterate over thousands of entries every time.
diff --git a/core/definitions.mk b/core/definitions.mk
index f3e4966..9fe0a11 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -81,6 +81,10 @@
 # GPL module license files
 ALL_GPL_MODULE_LICENSE_FILES:=
 
+# Generated class file names for Android resource.
+# They are escaped and quoted so can be passed safely to a bash command.
+ANDROID_RESOURCE_GENERATED_CLASSES := 'R.class' 'R$$*.class' 'Manifest.class' 'Manifest$$*.class'
+
 ###########################################################
 ## Debugging; prints a variable list to stdout
 ###########################################################
@@ -1515,6 +1519,10 @@
 $(hide) rm -f $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list
 $(hide) rm -f $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq
 $(hide) rm -f $@
+$(if $(PRIVATE_JAR_EXCLUDE_FILES), $(hide) find $(PRIVATE_CLASS_INTERMEDIATES_DIR) \
+    -name $(word 1, $(PRIVATE_JAR_EXCLUDE_FILES)) \
+    $(addprefix -o -name , $(wordlist 2, 999, $(PRIVATE_JAR_EXCLUDE_FILES))) \
+    | xargs rm -rf)
 $(hide) jar $(if $(strip $(PRIVATE_JAR_MANIFEST)),-cfm,-cf) \
     $@ $(PRIVATE_JAR_MANIFEST) -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .
 $(hide) mv $(PRIVATE_CLASS_INTERMEDIATES_DIR)/newstamp $(PRIVATE_CLASS_INTERMEDIATES_DIR)/stamp
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index 367ea5f..eaa74aa 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -36,14 +36,18 @@
     ))
 
 ifneq (,$(all_resources))
-# Those files will be excluded from the built jar.
-# The R/Manifest classes should be re-generated in the app Module instead.
-# Use '' and $ escape because they will be passed to bash.
-ifneq (true,$(LOCAL_KEEP_R_CLASS_IN_STATIC_JAVA_LIBRARY))
-LOCAL_JAR_EXCLUDE_FILES := 'R.class' 'R$$*.class' 'Manifest.class' 'Manifest$$*.class'
+# By default we should remove the R/Manifest classes from a static Java library,
+# because they will be regenerated in the app that uses it.
+# But if the static Java library will be used by a library, then we may need to
+# keep the generated classes with "LOCAL_JAR_EXCLUDE_FILES := none".
+ifndef LOCAL_JAR_EXCLUDE_FILES
+LOCAL_JAR_EXCLUDE_FILES := $(ANDROID_RESOURCE_GENERATED_CLASSES)
 endif
+ifeq (none,$(LOCAL_JAR_EXCLUDE_FILES))
+LOCAL_JAR_EXCLUDE_FILES :=
 endif
-endif
+endif  # all_resources
+endif  # LOCAL_RESOURCE_DIR
 
 include $(BUILD_SYSTEM)/java_library.mk
 
@@ -107,4 +111,3 @@
 endif  # $(all_resources) not empty
 
 LOCAL_IS_STATIC_JAVA_LIBRARY :=
-LOCAL_JAR_EXCLUDE_FILES :=
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 71a86ea..0c6e9ac 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -38,11 +38,8 @@
     Phone \
     QuickSearchBox \
     Settings \
-    Sync \
     SystemUI \
-    Updater \
     CalendarProvider \
-    SyncProvider \
     bluetooth-health \
     hostapd \
     wpa_supplicant.conf