diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java index 0a15d8468983b..f6e92ef0e8eae 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java @@ -165,7 +165,8 @@ public class Bubble implements BubbleViewProvider { * Create a bubble with limited information based on given {@link ShortcutInfo}. * Note: Currently this is only being used when the bubble is persisted to disk. */ - Bubble(@NonNull final String key, @NonNull final ShortcutInfo shortcutInfo, + @VisibleForTesting(visibility = PRIVATE) + public Bubble(@NonNull final String key, @NonNull final ShortcutInfo shortcutInfo, final int desiredHeight, final int desiredHeightResId, @Nullable final String title, int taskId, @Nullable final String locus, Executor mainExecutor) { Objects.requireNonNull(key); @@ -188,7 +189,7 @@ public class Bubble implements BubbleViewProvider { } @VisibleForTesting(visibility = PRIVATE) - Bubble(@NonNull final BubbleEntry entry, + public Bubble(@NonNull final BubbleEntry entry, @Nullable final Bubbles.SuppressionChangedListener listener, final Bubbles.PendingIntentCanceledListener intentCancelListener, Executor mainExecutor) { @@ -718,7 +719,8 @@ public class Bubble implements BubbleViewProvider { private int getUid(final Context context) { if (mAppUid != -1) return mAppUid; - final PackageManager pm = context.getPackageManager(); + final PackageManager pm = BubbleController.getPackageManagerForUser(context, + mUser.getIdentifier()); if (pm == null) return -1; try { final ApplicationInfo info = pm.getApplicationInfo(mShortcutInfo.getPackage(), 0); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleIconFactory.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleIconFactory.java index fe3f9ef6aa5f2..e64ed6a0836c1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleIconFactory.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleIconFactory.java @@ -29,6 +29,8 @@ import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; +import androidx.annotation.VisibleForTesting; + import com.android.launcher3.icons.BaseIconFactory; import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.ShadowGenerator; @@ -39,11 +41,12 @@ import com.android.wm.shell.R; * We are not using Launcher's IconFactory because bubbles only runs on the UI thread, * so there is no need to manage a pool across multiple threads. */ +@VisibleForTesting public class BubbleIconFactory extends BaseIconFactory { private int mBadgeSize; - protected BubbleIconFactory(Context context) { + public BubbleIconFactory(Context context) { super(context, context.getResources().getConfiguration().densityDpi, context.getResources().getDimensionPixelSize(R.dimen.individual_bubble_size)); mBadgeSize = mContext.getResources().getDimensionPixelSize( diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java index 5cdce886a9e8b..fc53ef26dbd95 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java @@ -39,6 +39,7 @@ import android.util.PathParser; import android.view.LayoutInflater; import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; import com.android.internal.graphics.ColorUtils; import com.android.launcher3.icons.BitmapInfo; @@ -118,7 +119,8 @@ public class BubbleViewInfoTask extends AsyncTask