From 50727306a510d1331c81410303eac4e2dc33b729 Mon Sep 17 00:00:00 2001 From: Calvin Huang Date: Thu, 6 Apr 2023 18:31:47 +0000 Subject: [PATCH] Show toast for invisible systemUI CarSystemUI is running on u0 and is invisible on display 0, but it should be able to send out toast. Bug: 277646621 Test: On car build, enable drive state then click on profile swith panel Test: atest android.widget.cts.ToastTest Test: atest 1B151FQGR00060 NotificationManagerServiceTest on bluejay Change-Id: I29abac50295b6147e8bb3d6a17c4023d7765471e --- .../android/server/notification/NotificationManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 1301cd476c260..ebcbfed93ac7c 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -3335,7 +3335,7 @@ public class NotificationManagerService extends SystemService { } checkCallerIsSameApp(pkg); - final boolean isSystemToast = isCallerSystemOrPhone() + final boolean isSystemToast = isCallerIsSystemOrSystemUi() || PackageManagerService.PLATFORM_PACKAGE_NAME.equals(pkg); boolean isAppRenderedToast = (callback != null); if (!checkCanEnqueueToast(pkg, callingUid, displayId, isAppRenderedToast,