Merge "Update support lib to use correct current SDK"
diff --git a/Android.mk b/Android.mk
index 4abc112..0d8e2f9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -16,6 +16,7 @@
 # Don't include in unbundled build.
 ifeq ($(TARGET_BUILD_APPS),)
 
+SUPPORT_CURRENT_SDK_VERSION := current
 SUPPORT_API_CHECK := $(LOCAL_PATH)/apicheck.mk
 api_check_current_msg_file := $(LOCAL_PATH)/apicheck_msg_current.txt
 api_check_last_msg_file := $(LOCAL_PATH)/apicheck_msg_last.txt
@@ -30,6 +31,7 @@
 include $(call all-makefiles-under,$(LOCAL_PATH))
 
 # Clear out variables
+SUPPORT_CURRENT_SDK_VERSION :=
 SUPPORT_API_CHECK :=
 api_check_current_msg_file :=
 api_check_last_msg_file :=
diff --git a/annotations/Android.mk b/annotations/Android.mk
index 287eb65..c741eae 100644
--- a/annotations/Android.mk
+++ b/annotations/Android.mk
@@ -16,6 +16,6 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-annotations
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under,src)
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/apicheck.mk b/apicheck.mk
index 97146cf..7f56866 100644
--- a/apicheck.mk
+++ b/apicheck.mk
@@ -44,7 +44,7 @@
 LOCAL_JAVA_LIBRARIES := $(support_module_java_libraries)
 LOCAL_ADDITIONAL_JAVA_DIR := \
     $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),$(support_module),,COMMON)/src
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 
 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates/src
 
diff --git a/customtabs/Android.mk b/customtabs/Android.mk
index 4b68227..562463d 100644
--- a/customtabs/Android.mk
+++ b/customtabs/Android.mk
@@ -20,7 +20,7 @@
 # in their makefiles to include the resources in their package.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-customtabs
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_AIDL_INCLUDES := $LOCAL_PATH/src
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
     $(call all-Iaidl-files-under, src)
diff --git a/design/Android.mk b/design/Android.mk
index 98a1f22..e9b73b7 100644
--- a/design/Android.mk
+++ b/design/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-design-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
     frameworks/support/v7/appcompat/res \
@@ -125,7 +125,7 @@
 # in their makefiles to include the resources in their package.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-design
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
 LOCAL_JAVA_LIBRARIES := android-support-design-res \
diff --git a/documents-archive/Android.mk b/documents-archive/Android.mk
index 63e0bbd..0c7a819 100644
--- a/documents-archive/Android.mk
+++ b/documents-archive/Android.mk
@@ -20,7 +20,7 @@
 # in their makefiles to include the resources in their package.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-documents-archive
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_AIDL_INCLUDES := $LOCAL_PATH/src
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_JAVA_LIBRARIES := android-support-annotations \
diff --git a/documents-archive/tests/Android.mk b/documents-archive/tests/Android.mk
index f42b9ad..7269434 100644
--- a/documents-archive/tests/Android.mk
+++ b/documents-archive/tests/Android.mk
@@ -17,7 +17,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-documents-archive
diff --git a/graphics/drawable/Android.mk b/graphics/drawable/Android.mk
index 563ad30..cec3954 100644
--- a/graphics/drawable/Android.mk
+++ b/graphics/drawable/Android.mk
@@ -17,7 +17,7 @@
 #static vector drawable library
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-vectordrawable
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, static/src)
 
 LOCAL_JAVA_LIBRARIES := android-support-v4
@@ -27,7 +27,7 @@
 #Animated vector drawable library
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-animatedvectordrawable
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, animated/src)
 
 LOCAL_JAVA_LIBRARIES := android-support-v4 android-support-vectordrawable
diff --git a/percent/Android.mk b/percent/Android.mk
index bc268c3..5c5129e 100644
--- a/percent/Android.mk
+++ b/percent/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-percent-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
 LOCAL_JAR_EXCLUDE_FILES := none
diff --git a/previewsdk/Android.mk b/previewsdk/Android.mk
index 95f5dba..f8806fa 100644
--- a/previewsdk/Android.mk
+++ b/previewsdk/Android.mk
@@ -26,7 +26,7 @@
 		bash $< > $@
 
 LOCAL_MODULE := android-support-previewsdk
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_GENERATED_SOURCES := $(previewsdk_gen_java_files)
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/v13/Android.mk b/v13/Android.mk
index c61b112..946d1f8 100644
--- a/v13/Android.mk
+++ b/v13/Android.mk
@@ -35,7 +35,7 @@
 # A helper sub-library that makes direct use of MNC APIs.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v13-mnc
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := 23
 LOCAL_SRC_FILES := $(call all-java-files-under, api23)
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13-ics-mr1
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/v14/preference/Android.mk b/v14/preference/Android.mk
index 6f56bac..52c1abb 100644
--- a/v14/preference/Android.mk
+++ b/v14/preference/Android.mk
@@ -14,14 +14,14 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v14-preference-res
-LOCAL_SDK_VERSION := current
 LOCAL_SRC_FILES := $(call all-java-files-under, ../../v7/preference/constants)
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_RESOURCE_DIR := \
         frameworks/support/v7/appcompat/res \
         frameworks/support/v7/preference/res \
