Exclude dynamic shortcuts from being force themed

Test: Manual
Bug: 397501448
Flag: com.android.launcher3.force_monochrome_app_icons
Change-Id: Iff1010e268c99ce192e1445ec124229c84420b23
This commit is contained in:
Sihua Ma committed 2025-02-19 18:16:10 +00:00
1 parent c7e545674d
commit 097efdc8ac
3 files changed
+21 -2

No files matched your search

@@ -30,6 +30,7 @@ import com.android.launcher3.icons.BaseIconFactory.IconOptions
import com.android.launcher3.icons.cache.BaseIconCache
import com.android.launcher3.icons.cache.CachingLogic
import com.android.launcher3.shortcuts.ShortcutKey
import com.android.launcher3.util.ApiWrapper
import com.android.launcher3.util.ApplicationInfoWrapper
import com.android.launcher3.util.PackageUserKey
import com.android.launcher3.util.Themes
@@ -114,7 +115,15 @@ object CacheableShortcutCachingLogic : CachingLogic<CacheableShortcutInfo> {
d,
IconOptions()
.setExtractedColor(Themes.getColorAccent(context))
.setSourceHint(getSourceHint(info, cache)),
.setSourceHint(
getSourceHint(info, cache)
.copy(
isFileDrawable =
ApiWrapper.INSTANCE[context].isFileDrawable(
info.shortcutInfo
)
)
),
)
} ?: BitmapInfo.LOW_RES_INFO
}
@@ -216,6 +216,13 @@ public class ApiWrapper {
return 0;
}
/**
* Checks if the shortcut is using an icon with file or URI source
*/
public boolean isFileDrawable(@NonNull ShortcutInfo shortcutInfo) {
return false;
}
private static class NoopDrawable extends ColorDrawable {
@Override
public int getIntrinsicHeight() {