summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anthony Hugh <ahugh@google.com> 2015-06-23 10:44:17 -0700
committer Anthony Hugh <ahugh@google.com> 2015-06-24 16:13:19 -0700
commit001df9ca900f3098222a4920a0048d2eb947bd4e (patch)
tree2d4adf4d8950c73cd541917400348616cf469782
parent65dca454c7a717b001b51d0089e7565ba428ce87 (diff)
DO NOT MERGE: Introduce stem keycodes for Wear
Cherry-pick from master This change adds four new stem keycodes for Android Wear. These keycodes are intended to represent the various hardware buttons around the watch. There is one primary stem key that will be used for power/settings and three generic stem keys that will be customizable. BUG: 21903503 Change-Id: I867cf79554c72d42c8acbb3ff8b1678e482d4fe2
-rw-r--r--core/java/android/view/KeyEvent.java17
-rw-r--r--core/res/res/values/attrs.xml4
2 files changed, 19 insertions, 2 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 243a0fc17e52..69287b18b81e 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -748,8 +748,21 @@ public class KeyEvent extends InputEvent implements Parcelable {
public static final int KEYCODE_TV_TIMER_PROGRAMMING = 258;
/** Key code constant: Help key. */
public static final int KEYCODE_HELP = 259;
-
- private static final int LAST_KEYCODE = KEYCODE_HELP;
+ /** Key code constant: Primary stem key for Wear
+ * Main power/reset button on watch.
+ * @hide */
+ public static final int KEYCODE_STEM_PRIMARY = 264;
+ /** Key code constant: Generic stem key 1 for Wear
+ * @hide */
+ public static final int KEYCODE_STEM_1 = 265;
+ /** Key code constant: Generic stem key 2 for Wear
+ * @hide */
+ public static final int KEYCODE_STEM_2 = 266;
+ /** Key code constant: Generic stem key 3 for Wear
+ * @hide */
+ public static final int KEYCODE_STEM_3 = 267;
+
+ private static final int LAST_KEYCODE = KEYCODE_STEM_3;
// NOTE: If you add a new keycode here you must also add it to:
// isSystem()
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 8492eaa0dd53..ee6eef2d091a 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1778,6 +1778,10 @@
<enum name="KEYCODE_TV_MEDIA_CONTEXT_MENU" value="257" />
<enum name="KEYCODE_TV_TIMER_PROGRAMMING" value="258" />
<enum name="KEYCODE_HELP" value="259" />
+ <enum name="KEYCODE_STEM_PRIMARY" value="264" />
+ <enum name="KEYCODE_STEM_1" value="265" />
+ <enum name="KEYCODE_STEM_2" value="266" />
+ <enum name="KEYCODE_STEM_3" value="267" />
</attr>
<!-- ***************************************************************** -->