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

Commit 71703b74 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/25733305'] into 24Q1-release.

Change-Id: I3520a624a01ece14fa2382cae2c0ce7b157fdc4e
parents 6295aabd 7aaf2bae
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@ import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.app.animation.Interpolators.FINAL_FRAME;
import static com.android.app.animation.Interpolators.INSTANT;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW;
import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED;
@@ -57,6 +59,7 @@ import androidx.annotation.VisibleForTesting;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.launcher3.Alarm;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimatorListeners;
@@ -937,19 +940,27 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
    }

    /**
     * We stash when IME or IME switcher is showing AND NOT
     *  * in small screen AND
     *  * 3 button nav AND
     *  * landscape (or seascape)
     * We do not stash if taskbar is transient or hardware keyboard is active.
     * We stash when IME or IME switcher is showing.
     *
     * <p>Do not stash if in small screen, with 3 button nav, and in landscape (or seascape).
     * <p>Do not stash if taskbar is transient.
     * <p>Do not stash if hardware keyboard is attached and taskbar is pinned.
     */
    private boolean shouldStashForIme() {
        if (DisplayController.isTransientTaskbar(mActivity) || mActivity.isHardwareKeyboard()) {
        if (DisplayController.isTransientTaskbar(mActivity)) {
            return false;
        }
        // Do not stash if in small screen, with 3 button nav, and in landscape.
        if (isPhoneMode() && mActivity.isThreeButtonNav()
                && mActivity.getDeviceProfile().isLandscape) {
            return false;
        }
        // Do not stash if pinned taskbar and hardware keyboard is attached.
        if (mActivity.isHardwareKeyboard() && enableTaskbarPinning()
                && LauncherPrefs.get(mActivity).get(TASKBAR_PINNING)) {
            return false;
        }
        return (mIsImeShowing || mIsImeSwitcherShowing) &&
                !(isPhoneMode() && mActivity.isThreeButtonNav()
                        && mActivity.getDeviceProfile().isLandscape);
        return mIsImeShowing || mIsImeSwitcherShowing;
    }

    /**