Merge "Make TaskbarStashController aware of accesseibilty time to action settings." into tm-qpr-dev am: 5cef4b83d5 am: b572cfee26 am: ed7c3439ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21778874 Change-Id: I8c28ae0c2df03bdb6d56c932590bb5243de44e9f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
package com.android.launcher3.taskbar;
|
package com.android.launcher3.taskbar;
|
||||||
|
|
||||||
import static android.view.HapticFeedbackConstants.LONG_PRESS;
|
import static android.view.HapticFeedbackConstants.LONG_PRESS;
|
||||||
|
import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTROLS;
|
||||||
|
|
||||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
|
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
|
||||||
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
|
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
|
||||||
@@ -43,6 +44,7 @@ import android.util.Log;
|
|||||||
import android.view.InsetsController;
|
import android.view.InsetsController;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
|
import android.view.accessibility.AccessibilityManager;
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -189,6 +191,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
|||||||
// Stashed handle properties.
|
// Stashed handle properties.
|
||||||
private MultiProperty mTaskbarStashedHandleAlpha;
|
private MultiProperty mTaskbarStashedHandleAlpha;
|
||||||
private AnimatedFloat mTaskbarStashedHandleHintScale;
|
private AnimatedFloat mTaskbarStashedHandleHintScale;
|
||||||
|
private final AccessibilityManager mAccessibilityManager;
|
||||||
|
|
||||||
/** Whether we are currently visually stashed (might change based on launcher state). */
|
/** Whether we are currently visually stashed (might change based on launcher state). */
|
||||||
private boolean mIsStashed = false;
|
private boolean mIsStashed = false;
|
||||||
@@ -221,6 +224,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
|||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
mPrefs = LauncherPrefs.getPrefs(mActivity);
|
mPrefs = LauncherPrefs.getPrefs(mActivity);
|
||||||
mSystemUiProxy = SystemUiProxy.INSTANCE.get(activity);
|
mSystemUiProxy = SystemUiProxy.INSTANCE.get(activity);
|
||||||
|
mAccessibilityManager = mActivity.getSystemService(AccessibilityManager.class);
|
||||||
if (isPhoneMode()) {
|
if (isPhoneMode()) {
|
||||||
// DeviceProfile's taskbar vars aren't initialized w/ the flag off
|
// DeviceProfile's taskbar vars aren't initialized w/ the flag off
|
||||||
Resources resources = mActivity.getResources();
|
Resources resources = mActivity.getResources();
|
||||||
@@ -1018,7 +1022,15 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
|||||||
cancelTimeoutIfExists();
|
cancelTimeoutIfExists();
|
||||||
|
|
||||||
mTimeoutAlarm.setOnAlarmListener(this::onTaskbarTimeout);
|
mTimeoutAlarm.setOnAlarmListener(this::onTaskbarTimeout);
|
||||||
mTimeoutAlarm.setAlarm(NO_TOUCH_TIMEOUT_TO_STASH_MS);
|
mTimeoutAlarm.setAlarm(getTaskbarAutoHideTimeout());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns appropriate timeout for taskbar to stash depending on accessibility being on/off.
|
||||||
|
*/
|
||||||
|
private long getTaskbarAutoHideTimeout() {
|
||||||
|
return mAccessibilityManager.getRecommendedTimeoutMillis((int) NO_TOUCH_TIMEOUT_TO_STASH_MS,
|
||||||
|
FLAG_CONTENT_CONTROLS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTaskbarTimeout(Alarm alarm) {
|
private void onTaskbarTimeout(Alarm alarm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user