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

Commit b8d96fee authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Migrate predictive back flags to aconfig

Bug: 309545085
Flag: ACONFIG com.android.systemui.predictive_back_sysui DISABLED
Flag: ACONFIG com.android.systemui.predictive_back_animate_shade DISABLED
Flag: ACONFIG com.android.systemui.shade_allow_back_gesture DISABLED
Flag: ACONFIG com.android.systemui.predictive_back_bouncer_anim DISABLED
Test: atest BackActionInteractorTest
Test: atest CentralSurfacesImplTest
Test: atest NotificationPanelViewControllerBaseTest
Test: atest StatusBarKeyguardViewManagerTest
Test: Manual, i.e. testing build on device and verifying behaviour of flagged features
Change-Id: I940233b69957819445cd3efb46ee598a3414e3e8
parent d2e0cd60
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
package: "com.android.systemui"

flag {
    name: "predictive_back_sysui"
    namespace: "systemui"
    description: "Predictive Back Dispatching for SysUI"
    bug: "309545085"
}

flag {
    name: "predictive_back_animate_shade"
    namespace: "systemui"
    description: "Enable Shade Animations"
    bug: "309545085"
}

flag {
    name: "predictive_back_animate_bouncer"
    namespace: "systemui"
    description: "Enable Predictive Back Animation in Bouncer"
    bug: "309545085"
}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ android_library {
        "kotlinx_coroutines",
        "dagger2",
        "jsr330",
        "com_android_systemui_shared_flags_lib",
    ],
    resource_dirs: [
        "res",
+3 −3
Original line number Diff line number Diff line
@@ -20,10 +20,11 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;

import static com.android.systemui.shared.Flags.shadeAllowBackGesture;

import android.annotation.IntDef;
import android.content.Context;
import android.content.res.Resources;
import android.os.SystemProperties;
import android.view.ViewConfiguration;
import android.view.WindowManagerPolicyConstants;

@@ -132,8 +133,7 @@ public class QuickStepContract {
            SYSUI_STATE_WAKEFULNESS_TRANSITION | SYSUI_STATE_AWAKE;

    // Whether the back gesture is allowed (or ignored) by the Shade
    public static final boolean ALLOW_BACK_GESTURE_IN_SHADE = SystemProperties.getBoolean(
            "persist.wm.debug.shade_allow_back_gesture", false);
    public static final boolean ALLOW_BACK_GESTURE_IN_SHADE = shadeAllowBackGesture();

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({SYSUI_STATE_SCREEN_PINNING,
+3 −5
Original line number Diff line number Diff line
@@ -22,10 +22,9 @@ import android.window.OnBackInvokedCallback
import android.window.OnBackInvokedDispatcher
import android.window.WindowOnBackInvokedDispatcher
import com.android.systemui.CoreStartable
import com.android.systemui.Flags.predictiveBackAnimateShade
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.scene.domain.interactor.WindowRootViewVisibilityInteractor
import com.android.systemui.shade.QuickSettingsController
@@ -48,14 +47,13 @@ constructor(
    private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
    private val shadeController: ShadeController,
    private val notificationShadeWindowController: NotificationShadeWindowController,
    private val windowRootViewVisibilityInteractor: WindowRootViewVisibilityInteractor,
    featureFlags: FeatureFlags,
    private val windowRootViewVisibilityInteractor: WindowRootViewVisibilityInteractor
) : CoreStartable {

    private var isCallbackRegistered = false

    private val callback =
        if (featureFlags.isEnabled(Flags.WM_SHADE_ANIMATE_BACK_GESTURE)) {
        if (predictiveBackAnimateShade()) {
            /**
             * New callback that handles back gesture invoked, cancel, progress and provides
             * feedback via Shade animation.
+0 −19
Original line number Diff line number Diff line
@@ -444,29 +444,10 @@ object Flags {
    // TODO(b/254512728): Tracking Bug
    @JvmField val NEW_BACK_AFFORDANCE = releasedFlag("new_back_affordance")

    // TODO(b/255854141): Tracking Bug
    @JvmField
    val WM_ENABLE_PREDICTIVE_BACK_SYSUI =
        unreleasedFlag("persist.wm.debug.predictive_back_sysui_enable", teamfood = true)

    // TODO(b/270987164): Tracking Bug
    @JvmField val TRACKPAD_GESTURE_FEATURES = releasedFlag("trackpad_gesture_features")

    // TODO(b/263826204): Tracking Bug
    @JvmField
    val WM_ENABLE_PREDICTIVE_BACK_BOUNCER_ANIM =
        unreleasedFlag("persist.wm.debug.predictive_back_bouncer_anim", teamfood = true)

    // TODO(b/238475428): Tracking Bug
    @JvmField
    val WM_SHADE_ALLOW_BACK_GESTURE =
        sysPropBooleanFlag("persist.wm.debug.shade_allow_back_gesture", default = false)

    // TODO(b/238475428): Tracking Bug
    @JvmField
    val WM_SHADE_ANIMATE_BACK_GESTURE =
        unreleasedFlag("persist.wm.debug.shade_animate_back_gesture", teamfood = false)

    // TODO(b/265639042): Tracking Bug
    @JvmField
    val WM_ENABLE_PREDICTIVE_BACK_QS_DIALOG_ANIM =
Loading