Revert "Allow doubletap/longpress power to toggle torch [2/2]"

This reverts commit 08476c3827.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Hưng Phan
2021-12-25 02:51:21 +07:00
parent 8983c890d0
commit cf692e35b0
4 changed files with 1 additions and 45 deletions

View File

@@ -12,18 +12,6 @@
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Torch Power button gestures -->
<string-array name="torch_power_button_gesture_entries">
<item>@string/torch_power_button_gesture_none</item>
<item>@string/torch_power_button_gesture_dt</item>
<item>@string/torch_power_button_gesture_lp</item>
</string-array>
<string-array name="torch_power_button_gesture_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<!-- Heads up timeout -->
<string-array name="heads_up_time_out_entries" translatable="false">

View File

@@ -167,13 +167,6 @@
<string name="volume_rocker_music_controls_title">Music control</string>
<string name="volume_rocker_music_controls_summary">Long press volume buttons to switch tracks while screen off</string>
<!-- Torch Power button gestures -->
<string name="torch_power_button_gesture_title">Toggle torch when screen off</string>
<string name="torch_power_button_gesture_none">Disabled</string>
<string name="torch_power_button_gesture_dt">Double tap power button (slower single tap response), Disables double power tap for camera.</string>
<string name="torch_power_button_gesture_dt_toast">Jump to camera gesture is now disabled</string>
<string name="torch_power_button_gesture_lp">Long press power button</string>
<!-- Hardware button navigation -->
<string name="action_value_default_action" translatable="false">default</string>
<string name="action_value_select_app" translatable="false">app</string>

View File

@@ -220,12 +220,6 @@
</com.cherish.settings.preferences.ActionPreference>
</PreferenceCategory>
<ListPreference
android:key="torch_power_button_gesture"
android:title="@string/torch_power_button_gesture_title"
android:entries="@array/torch_power_button_gesture_entries"
android:entryValues="@array/torch_power_button_gesture_values" />
</PreferenceScreen>

View File

@@ -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);