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

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

Change-Id: Iffbcb20ff0d21ae2548a0dc8d9e6944bc77e36df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shivakumar Neginal
2022-05-13 16:43:08 +00:00
committed by Automerger Merge Worker

View File

@@ -25,18 +25,17 @@ import android.annotation.SdkConstant;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.app.Activity; import android.app.Activity;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.app.compat.CompatChanges;
import android.compat.annotation.ChangeId; import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince; import android.compat.annotation.EnabledSince;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentSender; import android.content.IntentSender;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.RemoteException; import android.os.RemoteException;
import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer; import android.telephony.TelephonyFrameworkInitializer;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.telephony.UiccCardInfo; import android.telephony.UiccCardInfo;
@@ -1209,18 +1208,16 @@ public class EuiccManager {
return; return;
} }
try { try {
// TODO: Uncomment below compat change code once callers are ported to use if (subscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID
// switchToSubscription with portIndex for disable operation. && getIEuiccController().isCompatChangeEnabled(mContext.getOpPackageName(),
// if (subscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID SWITCH_WITHOUT_PORT_INDEX_EXCEPTION_ON_DISABLE)) {
// && getIEuiccController().isCompatChangeEnabled(mContext.getOpPackageName(), // Apps targeting on Android T and beyond will get exception whenever
// SWITCH_WITHOUT_PORT_INDEX_EXCEPTION_ON_DISABLE)) { // switchToSubscription without portIndex is called with INVALID_SUBSCRIPTION_ID.
// // Apps targeting on Android T and beyond will get exception whenever Log.e(TAG, "switchToSubscription without portIndex is not allowed for"
// // switchToSubscription without portIndex is called with INVALID_SUBSCRIPTION_ID. + " disable operation");
// Log.e(TAG, "switchToSubscription without portIndex is not allowed for" throw new IllegalArgumentException("Must use switchToSubscription with portIndex"
// + " disable operation"); + " API for disable operation");
// throw new IllegalArgumentException("Must use switchToSubscription with portIndex" }
// + " API for disable operation");
// }
getIEuiccController().switchToSubscription(mCardId, getIEuiccController().switchToSubscription(mCardId,
subscriptionId, mContext.getOpPackageName(), callbackIntent); subscriptionId, mContext.getOpPackageName(), callbackIntent);
} catch (RemoteException e) { } catch (RemoteException e) {