diff --git a/api/system-current.txt b/api/system-current.txt index 38baa4eb10641..8e73f2e18bcd6 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8820,6 +8820,7 @@ package android.telephony { } public class SubscriptionInfo implements android.os.Parcelable { + method public boolean areUiccApplicationsEnabled(); method @Nullable public java.util.List getAccessRules(); method public int getProfileClass(); method public boolean isGroupDisabled(); diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index 257c606607533..bbde1f48aed7c 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -209,6 +209,12 @@ public class SubscriptionInfo implements Parcelable { */ private int mSubscriptionType; + /** + * Whether uicc applications are configured to enable or disable. + * By default it's true. + */ + private boolean mAreUiccApplicationsEnabled = true; + /** * @hide */ @@ -220,7 +226,7 @@ public class SubscriptionInfo implements Parcelable { roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, -1, false, null, false, TelephonyManager.UNKNOWN_CARRIER_ID, SubscriptionManager.PROFILE_CLASS_DEFAULT, - SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null); + SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null, true); } /** @@ -234,7 +240,7 @@ public class SubscriptionInfo implements Parcelable { this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, -1, isOpportunistic, groupUUID, false, carrierId, profileClass, - SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null); + SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null, true); } /** @@ -246,7 +252,8 @@ public class SubscriptionInfo implements Parcelable { @Nullable UiccAccessRule[] nativeAccessRules, String cardString, int cardId, boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled, int carrierId, int profileClass, int subType, @Nullable String groupOwner, - @Nullable UiccAccessRule[] carrierConfigAccessRules) { + @Nullable UiccAccessRule[] carrierConfigAccessRules, + boolean areUiccApplicationsEnabled) { this.mId = id; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; @@ -272,6 +279,7 @@ public class SubscriptionInfo implements Parcelable { this.mSubscriptionType = subType; this.mGroupOwner = groupOwner; this.mCarrierConfigAccessRules = carrierConfigAccessRules; + this.mAreUiccApplicationsEnabled = areUiccApplicationsEnabled; } /** @@ -660,6 +668,15 @@ public class SubscriptionInfo implements Parcelable { return mIsGroupDisabled; } + /** + * Return whether uicc applications are set to be enabled or disabled. + * @hide + */ + @SystemApi + public boolean areUiccApplicationsEnabled() { + return mAreUiccApplicationsEnabled; + } + public static final @android.annotation.NonNull Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override public SubscriptionInfo createFromParcel(Parcel source) { @@ -691,12 +708,13 @@ public class SubscriptionInfo implements Parcelable { String groupOwner = source.readString(); UiccAccessRule[] carrierConfigAccessRules = source.createTypedArray( UiccAccessRule.CREATOR); + boolean areUiccApplicationsEnabled = source.readBoolean(); SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, cardId, isOpportunistic, groupUUID, isGroupDisabled, carrierid, profileClass, subType, groupOwner, - carrierConfigAccessRules); + carrierConfigAccessRules, areUiccApplicationsEnabled); info.setAssociatedPlmns(ehplmns, hplmns); return info; } @@ -736,6 +754,7 @@ public class SubscriptionInfo implements Parcelable { dest.writeStringArray(mHplmns); dest.writeString(mGroupOwner); dest.writeTypedArray(mCarrierConfigAccessRules, flags); + dest.writeBoolean(mAreUiccApplicationsEnabled); } @Override @@ -778,15 +797,16 @@ public class SubscriptionInfo implements Parcelable { + " hplmns=" + Arrays.toString(mHplmns) + " subscriptionType=" + mSubscriptionType + " mGroupOwner=" + mGroupOwner - + " carrierConfigAccessRules=" + mCarrierConfigAccessRules + "}"; + + " carrierConfigAccessRules=" + mCarrierConfigAccessRules + + " mAreUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled + "}"; } @Override public int hashCode() { return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded, - mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc, - mCountryIso, mCardString, mCardId, mDisplayName, mCarrierName, mNativeAccessRules, - mIsGroupDisabled, mCarrierId, mProfileClass, mGroupOwner); + mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc, mCountryIso, mCardString, + mCardId, mDisplayName, mCarrierName, mNativeAccessRules, mIsGroupDisabled, + mCarrierId, mProfileClass, mGroupOwner, mAreUiccApplicationsEnabled); } @Override @@ -809,6 +829,7 @@ public class SubscriptionInfo implements Parcelable { && mIsEmbedded == toCompare.mIsEmbedded && mIsOpportunistic == toCompare.mIsOpportunistic && mIsGroupDisabled == toCompare.mIsGroupDisabled + && mAreUiccApplicationsEnabled == toCompare.mAreUiccApplicationsEnabled && mCarrierId == toCompare.mCarrierId && Objects.equals(mGroupUUID, toCompare.mGroupUUID) && Objects.equals(mIccId, toCompare.mIccId) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index f4f0503cfc8f8..201c4ce27c552 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -834,6 +834,12 @@ public class SubscriptionManager { //TODO: add @SystemApi public static final String IMSI = "imsi"; + /** + * Whether uicc applications is set to be enabled or disabled. By default it's enabled. + * @hide + */ + public static final String UICC_APPLICATIONS_ENABLED = "uicc_applications_enabled"; + /** * Broadcast Action: The user has changed one of the default subs related to * data, phone calls, or sms