fix: Apply icon packs to work/private profile apps (#6990)

* fix: Apply icon packs to work/private profile apps

Resolve components via ActivityInfo/LauncherApps instead of
getLaunchIntentForPackage, and harden icon customization for
non-current users. Also restore work badges when themed icons are off.

Fixes #5202
Fixes #4988

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: Cache getActivityList result in SelectIconPreference

Avoid a redundant LauncherApps IPC when resolving work/private app labels.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Pavel VolkovandCursor authored and GitHub committed 2026-07-13 13:47:14 +08:00
1 parent 5aa1fb41ce
commit 2b24fe9966
4 files changed
+83 -9

No files matched your search

@@ -16,7 +16,6 @@
package com.android.launcher3.model.data;
import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
import android.content.Context;
@@ -324,7 +323,8 @@ public abstract class ItemInfoWithIcon extends ItemInfo {
*/
public FastBitmapDrawable newIcon(Context context) {
var shouldTheme = PreferenceManager.getInstance(context).getThemedIcons().get();
return newIcon(context, shouldTheme ? BitmapInfo.FLAG_THEMED : BitmapInfo.FLAG_NO_BADGE);
// Use 0 (not FLAG_NO_BADGE) when theming is off so work/clone profile badges still draw.
return newIcon(context, shouldTheme ? FLAG_THEMED : 0);
}
/**