From fd23e3ed976b22b9a92ddb2cb3a46f9d2a0ce23f Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Wed, 9 May 2012 13:34:28 -0700 Subject: Fix bugs in fallback key handling. If a fallback key is generated using a key plus a modifier, then it's possible we might get a different fallback key generated if the modifier has changed. PhoneWindowManager needs to remember which fallback is last generated for a given key code so that it can apply the same fallback action. When generating cancellation events, it's important to have preserved the policyFlags of the original event. Otherwise we may not dispatch the cancellation properly. For example, some actions are not performed if the POLICY_FLAG_TRUSTED is not specified. Remember the metaState associated with a key event so we can include it when canceled. Tell the policy when a fallback is being cancelled so that it can clean up its state. After a SEARCH shortcut is invoked, clear the flag indicating that a shortcut is pending. This is to prevent SEARCH from getting stuck down in the case where we might forget to send the up. (Shouldn't happen anymore after the prior fixes.) Bug: 5616255 Change-Id: I68f0a9679c7af464eaf31c099f2aa50b53fecf1f --- include/androidfw/Input.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/androidfw/Input.h b/include/androidfw/Input.h index 601a169..6d03fd6 100644 --- a/include/androidfw/Input.h +++ b/include/androidfw/Input.h @@ -262,6 +262,8 @@ public: inline int32_t getFlags() const { return mFlags; } + inline void setFlags(int32_t flags) { mFlags = flags; } + inline int32_t getKeyCode() const { return mKeyCode; } inline int32_t getScanCode() const { return mScanCode; } -- cgit v1.1