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

Commit c2484f04 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Android (Google) Code Review
Browse files

Merge "Clean up predictive_back_swipe_edge_none_api" into main

parents e1fdb25e c5796a43
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63508,7 +63508,7 @@ package android.window {
    method public float getTouchX();
    method public float getTouchY();
    field public static final int EDGE_LEFT = 0; // 0x0
    field @FlaggedApi("com.android.window.flags.predictive_back_swipe_edge_none_api") public static final int EDGE_NONE = 2; // 0x2
    field public static final int EDGE_NONE = 2; // 0x2
    field public static final int EDGE_RIGHT = 1; // 0x1
  }
+2 −8
Original line number Diff line number Diff line
@@ -134,7 +134,6 @@ import static com.android.text.flags.Flags.disableHandwritingInitiatorForIme;
import static com.android.window.flags.Flags.alwaysSeqIdLayout;
import static com.android.window.flags.Flags.alwaysSeqIdLayoutWear;
import static com.android.window.flags.Flags.enableWindowContextResourcesUpdateOnConfigChange;
import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi;
import static com.android.window.flags.Flags.reduceChangedExclusionRectsMsgs;
import static com.android.window.flags.Flags.setScPropertiesInClient;
@@ -7785,13 +7784,8 @@ public final class ViewRootImpl implements ViewParent,
                        // - 0 means the button was pressed.
                        // - 1 means the button continues to be pressed (long press).
                        if (keyEvent.getRepeatCount() == 0) {
                            BackEvent backEvent;
                            if (predictiveBackSwipeEdgeNoneApi()) {
                                backEvent = new BackEvent(0, 0, 0f, BackEvent.EDGE_NONE);
                            } else {
                                backEvent = new BackEvent(0, 0, 0f, BackEvent.EDGE_LEFT);
                            }
                            animationCallback.onBackStarted(backEvent);
                            animationCallback.onBackStarted(
                                    new BackEvent(0, 0, 0f, BackEvent.EDGE_NONE));
                        }
                        break;
                    case KeyEvent.ACTION_UP:
+0 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.window;

import static com.android.window.flags.Flags.FLAG_PREDICTIVE_BACK_SWIPE_EDGE_NONE_API;
import static com.android.window.flags.Flags.FLAG_PREDICTIVE_BACK_TIMESTAMP_API;
import static com.android.window.flags.Flags.predictiveBackTimestampApi;

@@ -42,7 +41,6 @@ public final class BackEvent {
     * to cases like using the back button in 3-button navigation or pressing a hardware back
     * button.
     */
    @FlaggedApi(FLAG_PREDICTIVE_BACK_SWIPE_EDGE_NONE_API)
    public static final int EDGE_NONE = 2;

    /** @hide */
+7 −14
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.window.BackEvent.EDGE_NONE;

import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.window.flags.Flags.predictiveBackTimestampApi;
import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -132,11 +131,9 @@ public class BackProgressAnimator implements DynamicAnimation.OnAnimationUpdateL
        if (!mBackAnimationInProgress) {
            return;
        }
        if (predictiveBackSwipeEdgeNoneApi()) {
        if (event.getSwipeEdge() == EDGE_NONE) {
            return;
        }
        }
        mLastBackEvent = event;
        if (mSpring == null) {
            return;
@@ -171,7 +168,6 @@ public class BackProgressAnimator implements DynamicAnimation.OnAnimationUpdateL
        mBackAnimationInProgress = true;
        updateProgressValue(/* progress */ 0, /* velocity */ 0,
                /* frameTime */ System.nanoTime() / TimeUtils.NANOS_PER_MS);
        if (predictiveBackSwipeEdgeNoneApi()) {
        if (event.getSwipeEdge() == EDGE_NONE) {
            mButtonSpringForce.setStiffness(BUTTON_SPRING_STIFFNESS);
            mSpring.setSpring(mButtonSpringForce);
@@ -180,9 +176,6 @@ public class BackProgressAnimator implements DynamicAnimation.OnAnimationUpdateL
            mSpring.setSpring(mGestureSpringForce);
            onBackProgressed(event);
        }
        } else {
            onBackProgressed(event);
        }
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_S
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_WAKEFULNESS_TRANSITION;
import static com.android.systemui.shared.system.QuickStepContract.addInterface;
import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi;

import android.annotation.FloatRange;
import android.annotation.Nullable;
@@ -346,7 +345,7 @@ public class LauncherProxyService implements CallbackController<LauncherProxyLis

        @Override
        public void onBackEvent(@Nullable KeyEvent keyEvent, int displayId) throws RemoteException {
            if (predictiveBackSwipeEdgeNoneApi() && mBackAnimation != null && keyEvent != null) {
            if (mBackAnimation != null && keyEvent != null) {
                if (DEBUG_MISSING_GESTURE && keyEvent.isCanceled()) {
                    Log.d(DEBUG_MISSING_GESTURE_TAG,
                            "Cancel back [launcher key event]: " + keyEvent);