mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Making LauncherIcons thread safe
Creating a pool of LauncherIcons so that they can be used from multiple threads Change-Id: Idc7b5ddb47b6e338a5389f3c4faa6f63de108c72
This commit is contained in:
@@ -215,9 +215,10 @@ public class LoaderTask implements Runnable {
|
||||
|
||||
public void loadUiResources() {
|
||||
if (Utilities.ATLEAST_OREO) {
|
||||
ClickShadowView.setAdaptiveIconScaleFactor(
|
||||
IconNormalizer.getInstance(mApp.getContext()).getScale(
|
||||
new AdaptiveIconDrawable(null, null), null, null, null));
|
||||
LauncherIcons li = LauncherIcons.obtain(mApp.getContext());
|
||||
ClickShadowView.setAdaptiveIconScaleFactor(li.getNormalizer()
|
||||
.getScale(new AdaptiveIconDrawable(null, null), null, null, null));
|
||||
li.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,8 +477,10 @@ public class LoaderTask implements Runnable {
|
||||
? finalInfo.iconBitmap : null;
|
||||
}
|
||||
};
|
||||
LauncherIcons.createShortcutIcon(pinnedShortcut, context,
|
||||
LauncherIcons li = LauncherIcons.obtain(context);
|
||||
li.createShortcutIcon(pinnedShortcut,
|
||||
true /* badged */, fallbackIconProvider).applyTo(info);
|
||||
li.recycle();
|
||||
if (pmHelper.isAppSuspended(
|
||||
pinnedShortcut.getPackage(), info.user)) {
|
||||
info.runtimeStatusFlags |= FLAG_DISABLED_SUSPENDED;
|
||||
|
||||
Reference in New Issue
Block a user