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
This commit is contained in:
Winson Chung
2020-06-02 13:33:20 -07:00
parent f813234a4e
commit 1259fd29f3

View File

@@ -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();