Merge "Report NSA NR As NR Cell Dwell Rate Metric" into rvc-dev am: c64b2ce195
Change-Id: I92f7bcff689d8f13c0302aba7afe6008a417722d
This commit is contained in:
@@ -50,6 +50,7 @@ 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;
|
||||||
@@ -99,6 +100,11 @@ public class DataConnectionStats extends BroadcastReceiver {
|
|||||||
mServiceState.getNetworkRegistrationInfo(DOMAIN_PS, TRANSPORT_TYPE_WWAN);
|
mServiceState.getNetworkRegistrationInfo(DOMAIN_PS, TRANSPORT_TYPE_WWAN);
|
||||||
int networkType = regInfo == null ? TelephonyManager.NETWORK_TYPE_UNKNOWN
|
int networkType = regInfo == null ? TelephonyManager.NETWORK_TYPE_UNKNOWN
|
||||||
: regInfo.getAccessNetworkTechnology();
|
: 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) {
|
||||||
|
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",
|
||||||
networkType, visible ? "" : "not "));
|
networkType, visible ? "" : "not "));
|
||||||
try {
|
try {
|
||||||
@@ -153,6 +159,7 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user