diff --git a/v17/leanback/Android.mk b/v17/leanback/Android.mk
index 2dc78a7..b3aa72a 100644
--- a/v17/leanback/Android.mk
+++ b/v17/leanback/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH:= $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v17-leanback-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
 LOCAL_AAPT_FLAGS := \
@@ -47,7 +47,7 @@
 #  A helper sub-library that makes direct use of API 23.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v17-leanback-api23
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := 23
 LOCAL_SRC_FILES := $(call all-java-files-under, api23)
 LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/v17/preference-leanback/Android.mk b/v17/preference-leanback/Android.mk
index 14be7eb..abee094 100644
--- a/v17/preference-leanback/Android.mk
+++ b/v17/preference-leanback/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v17-preference-leanback-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := \
         frameworks/support/v7/appcompat/res \
diff --git a/v17/tests/Android.mk b/v17/tests/Android.mk
index cf446cd..7091a81 100644
--- a/v17/tests/Android.mk
+++ b/v17/tests/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/v4/Android.mk b/v4/Android.mk
index 3962b8d..75bda5e 100644
--- a/v4/Android.mk
+++ b/v4/Android.mk
@@ -234,7 +234,7 @@
 # A helper sub-library that makes direct use of V24 APIs.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v4-api24
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, api24)
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-api23
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/v7/appcompat/Android.mk b/v7/appcompat/Android.mk
index 0eb6a7b..2f2cce1 100644
--- a/v7/appcompat/Android.mk
+++ b/v7/appcompat/Android.mk
@@ -20,7 +20,7 @@
 # in their makefiles to include the resources in their package.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v7-appcompat
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under,src)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-vectordrawable
diff --git a/v7/cardview/Android.mk b/v7/cardview/Android.mk
index dcbc4c6..cdb952d 100644
--- a/v7/cardview/Android.mk
+++ b/v7/cardview/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v7-cardview-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
 LOCAL_JAR_EXCLUDE_FILES := none
diff --git a/v7/gridlayout/tests/Android.mk b/v7/gridlayout/tests/Android.mk
index 70017f0..27587d1 100644
--- a/v7/gridlayout/tests/Android.mk
+++ b/v7/gridlayout/tests/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/v7/mediarouter/Android.mk b/v7/mediarouter/Android.mk
index 3b2b18f..4392e63 100644
--- a/v7/mediarouter/Android.mk
+++ b/v7/mediarouter/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v7-mediarouter-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
 	frameworks/support/v7/appcompat/res
@@ -64,7 +64,7 @@
 # A helper sub-library that makes direct use of V24 APIs.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v7-mediarouter-api24
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, api24)
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v7-mediarouter-jellybean-mr2
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/v7/preference/Android.mk b/v7/preference/Android.mk
index 4fb0f03..601d8bd 100644
--- a/v7/preference/Android.mk
+++ b/v7/preference/Android.mk
@@ -14,14 +14,14 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# Build the resources and resource constants using the current SDK version.
+# Build the resources using the latest applicable SDK version.
 # We do this here because the final static library must be compiled with an older
 # SDK version than the resources.  The resources library and the R class that it
 # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v7-preference-res
-LOCAL_SDK_VERSION := current
 LOCAL_SRC_FILES := $(call all-java-files-under, constants)
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_RESOURCE_DIR := \
         frameworks/support/v7/appcompat/res \
         frameworks/support/v7/recyclerview/res \
diff --git a/v7/recyclerview/Android.mk b/v7/recyclerview/Android.mk
index 7b39533..9a0e502 100644
--- a/v7/recyclerview/Android.mk
+++ b/v7/recyclerview/Android.mk
@@ -14,13 +14,13 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# # Build the resources using the current SDK version.
+# # Build the resources using the latest applicable SDK version.
 # # We do this here because the final static library must be compiled with an older
 # # SDK version than the resources.  The resources library and the R class that it
 # # contains will not be linked into the final static library.
 include $(CLEAR_VARS)
 LOCAL_MODULE := android-support-v7-recyclerview-res
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
 LOCAL_AAPT_FLAGS := \
diff --git a/v7/recyclerview/tests/Android.mk b/v7/recyclerview/tests/Android.mk
index 3aba114..9c523b7 100644
--- a/v7/recyclerview/tests/Android.mk
+++ b/v7/recyclerview/tests/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)