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

Commit ac514545 authored by Peter Wang's avatar Peter Wang Committed by Android (Google) Code Review
Browse files

Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and...

Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" into rvc-dev
parents a5dc9f04 e432fbd2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class PhoneSubInfoControllerTest extends TelephonyTest {
        doReturn(true).when(mSubscriptionController).isActiveSubId(0, TAG, FEATURE_ID);
        doReturn(true).when(mSubscriptionController).isActiveSubId(1, TAG, FEATURE_ID);
        doReturn(new int[]{0, 1}).when(mSubscriptionManager)
                .getActiveAndHiddenSubscriptionIdList();
                .getCompleteActiveSubscriptionIdList();

        mServiceManagerMockedServices.put("isub", mSubscriptionController);
        doReturn(mSubscriptionController).when(mSubscriptionController)
+4 −4
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public class TelephonyPermissionsTest {
                mMockSubscriptionManager);
        when(mMockContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn(
                mMockDevicePolicyManager);
        when(mMockSubscriptionManager.getActiveAndHiddenSubscriptionIdList()).thenReturn(
        when(mMockSubscriptionManager.getCompleteActiveSubscriptionIdList()).thenReturn(
                new int[]{SUB_ID});

        // By default, assume we have no permissions or app-ops bits.
@@ -355,7 +355,7 @@ public class TelephonyPermissionsTest {
    @Test
    public void testCheckReadDeviceIdentifiers_hasCarrierPrivilegesOnOtherSubscription()
            throws Exception {
        when(mMockSubscriptionManager.getActiveAndHiddenSubscriptionIdList()).thenReturn(
        when(mMockSubscriptionManager.getCompleteActiveSubscriptionIdList()).thenReturn(
                new int[]{SUB_ID, SUB_ID_2});
        when(mTelephonyManagerMock.createForSubscriptionId(eq(SUB_ID_2))).thenReturn(
                mTelephonyManagerMockForSub2);
@@ -372,7 +372,7 @@ public class TelephonyPermissionsTest {
        // SubscriptionManager returns an empty array for the active subscription IDs this check can
        // still proceed to check if the calling package has the appop and any subsequent checks
        // without a NullPointerException.
        when(mMockSubscriptionManager.getActiveAndHiddenSubscriptionIdList())
        when(mMockSubscriptionManager.getCompleteActiveSubscriptionIdList())
                .thenReturn(new int[0]);
        when(mMockAppOps.noteOpNoThrow(eq(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS), eq(UID),
                eq(PACKAGE), eq(FEATURE), nullable(String.class))).thenReturn(
@@ -441,7 +441,7 @@ public class TelephonyPermissionsTest {
        when(mMockContext.checkPermission(
                eq(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE),
                anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_DENIED);
        when(mMockSubscriptionManager.getActiveAndHiddenSubscriptionIdList()).thenReturn(
        when(mMockSubscriptionManager.getCompleteActiveSubscriptionIdList()).thenReturn(
                new int[]{SUB_ID, SUB_ID_2});
        when(mTelephonyManagerMock.createForSubscriptionId(eq(SUB_ID_2))).thenReturn(
                mTelephonyManagerMockForSub2);