diff options
author | Chiachang Wang <chiachangwang@google.com> | 2020-10-27 02:53:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-10-27 02:53:59 +0000 |
commit | f177ac1348e7f11ebbb12f48cf254a4cb97c1551 (patch) | |
tree | 50c9f2a447d714dc77a46911f75d289a932de31f | |
parent | 8dddad53d52010a0847f6c8669b6d065a4e4efdd (diff) | |
parent | d32aa193fdee6c2be5e5e4cb67e80f57299f1c04 (diff) |
Merge "Expose NetworkRegistrationInfo.getNrState() as public API"
-rw-r--r-- | api/current.txt | 1 | ||||
-rw-r--r-- | non-updatable-api/current.txt | 1 | ||||
-rw-r--r-- | services/core/java/com/android/server/connectivity/DataConnectionStats.java | 4 | ||||
-rw-r--r-- | telephony/java/android/telephony/NetworkRegistrationInfo.java | 1 |
4 files changed, 3 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt index 99d59d224945..19c31380a935 100644 --- a/api/current.txt +++ b/api/current.txt @@ -47671,6 +47671,7 @@ package android.telephony { method @NonNull public java.util.List<java.lang.Integer> getAvailableServices(); method @Nullable public android.telephony.CellIdentity getCellIdentity(); method public int getDomain(); + method public int getNrState(); method @Nullable public String getRegisteredPlmn(); method public int getTransportType(); method public boolean isRegistered(); diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index ae3b2ffb1a09..4a449049cafd 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -45839,6 +45839,7 @@ package android.telephony { method @NonNull public java.util.List<java.lang.Integer> getAvailableServices(); method @Nullable public android.telephony.CellIdentity getCellIdentity(); method public int getDomain(); + method public int getNrState(); method @Nullable public String getRegisteredPlmn(); method public int getTransportType(); method public boolean isRegistered(); diff --git a/services/core/java/com/android/server/connectivity/DataConnectionStats.java b/services/core/java/com/android/server/connectivity/DataConnectionStats.java index 15f43a0481bd..fbd089c1f0ee 100644 --- a/services/core/java/com/android/server/connectivity/DataConnectionStats.java +++ b/services/core/java/com/android/server/connectivity/DataConnectionStats.java @@ -52,7 +52,6 @@ public class DataConnectionStats extends BroadcastReceiver { private SignalStrength mSignalStrength; private ServiceState mServiceState; private int mDataState = TelephonyManager.DATA_DISCONNECTED; - private int mNrState = NetworkRegistrationInfo.NR_STATE_NONE; public DataConnectionStats(Context context, Handler listenerHandler) { mContext = context; @@ -100,7 +99,7 @@ public class DataConnectionStats extends BroadcastReceiver { : regInfo.getAccessNetworkTechnology(); // If the device is in NSA NR connection the networkType will report as LTE. // 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; } 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 public void onServiceStateChanged(ServiceState state) { mServiceState = state; - mNrState = state.getNrState(); notePhoneDataConnectionState(); } diff --git a/telephony/java/android/telephony/NetworkRegistrationInfo.java b/telephony/java/android/telephony/NetworkRegistrationInfo.java index 92238420fd32..f8a200a5f8d3 100644 --- a/telephony/java/android/telephony/NetworkRegistrationInfo.java +++ b/telephony/java/android/telephony/NetworkRegistrationInfo.java @@ -369,7 +369,6 @@ public final class NetworkRegistrationInfo implements Parcelable { * Get the 5G NR connection state. * * @return the 5G NR connection state. - * @hide */ public @NRState int getNrState() { return mNrState; |