Merge "refactor data/voice roaming states"
am: 6bd29ab2df
Change-Id: Iac8184fe2dfdb7ff4c3d93ecb7c0c9dd9a7a46a5
This commit is contained in:
@@ -5097,6 +5097,7 @@ package android.telephony {
|
|||||||
method public int getRejectCause();
|
method public int getRejectCause();
|
||||||
method public int getTransportType();
|
method public int getTransportType();
|
||||||
method public boolean isEmergencyEnabled();
|
method public boolean isEmergencyEnabled();
|
||||||
|
method public boolean isRoaming();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationState> CREATOR;
|
field public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationState> CREATOR;
|
||||||
field public static final int DOMAIN_CS = 1; // 0x1
|
field public static final int DOMAIN_CS = 1; // 0x1
|
||||||
|
|||||||
@@ -3945,6 +3945,12 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
public static final String EXTRA_LTE_EARFCN_RSRP_BOOST = "LteEarfcnRsrpBoost";
|
public static final String EXTRA_LTE_EARFCN_RSRP_BOOST = "LteEarfcnRsrpBoost";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An parcelable extra used with {@link #ACTION_SERVICE_STATE} representing the service state.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final String EXTRA_SERVICE_STATE = "android.intent.extra.SERVICE_STATE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the extra used to define the text to be processed, as a
|
* The name of the extra used to define the text to be processed, as a
|
||||||
* CharSequence. Note that this may be a styled CharSequence, so you must use
|
* CharSequence. Note that this may be a styled CharSequence, so you must use
|
||||||
|
|||||||
@@ -3213,7 +3213,6 @@ public final class Telephony {
|
|||||||
values.put(CDMA_ERI_ICON_INDEX, state.getCdmaEriIconIndex());
|
values.put(CDMA_ERI_ICON_INDEX, state.getCdmaEriIconIndex());
|
||||||
values.put(CDMA_ERI_ICON_MODE, state.getCdmaEriIconMode());
|
values.put(CDMA_ERI_ICON_MODE, state.getCdmaEriIconMode());
|
||||||
values.put(IS_EMERGENCY_ONLY, state.isEmergencyOnly());
|
values.put(IS_EMERGENCY_ONLY, state.isEmergencyOnly());
|
||||||
values.put(IS_DATA_ROAMING_FROM_REGISTRATION, state.getDataRoamingFromRegistration());
|
|
||||||
values.put(IS_USING_CARRIER_AGGREGATION, state.isUsingCarrierAggregation());
|
values.put(IS_USING_CARRIER_AGGREGATION, state.isUsingCarrierAggregation());
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,6 +95,13 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
@RegState
|
@RegState
|
||||||
private final int mRegState;
|
private final int mRegState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save the {@link ServiceState.RoamingType roaming type}. it can be overridden roaming type
|
||||||
|
* from resource overlay or carrier config.
|
||||||
|
*/
|
||||||
|
@ServiceState.RoamingType
|
||||||
|
private int mRoamingType;
|
||||||
|
|
||||||
private final int mAccessNetworkTechnology;
|
private final int mAccessNetworkTechnology;
|
||||||
|
|
||||||
private final int mRejectCause;
|
private final int mRejectCause;
|
||||||
@@ -140,6 +147,8 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
mDomain = domain;
|
mDomain = domain;
|
||||||
mTransportType = transportType;
|
mTransportType = transportType;
|
||||||
mRegState = regState;
|
mRegState = regState;
|
||||||
|
mRoamingType = (regState == REG_STATE_ROAMING)
|
||||||
|
? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
||||||
mAccessNetworkTechnology = accessNetworkTechnology;
|
mAccessNetworkTechnology = accessNetworkTechnology;
|
||||||
mRejectCause = rejectCause;
|
mRejectCause = rejectCause;
|
||||||
mAvailableServices = availableServices;
|
mAvailableServices = availableServices;
|
||||||
@@ -182,6 +191,7 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
mDomain = source.readInt();
|
mDomain = source.readInt();
|
||||||
mTransportType = source.readInt();
|
mTransportType = source.readInt();
|
||||||
mRegState = source.readInt();
|
mRegState = source.readInt();
|
||||||
|
mRoamingType = source.readInt();
|
||||||
mAccessNetworkTechnology = source.readInt();
|
mAccessNetworkTechnology = source.readInt();
|
||||||
mRejectCause = source.readInt();
|
mRejectCause = source.readInt();
|
||||||
mEmergencyOnly = source.readBoolean();
|
mEmergencyOnly = source.readBoolean();
|
||||||
@@ -210,6 +220,31 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
return mRegState;
|
return mRegState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if registered on roaming network, {@code false} otherwise.
|
||||||
|
*/
|
||||||
|
public boolean isRoaming() {
|
||||||
|
return mRoamingType != ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set {@link ServiceState.RoamingType roaming type}. This could override
|
||||||
|
* roaming type based on resource overlay or carrier config.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public void setRoamingType(@ServiceState.RoamingType int roamingType) {
|
||||||
|
mRoamingType = roamingType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@link ServiceState.RoamingType roaming type}. This could return
|
||||||
|
* overridden roaming type based on resource overlay or carrier config.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public @ServiceState.RoamingType int getRoamingType() {
|
||||||
|
return mRoamingType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Whether emergency is enabled.
|
* @return Whether emergency is enabled.
|
||||||
*/
|
*/
|
||||||
@@ -280,6 +315,7 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
.append(" domain=").append((mDomain == DOMAIN_CS) ? "CS" : "PS")
|
.append(" domain=").append((mDomain == DOMAIN_CS) ? "CS" : "PS")
|
||||||
.append("transportType=").append(mTransportType)
|
.append("transportType=").append(mTransportType)
|
||||||
.append(" regState=").append(regStateToString(mRegState))
|
.append(" regState=").append(regStateToString(mRegState))
|
||||||
|
.append(" roamingType=").append(mRoamingType)
|
||||||
.append(" accessNetworkTechnology=")
|
.append(" accessNetworkTechnology=")
|
||||||
.append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology))
|
.append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology))
|
||||||
.append(" rejectCause=").append(mRejectCause)
|
.append(" rejectCause=").append(mRejectCause)
|
||||||
@@ -293,9 +329,9 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mDomain, mTransportType, mRegState, mAccessNetworkTechnology,
|
return Objects.hash(mDomain, mTransportType, mRegState, mRoamingType,
|
||||||
mRejectCause, mEmergencyOnly, mAvailableServices, mCellIdentity,
|
mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
|
||||||
mVoiceSpecificStates, mDataSpecificStates);
|
mCellIdentity, mVoiceSpecificStates, mDataSpecificStates);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -310,6 +346,7 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
return mDomain == other.mDomain
|
return mDomain == other.mDomain
|
||||||
&& mTransportType == other.mTransportType
|
&& mTransportType == other.mTransportType
|
||||||
&& mRegState == other.mRegState
|
&& mRegState == other.mRegState
|
||||||
|
&& mRoamingType == other.mRoamingType
|
||||||
&& mAccessNetworkTechnology == other.mAccessNetworkTechnology
|
&& mAccessNetworkTechnology == other.mAccessNetworkTechnology
|
||||||
&& mRejectCause == other.mRejectCause
|
&& mRejectCause == other.mRejectCause
|
||||||
&& mEmergencyOnly == other.mEmergencyOnly
|
&& mEmergencyOnly == other.mEmergencyOnly
|
||||||
@@ -325,6 +362,7 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
dest.writeInt(mDomain);
|
dest.writeInt(mDomain);
|
||||||
dest.writeInt(mTransportType);
|
dest.writeInt(mTransportType);
|
||||||
dest.writeInt(mRegState);
|
dest.writeInt(mRegState);
|
||||||
|
dest.writeInt(mRoamingType);
|
||||||
dest.writeInt(mAccessNetworkTechnology);
|
dest.writeInt(mAccessNetworkTechnology);
|
||||||
dest.writeInt(mRejectCause);
|
dest.writeInt(mRejectCause);
|
||||||
dest.writeBoolean(mEmergencyOnly);
|
dest.writeBoolean(mEmergencyOnly);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import android.annotation.IntDef;
|
|||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -200,6 +201,15 @@ public class ServiceState implements Parcelable {
|
|||||||
private int mVoiceRegState = STATE_OUT_OF_SERVICE;
|
private int mVoiceRegState = STATE_OUT_OF_SERVICE;
|
||||||
private int mDataRegState = STATE_OUT_OF_SERVICE;
|
private int mDataRegState = STATE_OUT_OF_SERVICE;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
@IntDef(prefix = { "ROAMING_TYPE_" }, value = {
|
||||||
|
ROAMING_TYPE_NOT_ROAMING,
|
||||||
|
ROAMING_TYPE_UNKNOWN,
|
||||||
|
ROAMING_TYPE_DOMESTIC,
|
||||||
|
ROAMING_TYPE_INTERNATIONAL
|
||||||
|
})
|
||||||
|
public @interface RoamingType {}
|
||||||
/**
|
/**
|
||||||
* Roaming type
|
* Roaming type
|
||||||
* HOME : in home network
|
* HOME : in home network
|
||||||
@@ -230,8 +240,6 @@ public class ServiceState implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public static final int UNKNOWN_ID = -1;
|
public static final int UNKNOWN_ID = -1;
|
||||||
|
|
||||||
private int mVoiceRoamingType;
|
|
||||||
private int mDataRoamingType;
|
|
||||||
private String mVoiceOperatorAlphaLong;
|
private String mVoiceOperatorAlphaLong;
|
||||||
private String mVoiceOperatorAlphaShort;
|
private String mVoiceOperatorAlphaShort;
|
||||||
private String mVoiceOperatorNumeric;
|
private String mVoiceOperatorNumeric;
|
||||||
@@ -261,8 +269,6 @@ public class ServiceState implements Parcelable {
|
|||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private int mCdmaEriIconMode;
|
private int mCdmaEriIconMode;
|
||||||
|
|
||||||
private boolean mIsDataRoamingFromRegistration;
|
|
||||||
|
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private boolean mIsUsingCarrierAggregation;
|
private boolean mIsUsingCarrierAggregation;
|
||||||
|
|
||||||
@@ -334,8 +340,6 @@ public class ServiceState implements Parcelable {
|
|||||||
protected void copyFrom(ServiceState s) {
|
protected void copyFrom(ServiceState s) {
|
||||||
mVoiceRegState = s.mVoiceRegState;
|
mVoiceRegState = s.mVoiceRegState;
|
||||||
mDataRegState = s.mDataRegState;
|
mDataRegState = s.mDataRegState;
|
||||||
mVoiceRoamingType = s.mVoiceRoamingType;
|
|
||||||
mDataRoamingType = s.mDataRoamingType;
|
|
||||||
mVoiceOperatorAlphaLong = s.mVoiceOperatorAlphaLong;
|
mVoiceOperatorAlphaLong = s.mVoiceOperatorAlphaLong;
|
||||||
mVoiceOperatorAlphaShort = s.mVoiceOperatorAlphaShort;
|
mVoiceOperatorAlphaShort = s.mVoiceOperatorAlphaShort;
|
||||||
mVoiceOperatorNumeric = s.mVoiceOperatorNumeric;
|
mVoiceOperatorNumeric = s.mVoiceOperatorNumeric;
|
||||||
@@ -353,7 +357,6 @@ public class ServiceState implements Parcelable {
|
|||||||
mCdmaEriIconIndex = s.mCdmaEriIconIndex;
|
mCdmaEriIconIndex = s.mCdmaEriIconIndex;
|
||||||
mCdmaEriIconMode = s.mCdmaEriIconMode;
|
mCdmaEriIconMode = s.mCdmaEriIconMode;
|
||||||
mIsEmergencyOnly = s.mIsEmergencyOnly;
|
mIsEmergencyOnly = s.mIsEmergencyOnly;
|
||||||
mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration;
|
|
||||||
mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation;
|
mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation;
|
||||||
mChannelNumber = s.mChannelNumber;
|
mChannelNumber = s.mChannelNumber;
|
||||||
mCellBandwidths = s.mCellBandwidths == null ? null :
|
mCellBandwidths = s.mCellBandwidths == null ? null :
|
||||||
@@ -369,8 +372,6 @@ public class ServiceState implements Parcelable {
|
|||||||
public ServiceState(Parcel in) {
|
public ServiceState(Parcel in) {
|
||||||
mVoiceRegState = in.readInt();
|
mVoiceRegState = in.readInt();
|
||||||
mDataRegState = in.readInt();
|
mDataRegState = in.readInt();
|
||||||
mVoiceRoamingType = in.readInt();
|
|
||||||
mDataRoamingType = in.readInt();
|
|
||||||
mVoiceOperatorAlphaLong = in.readString();
|
mVoiceOperatorAlphaLong = in.readString();
|
||||||
mVoiceOperatorAlphaShort = in.readString();
|
mVoiceOperatorAlphaShort = in.readString();
|
||||||
mVoiceOperatorNumeric = in.readString();
|
mVoiceOperatorNumeric = in.readString();
|
||||||
@@ -388,7 +389,6 @@ public class ServiceState implements Parcelable {
|
|||||||
mCdmaEriIconIndex = in.readInt();
|
mCdmaEriIconIndex = in.readInt();
|
||||||
mCdmaEriIconMode = in.readInt();
|
mCdmaEriIconMode = in.readInt();
|
||||||
mIsEmergencyOnly = in.readInt() != 0;
|
mIsEmergencyOnly = in.readInt() != 0;
|
||||||
mIsDataRoamingFromRegistration = in.readInt() != 0;
|
|
||||||
mIsUsingCarrierAggregation = in.readInt() != 0;
|
mIsUsingCarrierAggregation = in.readInt() != 0;
|
||||||
mLteEarfcnRsrpBoost = in.readInt();
|
mLteEarfcnRsrpBoost = in.readInt();
|
||||||
mNetworkRegistrationStates = new ArrayList<>();
|
mNetworkRegistrationStates = new ArrayList<>();
|
||||||
@@ -400,8 +400,6 @@ public class ServiceState implements Parcelable {
|
|||||||
public void writeToParcel(Parcel out, int flags) {
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
out.writeInt(mVoiceRegState);
|
out.writeInt(mVoiceRegState);
|
||||||
out.writeInt(mDataRegState);
|
out.writeInt(mDataRegState);
|
||||||
out.writeInt(mVoiceRoamingType);
|
|
||||||
out.writeInt(mDataRoamingType);
|
|
||||||
out.writeString(mVoiceOperatorAlphaLong);
|
out.writeString(mVoiceOperatorAlphaLong);
|
||||||
out.writeString(mVoiceOperatorAlphaShort);
|
out.writeString(mVoiceOperatorAlphaShort);
|
||||||
out.writeString(mVoiceOperatorNumeric);
|
out.writeString(mVoiceOperatorNumeric);
|
||||||
@@ -419,7 +417,6 @@ public class ServiceState implements Parcelable {
|
|||||||
out.writeInt(mCdmaEriIconIndex);
|
out.writeInt(mCdmaEriIconIndex);
|
||||||
out.writeInt(mCdmaEriIconMode);
|
out.writeInt(mCdmaEriIconMode);
|
||||||
out.writeInt(mIsEmergencyOnly ? 1 : 0);
|
out.writeInt(mIsEmergencyOnly ? 1 : 0);
|
||||||
out.writeInt(mIsDataRoamingFromRegistration ? 1 : 0);
|
|
||||||
out.writeInt(mIsUsingCarrierAggregation ? 1 : 0);
|
out.writeInt(mIsUsingCarrierAggregation ? 1 : 0);
|
||||||
out.writeInt(mLteEarfcnRsrpBoost);
|
out.writeInt(mLteEarfcnRsrpBoost);
|
||||||
out.writeList(mNetworkRegistrationStates);
|
out.writeList(mNetworkRegistrationStates);
|
||||||
@@ -537,17 +534,21 @@ public class ServiceState implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public boolean getVoiceRoaming() {
|
public boolean getVoiceRoaming() {
|
||||||
return mVoiceRoamingType != ROAMING_TYPE_NOT_ROAMING;
|
return getVoiceRoamingType() != ROAMING_TYPE_NOT_ROAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current voice network roaming type
|
* Get current voice network roaming type
|
||||||
* @return roaming type
|
* @return roaming type
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public int getVoiceRoamingType() {
|
public @RoamingType int getVoiceRoamingType() {
|
||||||
return mVoiceRoamingType;
|
final NetworkRegistrationState regState = getNetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN);
|
||||||
|
if (regState != null) {
|
||||||
|
return regState.getRoamingType();
|
||||||
|
}
|
||||||
|
return ROAMING_TYPE_NOT_ROAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -557,19 +558,7 @@ public class ServiceState implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public boolean getDataRoaming() {
|
public boolean getDataRoaming() {
|
||||||
return mDataRoamingType != ROAMING_TYPE_NOT_ROAMING;
|
return getDataRoamingType() != ROAMING_TYPE_NOT_ROAMING;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set whether data network registration state is roaming
|
|
||||||
*
|
|
||||||
* This should only be set to the roaming value received
|
|
||||||
* once the data registration phase has completed.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@UnsupportedAppUsage
|
|
||||||
public void setDataRoamingFromRegistration(boolean dataRoaming) {
|
|
||||||
mIsDataRoamingFromRegistration = dataRoaming;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -578,7 +567,12 @@ public class ServiceState implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public boolean getDataRoamingFromRegistration() {
|
public boolean getDataRoamingFromRegistration() {
|
||||||
return mIsDataRoamingFromRegistration;
|
final NetworkRegistrationState regState = getNetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN);
|
||||||
|
if (regState != null) {
|
||||||
|
return (regState.getRegState() == NetworkRegistrationState.REG_STATE_ROAMING);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -587,8 +581,13 @@ public class ServiceState implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public int getDataRoamingType() {
|
public @RoamingType int getDataRoamingType() {
|
||||||
return mDataRoamingType;
|
final NetworkRegistrationState regState = getNetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN);
|
||||||
|
if (regState != null) {
|
||||||
|
return regState.getRoamingType();
|
||||||
|
}
|
||||||
|
return ROAMING_TYPE_NOT_ROAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -761,8 +760,6 @@ public class ServiceState implements Parcelable {
|
|||||||
return Objects.hash(
|
return Objects.hash(
|
||||||
mVoiceRegState,
|
mVoiceRegState,
|
||||||
mDataRegState,
|
mDataRegState,
|
||||||
mVoiceRoamingType,
|
|
||||||
mDataRoamingType,
|
|
||||||
mChannelNumber,
|
mChannelNumber,
|
||||||
mCellBandwidths,
|
mCellBandwidths,
|
||||||
mVoiceOperatorAlphaLong,
|
mVoiceOperatorAlphaLong,
|
||||||
@@ -782,7 +779,6 @@ public class ServiceState implements Parcelable {
|
|||||||
mCdmaEriIconIndex,
|
mCdmaEriIconIndex,
|
||||||
mCdmaEriIconMode,
|
mCdmaEriIconMode,
|
||||||
mIsEmergencyOnly,
|
mIsEmergencyOnly,
|
||||||
mIsDataRoamingFromRegistration,
|
|
||||||
mIsUsingCarrierAggregation,
|
mIsUsingCarrierAggregation,
|
||||||
mLteEarfcnRsrpBoost,
|
mLteEarfcnRsrpBoost,
|
||||||
mNetworkRegistrationStates);
|
mNetworkRegistrationStates);
|
||||||
@@ -796,8 +792,6 @@ public class ServiceState implements Parcelable {
|
|||||||
return (mVoiceRegState == s.mVoiceRegState
|
return (mVoiceRegState == s.mVoiceRegState
|
||||||
&& mDataRegState == s.mDataRegState
|
&& mDataRegState == s.mDataRegState
|
||||||
&& mIsManualNetworkSelection == s.mIsManualNetworkSelection
|
&& mIsManualNetworkSelection == s.mIsManualNetworkSelection
|
||||||
&& mVoiceRoamingType == s.mVoiceRoamingType
|
|
||||||
&& mDataRoamingType == s.mDataRoamingType
|
|
||||||
&& mChannelNumber == s.mChannelNumber
|
&& mChannelNumber == s.mChannelNumber
|
||||||
&& Arrays.equals(mCellBandwidths, s.mCellBandwidths)
|
&& Arrays.equals(mCellBandwidths, s.mCellBandwidths)
|
||||||
&& equalsHandlesNulls(mVoiceOperatorAlphaLong, s.mVoiceOperatorAlphaLong)
|
&& equalsHandlesNulls(mVoiceOperatorAlphaLong, s.mVoiceOperatorAlphaLong)
|
||||||
@@ -815,7 +809,6 @@ public class ServiceState implements Parcelable {
|
|||||||
&& equalsHandlesNulls(mCdmaDefaultRoamingIndicator,
|
&& equalsHandlesNulls(mCdmaDefaultRoamingIndicator,
|
||||||
s.mCdmaDefaultRoamingIndicator)
|
s.mCdmaDefaultRoamingIndicator)
|
||||||
&& mIsEmergencyOnly == s.mIsEmergencyOnly
|
&& mIsEmergencyOnly == s.mIsEmergencyOnly
|
||||||
&& mIsDataRoamingFromRegistration == s.mIsDataRoamingFromRegistration
|
|
||||||
&& mIsUsingCarrierAggregation == s.mIsUsingCarrierAggregation)
|
&& mIsUsingCarrierAggregation == s.mIsUsingCarrierAggregation)
|
||||||
&& (mNetworkRegistrationStates == null ? s.mNetworkRegistrationStates == null :
|
&& (mNetworkRegistrationStates == null ? s.mNetworkRegistrationStates == null :
|
||||||
s.mNetworkRegistrationStates != null &&
|
s.mNetworkRegistrationStates != null &&
|
||||||
@@ -935,8 +928,6 @@ public class ServiceState implements Parcelable {
|
|||||||
.append(", mChannelNumber=").append(mChannelNumber)
|
.append(", mChannelNumber=").append(mChannelNumber)
|
||||||
.append(", duplexMode()=").append(getDuplexMode())
|
.append(", duplexMode()=").append(getDuplexMode())
|
||||||
.append(", mCellBandwidths=").append(Arrays.toString(mCellBandwidths))
|
.append(", mCellBandwidths=").append(Arrays.toString(mCellBandwidths))
|
||||||
.append(", mVoiceRoamingType=").append(getRoamingLogString(mVoiceRoamingType))
|
|
||||||
.append(", mDataRoamingType=").append(getRoamingLogString(mDataRoamingType))
|
|
||||||
.append(", mVoiceOperatorAlphaLong=").append(mVoiceOperatorAlphaLong)
|
.append(", mVoiceOperatorAlphaLong=").append(mVoiceOperatorAlphaLong)
|
||||||
.append(", mVoiceOperatorAlphaShort=").append(mVoiceOperatorAlphaShort)
|
.append(", mVoiceOperatorAlphaShort=").append(mVoiceOperatorAlphaShort)
|
||||||
.append(", mDataOperatorAlphaLong=").append(mDataOperatorAlphaLong)
|
.append(", mDataOperatorAlphaLong=").append(mDataOperatorAlphaLong)
|
||||||
@@ -953,7 +944,6 @@ public class ServiceState implements Parcelable {
|
|||||||
.append(", mCdmaRoamingIndicator=").append(mCdmaRoamingIndicator)
|
.append(", mCdmaRoamingIndicator=").append(mCdmaRoamingIndicator)
|
||||||
.append(", mCdmaDefaultRoamingIndicator=").append(mCdmaDefaultRoamingIndicator)
|
.append(", mCdmaDefaultRoamingIndicator=").append(mCdmaDefaultRoamingIndicator)
|
||||||
.append(", mIsEmergencyOnly=").append(mIsEmergencyOnly)
|
.append(", mIsEmergencyOnly=").append(mIsEmergencyOnly)
|
||||||
.append(", mIsDataRoamingFromRegistration=").append(mIsDataRoamingFromRegistration)
|
|
||||||
.append(", mIsUsingCarrierAggregation=").append(mIsUsingCarrierAggregation)
|
.append(", mIsUsingCarrierAggregation=").append(mIsUsingCarrierAggregation)
|
||||||
.append(", mLteEarfcnRsrpBoost=").append(mLteEarfcnRsrpBoost)
|
.append(", mLteEarfcnRsrpBoost=").append(mLteEarfcnRsrpBoost)
|
||||||
.append(", mNetworkRegistrationStates=").append(mNetworkRegistrationStates)
|
.append(", mNetworkRegistrationStates=").append(mNetworkRegistrationStates)
|
||||||
@@ -964,8 +954,6 @@ public class ServiceState implements Parcelable {
|
|||||||
if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setNullState=" + state);
|
if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setNullState=" + state);
|
||||||
mVoiceRegState = state;
|
mVoiceRegState = state;
|
||||||
mDataRegState = state;
|
mDataRegState = state;
|
||||||
mVoiceRoamingType = ROAMING_TYPE_NOT_ROAMING;
|
|
||||||
mDataRoamingType = ROAMING_TYPE_NOT_ROAMING;
|
|
||||||
mChannelNumber = -1;
|
mChannelNumber = -1;
|
||||||
mCellBandwidths = new int[0];
|
mCellBandwidths = new int[0];
|
||||||
mVoiceOperatorAlphaLong = null;
|
mVoiceOperatorAlphaLong = null;
|
||||||
@@ -985,7 +973,6 @@ public class ServiceState implements Parcelable {
|
|||||||
mCdmaEriIconIndex = -1;
|
mCdmaEriIconIndex = -1;
|
||||||
mCdmaEriIconMode = -1;
|
mCdmaEriIconMode = -1;
|
||||||
mIsEmergencyOnly = false;
|
mIsEmergencyOnly = false;
|
||||||
mIsDataRoamingFromRegistration = false;
|
|
||||||
mIsUsingCarrierAggregation = false;
|
mIsUsingCarrierAggregation = false;
|
||||||
mLteEarfcnRsrpBoost = 0;
|
mLteEarfcnRsrpBoost = 0;
|
||||||
mNetworkRegistrationStates = new ArrayList<>();
|
mNetworkRegistrationStates = new ArrayList<>();
|
||||||
@@ -1031,32 +1018,50 @@ public class ServiceState implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setRoaming(boolean roaming) {
|
public void setRoaming(boolean roaming) {
|
||||||
mVoiceRoamingType = (roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
|
setVoiceRoaming(roaming);
|
||||||
mDataRoamingType = mVoiceRoamingType;
|
setDataRoaming(roaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public void setVoiceRoaming(boolean roaming) {
|
public void setVoiceRoaming(boolean roaming) {
|
||||||
mVoiceRoamingType = (roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
|
setVoiceRoamingType(roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public void setVoiceRoamingType(int type) {
|
public void setVoiceRoamingType(@RoamingType int type) {
|
||||||
mVoiceRoamingType = type;
|
NetworkRegistrationState regState = getNetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN);
|
||||||
|
if (regState == null) {
|
||||||
|
regState = new NetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN,
|
||||||
|
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0,
|
||||||
|
false, null, null);
|
||||||
|
addNetworkRegistrationState(regState);
|
||||||
|
}
|
||||||
|
regState.setRoamingType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public void setDataRoaming(boolean dataRoaming) {
|
public void setDataRoaming(boolean dataRoaming) {
|
||||||
mDataRoamingType = (dataRoaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
|
setDataRoamingType(dataRoaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public void setDataRoamingType(int type) {
|
public void setDataRoamingType(@RoamingType int type) {
|
||||||
mDataRoamingType = type;
|
NetworkRegistrationState regState = getNetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN);
|
||||||
|
if (regState == null) {
|
||||||
|
regState = new NetworkRegistrationState(
|
||||||
|
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN,
|
||||||
|
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0,
|
||||||
|
false, null, null);
|
||||||
|
addNetworkRegistrationState(regState);
|
||||||
|
}
|
||||||
|
regState.setRoamingType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1168,30 +1173,10 @@ public class ServiceState implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private void setFromNotifierBundle(Bundle m) {
|
private void setFromNotifierBundle(Bundle m) {
|
||||||
mVoiceRegState = m.getInt("voiceRegState");
|
ServiceState ssFromBundle = m.getParcelable(Intent.EXTRA_SERVICE_STATE);
|
||||||
mDataRegState = m.getInt("dataRegState");
|
if (ssFromBundle != null) {
|
||||||
mVoiceRoamingType = m.getInt("voiceRoamingType");
|
copyFrom(ssFromBundle);
|
||||||
mDataRoamingType = m.getInt("dataRoamingType");
|
}
|
||||||
mVoiceOperatorAlphaLong = m.getString("operator-alpha-long");
|
|
||||||
mVoiceOperatorAlphaShort = m.getString("operator-alpha-short");
|
|
||||||
mVoiceOperatorNumeric = m.getString("operator-numeric");
|
|
||||||
mDataOperatorAlphaLong = m.getString("data-operator-alpha-long");
|
|
||||||
mDataOperatorAlphaShort = m.getString("data-operator-alpha-short");
|
|
||||||
mDataOperatorNumeric = m.getString("data-operator-numeric");
|
|
||||||
mIsManualNetworkSelection = m.getBoolean("manual");
|
|
||||||
mRilVoiceRadioTechnology = m.getInt("radioTechnology");
|
|
||||||
mRilDataRadioTechnology = m.getInt("dataRadioTechnology");
|
|
||||||
mCssIndicator = m.getBoolean("cssIndicator");
|
|
||||||
mNetworkId = m.getInt("networkId");
|
|
||||||
mSystemId = m.getInt("systemId");
|
|
||||||
mCdmaRoamingIndicator = m.getInt("cdmaRoamingIndicator");
|
|
||||||
mCdmaDefaultRoamingIndicator = m.getInt("cdmaDefaultRoamingIndicator");
|
|
||||||
mIsEmergencyOnly = m.getBoolean("emergencyOnly");
|
|
||||||
mIsDataRoamingFromRegistration = m.getBoolean("isDataRoamingFromRegistration");
|
|
||||||
mIsUsingCarrierAggregation = m.getBoolean("isUsingCarrierAggregation");
|
|
||||||
mLteEarfcnRsrpBoost = m.getInt("LteEarfcnRsrpBoost");
|
|
||||||
mChannelNumber = m.getInt("ChannelNumber");
|
|
||||||
mCellBandwidths = m.getIntArray("CellBandwidths");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1202,10 +1187,13 @@ public class ServiceState implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public void fillInNotifierBundle(Bundle m) {
|
public void fillInNotifierBundle(Bundle m) {
|
||||||
|
m.putParcelable(Intent.EXTRA_SERVICE_STATE, this);
|
||||||
|
// serviceState already consists of below entries.
|
||||||
|
// for backward compatibility, we continue fill in below entries.
|
||||||
m.putInt("voiceRegState", mVoiceRegState);
|
m.putInt("voiceRegState", mVoiceRegState);
|
||||||
m.putInt("dataRegState", mDataRegState);
|
m.putInt("dataRegState", mDataRegState);
|
||||||
m.putInt("voiceRoamingType", mVoiceRoamingType);
|
m.putInt("dataRoamingType", getDataRoamingType());
|
||||||
m.putInt("dataRoamingType", mDataRoamingType);
|
m.putInt("voiceRoamingType", getVoiceRoamingType());
|
||||||
m.putString("operator-alpha-long", mVoiceOperatorAlphaLong);
|
m.putString("operator-alpha-long", mVoiceOperatorAlphaLong);
|
||||||
m.putString("operator-alpha-short", mVoiceOperatorAlphaShort);
|
m.putString("operator-alpha-short", mVoiceOperatorAlphaShort);
|
||||||
m.putString("operator-numeric", mVoiceOperatorNumeric);
|
m.putString("operator-numeric", mVoiceOperatorNumeric);
|
||||||
@@ -1221,7 +1209,7 @@ public class ServiceState implements Parcelable {
|
|||||||
m.putInt("cdmaRoamingIndicator", mCdmaRoamingIndicator);
|
m.putInt("cdmaRoamingIndicator", mCdmaRoamingIndicator);
|
||||||
m.putInt("cdmaDefaultRoamingIndicator", mCdmaDefaultRoamingIndicator);
|
m.putInt("cdmaDefaultRoamingIndicator", mCdmaDefaultRoamingIndicator);
|
||||||
m.putBoolean("emergencyOnly", mIsEmergencyOnly);
|
m.putBoolean("emergencyOnly", mIsEmergencyOnly);
|
||||||
m.putBoolean("isDataRoamingFromRegistration", mIsDataRoamingFromRegistration);
|
m.putBoolean("isDataRoamingFromRegistration", getDataRoamingFromRegistration());
|
||||||
m.putBoolean("isUsingCarrierAggregation", mIsUsingCarrierAggregation);
|
m.putBoolean("isUsingCarrierAggregation", mIsUsingCarrierAggregation);
|
||||||
m.putInt("LteEarfcnRsrpBoost", mLteEarfcnRsrpBoost);
|
m.putInt("LteEarfcnRsrpBoost", mLteEarfcnRsrpBoost);
|
||||||
m.putInt("ChannelNumber", mChannelNumber);
|
m.putInt("ChannelNumber", mChannelNumber);
|
||||||
|
|||||||
Reference in New Issue
Block a user