Add initial plumbing for brightness keys

Change-Id: I595e8a25e6c245e4b22f06df9a8acdbb75e4b041
This commit is contained in:
Michael Wright
2013-01-31 16:19:18 -08:00
parent b06870bf49
commit 1df477acf6
7 changed files with 26 additions and 5 deletions

View File

@@ -24186,6 +24186,8 @@ package android.view {
field public static final int KEYCODE_BACKSLASH = 73; // 0x49
field public static final int KEYCODE_BOOKMARK = 174; // 0xae
field public static final int KEYCODE_BREAK = 121; // 0x79
field public static final int KEYCODE_BRIGHTNESS_DOWN = 220; // 0xdc
field public static final int KEYCODE_BRIGHTNESS_UP = 221; // 0xdd
field public static final int KEYCODE_BUTTON_1 = 188; // 0xbc
field public static final int KEYCODE_BUTTON_10 = 197; // 0xc5
field public static final int KEYCODE_BUTTON_11 = 198; // 0xc6

View File

@@ -623,8 +623,14 @@ public class KeyEvent extends InputEvent implements Parcelable {
/** Key code constant: Assist key.
* Launches the global assist activity. Not delivered to applications. */
public static final int KEYCODE_ASSIST = 219;
/** Key code constant: Brightness Down key.
* Adjusts the screen brightness down. */
public static final int KEYCODE_BRIGHTNESS_DOWN = 220;
/** Key code constant: Brightness Up key.
* Adjusts the screen brightness up. */
public static final int KEYCODE_BRIGHTNESS_UP = 221;
private static final int LAST_KEYCODE = KEYCODE_ASSIST;
private static final int LAST_KEYCODE = KEYCODE_BRIGHTNESS_UP;
// NOTE: If you add a new keycode here you must also add it to:
// isSystem()
@@ -866,6 +872,8 @@ public class KeyEvent extends InputEvent implements Parcelable {
names.append(KEYCODE_RO, "KEYCODE_RO");
names.append(KEYCODE_KANA, "KEYCODE_KANA");
names.append(KEYCODE_ASSIST, "KEYCODE_ASSIST");
names.append(KEYCODE_BRIGHTNESS_DOWN, "KEYCODE_BRIGHTNESS_DOWN");
names.append(KEYCODE_BRIGHTNESS_UP, "KEYCODE_BRIGHTNESS_UP");
};
// Symbolic names of all metakeys in bit order from least significant to most significant.

View File

@@ -1542,6 +1542,8 @@
<enum name="KEYCODE_RO" value="217" />
<enum name="KEYCODE_KANA" value="218" />
<enum name="KEYCODE_ASSIST" value="219" />
<enum name="KEYCODE_BRIGHTNESS_DOWN" value="220" />
<enum name="KEYCODE_BRIGHTNESS_UP" value="221" />
</attr>
<!-- ***************************************************************** -->

View File

@@ -243,8 +243,8 @@ key 217 SEARCH
# key 221 "KEY_SHOP"
# key 222 "KEY_ALTERASE"
# key 223 "KEY_CANCEL"
# key 224 "KEY_BRIGHTNESSDOWN"
# key 225 "KEY_BRIGHTNESSUP"
key 224 BRIGHTNESS_DOWN
key 225 BRIGHTNESS_UP
key 226 HEADSETHOOK
key 256 BUTTON_1
@@ -404,6 +404,9 @@ key 484 B FUNCTION
# key 503 KEY_BRL_DOT7
# key 504 KEY_BRL_DOT8
# Keys defined by HID usages
key usage 0x0c006F BRIGHTNESS_UP
key usage 0x0c0070 BRIGHTNESS_DOWN
# Joystick and game controller axes.
# Axes that are not mapped will be assigned generic axis numbers by the input subsystem.

View File

@@ -112,8 +112,8 @@ key 163 MEDIA_NEXT
key 164 MEDIA_PLAY_PAUSE
key 165 MEDIA_PREVIOUS
# key 204 show gadgets
# key 224 reduce brightness
# key 225 increase brightness
key 224 BRIGHTNESS_DOWN
key 225 BRIGHTNESS_UP
# key 229 blank special function on F5
# key 230 blank special function on F6
key 464 FUNCTION

View File

@@ -244,6 +244,8 @@ static const KeycodeLabel KEYCODES[] = {
{ "RO", 217 },
{ "KANA", 218 },
{ "ASSIST", 219 },
{ "BRIGHTNESS_DOWN", 220 },
{ "BRIGHTNESS_UP", 221 },
// NOTE: If you add a new keycode here you must also add it to several other files.
// Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.

View File

@@ -72,6 +72,8 @@ bool KeyEvent::hasDefaultAction(int32_t keyCode) {
case AKEYCODE_MEDIA_RECORD:
case AKEYCODE_MEDIA_FAST_FORWARD:
case AKEYCODE_MUTE:
case AKEYCODE_BRIGHTNESS_DOWN:
case AKEYCODE_BRIGHTNESS_UP:
return true;
}
@@ -108,6 +110,8 @@ bool KeyEvent::isSystemKey(int32_t keyCode) {
case AKEYCODE_CAMERA:
case AKEYCODE_FOCUS:
case AKEYCODE_SEARCH:
case AKEYCODE_BRIGHTNESS_DOWN:
case AKEYCODE_BRIGHTNESS_UP:
return true;
}