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

Commit d021a3f5 authored by 张倞诚's avatar 张倞诚
Browse files

Fix NullPointerException in PermissionPolicyService#isTaskStartedFromLauncher

TaskInfo#baseActivity is nullable, so it may case NPE in system_server.

Change-Id: I7cefd006f61dd52d558c7e64e07da5005662bf74
parent ecf90eb7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1315,7 +1315,8 @@ public final class PermissionPolicyService extends SystemService {
        }

        private boolean isTaskStartedFromLauncher(String currPkg, TaskInfo taskInfo) {
            return currPkg.equals(taskInfo.baseActivity.getPackageName())
            return taskInfo.baseActivity != null
                    && currPkg.equals(taskInfo.baseActivity.getPackageName())
                    && isLauncherIntent(taskInfo.baseIntent);
        }