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

Commit 560f41e5 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

WM: ANR window pid if activity has no active process

Fixes a NPE when trying to access the activity's
ProcessRecord before calling into ActivityManager.

Test: presubmit
Fixes: 204520514
Change-Id: If89be2943a43efd7724be2294835170394049a13
parent 2ed83ecd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -6214,15 +6214,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    public boolean inputDispatchingTimedOut(String reason, int windowPid) {
        ActivityRecord anrActivity;
        WindowProcessController anrApp;
        boolean windowFromSameProcessAsActivity;
        boolean blameActivityProcess;
        synchronized (mAtmService.mGlobalLock) {
            anrActivity = getWaitingHistoryRecordLocked();
            anrApp = app;
            windowFromSameProcessAsActivity =
                    !hasProcess() || app.getPid() == windowPid || windowPid == INVALID_PID;
            blameActivityProcess =  hasProcess()
                    && (app.getPid() == windowPid || windowPid == INVALID_PID);
        }

        if (windowFromSameProcessAsActivity) {
        if (blameActivityProcess) {
            return mAtmService.mAmInternal.inputDispatchingTimedOut(anrApp.mOwner,
                    anrActivity.shortComponentName, anrActivity.info.applicationInfo,
                    shortComponentName, app, false, reason);