field public static final String MBMS_STREAMING_SERVICE_ACTION = "android.telephony.action.EmbmsStreaming";
}
- public class NetworkRegistrationState implements android.os.Parcelable {
- ctor public NetworkRegistrationState(int, int, int, int, int, boolean, @NonNull int[], @Nullable android.telephony.CellIdentity);
+ public class NetworkRegistrationInfo implements android.os.Parcelable {
+ ctor public NetworkRegistrationInfo(int, int, int, int, int, boolean, @NonNull int[], @Nullable android.telephony.CellIdentity);
method public int describeContents();
method public int getAccessNetworkTechnology();
method @NonNull public int[] getAvailableServices();
method public boolean isEmergencyEnabled();
method public boolean isRoaming();
method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationState> 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_PS = 2; // 0x2
field public static final int REG_STATE_DENIED = 3; // 0x3
field public static final int SERVICE_TYPE_VOICE = 1; // 0x1
}
- public static class NetworkRegistrationState.Builder {
- ctor public NetworkRegistrationState.Builder();
- method @NonNull public android.telephony.NetworkRegistrationState build();
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setAccessNetworkTechnology(int);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setAvailableServices(@NonNull int[]);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setDomain(int);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setEmergencyOnly(boolean);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setNrStatus(int);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setRegState(int);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setRejectCause(int);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setRoamingType(int);
- method @NonNull public android.telephony.NetworkRegistrationState.Builder setTransportType(int);
+ public static class NetworkRegistrationInfo.Builder {
+ ctor public NetworkRegistrationInfo.Builder();
+ method @NonNull public android.telephony.NetworkRegistrationInfo build();
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAccessNetworkTechnology(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAvailableServices(@NonNull int[]);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setDomain(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setEmergencyOnly(boolean);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setNrStatus(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegState(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRejectCause(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRoamingType(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setTransportType(int);
}
public abstract class NetworkService extends android.app.Service {
public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable {
ctor public NetworkService.NetworkServiceProvider(int);
method public abstract void close();
- method public void getNetworkRegistrationState(int, @NonNull android.telephony.NetworkServiceCallback);
+ method public void getNetworkRegistrationInfo(int, @NonNull android.telephony.NetworkServiceCallback);
method public final int getSlotIndex();
- method public final void notifyNetworkRegistrationStateChanged();
+ method public final void notifyNetworkRegistrationInfoChanged();
}
public class NetworkServiceCallback {
- method public void onGetNetworkRegistrationStateComplete(int, @Nullable android.telephony.NetworkRegistrationState);
+ method public void onGetNetworkRegistrationInfoComplete(int, @Nullable android.telephony.NetworkRegistrationInfo);
field public static final int RESULT_ERROR_BUSY = 3; // 0x3
field public static final int RESULT_ERROR_FAILED = 5; // 0x5
field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
}
public class ServiceState implements android.os.Parcelable {
- method @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationState(int, int);
- method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates();
- method @Deprecated @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(int);
- method @Deprecated @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int);
- method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int);
- method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int);
+ method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList();
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(int);
field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
import android.provider.Settings;
import android.telephony.AccessNetworkConstants;
import android.telephony.CellSignalStrength;
-import android.telephony.NetworkRegistrationState;
+import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
return;
}
// See if the data sub is registered for PS services on cell.
- final NetworkRegistrationState nrs = dataSs.getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS,
+ final NetworkRegistrationInfo nrs = dataSs.getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS,
AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
latencyBroadcast.putExtra(
NetworkMonitorUtils.EXTRA_CELL_ID,
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings.Global;
-import android.telephony.NetworkRegistrationState;
+import android.telephony.NetworkRegistrationInfo;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
if (mServiceState == null) return null;
int nrStatus = mServiceState.getNrStatus();
- if (nrStatus == NetworkRegistrationState.NR_STATUS_CONNECTED) {
+ if (nrStatus == NetworkRegistrationInfo.NR_STATUS_CONNECTED) {
// Check if the NR 5G is using millimeter wave and the icon is config.
if (mServiceState.getNrFrequencyRange() == ServiceState.FREQUENCY_RANGE_MMWAVE) {
if (mConfig.nr5GIconMap.containsKey(Config.NR_CONNECTED_MMWAVE)) {
if (mConfig.nr5GIconMap.containsKey(Config.NR_CONNECTED)) {
return mConfig.nr5GIconMap.get(Config.NR_CONNECTED);
}
- } else if (nrStatus == NetworkRegistrationState.NR_STATUS_NOT_RESTRICTED) {
+ } else if (nrStatus == NetworkRegistrationInfo.NR_STATUS_NOT_RESTRICTED) {
if (mConfig.nr5GIconMap.containsKey(Config.NR_NOT_RESTRICTED)) {
return mConfig.nr5GIconMap.get(Config.NR_NOT_RESTRICTED);
}
- } else if (nrStatus == NetworkRegistrationState.NR_STATUS_RESTRICTED) {
+ } else if (nrStatus == NetworkRegistrationInfo.NR_STATUS_RESTRICTED) {
if (mConfig.nr5GIconMap.containsKey(Config.NR_RESTRICTED)) {
return mConfig.nr5GIconMap.get(Config.NR_RESTRICTED);
}
import android.net.NetworkCapabilities;
import android.os.Looper;
-import android.telephony.NetworkRegistrationState;
+import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.test.suitebuilder.annotation.SmallTest;
updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
TelephonyManager.NETWORK_TYPE_LTE);
ServiceState ss = Mockito.mock(ServiceState.class);
- doReturn(NetworkRegistrationState.NR_STATUS_CONNECTED).when(ss).getNrStatus();
+ doReturn(NetworkRegistrationInfo.NR_STATUS_CONNECTED).when(ss).getNrStatus();
doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(ss).getNrFrequencyRange();
mPhoneStateListener.onServiceStateChanged(ss);
updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
TelephonyManager.NETWORK_TYPE_LTE);
ServiceState ss = Mockito.mock(ServiceState.class);
- doReturn(NetworkRegistrationState.NR_STATUS_CONNECTED).when(ss).getNrStatus();
+ doReturn(NetworkRegistrationInfo.NR_STATUS_CONNECTED).when(ss).getNrStatus();
doReturn(ServiceState.FREQUENCY_RANGE_MMWAVE).when(ss).getNrFrequencyRange();
mPhoneStateListener.onServiceStateChanged(ss);
updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
TelephonyManager.NETWORK_TYPE_LTE);
ServiceState ss = Mockito.mock(ServiceState.class);
- doReturn(NetworkRegistrationState.NR_STATUS_RESTRICTED).when(ss).getNrStatus();
+ doReturn(NetworkRegistrationInfo.NR_STATUS_RESTRICTED).when(ss).getNrStatus();
mPhoneStateListener.onServiceStateChanged(mServiceState);
verifyDataIndicators(TelephonyIcons.ICON_LTE);
{
void createNetworkServiceProvider(int slotId);
void removeNetworkServiceProvider(int slotId);
- void getNetworkRegistrationState(int slotId, int domain, INetworkServiceCallback callback);
- void registerForNetworkRegistrationStateChanged(int slotId, INetworkServiceCallback callback);
- void unregisterForNetworkRegistrationStateChanged(int slotId, INetworkServiceCallback callback);
+ void getNetworkRegistrationInfo(int slotId, int domain, INetworkServiceCallback callback);
+ void registerForNetworkRegistrationInfoChanged(int slotId, INetworkServiceCallback callback);
+ void unregisterForNetworkRegistrationInfoChanged(int slotId, INetworkServiceCallback callback);
}
package android.telephony;
-import android.telephony.NetworkRegistrationState;
+import android.telephony.NetworkRegistrationInfo;
/**
* Network service call back interface
*/
oneway interface INetworkServiceCallback
{
- void onGetNetworkRegistrationStateComplete(int result, in NetworkRegistrationState state);
+ void onGetNetworkRegistrationInfoComplete(int result, in NetworkRegistrationInfo state);
void onNetworkStateChanged();
}
package android.telephony;
-parcelable NetworkRegistrationState;
+parcelable NetworkRegistrationInfo;
import java.util.stream.Collectors;
/**
- * Description of a mobile network registration state
+ * Description of a mobile network registration info
* @hide
*/
@SystemApi
-public class NetworkRegistrationState implements Parcelable {
+public class NetworkRegistrationInfo implements Parcelable {
/**
* Network domain
* @hide
* @param cellIdentity The identity representing a unique cell or wifi AP. Set to null if the
* information is not available.
*/
- public NetworkRegistrationState(@Domain int domain, @TransportType int transportType,
- @RegState int regState,
- @NetworkType int accessNetworkTechnology, int rejectCause,
- boolean emergencyOnly,
- @NonNull @ServiceType int[] availableServices,
- @Nullable CellIdentity cellIdentity) {
+ public NetworkRegistrationInfo(@Domain int domain, @TransportType int transportType,
+ @RegState int regState,
+ @NetworkType int accessNetworkTechnology, int rejectCause,
+ boolean emergencyOnly,
+ @NonNull @ServiceType int[] availableServices,
+ @Nullable CellIdentity cellIdentity) {
mDomain = domain;
mTransportType = transportType;
mRegState = regState;
}
/**
- * Constructor for voice network registration states.
+ * Constructor for voice network registration info.
* @hide
*/
- public NetworkRegistrationState(int domain, @TransportType int transportType, int regState,
- int accessNetworkTechnology, int rejectCause, boolean emergencyOnly,
- int[] availableServices, @Nullable CellIdentity cellIdentity, boolean cssSupported,
- int roamingIndicator, int systemIsInPrl, int defaultRoamingIndicator) {
+ public NetworkRegistrationInfo(int domain, @TransportType int transportType, int regState,
+ int accessNetworkTechnology, int rejectCause,
+ boolean emergencyOnly, int[] availableServices,
+ @Nullable CellIdentity cellIdentity, boolean cssSupported,
+ int roamingIndicator, int systemIsInPrl,
+ int defaultRoamingIndicator) {
this(domain, transportType, regState, accessNetworkTechnology, rejectCause, emergencyOnly,
availableServices, cellIdentity);
}
/**
- * Constructor for data network registration states.
+ * Constructor for data network registration info.
* @hide
*/
- public NetworkRegistrationState(int domain, @TransportType int transportType, int regState,
- int accessNetworkTechnology, int rejectCause, boolean emergencyOnly,
- int[] availableServices, @Nullable CellIdentity cellIdentity, int maxDataCalls,
- boolean isDcNrRestricted, boolean isNrAvailable, boolean isEndcAvailable,
- LteVopsSupportInfo lteVopsSupportInfo) {
+ public NetworkRegistrationInfo(int domain, @TransportType int transportType, int regState,
+ int accessNetworkTechnology, int rejectCause,
+ boolean emergencyOnly, int[] availableServices,
+ @Nullable CellIdentity cellIdentity, int maxDataCalls,
+ boolean isDcNrRestricted, boolean isNrAvailable,
+ boolean isEndcAvailable,
+ LteVopsSupportInfo lteVopsSupportInfo) {
this(domain, transportType, regState, accessNetworkTechnology, rejectCause, emergencyOnly,
availableServices, cellIdentity);
updateNrStatus(mDataSpecificStates);
}
- private NetworkRegistrationState(Parcel source) {
+ private NetworkRegistrationInfo(Parcel source) {
mDomain = source.readInt();
mTransportType = source.readInt();
mRegState = source.readInt();
@Override
public String toString() {
- return new StringBuilder("NetworkRegistrationState{")
+ return new StringBuilder("NetworkRegistrationInfo{")
.append(" domain=").append((mDomain == DOMAIN_CS) ? "CS" : "PS")
.append(" transportType=").append(
AccessNetworkConstants.transportTypeToString(mTransportType))
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof NetworkRegistrationState)) {
+ if (!(o instanceof NetworkRegistrationInfo)) {
return false;
}
- NetworkRegistrationState other = (NetworkRegistrationState) o;
+ NetworkRegistrationInfo other = (NetworkRegistrationInfo) o;
return mDomain == other.mDomain
&& mTransportType == other.mTransportType
&& mRegState == other.mRegState
}
}
- public static final @android.annotation.NonNull Parcelable.Creator<NetworkRegistrationState> CREATOR =
- new Parcelable.Creator<NetworkRegistrationState>() {
- @Override
- public NetworkRegistrationState createFromParcel(Parcel source) {
- return new NetworkRegistrationState(source);
- }
+ public static final @NonNull Parcelable.Creator<NetworkRegistrationInfo> CREATOR =
+ new Parcelable.Creator<NetworkRegistrationInfo>() {
+ @Override
+ public NetworkRegistrationInfo createFromParcel(Parcel source) {
+ return new NetworkRegistrationInfo(source);
+ }
- @Override
- public NetworkRegistrationState[] newArray(int size) {
- return new NetworkRegistrationState[size];
- }
- };
+ @Override
+ public NetworkRegistrationInfo[] newArray(int size) {
+ return new NetworkRegistrationInfo[size];
+ }
+ };
/**
* @hide
*/
- public NetworkRegistrationState sanitizeLocationInfo() {
- NetworkRegistrationState result = copy();
+ public NetworkRegistrationInfo sanitizeLocationInfo() {
+ NetworkRegistrationInfo result = copy();
result.mCellIdentity = null;
return result;
}
- private NetworkRegistrationState copy() {
+ private NetworkRegistrationInfo copy() {
Parcel p = Parcel.obtain();
this.writeToParcel(p, 0);
p.setDataPosition(0);
- NetworkRegistrationState result = new NetworkRegistrationState(p);
+ NetworkRegistrationInfo result = new NetworkRegistrationInfo(p);
p.recycle();
return result;
}
/**
- * Provides a convenient way to set the fields of a {@link NetworkRegistrationState} when
+ * Provides a convenient way to set the fields of a {@link NetworkRegistrationInfo} when
* creating a new instance.
*
- * <p>The example below shows how you might create a new {@code NetworkRegistrationState}:
+ * <p>The example below shows how you might create a new {@code NetworkRegistrationInfo}:
*
* <pre><code>
*
- * NetworkRegistrationState nrs = new NetworkRegistrationState.Builder()
+ * NetworkRegistrationInfo nrs = new NetworkRegistrationInfo.Builder()
* .setApnTypeBitmask(ApnSetting.TYPE_DEFAULT | ApnSetting.TYPE_MMS)
* .setApnName("apn.example.com")
* .setEntryName("Example Carrier APN")
}
/**
- * Build the NetworkRegistrationState.
+ * Build the NetworkRegistrationInfo.
*
- * @return the NetworkRegistrationState object.
+ * @return the NetworkRegistrationInfo object.
*/
- public @NonNull NetworkRegistrationState build() {
- return new NetworkRegistrationState(mDomain, mTransportType, mRegState,
+ public @NonNull NetworkRegistrationInfo build() {
+ return new NetworkRegistrationInfo(mDomain, mTransportType, mRegState,
mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
mCellIdentity);
}
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
-import android.telephony.NetworkRegistrationState.Domain;
+import android.telephony.NetworkRegistrationInfo.Domain;
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
private static final int NETWORK_SERVICE_CREATE_NETWORK_SERVICE_PROVIDER = 1;
private static final int NETWORK_SERVICE_REMOVE_NETWORK_SERVICE_PROVIDER = 2;
private static final int NETWORK_SERVICE_REMOVE_ALL_NETWORK_SERVICE_PROVIDERS = 3;
- private static final int NETWORK_SERVICE_GET_REGISTRATION_STATE = 4;
- private static final int NETWORK_SERVICE_REGISTER_FOR_STATE_CHANGE = 5;
- private static final int NETWORK_SERVICE_UNREGISTER_FOR_STATE_CHANGE = 6;
- private static final int NETWORK_SERVICE_INDICATION_NETWORK_STATE_CHANGED = 7;
+ private static final int NETWORK_SERVICE_GET_REGISTRATION_INFO = 4;
+ private static final int NETWORK_SERVICE_REGISTER_FOR_INFO_CHANGE = 5;
+ private static final int NETWORK_SERVICE_UNREGISTER_FOR_INFO_CHANGE = 6;
+ private static final int NETWORK_SERVICE_INDICATION_NETWORK_INFO_CHANGED = 7;
private final HandlerThread mHandlerThread;
private final int mSlotIndex;
private final List<INetworkServiceCallback>
- mNetworkRegistrationStateChangedCallbacks = new ArrayList<>();
+ mNetworkRegistrationInfoChangedCallbacks = new ArrayList<>();
/**
* Constructor
}
/**
- * API to get network registration state. The result will be passed to the callback.
+ * API to get network registration info. The result will be passed to the callback.
* @param domain Network domain
- * @param callback The callback for reporting network registration state
+ * @param callback The callback for reporting network registration info
*/
- public void getNetworkRegistrationState(@Domain int domain,
- @NonNull NetworkServiceCallback callback) {
- callback.onGetNetworkRegistrationStateComplete(
+ public void getNetworkRegistrationInfo(@Domain int domain,
+ @NonNull NetworkServiceCallback callback) {
+ callback.onGetNetworkRegistrationInfoComplete(
NetworkServiceCallback.RESULT_ERROR_UNSUPPORTED, null);
}
/**
- * Notify the system that network registration state is changed.
+ * Notify the system that network registration info is changed.
*/
- public final void notifyNetworkRegistrationStateChanged() {
- mHandler.obtainMessage(NETWORK_SERVICE_INDICATION_NETWORK_STATE_CHANGED,
+ public final void notifyNetworkRegistrationInfoChanged() {
+ mHandler.obtainMessage(NETWORK_SERVICE_INDICATION_NETWORK_INFO_CHANGED,
mSlotIndex, 0, null).sendToTarget();
}
- private void registerForStateChanged(@NonNull INetworkServiceCallback callback) {
- synchronized (mNetworkRegistrationStateChangedCallbacks) {
- mNetworkRegistrationStateChangedCallbacks.add(callback);
+ private void registerForInfoChanged(@NonNull INetworkServiceCallback callback) {
+ synchronized (mNetworkRegistrationInfoChangedCallbacks) {
+ mNetworkRegistrationInfoChangedCallbacks.add(callback);
}
}
- private void unregisterForStateChanged(@NonNull INetworkServiceCallback callback) {
- synchronized (mNetworkRegistrationStateChangedCallbacks) {
- mNetworkRegistrationStateChangedCallbacks.remove(callback);
+ private void unregisterForInfoChanged(@NonNull INetworkServiceCallback callback) {
+ synchronized (mNetworkRegistrationInfoChangedCallbacks) {
+ mNetworkRegistrationInfoChangedCallbacks.remove(callback);
}
}
- private void notifyStateChangedToCallbacks() {
- for (INetworkServiceCallback callback : mNetworkRegistrationStateChangedCallbacks) {
+ private void notifyInfoChangedToCallbacks() {
+ for (INetworkServiceCallback callback : mNetworkRegistrationInfoChangedCallbacks) {
try {
callback.onNetworkStateChanged();
} catch (RemoteException exception) {
}
mServiceMap.clear();
break;
- case NETWORK_SERVICE_GET_REGISTRATION_STATE:
+ case NETWORK_SERVICE_GET_REGISTRATION_INFO:
if (serviceProvider == null) break;
int domainId = message.arg2;
- serviceProvider.getNetworkRegistrationState(domainId,
+ serviceProvider.getNetworkRegistrationInfo(domainId,
new NetworkServiceCallback(callback));
break;
- case NETWORK_SERVICE_REGISTER_FOR_STATE_CHANGE:
+ case NETWORK_SERVICE_REGISTER_FOR_INFO_CHANGE:
if (serviceProvider == null) break;
- serviceProvider.registerForStateChanged(callback);
+ serviceProvider.registerForInfoChanged(callback);
break;
- case NETWORK_SERVICE_UNREGISTER_FOR_STATE_CHANGE:
+ case NETWORK_SERVICE_UNREGISTER_FOR_INFO_CHANGE:
if (serviceProvider == null) break;
- serviceProvider.unregisterForStateChanged(callback);
+ serviceProvider.unregisterForInfoChanged(callback);
break;
- case NETWORK_SERVICE_INDICATION_NETWORK_STATE_CHANGED:
+ case NETWORK_SERVICE_INDICATION_NETWORK_INFO_CHANGED:
if (serviceProvider == null) break;
- serviceProvider.notifyStateChangedToCallbacks();
+ serviceProvider.notifyInfoChangedToCallbacks();
break;
default:
break;
}
@Override
- public void getNetworkRegistrationState(
+ public void getNetworkRegistrationInfo(
int slotIndex, int domain, INetworkServiceCallback callback) {
- mHandler.obtainMessage(NETWORK_SERVICE_GET_REGISTRATION_STATE, slotIndex,
+ mHandler.obtainMessage(NETWORK_SERVICE_GET_REGISTRATION_INFO, slotIndex,
domain, callback).sendToTarget();
}
@Override
- public void registerForNetworkRegistrationStateChanged(
+ public void registerForNetworkRegistrationInfoChanged(
int slotIndex, INetworkServiceCallback callback) {
- mHandler.obtainMessage(NETWORK_SERVICE_REGISTER_FOR_STATE_CHANGE, slotIndex,
+ mHandler.obtainMessage(NETWORK_SERVICE_REGISTER_FOR_INFO_CHANGE, slotIndex,
0, callback).sendToTarget();
}
@Override
- public void unregisterForNetworkRegistrationStateChanged(
+ public void unregisterForNetworkRegistrationInfoChanged(
int slotIndex, INetworkServiceCallback callback) {
- mHandler.obtainMessage(NETWORK_SERVICE_UNREGISTER_FOR_STATE_CHANGE, slotIndex,
+ mHandler.obtainMessage(NETWORK_SERVICE_UNREGISTER_FOR_INFO_CHANGE, slotIndex,
0, callback).sendToTarget();
}
}
/**
* Network service callback. Object of this class is passed to NetworkServiceProvider upon
- * calling getNetworkRegistrationState, to receive asynchronous feedback from NetworkServiceProvider
- * upon onGetNetworkRegistrationStateComplete. It's like a wrapper of INetworkServiceCallback
+ * calling getNetworkRegistrationInfo, to receive asynchronous feedback from NetworkServiceProvider
+ * upon onGetNetworkRegistrationInfoComplete. It's like a wrapper of INetworkServiceCallback
* because INetworkServiceCallback can't be a parameter type in public APIs.
*
* @hide
/**
* Called to indicate result of
- * {@link NetworkServiceProvider#getNetworkRegistrationState(int, NetworkServiceCallback)}
+ * {@link NetworkServiceProvider#getNetworkRegistrationInfo(int, NetworkServiceCallback)}
*
* @param result Result status like {@link NetworkServiceCallback#RESULT_SUCCESS} or
* {@link NetworkServiceCallback#RESULT_ERROR_UNSUPPORTED}
* @param state The state information to be returned to callback.
*/
- public void onGetNetworkRegistrationStateComplete(int result,
- @Nullable NetworkRegistrationState state) {
+ public void onGetNetworkRegistrationInfoComplete(int result,
+ @Nullable NetworkRegistrationInfo state) {
INetworkServiceCallback callback = mCallback.get();
if (callback != null) {
try {
- callback.onGetNetworkRegistrationStateComplete(result, state);
+ callback.onGetNetworkRegistrationInfoComplete(result, state);
} catch (RemoteException e) {
- Rlog.e(mTag, "Failed to onGetNetworkRegistrationStateComplete on the remote");
+ Rlog.e(mTag, "Failed to onGetNetworkRegistrationInfoComplete on the remote");
}
} else {
Rlog.e(mTag, "Weak reference of callback is null.");
import android.os.Parcelable;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.AccessNetworkConstants.TransportType;
-import android.telephony.NetworkRegistrationState.Domain;
-import android.telephony.NetworkRegistrationState.NRStatus;
+import android.telephony.NetworkRegistrationInfo.Domain;
+import android.telephony.NetworkRegistrationInfo.NRStatus;
import android.text.TextUtils;
import java.lang.annotation.Retention;
* Reference: 3GPP TS 36.104 5.4.3 */
private int mLteEarfcnRsrpBoost = 0;
- private List<NetworkRegistrationState> mNetworkRegistrationStates = new ArrayList<>();
+ private List<NetworkRegistrationInfo> mNetworkRegistrationInfos = new ArrayList<>();
/**
* get String description of roaming type
mCellBandwidths = s.mCellBandwidths == null ? null :
Arrays.copyOf(s.mCellBandwidths, s.mCellBandwidths.length);
mLteEarfcnRsrpBoost = s.mLteEarfcnRsrpBoost;
- mNetworkRegistrationStates = s.mNetworkRegistrationStates == null ? null :
- new ArrayList<>(s.mNetworkRegistrationStates);
+ mNetworkRegistrationInfos = s.mNetworkRegistrationInfos == null ? null :
+ new ArrayList<>(s.mNetworkRegistrationInfos);
mNrFrequencyRange = s.mNrFrequencyRange;
}
mIsEmergencyOnly = in.readInt() != 0;
mIsUsingCarrierAggregation = in.readInt() != 0;
mLteEarfcnRsrpBoost = in.readInt();
- mNetworkRegistrationStates = new ArrayList<>();
- in.readList(mNetworkRegistrationStates, NetworkRegistrationState.class.getClassLoader());
+ mNetworkRegistrationInfos = new ArrayList<>();
+ in.readList(mNetworkRegistrationInfos, NetworkRegistrationInfo.class.getClassLoader());
mChannelNumber = in.readInt();
mCellBandwidths = in.createIntArray();
mNrFrequencyRange = in.readInt();
out.writeInt(mIsEmergencyOnly ? 1 : 0);
out.writeInt(mIsUsingCarrierAggregation ? 1 : 0);
out.writeInt(mLteEarfcnRsrpBoost);
- out.writeList(mNetworkRegistrationStates);
+ out.writeList(mNetworkRegistrationInfos);
out.writeInt(mChannelNumber);
out.writeIntArray(mCellBandwidths);
out.writeInt(mNrFrequencyRange);
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @RoamingType int getVoiceRoamingType() {
- final NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) {
return regState.getRoamingType();
}
* @hide
*/
public boolean getDataRoamingFromRegistration() {
- final NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) {
- return (regState.getRegState() == NetworkRegistrationState.REG_STATE_ROAMING);
+ return (regState.getRegState() == NetworkRegistrationInfo.REG_STATE_ROAMING);
}
return false;
}
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @RoamingType int getDataRoamingType() {
- final NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) {
return regState.getRoamingType();
}
mIsEmergencyOnly,
mIsUsingCarrierAggregation,
mLteEarfcnRsrpBoost,
- mNetworkRegistrationStates,
+ mNetworkRegistrationInfos,
mNrFrequencyRange);
}
s.mCdmaDefaultRoamingIndicator)
&& mIsEmergencyOnly == s.mIsEmergencyOnly
&& mIsUsingCarrierAggregation == s.mIsUsingCarrierAggregation)
- && (mNetworkRegistrationStates == null ? s.mNetworkRegistrationStates == null :
- s.mNetworkRegistrationStates != null &&
- mNetworkRegistrationStates.containsAll(s.mNetworkRegistrationStates))
+ && (mNetworkRegistrationInfos == null
+ ? s.mNetworkRegistrationInfos == null : s.mNetworkRegistrationInfos != null
+ && mNetworkRegistrationInfos.containsAll(s.mNetworkRegistrationInfos))
&& mNrFrequencyRange == s.mNrFrequencyRange;
}
.append(", mIsEmergencyOnly=").append(mIsEmergencyOnly)
.append(", mIsUsingCarrierAggregation=").append(mIsUsingCarrierAggregation)
.append(", mLteEarfcnRsrpBoost=").append(mLteEarfcnRsrpBoost)
- .append(", mNetworkRegistrationStates=").append(mNetworkRegistrationStates)
+ .append(", mNetworkRegistrationInfos=").append(mNetworkRegistrationInfos)
.append(", mNrFrequencyRange=").append(mNrFrequencyRange)
.append("}").toString();
}
mIsEmergencyOnly = false;
mIsUsingCarrierAggregation = false;
mLteEarfcnRsrpBoost = 0;
- mNetworkRegistrationStates = new ArrayList<>();
+ mNetworkRegistrationInfos = new ArrayList<>();
mNrFrequencyRange = FREQUENCY_RANGE_UNKNOWN;
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public void setVoiceRoamingType(@RoamingType int type) {
- NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) {
- regState = new NetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+ regState = new NetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0,
false, null, null);
- addNetworkRegistrationState(regState);
+ addNetworkRegistrationInfo(regState);
}
regState.setRoamingType(type);
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public void setDataRoamingType(@RoamingType int type) {
- NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) {
- regState = new NetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+ regState = new NetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0,
false, null, null);
- addNetworkRegistrationState(regState);
+ addNetworkRegistrationInfo(regState);
}
regState.setRoamingType(type);
}
this.mRilVoiceRadioTechnology = rt;
// sync to network registration state
- NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) {
- regState = new NetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+ regState = new NetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN,
0, false, null, null);
- addNetworkRegistrationState(regState);
+ addNetworkRegistrationInfo(regState);
}
regState.setAccessNetworkTechnology(
rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology));
mRilDataRadioTechnology);
// sync to network registration state
- NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) {
- regState = new NetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+ regState = new NetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN,
0, false, null, null);
- addNetworkRegistrationState(regState);
+ addNetworkRegistrationInfo(regState);
}
regState.setAccessNetworkTechnology(
rilRadioTechnologyToNetworkType(mRilDataRadioTechnology));
* @hide
*/
public @NRStatus int getNrStatus() {
- final NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
- if (regState == null) return NetworkRegistrationState.NR_STATUS_NONE;
+ final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ if (regState == null) return NetworkRegistrationInfo.NR_STATUS_NONE;
return regState.getNrStatus();
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @TelephonyManager.NetworkType int getDataNetworkType() {
- final NetworkRegistrationState iwlanRegState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
+ final NetworkRegistrationInfo iwlanRegState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
if (iwlanRegState != null
- && iwlanRegState.getRegState() == NetworkRegistrationState.REG_STATE_HOME) {
+ && iwlanRegState.getRegState() == NetworkRegistrationInfo.REG_STATE_HOME) {
// If the device is on IWLAN, return IWLAN as the network type. This is to simulate the
// behavior of legacy mode device. In the future caller should use
- // getNetworkRegistrationState() to retrieve the actual data network type on cellular
+ // getNetworkRegistrationInfo() to retrieve the actual data network type on cellular
// or on IWLAN.
return iwlanRegState.getAccessNetworkTechnology();
}
- final NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) {
return regState.getAccessNetworkTechnology();
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @TelephonyManager.NetworkType int getVoiceNetworkType() {
- final NetworkRegistrationState regState = getNetworkRegistrationState(
- NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+ final NetworkRegistrationInfo regState = getNetworkRegistrationInfo(
+ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) {
return regState.getAccessNetworkTechnology();
}
}
/**
- * Get all of the available network registration states.
+ * Get all of the available network registration info.
*
- * @return List of {@link NetworkRegistrationState}
+ * @return List of {@link NetworkRegistrationInfo}
* @hide
*/
@NonNull
@SystemApi
- public List<NetworkRegistrationState> getNetworkRegistrationStates() {
- synchronized (mNetworkRegistrationStates) {
- return new ArrayList<>(mNetworkRegistrationStates);
+ public List<NetworkRegistrationInfo> getNetworkRegistrationInfoList() {
+ synchronized (mNetworkRegistrationInfos) {
+ return new ArrayList<>(mNetworkRegistrationInfos);
}
}
/**
- * Get the network registration states for the transport type.
+ * Get the network registration info list for the transport type.
*
* @param transportType The transport type
- * @return List of {@link NetworkRegistrationState}
- * @hide
- *
- * @deprecated Use {@link #getNetworkRegistrationStatesForTransportType(int)}
- */
- @NonNull
- @Deprecated
- @SystemApi
- public List<NetworkRegistrationState> getNetworkRegistrationStates(int transportType) {
- return getNetworkRegistrationStatesForTransportType(transportType);
- }
-
- /**
- * Get the network registration states for the transport type.
- *
- * @param transportType The transport type
- * @return List of {@link NetworkRegistrationState}
+ * @return List of {@link NetworkRegistrationInfo}
* @hide
*/
@NonNull
@SystemApi
- public List<NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(
+ public List<NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(
@TransportType int transportType) {
- List<NetworkRegistrationState> list = new ArrayList<>();
+ List<NetworkRegistrationInfo> list = new ArrayList<>();
- synchronized (mNetworkRegistrationStates) {
- for (NetworkRegistrationState networkRegistrationState : mNetworkRegistrationStates) {
- if (networkRegistrationState.getTransportType() == transportType) {
- list.add(networkRegistrationState);
+ synchronized (mNetworkRegistrationInfos) {
+ for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) {
+ if (networkRegistrationInfo.getTransportType() == transportType) {
+ list.add(networkRegistrationInfo);
}
}
}
}
/**
- * Get the network registration states for the network domain.
+ * Get the network registration info list for the network domain.
*
- * @param domain The network {@link NetworkRegistrationState.Domain domain}
- * @return List of {@link NetworkRegistrationState}
+ * @param domain The network {@link NetworkRegistrationInfo.Domain domain}
+ * @return List of {@link NetworkRegistrationInfo}
* @hide
*/
@NonNull
@SystemApi
- public List<NetworkRegistrationState> getNetworkRegistrationStatesForDomain(
+ public List<NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(
@Domain int domain) {
- List<NetworkRegistrationState> list = new ArrayList<>();
+ List<NetworkRegistrationInfo> list = new ArrayList<>();
- synchronized (mNetworkRegistrationStates) {
- for (NetworkRegistrationState networkRegistrationState : mNetworkRegistrationStates) {
- if (networkRegistrationState.getDomain() == domain) {
- list.add(networkRegistrationState);
+ synchronized (mNetworkRegistrationInfos) {
+ for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) {
+ if (networkRegistrationInfo.getDomain() == domain) {
+ list.add(networkRegistrationInfo);
}
}
}
/**
* Get the network registration state for the transport type and network domain.
*
- * @param domain The network {@link NetworkRegistrationState.Domain domain}
- * @param transportType The transport type
- * @return The matching {@link NetworkRegistrationState}
- * @hide
- *
- * @deprecated Use {@link #getNetworkRegistrationState(int, int)}
- */
- @Nullable
- @Deprecated
- @SystemApi
- public NetworkRegistrationState getNetworkRegistrationStates(@Domain int domain,
- @TransportType int transportType) {
- return getNetworkRegistrationState(domain, transportType);
- }
-
- /**
- * Get the network registration state for the transport type and network domain.
- *
- * @param domain The network {@link NetworkRegistrationState.Domain domain}
+ * @param domain The network {@link NetworkRegistrationInfo.Domain domain}
* @param transportType The transport type
- * @return The matching {@link NetworkRegistrationState}
+ * @return The matching {@link NetworkRegistrationInfo}
* @hide
*
*/
@Nullable
@SystemApi
- public NetworkRegistrationState getNetworkRegistrationState(@Domain int domain,
- @TransportType int transportType) {
- synchronized (mNetworkRegistrationStates) {
- for (NetworkRegistrationState networkRegistrationState : mNetworkRegistrationStates) {
- if (networkRegistrationState.getTransportType() == transportType
- && networkRegistrationState.getDomain() == domain) {
- return networkRegistrationState;
+ public NetworkRegistrationInfo getNetworkRegistrationInfo(@Domain int domain,
+ @TransportType int transportType) {
+ synchronized (mNetworkRegistrationInfos) {
+ for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) {
+ if (networkRegistrationInfo.getTransportType() == transportType
+ && networkRegistrationInfo.getDomain() == domain) {
+ return networkRegistrationInfo;
}
}
}
/**
* @hide
*/
- public void addNetworkRegistrationState(NetworkRegistrationState regState) {
+ public void addNetworkRegistrationInfo(NetworkRegistrationInfo regState) {
if (regState == null) return;
- synchronized (mNetworkRegistrationStates) {
- for (int i = 0; i < mNetworkRegistrationStates.size(); i++) {
- NetworkRegistrationState curRegState = mNetworkRegistrationStates.get(i);
+ synchronized (mNetworkRegistrationInfos) {
+ for (int i = 0; i < mNetworkRegistrationInfos.size(); i++) {
+ NetworkRegistrationInfo curRegState = mNetworkRegistrationInfos.get(i);
if (curRegState.getTransportType() == regState.getTransportType()
&& curRegState.getDomain() == regState.getDomain()) {
- mNetworkRegistrationStates.remove(i);
+ mNetworkRegistrationInfos.remove(i);
break;
}
}
- mNetworkRegistrationStates.add(regState);
+ mNetworkRegistrationInfos.add(regState);
}
}
/**
* Returns a copy of self with location-identifying information removed.
- * Always clears the NetworkRegistrationState's CellIdentity fields, but if removeCoarseLocation
+ * Always clears the NetworkRegistrationInfo's CellIdentity fields, but if removeCoarseLocation
* is true, clears other info as well.
* @hide
*/
public ServiceState sanitizeLocationInfo(boolean removeCoarseLocation) {
ServiceState state = new ServiceState(this);
- if (state.mNetworkRegistrationStates != null) {
- state.mNetworkRegistrationStates = state.mNetworkRegistrationStates.stream()
- .map(NetworkRegistrationState::sanitizeLocationInfo)
+ if (state.mNetworkRegistrationInfos != null) {
+ state.mNetworkRegistrationInfos = state.mNetworkRegistrationInfos.stream()
+ .map(NetworkRegistrationInfo::sanitizeLocationInfo)
.collect(Collectors.toList());
}
if (!removeCoarseLocation) return state;