Merge "Fix to call openGutsInternal even when no Statusbar exists" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-07-19 23:49:57 +00:00
committed by Android (Google) Code Review

View File

@@ -561,18 +561,23 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
.setLeaveOpenOnKeyguardHide(true); .setLeaveOpenOnKeyguardHide(true);
} }
Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get();
if (statusBarOptional.isPresent()) {
Runnable r = () -> mMainHandler.post( Runnable r = () -> mMainHandler.post(
() -> openGutsInternal(view, x, y, menuItem)); () -> openGutsInternal(view, x, y, menuItem));
statusBarOptional.get().executeRunnableDismissingKeyguard(
mStatusBarOptionalLazy.get().ifPresent(
statusBar -> statusBar.executeRunnableDismissingKeyguard(
r, r,
null /* cancelAction */, null /* cancelAction */,
false /* dismissShade */, false /* dismissShade */,
true /* afterKeyguardGone */, true /* afterKeyguardGone */,
true /* deferred */)); true /* deferred */);
return true; 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); return openGutsInternal(view, x, y, menuItem);
} }