Merge "Turn off predictive back" into tm-dev
This commit is contained in:
@@ -54,7 +54,7 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
|
|||||||
private static final String TAG = "WindowOnBackDispatcher";
|
private static final String TAG = "WindowOnBackDispatcher";
|
||||||
private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability";
|
private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability";
|
||||||
private static final boolean IS_BACK_PREDICTABILITY_ENABLED = SystemProperties
|
private static final boolean IS_BACK_PREDICTABILITY_ENABLED = SystemProperties
|
||||||
.getInt(BACK_PREDICTABILITY_PROP, 1) > 0;
|
.getInt(BACK_PREDICTABILITY_PROP, 0) > 0;
|
||||||
|
|
||||||
/** Convenience hashmap to quickly decide if a callback has been added. */
|
/** Convenience hashmap to quickly decide if a callback has been added. */
|
||||||
private final HashMap<OnBackInvokedCallback, Integer> mAllCallbacks = new HashMap<>();
|
private final HashMap<OnBackInvokedCallback, Integer> mAllCallbacks = new HashMap<>();
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ import com.android.wm.shell.common.annotations.ShellMainThread;
|
|||||||
*/
|
*/
|
||||||
public class BackAnimationController implements RemoteCallable<BackAnimationController> {
|
public class BackAnimationController implements RemoteCallable<BackAnimationController> {
|
||||||
|
|
||||||
|
private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability";
|
||||||
|
public static final boolean IS_ENABLED = SystemProperties
|
||||||
|
.getInt(BACK_PREDICTABILITY_PROP, 0) > 0;
|
||||||
private static final String BACK_PREDICTABILITY_PROGRESS_THRESHOLD_PROP =
|
private static final String BACK_PREDICTABILITY_PROGRESS_THRESHOLD_PROP =
|
||||||
"persist.debug.back_predictability_progress_threshold";
|
"persist.debug.back_predictability_progress_threshold";
|
||||||
private static final int PROGRESS_THRESHOLD = SystemProperties
|
private static final int PROGRESS_THRESHOLD = SystemProperties
|
||||||
|
|||||||
@@ -699,7 +699,10 @@ public abstract class WMShellBaseModule {
|
|||||||
Context context,
|
Context context,
|
||||||
@ShellMainThread ShellExecutor shellExecutor
|
@ShellMainThread ShellExecutor shellExecutor
|
||||||
) {
|
) {
|
||||||
return Optional.of(
|
if (BackAnimationController.IS_ENABLED) {
|
||||||
new BackAnimationController(shellExecutor, context));
|
return Optional.of(
|
||||||
|
new BackAnimationController(shellExecutor, context));
|
||||||
|
}
|
||||||
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,6 +263,15 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
|
|||||||
// Notify FalsingManager that an intentional gesture has occurred.
|
// Notify FalsingManager that an intentional gesture has occurred.
|
||||||
// TODO(b/186519446): use a different method than isFalseTouch
|
// TODO(b/186519446): use a different method than isFalseTouch
|
||||||
mFalsingManager.isFalseTouch(BACK_GESTURE);
|
mFalsingManager.isFalseTouch(BACK_GESTURE);
|
||||||
|
// Only inject back keycodes when ahead-of-time back dispatching is disabled.
|
||||||
|
if (mBackAnimation == null) {
|
||||||
|
boolean sendDown = sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK);
|
||||||
|
boolean sendUp = sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK);
|
||||||
|
if (DEBUG_MISSING_GESTURE) {
|
||||||
|
Log.d(DEBUG_MISSING_GESTURE_TAG, "Triggered back: down="
|
||||||
|
+ sendDown + ", up=" + sendUp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x,
|
mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x,
|
||||||
(int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
|
(int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class BackNavigationController {
|
|||||||
* Returns true if the back predictability feature is enabled
|
* Returns true if the back predictability feature is enabled
|
||||||
*/
|
*/
|
||||||
static boolean isEnabled() {
|
static boolean isEnabled() {
|
||||||
return SystemProperties.getInt(BACK_PREDICTABILITY_PROP, 1) > 0;
|
return SystemProperties.getInt(BACK_PREDICTABILITY_PROP, 0) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean isScreenshotEnabled() {
|
static boolean isScreenshotEnabled() {
|
||||||
|
|||||||
Reference in New Issue
Block a user