OSDN Git Service

ApplicationPackageManager should fetch Resource from non system context
authorHyunyoung Song <hyunyoungs@google.com>
Tue, 12 Mar 2019 21:17:30 +0000 (14:17 -0700)
committerHyunyoung Song <hyunyoungs@google.com>
Thu, 14 Mar 2019 20:27:34 +0000 (13:27 -0700)
Test: builds and manually verified on device
Test: change theme inside ThemePicker and default icon color changes

Bug: 128445995
Bug: 128447895

Change-Id: I184534c9ecea52fa381ffa6cd1e9ba53134766ca

core/java/android/app/ApplicationPackageManager.java
core/res/res/drawable/sym_def_app_icon_background.xml

index d3e3507..bd47c9e 100644 (file)
@@ -1301,8 +1301,7 @@ public class ApplicationPackageManager extends PackageManager {
     }
 
     @Override public Drawable getDefaultActivityIcon() {
-        return Resources.getSystem().getDrawable(
-            com.android.internal.R.drawable.sym_def_app_icon);
+        return mContext.getDrawable(com.android.internal.R.drawable.sym_def_app_icon);
     }
 
     @Override public Drawable getApplicationIcon(ApplicationInfo info) {
@@ -1440,7 +1439,7 @@ public class ApplicationPackageManager extends PackageManager {
         if (density <= 0) {
             density = mContext.getResources().getDisplayMetrics().densityDpi;
         }
-        return Resources.getSystem().getDrawableForDensity(drawableId, density);
+        return mContext.getResources().getDrawableForDensity(drawableId, density);
     }
 
     private Drawable getManagedProfileIconForDensity(UserHandle user, int drawableId, int density) {
index 5755210..17b592f 100644 (file)
@@ -5,7 +5,7 @@
     android:viewportHeight="108.0"
     android:viewportWidth="108.0"
     xmlns:android="http://schemas.android.com/apk/res/android">
-    <path android:fillColor="@android:color/material_deep_teal_500"
+    <path android:fillColor="@android:color/accent_device_default_light"
         android:pathData="M0,0h108v108h-108z"
         android:strokeColor="#66FFFFFF" android:strokeWidth="0.8"/>
     <path android:fillColor="#00000000" android:pathData="M19,0L19,108"