From 9d1e05c6b345a48f45afd451f602a52337047689 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 16 Aug 2021 14:32:13 -0400 Subject: Ensure package context used by System UI has a valid userId. Fixes: 189924598 Bug: 194356170 Test: atest SystemUITests Test: atest android.service.notification.StatusBarNotificationTest#testGetPackageContext_worksWithUserAll Change-Id: Ic43a0301cb62ab27e276c2938012a27c3a9a6fff --- core/java/android/service/notification/StatusBarNotification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/java/android') diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java index 8e4a68e52697..40041486f6a6 100644 --- a/core/java/android/service/notification/StatusBarNotification.java +++ b/core/java/android/service/notification/StatusBarNotification.java @@ -436,7 +436,7 @@ public class StatusBarNotification implements Parcelable { try { ApplicationInfo ai = context.getPackageManager() .getApplicationInfoAsUser(pkg, PackageManager.MATCH_UNINSTALLED_PACKAGES, - getUserId()); + getNormalizedUserId()); mContext = context.createApplicationContext(ai, Context.CONTEXT_RESTRICTED); } catch (PackageManager.NameNotFoundException e) { -- cgit v1.2.3