Fix direct share badges when sharing on work/personal profiles

Use the passed-in user instead of the current user to determine
whether or not to add the work profile badge to direct share
target app icons, so that personal share targets do not have the
badge (even when sharing something from the work profile) and
work/managed share targets do have it (even when sharing something
from the personal profile).

Test: manual; tested appearance sharing from personal->work and
from work->personal
Bug: 197388251
Fix: 197388251

Change-Id: Ieee50d46e8058a92efa5be8aae9859447531c270
This commit is contained in:
Miranda Kephart
2021-09-15 15:20:14 -04:00
parent c72d4fc175
commit 63fe7d7343

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(android.os.Process.myUserHandle());
.getIconBitmap(mContext.getUser());
// Raster target drawable with appIcon as a badge
SimpleIconFactory sif = SimpleIconFactory.obtain(mContext);