Java Code Examples for android.content.pm.PackageItemInfo#loadDefaultIcon()
The following examples show how to use
android.content.pm.PackageItemInfo#loadDefaultIcon() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 2
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 3
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 4
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon( mContext.getResources(), itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 5
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 6
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 7
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 8
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(@NonNull PackageItemInfo itemInfo, @Nullable ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { // Indicates itemInfo is for a different user (e.g. a profile's parent), so use a // generic user icon (users generally lack permission to view each other's actual icons) int targetUserId = itemInfo.showUserIcon; return UserIcons.getDefaultUserIcon( mContext.getResources(), targetUserId, /* light= */ false); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null && itemInfo != appInfo && appInfo != null) { dr = loadUnbadgedItemIcon(appInfo, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 9
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }
Example 10
Source File: ApplicationPackageManager.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
/** * @hide */ public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) { if (itemInfo.showUserIcon != UserHandle.USER_NULL) { Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon); if (bitmap == null) { return UserIcons.getDefaultUserIcon( mContext.getResources(), itemInfo.showUserIcon, /* light= */ false); } return new BitmapDrawable(bitmap); } Drawable dr = null; if (itemInfo.packageName != null) { dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo); } if (dr == null) { dr = itemInfo.loadDefaultIcon(this); } return dr; }