A get method for NR status in ServiceState

Bug: 111453000
Test: build
Change-Id: I07749ff00fc9d53796208ca78721b498ed4c16fd
This commit is contained in:
Pengquan Meng
2018-12-06 17:48:05 -08:00
parent 4d50e4990c
commit bbcd9123aa

View File

@@ -27,6 +27,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.NetworkRegistrationState.Domain;
import android.telephony.NetworkRegistrationState.NRStatus;
import android.text.TextUtils;
import java.lang.annotation.Retention;
@@ -1357,6 +1358,18 @@ public class ServiceState implements Parcelable {
return mNrFrequencyRange;
}
/**
* Get the NR 5G status of the mobile data network.
* @return the NR 5G status.
* @hide
*/
public @NRStatus int getNrStatus() {
final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN);
if (regState == null) return NetworkRegistrationState.NR_STATUS_NONE;
return regState.getNrStatus();
}
/**
* @param nrFrequencyRange the frequency range of 5G NR.
* @hide
@@ -1531,7 +1544,6 @@ public class ServiceState implements Parcelable {
}
}
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @TelephonyManager.NetworkType int getDataNetworkType() {