Don't show nested badge for work profile direct share targets

Currently, we add a work badge (briefcase icon) to app icons in
the sharesheet. If the target is an app, this results in the
regular app icon with a work badge. However, for direct share
targets we show the person, with the app icon as a badge. This
means that for direct share targets, we show an app icon badge
that itself has a (very tiny) work profile badge.

This change removes the "nested" work profile badge for direct
share targets.

Bug: 179783660
Fix: 179783660
Test: manual (shared something and verified that no direct share
targets have a work profile badge, but work profile apps are still
badged)

Change-Id: I5196184a6f1fb442eee905240656faa6c9fc4cfb
This commit is contained in:
Miranda Kephart
2021-10-29 12:19:35 -04:00
parent 2438ebe2df
commit f50afcbabb
3 changed files with 3 additions and 3 deletions

View File

@@ -923,7 +923,7 @@ public class ResolverListAdapter extends BaseAdapter {
return new BitmapDrawable(mCtx.getResources(), getIconBitmap(userHandle));
}
public Bitmap getIconBitmap(UserHandle userHandle) {
public Bitmap getIconBitmap(@Nullable UserHandle userHandle) {
Drawable dr = null;
if (mHasSubstitutePermission) {
dr = getIconSubstituteInternal();

View File

@@ -194,7 +194,7 @@ public class SimpleIconFactory {
* @deprecated Do not use, functionality will be replaced by iconloader lib eventually.
*/
@Deprecated
Bitmap createUserBadgedIconBitmap(@Nullable Drawable icon, UserHandle user) {
Bitmap createUserBadgedIconBitmap(@Nullable Drawable icon, @Nullable UserHandle user) {
float [] scale = new float[1];
// If no icon is provided use the system default

View File

@@ -165,7 +165,7 @@ public final class SelectableTargetInfo implements ChooserTargetInfo {
// Now fetch app icon and raster with no badging even in work profile
Bitmap appIcon = mSelectableTargetInfoCommunicator.makePresentationGetter(info)
.getIconBitmap(mContext.getUser());
.getIconBitmap(null);
// Raster target drawable with appIcon as a badge
SimpleIconFactory sif = SimpleIconFactory.obtain(mContext);