diff options
| author | Malcolm Chen <refuhoo@google.com> | 2018-11-29 11:48:14 -0800 |
|---|---|---|
| committer | Malcolm Chen <refuhoo@google.com> | 2018-12-04 14:56:18 -0800 |
| commit | d9e3a5bf9b95663034fe243e2ef2d7d2ed287c4c (patch) | |
| tree | 18838efc008dd08727a0acc020116a057debf719 | |
| parent | 44be2074d09b8565fbdddc97737ffdda903cb040 (diff) | |
Deactivate bundled opportunistic subscription.
When primary subscription is disabled, also deactivate
its bundled opportunistic subscription.
Bug: 118349116
Test: unittest
Change-Id: I04cb89b8cc2d03836878866d2975af186de42468
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionInfo.java | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index bacfe61a1a10..dacc5d86e9ae 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -155,6 +155,14 @@ public class SubscriptionInfo implements Parcelable { private boolean mIsMetered; /** + * Whether group of the subscription is disabled. + * This is only useful if it's a grouped opportunistic subscription. In this case, if all + * primary (non-opportunistic) subscriptions in the group are deactivated (unplugged pSIM + * or deactivated eSIM profile), we should disable this opportunistic subscription. + */ + private boolean mIsGroupDisabled = false; + + /** * @hide */ public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName, @@ -174,6 +182,18 @@ public class SubscriptionInfo implements Parcelable { Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic, @Nullable String groupUUID, boolean isMetered) { + this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, + roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId, + isOpportunistic, groupUUID, isMetered, false); + } + /** + * @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, + @Nullable String groupUUID, boolean isMetered, boolean isGroupDisabled) { this.mId = id; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; @@ -193,6 +213,7 @@ public class SubscriptionInfo implements Parcelable { this.mIsOpportunistic = isOpportunistic; this.mGroupUUID = groupUUID; this.mIsMetered = isMetered; + this.mIsGroupDisabled = isGroupDisabled; } @@ -494,6 +515,22 @@ public class SubscriptionInfo implements Parcelable { return this.mCardId; } + /** + * Set whether the subscription's group is disabled. + * @hide + */ + public void setGroupDisabled(boolean isGroupDisabled) { + this.mIsGroupDisabled = isGroupDisabled; + } + + /** + * Return whether the subscription's group is disabled. + * @hide + */ + public boolean isGroupDisabled() { + return mIsGroupDisabled; + } + public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() { @Override public SubscriptionInfo createFromParcel(Parcel source) { @@ -516,10 +553,12 @@ public class SubscriptionInfo implements Parcelable { boolean isOpportunistic = source.readBoolean(); String groupUUID = source.readString(); boolean isMetered = source.readBoolean(); + boolean isGroupDisabled = source.readBoolean(); return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, - isEmbedded, accessRules, cardId, isOpportunistic, groupUUID, isMetered); + isEmbedded, accessRules, cardId, isOpportunistic, groupUUID, isMetered, + isGroupDisabled); } @Override @@ -549,6 +588,7 @@ public class SubscriptionInfo implements Parcelable { dest.writeBoolean(mIsOpportunistic); dest.writeString(mGroupUUID); dest.writeBoolean(mIsMetered); + dest.writeBoolean(mIsGroupDisabled); } @Override @@ -582,14 +622,15 @@ public class SubscriptionInfo implements Parcelable { + " mnc " + mMnc + "mCountryIso=" + mCountryIso + " isEmbedded " + mIsEmbedded + " accessRules " + Arrays.toString(mAccessRules) + " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic - + " mGroupUUID=" + mGroupUUID + " isMetered=" + mIsMetered + "}"; + + " mGroupUUID=" + mGroupUUID + " isMetered=" + mIsMetered + + " mIsGroupDisabled=" + mIsGroupDisabled + "}"; } @Override public int hashCode() { return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded, mIsOpportunistic, mGroupUUID, mIsMetered, mIccId, mNumber, mMcc, mMnc, - mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules); + mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules, mIsGroupDisabled); } @Override @@ -611,6 +652,7 @@ public class SubscriptionInfo implements Parcelable { && mDataRoaming == toCompare.mDataRoaming && mIsEmbedded == toCompare.mIsEmbedded && mIsOpportunistic == toCompare.mIsOpportunistic + && mIsGroupDisabled == toCompare.mIsGroupDisabled && Objects.equals(mGroupUUID, toCompare.mGroupUUID) && mIsMetered == toCompare.mIsMetered && Objects.equals(mIccId, toCompare.mIccId) @@ -623,4 +665,4 @@ public class SubscriptionInfo implements Parcelable { && TextUtils.equals(mCarrierName, toCompare.mCarrierName) && Arrays.equals(mAccessRules, toCompare.mAccessRules); } -}
\ No newline at end of file +} |
