Resources res = packageManager.getResourcesForApplication(
iconResource.packageName);
icon = res.getDrawable(res.getIdentifier(
- iconResource.resourceName, null, null));
+ iconResource.resourceName, null, null), null);
} catch (NameNotFoundException e) {
// Ignore
}
try {
if (desc.iconId != 0) {
Context authContext = context.createPackageContext(desc.packageName, 0);
- icon = authContext.getResources().getDrawable(desc.iconId);
+ icon = authContext.getDrawable(desc.iconId);
}
} catch (PackageManager.NameNotFoundException e) {
Log.w(TAG, "No icon for account type " + desc.type);
int resId = getResourceId();
if (resId != 0) {
try {
- Drawable d = resources.getDrawable(resId);
+ Drawable d = getDrawable(resId);
// set to false if the width or height is <= 2
// (missing PNG can return an empty 2x2 pixel Drawable)
regulatoryInfoDrawableExists = (d.getIntrinsicWidth() > 2
UserInfo userInfo = um.getUserInfo(mUserHandle.getIdentifier());
if (userInfo.isManagedProfile()) {
name = context.getString(R.string.managed_user_title);
- icon = Resources.getSystem().getDrawable(
+ icon = context.getDrawable(
com.android.internal.R.drawable.ic_corp_icon);
} else {
name = userInfo.name;
Bundle metaData = resolveInfo.activityInfo.metaData;
if (res != null && metaData != null) {
- icon = res.getDrawable(metaData.getInt(META_DATA_PREFERENCE_ICON));
+ icon = res.getDrawable(
+ metaData.getInt(META_DATA_PREFERENCE_ICON), null);
title = res.getString(metaData.getInt(META_DATA_PREFERENCE_TITLE));
summary = res.getString(metaData.getInt(META_DATA_PREFERENCE_SUMMARY));
}
ImageView imageView = (ImageView) capabilityView.findViewById(
com.android.internal.R.id.perm_icon);
- imageView.setImageDrawable(getResources().getDrawable(
+ imageView.setImageDrawable(getActivity().getDrawable(
com.android.internal.R.drawable.ic_text_dot));
TextView labelView = (TextView) capabilityView.findViewById(
imageView = (ImageView) capabilityView.findViewById(
com.android.internal.R.id.perm_icon);
- imageView.setImageDrawable(getResources().getDrawable(
+ imageView.setImageDrawable(getActivity().getDrawable(
com.android.internal.R.drawable.ic_text_dot));
labelView = (TextView) capabilityView.findViewById(
Context authContext = context.createPackageContextAsUser(desc.packageName, 0,
mUserHandle);
icon = mContext.getPackageManager().getUserBadgedIcon(
- authContext.getResources().getDrawable(desc.iconId), mUserHandle);
+ authContext.getDrawable(desc.iconId), mUserHandle);
synchronized (mAccTypeIconCache) {
mAccTypeIconCache.put(accountType, icon);
}
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
Context authContext = createPackageContextAsUser(desc.packageName, 0, mUserHandle);
icon = getPackageManager().getUserBadgedIcon(
- authContext.getResources().getDrawable(desc.iconId), mUserHandle);
+ authContext.getDrawable(desc.iconId), mUserHandle);
} catch (PackageManager.NameNotFoundException e) {
// TODO: place holder icon for missing account icons?
Log.w(TAG, "No icon name for account type " + accountType);
return mIcon;
}
- return mState.mContext.getResources().getDrawable(
+ return mState.mContext.getDrawable(
android.R.drawable.sym_def_app_icon);
}
return true;
} else {
this.mounted = false;
- this.icon = context.getResources().getDrawable(
+ this.icon = context.getDrawable(
com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon);
}
} else if (!this.mounted) {
return constState.newDrawable();
}
}
- return context.getResources().getDrawable(
+ return context.getDrawable(
com.android.internal.R.drawable.ic_menu_cc);
}
}
int iconResource = profile.getDrawableResource(mCachedDevice.getBtClass());
if (iconResource != 0) {
- pref.setIcon(getResources().getDrawable(iconResource));
+ pref.setIcon(getActivity().getDrawable(iconResource));
}
refreshProfilePreference(pref, profile);
break;
}
if (iconId > 0) {
- icon = context.getResources().getDrawable(iconId);
+ icon = context.getDrawable(iconId);
}
if ((name == null || iconId == 0) && this.sipper.uidObj != null) {
getQuickNameIconForUid(this.sipper.uidObj);
name = context.getResources().getString(R.string.process_mediaserver_label);
}
iconId = R.drawable.ic_power_system;
- icon = context.getResources().getDrawable(iconId);
+ icon = context.getDrawable(iconId);
return;
} else {
//name = packages[0];
// Use default icon
}
} else if (iconId != 0) {
- mAppIcon = getActivity().getResources().getDrawable(iconId);
+ mAppIcon = getActivity().getDrawable(iconId);
}
if (mAppIcon == null) {
mAppIcon = getActivity().getPackageManager().getDefaultActivityIcon();
if (info != null) {
if (info.isManagedProfile()) {
detail.label = res.getString(R.string.managed_user_title);
- detail.icon = Resources.getSystem().getDrawable(
+ detail.icon = mContext.getDrawable(
com.android.internal.R.drawable.ic_corp_icon);
} else {
detail.label = res.getString(R.string.running_process_item_user_label,
}
try {
- return r.getDrawable(resId);
+ return r.getDrawable(resId, null);
} catch (RuntimeException e) {
Log.w(TAG, "Icon not found in "
+ (pkg != null ? resId : "<system>")