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

Commit 6352c9bc authored by Jon Miranda's avatar Jon Miranda Committed by Android (Google) Code Review
Browse files

Merge "Revert "Suspend immersive mode autohide while pending transient taskbar...

Merge "Revert "Suspend immersive mode autohide while pending transient taskbar timeout"" into udc-dev
parents c70e41a4 a6653ae6
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -41,10 +41,8 @@ public class TaskbarAutohideSuspendController implements
    public static final int FLAG_AUTOHIDE_SUSPEND_TOUCHING = 1 << 2;
    // Taskbar EDU overlay is open above the Taskbar. */
    public static final int FLAG_AUTOHIDE_SUSPEND_EDU_OPEN = 1 << 3;
    // Taskbar is in immersive mode in overview.
    // Taskbar in immersive mode in overview
    public static final int FLAG_AUTOHIDE_SUSPEND_IN_LAUNCHER = 1 << 4;
    // Transient Taskbar is temporarily unstashed (pending a timeout).
    public static final int FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR = 1 << 5;

    @IntDef(flag = true, value = {
            FLAG_AUTOHIDE_SUSPEND_FULLSCREEN,
@@ -52,7 +50,6 @@ public class TaskbarAutohideSuspendController implements
            FLAG_AUTOHIDE_SUSPEND_TOUCHING,
            FLAG_AUTOHIDE_SUSPEND_EDU_OPEN,
            FLAG_AUTOHIDE_SUSPEND_IN_LAUNCHER,
            FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface AutohideSuspendFlag {}
@@ -88,21 +85,18 @@ public class TaskbarAutohideSuspendController implements

        boolean isSuspended = isSuspended();
        mSystemUiProxy.notifyTaskbarAutohideSuspend(isSuspended);
        mActivity.onTransientAutohideSuspendFlagChanged(isTransientTaskbarStashingSuspended());
        mActivity.onTransientAutohideSuspendFlagChanged(isSuspended);
    }

    /**
     * Returns true iff taskbar autohide is currently suspended for immersive mode.
     * Returns true iff taskbar autohide is currently suspended.
     */
    private boolean isSuspended() {
    public boolean isSuspended() {
        return mAutohideSuspendFlags != 0;
    }

    /**
     * Returns whether Transient Taskbar should avoid auto-stashing.
     */
    public boolean isTransientTaskbarStashingSuspended() {
        return (mAutohideSuspendFlags & ~FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR) != 0;
    public boolean isSuspendedForTransientTaskbarInOverview() {
        return (mAutohideSuspendFlags & FLAG_AUTOHIDE_SUSPEND_IN_LAUNCHER) != 0;
    }

    @Override
@@ -121,8 +115,6 @@ public class TaskbarAutohideSuspendController implements
        appendFlag(str, flags, FLAG_AUTOHIDE_SUSPEND_EDU_OPEN, "FLAG_AUTOHIDE_SUSPEND_EDU_OPEN");
        appendFlag(str, flags, FLAG_AUTOHIDE_SUSPEND_IN_LAUNCHER,
                "FLAG_AUTOHIDE_SUSPEND_IN_LAUNCHER");
        appendFlag(str, flags, FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR,
                "FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR");
        return str.toString();
    }
}
+5 −6
Original line number Diff line number Diff line
@@ -509,8 +509,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
            return;
        }

        if (stash && mControllers.taskbarAutohideSuspendController
                .isTransientTaskbarStashingSuspended()) {
        if (stash && mControllers.taskbarAutohideSuspendController.isSuspended()
                && !mControllers.taskbarAutohideSuspendController
                .isSuspendedForTransientTaskbarInOverview()) {
            // Avoid stashing if autohide is currently suspended.
            return;
        }

@@ -1037,9 +1039,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
            mActivity.getStatsLogManager().logger().log(hasAnyFlag(FLAG_STASHED_IN_APP_AUTO)
                    ? LAUNCHER_TRANSIENT_TASKBAR_HIDE
                    : LAUNCHER_TRANSIENT_TASKBAR_SHOW);
            mControllers.taskbarAutohideSuspendController.updateFlag(
                    TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TRANSIENT_TASKBAR,
                    !hasAnyFlag(FLAG_STASHED_IN_APP_AUTO));
        }
    }

@@ -1132,7 +1131,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
    }

    private void onTaskbarTimeout(Alarm alarm) {
        if (mControllers.taskbarAutohideSuspendController.isTransientTaskbarStashingSuspended()) {
        if (mControllers.taskbarAutohideSuspendController.isSuspended()) {
            return;
        }
        updateAndAnimateTransientTaskbar(true);