Merge "Add fingerprint navigation to enable pulling down the statusbar" into nyc-mr1-dev
This commit is contained in:
@@ -41472,6 +41472,10 @@ package android.view {
|
|||||||
field public static final int KEYCODE_FOCUS = 80; // 0x50
|
field public static final int KEYCODE_FOCUS = 80; // 0x50
|
||||||
field public static final int KEYCODE_FORWARD = 125; // 0x7d
|
field public static final int KEYCODE_FORWARD = 125; // 0x7d
|
||||||
field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
|
field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
|
||||||
|
field public static final int KEYCODE_FP_NAV_DOWN = 281; // 0x119
|
||||||
|
field public static final int KEYCODE_FP_NAV_LEFT = 282; // 0x11a
|
||||||
|
field public static final int KEYCODE_FP_NAV_RIGHT = 283; // 0x11b
|
||||||
|
field public static final int KEYCODE_FP_NAV_UP = 280; // 0x118
|
||||||
field public static final int KEYCODE_FUNCTION = 119; // 0x77
|
field public static final int KEYCODE_FUNCTION = 119; // 0x77
|
||||||
field public static final int KEYCODE_G = 35; // 0x23
|
field public static final int KEYCODE_G = 35; // 0x23
|
||||||
field public static final int KEYCODE_GRAVE = 68; // 0x44
|
field public static final int KEYCODE_GRAVE = 68; // 0x44
|
||||||
|
|||||||
@@ -44474,6 +44474,10 @@ package android.view {
|
|||||||
field public static final int KEYCODE_FOCUS = 80; // 0x50
|
field public static final int KEYCODE_FOCUS = 80; // 0x50
|
||||||
field public static final int KEYCODE_FORWARD = 125; // 0x7d
|
field public static final int KEYCODE_FORWARD = 125; // 0x7d
|
||||||
field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
|
field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
|
||||||
|
field public static final int KEYCODE_FP_NAV_DOWN = 281; // 0x119
|
||||||
|
field public static final int KEYCODE_FP_NAV_LEFT = 282; // 0x11a
|
||||||
|
field public static final int KEYCODE_FP_NAV_RIGHT = 283; // 0x11b
|
||||||
|
field public static final int KEYCODE_FP_NAV_UP = 280; // 0x118
|
||||||
field public static final int KEYCODE_FUNCTION = 119; // 0x77
|
field public static final int KEYCODE_FUNCTION = 119; // 0x77
|
||||||
field public static final int KEYCODE_G = 35; // 0x23
|
field public static final int KEYCODE_G = 35; // 0x23
|
||||||
field public static final int KEYCODE_GRAVE = 68; // 0x44
|
field public static final int KEYCODE_GRAVE = 68; // 0x44
|
||||||
|
|||||||
@@ -41552,6 +41552,10 @@ package android.view {
|
|||||||
field public static final int KEYCODE_FOCUS = 80; // 0x50
|
field public static final int KEYCODE_FOCUS = 80; // 0x50
|
||||||
field public static final int KEYCODE_FORWARD = 125; // 0x7d
|
field public static final int KEYCODE_FORWARD = 125; // 0x7d
|
||||||
field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
|
field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
|
||||||
|
field public static final int KEYCODE_FP_NAV_DOWN = 281; // 0x119
|
||||||
|
field public static final int KEYCODE_FP_NAV_LEFT = 282; // 0x11a
|
||||||
|
field public static final int KEYCODE_FP_NAV_RIGHT = 283; // 0x11b
|
||||||
|
field public static final int KEYCODE_FP_NAV_UP = 280; // 0x118
|
||||||
field public static final int KEYCODE_FUNCTION = 119; // 0x77
|
field public static final int KEYCODE_FUNCTION = 119; // 0x77
|
||||||
field public static final int KEYCODE_G = 35; // 0x23
|
field public static final int KEYCODE_G = 35; // 0x23
|
||||||
field public static final int KEYCODE_GRAVE = 68; // 0x44
|
field public static final int KEYCODE_GRAVE = 68; // 0x44
|
||||||
|
|||||||
@@ -796,8 +796,16 @@ public class KeyEvent extends InputEvent implements Parcelable {
|
|||||||
public static final int KEYCODE_COPY = 278;
|
public static final int KEYCODE_COPY = 278;
|
||||||
/** Key code constant: Paste key. */
|
/** Key code constant: Paste key. */
|
||||||
public static final int KEYCODE_PASTE = 279;
|
public static final int KEYCODE_PASTE = 279;
|
||||||
|
/** Key code constant: fingerprint navigation up */
|
||||||
|
public static final int KEYCODE_FP_NAV_UP = 280;
|
||||||
|
/** Key code constant: fingerprint navigation down */
|
||||||
|
public static final int KEYCODE_FP_NAV_DOWN = 281;
|
||||||
|
/** Key code constant: fingerprint navigation left*/
|
||||||
|
public static final int KEYCODE_FP_NAV_LEFT = 282;
|
||||||
|
/** Key code constant: fingerprint navigation right */
|
||||||
|
public static final int KEYCODE_FP_NAV_RIGHT = 283;
|
||||||
|
|
||||||
private static final int LAST_KEYCODE = KEYCODE_PASTE;
|
private static final int LAST_KEYCODE = KEYCODE_FP_NAV_RIGHT;
|
||||||
|
|
||||||
// NOTE: If you add a new keycode here you must also add it to:
|
// NOTE: If you add a new keycode here you must also add it to:
|
||||||
// isSystem()
|
// isSystem()
|
||||||
@@ -1844,6 +1852,10 @@ public class KeyEvent extends InputEvent implements Parcelable {
|
|||||||
case KeyEvent.KEYCODE_BRIGHTNESS_DOWN:
|
case KeyEvent.KEYCODE_BRIGHTNESS_DOWN:
|
||||||
case KeyEvent.KEYCODE_BRIGHTNESS_UP:
|
case KeyEvent.KEYCODE_BRIGHTNESS_UP:
|
||||||
case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK:
|
case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK:
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_UP:
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_DOWN:
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_LEFT:
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_RIGHT:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1835,6 +1835,10 @@ i
|
|||||||
<enum name="KEYCODE_CUT" value="277" />
|
<enum name="KEYCODE_CUT" value="277" />
|
||||||
<enum name="KEYCODE_COPY" value="278" />
|
<enum name="KEYCODE_COPY" value="278" />
|
||||||
<enum name="KEYCODE_PASTE" value="279" />
|
<enum name="KEYCODE_PASTE" value="279" />
|
||||||
|
<enum name="KEYCODE_FP_NAV_UP" value="280" />
|
||||||
|
<enum name="KEYCODE_FP_NAV_DOWN" value="281" />
|
||||||
|
<enum name="KEYCODE_FP_NAV_LEFT" value="282" />
|
||||||
|
<enum name="KEYCODE_FP_NAV_RIGHT" value="283" />
|
||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<!-- ***************************************************************** -->
|
<!-- ***************************************************************** -->
|
||||||
|
|||||||
@@ -5632,6 +5632,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_DOWN:
|
||||||
|
// fall through
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_UP:
|
||||||
|
// fall through
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_LEFT:
|
||||||
|
// fall through
|
||||||
|
case KeyEvent.KEYCODE_FP_NAV_RIGHT: {
|
||||||
|
interceptStatusBarKey(event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case KeyEvent.KEYCODE_SLEEP: {
|
case KeyEvent.KEYCODE_SLEEP: {
|
||||||
result &= ~ACTION_PASS_TO_USER;
|
result &= ~ACTION_PASS_TO_USER;
|
||||||
isWakeKey = false;
|
isWakeKey = false;
|
||||||
@@ -5752,6 +5763,32 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle statusbar expansion events.
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
private void interceptStatusBarKey(KeyEvent event) {
|
||||||
|
final int e = event.getKeyCode();
|
||||||
|
if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
boolean doOpen = false;
|
||||||
|
boolean doClose = false;
|
||||||
|
doOpen = (e == KeyEvent.KEYCODE_FP_NAV_DOWN);
|
||||||
|
doClose = (e == KeyEvent.KEYCODE_FP_NAV_UP);
|
||||||
|
IStatusBarService sbar = getStatusBarService();
|
||||||
|
if (sbar != null) {
|
||||||
|
try {
|
||||||
|
if (doOpen) {
|
||||||
|
sbar.expandNotificationsPanel();
|
||||||
|
} else if (doClose) {
|
||||||
|
sbar.collapsePanels();
|
||||||
|
}
|
||||||
|
} catch (RemoteException e1) {
|
||||||
|
// oops, no statusbar. Ignore event.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the key can have global actions attached to it.
|
* Returns true if the key can have global actions attached to it.
|
||||||
* We reserve all power management keys for the system since they require
|
* We reserve all power management keys for the system since they require
|
||||||
|
|||||||
Reference in New Issue
Block a user