CMParts: Long-press power while display is off for torch
Add the switch for the following gesture:
Long-press the power button while the display is off
to switch the torchlight on.
Press the power button again to switch it off.
Serhij Kyryljan: Port to CMParts.
Change-Id: I657c5fee6944e4a1e087e0c9e10fd43e5c8ea7f5
diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml
index 544dc00..ad28e0c 100644
--- a/res/xml/button_settings.xml
+++ b/res/xml/button_settings.xml
@@ -15,6 +15,7 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:cm="http://schemas.android.com/apk/res/cyanogenmod.platform"
android:key="button_settings"
android:title="@string/button_pref_title">
@@ -91,6 +92,13 @@
android:summary="@string/power_end_call_summary"
android:persistent="false"/>
+ <cyanogenmod.preference.CMSystemSettingSwitchPreference
+ android:key="torch_long_press_power_gesture"
+ android:title="@string/torch_long_press_power_gesture_title"
+ android:summary="@string/torch_long_press_power_gesture_desc"
+ android:defaultValue="false"
+ cm:requiresConfig="@*android:bool/config_supportLongPressPowerWhenNonInteractive" />
+
</PreferenceCategory>
<PreferenceCategory