Merge changes from topics "rename_display_name_source", "sdbm"
* changes: Improved debug message Fixed equals and hashCode Renamed name source to display name source
This commit is contained in:
@@ -53,6 +53,7 @@ import com.android.internal.telephony.SmsApplication;
|
|||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -4353,6 +4354,12 @@ public final class Telephony {
|
|||||||
*/
|
*/
|
||||||
public static final String COLUMN_NAME_SOURCE = "name_source";
|
public static final String COLUMN_NAME_SOURCE = "name_source";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name source is unknown.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int NAME_SOURCE_UNKNOWN = -1;
|
||||||
|
|
||||||
/** The name_source is from the carrier id. {@hide} */
|
/** The name_source is from the carrier id. {@hide} */
|
||||||
public static final int NAME_SOURCE_CARRIER_ID = 0;
|
public static final int NAME_SOURCE_CARRIER_ID = 0;
|
||||||
|
|
||||||
@@ -4834,5 +4841,86 @@ public final class Telephony {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final String COLUMN_USER_HANDLE = "user_handle";
|
public static final String COLUMN_USER_HANDLE = "user_handle";
|
||||||
|
|
||||||
|
/** All columns in {@link SimInfo} table. */
|
||||||
|
private static final List<String> ALL_COLUMNS = List.of(
|
||||||
|
COLUMN_UNIQUE_KEY_SUBSCRIPTION_ID,
|
||||||
|
COLUMN_ICC_ID,
|
||||||
|
COLUMN_SIM_SLOT_INDEX,
|
||||||
|
COLUMN_DISPLAY_NAME,
|
||||||
|
COLUMN_CARRIER_NAME,
|
||||||
|
COLUMN_NAME_SOURCE,
|
||||||
|
COLUMN_COLOR,
|
||||||
|
COLUMN_NUMBER,
|
||||||
|
COLUMN_DISPLAY_NUMBER_FORMAT,
|
||||||
|
COLUMN_DATA_ROAMING,
|
||||||
|
COLUMN_MCC,
|
||||||
|
COLUMN_MNC,
|
||||||
|
COLUMN_MCC_STRING,
|
||||||
|
COLUMN_MNC_STRING,
|
||||||
|
COLUMN_EHPLMNS,
|
||||||
|
COLUMN_HPLMNS,
|
||||||
|
COLUMN_SIM_PROVISIONING_STATUS,
|
||||||
|
COLUMN_IS_EMBEDDED,
|
||||||
|
COLUMN_CARD_ID,
|
||||||
|
COLUMN_ACCESS_RULES,
|
||||||
|
COLUMN_ACCESS_RULES_FROM_CARRIER_CONFIGS,
|
||||||
|
COLUMN_IS_REMOVABLE,
|
||||||
|
COLUMN_CB_EXTREME_THREAT_ALERT,
|
||||||
|
COLUMN_CB_SEVERE_THREAT_ALERT,
|
||||||
|
COLUMN_CB_AMBER_ALERT,
|
||||||
|
COLUMN_CB_EMERGENCY_ALERT,
|
||||||
|
COLUMN_CB_ALERT_SOUND_DURATION,
|
||||||
|
COLUMN_CB_ALERT_REMINDER_INTERVAL,
|
||||||
|
COLUMN_CB_ALERT_VIBRATE,
|
||||||
|
COLUMN_CB_ALERT_SPEECH,
|
||||||
|
COLUMN_CB_ETWS_TEST_ALERT,
|
||||||
|
COLUMN_CB_CHANNEL_50_ALERT,
|
||||||
|
COLUMN_CB_CMAS_TEST_ALERT,
|
||||||
|
COLUMN_CB_OPT_OUT_DIALOG,
|
||||||
|
COLUMN_ENHANCED_4G_MODE_ENABLED,
|
||||||
|
COLUMN_VT_IMS_ENABLED,
|
||||||
|
COLUMN_WFC_IMS_ENABLED,
|
||||||
|
COLUMN_WFC_IMS_MODE,
|
||||||
|
COLUMN_WFC_IMS_ROAMING_MODE,
|
||||||
|
COLUMN_WFC_IMS_ROAMING_ENABLED,
|
||||||
|
COLUMN_IS_OPPORTUNISTIC,
|
||||||
|
COLUMN_GROUP_UUID,
|
||||||
|
COLUMN_IS_METERED,
|
||||||
|
COLUMN_ISO_COUNTRY_CODE,
|
||||||
|
COLUMN_CARRIER_ID,
|
||||||
|
COLUMN_PROFILE_CLASS,
|
||||||
|
COLUMN_SUBSCRIPTION_TYPE,
|
||||||
|
COLUMN_GROUP_OWNER,
|
||||||
|
COLUMN_DATA_ENABLED_OVERRIDE_RULES,
|
||||||
|
COLUMN_ENABLED_MOBILE_DATA_POLICIES,
|
||||||
|
COLUMN_IMSI,
|
||||||
|
COLUMN_UICC_APPLICATIONS_ENABLED,
|
||||||
|
COLUMN_ALLOWED_NETWORK_TYPES,
|
||||||
|
COLUMN_IMS_RCS_UCE_ENABLED,
|
||||||
|
COLUMN_CROSS_SIM_CALLING_ENABLED,
|
||||||
|
COLUMN_RCS_CONFIG,
|
||||||
|
COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS,
|
||||||
|
COLUMN_D2D_STATUS_SHARING,
|
||||||
|
COLUMN_VOIMS_OPT_IN_STATUS,
|
||||||
|
COLUMN_D2D_STATUS_SHARING_SELECTED_CONTACTS,
|
||||||
|
COLUMN_NR_ADVANCED_CALLING_ENABLED,
|
||||||
|
COLUMN_PHONE_NUMBER_SOURCE_CARRIER,
|
||||||
|
COLUMN_PHONE_NUMBER_SOURCE_IMS,
|
||||||
|
COLUMN_PORT_INDEX,
|
||||||
|
COLUMN_USAGE_SETTING,
|
||||||
|
COLUMN_TP_MESSAGE_REF,
|
||||||
|
COLUMN_USER_HANDLE
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return All columns in {@link SimInfo} table.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static List<String> getAllColumns() {
|
||||||
|
return ALL_COLUMNS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,4 +192,22 @@ public final class TelephonyUtils {
|
|||||||
// This is the error case. The well-defined value for UNKNOWN is -1.
|
// This is the error case. The well-defined value for UNKNOWN is -1.
|
||||||
return "UNKNOWN(" + state + ")";
|
return "UNKNOWN(" + state + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert mobile data policy to string.
|
||||||
|
*
|
||||||
|
* @param mobileDataPolicy The mobile data policy.
|
||||||
|
* @return The mobile data policy in string format.
|
||||||
|
*/
|
||||||
|
public static @NonNull String mobileDataPolicyToString(
|
||||||
|
@TelephonyManager.MobileDataPolicy int mobileDataPolicy) {
|
||||||
|
switch (mobileDataPolicy) {
|
||||||
|
case TelephonyManager.MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL:
|
||||||
|
return "DATA_ON_NON_DEFAULT_DURING_VOICE_CALL";
|
||||||
|
case TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED:
|
||||||
|
return "MMS_ALWAYS_ALLOWED";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + mobileDataPolicy + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import static android.text.TextUtils.formatSimple;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -34,7 +33,6 @@ import android.graphics.PorterDuff;
|
|||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.ParcelUuid;
|
import android.os.ParcelUuid;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -98,17 +96,10 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
private final CharSequence mCarrierName;
|
private final CharSequence mCarrierName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The subscription carrier id.
|
* The source of the {@link #mDisplayName}.
|
||||||
*
|
|
||||||
* @see TelephonyManager#getSimCarrierId()
|
|
||||||
*/
|
|
||||||
private final int mCarrierId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The source of the {@link #mCarrierName}.
|
|
||||||
*/
|
*/
|
||||||
@SimDisplayNameSource
|
@SimDisplayNameSource
|
||||||
private final int mNameSource;
|
private final int mDisplayNameSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The color to be used for tinting the icon when displaying to the user.
|
* The color to be used for tinting the icon when displaying to the user.
|
||||||
@@ -128,12 +119,6 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private final int mDataRoaming;
|
private final int mDataRoaming;
|
||||||
|
|
||||||
/**
|
|
||||||
* SIM icon bitmap cache.
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
private Bitmap mIconBitmap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mobile Country Code.
|
* Mobile Country Code.
|
||||||
*/
|
*/
|
||||||
@@ -158,17 +143,18 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
@NonNull
|
@NonNull
|
||||||
private final String[] mHplmns;
|
private final String[] mHplmns;
|
||||||
|
|
||||||
/**
|
|
||||||
* ISO Country code for the subscription's provider.
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
private final String mCountryIso;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the subscription is from eSIM.
|
* Whether the subscription is from eSIM.
|
||||||
*/
|
*/
|
||||||
private final boolean mIsEmbedded;
|
private final boolean mIsEmbedded;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The string ID of the SIM card. It is the ICCID of the active profile for a UICC card and the
|
||||||
|
* EID for an eUICC card.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
private final String mCardString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The access rules for this subscription, if it is embedded and defines any. This does not
|
* The access rules for this subscription, if it is embedded and defines any. This does not
|
||||||
* include access rules for non-embedded subscriptions.
|
* include access rules for non-embedded subscriptions.
|
||||||
@@ -183,18 +169,6 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
@Nullable
|
@Nullable
|
||||||
private final UiccAccessRule[] mCarrierConfigAccessRules;
|
private final UiccAccessRule[] mCarrierConfigAccessRules;
|
||||||
|
|
||||||
/**
|
|
||||||
* The string ID of the SIM card. It is the ICCID of the active profile for a UICC card and the
|
|
||||||
* EID for an eUICC card.
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
private final String mCardString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The card ID of the SIM card. This maps uniquely to {@link #mCardString}.
|
|
||||||
*/
|
|
||||||
private final int mCardId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the subscription is opportunistic.
|
* Whether the subscription is opportunistic.
|
||||||
*/
|
*/
|
||||||
@@ -209,18 +183,17 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
private final ParcelUuid mGroupUuid;
|
private final ParcelUuid mGroupUuid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A package name that specifies who created the group. Empty if not available.
|
* ISO Country code for the subscription's provider.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
private final String mGroupOwner;
|
private final String mCountryIso;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether group of the subscription is disabled. This is only useful if it's a grouped
|
* The subscription carrier id.
|
||||||
* 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
|
* @see TelephonyManager#getSimCarrierId()
|
||||||
* this opportunistic subscription.
|
|
||||||
*/
|
*/
|
||||||
private final boolean mIsGroupDisabled;
|
private final int mCarrierId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The profile class populated from the profile metadata if present. Otherwise,
|
* The profile class populated from the profile metadata if present. Otherwise,
|
||||||
@@ -237,6 +210,12 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
@SubscriptionType
|
@SubscriptionType
|
||||||
private final int mType;
|
private final int mType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A package name that specifies who created the group. Empty if not available.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
private final String mGroupOwner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether uicc applications are configured to enable or disable.
|
* Whether uicc applications are configured to enable or disable.
|
||||||
* By default it's true.
|
* By default it's true.
|
||||||
@@ -254,6 +233,27 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
@UsageSetting
|
@UsageSetting
|
||||||
private final int mUsageSetting;
|
private final int mUsageSetting;
|
||||||
|
|
||||||
|
// Below are the fields that do not exist in the database.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SIM icon bitmap cache.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
private Bitmap mIconBitmap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The card ID of the SIM card. This maps uniquely to {@link #mCardString}.
|
||||||
|
*/
|
||||||
|
private final int mCardId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 final boolean mIsGroupDisabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*
|
*
|
||||||
@@ -319,14 +319,14 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
// TODO: Clean up after external usages moved to builder model.
|
// TODO: Clean up after external usages moved to builder model.
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
||||||
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
CharSequence carrierName, int displayNameSource, int iconTint, String number,
|
||||||
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
int roaming, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||||
@Nullable UiccAccessRule[] nativeAccessRules, String cardString, int cardId,
|
@Nullable UiccAccessRule[] nativeAccessRules, String cardString, int cardId,
|
||||||
boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled,
|
boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled,
|
||||||
int carrierId, int profileClass, int subType, @Nullable String groupOwner,
|
int carrierId, int profileClass, int subType, @Nullable String groupOwner,
|
||||||
@Nullable UiccAccessRule[] carrierConfigAccessRules,
|
@Nullable UiccAccessRule[] carrierConfigAccessRules,
|
||||||
boolean areUiccApplicationsEnabled, int portIndex) {
|
boolean areUiccApplicationsEnabled, int portIndex) {
|
||||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
this(id, iccId, simSlotIndex, displayName, carrierName, displayNameSource, iconTint, number,
|
||||||
roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString,
|
roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString,
|
||||||
cardId, isOpportunistic, groupUUID, isGroupDisabled, carrierId, profileClass,
|
cardId, isOpportunistic, groupUUID, isGroupDisabled, carrierId, profileClass,
|
||||||
subType, groupOwner, carrierConfigAccessRules, areUiccApplicationsEnabled,
|
subType, groupOwner, carrierConfigAccessRules, areUiccApplicationsEnabled,
|
||||||
@@ -353,7 +353,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
this.mSimSlotIndex = simSlotIndex;
|
this.mSimSlotIndex = simSlotIndex;
|
||||||
this.mDisplayName = displayName;
|
this.mDisplayName = displayName;
|
||||||
this.mCarrierName = carrierName;
|
this.mCarrierName = carrierName;
|
||||||
this.mNameSource = nameSource;
|
this.mDisplayNameSource = nameSource;
|
||||||
this.mIconTint = iconTint;
|
this.mIconTint = iconTint;
|
||||||
this.mNumber = number;
|
this.mNumber = number;
|
||||||
this.mDataRoaming = roaming;
|
this.mDataRoaming = roaming;
|
||||||
@@ -391,7 +391,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
this.mSimSlotIndex = builder.mSimSlotIndex;
|
this.mSimSlotIndex = builder.mSimSlotIndex;
|
||||||
this.mDisplayName = builder.mDisplayName;
|
this.mDisplayName = builder.mDisplayName;
|
||||||
this.mCarrierName = builder.mCarrierName;
|
this.mCarrierName = builder.mCarrierName;
|
||||||
this.mNameSource = builder.mNameSource;
|
this.mDisplayNameSource = builder.mDisplayNameSource;
|
||||||
this.mIconTint = builder.mIconTint;
|
this.mIconTint = builder.mIconTint;
|
||||||
this.mNumber = builder.mNumber;
|
this.mNumber = builder.mNumber;
|
||||||
this.mDataRoaming = builder.mDataRoaming;
|
this.mDataRoaming = builder.mDataRoaming;
|
||||||
@@ -481,14 +481,13 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The source of the {@link #getCarrierName()}.
|
* @return The source of the {@link #getDisplayName()}.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
|
||||||
@SimDisplayNameSource
|
@SimDisplayNameSource
|
||||||
public int getNameSource() {
|
public int getDisplayNameSource() {
|
||||||
return mNameSource;
|
return mDisplayNameSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -668,7 +667,8 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<String> getEhplmns() {
|
public List<String> getEhplmns() {
|
||||||
return mEhplmns == null ? Collections.emptyList() : Arrays.asList(mEhplmns);
|
return Collections.unmodifiableList(mEhplmns == null
|
||||||
|
? Collections.emptyList() : Arrays.asList(mEhplmns));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,7 +676,8 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<String> getHplmns() {
|
public List<String> getHplmns() {
|
||||||
return mHplmns == null ? Collections.emptyList() : Arrays.asList(mHplmns);
|
return Collections.unmodifiableList(mHplmns == null
|
||||||
|
? Collections.emptyList() : Arrays.asList(mHplmns));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -780,7 +781,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
if (mCarrierConfigAccessRules != null) {
|
if (mCarrierConfigAccessRules != null) {
|
||||||
merged.addAll(Arrays.asList(mCarrierConfigAccessRules));
|
merged.addAll(Arrays.asList(mCarrierConfigAccessRules));
|
||||||
}
|
}
|
||||||
return merged.isEmpty() ? null : merged;
|
return merged.isEmpty() ? null : Collections.unmodifiableList(merged);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -863,7 +864,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
.setSimSlotIndex(source.readInt())
|
.setSimSlotIndex(source.readInt())
|
||||||
.setDisplayName(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source))
|
.setDisplayName(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source))
|
||||||
.setCarrierName(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source))
|
.setCarrierName(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source))
|
||||||
.setNameSource(source.readInt())
|
.setDisplayNameSource(source.readInt())
|
||||||
.setIconTint(source.readInt())
|
.setIconTint(source.readInt())
|
||||||
.setNumber(source.readString())
|
.setNumber(source.readString())
|
||||||
.setDataRoaming(source.readInt())
|
.setDataRoaming(source.readInt())
|
||||||
@@ -904,7 +905,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
dest.writeInt(mSimSlotIndex);
|
dest.writeInt(mSimSlotIndex);
|
||||||
TextUtils.writeToParcel(mDisplayName, dest, 0);
|
TextUtils.writeToParcel(mDisplayName, dest, 0);
|
||||||
TextUtils.writeToParcel(mCarrierName, dest, 0);
|
TextUtils.writeToParcel(mCarrierName, dest, 0);
|
||||||
dest.writeInt(mNameSource);
|
dest.writeInt(mDisplayNameSource);
|
||||||
dest.writeInt(mIconTint);
|
dest.writeInt(mIconTint);
|
||||||
dest.writeString(mNumber);
|
dest.writeString(mNumber);
|
||||||
dest.writeInt(mDataRoaming);
|
dest.writeInt(mDataRoaming);
|
||||||
@@ -960,69 +961,75 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
String iccIdToPrint = givePrintableIccid(mIccId);
|
String iccIdToPrint = givePrintableIccid(mIccId);
|
||||||
String cardStringToPrint = givePrintableIccid(mCardString);
|
String cardStringToPrint = givePrintableIccid(mCardString);
|
||||||
return "{id=" + mId + " iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
|
return "[SubscriptionInfo: id=" + mId
|
||||||
+ " carrierId=" + mCarrierId + " displayName=" + mDisplayName
|
+ " iccId=" + iccIdToPrint
|
||||||
+ " carrierName=" + mCarrierName + " nameSource=" + mNameSource
|
+ " simSlotIndex=" + mSimSlotIndex
|
||||||
|
+ " portIndex=" + mPortIndex
|
||||||
|
+ " isEmbedded=" + mIsEmbedded
|
||||||
|
+ " carrierId=" + mCarrierId
|
||||||
|
+ " displayName=" + mDisplayName
|
||||||
|
+ " carrierName=" + mCarrierName
|
||||||
|
+ " isOpportunistic=" + mIsOpportunistic
|
||||||
|
+ " groupUuid=" + mGroupUuid
|
||||||
|
+ " groupOwner=" + mGroupOwner
|
||||||
|
+ " isGroupDisabled=" + mIsGroupDisabled
|
||||||
|
+ " displayNameSource="
|
||||||
|
+ SubscriptionManager.displayNameSourceToString(mDisplayNameSource)
|
||||||
+ " iconTint=" + mIconTint
|
+ " iconTint=" + mIconTint
|
||||||
+ " number=" + Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, mNumber)
|
+ " number=" + Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, mNumber)
|
||||||
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc=" + mMcc
|
+ " dataRoaming=" + mDataRoaming
|
||||||
+ " mnc=" + mMnc + " countryIso=" + mCountryIso + " isEmbedded=" + mIsEmbedded
|
+ " mcc=" + mMcc
|
||||||
+ " nativeAccessRules=" + Arrays.toString(mNativeAccessRules)
|
+ " mnc=" + mMnc
|
||||||
+ " cardString=" + cardStringToPrint + " cardId=" + mCardId
|
|
||||||
+ " portIndex=" + mPortIndex
|
|
||||||
+ " isOpportunistic=" + mIsOpportunistic + " groupUuid=" + mGroupUuid
|
|
||||||
+ " isGroupDisabled=" + mIsGroupDisabled
|
|
||||||
+ " profileClass=" + mProfileClass
|
|
||||||
+ " ehplmns=" + Arrays.toString(mEhplmns)
|
+ " ehplmns=" + Arrays.toString(mEhplmns)
|
||||||
+ " hplmns=" + Arrays.toString(mHplmns)
|
+ " hplmns=" + Arrays.toString(mHplmns)
|
||||||
+ " mType=" + mType
|
+ " cardString=" + cardStringToPrint
|
||||||
+ " groupOwner=" + mGroupOwner
|
+ " cardId=" + mCardId
|
||||||
|
+ " nativeAccessRules=" + Arrays.toString(mNativeAccessRules)
|
||||||
+ " carrierConfigAccessRules=" + Arrays.toString(mCarrierConfigAccessRules)
|
+ " carrierConfigAccessRules=" + Arrays.toString(mCarrierConfigAccessRules)
|
||||||
|
+ " countryIso=" + mCountryIso
|
||||||
|
+ " profileClass=" + mProfileClass
|
||||||
|
+ " mType=" + SubscriptionManager.subscriptionTypeToString(mType)
|
||||||
+ " areUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled
|
+ " areUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled
|
||||||
+ " usageSetting=" + mUsageSetting + "}";
|
+ " usageSetting=" + SubscriptionManager.usageSettingToString(mUsageSetting)
|
||||||
|
+ "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
SubscriptionInfo that = (SubscriptionInfo) o;
|
||||||
|
return mId == that.mId && mSimSlotIndex == that.mSimSlotIndex
|
||||||
|
&& mDisplayNameSource == that.mDisplayNameSource && mIconTint == that.mIconTint
|
||||||
|
&& mDataRoaming == that.mDataRoaming && mIsEmbedded == that.mIsEmbedded
|
||||||
|
&& mIsOpportunistic == that.mIsOpportunistic && mCarrierId == that.mCarrierId
|
||||||
|
&& mProfileClass == that.mProfileClass && mType == that.mType
|
||||||
|
&& mAreUiccApplicationsEnabled == that.mAreUiccApplicationsEnabled
|
||||||
|
&& mPortIndex == that.mPortIndex && mUsageSetting == that.mUsageSetting
|
||||||
|
&& mCardId == that.mCardId && mIsGroupDisabled == that.mIsGroupDisabled
|
||||||
|
&& mIccId.equals(that.mIccId) && mDisplayName.equals(that.mDisplayName)
|
||||||
|
&& mCarrierName.equals(that.mCarrierName) && mNumber.equals(that.mNumber)
|
||||||
|
&& Objects.equals(mMcc, that.mMcc) && Objects.equals(mMnc,
|
||||||
|
that.mMnc) && Arrays.equals(mEhplmns, that.mEhplmns)
|
||||||
|
&& Arrays.equals(mHplmns, that.mHplmns) && mCardString.equals(
|
||||||
|
that.mCardString) && Arrays.equals(mNativeAccessRules,
|
||||||
|
that.mNativeAccessRules) && Arrays.equals(mCarrierConfigAccessRules,
|
||||||
|
that.mCarrierConfigAccessRules) && Objects.equals(mGroupUuid, that.mGroupUuid)
|
||||||
|
&& mCountryIso.equals(that.mCountryIso) && mGroupOwner.equals(that.mGroupOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
|
int result = Objects.hash(mId, mIccId, mSimSlotIndex, mDisplayName, mCarrierName,
|
||||||
mIsOpportunistic, mGroupUuid, mIccId, mNumber, mMcc, mMnc, mCountryIso, mCardString,
|
mDisplayNameSource, mIconTint, mNumber, mDataRoaming, mMcc, mMnc, mIsEmbedded,
|
||||||
mCardId, mDisplayName, mCarrierName, Arrays.hashCode(mNativeAccessRules),
|
mCardString, mIsOpportunistic, mGroupUuid, mCountryIso, mCarrierId, mProfileClass,
|
||||||
mIsGroupDisabled, mCarrierId, mProfileClass, mGroupOwner,
|
mType, mGroupOwner, mAreUiccApplicationsEnabled, mPortIndex, mUsageSetting, mCardId,
|
||||||
mAreUiccApplicationsEnabled, mPortIndex, mUsageSetting);
|
mIsGroupDisabled);
|
||||||
}
|
result = 31 * result + Arrays.hashCode(mEhplmns);
|
||||||
|
result = 31 * result + Arrays.hashCode(mHplmns);
|
||||||
@Override
|
result = 31 * result + Arrays.hashCode(mNativeAccessRules);
|
||||||
public boolean equals(Object obj) {
|
result = 31 * result + Arrays.hashCode(mCarrierConfigAccessRules);
|
||||||
if (this == obj) return true;
|
return result;
|
||||||
if (obj == null || getClass() != obj.getClass()) return false;
|
|
||||||
SubscriptionInfo toCompare = (SubscriptionInfo) obj;
|
|
||||||
return mId == toCompare.mId
|
|
||||||
&& mSimSlotIndex == toCompare.mSimSlotIndex
|
|
||||||
&& mNameSource == toCompare.mNameSource
|
|
||||||
&& mIconTint == toCompare.mIconTint
|
|
||||||
&& mDataRoaming == toCompare.mDataRoaming
|
|
||||||
&& mIsEmbedded == toCompare.mIsEmbedded
|
|
||||||
&& mIsOpportunistic == toCompare.mIsOpportunistic
|
|
||||||
&& mIsGroupDisabled == toCompare.mIsGroupDisabled
|
|
||||||
&& mAreUiccApplicationsEnabled == toCompare.mAreUiccApplicationsEnabled
|
|
||||||
&& mCarrierId == toCompare.mCarrierId
|
|
||||||
&& Objects.equals(mGroupUuid, toCompare.mGroupUuid)
|
|
||||||
&& Objects.equals(mIccId, toCompare.mIccId)
|
|
||||||
&& Objects.equals(mNumber, toCompare.mNumber)
|
|
||||||
&& Objects.equals(mMcc, toCompare.mMcc)
|
|
||||||
&& Objects.equals(mMnc, toCompare.mMnc)
|
|
||||||
&& Objects.equals(mCountryIso, toCompare.mCountryIso)
|
|
||||||
&& Objects.equals(mCardString, toCompare.mCardString)
|
|
||||||
&& Objects.equals(mCardId, toCompare.mCardId)
|
|
||||||
&& mPortIndex == toCompare.mPortIndex
|
|
||||||
&& Objects.equals(mGroupOwner, toCompare.mGroupOwner)
|
|
||||||
&& TextUtils.equals(mDisplayName, toCompare.mDisplayName)
|
|
||||||
&& TextUtils.equals(mCarrierName, toCompare.mCarrierName)
|
|
||||||
&& Arrays.equals(mNativeAccessRules, toCompare.mNativeAccessRules)
|
|
||||||
&& mProfileClass == toCompare.mProfileClass
|
|
||||||
&& Arrays.equals(mEhplmns, toCompare.mEhplmns)
|
|
||||||
&& Arrays.equals(mHplmns, toCompare.mHplmns)
|
|
||||||
&& mUsageSetting == toCompare.mUsageSetting;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1034,7 +1041,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* The subscription id.
|
* The subscription id.
|
||||||
*/
|
*/
|
||||||
private int mId = 0;
|
private int mId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ICCID of the SIM that is associated with this subscription, empty if unknown.
|
* The ICCID of the SIM that is associated with this subscription, empty if unknown.
|
||||||
@@ -1064,10 +1071,10 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
private CharSequence mCarrierName = "";
|
private CharSequence mCarrierName = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The source of the carrier name.
|
* The source of the display name.
|
||||||
*/
|
*/
|
||||||
@SimDisplayNameSource
|
@SimDisplayNameSource
|
||||||
private int mNameSource = SubscriptionManager.NAME_SOURCE_CARRIER_ID;
|
private int mDisplayNameSource = SubscriptionManager.NAME_SOURCE_UNKNOWN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The color to be used for tinting the icon when displaying to the user.
|
* The color to be used for tinting the icon when displaying to the user.
|
||||||
@@ -1144,7 +1151,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* The card ID of the SIM card which contains the subscription.
|
* The card ID of the SIM card which contains the subscription.
|
||||||
*/
|
*/
|
||||||
private int mCardId = -1;
|
private int mCardId = TelephonyManager.UNINITIALIZED_CARD_ID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the subscription is opportunistic or not.
|
* Whether the subscription is opportunistic or not.
|
||||||
@@ -1208,7 +1215,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* the port index of the Uicc card.
|
* the port index of the Uicc card.
|
||||||
*/
|
*/
|
||||||
private int mPortIndex = 0;
|
private int mPortIndex = TelephonyManager.INVALID_PORT_INDEX;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscription's preferred usage setting.
|
* Subscription's preferred usage setting.
|
||||||
@@ -1233,7 +1240,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
mSimSlotIndex = info.mSimSlotIndex;
|
mSimSlotIndex = info.mSimSlotIndex;
|
||||||
mDisplayName = info.mDisplayName;
|
mDisplayName = info.mDisplayName;
|
||||||
mCarrierName = info.mCarrierName;
|
mCarrierName = info.mCarrierName;
|
||||||
mNameSource = info.mNameSource;
|
mDisplayNameSource = info.mDisplayNameSource;
|
||||||
mIconTint = info.mIconTint;
|
mIconTint = info.mIconTint;
|
||||||
mNumber = info.mNumber;
|
mNumber = info.mNumber;
|
||||||
mDataRoaming = info.mDataRoaming;
|
mDataRoaming = info.mDataRoaming;
|
||||||
@@ -1324,14 +1331,16 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the source of the carrier name.
|
* Set the source of the display name.
|
||||||
*
|
*
|
||||||
* @param nameSource The source of the carrier name.
|
* @param displayNameSource The source of the display name.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
|
*
|
||||||
|
* @see SubscriptionInfo#getDisplayName()
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public Builder setNameSource(@SimDisplayNameSource int nameSource) {
|
public Builder setDisplayNameSource(@SimDisplayNameSource int displayNameSource) {
|
||||||
mNameSource = nameSource;
|
mDisplayNameSource = displayNameSource;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1434,9 +1443,9 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the ISO Country code for the subscription's provider.
|
* Set the ISO country code for the subscription's provider.
|
||||||
*
|
*
|
||||||
* @param countryIso The ISO Country code for the subscription's provider.
|
* @param countryIso The ISO country code for the subscription's provider.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -1593,7 +1602,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
* Set the carrier certificates for this subscription that are saved in carrier configs.
|
* Set the carrier certificates for this subscription that are saved in carrier configs.
|
||||||
* This does not include access rules from the Uicc, whether embedded or non-embedded.
|
* This does not include access rules from the Uicc, whether embedded or non-embedded.
|
||||||
*
|
*
|
||||||
* @param carrierConfigAccessRules The carrier certificates for this subscription
|
* @param carrierConfigAccessRules The carrier certificates for this subscription.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|||||||
@@ -565,6 +565,12 @@ public class SubscriptionManager {
|
|||||||
*/
|
*/
|
||||||
public static final String NAME_SOURCE = SimInfo.COLUMN_NAME_SOURCE;
|
public static final String NAME_SOURCE = SimInfo.COLUMN_NAME_SOURCE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name_source is unknown. (for initialization)
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int NAME_SOURCE_UNKNOWN = SimInfo.NAME_SOURCE_UNKNOWN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name_source is from the carrier id.
|
* The name_source is from the carrier id.
|
||||||
* @hide
|
* @hide
|
||||||
@@ -600,6 +606,7 @@ public class SubscriptionManager {
|
|||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef(prefix = {"NAME_SOURCE_"},
|
@IntDef(prefix = {"NAME_SOURCE_"},
|
||||||
value = {
|
value = {
|
||||||
|
NAME_SOURCE_UNKNOWN,
|
||||||
NAME_SOURCE_CARRIER_ID,
|
NAME_SOURCE_CARRIER_ID,
|
||||||
NAME_SOURCE_SIM_SPN,
|
NAME_SOURCE_SIM_SPN,
|
||||||
NAME_SOURCE_USER_INPUT,
|
NAME_SOURCE_USER_INPUT,
|
||||||
@@ -4129,5 +4136,66 @@ public class SubscriptionManager {
|
|||||||
(iSub)-> iSub.setUsageSetting(
|
(iSub)-> iSub.setUsageSetting(
|
||||||
usageSetting, subscriptionId, mContext.getOpPackageName()));
|
usageSetting, subscriptionId, mContext.getOpPackageName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert display name source to string.
|
||||||
|
*
|
||||||
|
* @param source The display name source.
|
||||||
|
* @return The display name source in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String displayNameSourceToString(
|
||||||
|
@SubscriptionManager.SimDisplayNameSource int source) {
|
||||||
|
switch (source) {
|
||||||
|
case SubscriptionManager.NAME_SOURCE_UNKNOWN: return "UNKNOWN";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_CARRIER_ID: return "CARRIER_ID";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_SIM_SPN: return "SIM_SPN";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_USER_INPUT: return "USER_INPUT";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_CARRIER: return "CARRIER";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_SIM_PNN: return "SIM_PNN";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + source + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert subscription type to string.
|
||||||
|
*
|
||||||
|
* @param type The subscription type.
|
||||||
|
* @return The subscription type in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String subscriptionTypeToString(@SubscriptionManager.SubscriptionType int type) {
|
||||||
|
switch (type) {
|
||||||
|
case SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM: return "LOCAL_SIM";
|
||||||
|
case SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM: return "REMOTE_SIM";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + type + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert usage setting to string.
|
||||||
|
*
|
||||||
|
* @param usageSetting Usage setting.
|
||||||
|
* @return The usage setting in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String usageSettingToString(@SubscriptionManager.UsageSetting int usageSetting) {
|
||||||
|
switch (usageSetting) {
|
||||||
|
case SubscriptionManager.USAGE_SETTING_UNKNOWN: return "UNKNOWN";
|
||||||
|
case SubscriptionManager.USAGE_SETTING_DEFAULT: return "DEFAULT";
|
||||||
|
case SubscriptionManager.USAGE_SETTING_VOICE_CENTRIC: return "VOICE_CENTRIC";
|
||||||
|
case SubscriptionManager.USAGE_SETTING_DATA_CENTRIC: return "DATA_CENTRIC";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + usageSetting + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,12 +72,19 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef(prefix = "WIFI_MODE_", value = {
|
@IntDef(prefix = "WIFI_MODE_", value = {
|
||||||
|
WIFI_MODE_UNKNOWN,
|
||||||
WIFI_MODE_WIFI_ONLY,
|
WIFI_MODE_WIFI_ONLY,
|
||||||
WIFI_MODE_CELLULAR_PREFERRED,
|
WIFI_MODE_CELLULAR_PREFERRED,
|
||||||
WIFI_MODE_WIFI_PREFERRED
|
WIFI_MODE_WIFI_PREFERRED
|
||||||
})
|
})
|
||||||
public @interface WiFiCallingMode {}
|
public @interface WiFiCallingMode {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wifi calling mode is unknown. This is for initialization only.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int WIFI_MODE_UNKNOWN = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register for IMS over IWLAN if WiFi signal quality is high enough. Do not hand over to LTE
|
* Register for IMS over IWLAN if WiFi signal quality is high enough. Do not hand over to LTE
|
||||||
* registration if signal quality degrades.
|
* registration if signal quality degrades.
|
||||||
@@ -1581,4 +1588,24 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
.get());
|
.get());
|
||||||
return binder;
|
return binder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert Wi-Fi calling mode to string.
|
||||||
|
*
|
||||||
|
* @param mode Wi-Fi calling mode.
|
||||||
|
* @return The Wi-Fi calling mode in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String wifiCallingModeToString(@ImsMmTelManager.WiFiCallingMode int mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case ImsMmTelManager.WIFI_MODE_UNKNOWN: return "UNKNOWN";
|
||||||
|
case ImsMmTelManager.WIFI_MODE_WIFI_ONLY: return "WIFI_ONLY";
|
||||||
|
case ImsMmTelManager.WIFI_MODE_CELLULAR_PREFERRED: return "CELLULAR_PREFERRED";
|
||||||
|
case ImsMmTelManager.WIFI_MODE_WIFI_PREFERRED: return "WIFI_PREFERRED";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + mode + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user