Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32066032 authored by Winson Chung's avatar Winson Chung
Browse files

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
parent 780b624f
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1199,6 +1199,14 @@ class ActivityStarter {
                // since the app transition will not be triggered through the resume channel.
                // since the app transition will not be triggered through the resume channel.
                mWindowManager.executeAppTransition();
                mWindowManager.executeAppTransition();
            } else {
            } 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,
                mSupervisor.resumeFocusedStackTopActivityLocked(mTargetStack, mStartActivity,
                        mOptions);
                        mOptions);
            }
            }