Loading services/core/java/com/android/server/pm/PackageArchiver.java +6 −2 Original line number Diff line number Diff line Loading @@ -819,6 +819,7 @@ public class PackageArchiver { * <p> The icon is returned without any treatment/overlay. In the rare case the app had multiple * launcher activities, only one of the icons is returned arbitrarily. */ @Nullable public Bitmap getArchivedAppIcon(@NonNull String packageName, @NonNull UserHandle user, String callingPackageName) { Objects.requireNonNull(packageName); Loading @@ -844,7 +845,7 @@ public class PackageArchiver { // In the rare case the archived app defined more than two launcher activities, we choose // the first one arbitrarily. Bitmap icon = decodeIcon(archiveState.getActivityInfos().get(0)); if (getAppOpsManager().checkOp( if (icon != null && getAppOpsManager().checkOp( AppOpsManager.OP_ARCHIVE_ICON_OVERLAY, callingUid, callingPackageName) == MODE_ALLOWED) { icon = includeCloudOverlay(icon); Loading Loading @@ -900,6 +901,7 @@ public class PackageArchiver { return bitmap; } @Nullable Bitmap includeCloudOverlay(Bitmap bitmap) { Drawable cloudDrawable = mContext.getResources() Loading @@ -920,7 +922,9 @@ public class PackageArchiver { final int iconSize = mContext.getSystemService( ActivityManager.class).getLauncherLargeIconSize(); Bitmap appIconWithCloudOverlay = drawableToBitmap(layerDrawable, iconSize); if (bitmap != null) { bitmap.recycle(); } return appIconWithCloudOverlay; } Loading Loading
services/core/java/com/android/server/pm/PackageArchiver.java +6 −2 Original line number Diff line number Diff line Loading @@ -819,6 +819,7 @@ public class PackageArchiver { * <p> The icon is returned without any treatment/overlay. In the rare case the app had multiple * launcher activities, only one of the icons is returned arbitrarily. */ @Nullable public Bitmap getArchivedAppIcon(@NonNull String packageName, @NonNull UserHandle user, String callingPackageName) { Objects.requireNonNull(packageName); Loading @@ -844,7 +845,7 @@ public class PackageArchiver { // In the rare case the archived app defined more than two launcher activities, we choose // the first one arbitrarily. Bitmap icon = decodeIcon(archiveState.getActivityInfos().get(0)); if (getAppOpsManager().checkOp( if (icon != null && getAppOpsManager().checkOp( AppOpsManager.OP_ARCHIVE_ICON_OVERLAY, callingUid, callingPackageName) == MODE_ALLOWED) { icon = includeCloudOverlay(icon); Loading Loading @@ -900,6 +901,7 @@ public class PackageArchiver { return bitmap; } @Nullable Bitmap includeCloudOverlay(Bitmap bitmap) { Drawable cloudDrawable = mContext.getResources() Loading @@ -920,7 +922,9 @@ public class PackageArchiver { final int iconSize = mContext.getSystemService( ActivityManager.class).getLauncherLargeIconSize(); Bitmap appIconWithCloudOverlay = drawableToBitmap(layerDrawable, iconSize); if (bitmap != null) { bitmap.recycle(); } return appIconWithCloudOverlay; } Loading