[2/2] OmniGears: hardware button enhancement
-added "go to sleep" action
-cancel "kill app" action if finger lifted before timeout
Change-Id: I49d6c54580c6cd05ed02b4c15ae6daa60e574609
diff --git a/res/values/custom_arrays.xml b/res/values/custom_arrays.xml
index 8675a5b..d632f6a 100644
--- a/res/values/custom_arrays.xml
+++ b/res/values/custom_arrays.xml
@@ -108,6 +108,7 @@
<item>@string/keys_action_in_app_search</item>
<item>@string/keys_action_last_app</item>
<item>@string/keys_action_kill_app</item>
+ <item>@string/keys_action_sleep</item>
</string-array>
<string-array name="keys_action_values" translatable="false">
@@ -121,6 +122,7 @@
<item>5</item>
<item>8</item>
<item>9</item>
+ <item>10</item>
</string-array>
<!-- ActiveDisplay Notifications -->
diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml
index 14ae512..f9b45ad 100644
--- a/res/values/custom_strings.xml
+++ b/res/values/custom_strings.xml
@@ -203,6 +203,7 @@
<string name="keys_action_back">Back button</string>
<string name="keys_action_last_app">Switch to last app</string>
<string name="keys_action_kill_app">Kill app</string>
+ <string name="keys_action_sleep">Go to sleep</string>
<string name="keys_action_normal">Normal press</string>
<string name="keys_action_long">Long press</string>
<string name="keys_action_double">Double tap</string>
diff --git a/src/org/omnirom/omnigears/ButtonSettings.java b/src/org/omnirom/omnigears/ButtonSettings.java
index fd2e2b7..2ec08ef 100644
--- a/src/org/omnirom/omnigears/ButtonSettings.java
+++ b/src/org/omnirom/omnigears/ButtonSettings.java
@@ -104,6 +104,7 @@
private static final int ACTION_BACK = 7;
private static final int ACTION_LAST_APP = 8;
private static final int ACTION_KILL_APP = 9;
+ private static final int ACTION_SLEEP = 10;
// Masks for checking presence of hardware keys.
// Must match values in frameworks/base/core/res/res/values/config.xml