OSDN Git Service

DO NOT MERGE Clean up SettingsLib dependencies
authorAlan Viverette <alanv@google.com>
Wed, 21 Mar 2018 19:07:32 +0000 (15:07 -0400)
committerAlan Viverette <alanv@google.com>
Sat, 24 Mar 2018 00:27:39 +0000 (00:27 +0000)
v14-preferences is an empty lib and libraries cannot directly
reference other libraries' R classes due to a bug in Make builds

Bug: 73250914
Bug: 74248169
Test: make && make checkbuild
Change-Id: Id156b2a2140cabc98b58b5312ea28da42f4ca63b

packages/SettingsLib/Android.mk
packages/SettingsLib/res/values/attrs.xml
packages/SettingsLib/src/com/android/settingslib/RestrictedPreference.java
packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java

index 4338d26..859f86f 100644 (file)
@@ -13,7 +13,6 @@ LOCAL_SHARED_ANDROID_LIBRARIES := \
     android-support-v7-recyclerview \
     android-support-v7-preference \
     android-support-v7-appcompat \
-    android-support-v14-preference \
     android-arch-lifecycle-runtime
 
 LOCAL_SHARED_JAVA_LIBRARIES := \
index a8a1793..9aed54e 100644 (file)
@@ -48,4 +48,8 @@
 
     <attr name="footerPreferenceStyle" format="reference" />
 
+    <!-- Workaround for b/74248169. These are duplicates of attrs in AndroidX preferences. -->
+    <attr name="preferenceStyle" format="reference" />
+    <attr name="switchPreferenceStyle" format="reference" />
+
 </resources>
index 9f21dd2..b4a3b51 100644 (file)
@@ -44,8 +44,7 @@ public class RestrictedPreference extends TwoTargetPreference {
     }
 
     public RestrictedPreference(Context context, AttributeSet attrs) {
-        this(context, attrs, TypedArrayUtils.getAttr(context,
-                android.support.v7.preference.R.attr.preferenceStyle,
+        this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceStyle,
                 android.R.attr.preferenceStyle));
     }
 
index 1ad710a..48b7c35 100644 (file)
@@ -82,8 +82,7 @@ public class RestrictedSwitchPreference extends SwitchPreference {
     }
 
     public RestrictedSwitchPreference(Context context, AttributeSet attrs) {
-        this(context, attrs, TypedArrayUtils.getAttr(context,
-                android.support.v7.preference.R.attr.switchPreferenceStyle,
+        this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.switchPreferenceStyle,
                 android.R.attr.switchPreferenceStyle));
     }