Use correct API for badging
Bug: 17414778 Change-Id: Ieb9890751c3071088b9f5aab48053e767f78bfe5
This commit is contained in:
@@ -304,8 +304,8 @@ public class DeviceAdminSettings extends ListFragment {
|
||||
final Activity activity = getActivity();
|
||||
ViewHolder vh = (ViewHolder) view.getTag();
|
||||
Drawable activityIcon = item.loadIcon(activity.getPackageManager());
|
||||
Drawable badgedIcon = activity.getPackageManager().getUserBadgedDrawableForDensity(
|
||||
activityIcon, new UserHandle(getUserId(item)), null, 0);
|
||||
Drawable badgedIcon = activity.getPackageManager().getUserBadgedIcon(
|
||||
activityIcon, new UserHandle(getUserId(item)));
|
||||
vh.icon.setImageDrawable(badgedIcon);
|
||||
vh.name.setText(item.loadLabel(activity.getPackageManager()));
|
||||
vh.checkbox.setChecked(isActiveAdmin(item));
|
||||
|
@@ -104,8 +104,8 @@ final public class AuthenticatorHelper extends BroadcastReceiver {
|
||||
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
|
||||
Context authContext = context.createPackageContextAsUser(desc.packageName, 0,
|
||||
mUserHandle);
|
||||
icon = mContext.getPackageManager().getUserBadgedDrawableForDensity(
|
||||
authContext.getResources().getDrawable(desc.iconId), mUserHandle, null, 0);
|
||||
icon = mContext.getPackageManager().getUserBadgedIcon(
|
||||
authContext.getResources().getDrawable(desc.iconId), mUserHandle);
|
||||
synchronized (mAccTypeIconCache) {
|
||||
mAccTypeIconCache.put(accountType, icon);
|
||||
}
|
||||
|
@@ -215,8 +215,8 @@ public class ChooseAccountActivity extends PreferenceActivity {
|
||||
try {
|
||||
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
|
||||
Context authContext = createPackageContextAsUser(desc.packageName, 0, mUserHandle);
|
||||
icon = getPackageManager().getUserBadgedDrawableForDensity(
|
||||
authContext.getResources().getDrawable(desc.iconId), mUserHandle, null, 0);
|
||||
icon = getPackageManager().getUserBadgedIcon(
|
||||
authContext.getResources().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);
|
||||
|
@@ -212,10 +212,9 @@ public class RecentLocationApps {
|
||||
|
||||
final UserHandle userHandle = new UserHandle(userId);
|
||||
Drawable appIcon = mPackageManager.getApplicationIcon(appInfo);
|
||||
Drawable icon = mPackageManager.getUserBadgedDrawableForDensity(appIcon, userHandle,
|
||||
null, 0);
|
||||
Drawable icon = mPackageManager.getUserBadgedIcon(appIcon, userHandle);
|
||||
CharSequence appLabel = mPackageManager.getApplicationLabel(appInfo);
|
||||
CharSequence badgedAppLabel = um.getBadgedLabelForUser(appLabel.toString(), userHandle);
|
||||
CharSequence badgedAppLabel = mPackageManager.getUserBadgedLabel(appLabel, userHandle);
|
||||
preference = createRecentLocationEntry(icon,
|
||||
appLabel, highBattery, badgedAppLabel,
|
||||
new PackageEntryClickedListener(packageName));
|
||||
|
Reference in New Issue
Block a user