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

Commit 53b854ad authored by Michael Wright's avatar Michael Wright
Browse files

Crash early when requesting a keyboard shortcut helper...

with a null IResultReceiver.

We're seeing Dialer crashes in this code path but they happen in the
main Handler loop so we can't see where the request with the null
request is coming from. Crashing earlier will hopefully give us a
stack trace that we can use to diagnose the issue.

Bug: 27963013
Change-Id: I60e4ef2ef328fa69790bbcaa4f196c02f7443296
parent 063988c4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -3370,6 +3370,16 @@ public final class ViewRootImpl implements ViewParent,
            return super.getMessageName(message);
        }

        @Override
        public boolean sendMessageAtTime(Message msg, long uptimeMillis) {
            if (msg.what == MSG_REQUEST_KEYBOARD_SHORTCUTS && msg.obj == null) {
                // Debugging for b/27963013
                throw new NullPointerException(
                        "Attempted to call MSG_REQUEST_KEYBOARD_SHORTCUTS with null receiver:");
            }
            return super.sendMessageAtTime(msg, uptimeMillis);
        }

        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {