Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56f49807 authored by Jakob Schneider's avatar Jakob Schneider Committed by Android (Google) Code Review
Browse files

Merge "Fix issue where we show a white icon instead of the default icon if the...

Merge "Fix issue where we show a white icon instead of the default icon if the archived app icon is missing." into main
parents a793774a 6c58aaa9
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.LauncherIcons;
import android.util.Log;
import android.util.Slog;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.Immutable;
@@ -4047,11 +4048,16 @@ public class ApplicationPackageManager extends PackageManager {
    @Nullable
    private Drawable getArchivedAppIcon(String packageName) {
        try {
            return new BitmapDrawable(null,
                    mPM.getArchivedAppIcon(packageName, new UserHandle(getUserId()),
                            mContext.getPackageName()));
            Bitmap archivedAppIcon = mPM.getArchivedAppIcon(packageName,
                    new UserHandle(getUserId()),
                    mContext.getPackageName());
            if (archivedAppIcon == null) {
                return null;
            }
            return new BitmapDrawable(null, archivedAppIcon);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
            Slog.e(TAG, "Failed to retrieve archived app icon: " + e.getMessage());
            return null;
        }
    }