From 087a06f44d381b2c071d221327e98ba8332b1e1a Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 19 Jul 2021 10:56:07 +0900 Subject: [PATCH] Fix to call openGutsInternal even when no Statusbar exists Bug: 194014429 Bug: 138625582 Bug: 187111293 Test: atest SystemUITests Test: atest ArcNotificationPipelineIntegrationTest Change-Id: I9b4455ad31ef0a227fac52990c15af8abc164e6b --- .../row/NotificationGutsManager.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java index 668d541e1770b..8fe0894f39c19 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java @@ -561,17 +561,22 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx .setLeaveOpenOnKeyguardHide(true); } - Runnable r = () -> mMainHandler.post( - () -> openGutsInternal(view, x, y, menuItem)); - - mStatusBarOptionalLazy.get().ifPresent( - statusBar -> statusBar.executeRunnableDismissingKeyguard( - r, - null /* cancelAction */, - false /* dismissShade */, - true /* afterKeyguardGone */, - true /* deferred */)); - return true; + Optional statusBarOptional = mStatusBarOptionalLazy.get(); + if (statusBarOptional.isPresent()) { + Runnable r = () -> mMainHandler.post( + () -> openGutsInternal(view, x, y, menuItem)); + statusBarOptional.get().executeRunnableDismissingKeyguard( + r, + null /* cancelAction */, + false /* dismissShade */, + true /* afterKeyguardGone */, + true /* deferred */); + return true; + } + /** + * When {@link StatusBar} doesn't exist, falling through to call + * {@link #openGutsInternal(View,int,int,NotificationMenuRowPlugin.MenuItem)}. + */ } } return openGutsInternal(view, x, y, menuItem);