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
This commit is contained in:
Peter Kalauskas
2022-06-15 23:12:14 +00:00
parent 513cc27dc7
commit 6acb1cfda8
2 changed files with 5 additions and 4 deletions

View File

@@ -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 ==========================
// | |

View File

@@ -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 {