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

Commit f3cc20ad authored by Louis Chang's avatar Louis Chang
Browse files

Fix NullPointerException

There could be no running activity in the Task if all activities
are finishing.

The exception seems only happening on monkey tests where the touch
events send randomly while the activities are finishing.

Bug: 362379175
Test: wm presubmit
Flag: EXEMPT bugfix
Change-Id: I5277f9e16e036fcab146fb693fd033d22dc9248a
parent 9ace7069
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8951,7 +8951,7 @@ public class WindowManagerService extends IWindowManager.Stub
        final ActivityRecord touchedApp = t.getActivityRecord();
        if (touchedApp != null && touchedApp.getTask() != null) {
            final ActivityRecord top = touchedApp.getTask().topRunningActivity();
            if (top != touchedApp && top.getTaskFragment().getBounds().contains(
            if (top != null && top != touchedApp && top.getTaskFragment().getBounds().contains(
                    touchedApp.getTaskFragment().getBounds())) {
                // This is a special case where the pointer-down-outside focus on an Activity that's
                // entirely occluded by the task top running activity, this is possible if the