Turn in the work profile's badge.

The badge is no longer part of the preferred work profile UX. By
removing the code which badges the preferences for the individual
storage items, we can avoid placing the no longer needed tiny badges.

Change-Id: I6fd2ec28d3cf55e3a95b877f4c7b9b51c94e12d8
Fixes: 64475406
Test: Manual
This commit is contained in:
Daniel Nishi
2017-09-01 12:45:56 -07:00
parent c3b47925e3
commit 9e6d39e71a

View File

@@ -208,23 +208,18 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
public void setUserId(UserHandle userHandle) {
mUserId = userHandle.getIdentifier();
PackageManager pm = mContext.getPackageManager();
badgePreference(pm, userHandle, mPhotoPreference);
badgePreference(pm, userHandle, mMoviesPreference);
badgePreference(pm, userHandle, mAudioPreference);
badgePreference(pm, userHandle, mGamePreference);
badgePreference(pm, userHandle, mAppPreference);
badgePreference(pm, userHandle, mSystemPreference);
badgePreference(pm, userHandle, mFilePreference);
tintPreference(mPhotoPreference);
tintPreference(mMoviesPreference);
tintPreference(mAudioPreference);
tintPreference(mGamePreference);
tintPreference(mAppPreference);
tintPreference(mSystemPreference);
tintPreference(mFilePreference);
}
private void badgePreference(PackageManager pm, UserHandle userHandle, Preference preference) {
private void tintPreference(Preference preference) {
if (preference != null) {
Drawable currentIcon = preference.getIcon();
// Sigh... Applying the badge to the icon clobbers the tint on the base drawable.
// For some reason, reapplying it here means the tint remains.
currentIcon = applyTint(mContext, currentIcon);
preference.setIcon(pm.getUserBadgedIcon(currentIcon, userHandle));
preference.setIcon(applyTint(mContext, preference.getIcon()));
}
}