Merge "SettingsLib: Build with AAPT2" into nyc-dev am: 0b1a203

am: d699f72

* commit 'd699f726ceb3373a1f8158c2a9d42a035d4c4164':
  SettingsLib: Build with AAPT2

Change-Id: I27f4af8d2d11ebdfe50c29aebd36334fb39e5a8e
This commit is contained in:
Adam Lesinski
2016-04-16 07:08:59 +00:00
committed by android-build-merger
5 changed files with 25 additions and 13 deletions

View File

@@ -1,24 +1,21 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_USE_AAPT2 := true
LOCAL_MODULE := SettingsLib
LOCAL_STATIC_JAVA_LIBRARIES := \
LOCAL_SHARED_ANDROID_LIBRARIES := \
android-support-v4 \
android-support-v7-recyclerview \
android-support-v7-preference \
android-support-v7-appcompat \
android-support-v14-preference
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
frameworks/support/v7/preference/res \
frameworks/support/v14/preference/res \
frameworks/support/v7/appcompat/res \
frameworks/support/v7/recyclerview/res
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_JAR_EXCLUDE_FILES := none
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_AAPT_FLAGS := --auto-add-overlay \
--extra-packages android.support.v7.preference:android.support.v14.preference:android.support.v17.preference:android.support.v7.appcompat:android.support.v7.recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)

View File

@@ -13,6 +13,16 @@
# include frameworks/base/packages/SettingsLib/common.mk
#
ifeq ($(LOCAL_USE_AAPT2),true)
LOCAL_STATIC_ANDROID_LIBRARIES += \
android-support-annotations \
android-support-v4 \
SettingsLib
else
LOCAL_RESOURCE_DIR += $(call my-dir)/res
LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.settingslib
LOCAL_STATIC_JAVA_LIBRARIES += SettingsLib
LOCAL_STATIC_JAVA_LIBRARIES += \
android-support-annotations \
android-support-v4 \
SettingsLib
endif

View File

@@ -46,7 +46,8 @@ public class RestrictedPreference extends Preference {
}
public RestrictedPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceStyle,
this(context, attrs, TypedArrayUtils.getAttr(context,
android.support.v7.preference.R.attr.preferenceStyle,
android.R.attr.preferenceStyle));
}

View File

@@ -65,7 +65,8 @@ public class RestrictedSwitchPreference extends SwitchPreference {
}
public RestrictedSwitchPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.switchPreferenceStyle,
this(context, attrs, TypedArrayUtils.getAttr(context,
android.support.v7.preference.R.attr.switchPreferenceStyle,
android.R.attr.switchPreferenceStyle));
}

View File

@@ -136,6 +136,9 @@ bool ManifestFixer::buildRules(xml::XmlActionExecutor* executor, IDiagnostics* d
return true;
});
// Meta tags.
manifestAction[u"eat-comment"];
// Uses-sdk actions.
manifestAction[u"uses-sdk"].action([&](xml::Element* el) -> bool {
if (mOptions.minSdkVersionDefault &&
@@ -168,7 +171,7 @@ bool ManifestFixer::buildRules(xml::XmlActionExecutor* executor, IDiagnostics* d
return true;
});
manifestAction[u"eat-comment"];
manifestAction[u"original-package"];
manifestAction[u"protected-broadcast"];
manifestAction[u"uses-permission"];
manifestAction[u"permission"];