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

Commit 866c4fb0 authored by Yash Garg's avatar Yash Garg 💬
Browse files

Merge branch '3674-r-split_screen_test' into 'v1-r'

Set app switch action to nothing if it's set to split screen (R)

See merge request !29
parents 4065aa56 6c9e407b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ public class BootReceiver extends BroadcastReceiver {
            setRestoredTunable(ctx);
        }

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

+12 −0
Original line number Diff line number Diff line
@@ -792,6 +792,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) {