Loading api/current.txt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -42408,9 +42408,11 @@ package android.telephony { method public deprecated int getMnc(); method public deprecated int getMnc(); method public java.lang.String getMncString(); method public java.lang.String getMncString(); method public java.lang.String getNumber(); method public java.lang.String getNumber(); method public int getParentSubId(); method public int getSimSlotIndex(); method public int getSimSlotIndex(); method public int getSubscriptionId(); method public int getSubscriptionId(); method public boolean isEmbedded(); method public boolean isEmbedded(); method public boolean isOpportunistic(); method public void writeToParcel(android.os.Parcel, int); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR; field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR; } } Loading @@ -42435,6 +42437,7 @@ package android.telephony { method public void setSubscriptionOverrideCongested(int, boolean, long); method public void setSubscriptionOverrideCongested(int, boolean, long); method public void setSubscriptionOverrideUnmetered(int, boolean, long); method public void setSubscriptionOverrideUnmetered(int, boolean, long); method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>); method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>); method public void switchToSubscription(int, android.app.PendingIntent); field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS"; field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS"; telephony/java/android/telephony/SubscriptionInfo.java +55 −2 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,16 @@ public class SubscriptionInfo implements Parcelable { */ */ private String mCardId; private String mCardId; /** * Whether the subscription is opportunistic. */ private boolean mIsOpportunistic; /** * SubId of the parent subscription, if there is one. */ private int mParentSubId; /** /** * @hide * @hide */ */ Loading @@ -141,6 +151,19 @@ public class SubscriptionInfo implements Parcelable { CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardId) { @Nullable UiccAccessRule[] accessRules, String cardId) { this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId, false, SubscriptionManager.INVALID_SUBSCRIPTION_ID); } /** * @hide */ public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic, int parentSubId) { this.mId = id; this.mId = id; this.mIccId = iccId; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; this.mSimSlotIndex = simSlotIndex; Loading @@ -157,6 +180,8 @@ public class SubscriptionInfo implements Parcelable { this.mIsEmbedded = isEmbedded; this.mIsEmbedded = isEmbedded; this.mAccessRules = accessRules; this.mAccessRules = accessRules; this.mCardId = cardId; this.mCardId = cardId; this.mIsOpportunistic = isOpportunistic; this.mParentSubId = parentSubId; } } /** /** Loading Loading @@ -346,6 +371,29 @@ public class SubscriptionInfo implements Parcelable { return this.mIsEmbedded; return this.mIsEmbedded; } } /** * An opportunistic subscription connects to a network that is * limited in functionality and / or coverage. * * @return whether subscription is opportunistic. */ public boolean isOpportunistic() { return mIsOpportunistic; } /** * Used in scenarios where a child subscription is bundled with a primary parent subscription. * The child subscription will typically be opportunistic (see {@link #isOpportunistic()}) * and will be used to provide data services where available, with the parent being the primary * fallback subscription. * * @return subId of parent subscription if it’s bundled with a primary subscription. * If there isn't one, {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID} */ public int getParentSubId() { return mParentSubId; } /** /** * Checks whether the app with the given context is authorized to manage this subscription * Checks whether the app with the given context is authorized to manage this subscription * according to its metadata. Only supported for embedded subscriptions (if {@link #isEmbedded} * according to its metadata. Only supported for embedded subscriptions (if {@link #isEmbedded} Loading Loading @@ -438,10 +486,12 @@ public class SubscriptionInfo implements Parcelable { boolean isEmbedded = source.readBoolean(); boolean isEmbedded = source.readBoolean(); UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR); UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR); String cardId = source.readString(); String cardId = source.readString(); boolean isOpportunistic = source.readBoolean(); int parentSubId = source.readInt(); return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, isEmbedded, accessRules, cardId); isEmbedded, accessRules, cardId, isOpportunistic, parentSubId); } } @Override @Override Loading @@ -468,6 +518,8 @@ public class SubscriptionInfo implements Parcelable { dest.writeBoolean(mIsEmbedded); dest.writeBoolean(mIsEmbedded); dest.writeTypedArray(mAccessRules, flags); dest.writeTypedArray(mAccessRules, flags); dest.writeString(mCardId); dest.writeString(mCardId); dest.writeBoolean(mIsOpportunistic); dest.writeInt(mParentSubId); } } @Override @Override Loading Loading @@ -500,6 +552,7 @@ public class SubscriptionInfo implements Parcelable { + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc + " mnc " + mMnc + " isEmbedded " + mIsEmbedded + " mnc " + mMnc + " isEmbedded " + mIsEmbedded + " accessRules " + Arrays.toString(mAccessRules) + " accessRules " + Arrays.toString(mAccessRules) + " cardId=" + cardIdToPrint + "}"; + " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic + " parentSubId=" + mParentSubId + "}"; } } } } telephony/java/android/telephony/SubscriptionManager.java +105 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.annotation.SuppressAutoDoc; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.SystemService; import android.app.BroadcastOptions; import android.app.BroadcastOptions; import android.app.PendingIntent; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageInfo; Loading @@ -43,6 +44,7 @@ import android.os.Looper; import android.os.Message; import android.os.Message; import android.os.RemoteException; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager; import android.telephony.euicc.EuiccManager; import android.util.DisplayMetrics; import android.util.DisplayMetrics; import com.android.internal.telephony.IOnSubscriptionsChangedListener; import com.android.internal.telephony.IOnSubscriptionsChangedListener; Loading Loading @@ -432,6 +434,24 @@ public class SubscriptionManager { */ */ public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; /** * TelephonyProvider column name for whether a subscription is opportunistic, that is, * whether the network it connects to is limited in functionality or coverage. * For example, CBRS. * IS_EMBEDDED should always be true. * <p>Type: INTEGER (int), 1 for opportunistic or 0 for non-opportunistic. * @hide */ public static final String IS_OPPORTUNISTIC = "is_opportunistic"; /** * TelephonyProvider column name for subId of parent subscription of an opportunistic * subscription. * if the parent sub id is valid, then is_opportunistic should always to true. * @hide */ public static final String PARENT_SUB_ID = "parent_sub_id"; /** /** * Broadcast Action: The user has changed one of the default subs related to * Broadcast Action: The user has changed one of the default subs related to * data, phone calls, or sms</p> * data, phone calls, or sms</p> Loading Loading @@ -1940,6 +1960,91 @@ public class SubscriptionManager { return false; return false; } } /** * Set preferred default data. * Set on which slot default data will be on. * * @param slotId which slot is preferred to for cellular data. * @hide * */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredData(int slotId) { if (VDBG) logd("[setPreferredData]+ slotId:" + slotId); setSubscriptionPropertyHelper(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, "setPreferredData", (iSub)-> iSub.setPreferredData(slotId)); } /** * Get User downloaded Profiles. * * Provide all available user downloaded profile on the phone. * @param slotId on which phone the switch will operate on */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; List<SubscriptionInfo> subInfoList = null; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { subInfoList = iSub.getOpportunisticSubscriptions(slotId, pkgForDebug); } } catch (RemoteException ex) { // ignore it } if (subInfoList == null) { subInfoList = new ArrayList<>(); } return subInfoList; } /** * Switch to a certain subscription * * @param subId sub id * @param callbackIntent pending intent that will be sent after operation is done. */ @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void switchToSubscription(int subId, PendingIntent callbackIntent) { EuiccManager euiccManager = new EuiccManager(mContext); euiccManager.switchToSubscription(subId, callbackIntent); } /** * Set opportunistic by simInfo index * * @param opportunistic whether it’s opportunistic subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated * @hide */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setOpportunistic(boolean opportunistic, int subId) { if (VDBG) logd("[setOpportunistic]+ opportunistic:" + opportunistic + " subId:" + subId); return setSubscriptionPropertyHelper(subId, "setOpportunistic", (iSub)-> iSub.setOpportunistic(opportunistic, subId)); } /** * Set parent subId by simInfo index * * @param parentSubId subId of its parent subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated * @hide * */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setParentSubId(int parentSubId, int subId) { if (VDBG) logd("[setParentSubId]+ parentSubId:" + parentSubId + " subId:" + subId); return setSubscriptionPropertyHelper(subId, "parentSubId", (iSub)-> iSub.setParentSubId(parentSubId, subId)); } private interface CallISubMethodHelper { private interface CallISubMethodHelper { int callMethod(ISub iSub) throws RemoteException; int callMethod(ISub iSub) throws RemoteException; } } Loading telephony/java/com/android/internal/telephony/ISub.aidl +37 −1 Original line number Original line Diff line number Diff line Loading @@ -156,6 +156,42 @@ interface ISub { */ */ int setDataRoaming(int roaming, int subId); int setDataRoaming(int roaming, int subId); /** * Switch to a certain subscription * * @param opportunistic whether it’s opportunistic subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated */ int setOpportunistic(boolean opportunistic, int subId); /** * Set parent subId by simInfo index * * @param parentSubId: subId of its parent subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated */ int setParentSubId(int parentSubId, int subId); /** * Set preferred default data. * Set on which slot default data will be on. * * @param slotId which slot is preferred to for cellular data. * @hide * */ int setPreferredData(int slotId); /** * Get User downloaded Profiles. * * Provide all available user downloaded profile on the phone. * @param slotId on which phone the switch will operate on */ List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId, String callingPackage); int getSlotIndex(int subId); int getSlotIndex(int subId); int[] getSubId(int slotIndex); int[] getSubId(int slotIndex); Loading Loading @@ -186,7 +222,7 @@ interface ISub { int[] getActiveSubIdList(); int[] getActiveSubIdList(); void setSubscriptionProperty(int subId, String propKey, String propValue); int setSubscriptionProperty(int subId, String propKey, String propValue); String getSubscriptionProperty(int subId, String propKey, String callingPackage); String getSubscriptionProperty(int subId, String propKey, String callingPackage); Loading telephony/java/com/android/internal/telephony/TelephonyIntents.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ */ package com.android.internal.telephony; package com.android.internal.telephony; import android.content.Intent; import android.content.Intent; import android.content.Intent; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager; Loading Loading
api/current.txt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -42408,9 +42408,11 @@ package android.telephony { method public deprecated int getMnc(); method public deprecated int getMnc(); method public java.lang.String getMncString(); method public java.lang.String getMncString(); method public java.lang.String getNumber(); method public java.lang.String getNumber(); method public int getParentSubId(); method public int getSimSlotIndex(); method public int getSimSlotIndex(); method public int getSubscriptionId(); method public int getSubscriptionId(); method public boolean isEmbedded(); method public boolean isEmbedded(); method public boolean isOpportunistic(); method public void writeToParcel(android.os.Parcel, int); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR; field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR; } } Loading @@ -42435,6 +42437,7 @@ package android.telephony { method public void setSubscriptionOverrideCongested(int, boolean, long); method public void setSubscriptionOverrideCongested(int, boolean, long); method public void setSubscriptionOverrideUnmetered(int, boolean, long); method public void setSubscriptionOverrideUnmetered(int, boolean, long); method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>); method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>); method public void switchToSubscription(int, android.app.PendingIntent); field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS"; field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS";
telephony/java/android/telephony/SubscriptionInfo.java +55 −2 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,16 @@ public class SubscriptionInfo implements Parcelable { */ */ private String mCardId; private String mCardId; /** * Whether the subscription is opportunistic. */ private boolean mIsOpportunistic; /** * SubId of the parent subscription, if there is one. */ private int mParentSubId; /** /** * @hide * @hide */ */ Loading @@ -141,6 +151,19 @@ public class SubscriptionInfo implements Parcelable { CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardId) { @Nullable UiccAccessRule[] accessRules, String cardId) { this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId, false, SubscriptionManager.INVALID_SUBSCRIPTION_ID); } /** * @hide */ public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic, int parentSubId) { this.mId = id; this.mId = id; this.mIccId = iccId; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; this.mSimSlotIndex = simSlotIndex; Loading @@ -157,6 +180,8 @@ public class SubscriptionInfo implements Parcelable { this.mIsEmbedded = isEmbedded; this.mIsEmbedded = isEmbedded; this.mAccessRules = accessRules; this.mAccessRules = accessRules; this.mCardId = cardId; this.mCardId = cardId; this.mIsOpportunistic = isOpportunistic; this.mParentSubId = parentSubId; } } /** /** Loading Loading @@ -346,6 +371,29 @@ public class SubscriptionInfo implements Parcelable { return this.mIsEmbedded; return this.mIsEmbedded; } } /** * An opportunistic subscription connects to a network that is * limited in functionality and / or coverage. * * @return whether subscription is opportunistic. */ public boolean isOpportunistic() { return mIsOpportunistic; } /** * Used in scenarios where a child subscription is bundled with a primary parent subscription. * The child subscription will typically be opportunistic (see {@link #isOpportunistic()}) * and will be used to provide data services where available, with the parent being the primary * fallback subscription. * * @return subId of parent subscription if it’s bundled with a primary subscription. * If there isn't one, {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID} */ public int getParentSubId() { return mParentSubId; } /** /** * Checks whether the app with the given context is authorized to manage this subscription * Checks whether the app with the given context is authorized to manage this subscription * according to its metadata. Only supported for embedded subscriptions (if {@link #isEmbedded} * according to its metadata. Only supported for embedded subscriptions (if {@link #isEmbedded} Loading Loading @@ -438,10 +486,12 @@ public class SubscriptionInfo implements Parcelable { boolean isEmbedded = source.readBoolean(); boolean isEmbedded = source.readBoolean(); UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR); UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR); String cardId = source.readString(); String cardId = source.readString(); boolean isOpportunistic = source.readBoolean(); int parentSubId = source.readInt(); return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, isEmbedded, accessRules, cardId); isEmbedded, accessRules, cardId, isOpportunistic, parentSubId); } } @Override @Override Loading @@ -468,6 +518,8 @@ public class SubscriptionInfo implements Parcelable { dest.writeBoolean(mIsEmbedded); dest.writeBoolean(mIsEmbedded); dest.writeTypedArray(mAccessRules, flags); dest.writeTypedArray(mAccessRules, flags); dest.writeString(mCardId); dest.writeString(mCardId); dest.writeBoolean(mIsOpportunistic); dest.writeInt(mParentSubId); } } @Override @Override Loading Loading @@ -500,6 +552,7 @@ public class SubscriptionInfo implements Parcelable { + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc + " mnc " + mMnc + " isEmbedded " + mIsEmbedded + " mnc " + mMnc + " isEmbedded " + mIsEmbedded + " accessRules " + Arrays.toString(mAccessRules) + " accessRules " + Arrays.toString(mAccessRules) + " cardId=" + cardIdToPrint + "}"; + " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic + " parentSubId=" + mParentSubId + "}"; } } } }
telephony/java/android/telephony/SubscriptionManager.java +105 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.annotation.SuppressAutoDoc; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.SystemService; import android.app.BroadcastOptions; import android.app.BroadcastOptions; import android.app.PendingIntent; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageInfo; Loading @@ -43,6 +44,7 @@ import android.os.Looper; import android.os.Message; import android.os.Message; import android.os.RemoteException; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager; import android.telephony.euicc.EuiccManager; import android.util.DisplayMetrics; import android.util.DisplayMetrics; import com.android.internal.telephony.IOnSubscriptionsChangedListener; import com.android.internal.telephony.IOnSubscriptionsChangedListener; Loading Loading @@ -432,6 +434,24 @@ public class SubscriptionManager { */ */ public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; /** * TelephonyProvider column name for whether a subscription is opportunistic, that is, * whether the network it connects to is limited in functionality or coverage. * For example, CBRS. * IS_EMBEDDED should always be true. * <p>Type: INTEGER (int), 1 for opportunistic or 0 for non-opportunistic. * @hide */ public static final String IS_OPPORTUNISTIC = "is_opportunistic"; /** * TelephonyProvider column name for subId of parent subscription of an opportunistic * subscription. * if the parent sub id is valid, then is_opportunistic should always to true. * @hide */ public static final String PARENT_SUB_ID = "parent_sub_id"; /** /** * Broadcast Action: The user has changed one of the default subs related to * Broadcast Action: The user has changed one of the default subs related to * data, phone calls, or sms</p> * data, phone calls, or sms</p> Loading Loading @@ -1940,6 +1960,91 @@ public class SubscriptionManager { return false; return false; } } /** * Set preferred default data. * Set on which slot default data will be on. * * @param slotId which slot is preferred to for cellular data. * @hide * */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredData(int slotId) { if (VDBG) logd("[setPreferredData]+ slotId:" + slotId); setSubscriptionPropertyHelper(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, "setPreferredData", (iSub)-> iSub.setPreferredData(slotId)); } /** * Get User downloaded Profiles. * * Provide all available user downloaded profile on the phone. * @param slotId on which phone the switch will operate on */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; List<SubscriptionInfo> subInfoList = null; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { subInfoList = iSub.getOpportunisticSubscriptions(slotId, pkgForDebug); } } catch (RemoteException ex) { // ignore it } if (subInfoList == null) { subInfoList = new ArrayList<>(); } return subInfoList; } /** * Switch to a certain subscription * * @param subId sub id * @param callbackIntent pending intent that will be sent after operation is done. */ @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void switchToSubscription(int subId, PendingIntent callbackIntent) { EuiccManager euiccManager = new EuiccManager(mContext); euiccManager.switchToSubscription(subId, callbackIntent); } /** * Set opportunistic by simInfo index * * @param opportunistic whether it’s opportunistic subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated * @hide */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setOpportunistic(boolean opportunistic, int subId) { if (VDBG) logd("[setOpportunistic]+ opportunistic:" + opportunistic + " subId:" + subId); return setSubscriptionPropertyHelper(subId, "setOpportunistic", (iSub)-> iSub.setOpportunistic(opportunistic, subId)); } /** * Set parent subId by simInfo index * * @param parentSubId subId of its parent subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated * @hide * */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setParentSubId(int parentSubId, int subId) { if (VDBG) logd("[setParentSubId]+ parentSubId:" + parentSubId + " subId:" + subId); return setSubscriptionPropertyHelper(subId, "parentSubId", (iSub)-> iSub.setParentSubId(parentSubId, subId)); } private interface CallISubMethodHelper { private interface CallISubMethodHelper { int callMethod(ISub iSub) throws RemoteException; int callMethod(ISub iSub) throws RemoteException; } } Loading
telephony/java/com/android/internal/telephony/ISub.aidl +37 −1 Original line number Original line Diff line number Diff line Loading @@ -156,6 +156,42 @@ interface ISub { */ */ int setDataRoaming(int roaming, int subId); int setDataRoaming(int roaming, int subId); /** * Switch to a certain subscription * * @param opportunistic whether it’s opportunistic subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated */ int setOpportunistic(boolean opportunistic, int subId); /** * Set parent subId by simInfo index * * @param parentSubId: subId of its parent subscription. * @param subId the unique SubscriptionInfo index in database * @return the number of records updated */ int setParentSubId(int parentSubId, int subId); /** * Set preferred default data. * Set on which slot default data will be on. * * @param slotId which slot is preferred to for cellular data. * @hide * */ int setPreferredData(int slotId); /** * Get User downloaded Profiles. * * Provide all available user downloaded profile on the phone. * @param slotId on which phone the switch will operate on */ List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId, String callingPackage); int getSlotIndex(int subId); int getSlotIndex(int subId); int[] getSubId(int slotIndex); int[] getSubId(int slotIndex); Loading Loading @@ -186,7 +222,7 @@ interface ISub { int[] getActiveSubIdList(); int[] getActiveSubIdList(); void setSubscriptionProperty(int subId, String propKey, String propValue); int setSubscriptionProperty(int subId, String propKey, String propValue); String getSubscriptionProperty(int subId, String propKey, String callingPackage); String getSubscriptionProperty(int subId, String propKey, String callingPackage); Loading
telephony/java/com/android/internal/telephony/TelephonyIntents.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ */ package com.android.internal.telephony; package com.android.internal.telephony; import android.content.Intent; import android.content.Intent; import android.content.Intent; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager; Loading