Null check inside filterIfNotSystemUser

List<ResolveInfo> is defined as nullable, so if that ever happens,
need to handle it in the filter method.

Bug: 222180729

Test: presubmit

Change-Id: I84e8b66485f226e0d01074e01c77fa0b71f37122
This commit is contained in:
Winson
2022-03-02 11:38:08 -08:00
parent 1c11a5dfe6
commit a2aa3eadec

View File

@@ -1431,7 +1431,8 @@ public class ComputerEngine implements Computer {
if (userId == UserHandle.USER_SYSTEM) {
return resolveInfos;
}
for (int i = resolveInfos.size() - 1; i >= 0; i--) {
for (int i = CollectionUtils.size(resolveInfos) - 1; i >= 0; i--) {
ResolveInfo info = resolveInfos.get(i);
if ((info.activityInfo.flags & ActivityInfo.FLAG_SYSTEM_USER_ONLY) != 0) {
resolveInfos.remove(i);