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

Commit d842f5e5 authored by Pat Manning's avatar Pat Manning Committed by Android (Google) Code Review
Browse files

Merge "Hide taskbar icons for IME when virtual keyboard is present." into main

parents d89b61a4 559434af
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;
@@ -930,19 +933,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 (mActivity.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) &&
                !(mActivity.isPhoneMode() && mActivity.isThreeButtonNav()
                        && mActivity.getDeviceProfile().isLandscape);
        return mIsImeShowing || mIsImeSwitcherShowing;
    }

    /**