Browse Source

Updates to match prebuilts drop

Test: build
Bug: 77482321
Change-Id: I65a2cffb0a921ef6acb58ff500a7da8a8f870e76
Jason Monk 1 year ago
parent
commit
20210122bd

+ 1
- 0
Android.mk View File

@@ -24,6 +24,7 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \
24 24
     android-slices-builders \
25 25
     android-slices-core \
26 26
     android-slices-view \
27
+    android-support-compat \
27 28
     android-support-v4 \
28 29
     android-support-v13 \
29 30
     android-support-v7-appcompat \

+ 2
- 1
AndroidManifest.xml View File

@@ -105,7 +105,8 @@
105 105
             android:allowBackup="false"
106 106
             android:usesCleartextTraffic="true"
107 107
             android:defaultToDeviceProtectedStorage="true"
108
-            android:directBootAware="true">
108
+            android:directBootAware="true"
109
+            android:appComponentFactory="android.support.v4.app.CoreComponentFactory">
109 110
 
110 111
         <uses-library android:name="org.apache.http.legacy" />
111 112
         <!-- Settings -->

+ 1
- 0
proguard.flags View File

@@ -51,3 +51,4 @@
51 51
     public static ** SEARCH_INDEX_DATA_PROVIDER;
52 52
     public static ** SUMMARY_PROVIDER_FACTORY;
53 53
 }
54
+-keep class android.support.v4.app.CoreComponentFactory

+ 3
- 1
src/com/android/settings/slices/SettingsSliceProvider.java View File

@@ -24,6 +24,7 @@ import android.graphics.drawable.Icon;
24 24
 import android.net.Uri;
25 25
 import android.net.wifi.WifiManager;
26 26
 import android.support.annotation.VisibleForTesting;
27
+import android.support.v4.graphics.drawable.IconCompat;
27 28
 import android.util.Log;
28 29
 
29 30
 import com.android.settings.R;
@@ -203,7 +204,8 @@ public class SettingsSliceProvider extends SliceProvider {
203 204
                         .addEndItem(new SliceAction(getBroadcastIntent(ACTION_WIFI_CHANGED),
204 205
                                 null, finalWifiEnabled))
205 206
                         .setPrimaryAction(
206
-                                new SliceAction(getIntent(Intent.ACTION_MAIN), null, null)))
207
+                                new SliceAction(getIntent(Intent.ACTION_MAIN),
208
+                                        (IconCompat) null, null)))
207 209
                 .build();
208 210
     }
209 211
 

+ 8
- 6
src/com/android/settings/slices/SliceBuilderUtils.java View File

@@ -45,6 +45,7 @@ import com.android.settings.core.TogglePreferenceController;
45 45
 import com.android.settings.search.DatabaseIndexingUtils;
46 46
 import com.android.settingslib.core.AbstractPreferenceController;
47 47
 
48
+import android.support.v4.graphics.drawable.IconCompat;
48 49
 import androidx.slice.Slice;
49 50
 import androidx.slice.builders.SliceAction;
50 51
 import androidx.slice.builders.ListBuilder;
@@ -164,7 +165,7 @@ public class SliceBuilderUtils {
164 165
                         .setTitle(sliceData.getTitle())
165 166
                         .setTitleItem(icon, ICON_IMAGE)
166 167
                         .setSubtitle(subtitleText)
167
-                        .setPrimaryAction(new SliceAction(contentIntent, null, null))
168
+                        .setPrimaryAction(new SliceAction(contentIntent, (IconCompat) null, null))
168 169
                         .addEndItem(sliceAction))
169 170
                 .build();
170 171
     }
@@ -180,7 +181,7 @@ public class SliceBuilderUtils {
180 181
                         .setTitle(sliceData.getTitle())
181 182
                         .setTitleItem(icon, ICON_IMAGE)
182 183
                         .setSubtitle(subtitleText)
183
-                        .setPrimaryAction(new SliceAction(contentIntent, null, null)))
184
+                        .setPrimaryAction(new SliceAction(contentIntent, (IconCompat) null, null)))
184 185
                 .build();
185 186
     }
186 187
 
@@ -284,24 +285,25 @@ public class SliceBuilderUtils {
284 285
         switch (controller.getAvailabilityStatus()) {
285 286
             case DISABLED_UNSUPPORTED:
286 287
                 summary = context.getString(R.string.unsupported_setting_summary);
287
-                primaryAction = new SliceAction(getSettingsIntent(context), null /* actionIcon */,
288
+                primaryAction = new SliceAction(getSettingsIntent(context),
289
+                        (IconCompat) null /* actionIcon */,
288 290
                         null /* actionTitle */);
289 291
                 break;
290 292
             case DISABLED_FOR_USER:
291 293
                 summary = context.getString(R.string.disabled_for_user_setting_summary);
292 294
                 primaryAction = new SliceAction(getContentIntent(context, data),
293
-                        null /* actionIcon */, null /* actionTitle */);
295
+                        (IconCompat) null /* actionIcon */, null /* actionTitle */);
294 296
                 break;
295 297
             case DISABLED_DEPENDENT_SETTING:
296 298
                 summary = context.getString(R.string.disabled_dependent_setting_summary);
297 299
                 primaryAction = new SliceAction(getContentIntent(context, data),
298
-                        null /* actionIcon */, null /* actionTitle */);
300
+                        (IconCompat) null /* actionIcon */, null /* actionTitle */);
299 301
                 break;
300 302
             case UNAVAILABLE_UNKNOWN:
301 303
             default:
302 304
                 summary = context.getString(R.string.unknown_unavailability_setting_summary);
303 305
                 primaryAction = new SliceAction(getSettingsIntent(context),
304
-                        null /* actionIcon */, null /* actionTitle */);
306
+                        (IconCompat) null /* actionIcon */, null /* actionTitle */);
305 307
         }
306 308
 
307 309
         return new ListBuilder(context, data.getUri())