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

Commit 0cb595b6 authored by Shivakumar Neginal's avatar Shivakumar Neginal Committed by Automerger Merge Worker
Browse files

Merge "[MEP]Uncomment the EuiccManager switchToSubscription changes." into...

Merge "[MEP]Uncomment the EuiccManager switchToSubscription changes." into tm-dev am: 4f1b236c am: 4de5b7fb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18356906



Change-Id: I269597a3e4e9f31d337768ab81f936e9543d0723
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7f04c7b6 4de5b7fb
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -25,18 +25,17 @@ import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.compat.CompatChanges;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer;
import android.telephony.TelephonyManager;
import android.telephony.UiccCardInfo;
@@ -1209,18 +1208,16 @@ public class EuiccManager {
            return;
        }
        try {
            // TODO: Uncomment below compat change code once callers are ported to use
            //  switchToSubscription with portIndex for disable operation.
            // if (subscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID
            //        && getIEuiccController().isCompatChangeEnabled(mContext.getOpPackageName(),
            //        SWITCH_WITHOUT_PORT_INDEX_EXCEPTION_ON_DISABLE)) {
            //    // Apps targeting on Android T and beyond will get exception whenever
            //    // switchToSubscription without portIndex is called with INVALID_SUBSCRIPTION_ID.
            //    Log.e(TAG, "switchToSubscription without portIndex is not allowed for"
            //            + " disable operation");
            //    throw new IllegalArgumentException("Must use switchToSubscription with portIndex"
            //            + " API for disable operation");
            // }
            if (subscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID
                     && getIEuiccController().isCompatChangeEnabled(mContext.getOpPackageName(),
                     SWITCH_WITHOUT_PORT_INDEX_EXCEPTION_ON_DISABLE)) {
                // Apps targeting on Android T and beyond will get exception whenever
                // switchToSubscription without portIndex is called with INVALID_SUBSCRIPTION_ID.
                Log.e(TAG, "switchToSubscription without portIndex is not allowed for"
                        + " disable operation");
                throw new IllegalArgumentException("Must use switchToSubscription with portIndex"
                        + " API for disable operation");
            }
            getIEuiccController().switchToSubscription(mCardId,
                    subscriptionId, mContext.getOpPackageName(), callbackIntent);
        } catch (RemoteException e) {