CMParts: buttons: Remove double tap power for camera setting
We have this in the AOSP gesture settings.
Change-Id: I25693111a28c1da2dbc53fc01b0fc6d4a4f80256
diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml
index a4b4c9f..544dc00 100644
--- a/res/xml/button_settings.xml
+++ b/res/xml/button_settings.xml
@@ -91,12 +91,6 @@
android:summary="@string/power_end_call_summary"
android:persistent="false"/>
- <SwitchPreference
- android:key="camera_double_tap_power_gesture"
- android:title="@string/camera_double_tap_power_gesture_title"
- android:summary="@string/camera_double_tap_power_gesture_desc"
- android:persistent="false" />
-
</PreferenceCategory>
<PreferenceCategory
diff --git a/src/org/cyanogenmod/cmparts/input/ButtonSettings.java b/src/org/cyanogenmod/cmparts/input/ButtonSettings.java
index 5c8b9de..6573ba5 100644
--- a/src/org/cyanogenmod/cmparts/input/ButtonSettings.java
+++ b/src/org/cyanogenmod/cmparts/input/ButtonSettings.java
@@ -49,8 +49,6 @@
import cyanogenmod.hardware.CMHardwareManager;
import cyanogenmod.providers.CMSettings;
-import static android.provider.Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED;
-
public class ButtonSettings extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener {
private static final String TAG = "SystemSettings";
@@ -75,8 +73,6 @@
private static final String KEY_HOME_ANSWER_CALL = "home_answer_call";
private static final String KEY_VOLUME_MUSIC_CONTROLS = "volbtn_music_controls";
private static final String KEY_VOLUME_CONTROL_RING_STREAM = "volume_keys_control_ring_stream";
- private static final String KEY_CAMERA_DOUBLE_TAP_POWER_GESTURE
- = "camera_double_tap_power_gesture";
private static final String CATEGORY_POWER = "power_key";
private static final String CATEGORY_HOME = "home_key";
@@ -148,7 +144,6 @@
private ListPreference mNavigationRecentsLongPressAction;
private SwitchPreference mPowerEndCall;
private SwitchPreference mHomeAnswerCall;
- private SwitchPreference mCameraDoubleTapPowerGesture;
private PreferenceCategory mNavigationPreferencesCat;
@@ -207,10 +202,6 @@
// Power button ends calls.
mPowerEndCall = (SwitchPreference) findPreference(KEY_POWER_END_CALL);
- // Double press power to launch camera.
- mCameraDoubleTapPowerGesture
- = (SwitchPreference) findPreference(KEY_CAMERA_DOUBLE_TAP_POWER_GESTURE);
-
// Home button answers calls.
mHomeAnswerCall = (SwitchPreference) findPreference(KEY_HOME_ANSWER_CALL);
@@ -283,17 +274,6 @@
powerCategory.removePreference(mPowerEndCall);
mPowerEndCall = null;
}
- if (mCameraDoubleTapPowerGesture != null &&
- isCameraDoubleTapPowerGestureAvailable(getResources())) {
- // Update double tap power to launch camera if available.
- mCameraDoubleTapPowerGesture.setOnPreferenceChangeListener(this);
- int cameraDoubleTapPowerDisabled = Settings.Secure.getInt(
- getContentResolver(), CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0);
- mCameraDoubleTapPowerGesture.setChecked(cameraDoubleTapPowerDisabled == 0);
- } else {
- powerCategory.removePreference(mCameraDoubleTapPowerGesture);
- mCameraDoubleTapPowerGesture = null;
- }
} else {
prefScreen.removePreference(powerCategory);
}
@@ -639,11 +619,6 @@
CMSettings.Secure.putString(getContentResolver(),
CMSettings.Secure.RECENTS_LONG_PRESS_ACTIVITY, putString);
return true;
- } else if (preference == mCameraDoubleTapPowerGesture) {
- boolean value = (Boolean) newValue;
- Settings.Secure.putInt(getContentResolver(), CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
- value ? 0 : 1 /* Backwards because setting is for disabling */);
- return true;
}
return false;
}
@@ -758,9 +733,4 @@
? CMSettings.Secure.RING_HOME_BUTTON_BEHAVIOR_ANSWER
: CMSettings.Secure.RING_HOME_BUTTON_BEHAVIOR_DO_NOTHING));
}
-
- private static boolean isCameraDoubleTapPowerGestureAvailable(Resources res) {
- return res.getBoolean(
- com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled);
- }
}