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

Commit 24e9073b authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Skip foregound check if ActivityManagerService returns null list

In some unknown cases, ActivityManagerService can return a null list
of processes. This is already a corner case, and we do have other
checks so it should be safe to return `true` when this happens.

Fixes: 144821633

Test: BiometricPromptDemo
Change-Id: I07458f812be7f8e331e48cd5566568ed015596bd
parent 6868ae6b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1013,8 +1013,13 @@ public abstract class BiometricServiceBase extends SystemService

    private boolean isForegroundActivity(int uid, int pid) {
        try {
            List<ActivityManager.RunningAppProcessInfo> procs =
            final List<ActivityManager.RunningAppProcessInfo> procs =
                    ActivityManager.getService().getRunningAppProcesses();
            if (procs == null) {
                Slog.e(getTag(), "Processes null, defaulting to true");
                return true;
            }

            int N = procs.size();
            for (int i = 0; i < N; i++) {
                ActivityManager.RunningAppProcessInfo proc = procs.get(i);