Loading proto/src/telephony.proto +44 −0 Original line number Diff line number Diff line Loading @@ -262,6 +262,44 @@ message TelephonyServiceState { ROAMING_TYPE_INTERNATIONAL = 3; } enum FrequencyRange { // Unknown. The default value. FREQUENCY_RANGE_UNKNOWN = -1; // Frequency range is below 1GHz. FREQUENCY_RANGE_LOW = 1; // Frequency range is between 1GHz and 3GHz. FREQUENCY_RANGE_MID = 2; // Frequency range is between 3GHz and 6GHz. FREQUENCY_RANGE_HIGH = 3; // Frequency range is above 6GHz (millimeter wave frequency). FREQUENCY_RANGE_MMWAVE = 4; } enum NrState { // The device isn't camped on an LTE cell // or the LTE cell doesn't support EN-DC. NR_STATE_NONE = -1; // The device is camped on an LTE cell that supports EN-DC // but either DCNR is restricted // or NR is not supported by the selected PLMN. NR_STATE_RESTRICTED = 1; // The device is camped on an LTE cell that supports EN-DC // and both DCNR is not restricted and NR is supported // by the selected PLMN. NR_STATE_NOT_RESTRICTED = 2; // The device is camped on an LTE cell that supports EN-DC // and connected to at least one 5G cell // as a secondary serving cell. NR_STATE_CONNECTED = 3; } // Current registered operator optional TelephonyOperator voice_operator = 1; Loading @@ -282,6 +320,12 @@ message TelephonyServiceState { // Current Channel Number optional int32 channel_number = 7; // Current NR frequency range optional FrequencyRange nr_frequency_range = 8; // Current NR state optional NrState nr_state = 9; } // Radio access families Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +13 −2 Original line number Diff line number Diff line Loading @@ -1555,6 +1555,8 @@ public class ServiceStateTracker extends Handler { if (hasChanged || RatRatcheter.updateBandwidths(getBandwidthsFromConfigs(list), mSS)) { mPhone.notifyServiceStateChanged(mSS); TelephonyMetrics.getInstance().writeServiceStateChanged( mPhone.getPhoneId(), mSS); } } break; Loading Loading @@ -2128,6 +2130,7 @@ public class ServiceStateTracker extends Handler { int serviceState = regCodeToServiceState(registrationState); int newDataRat = ServiceState.networkTypeToRilRadioTechnology( networkRegState.getAccessNetworkTechnology()); boolean nrHasChanged = false; if (DBG) { log("handlePollStateResultMessage: PS cellular. " + networkRegState); Loading @@ -2138,11 +2141,17 @@ public class ServiceStateTracker extends Handler { // (2 or more cells) to a new cell if they camp for emergency service only. if (serviceState == ServiceState.STATE_OUT_OF_SERVICE) { mLastPhysicalChannelConfigList = null; updateNrFrequencyRangeFromPhysicalChannelConfigs(null, mNewSS); nrHasChanged |= updateNrFrequencyRangeFromPhysicalChannelConfigs(null, mNewSS); } updateNrStateFromPhysicalChannelConfigs(mLastPhysicalChannelConfigList, mNewSS); nrHasChanged |= updateNrStateFromPhysicalChannelConfigs( mLastPhysicalChannelConfigList, mNewSS); setPhyCellInfoFromCellIdentity(mNewSS, networkRegState.getCellIdentity()); if (nrHasChanged) { TelephonyMetrics.getInstance().writeServiceStateChanged( mPhone.getPhoneId(), mSS); } if (mPhone.isPhoneTypeGsm()) { mNewReasonDataDenied = networkRegState.getRejectCause(); Loading Loading @@ -3371,7 +3380,9 @@ public class ServiceStateTracker extends Handler { mPhone.getContext().getContentResolver() .insert(getUriForSubscriptionId(mPhone.getSubId()), getContentValuesForServiceState(mSS)); } if (hasChanged || hasNrStateChanged) { TelephonyMetrics.getInstance().writeServiceStateChanged(mPhone.getPhoneId(), mSS); } Loading src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +7 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.RIL; import com.android.internal.telephony.RILConstants; import com.android.internal.telephony.SmsResponse; import com.android.internal.telephony.util.TelephonyUtils; import com.android.internal.telephony.UUSInfo; import com.android.internal.telephony.imsphone.ImsPhoneCall; import com.android.internal.telephony.nano.TelephonyProto; Loading Loading @@ -105,6 +104,7 @@ import com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState; import com.android.internal.telephony.nano.TelephonyProto.TelephonySettings; import com.android.internal.telephony.nano.TelephonyProto.TimeInterval; import com.android.internal.telephony.protobuf.nano.MessageNano; import com.android.internal.telephony.util.TelephonyUtils; import com.android.internal.util.IndentingPrintWriter; import java.io.FileDescriptor; Loading Loading @@ -434,6 +434,8 @@ public class TelephonyMetrics { + "(" + "Data RAT " + event.serviceState.dataRat + " Voice RAT " + event.serviceState.voiceRat + " Channel Number " + event.serviceState.channelNumber + " NR Frequency Range " + event.serviceState.nrFrequencyRange + " NR State " + event.serviceState.nrState + ")"); } else { pw.print(telephonyEventToString(event.type)); Loading Loading @@ -463,6 +465,8 @@ public class TelephonyMetrics { + "(" + "Data RAT " + event.serviceState.dataRat + " Voice RAT " + event.serviceState.voiceRat + " Channel Number " + event.serviceState.channelNumber + " NR Frequency Range " + event.serviceState.nrFrequencyRange + " NR State " + event.serviceState.nrState + ")"); } else if (event.type == TelephonyCallSession.Event.Type.RIL_CALL_LIST_CHANGED) { pw.println(callSessionEventToString(event.type)); Loading Loading @@ -912,6 +916,8 @@ public class TelephonyMetrics { ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology(); ssProto.dataRat = serviceState.getRilDataRadioTechnology(); ssProto.channelNumber = serviceState.getChannelNumber(); ssProto.nrFrequencyRange = serviceState.getNrFrequencyRange(); ssProto.nrState = serviceState.getNrState(); return ssProto; } Loading Loading
proto/src/telephony.proto +44 −0 Original line number Diff line number Diff line Loading @@ -262,6 +262,44 @@ message TelephonyServiceState { ROAMING_TYPE_INTERNATIONAL = 3; } enum FrequencyRange { // Unknown. The default value. FREQUENCY_RANGE_UNKNOWN = -1; // Frequency range is below 1GHz. FREQUENCY_RANGE_LOW = 1; // Frequency range is between 1GHz and 3GHz. FREQUENCY_RANGE_MID = 2; // Frequency range is between 3GHz and 6GHz. FREQUENCY_RANGE_HIGH = 3; // Frequency range is above 6GHz (millimeter wave frequency). FREQUENCY_RANGE_MMWAVE = 4; } enum NrState { // The device isn't camped on an LTE cell // or the LTE cell doesn't support EN-DC. NR_STATE_NONE = -1; // The device is camped on an LTE cell that supports EN-DC // but either DCNR is restricted // or NR is not supported by the selected PLMN. NR_STATE_RESTRICTED = 1; // The device is camped on an LTE cell that supports EN-DC // and both DCNR is not restricted and NR is supported // by the selected PLMN. NR_STATE_NOT_RESTRICTED = 2; // The device is camped on an LTE cell that supports EN-DC // and connected to at least one 5G cell // as a secondary serving cell. NR_STATE_CONNECTED = 3; } // Current registered operator optional TelephonyOperator voice_operator = 1; Loading @@ -282,6 +320,12 @@ message TelephonyServiceState { // Current Channel Number optional int32 channel_number = 7; // Current NR frequency range optional FrequencyRange nr_frequency_range = 8; // Current NR state optional NrState nr_state = 9; } // Radio access families Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +13 −2 Original line number Diff line number Diff line Loading @@ -1555,6 +1555,8 @@ public class ServiceStateTracker extends Handler { if (hasChanged || RatRatcheter.updateBandwidths(getBandwidthsFromConfigs(list), mSS)) { mPhone.notifyServiceStateChanged(mSS); TelephonyMetrics.getInstance().writeServiceStateChanged( mPhone.getPhoneId(), mSS); } } break; Loading Loading @@ -2128,6 +2130,7 @@ public class ServiceStateTracker extends Handler { int serviceState = regCodeToServiceState(registrationState); int newDataRat = ServiceState.networkTypeToRilRadioTechnology( networkRegState.getAccessNetworkTechnology()); boolean nrHasChanged = false; if (DBG) { log("handlePollStateResultMessage: PS cellular. " + networkRegState); Loading @@ -2138,11 +2141,17 @@ public class ServiceStateTracker extends Handler { // (2 or more cells) to a new cell if they camp for emergency service only. if (serviceState == ServiceState.STATE_OUT_OF_SERVICE) { mLastPhysicalChannelConfigList = null; updateNrFrequencyRangeFromPhysicalChannelConfigs(null, mNewSS); nrHasChanged |= updateNrFrequencyRangeFromPhysicalChannelConfigs(null, mNewSS); } updateNrStateFromPhysicalChannelConfigs(mLastPhysicalChannelConfigList, mNewSS); nrHasChanged |= updateNrStateFromPhysicalChannelConfigs( mLastPhysicalChannelConfigList, mNewSS); setPhyCellInfoFromCellIdentity(mNewSS, networkRegState.getCellIdentity()); if (nrHasChanged) { TelephonyMetrics.getInstance().writeServiceStateChanged( mPhone.getPhoneId(), mSS); } if (mPhone.isPhoneTypeGsm()) { mNewReasonDataDenied = networkRegState.getRejectCause(); Loading Loading @@ -3371,7 +3380,9 @@ public class ServiceStateTracker extends Handler { mPhone.getContext().getContentResolver() .insert(getUriForSubscriptionId(mPhone.getSubId()), getContentValuesForServiceState(mSS)); } if (hasChanged || hasNrStateChanged) { TelephonyMetrics.getInstance().writeServiceStateChanged(mPhone.getPhoneId(), mSS); } Loading
src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +7 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.RIL; import com.android.internal.telephony.RILConstants; import com.android.internal.telephony.SmsResponse; import com.android.internal.telephony.util.TelephonyUtils; import com.android.internal.telephony.UUSInfo; import com.android.internal.telephony.imsphone.ImsPhoneCall; import com.android.internal.telephony.nano.TelephonyProto; Loading Loading @@ -105,6 +104,7 @@ import com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState; import com.android.internal.telephony.nano.TelephonyProto.TelephonySettings; import com.android.internal.telephony.nano.TelephonyProto.TimeInterval; import com.android.internal.telephony.protobuf.nano.MessageNano; import com.android.internal.telephony.util.TelephonyUtils; import com.android.internal.util.IndentingPrintWriter; import java.io.FileDescriptor; Loading Loading @@ -434,6 +434,8 @@ public class TelephonyMetrics { + "(" + "Data RAT " + event.serviceState.dataRat + " Voice RAT " + event.serviceState.voiceRat + " Channel Number " + event.serviceState.channelNumber + " NR Frequency Range " + event.serviceState.nrFrequencyRange + " NR State " + event.serviceState.nrState + ")"); } else { pw.print(telephonyEventToString(event.type)); Loading Loading @@ -463,6 +465,8 @@ public class TelephonyMetrics { + "(" + "Data RAT " + event.serviceState.dataRat + " Voice RAT " + event.serviceState.voiceRat + " Channel Number " + event.serviceState.channelNumber + " NR Frequency Range " + event.serviceState.nrFrequencyRange + " NR State " + event.serviceState.nrState + ")"); } else if (event.type == TelephonyCallSession.Event.Type.RIL_CALL_LIST_CHANGED) { pw.println(callSessionEventToString(event.type)); Loading Loading @@ -912,6 +916,8 @@ public class TelephonyMetrics { ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology(); ssProto.dataRat = serviceState.getRilDataRadioTechnology(); ssProto.channelNumber = serviceState.getChannelNumber(); ssProto.nrFrequencyRange = serviceState.getNrFrequencyRange(); ssProto.nrState = serviceState.getNrState(); return ssProto; } Loading