Ensure that focusable stack is focused when starting a new activity.

- When starting a new activity, if the old top activity was not
  focusable the focused stack was not updated, leaving the activity
  in a non-resumed state.  Now, ensure that we focus the stack if
  starting an activity allows the stack to be focused.

Test: Enable tap-through in the SystemUI tuner, tap on the activity and
      ensure the menu shows.

Bug: 32636739
Change-Id: I8dd964baacd1e7352880ddd2b2324b947cbec556
This commit is contained in:
Winson Chung
2016-11-04 11:55:21 -07:00
parent 780b624fb5
commit 3206603271

View File

@@ -1199,6 +1199,14 @@ class ActivityStarter {
// since the app transition will not be triggered through the resume channel.
mWindowManager.executeAppTransition();
} else {
// If the target stack was not previously focusable (previous top running activity
// on that stack was not visible) then any prior calls to move the stack to the
// will not update the focused stack. If starting the new activity now allows the
// task stack to be focusable, then ensure that we now update the focused stack
// accordingly.
if (mTargetStack.isFocusable() && !mSupervisor.isFocusedStack(mTargetStack)) {
mTargetStack.moveToFront("startActivityUnchecked");
}
mSupervisor.resumeFocusedStackTopActivityLocked(mTargetStack, mStartActivity,
mOptions);
}