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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user