summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/input/InputManagerService.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server/input/InputManagerService.java')
-rw-r--r--services/java/com/android/server/input/InputManagerService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/java/com/android/server/input/InputManagerService.java b/services/java/com/android/server/input/InputManagerService.java
index aa3b283..a1d52d3 100644
--- a/services/java/com/android/server/input/InputManagerService.java
+++ b/services/java/com/android/server/input/InputManagerService.java
@@ -1656,7 +1656,11 @@ public class InputManagerService extends IInputManager.Stub
policyFlags | WindowManagerPolicy.FLAG_FILTERED);
} else {
try {
- mNext.mInputFilter.filterInputEvent(event, policyFlags);
+ // We need to pass a copy into filterInputEvent as it assumes
+ // the callee takes responsibility and recycles it - in case
+ // multiple filters are chained, calling into the second filter
+ // will cause event to be recycled twice
+ mNext.mInputFilter.filterInputEvent(event.copy(), policyFlags);
} catch (RemoteException e) {
/* ignore */
}