Add null check to KeyEventDispatcher.

Make sure we don't try to dispatch key events to services
that have died. Doing so crashes the device.

Bug: 30866905
Change-Id: I1cc0515cca8924b0c2744de98ac75a901b94246d
This commit is contained in:
Phil Weaver
2016-08-15 17:49:55 -07:00
parent 1fb9466c1d
commit 2a0e48aaf5

View File

@@ -121,7 +121,7 @@ public class KeyEventDispatcher {
Service service = boundServices.get(i);
// Key events are handled only by services that declared
// this capability and requested to filter key events.
if (!service.mRequestFilterKeyEvents) {
if (!service.mRequestFilterKeyEvents || (service.mServiceInterface == null)) {
continue;
}
int filterKeyEventBit = service.mAccessibilityServiceInfo.getCapabilities()