From 1259fd29f34e9903e2db7bb48131abdac48a87b9 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 2 Jun 2020 13:33:20 -0700 Subject: [PATCH] Restore previous behaviour of hiding pip menu when not focused - Prior to multi-resume in Q, tapping or starting another activity would cause the pip menu activity to pause, which would trigger the menu to be hidden, but now, both activities are resumed so that logic is not hit (at least through that path). Instead the menu can listen for top-resumed-activity changed and use that signal for the same behaviour. This affects the overlay test because it uses the trigger to go home to hide the menu to ensure there are no sysui task overlays. Bug: 156314330 Test: atest PinnedStackTests Change-Id: Ib3b340bc091bb4a94f7b7dc44e08e7af66e4f76f --- .../com/android/systemui/pip/phone/PipMenuActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index a3185a2ad7969..6ab73fcce3997 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -294,6 +294,14 @@ public class PipMenuActivity extends Activity { hideMenu(); } + @Override + public void onTopResumedActivityChanged(boolean isTopResumedActivity) { + super.onTopResumedActivityChanged(isTopResumedActivity); + if (!isTopResumedActivity && mMenuState != MENU_STATE_NONE) { + hideMenu(); + } + } + @Override protected void onStop() { super.onStop();