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

Commit 892fc8d0 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Do not check targetSdkVersion if only one package

Bug: 36485175
Test: AccountManagerServiceTest
Change-Id: Icef2a292dbf5119a5c2bb184aa2da7bcf8e7bd11
parent 73b84186
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3697,11 +3697,11 @@ public class AccountManagerService
        if (ArrayUtils.isEmpty(packageNames)) {
            return null;
        }
        // For app op checks related to permissions all packages in the UID
        // have the same app op state, so doesn't matter which one we pick.
        // Update: due to visibility changes we want to use package with oldest target SDK,

        String packageName = packageNames[0];
        if (packageNames.length == 1) {
            return packageName;
        }
        // Due to visibility changes we want to use package with oldest target SDK
        int oldestVersion = Integer.MAX_VALUE;
        for (String name : packageNames) {
            try {