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

Commit 22dd33be authored by Winson's avatar Winson Committed by android-build-merger
Browse files

Adjusting the tuner flags to allow disabling fast toggle.

am: 14e15b2c

* commit '14e15b2c':
  Adjusting the tuner flags to allow disabling fast toggle.
parents 951e2e4f 14e15b2c
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -1176,15 +1176,10 @@
    <!-- Option to use new paging layout in quick settings [CHAR LIMIT=60] -->
    <string name="qs_paging" translatable="false">Use the new Quick Settings</string>

    <!-- Toggles fast-toggling recents via the recents button. DO NOT TRANSLATE -->
    <string name="overview_fast_toggle_via_button">Enable fast toggle</string>
    <!-- Disables fast-toggling recents via the recents button. DO NOT TRANSLATE -->
    <string name="overview_disable_fast_toggle_via_button">Disable fast toggle</string>
    <!-- Description for the toggle for fast-toggling recents via the recents button. DO NOT TRANSLATE -->
    <string name="overview_fast_toggle_via_button_desc">Enable launch timeout while paging</string>

    <!-- Toggle to set the initial scroll state to be paging or stack. DO NOT TRANSLATE -->
    <string name="overview_initial_state_paging">Initialize to paging</string>
    <!-- Description for the toggle to set the initial scroll state to be paging or stack. DO NOT TRANSLATE -->
    <string name="overview_initial_state_paging_desc">Determines whether Overview will initially be in a stacked or paged state</string>
    <string name="overview_disable_fast_toggle_via_button_desc">Disable launch timeout while paging</string>

    <!-- Toggle to enable the gesture to enter split-screen by swiping up from the Overview button. [CHAR LIMIT=60]-->
    <string name="overview_nav_bar_gesture">Enable split-screen swipe-up accelerator</string>
+3 −8
Original line number Diff line number Diff line
@@ -113,14 +113,9 @@
        android:title="@string/overview" >

        <com.android.systemui.tuner.TunerSwitch
            android:key="overview_initial_state_paging"
            android:title="@string/overview_initial_state_paging"
            android:summary="@string/overview_initial_state_paging_desc" />

        <com.android.systemui.tuner.TunerSwitch
            android:key="overview_fast_toggle_via_button"
            android:title="@string/overview_fast_toggle_via_button"
            android:summary="@string/overview_fast_toggle_via_button_desc" />
            android:key="overview_disable_fast_toggle_via_button"
            android:title="@string/overview_disable_fast_toggle_via_button"
            android:summary="@string/overview_disable_fast_toggle_via_button_desc" />

        <com.android.systemui.tuner.TunerSwitch
            android:key="overview_nav_bar_gesture"
+8 −21
Original line number Diff line number Diff line
@@ -52,11 +52,9 @@ public class RecentsDebugFlags implements TunerService.Tunable {
        public static final int MockTaskGroupsTaskCount = 12;
    }

    private static final String KEY_FAST_TOGGLE = "overview_fast_toggle_via_button";
    private static final String KEY_INITIAL_STATE_PAGING = "overview_initial_state_paging";
    private static final String KEY_DISABLE_FAST_TOGGLE = "overview_disable_fast_toggle_via_button";

    private boolean mFastToggleRecents;
    private boolean mInitialStatePaging;
    private boolean mDisableFastToggleRecents;

    /**
     * We read the prefs once when we start the activity, then update them as the tuner changes
@@ -65,7 +63,7 @@ public class RecentsDebugFlags implements TunerService.Tunable {
    public RecentsDebugFlags(Context context) {
        // Register all our flags, this will also call onTuningChanged() for each key, which will
        // initialize the current state of each flag
        TunerService.get(context).addTunable(this, KEY_FAST_TOGGLE, KEY_INITIAL_STATE_PAGING);
        TunerService.get(context).addTunable(this, KEY_DISABLE_FAST_TOGGLE);
    }

    /**
@@ -74,32 +72,21 @@ public class RecentsDebugFlags implements TunerService.Tunable {
    public boolean isFastToggleRecentsEnabled() {
        // These checks EnableFastToggleTimeoutOverride
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (ssp.hasFreeformWorkspaceSupport() || ssp.hasDockedTask() ||
                ssp.isTouchExplorationEnabled()) {
        if (mDisableFastToggleRecents || ssp.hasFreeformWorkspaceSupport() || ssp.hasDockedTask()
                || ssp.isTouchExplorationEnabled()) {
            return false;
        }
        if (Static.EnableFastToggleTimeoutOverride) {
            return true;
        }
        return mFastToggleRecents;
    }

    /**
     * @return whether the initial stack state is paging.
     */
    public boolean isInitialStatePaging() {
        return mInitialStatePaging;
        return true;
    }

    @Override
    public void onTuningChanged(String key, String newValue) {
        switch (key) {
            case KEY_FAST_TOGGLE:
                mFastToggleRecents = (newValue != null) &&
                        (Integer.parseInt(newValue) != 0);
                break;
            case KEY_INITIAL_STATE_PAGING:
                mInitialStatePaging = (newValue != null) &&
            case KEY_DISABLE_FAST_TOGGLE:
                mDisableFastToggleRecents = (newValue != null) &&
                        (Integer.parseInt(newValue) != 0);
                break;
        }
+1 −6
Original line number Diff line number Diff line
@@ -518,13 +518,8 @@ public class TaskStackLayoutAlgorithm {
     * Returns the default focus state.
     */
    public float getDefaultFocusState() {
        RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
        RecentsDebugFlags debugFlags = Recents.getDebugFlags();
        if (launchState.launchedWithAltTab || debugFlags.isInitialStatePaging()) {
        return STATE_FOCUSED;
    }
        return STATE_UNFOCUSED;
    }

    /**
     * Returns the TaskViewTransform that would put the task just off the back of the stack.