From 645e988e1d786f0e68cc0fb99360d35837c70c34 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Mon, 23 Nov 2020 17:08:26 -0800 Subject: [PATCH] PiP: Safeguard in calling on menu view in case it's not created. In case SystemUI crashes, there is a possibility that we can call on showMenu() upon SysUI restart without the menu instance created. We should at least not crash SysUI again for this. Bug: 173683353 Test: None Change-Id: I67c11ffaf9f7e6972cc4b005f07f8fc6897ac5c1 --- .../android/wm/shell/pip/phone/PipMenuActivityController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActivityController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActivityController.java index 1d5430008501c..d4217553ef2d6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActivityController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActivityController.java @@ -239,7 +239,9 @@ public class PipMenuActivityController { + " callers=\n" + Debug.getCallers(5, " ")); } - maybeCreateSyncApplier(); + if (!maybeCreateSyncApplier()) { + return; + } mPipMenuView.showMenu(menuState, stackBounds, allowMenuTimeout, willResizeMenu, withDelay, showResizeHandle);