diff options
| author | 2023-02-13 11:06:57 +0000 | |
|---|---|---|
| committer | 2023-02-27 12:32:35 +0000 | |
| commit | 491c34e7272f6c29d61d8c37b2c130167e6a3fff (patch) | |
| tree | 1533d02179d3819168e513d1f9ca975558d4c076 /packages/SettingsLib/src | |
| parent | fcc74c31ae81ceebcb23d79cdf0aaa036e419838 (diff) | |
Clone profile badge resolution in settings.
Adds the mechanism to allow iconLoader library resolve badges for
clone profile alongside work profile.
Bug: 266177840
Test: Manually flashing and checking settings.
Change-Id: I8c5814d165a440574d3728cb552d48af07901a86
Diffstat (limited to 'packages/SettingsLib/src')
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/Utils.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/Utils.java b/packages/SettingsLib/src/com/android/settingslib/Utils.java index 888b09fafd3b..e846480f68d9 100644 --- a/packages/SettingsLib/src/com/android/settingslib/Utils.java +++ b/packages/SettingsLib/src/com/android/settingslib/Utils.java @@ -575,9 +575,15 @@ public class Utils { /** Get the corresponding adaptive icon drawable. */ public static Drawable getBadgedIcon(Context context, Drawable icon, UserHandle user) { + UserManager um = context.getSystemService(UserManager.class); + boolean isClone = um.getProfiles(user.getIdentifier()).stream() + .anyMatch(profile -> + profile.isCloneProfile() && profile.id == user.getIdentifier()); try (IconFactory iconFactory = IconFactory.obtain(context)) { return iconFactory - .createBadgedIconBitmap(icon, new IconOptions().setUser(user)) + .createBadgedIconBitmap( + icon, + new IconOptions().setUser(user).setIsCloneProfile(isClone)) .newIcon(context); } } |