Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a0e48aa authored by Phil Weaver's avatar Phil Weaver
Browse files

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
parent 1fb9466c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ public class KeyEventDispatcher {
            Service service = boundServices.get(i);
            Service service = boundServices.get(i);
            // Key events are handled only by services that declared
            // Key events are handled only by services that declared
            // this capability and requested to filter key events.
            // this capability and requested to filter key events.
            if (!service.mRequestFilterKeyEvents) {
            if (!service.mRequestFilterKeyEvents || (service.mServiceInterface == null)) {
                continue;
                continue;
            }
            }
            int filterKeyEventBit = service.mAccessibilityServiceInfo.getCapabilities()
            int filterKeyEventBit = service.mAccessibilityServiceInfo.getCapabilities()