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:
@@ -13,18 +13,6 @@
|
|||||||
-->
|
-->
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
<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 -->
|
<!-- Heads up timeout -->
|
||||||
<string-array name="heads_up_time_out_entries" translatable="false">
|
<string-array name="heads_up_time_out_entries" translatable="false">
|
||||||
<item>@string/heads_up_time_out_2sec</item>
|
<item>@string/heads_up_time_out_2sec</item>
|
||||||
|
|||||||
@@ -167,13 +167,6 @@
|
|||||||
<string name="volume_rocker_music_controls_title">Music control</string>
|
<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>
|
<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 -->
|
<!-- Hardware button navigation -->
|
||||||
<string name="action_value_default_action" translatable="false">default</string>
|
<string name="action_value_default_action" translatable="false">default</string>
|
||||||
<string name="action_value_select_app" translatable="false">app</string>
|
<string name="action_value_select_app" translatable="false">app</string>
|
||||||
|
|||||||
@@ -221,11 +221,5 @@
|
|||||||
|
|
||||||
</PreferenceCategory>
|
</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>
|
</PreferenceScreen>
|
||||||
@@ -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_CAMERA = 0x20;
|
||||||
public static final int KEY_MASK_VOLUME = 0x40;
|
public static final int KEY_MASK_VOLUME = 0x40;
|
||||||
|
|
||||||
private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture";
|
|
||||||
|
|
||||||
private SwitchPreference mHwKeyDisable;
|
private SwitchPreference mHwKeyDisable;
|
||||||
private ListPreference mTorchPowerButton;
|
|
||||||
private CustomSeekBarPreference mButtonTimoutBar;
|
private CustomSeekBarPreference mButtonTimoutBar;
|
||||||
private CustomSeekBarPreference mManualButtonBrightness;
|
private CustomSeekBarPreference mManualButtonBrightness;
|
||||||
private PreferenceCategory mButtonBackLightCategory;
|
private PreferenceCategory mButtonBackLightCategory;
|
||||||
@@ -164,14 +161,6 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange
|
|||||||
// load preferences first
|
// load preferences first
|
||||||
setActionPreferencesEnabled(keysDisabled == 0);
|
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(
|
mManualButtonBrightness = (CustomSeekBarPreference) findPreference(
|
||||||
KEY_BUTTON_MANUAL_BRIGHTNESS_NEW);
|
KEY_BUTTON_MANUAL_BRIGHTNESS_NEW);
|
||||||
final int customButtonBrightness = getResources().getInteger(
|
final int customButtonBrightness = getResources().getInteger(
|
||||||
@@ -201,15 +190,7 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange
|
|||||||
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
ContentResolver resolver = getActivity().getContentResolver();
|
ContentResolver resolver = getActivity().getContentResolver();
|
||||||
if (preference == mTorchPowerButton) {
|
if (preference == mHwKeyDisable) {
|
||||||
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) {
|
|
||||||
boolean value = (Boolean) newValue;
|
boolean value = (Boolean) newValue;
|
||||||
Settings.System.putInt(getContentResolver(), Settings.System.HARDWARE_KEYS_DISABLE,
|
Settings.System.putInt(getContentResolver(), Settings.System.HARDWARE_KEYS_DISABLE,
|
||||||
value ? 1 : 0);
|
value ? 1 : 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user