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

Commit cd30338d authored by Jeff Davidson's avatar Jeff Davidson
Browse files

Include DISABLED_UNTIL_USED components in carrier privilege check.

In order to support situations where a single device SKU (build) will
work with multiple carrier apps bundled in the system image, we may
want to mark carrier apps as DISABLED_UNTIL_USED, which means they are
effectively disabled until the user explicitly takes action indicating
that they want to use the app (e.g. by inserting a matching SIM card).

This facilitates this behavior by having carrier privilege checks work
on apps in this state without having the app be fully disabled.

This is similar to how IMEs and device policy both work.

Bug: 21613234
Change-Id: Ibe8266214c6dbd6743b4386483a61f377d3cc691
parent 3b413ed5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -289,8 +289,11 @@ public class UiccCarrierPrivilegeRules extends Handler {
     */
    public int getCarrierPrivilegeStatus(PackageManager packageManager, String packageName) {
        try {
            // Include DISABLED_UNTIL_USED components. This facilitates cases where a carrier app
            // is disabled by default, and some other component wants to enable it when it has
            // gained carrier privileges (as an indication that a matching SIM has been inserted).
            PackageInfo pInfo = packageManager.getPackageInfo(packageName,
                PackageManager.GET_SIGNATURES);
                PackageManager.GET_SIGNATURES | PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS);
            Signature[] signatures = pInfo.signatures;
            for (Signature sig : signatures) {
                int accessStatus = getCarrierPrivilegeStatus(sig, pInfo.packageName);