Merge "Deactivate bundled opportunistic subscription."
This commit is contained in:
@@ -154,6 +154,14 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private boolean mIsMetered;
|
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
|
* @hide
|
||||||
*/
|
*/
|
||||||
@@ -174,6 +182,18 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
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, boolean isOpportunistic,
|
@Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic,
|
||||||
@Nullable String groupUUID, boolean isMetered) {
|
@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.mId = id;
|
||||||
this.mIccId = iccId;
|
this.mIccId = iccId;
|
||||||
this.mSimSlotIndex = simSlotIndex;
|
this.mSimSlotIndex = simSlotIndex;
|
||||||
@@ -193,6 +213,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
this.mIsOpportunistic = isOpportunistic;
|
this.mIsOpportunistic = isOpportunistic;
|
||||||
this.mGroupUUID = groupUUID;
|
this.mGroupUUID = groupUUID;
|
||||||
this.mIsMetered = isMetered;
|
this.mIsMetered = isMetered;
|
||||||
|
this.mIsGroupDisabled = isGroupDisabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -494,6 +515,22 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
return this.mCardId;
|
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>() {
|
public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public SubscriptionInfo createFromParcel(Parcel source) {
|
public SubscriptionInfo createFromParcel(Parcel source) {
|
||||||
@@ -516,10 +553,12 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
boolean isOpportunistic = source.readBoolean();
|
boolean isOpportunistic = source.readBoolean();
|
||||||
String groupUUID = source.readString();
|
String groupUUID = source.readString();
|
||||||
boolean isMetered = source.readBoolean();
|
boolean isMetered = source.readBoolean();
|
||||||
|
boolean isGroupDisabled = source.readBoolean();
|
||||||
|
|
||||||
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, isOpportunistic, groupUUID, isMetered);
|
isEmbedded, accessRules, cardId, isOpportunistic, groupUUID, isMetered,
|
||||||
|
isGroupDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -549,6 +588,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
dest.writeBoolean(mIsOpportunistic);
|
dest.writeBoolean(mIsOpportunistic);
|
||||||
dest.writeString(mGroupUUID);
|
dest.writeString(mGroupUUID);
|
||||||
dest.writeBoolean(mIsMetered);
|
dest.writeBoolean(mIsMetered);
|
||||||
|
dest.writeBoolean(mIsGroupDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -582,14 +622,15 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
+ " mnc " + mMnc + "mCountryIso=" + mCountryIso + " isEmbedded " + mIsEmbedded
|
+ " mnc " + mMnc + "mCountryIso=" + mCountryIso + " isEmbedded " + mIsEmbedded
|
||||||
+ " accessRules " + Arrays.toString(mAccessRules)
|
+ " accessRules " + Arrays.toString(mAccessRules)
|
||||||
+ " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic
|
+ " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic
|
||||||
+ " mGroupUUID=" + mGroupUUID + " isMetered=" + mIsMetered + "}";
|
+ " mGroupUUID=" + mGroupUUID + " isMetered=" + mIsMetered
|
||||||
|
+ " mIsGroupDisabled=" + mIsGroupDisabled + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
|
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
|
||||||
mIsOpportunistic, mGroupUUID, mIsMetered, mIccId, mNumber, mMcc, mMnc,
|
mIsOpportunistic, mGroupUUID, mIsMetered, mIccId, mNumber, mMcc, mMnc,
|
||||||
mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules);
|
mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules, mIsGroupDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -611,6 +652,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
&& mDataRoaming == toCompare.mDataRoaming
|
&& mDataRoaming == toCompare.mDataRoaming
|
||||||
&& mIsEmbedded == toCompare.mIsEmbedded
|
&& mIsEmbedded == toCompare.mIsEmbedded
|
||||||
&& mIsOpportunistic == toCompare.mIsOpportunistic
|
&& mIsOpportunistic == toCompare.mIsOpportunistic
|
||||||
|
&& mIsGroupDisabled == toCompare.mIsGroupDisabled
|
||||||
&& Objects.equals(mGroupUUID, toCompare.mGroupUUID)
|
&& Objects.equals(mGroupUUID, toCompare.mGroupUUID)
|
||||||
&& mIsMetered == toCompare.mIsMetered
|
&& mIsMetered == toCompare.mIsMetered
|
||||||
&& Objects.equals(mIccId, toCompare.mIccId)
|
&& Objects.equals(mIccId, toCompare.mIccId)
|
||||||
|
|||||||
Reference in New Issue
Block a user