Loading packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -82,8 +82,11 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen private void setTileIcon() { private void setTileIcon() { try { try { PackageManager pm = mContext.getPackageManager(); PackageManager pm = mContext.getPackageManager(); ServiceInfo info = pm.getServiceInfo(mComponent, int flags = PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE; PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE); if (isSystemApp(pm)) { flags |= PackageManager.MATCH_DISABLED_COMPONENTS; } ServiceInfo info = pm.getServiceInfo(mComponent, flags); int icon = info.icon != 0 ? info.icon int icon = info.icon != 0 ? info.icon : info.applicationInfo.icon; : info.applicationInfo.icon; // Update the icon if its not set or is the default icon. // Update the icon if its not set or is the default icon. Loading @@ -103,6 +106,10 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen } } } } private boolean isSystemApp(PackageManager pm) throws PackageManager.NameNotFoundException { return pm.getApplicationInfo(mComponent.getPackageName(), 0).isSystemApp(); } /** /** * Compare two icons, only works for resources. * Compare two icons, only works for resources. */ */ Loading Loading
packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -82,8 +82,11 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen private void setTileIcon() { private void setTileIcon() { try { try { PackageManager pm = mContext.getPackageManager(); PackageManager pm = mContext.getPackageManager(); ServiceInfo info = pm.getServiceInfo(mComponent, int flags = PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE; PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE); if (isSystemApp(pm)) { flags |= PackageManager.MATCH_DISABLED_COMPONENTS; } ServiceInfo info = pm.getServiceInfo(mComponent, flags); int icon = info.icon != 0 ? info.icon int icon = info.icon != 0 ? info.icon : info.applicationInfo.icon; : info.applicationInfo.icon; // Update the icon if its not set or is the default icon. // Update the icon if its not set or is the default icon. Loading @@ -103,6 +106,10 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen } } } } private boolean isSystemApp(PackageManager pm) throws PackageManager.NameNotFoundException { return pm.getApplicationInfo(mComponent.getPackageName(), 0).isSystemApp(); } /** /** * Compare two icons, only works for resources. * Compare two icons, only works for resources. */ */ Loading