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

Commit 0d93cd73 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Add a null check for the result of getPackagesForUid()

Test: none
Bug: 168497288
Change-Id: I9c54330a1b571453e0b273bc2729e56b0c4d619d
parent 8cfa71dd
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -381,12 +381,14 @@ public class UiccCarrierPrivilegeRules extends Handler {
            PackageManager packageManager, int uid) {
        String[] packages = packageManager.getPackagesForUid(uid);

        if (packages != null) {
            for (String pkg : packages) {
                int accessStatus = getCarrierPrivilegeStatus(packageManager, pkg);
                if (accessStatus != TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS) {
                    return accessStatus;
                }
            }
        }
        return TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
    }