Merge "API: Separates getting roaming according to overridden or non-overridden" into tm-qpr-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
987cb93271
@@ -42743,9 +42743,12 @@ package android.telephony {
|
|||||||
method public int getDomain();
|
method public int getDomain();
|
||||||
method @Nullable public String getRegisteredPlmn();
|
method @Nullable public String getRegisteredPlmn();
|
||||||
method public int getTransportType();
|
method public int getTransportType();
|
||||||
method public boolean isRegistered();
|
method public boolean isNetworkRegistered();
|
||||||
method public boolean isRoaming();
|
method public boolean isNetworkRoaming();
|
||||||
method public boolean isSearching();
|
method public boolean isNetworkSearching();
|
||||||
|
method @Deprecated public boolean isRegistered();
|
||||||
|
method @Deprecated public boolean isRoaming();
|
||||||
|
method @Deprecated public boolean isSearching();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationInfo> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationInfo> CREATOR;
|
||||||
field public static final int DOMAIN_CS = 1; // 0x1
|
field public static final int DOMAIN_CS = 1; // 0x1
|
||||||
@@ -43499,6 +43502,7 @@ package android.telephony {
|
|||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public int getNetworkType();
|
method public int getNetworkType();
|
||||||
method public int getOverrideNetworkType();
|
method public int getOverrideNetworkType();
|
||||||
|
method public boolean isRoaming();
|
||||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.TelephonyDisplayInfo> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.TelephonyDisplayInfo> CREATOR;
|
||||||
field public static final int OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = 2; // 0x2
|
field public static final int OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = 2; // 0x2
|
||||||
|
|||||||
@@ -12828,7 +12828,8 @@ package android.telephony {
|
|||||||
|
|
||||||
public final class NetworkRegistrationInfo implements android.os.Parcelable {
|
public final class NetworkRegistrationInfo implements android.os.Parcelable {
|
||||||
method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
|
method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
|
||||||
method public int getRegistrationState();
|
method public int getNetworkRegistrationState();
|
||||||
|
method @Deprecated public int getRegistrationState();
|
||||||
method public int getRejectCause();
|
method public int getRejectCause();
|
||||||
method public int getRoamingType();
|
method public int getRoamingType();
|
||||||
method public boolean isEmergencyEnabled();
|
method public boolean isEmergencyEnabled();
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ public class MobileStatusTracker {
|
|||||||
public SignalStrength signalStrength;
|
public SignalStrength signalStrength;
|
||||||
public TelephonyDisplayInfo telephonyDisplayInfo =
|
public TelephonyDisplayInfo telephonyDisplayInfo =
|
||||||
new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||||
TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
|
TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Empty constructor
|
* Empty constructor
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi
|
|||||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||||
private static final TelephonyDisplayInfo DEFAULT_TELEPHONY_DISPLAY_INFO =
|
private static final TelephonyDisplayInfo DEFAULT_TELEPHONY_DISPLAY_INFO =
|
||||||
new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||||
TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
|
TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, false);
|
||||||
|
|
||||||
static final int MAX_WIFI_ENTRY_COUNT = 3;
|
static final int MAX_WIFI_ENTRY_COUNT = 3;
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ internal class MobileState(
|
|||||||
) : ConnectivityState() {
|
) : ConnectivityState() {
|
||||||
|
|
||||||
@JvmField var telephonyDisplayInfo = TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
@JvmField var telephonyDisplayInfo = TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||||
TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE)
|
TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, false)
|
||||||
@JvmField var serviceState: ServiceState? = null
|
@JvmField var serviceState: ServiceState? = null
|
||||||
@JvmField var signalStrength: SignalStrength? = null
|
@JvmField var signalStrength: SignalStrength? = null
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ internal class MobileState(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isRoaming(): Boolean {
|
fun isRoaming(): Boolean {
|
||||||
return serviceState != null && serviceState!!.roaming
|
return telephonyDisplayInfo != null && telephonyDisplayInfo.isRoaming
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1957,7 +1957,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
&& overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED) {
|
&& overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED) {
|
||||||
overrideNetworkType = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE;
|
overrideNetworkType = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE;
|
||||||
}
|
}
|
||||||
return new TelephonyDisplayInfo(networkType, overrideNetworkType);
|
boolean isRoaming = telephonyDisplayInfo.isRoaming();
|
||||||
|
return new TelephonyDisplayInfo(networkType, overrideNetworkType, isRoaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyCallForwardingChanged(boolean cfi) {
|
public void notifyCallForwardingChanged(boolean cfi) {
|
||||||
|
|||||||
@@ -184,10 +184,11 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
private final int mTransportType;
|
private final int mTransportType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The initial registration state
|
* The true registration state of network, This is not affected by any carrier config or
|
||||||
|
* resource overlay.
|
||||||
*/
|
*/
|
||||||
@RegistrationState
|
@RegistrationState
|
||||||
private final int mInitialRegistrationState;
|
private final int mNetworkRegistrationState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The registration state that might have been overridden by config
|
* The registration state that might have been overridden by config
|
||||||
@@ -264,7 +265,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
mDomain = domain;
|
mDomain = domain;
|
||||||
mTransportType = transportType;
|
mTransportType = transportType;
|
||||||
mRegistrationState = registrationState;
|
mRegistrationState = registrationState;
|
||||||
mInitialRegistrationState = registrationState;
|
mNetworkRegistrationState = registrationState;
|
||||||
mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING)
|
mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING)
|
||||||
? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
||||||
setAccessNetworkTechnology(accessNetworkTechnology);
|
setAccessNetworkTechnology(accessNetworkTechnology);
|
||||||
@@ -320,7 +321,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
mDomain = source.readInt();
|
mDomain = source.readInt();
|
||||||
mTransportType = source.readInt();
|
mTransportType = source.readInt();
|
||||||
mRegistrationState = source.readInt();
|
mRegistrationState = source.readInt();
|
||||||
mInitialRegistrationState = source.readInt();
|
mNetworkRegistrationState = source.readInt();
|
||||||
mRoamingType = source.readInt();
|
mRoamingType = source.readInt();
|
||||||
mAccessNetworkTechnology = source.readInt();
|
mAccessNetworkTechnology = source.readInt();
|
||||||
mRejectCause = source.readInt();
|
mRejectCause = source.readInt();
|
||||||
@@ -347,7 +348,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
mDomain = nri.mDomain;
|
mDomain = nri.mDomain;
|
||||||
mTransportType = nri.mTransportType;
|
mTransportType = nri.mTransportType;
|
||||||
mRegistrationState = nri.mRegistrationState;
|
mRegistrationState = nri.mRegistrationState;
|
||||||
mInitialRegistrationState = nri.mInitialRegistrationState;
|
mNetworkRegistrationState = nri.mNetworkRegistrationState;
|
||||||
mRoamingType = nri.mRoamingType;
|
mRoamingType = nri.mRoamingType;
|
||||||
mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
|
mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
|
||||||
mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation;
|
mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation;
|
||||||
@@ -400,39 +401,71 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The registration state.
|
* @return The registration state. Note this value can be affected by the carrier config
|
||||||
|
* override.
|
||||||
*
|
*
|
||||||
|
* @deprecated Use {@link #getNetworkRegistrationState}, which is not affected by any carrier
|
||||||
|
* config or resource overlay, instead.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public @RegistrationState int getRegistrationState() {
|
public @RegistrationState int getRegistrationState() {
|
||||||
return mRegistrationState;
|
return mRegistrationState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The initial registration state.
|
* @return The true registration state of network. (This value is not affected by any carrier
|
||||||
|
* config or resource overlay override).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public @RegistrationState int getInitialRegistrationState() {
|
@SystemApi
|
||||||
return mInitialRegistrationState;
|
public @RegistrationState int getNetworkRegistrationState() {
|
||||||
|
return mNetworkRegistrationState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@code true} if registered on roaming or home network, {@code false} otherwise.
|
* @return {@code true} if registered on roaming or home network. Note this value can be
|
||||||
|
* affected by the carrier config override.
|
||||||
|
*
|
||||||
|
* @deprecated Use {@link #isNetworkRegistered}, which is not affected by any carrier config or
|
||||||
|
* resource overlay, instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean isRegistered() {
|
public boolean isRegistered() {
|
||||||
return mRegistrationState == REGISTRATION_STATE_HOME
|
return mRegistrationState == REGISTRATION_STATE_HOME
|
||||||
|| mRegistrationState == REGISTRATION_STATE_ROAMING;
|
|| mRegistrationState == REGISTRATION_STATE_ROAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@code true} if searching for service, {@code false} otherwise.
|
* @return {@code true} if registered on roaming or home network, {@code false} otherwise. (This
|
||||||
|
* value is not affected by any carrier config or resource overlay override).
|
||||||
*/
|
*/
|
||||||
|
public boolean isNetworkRegistered() {
|
||||||
|
return mNetworkRegistrationState == REGISTRATION_STATE_HOME
|
||||||
|
|| mNetworkRegistrationState == REGISTRATION_STATE_ROAMING;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if searching for service, {@code false} otherwise.
|
||||||
|
*
|
||||||
|
* @deprecated Use {@link #isNetworkRegistered}, which is not affected by any carrier config or
|
||||||
|
* resource overlay, instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean isSearching() {
|
public boolean isSearching() {
|
||||||
return mRegistrationState == REGISTRATION_STATE_NOT_REGISTERED_SEARCHING;
|
return mRegistrationState == REGISTRATION_STATE_NOT_REGISTERED_SEARCHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if searching for service, {@code false} otherwise. (This value is not
|
||||||
|
* affected by any carrier config or resource overlay override).
|
||||||
|
*/
|
||||||
|
public boolean isNetworkSearching() {
|
||||||
|
return mNetworkRegistrationState == REGISTRATION_STATE_NOT_REGISTERED_SEARCHING;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the PLMN-ID for this Network Registration, also known as the RPLMN.
|
* Get the PLMN-ID for this Network Registration, also known as the RPLMN.
|
||||||
*
|
*
|
||||||
@@ -450,12 +483,24 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@code true} if registered on roaming network, {@code false} otherwise.
|
* @return {@code true} if registered on roaming network overridden by config. Note this value
|
||||||
|
* can be affected by the carrier config override.
|
||||||
|
*
|
||||||
|
* @deprecated Use {@link TelephonyDisplayInfo#isRoaming} instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean isRoaming() {
|
public boolean isRoaming() {
|
||||||
return mRoamingType != ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
return mRoamingType != ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if registered on roaming network. (This value is not affected by any
|
||||||
|
* carrier config or resource overlay override).
|
||||||
|
*/
|
||||||
|
public boolean isNetworkRoaming() {
|
||||||
|
return mNetworkRegistrationState == REGISTRATION_STATE_ROAMING;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
* @return {@code true} if in service.
|
* @return {@code true} if in service.
|
||||||
@@ -486,7 +531,8 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current network roaming type.
|
* @return the current network roaming type. Note that this value can be possibly overridden by
|
||||||
|
* the carrier config or resource overlay.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@@ -666,8 +712,8 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
.append(" transportType=").append(
|
.append(" transportType=").append(
|
||||||
AccessNetworkConstants.transportTypeToString(mTransportType))
|
AccessNetworkConstants.transportTypeToString(mTransportType))
|
||||||
.append(" registrationState=").append(registrationStateToString(mRegistrationState))
|
.append(" registrationState=").append(registrationStateToString(mRegistrationState))
|
||||||
.append(" mInitialRegistrationState=")
|
.append(" networkRegistrationState=")
|
||||||
.append(registrationStateToString(mInitialRegistrationState))
|
.append(registrationStateToString(mNetworkRegistrationState))
|
||||||
.append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType))
|
.append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType))
|
||||||
.append(" accessNetworkTechnology=")
|
.append(" accessNetworkTechnology=")
|
||||||
.append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology))
|
.append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology))
|
||||||
@@ -688,7 +734,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mDomain, mTransportType, mRegistrationState, mInitialRegistrationState,
|
return Objects.hash(mDomain, mTransportType, mRegistrationState, mNetworkRegistrationState,
|
||||||
mRoamingType, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly,
|
mRoamingType, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly,
|
||||||
mAvailableServices, mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState,
|
mAvailableServices, mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState,
|
||||||
mRplmn, mIsUsingCarrierAggregation);
|
mRplmn, mIsUsingCarrierAggregation);
|
||||||
@@ -706,7 +752,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
return mDomain == other.mDomain
|
return mDomain == other.mDomain
|
||||||
&& mTransportType == other.mTransportType
|
&& mTransportType == other.mTransportType
|
||||||
&& mRegistrationState == other.mRegistrationState
|
&& mRegistrationState == other.mRegistrationState
|
||||||
&& mInitialRegistrationState == other.mInitialRegistrationState
|
&& mNetworkRegistrationState == other.mNetworkRegistrationState
|
||||||
&& mRoamingType == other.mRoamingType
|
&& mRoamingType == other.mRoamingType
|
||||||
&& mAccessNetworkTechnology == other.mAccessNetworkTechnology
|
&& mAccessNetworkTechnology == other.mAccessNetworkTechnology
|
||||||
&& mRejectCause == other.mRejectCause
|
&& mRejectCause == other.mRejectCause
|
||||||
@@ -729,7 +775,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
dest.writeInt(mDomain);
|
dest.writeInt(mDomain);
|
||||||
dest.writeInt(mTransportType);
|
dest.writeInt(mTransportType);
|
||||||
dest.writeInt(mRegistrationState);
|
dest.writeInt(mRegistrationState);
|
||||||
dest.writeInt(mInitialRegistrationState);
|
dest.writeInt(mNetworkRegistrationState);
|
||||||
dest.writeInt(mRoamingType);
|
dest.writeInt(mRoamingType);
|
||||||
dest.writeInt(mAccessNetworkTechnology);
|
dest.writeInt(mAccessNetworkTechnology);
|
||||||
dest.writeInt(mRejectCause);
|
dest.writeInt(mRejectCause);
|
||||||
@@ -826,7 +872,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
private int mTransportType;
|
private int mTransportType;
|
||||||
|
|
||||||
@RegistrationState
|
@RegistrationState
|
||||||
private int mInitialRegistrationState;
|
private int mNetworkRegistrationState;
|
||||||
|
|
||||||
@NetworkType
|
@NetworkType
|
||||||
private int mAccessNetworkTechnology;
|
private int mAccessNetworkTechnology;
|
||||||
@@ -864,7 +910,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
public Builder(@NonNull NetworkRegistrationInfo nri) {
|
public Builder(@NonNull NetworkRegistrationInfo nri) {
|
||||||
mDomain = nri.mDomain;
|
mDomain = nri.mDomain;
|
||||||
mTransportType = nri.mTransportType;
|
mTransportType = nri.mTransportType;
|
||||||
mInitialRegistrationState = nri.mInitialRegistrationState;
|
mNetworkRegistrationState = nri.mNetworkRegistrationState;
|
||||||
mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
|
mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
|
||||||
mRejectCause = nri.mRejectCause;
|
mRejectCause = nri.mRejectCause;
|
||||||
mEmergencyOnly = nri.mEmergencyOnly;
|
mEmergencyOnly = nri.mEmergencyOnly;
|
||||||
@@ -912,7 +958,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
* @return The same instance of the builder.
|
* @return The same instance of the builder.
|
||||||
*/
|
*/
|
||||||
public @NonNull Builder setRegistrationState(@RegistrationState int registrationState) {
|
public @NonNull Builder setRegistrationState(@RegistrationState int registrationState) {
|
||||||
mInitialRegistrationState = registrationState;
|
mNetworkRegistrationState = registrationState;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1031,7 +1077,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public @NonNull NetworkRegistrationInfo build() {
|
public @NonNull NetworkRegistrationInfo build() {
|
||||||
return new NetworkRegistrationInfo(mDomain, mTransportType, mInitialRegistrationState,
|
return new NetworkRegistrationInfo(mDomain, mTransportType, mNetworkRegistrationState,
|
||||||
mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
|
mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
|
||||||
mCellIdentity, mRplmn, mVoiceSpecificRegistrationInfo,
|
mCellIdentity, mRplmn, mVoiceSpecificRegistrationInfo,
|
||||||
mDataSpecificRegistrationInfo);
|
mDataSpecificRegistrationInfo);
|
||||||
|
|||||||
@@ -631,11 +631,17 @@ public class ServiceState implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current roaming indicator of phone
|
* Get current roaming indicator of phone. This roaming state could be overridden by the carrier
|
||||||
|
* config.
|
||||||
* (note: not just decoding from TS 27.007 7.2)
|
* (note: not just decoding from TS 27.007 7.2)
|
||||||
*
|
* @see TelephonyDisplayInfo#isRoaming() for visualization purpose.
|
||||||
* @return true if TS 27.007 7.2 roaming is true
|
* @return true if TS 27.007 7.2 roaming is true
|
||||||
* and ONS is different from SPN
|
* and ONS is different from SPN
|
||||||
|
* @see CarrierConfigManager#KEY_FORCE_HOME_NETWORK_BOOL
|
||||||
|
* @see CarrierConfigManager#KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
* @see CarrierConfigManager#KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
* @see CarrierConfigManager#KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
* @see CarrierConfigManager#KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY
|
||||||
*/
|
*/
|
||||||
public boolean getRoaming() {
|
public boolean getRoaming() {
|
||||||
return getVoiceRoaming() || getDataRoaming();
|
return getVoiceRoaming() || getDataRoaming();
|
||||||
@@ -650,8 +656,9 @@ public class ServiceState implements Parcelable {
|
|||||||
public boolean getVoiceRoaming() {
|
public boolean getVoiceRoaming() {
|
||||||
return getVoiceRoamingType() != ROAMING_TYPE_NOT_ROAMING;
|
return getVoiceRoamingType() != ROAMING_TYPE_NOT_ROAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current voice network roaming type
|
* Get current voice roaming type. This roaming type could be overridden by the carrier config.
|
||||||
* @return roaming type
|
* @return roaming type
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@@ -701,7 +708,7 @@ public class ServiceState implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current data network roaming type
|
* Get current data roaming type. This roaming type could be overridden by the carrier config.
|
||||||
* @return roaming type
|
* @return roaming type
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -87,10 +87,12 @@ public final class TelephonyDisplayInfo implements Parcelable {
|
|||||||
public static final int OVERRIDE_NETWORK_TYPE_NR_ADVANCED = 5;
|
public static final int OVERRIDE_NETWORK_TYPE_NR_ADVANCED = 5;
|
||||||
|
|
||||||
@NetworkType
|
@NetworkType
|
||||||
private final int mNetworkType;
|
private final int mNetworkType;
|
||||||
|
|
||||||
@OverrideNetworkType
|
@OverrideNetworkType
|
||||||
private final int mOverrideNetworkType;
|
private final int mOverrideNetworkType;
|
||||||
|
|
||||||
|
private final boolean mIsRoaming;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -98,18 +100,37 @@ public final class TelephonyDisplayInfo implements Parcelable {
|
|||||||
* @param networkType Current packet-switching cellular network type
|
* @param networkType Current packet-switching cellular network type
|
||||||
* @param overrideNetworkType The override network type
|
* @param overrideNetworkType The override network type
|
||||||
*
|
*
|
||||||
|
* @deprecated will not use this constructor anymore.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public TelephonyDisplayInfo(@NetworkType int networkType,
|
||||||
|
@OverrideNetworkType int overrideNetworkType) {
|
||||||
|
this(networkType, overrideNetworkType, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param networkType Current packet-switching cellular network type
|
||||||
|
* @param overrideNetworkType The override network type
|
||||||
|
* @param isRoaming True if the device is roaming after override.
|
||||||
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public TelephonyDisplayInfo(@NetworkType int networkType,
|
public TelephonyDisplayInfo(@NetworkType int networkType,
|
||||||
@OverrideNetworkType int overrideNetworkType) {
|
@OverrideNetworkType int overrideNetworkType,
|
||||||
|
boolean isRoaming) {
|
||||||
mNetworkType = networkType;
|
mNetworkType = networkType;
|
||||||
mOverrideNetworkType = overrideNetworkType;
|
mOverrideNetworkType = overrideNetworkType;
|
||||||
|
mIsRoaming = isRoaming;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public TelephonyDisplayInfo(Parcel p) {
|
public TelephonyDisplayInfo(Parcel p) {
|
||||||
mNetworkType = p.readInt();
|
mNetworkType = p.readInt();
|
||||||
mOverrideNetworkType = p.readInt();
|
mOverrideNetworkType = p.readInt();
|
||||||
|
mIsRoaming = p.readBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -135,10 +156,25 @@ public final class TelephonyDisplayInfo implements Parcelable {
|
|||||||
return mOverrideNetworkType;
|
return mOverrideNetworkType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get device is roaming or not. Note the isRoaming is for market branding or visualization
|
||||||
|
* purposes only. It cannot be treated as the actual roaming device is camped on.
|
||||||
|
*
|
||||||
|
* @return True if the device is registered on roaming network overridden by config.
|
||||||
|
* @see CarrierConfigManager#KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
* @see CarrierConfigManager#KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
* @see CarrierConfigManager#KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
* @see CarrierConfigManager#KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY
|
||||||
|
*/
|
||||||
|
public boolean isRoaming() {
|
||||||
|
return mIsRoaming;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||||
dest.writeInt(mNetworkType);
|
dest.writeInt(mNetworkType);
|
||||||
dest.writeInt(mOverrideNetworkType);
|
dest.writeInt(mOverrideNetworkType);
|
||||||
|
dest.writeBoolean(mIsRoaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final @NonNull Parcelable.Creator<TelephonyDisplayInfo> CREATOR =
|
public static final @NonNull Parcelable.Creator<TelephonyDisplayInfo> CREATOR =
|
||||||
@@ -165,12 +201,13 @@ public final class TelephonyDisplayInfo implements Parcelable {
|
|||||||
if (o == null || getClass() != o.getClass()) return false;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
TelephonyDisplayInfo that = (TelephonyDisplayInfo) o;
|
TelephonyDisplayInfo that = (TelephonyDisplayInfo) o;
|
||||||
return mNetworkType == that.mNetworkType
|
return mNetworkType == that.mNetworkType
|
||||||
&& mOverrideNetworkType == that.mOverrideNetworkType;
|
&& mOverrideNetworkType == that.mOverrideNetworkType
|
||||||
|
&& mIsRoaming == that.mIsRoaming;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mNetworkType, mOverrideNetworkType);
|
return Objects.hash(mNetworkType, mOverrideNetworkType, mIsRoaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -195,6 +232,7 @@ public final class TelephonyDisplayInfo implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TelephonyDisplayInfo {network=" + TelephonyManager.getNetworkTypeName(mNetworkType)
|
return "TelephonyDisplayInfo {network=" + TelephonyManager.getNetworkTypeName(mNetworkType)
|
||||||
+ ", override=" + overrideNetworkTypeToString(mOverrideNetworkType) + "}";
|
+ ", overrideNetwork=" + overrideNetworkTypeToString(mOverrideNetworkType)
|
||||||
|
+ ", isRoaming=" + mIsRoaming + "}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user