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

Commit 80141d1c authored by George Mount's avatar George Mount
Browse files

Fix input pause without resume.

Bug 22455206

Previously, when an exit activity transition was created, the input
would be paused. This worked fine as long as the transition was
run. However, sometimes that transition wasn't run and this would
cause the input to fail to be started again.

This fix moves the input pause to when the transition is started.

Change-Id: I738d5471f7932f00b50897f87a8f8a71ecbc57e2
parent 8af7432c
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -217,11 +217,6 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
    }

    protected void viewsReady(ArrayMap<String, View> sharedElements) {
        final View decor = getDecor();
        final ViewRootImpl viewRoot = decor == null ? null : decor.getViewRootImpl();
        if (viewRoot != null) {
            viewRoot.setPausedForTransition(true);
        }
        sharedElements.retainAll(mAllSharedElementNames);
        if (mListener != null) {
            mListener.onMapSharedElements(mAllSharedElementNames, sharedElements);
@@ -905,6 +900,14 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
        }
    }

    protected void pauseInput() {
        final View decor = getDecor();
        final ViewRootImpl viewRoot = decor == null ? null : decor.getViewRootImpl();
        if (viewRoot != null) {
            viewRoot.setPausedForTransition(true);
        }
    }

    protected void onTransitionsComplete() {}

    protected class ContinueTransitionListener extends Transition.TransitionListenerAdapter {
+1 −0
Original line number Diff line number Diff line
@@ -333,6 +333,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
        boolean startSharedElementTransition = true;
        setGhostVisibility(View.INVISIBLE);
        scheduleGhostVisibilityChange(View.INVISIBLE);
        pauseInput();
        Transition transition = beginTransition(decorView, startEnterTransition,
                startSharedElementTransition);
        scheduleGhostVisibilityChange(View.VISIBLE);
+2 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
    public void startExit() {
        if (!mIsExitStarted) {
            mIsExitStarted = true;
            pauseInput();
            ViewGroup decorView = getDecor();
            if (decorView != null) {
                decorView.suppressLayout(true);
@@ -220,6 +221,7 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
    public void startExit(int resultCode, Intent data) {
        if (!mIsExitStarted) {
            mIsExitStarted = true;
            pauseInput();
            ViewGroup decorView = getDecor();
            if (decorView != null) {
                decorView.suppressLayout(true);