Loading src/org/lineageos/lineageparts/input/ButtonSettings.java +1 −21 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2016 The CyanogenMod project * SPDX-FileCopyrightText: 2017-2024 The LineageOS project * SPDX-FileCopyrightText: 2017-2025 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ package org.lineageos.lineageparts.input; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY; Loading Loading @@ -655,10 +654,6 @@ public class ButtonSettings extends SettingsPreferenceFragment return true; } else if (preference == mEnableTaskbar) { toggleTaskBarDependencies((Boolean) newValue); if ((Boolean) newValue && is2ButtonNavigationEnabled(requireContext())) { // Let's switch to gestural mode if user previously had 2 buttons enabled. setButtonNavigationMode(NAV_BAR_MODE_GESTURAL_OVERLAY); } LineageSettings.System.putInt(getContentResolver(), LineageSettings.System.ENABLE_TASKBAR, ((Boolean) newValue) ? 1 : 0); return true; Loading @@ -666,11 +661,6 @@ public class ButtonSettings extends SettingsPreferenceFragment return false; } private static boolean is2ButtonNavigationEnabled(Context context) { return NAV_BAR_MODE_2BUTTON == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } private static void setButtonNavigationMode(String overlayPackage) { IOverlayManager overlayManager = IOverlayManager.Stub.asInterface( ServiceManager.getService(Context.OVERLAY_SERVICE)); Loading Loading @@ -744,13 +734,6 @@ public class ButtonSettings extends SettingsPreferenceFragment mNavigationPreferencesCat.removePreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.removePreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.removePreference(mNavigationAppSwitchLongPressAction); } else if (DeviceUtils.isSwipeUpEnabled(getContext())) { mNavigationPreferencesCat.addPreference(mNavigationBackLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.removePreference(mNavigationAppSwitchLongPressAction); mNavigationPreferencesCat.removePreference(mEdgeLongSwipeAction); } else { mNavigationPreferencesCat.addPreference(mNavigationBackLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeLongPressAction); Loading Loading @@ -998,9 +981,6 @@ public class ButtonSettings extends SettingsPreferenceFragment result.add(KEY_NAVIGATION_HOME_LONG_PRESS); result.add(KEY_NAVIGATION_HOME_DOUBLE_TAP); result.add(KEY_NAVIGATION_APP_SWITCH_LONG_PRESS); } else if (DeviceUtils.isSwipeUpEnabled(context)) { result.add(KEY_NAVIGATION_APP_SWITCH_LONG_PRESS); result.add(KEY_EDGE_LONG_SWIPE); } else { result.add(KEY_EDGE_LONG_SWIPE); } Loading src/org/lineageos/lineageparts/utils/DeviceUtils.java +1 −9 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2016 The CyanogenMod project * SPDX-FileCopyrightText: 2017-2023 The LineageOS project * SPDX-FileCopyrightText: 2017-2025 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ package org.lineageos.lineageparts.utils; Loading Loading @@ -270,14 +270,6 @@ public class DeviceUtils { return telephonyManager.createForSubscriptionId(subId).isDataEnabled(); } public static boolean isSwipeUpEnabled(Context context) { if (isEdgeToEdgeEnabled(context)) { return false; } return NAV_BAR_MODE_2BUTTON == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } public static boolean isEdgeToEdgeEnabled(Context context) { return NAV_BAR_MODE_GESTURAL == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); Loading Loading
src/org/lineageos/lineageparts/input/ButtonSettings.java +1 −21 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2016 The CyanogenMod project * SPDX-FileCopyrightText: 2017-2024 The LineageOS project * SPDX-FileCopyrightText: 2017-2025 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ package org.lineageos.lineageparts.input; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY; Loading Loading @@ -655,10 +654,6 @@ public class ButtonSettings extends SettingsPreferenceFragment return true; } else if (preference == mEnableTaskbar) { toggleTaskBarDependencies((Boolean) newValue); if ((Boolean) newValue && is2ButtonNavigationEnabled(requireContext())) { // Let's switch to gestural mode if user previously had 2 buttons enabled. setButtonNavigationMode(NAV_BAR_MODE_GESTURAL_OVERLAY); } LineageSettings.System.putInt(getContentResolver(), LineageSettings.System.ENABLE_TASKBAR, ((Boolean) newValue) ? 1 : 0); return true; Loading @@ -666,11 +661,6 @@ public class ButtonSettings extends SettingsPreferenceFragment return false; } private static boolean is2ButtonNavigationEnabled(Context context) { return NAV_BAR_MODE_2BUTTON == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } private static void setButtonNavigationMode(String overlayPackage) { IOverlayManager overlayManager = IOverlayManager.Stub.asInterface( ServiceManager.getService(Context.OVERLAY_SERVICE)); Loading Loading @@ -744,13 +734,6 @@ public class ButtonSettings extends SettingsPreferenceFragment mNavigationPreferencesCat.removePreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.removePreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.removePreference(mNavigationAppSwitchLongPressAction); } else if (DeviceUtils.isSwipeUpEnabled(getContext())) { mNavigationPreferencesCat.addPreference(mNavigationBackLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.removePreference(mNavigationAppSwitchLongPressAction); mNavigationPreferencesCat.removePreference(mEdgeLongSwipeAction); } else { mNavigationPreferencesCat.addPreference(mNavigationBackLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeLongPressAction); Loading Loading @@ -998,9 +981,6 @@ public class ButtonSettings extends SettingsPreferenceFragment result.add(KEY_NAVIGATION_HOME_LONG_PRESS); result.add(KEY_NAVIGATION_HOME_DOUBLE_TAP); result.add(KEY_NAVIGATION_APP_SWITCH_LONG_PRESS); } else if (DeviceUtils.isSwipeUpEnabled(context)) { result.add(KEY_NAVIGATION_APP_SWITCH_LONG_PRESS); result.add(KEY_EDGE_LONG_SWIPE); } else { result.add(KEY_EDGE_LONG_SWIPE); } Loading
src/org/lineageos/lineageparts/utils/DeviceUtils.java +1 −9 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2016 The CyanogenMod project * SPDX-FileCopyrightText: 2017-2023 The LineageOS project * SPDX-FileCopyrightText: 2017-2025 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ package org.lineageos.lineageparts.utils; Loading Loading @@ -270,14 +270,6 @@ public class DeviceUtils { return telephonyManager.createForSubscriptionId(subId).isDataEnabled(); } public static boolean isSwipeUpEnabled(Context context) { if (isEdgeToEdgeEnabled(context)) { return false; } return NAV_BAR_MODE_2BUTTON == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } public static boolean isEdgeToEdgeEnabled(Context context) { return NAV_BAR_MODE_GESTURAL == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); Loading