From cf692e35b09baa167aee3445daab61e442acd08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C6=B0ng=20Phan?= Date: Sat, 25 Dec 2021 02:51:21 +0700 Subject: [PATCH] Revert "Allow doubletap/longpress power to toggle torch [2/2]" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 08476c3827b823f0509268375d3a2c49fb8db8e2. Signed-off-by: Hưng Phan --- res/values/cherish_arrays.xml | 12 ----------- res/values/cherish_strings.xml | 7 ------- res/xml/cherish_settings_button.xml | 6 ------ .../settings/fragments/ButtonSettings.java | 21 +------------------ 4 files changed, 1 insertion(+), 45 deletions(-) diff --git a/res/values/cherish_arrays.xml b/res/values/cherish_arrays.xml index 081432f..9aaa3e6 100644 --- a/res/values/cherish_arrays.xml +++ b/res/values/cherish_arrays.xml @@ -12,18 +12,6 @@ limitations under the License. --> - - - - @string/torch_power_button_gesture_none - @string/torch_power_button_gesture_dt - @string/torch_power_button_gesture_lp - - - 0 - 1 - 2 - diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index 59b6f68..9085755 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -167,13 +167,6 @@ Music control Long press volume buttons to switch tracks while screen off - - Toggle torch when screen off - Disabled - Double tap power button (slower single tap response), Disables double power tap for camera. - Jump to camera gesture is now disabled - Long press power button - default app diff --git a/res/xml/cherish_settings_button.xml b/res/xml/cherish_settings_button.xml index bfb8a54..9e3bdf3 100644 --- a/res/xml/cherish_settings_button.xml +++ b/res/xml/cherish_settings_button.xml @@ -220,12 +220,6 @@ - - \ No newline at end of file diff --git a/src/com/cherish/settings/fragments/ButtonSettings.java b/src/com/cherish/settings/fragments/ButtonSettings.java index 0dbbbec..de290c7 100644 --- a/src/com/cherish/settings/fragments/ButtonSettings.java +++ b/src/com/cherish/settings/fragments/ButtonSettings.java @@ -85,10 +85,7 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange public static final int KEY_MASK_CAMERA = 0x20; public static final int KEY_MASK_VOLUME = 0x40; - private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture"; - private SwitchPreference mHwKeyDisable; - private ListPreference mTorchPowerButton; private CustomSeekBarPreference mButtonTimoutBar; private CustomSeekBarPreference mManualButtonBrightness; private PreferenceCategory mButtonBackLightCategory; @@ -164,14 +161,6 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange // load preferences first setActionPreferencesEnabled(keysDisabled == 0); - // screen off torch - mTorchPowerButton = (ListPreference) findPreference(TORCH_POWER_BUTTON_GESTURE); - int mTorchPowerButtonValue = Settings.System.getInt(resolver, - Settings.System.TORCH_POWER_BUTTON_GESTURE, 0); - mTorchPowerButton.setValue(Integer.toString(mTorchPowerButtonValue)); - mTorchPowerButton.setSummary(mTorchPowerButton.getEntry()); - mTorchPowerButton.setOnPreferenceChangeListener(this); - mManualButtonBrightness = (CustomSeekBarPreference) findPreference( KEY_BUTTON_MANUAL_BRIGHTNESS_NEW); final int customButtonBrightness = getResources().getInteger( @@ -201,15 +190,7 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange public boolean onPreferenceChange(Preference preference, Object newValue) { ContentResolver resolver = getActivity().getContentResolver(); - if (preference == mTorchPowerButton) { - int mTorchPowerButtonValue = Integer.valueOf((String) newValue); - int index = mTorchPowerButton.findIndexOfValue((String) newValue); - mTorchPowerButton.setSummary( - mTorchPowerButton.getEntries()[index]); - Settings.System.putInt(resolver, Settings.System.TORCH_POWER_BUTTON_GESTURE, - mTorchPowerButtonValue); - return true; - } else if (preference == mHwKeyDisable) { + if (preference == mHwKeyDisable) { boolean value = (Boolean) newValue; Settings.System.putInt(getContentResolver(), Settings.System.HARDWARE_KEYS_DISABLE, value ? 1 : 0);