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

Commit 98c4f1fb authored by Yash Garg's avatar Yash Garg 💬 Committed by Nishith Khanna
Browse files

Remove split screen option from recents long press actions

- Set app switch action to nothing if it's set to split screen
parent dac08ce7
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@
        <item>@string/hardware_keys_action_launch_camera</item>
        <item>@string/hardware_keys_action_sleep</item>
        <item>@string/hardware_keys_action_last_app</item>
        <item>@string/hardware_keys_action_split_screen</item>
        <item>@string/hardware_keys_action_kill_app</item>
        <item>@string/hardware_keys_action_play_pause_music</item>
    </string-array>
@@ -96,7 +95,6 @@
        <item>6</item>
        <item>7</item>
        <item>8</item>
        <item>9</item>
        <item>10</item>
        <item>11</item>
    </string-array>
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public class BootReceiver extends BroadcastReceiver {
        }

        ButtonSettings.restoreKeyDisabler(ctx);
        ButtonSettings.setLongPressActionToNothing(ctx);
        ButtonSettings.restoreKeySwapper(ctx);
        TouchscreenGestureSettings.restoreTouchscreenGestureStates(ctx);

+12 −0
Original line number Diff line number Diff line
@@ -794,6 +794,18 @@ public class ButtonSettings extends SettingsPreferenceFragment
                preferences.getBoolean(KEY_SWAP_CAPACITIVE_KEYS, false));
    }

    public static void setLongPressActionToNothing(Context context) {
        final int action = LineageSettings.System.getIntForUser(context.getContentResolver(),
                LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION, context.getResources().getInteger(
                org.lineageos.platform.internal.R.integer.config_longPressOnAppSwitchBehavior),
                UserHandle.USER_CURRENT);

        if (action == Action.SPLIT_SCREEN.ordinal()) {
            LineageSettings.System.putInt(context.getContentResolver(),
                LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION, Action.NOTHING.ordinal());
        }
    }

    @Override
    public boolean onPreferenceTreeClick(Preference preference) {
        if (preference == mSwapVolumeButtons) {