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

Commit f7ec3f6d authored by Nazanin Bakhshi's avatar Nazanin Bakhshi Committed by Android (Google) Code Review
Browse files

Merge "fix broken telephony tests by making intents immutable they started...

Merge "fix broken telephony tests by making intents immutable they started failing after the change ag/13048968) that made mutable/immutable flag mandatory"
parents 7f705e2d 2f1fcc91
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -1290,7 +1290,8 @@ public class EuiccControllerTest extends TelephonyTest {
    private void callGetDownloadableSubscriptionMetadata(DownloadableSubscription subscription,
            boolean complete, GetDownloadableSubscriptionMetadataResult result) {
        prepareGetDownloadableSubscriptionMetadataCall(complete, result);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        mController.getDownloadableSubscriptionMetadata(0, subscription, PACKAGE_NAME,
                resultCallback);
    }
@@ -1311,14 +1312,16 @@ public class EuiccControllerTest extends TelephonyTest {
            }
        }).when(mMockConnector).getDefaultDownloadableSubscriptionList(anyInt(), anyBoolean(),
                any());
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        mController.getDefaultDownloadableSubscriptionList(CARD_ID, PACKAGE_NAME, resultCallback);
    }

    private void callDownloadSubscription(DownloadableSubscription subscription,
            boolean switchAfterDownload, final boolean complete, final int result,
            final int resolvableError, String callingPackage) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
@@ -1345,7 +1348,8 @@ public class EuiccControllerTest extends TelephonyTest {

    private void callDeleteSubscription(int subscriptionId, String iccid, final boolean complete,
            final int result, String callingPackage) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
@@ -1364,7 +1368,8 @@ public class EuiccControllerTest extends TelephonyTest {

    private void callSwitchToSubscription(int subscriptionId, String iccid, final boolean complete,
            final int result, String callingPackage) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
@@ -1383,7 +1388,8 @@ public class EuiccControllerTest extends TelephonyTest {

    private void callUpdateSubscriptionNickname(int subscriptionId, String iccid, String nickname,
            final boolean complete, final int result, String callingPackage) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
@@ -1403,7 +1409,8 @@ public class EuiccControllerTest extends TelephonyTest {
    }

    private void callEraseSubscriptions(final boolean complete, final int result) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
@@ -1421,7 +1428,8 @@ public class EuiccControllerTest extends TelephonyTest {
    }

    private void callEraseSubscriptionsWithOptions(final boolean complete, final int result) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
@@ -1440,7 +1448,8 @@ public class EuiccControllerTest extends TelephonyTest {
    }

    private void callRetainSubscriptionsForFactoryReset(final boolean complete, final int result) {
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(), 0);
        PendingIntent resultCallback = PendingIntent.getBroadcast(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Exception {
+1 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ public class GsmSmsDispatcherTest extends TelephonyTest {

        ArrayList<PendingIntent> sentIntents = new ArrayList<>();
        PendingIntent sentIntent = PendingIntent.getBroadcast(realContext, 0,
                new Intent(TEST_INTENT), 0);
                new Intent(TEST_INTENT), PendingIntent.FLAG_IMMUTABLE);
        sentIntents.add(sentIntent);
        sentIntents.add(sentIntent);