Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ff3ad63 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

SettingsLib: Build with AAPT2

Bug:22775504
Change-Id: I2e5015235384d124418d32186daa190f38e1c5b3
parent b5abb78b
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
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_SRC_FILES := $(call all-java-files-under, src)
LOCAL_JAR_EXCLUDE_FILES := none

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
LOCAL_SRC_FILES := $(call all-java-files-under, src)

include $(BUILD_STATIC_JAVA_LIBRARY)
+11 −1
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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));
    }

+2 −1
Original line number Diff line number Diff line
@@ -47,7 +47,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));
    }

+4 −1
Original line number Diff line number Diff line
@@ -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"];