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

Commit 478cbabf authored by Chen Xu's avatar Chen Xu Committed by Gerrit Code Review
Browse files

Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions"

parents cb36cba2 bd0005b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -109,7 +109,7 @@ public final class NetworkStatsAccess {
        final TelephonyManager tm = (TelephonyManager)
        final TelephonyManager tm = (TelephonyManager)
                context.getSystemService(Context.TELEPHONY_SERVICE);
                context.getSystemService(Context.TELEPHONY_SERVICE);
        boolean hasCarrierPrivileges = tm != null &&
        boolean hasCarrierPrivileges = tm != null &&
                tm.checkCarrierPrivilegesForPackage(callingPackage) ==
                tm.checkCarrierPrivilegesForPackageAnyPhone(callingPackage) ==
                        TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
                        TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
        boolean isDeviceOwner = dpmi != null && dpmi.isActiveAdminWithPolicy(callingUid,
        boolean isDeviceOwner = dpmi != null && dpmi.isActiveAdminWithPolicy(callingUid,
                DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
                DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
+1 −1
Original line number Original line Diff line number Diff line
@@ -161,7 +161,7 @@ public class NetworkStatsAccessTest {
    }
    }


    private void setHasCarrierPrivileges(boolean hasPrivileges) {
    private void setHasCarrierPrivileges(boolean hasPrivileges) {
        when(mTm.checkCarrierPrivilegesForPackage(TEST_PKG)).thenReturn(
        when(mTm.checkCarrierPrivilegesForPackageAnyPhone(TEST_PKG)).thenReturn(
                hasPrivileges ? TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS
                hasPrivileges ? TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS
                        : TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS);
                        : TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS);
    }
    }