diff options
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionInfo.java | 38 | ||||
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 8 |
2 files changed, 37 insertions, 9 deletions
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index 770f780372ad..70471d719205 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -173,6 +173,11 @@ public class SubscriptionInfo implements Parcelable { 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. * 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 @@ -203,9 +208,10 @@ public class SubscriptionInfo implements Parcelable { Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardString) { this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, - roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, - false, null, TelephonyManager.UNKNOWN_CARRIER_ID, - SubscriptionManager.PROFILE_CLASS_DEFAULT); + roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, -1, + false, null, false, TelephonyManager.UNKNOWN_CARRIER_ID, + 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, roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, -1, 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, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardString, int cardId, - boolean isOpportunistic, @Nullable String groupUUID, - boolean isGroupDisabled, int carrierId, int profileClass, int subType) { + boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled, + int carrierId, int profileClass, int subType, @Nullable String groupOwner) { this.mId = id; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; @@ -254,6 +260,7 @@ public class SubscriptionInfo implements Parcelable { this.mCarrierId = carrierId; this.mProfileClass = profileClass; this.mSubscriptionType = subType; + this.mGroupOwner = groupOwner; } /** @@ -500,6 +507,15 @@ public class SubscriptionInfo implements Parcelable { } /** + * Return owner package of group the subscription belongs to. + * + * @hide + */ + public @Nullable String getGroupOwner() { + return mGroupOwner; + } + + /** * @return the profile class of this subscription. * @hide */ @@ -645,11 +661,12 @@ public class SubscriptionInfo implements Parcelable { int subType = source.readInt(); String[] ehplmns = source.readStringArray(); String[] hplmns = source.readStringArray(); + String groupOwner = source.readString(); SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, cardId, isOpportunistic, - groupUUID, isGroupDisabled, carrierid, profileClass, subType); + groupUUID, isGroupDisabled, carrierid, profileClass, subType, groupOwner); info.setAssociatedPlmns(ehplmns, hplmns); return info; } @@ -687,6 +704,7 @@ public class SubscriptionInfo implements Parcelable { dest.writeInt(mSubscriptionType); dest.writeStringArray(mEhplmns); dest.writeStringArray(mHplmns); + dest.writeString(mGroupOwner); } @Override @@ -726,7 +744,8 @@ public class SubscriptionInfo implements Parcelable { + " profileClass=" + mProfileClass + " ehplmns = " + Arrays.toString(mEhplmns) + " hplmns = " + Arrays.toString(mHplmns) - + " subscriptionType=" + mSubscriptionType + "}"; + + " subscriptionType=" + mSubscriptionType + + " mGroupOwner=" + mGroupOwner + "}"; } @Override @@ -734,7 +753,7 @@ public class SubscriptionInfo implements Parcelable { return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded, mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc, mCountryIso, mCardString, mCardId, mDisplayName, mCarrierName, mAccessRules, - mIsGroupDisabled, mCarrierId, mProfileClass); + mIsGroupDisabled, mCarrierId, mProfileClass, mGroupOwner); } @Override @@ -766,6 +785,7 @@ public class SubscriptionInfo implements Parcelable { && Objects.equals(mCountryIso, toCompare.mCountryIso) && Objects.equals(mCardString, toCompare.mCardString) && Objects.equals(mCardId, toCompare.mCardId) + && Objects.equals(mGroupOwner, toCompare.mGroupOwner) && TextUtils.equals(mDisplayName, toCompare.mDisplayName) && TextUtils.equals(mCarrierName, toCompare.mCarrierName) && Arrays.equals(mAccessRules, toCompare.mAccessRules) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 0b1a8e02f00d..addd9e0591b0 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -694,6 +694,14 @@ public class SubscriptionManager { 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 * the network it connects to charges for subscription or not. For example, paid CBRS or unpaid. * @hide |