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

Commit 6acb1cfd authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Introduce a flag for new back affordance

Also, turn it on by default.

This allows the new back indicator to be tested seperately from
predictive back animations.

Test: adb shell broadcast -a com.android.systemui.action.SET_FLAG \
        --ei id 1203 --ez value 1
Bug: 217579545
Change-Id: I2f3a3b1413e25bcac04cd7ad5b288565478101b9
parent 513cc27d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -194,6 +194,8 @@ public class Flags {
    public static final SysPropBooleanFlag WM_ALWAYS_ENFORCE_PREDICTIVE_BACK =
            new SysPropBooleanFlag(1202, "persist.wm.debug.predictive_back_always_enforce", false);

    public static final BooleanFlag NEW_BACK_AFFORDANCE = new BooleanFlag(1203, true);

    // Pay no attention to the reflection behind the curtain.
    // ========================== Curtain ==========================
    // |                                                           |
+3 −4
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
    private boolean mIsBackGestureAllowed;
    private boolean mGestureBlockingActivityRunning;
    private boolean mIsInPipMode;
    private boolean mIsPredictiveBackAnimEnabled;
    private boolean mIsNewBackAffordanceEnabled;

    private InputMonitor mInputMonitor;
    private InputChannelCompat.InputEventReceiver mInputEventReceiver;
@@ -524,8 +524,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
                    Choreographer.getInstance(), this::onInputEvent);

            // Add a nav bar panel window
            mIsPredictiveBackAnimEnabled =
                    mFeatureFlags.isEnabled(Flags.WM_ENABLE_PREDICTIVE_BACK_ANIM);
            mIsNewBackAffordanceEnabled = mFeatureFlags.isEnabled(Flags.NEW_BACK_AFFORDANCE);
            resetEdgeBackPlugin();
            mPluginManager.addPluginListener(
                    this, NavigationEdgeBackPlugin.class, /*allowMultiple=*/ false);
@@ -545,7 +544,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
    }

    private void resetEdgeBackPlugin() {
        if (mIsPredictiveBackAnimEnabled) {
        if (mIsNewBackAffordanceEnabled) {
            setEdgeBackPlugin(
                    mBackPanelControllerFactory.create(mContext, mBackAnimation));
        } else {