Merge "Adding subscription group owner."

This commit is contained in:
Xiangyu/Malcolm Chen
2019-05-16 06:21:12 +00:00
committed by Gerrit Code Review
2 changed files with 37 additions and 9 deletions

View File

@@ -172,6 +172,11 @@ public class SubscriptionInfo implements Parcelable {
@Nullable @Nullable
private ParcelUuid mGroupUUID; private ParcelUuid mGroupUUID;
/**
* A package name that specifies who created the group. Null if mGroupUUID is null.
*/
private String mGroupOwner;
/** /**
* Whether group of the subscription is disabled. * Whether group of the subscription is disabled.
* This is only useful if it's a grouped opportunistic subscription. In this case, if all * This is only useful if it's a grouped opportunistic subscription. In this case, if all
@@ -203,9 +208,10 @@ 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 cardString) { @Nullable UiccAccessRule[] accessRules, String cardString) {
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, -1,
false, null, TelephonyManager.UNKNOWN_CARRIER_ID, false, null, false, TelephonyManager.UNKNOWN_CARRIER_ID,
SubscriptionManager.PROFILE_CLASS_DEFAULT); SubscriptionManager.PROFILE_CLASS_DEFAULT,
SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null);
} }
/** /**
@@ -219,7 +225,7 @@ public class SubscriptionInfo implements Parcelable {
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, -1, roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, -1,
isOpportunistic, groupUUID, false, carrierId, profileClass, isOpportunistic, groupUUID, false, carrierId, profileClass,
SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM); SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null);
} }
/** /**
@@ -229,8 +235,8 @@ 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 cardString, int cardId, @Nullable UiccAccessRule[] accessRules, String cardString, int cardId,
boolean isOpportunistic, @Nullable String groupUUID, boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled,
boolean isGroupDisabled, int carrierId, int profileClass, int subType) { int carrierId, int profileClass, int subType, @Nullable String groupOwner) {
this.mId = id; this.mId = id;
this.mIccId = iccId; this.mIccId = iccId;
this.mSimSlotIndex = simSlotIndex; this.mSimSlotIndex = simSlotIndex;
@@ -254,6 +260,7 @@ public class SubscriptionInfo implements Parcelable {
this.mCarrierId = carrierId; this.mCarrierId = carrierId;
this.mProfileClass = profileClass; this.mProfileClass = profileClass;
this.mSubscriptionType = subType; this.mSubscriptionType = subType;
this.mGroupOwner = groupOwner;
} }
/** /**
@@ -499,6 +506,15 @@ public class SubscriptionInfo implements Parcelable {
return mHplmns == null ? Collections.emptyList() : Arrays.asList(mHplmns); return mHplmns == null ? Collections.emptyList() : Arrays.asList(mHplmns);
} }
/**
* Return owner package of group the subscription belongs to.
*
* @hide
*/
public @Nullable String getGroupOwner() {
return mGroupOwner;
}
/** /**
* @return the profile class of this subscription. * @return the profile class of this subscription.
* @hide * @hide
@@ -645,11 +661,12 @@ public class SubscriptionInfo implements Parcelable {
int subType = source.readInt(); int subType = source.readInt();
String[] ehplmns = source.readStringArray(); String[] ehplmns = source.readStringArray();
String[] hplmns = source.readStringArray(); String[] hplmns = source.readStringArray();
String groupOwner = source.readString();
SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName, SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName,
carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc,
countryIso, isEmbedded, accessRules, cardString, cardId, isOpportunistic, countryIso, isEmbedded, accessRules, cardString, cardId, isOpportunistic,
groupUUID, isGroupDisabled, carrierid, profileClass, subType); groupUUID, isGroupDisabled, carrierid, profileClass, subType, groupOwner);
info.setAssociatedPlmns(ehplmns, hplmns); info.setAssociatedPlmns(ehplmns, hplmns);
return info; return info;
} }
@@ -687,6 +704,7 @@ public class SubscriptionInfo implements Parcelable {
dest.writeInt(mSubscriptionType); dest.writeInt(mSubscriptionType);
dest.writeStringArray(mEhplmns); dest.writeStringArray(mEhplmns);
dest.writeStringArray(mHplmns); dest.writeStringArray(mHplmns);
dest.writeString(mGroupOwner);
} }
@Override @Override
@@ -726,7 +744,8 @@ public class SubscriptionInfo implements Parcelable {
+ " profileClass=" + mProfileClass + " profileClass=" + mProfileClass
+ " ehplmns = " + Arrays.toString(mEhplmns) + " ehplmns = " + Arrays.toString(mEhplmns)
+ " hplmns = " + Arrays.toString(mHplmns) + " hplmns = " + Arrays.toString(mHplmns)
+ " subscriptionType=" + mSubscriptionType + "}"; + " subscriptionType=" + mSubscriptionType
+ " mGroupOwner=" + mGroupOwner + "}";
} }
@Override @Override
@@ -734,7 +753,7 @@ public class SubscriptionInfo implements Parcelable {
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded, return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc, mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc,
mCountryIso, mCardString, mCardId, mDisplayName, mCarrierName, mAccessRules, mCountryIso, mCardString, mCardId, mDisplayName, mCarrierName, mAccessRules,
mIsGroupDisabled, mCarrierId, mProfileClass); mIsGroupDisabled, mCarrierId, mProfileClass, mGroupOwner);
} }
@Override @Override
@@ -766,6 +785,7 @@ public class SubscriptionInfo implements Parcelable {
&& Objects.equals(mCountryIso, toCompare.mCountryIso) && Objects.equals(mCountryIso, toCompare.mCountryIso)
&& Objects.equals(mCardString, toCompare.mCardString) && Objects.equals(mCardString, toCompare.mCardString)
&& Objects.equals(mCardId, toCompare.mCardId) && Objects.equals(mCardId, toCompare.mCardId)
&& Objects.equals(mGroupOwner, toCompare.mGroupOwner)
&& TextUtils.equals(mDisplayName, toCompare.mDisplayName) && TextUtils.equals(mDisplayName, toCompare.mDisplayName)
&& TextUtils.equals(mCarrierName, toCompare.mCarrierName) && TextUtils.equals(mCarrierName, toCompare.mCarrierName)
&& Arrays.equals(mAccessRules, toCompare.mAccessRules) && Arrays.equals(mAccessRules, toCompare.mAccessRules)

View File

@@ -693,6 +693,14 @@ public class SubscriptionManager {
*/ */
public static final String GROUP_UUID = "group_uuid"; public static final String GROUP_UUID = "group_uuid";
/**
* TelephonyProvider column name for group owner. It's the package name who created
* the subscription group.
*
* @hide
*/
public static final String GROUP_OWNER = "group_owner";
/** /**
* TelephonyProvider column name for whether a subscription is metered or not, that is, whether * TelephonyProvider column name for whether a subscription is metered or not, that is, whether
* the network it connects to charges for subscription or not. For example, paid CBRS or unpaid. * the network it connects to charges for subscription or not. For example, paid CBRS or unpaid.