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

Unverified Commit ba512fe1 authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-13.0.0_r76' of...

Merge tag 'android-13.0.0_r76' of https://android.googlesource.com/platform/packages/apps/Launcher3 into staging/lineage-20.0_merge-android-13.0.0_r75

Android 13.0.0 release 76

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZQiTAgAKCRDorT+BmrEO
# eL32AJ4mzhwQ5hzDKBun9MpG2lj2pCa+qACfSf9S3JULAAXq7acBTg+J/DlT4tk=
# =Hxld
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Sep 18 21:12:18 2023 EEST
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [marginal]
# gpg: initial-contribution@android.com: Verified 1890 signatures in the past
#      22 months.  Encrypted 4 messages in the past 20 months.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By Sunny Goyal
# Via Android Build Coastguard Worker
* tag 'android-13.0.0_r76' of https://android.googlesource.com/platform/packages/apps/Launcher3:
  Fixing syntax error due to java-version changes
  Fixing icon cache thrashing due to an unsupported icon

Change-Id: If57155e502d8ad93da39155d2d8d8dc5512f87b4
parents a2180205 1cf9d7d0
Loading
Loading
Loading
Loading
+23 −11
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ public class IconCache extends BaseIconCache {
    private final UserCache mUserManager;
    private final InstantAppResolver mInstantAppResolver;
    private final IconProvider mIconProvider;
    private final HandlerRunnable mCancelledRunnable;

    private final SparseArray<BitmapInfo> mWidgetCategoryBitmapInfos;

@@ -121,6 +122,10 @@ public class IconCache extends BaseIconCache {
        mInstantAppResolver = InstantAppResolver.newInstance(mContext);
        mIconProvider = iconProvider;
        mWidgetCategoryBitmapInfos = new SparseArray<>();

        mCancelledRunnable = new HandlerRunnable(
                mWorkerHandler, () -> null, MAIN_EXECUTOR, c -> { });
        mCancelledRunnable.cancel();
    }

    @Override
@@ -176,23 +181,30 @@ public class IconCache extends BaseIconCache {
    public HandlerRunnable updateIconInBackground(final ItemInfoUpdateReceiver caller,
            final ItemInfoWithIcon info) {
        Preconditions.assertUIThread();
        Supplier<ItemInfoWithIcon> task;
        if (info instanceof AppInfo || info instanceof WorkspaceItemInfo) {
            task = () -> {
                getTitleAndIcon(info, false);
                return info;
            };
        } else if (info instanceof PackageItemInfo) {
            task = () -> {
                getTitleAndIconForApp((PackageItemInfo) info, false);
                return info;
            };
        } else {
            Log.i(TAG, "Icon update not supported for "
                    + info == null ? "null" : info.getClass().getName());
            return mCancelledRunnable;
        }

        if (mPendingIconRequestCount <= 0) {
            MODEL_EXECUTOR.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
        }
        mPendingIconRequestCount++;

        HandlerRunnable<ItemInfoWithIcon> request = new HandlerRunnable<>(mWorkerHandler,
                () -> {
                    if (info instanceof AppInfo || info instanceof WorkspaceItemInfo) {
                        getTitleAndIcon(info, false);
                    } else if (info instanceof PackageItemInfo) {
                        getTitleAndIconForApp((PackageItemInfo) info, false);
                    }
                    return info;
                },
                MAIN_EXECUTOR,
                caller::reapplyItemInfo,
                this::onIconRequestEnd);
                task, MAIN_EXECUTOR, caller::reapplyItemInfo, this::onIconRequestEnd);
        Utilities.postAsyncCallback(mWorkerHandler, request);
        return request;
    }