Loading core/java/android/view/WindowManagerPolicy.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -73,6 +73,7 @@ public interface WindowManagerPolicy { public final static int FLAG_ALT_GR = 0x00000020; public final static int FLAG_ALT_GR = 0x00000020; public final static int FLAG_MENU = 0x00000040; public final static int FLAG_MENU = 0x00000040; public final static int FLAG_LAUNCHER = 0x00000080; public final static int FLAG_LAUNCHER = 0x00000080; public final static int FLAG_VIRTUAL = 0x00000100; public final static int FLAG_INJECTED = 0x01000000; public final static int FLAG_INJECTED = 0x01000000; Loading include/ui/Input.h +3 −1 Original line number Original line Diff line number Diff line Loading @@ -73,7 +73,8 @@ namespace android { * policy decisions such as waking from device sleep. * policy decisions such as waking from device sleep. */ */ enum { enum { /* These flags originate in RawEvents and are generally set in the key map. */ /* These flags originate in RawEvents and are generally set in the key map. * See also labels for policy flags in KeycodeLabels.h. */ POLICY_FLAG_WAKE = 0x00000001, POLICY_FLAG_WAKE = 0x00000001, POLICY_FLAG_WAKE_DROPPED = 0x00000002, POLICY_FLAG_WAKE_DROPPED = 0x00000002, Loading @@ -83,6 +84,7 @@ enum { POLICY_FLAG_ALT_GR = 0x00000020, POLICY_FLAG_ALT_GR = 0x00000020, POLICY_FLAG_MENU = 0x00000040, POLICY_FLAG_MENU = 0x00000040, POLICY_FLAG_LAUNCHER = 0x00000080, POLICY_FLAG_LAUNCHER = 0x00000080, POLICY_FLAG_VIRTUAL = 0x00000100, POLICY_FLAG_RAW_MASK = 0x0000ffff, POLICY_FLAG_RAW_MASK = 0x0000ffff, Loading include/ui/InputReader.h +0 −4 Original line number Original line Diff line number Diff line Loading @@ -103,10 +103,6 @@ public: virtual bool getDisplayInfo(int32_t displayId, virtual bool getDisplayInfo(int32_t displayId, int32_t* width, int32_t* height, int32_t* orientation) = 0; int32_t* width, int32_t* height, int32_t* orientation) = 0; /* Provides feedback for a virtual key down. */ virtual void virtualKeyDownFeedback() = 0; /* Intercepts a key event. /* Intercepts a key event. * The policy can use this method as an opportunity to perform power management functions * The policy can use this method as an opportunity to perform power management functions * and early event preprocessing such as updating policy flags. * and early event preprocessing such as updating policy flags. Loading include/ui/KeycodeLabels.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -142,6 +142,7 @@ static const KeycodeLabel KEYCODES[] = { { NULL, 0 } { NULL, 0 } }; }; // See also policy flags in Input.h. static const KeycodeLabel FLAGS[] = { static const KeycodeLabel FLAGS[] = { { "WAKE", 0x00000001 }, { "WAKE", 0x00000001 }, { "WAKE_DROPPED", 0x00000002 }, { "WAKE_DROPPED", 0x00000002 }, Loading @@ -151,6 +152,7 @@ static const KeycodeLabel FLAGS[] = { { "ALT_GR", 0x00000020 }, { "ALT_GR", 0x00000020 }, { "MENU", 0x00000040 }, { "MENU", 0x00000040 }, { "LAUNCHER", 0x00000080 }, { "LAUNCHER", 0x00000080 }, { "VIRTUAL", 0x00000100 }, { NULL, 0 } { NULL, 0 } }; }; Loading libs/ui/InputReader.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -993,7 +993,10 @@ void KeyboardInputMapper::applyPolicyAndDispatch(nsecs_t when, uint32_t policyFl int32_t keyEventAction = down ? AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP; int32_t keyEventAction = down ? AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP; int32_t keyEventFlags = AKEY_EVENT_FLAG_FROM_SYSTEM; int32_t keyEventFlags = AKEY_EVENT_FLAG_FROM_SYSTEM; if (policyFlags & POLICY_FLAG_WOKE_HERE) { if (policyFlags & POLICY_FLAG_WOKE_HERE) { keyEventFlags = keyEventFlags | AKEY_EVENT_FLAG_WOKE_HERE; keyEventFlags |= AKEY_EVENT_FLAG_WOKE_HERE; } if (policyFlags & POLICY_FLAG_VIRTUAL) { keyEventFlags |= AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY; } } getDispatcher()->notifyKey(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, policyFlags, getDispatcher()->notifyKey(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, policyFlags, Loading Loading @@ -2162,10 +2165,7 @@ void TouchInputMapper::applyPolicyAndDispatchVirtualKey(nsecs_t when, uint32_t p int32_t keyCode, int32_t scanCode, nsecs_t downTime) { int32_t keyCode, int32_t scanCode, nsecs_t downTime) { int32_t metaState = mContext->getGlobalMetaState(); int32_t metaState = mContext->getGlobalMetaState(); if (keyEventAction == AKEY_EVENT_ACTION_DOWN) { policyFlags |= POLICY_FLAG_VIRTUAL; getPolicy()->virtualKeyDownFeedback(); } int32_t policyActions = getPolicy()->interceptKey(when, getDeviceId(), int32_t policyActions = getPolicy()->interceptKey(when, getDeviceId(), keyEventAction == AKEY_EVENT_ACTION_DOWN, keyCode, scanCode, policyFlags); keyEventAction == AKEY_EVENT_ACTION_DOWN, keyCode, scanCode, policyFlags); Loading Loading
core/java/android/view/WindowManagerPolicy.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -73,6 +73,7 @@ public interface WindowManagerPolicy { public final static int FLAG_ALT_GR = 0x00000020; public final static int FLAG_ALT_GR = 0x00000020; public final static int FLAG_MENU = 0x00000040; public final static int FLAG_MENU = 0x00000040; public final static int FLAG_LAUNCHER = 0x00000080; public final static int FLAG_LAUNCHER = 0x00000080; public final static int FLAG_VIRTUAL = 0x00000100; public final static int FLAG_INJECTED = 0x01000000; public final static int FLAG_INJECTED = 0x01000000; Loading
include/ui/Input.h +3 −1 Original line number Original line Diff line number Diff line Loading @@ -73,7 +73,8 @@ namespace android { * policy decisions such as waking from device sleep. * policy decisions such as waking from device sleep. */ */ enum { enum { /* These flags originate in RawEvents and are generally set in the key map. */ /* These flags originate in RawEvents and are generally set in the key map. * See also labels for policy flags in KeycodeLabels.h. */ POLICY_FLAG_WAKE = 0x00000001, POLICY_FLAG_WAKE = 0x00000001, POLICY_FLAG_WAKE_DROPPED = 0x00000002, POLICY_FLAG_WAKE_DROPPED = 0x00000002, Loading @@ -83,6 +84,7 @@ enum { POLICY_FLAG_ALT_GR = 0x00000020, POLICY_FLAG_ALT_GR = 0x00000020, POLICY_FLAG_MENU = 0x00000040, POLICY_FLAG_MENU = 0x00000040, POLICY_FLAG_LAUNCHER = 0x00000080, POLICY_FLAG_LAUNCHER = 0x00000080, POLICY_FLAG_VIRTUAL = 0x00000100, POLICY_FLAG_RAW_MASK = 0x0000ffff, POLICY_FLAG_RAW_MASK = 0x0000ffff, Loading
include/ui/InputReader.h +0 −4 Original line number Original line Diff line number Diff line Loading @@ -103,10 +103,6 @@ public: virtual bool getDisplayInfo(int32_t displayId, virtual bool getDisplayInfo(int32_t displayId, int32_t* width, int32_t* height, int32_t* orientation) = 0; int32_t* width, int32_t* height, int32_t* orientation) = 0; /* Provides feedback for a virtual key down. */ virtual void virtualKeyDownFeedback() = 0; /* Intercepts a key event. /* Intercepts a key event. * The policy can use this method as an opportunity to perform power management functions * The policy can use this method as an opportunity to perform power management functions * and early event preprocessing such as updating policy flags. * and early event preprocessing such as updating policy flags. Loading
include/ui/KeycodeLabels.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -142,6 +142,7 @@ static const KeycodeLabel KEYCODES[] = { { NULL, 0 } { NULL, 0 } }; }; // See also policy flags in Input.h. static const KeycodeLabel FLAGS[] = { static const KeycodeLabel FLAGS[] = { { "WAKE", 0x00000001 }, { "WAKE", 0x00000001 }, { "WAKE_DROPPED", 0x00000002 }, { "WAKE_DROPPED", 0x00000002 }, Loading @@ -151,6 +152,7 @@ static const KeycodeLabel FLAGS[] = { { "ALT_GR", 0x00000020 }, { "ALT_GR", 0x00000020 }, { "MENU", 0x00000040 }, { "MENU", 0x00000040 }, { "LAUNCHER", 0x00000080 }, { "LAUNCHER", 0x00000080 }, { "VIRTUAL", 0x00000100 }, { NULL, 0 } { NULL, 0 } }; }; Loading
libs/ui/InputReader.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -993,7 +993,10 @@ void KeyboardInputMapper::applyPolicyAndDispatch(nsecs_t when, uint32_t policyFl int32_t keyEventAction = down ? AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP; int32_t keyEventAction = down ? AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP; int32_t keyEventFlags = AKEY_EVENT_FLAG_FROM_SYSTEM; int32_t keyEventFlags = AKEY_EVENT_FLAG_FROM_SYSTEM; if (policyFlags & POLICY_FLAG_WOKE_HERE) { if (policyFlags & POLICY_FLAG_WOKE_HERE) { keyEventFlags = keyEventFlags | AKEY_EVENT_FLAG_WOKE_HERE; keyEventFlags |= AKEY_EVENT_FLAG_WOKE_HERE; } if (policyFlags & POLICY_FLAG_VIRTUAL) { keyEventFlags |= AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY; } } getDispatcher()->notifyKey(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, policyFlags, getDispatcher()->notifyKey(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, policyFlags, Loading Loading @@ -2162,10 +2165,7 @@ void TouchInputMapper::applyPolicyAndDispatchVirtualKey(nsecs_t when, uint32_t p int32_t keyCode, int32_t scanCode, nsecs_t downTime) { int32_t keyCode, int32_t scanCode, nsecs_t downTime) { int32_t metaState = mContext->getGlobalMetaState(); int32_t metaState = mContext->getGlobalMetaState(); if (keyEventAction == AKEY_EVENT_ACTION_DOWN) { policyFlags |= POLICY_FLAG_VIRTUAL; getPolicy()->virtualKeyDownFeedback(); } int32_t policyActions = getPolicy()->interceptKey(when, getDeviceId(), int32_t policyActions = getPolicy()->interceptKey(when, getDeviceId(), keyEventAction == AKEY_EVENT_ACTION_DOWN, keyCode, scanCode, policyFlags); keyEventAction == AKEY_EVENT_ACTION_DOWN, keyCode, scanCode, policyFlags); Loading