Merge "Expose NetworkRegistrationInfo.getNrState() as public API" am: f177ac1348 am: b637605947 am: ab746aa210

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1467045

Change-Id: I111cbae01fb9aea68a9bc0b63bd6f5caae4011e9
This commit is contained in:
Chiachang Wang
2020-10-27 03:46:29 +00:00
committed by Automerger Merge Worker
4 changed files with 3 additions and 4 deletions

View File

@@ -47671,6 +47671,7 @@ package android.telephony {
method @NonNull public java.util.List<java.lang.Integer> getAvailableServices(); method @NonNull public java.util.List<java.lang.Integer> getAvailableServices();
method @Nullable public android.telephony.CellIdentity getCellIdentity(); method @Nullable public android.telephony.CellIdentity getCellIdentity();
method public int getDomain(); method public int getDomain();
method public int getNrState();
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 isRegistered();

View File

@@ -45839,6 +45839,7 @@ package android.telephony {
method @NonNull public java.util.List<java.lang.Integer> getAvailableServices(); method @NonNull public java.util.List<java.lang.Integer> getAvailableServices();
method @Nullable public android.telephony.CellIdentity getCellIdentity(); method @Nullable public android.telephony.CellIdentity getCellIdentity();
method public int getDomain(); method public int getDomain();
method public int getNrState();
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 isRegistered();

View File

@@ -52,7 +52,6 @@ public class DataConnectionStats extends BroadcastReceiver {
private SignalStrength mSignalStrength; private SignalStrength mSignalStrength;
private ServiceState mServiceState; private ServiceState mServiceState;
private int mDataState = TelephonyManager.DATA_DISCONNECTED; private int mDataState = TelephonyManager.DATA_DISCONNECTED;
private int mNrState = NetworkRegistrationInfo.NR_STATE_NONE;
public DataConnectionStats(Context context, Handler listenerHandler) { public DataConnectionStats(Context context, Handler listenerHandler) {
mContext = context; mContext = context;
@@ -100,7 +99,7 @@ public class DataConnectionStats extends BroadcastReceiver {
: regInfo.getAccessNetworkTechnology(); : regInfo.getAccessNetworkTechnology();
// If the device is in NSA NR connection the networkType will report as LTE. // If the device is in NSA NR connection the networkType will report as LTE.
// For cell dwell rate metrics, this should report NR instead. // For cell dwell rate metrics, this should report NR instead.
if (mNrState == NetworkRegistrationInfo.NR_STATE_CONNECTED) { if (regInfo != null && regInfo.getNrState() == NetworkRegistrationInfo.NR_STATE_CONNECTED) {
networkType = TelephonyManager.NETWORK_TYPE_NR; networkType = TelephonyManager.NETWORK_TYPE_NR;
} }
if (DEBUG) Log.d(TAG, String.format("Noting data connection for network type %s: %svisible", if (DEBUG) Log.d(TAG, String.format("Noting data connection for network type %s: %svisible",
@@ -172,7 +171,6 @@ public class DataConnectionStats extends BroadcastReceiver {
@Override @Override
public void onServiceStateChanged(ServiceState state) { public void onServiceStateChanged(ServiceState state) {
mServiceState = state; mServiceState = state;
mNrState = state.getNrState();
notePhoneDataConnectionState(); notePhoneDataConnectionState();
} }

View File

@@ -369,7 +369,6 @@ public final class NetworkRegistrationInfo implements Parcelable {
* Get the 5G NR connection state. * Get the 5G NR connection state.
* *
* @return the 5G NR connection state. * @return the 5G NR connection state.
* @hide
*/ */
public @NRState int getNrState() { public @NRState int getNrState() {
return mNrState; return mNrState;