Merge "Re-expose raw data roaming state" am: efa17d986e
Change-Id: Idf670452a33814c760244217303069ba8c9add09
This commit is contained in:
@@ -9092,6 +9092,7 @@ package android.telephony {
|
||||
method public void fillInNotifierBundle(@NonNull android.os.Bundle);
|
||||
method public int getDataNetworkType();
|
||||
method public int getDataRegistrationState();
|
||||
method public boolean getDataRoamingFromRegistration();
|
||||
method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
|
||||
method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(int);
|
||||
method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(int);
|
||||
|
||||
@@ -353,6 +353,7 @@ public class ServiceState implements Parcelable {
|
||||
|
||||
private String mOperatorAlphaLongRaw;
|
||||
private String mOperatorAlphaShortRaw;
|
||||
private boolean mIsDataRoamingFromRegistration;
|
||||
private boolean mIsIwlanPreferred;
|
||||
|
||||
/**
|
||||
@@ -438,6 +439,7 @@ public class ServiceState implements Parcelable {
|
||||
mNrFrequencyRange = s.mNrFrequencyRange;
|
||||
mOperatorAlphaLongRaw = s.mOperatorAlphaLongRaw;
|
||||
mOperatorAlphaShortRaw = s.mOperatorAlphaShortRaw;
|
||||
mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration;
|
||||
mIsIwlanPreferred = s.mIsIwlanPreferred;
|
||||
}
|
||||
|
||||
@@ -472,6 +474,7 @@ public class ServiceState implements Parcelable {
|
||||
mNrFrequencyRange = in.readInt();
|
||||
mOperatorAlphaLongRaw = in.readString();
|
||||
mOperatorAlphaShortRaw = in.readString();
|
||||
mIsDataRoamingFromRegistration = in.readBoolean();
|
||||
mIsIwlanPreferred = in.readBoolean();
|
||||
}
|
||||
|
||||
@@ -499,6 +502,7 @@ public class ServiceState implements Parcelable {
|
||||
out.writeInt(mNrFrequencyRange);
|
||||
out.writeString(mOperatorAlphaLongRaw);
|
||||
out.writeString(mOperatorAlphaShortRaw);
|
||||
out.writeBoolean(mIsDataRoamingFromRegistration);
|
||||
out.writeBoolean(mIsIwlanPreferred);
|
||||
}
|
||||
|
||||
@@ -649,7 +653,9 @@ public class ServiceState implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current data network roaming type
|
||||
* Get whether the current data network is roaming.
|
||||
* This value may be overwritten by resource overlay or carrier configuration.
|
||||
* @see #getDataRoamingFromRegistration() to get the value from the network registration.
|
||||
* @return roaming type
|
||||
* @hide
|
||||
*/
|
||||
@@ -659,18 +665,25 @@ public class ServiceState implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether data network registration state is roaming
|
||||
* Set whether the data network registration state is roaming.
|
||||
* This should only be set to the roaming value received
|
||||
* once the data registration phase has completed.
|
||||
* @hide
|
||||
*/
|
||||
public void setDataRoamingFromRegistration(boolean dataRoaming) {
|
||||
mIsDataRoamingFromRegistration = dataRoaming;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether data network registration state is roaming.
|
||||
* This value is set directly from the modem and will not be overwritten
|
||||
* by resource overlay or carrier configuration.
|
||||
* @return true if registration indicates roaming, false otherwise
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public boolean getDataRoamingFromRegistration() {
|
||||
final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
|
||||
NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
|
||||
if (regState != null) {
|
||||
return regState.getRegistrationState()
|
||||
== NetworkRegistrationInfo.REGISTRATION_STATE_ROAMING;
|
||||
}
|
||||
return false;
|
||||
return mIsDataRoamingFromRegistration;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -873,6 +886,7 @@ public class ServiceState implements Parcelable {
|
||||
mNrFrequencyRange,
|
||||
mOperatorAlphaLongRaw,
|
||||
mOperatorAlphaShortRaw,
|
||||
mIsDataRoamingFromRegistration,
|
||||
mIsIwlanPreferred);
|
||||
}
|
||||
}
|
||||
@@ -903,6 +917,7 @@ public class ServiceState implements Parcelable {
|
||||
&& mNetworkRegistrationInfos.size() == s.mNetworkRegistrationInfos.size()
|
||||
&& mNetworkRegistrationInfos.containsAll(s.mNetworkRegistrationInfos)
|
||||
&& mNrFrequencyRange == s.mNrFrequencyRange
|
||||
&& mIsDataRoamingFromRegistration == s.mIsDataRoamingFromRegistration
|
||||
&& mIsIwlanPreferred == s.mIsIwlanPreferred;
|
||||
}
|
||||
}
|
||||
@@ -1062,6 +1077,8 @@ public class ServiceState implements Parcelable {
|
||||
.append(", mNrFrequencyRange=").append(mNrFrequencyRange)
|
||||
.append(", mOperatorAlphaLongRaw=").append(mOperatorAlphaLongRaw)
|
||||
.append(", mOperatorAlphaShortRaw=").append(mOperatorAlphaShortRaw)
|
||||
.append(", mIsDataRoamingFromRegistration=")
|
||||
.append(mIsDataRoamingFromRegistration)
|
||||
.append(", mIsIwlanPreferred=").append(mIsIwlanPreferred)
|
||||
.append("}").toString();
|
||||
}
|
||||
@@ -1102,6 +1119,7 @@ public class ServiceState implements Parcelable {
|
||||
}
|
||||
mOperatorAlphaLongRaw = null;
|
||||
mOperatorAlphaShortRaw = null;
|
||||
mIsDataRoamingFromRegistration = false;
|
||||
mIsIwlanPreferred = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user