OSDN Git Service

Only mark repeated keys as PASS_TO_USER if the original key was.
authorMichael Wright <michaelwr@google.com>
Wed, 24 Sep 2014 20:26:59 +0000 (13:26 -0700)
committerMichael Wright <michaelwr@google.com>
Thu, 25 Sep 2014 20:20:20 +0000 (13:20 -0700)
Bug: 17629695
Change-Id: Ic569aba4149c6cc321c2cf8aede7c5e8a1196234

services/inputflinger/InputDispatcher.cpp

index ce14f99..2b5e744 100644 (file)
@@ -653,8 +653,8 @@ InputDispatcher::KeyEntry* InputDispatcher::synthesizeKeyRepeatLocked(nsecs_t cu
     KeyEntry* entry = mKeyRepeatState.lastKeyEntry;
 
     // Reuse the repeated key entry if it is otherwise unreferenced.
-    uint32_t policyFlags = (entry->policyFlags & POLICY_FLAG_RAW_MASK)
-            | POLICY_FLAG_PASS_TO_USER | POLICY_FLAG_TRUSTED;
+    uint32_t policyFlags = entry->policyFlags &
+            (POLICY_FLAG_RAW_MASK | POLICY_FLAG_PASS_TO_USER | POLICY_FLAG_TRUSTED);
     if (entry->refCount == 1) {
         entry->recycle();
         entry->eventTime = currentTime;