Merge "Add EHPLMN and HPLMN to SubscriptionInfo"
This commit is contained in:
@@ -39,6 +39,7 @@ import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -122,6 +123,16 @@ public class SubscriptionInfo implements Parcelable {
|
||||
*/
|
||||
private String mMnc;
|
||||
|
||||
/**
|
||||
* EHPLMNs associated with the subscription
|
||||
*/
|
||||
private String[] mEhplmns;
|
||||
|
||||
/**
|
||||
* HPLMNs associated with the subscription
|
||||
*/
|
||||
private String[] mHplmns;
|
||||
|
||||
/**
|
||||
* ISO Country code for the subscription's provider
|
||||
*/
|
||||
@@ -315,6 +326,14 @@ public class SubscriptionInfo implements Parcelable {
|
||||
return this.mNameSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public void setAssociatedPlmns(String[] ehplmns, String[] hplmns) {
|
||||
mEhplmns = ehplmns;
|
||||
mHplmns = hplmns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns an icon {@code Bitmap} to represent this {@code SubscriptionInfo} in a
|
||||
* user interface.
|
||||
@@ -466,6 +485,20 @@ public class SubscriptionInfo implements Parcelable {
|
||||
return mGroupUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public List<String> getEhplmns() {
|
||||
return mEhplmns == null ? Collections.emptyList() : Arrays.asList(mEhplmns);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public List<String> getHplmns() {
|
||||
return mHplmns == null ? Collections.emptyList() : Arrays.asList(mHplmns);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the profile class of this subscription.
|
||||
* @hide
|
||||
@@ -599,7 +632,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
String mcc = source.readString();
|
||||
String mnc = source.readString();
|
||||
String countryIso = source.readString();
|
||||
Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
|
||||
Bitmap iconBitmap = source.readParcelable(Bitmap.class.getClassLoader());
|
||||
boolean isEmbedded = source.readBoolean();
|
||||
UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR);
|
||||
String cardString = source.readString();
|
||||
@@ -610,11 +643,15 @@ public class SubscriptionInfo implements Parcelable {
|
||||
int carrierid = source.readInt();
|
||||
int profileClass = source.readInt();
|
||||
int subType = source.readInt();
|
||||
String[] ehplmns = source.readStringArray();
|
||||
String[] hplmns = source.readStringArray();
|
||||
|
||||
return 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);
|
||||
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);
|
||||
info.setAssociatedPlmns(ehplmns, hplmns);
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -637,7 +674,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
dest.writeString(mMcc);
|
||||
dest.writeString(mMnc);
|
||||
dest.writeString(mCountryIso);
|
||||
mIconBitmap.writeToParcel(dest, flags);
|
||||
dest.writeParcelable(mIconBitmap, flags);
|
||||
dest.writeBoolean(mIsEmbedded);
|
||||
dest.writeTypedArray(mAccessRules, flags);
|
||||
dest.writeString(mCardString);
|
||||
@@ -648,6 +685,8 @@ public class SubscriptionInfo implements Parcelable {
|
||||
dest.writeInt(mCarrierId);
|
||||
dest.writeInt(mProfileClass);
|
||||
dest.writeInt(mSubscriptionType);
|
||||
dest.writeStringArray(mEhplmns);
|
||||
dest.writeStringArray(mHplmns);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -685,6 +724,8 @@ public class SubscriptionInfo implements Parcelable {
|
||||
+ " isOpportunistic " + mIsOpportunistic + " mGroupUUID=" + mGroupUUID
|
||||
+ " mIsGroupDisabled=" + mIsGroupDisabled
|
||||
+ " profileClass=" + mProfileClass
|
||||
+ " ehplmns = " + Arrays.toString(mEhplmns)
|
||||
+ " hplmns = " + Arrays.toString(mHplmns)
|
||||
+ " subscriptionType=" + mSubscriptionType + "}";
|
||||
}
|
||||
|
||||
@@ -728,6 +769,8 @@ public class SubscriptionInfo implements Parcelable {
|
||||
&& TextUtils.equals(mDisplayName, toCompare.mDisplayName)
|
||||
&& TextUtils.equals(mCarrierName, toCompare.mCarrierName)
|
||||
&& Arrays.equals(mAccessRules, toCompare.mAccessRules)
|
||||
&& mProfileClass == toCompare.mProfileClass;
|
||||
&& mProfileClass == toCompare.mProfileClass
|
||||
&& Arrays.equals(mEhplmns, toCompare.mEhplmns)
|
||||
&& Arrays.equals(mHplmns, toCompare.mHplmns);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,6 +457,18 @@ public class SubscriptionManager {
|
||||
*/
|
||||
public static final String CARRIER_ID = "carrier_id";
|
||||
|
||||
/**
|
||||
* @hide A comma-separated list of EHPLMNs associated with the subscription
|
||||
* <P>Type: TEXT (String)</P>
|
||||
*/
|
||||
public static final String EHPLMNS = "ehplmns";
|
||||
|
||||
/**
|
||||
* @hide A comma-separated list of HPLMNs associated with the subscription
|
||||
* <P>Type: TEXT (String)</P>
|
||||
*/
|
||||
public static final String HPLMNS = "hplmns";
|
||||
|
||||
/**
|
||||
* TelephonyProvider column name for the MCC associated with a SIM, stored as a string.
|
||||
* <P>Type: TEXT (String)</P>
|
||||
|
||||
Reference in New Issue
Block a user