Loading proto/src/telephony.proto +37 −0 Original line number Original line Diff line number Diff line Loading @@ -242,6 +242,17 @@ message TelephonyServiceState { optional string numeric = 3; optional string numeric = 3; } } message NetworkRegistrationInfo { // Network domain optional Domain domain = 1; // Network transport optional Transport transport = 2; // Radio access technology optional RadioAccessTechnology rat = 3; } // Roaming type // Roaming type enum RoamingType { enum RoamingType { Loading @@ -262,6 +273,29 @@ message TelephonyServiceState { ROAMING_TYPE_INTERNATIONAL = 3; ROAMING_TYPE_INTERNATIONAL = 3; } } // Domain type enum Domain { // Unknown DOMAIN_UNKNOWN = 0; // Circuit switching domain DOMAIN_CS = 1; // Packet switching domain DOMAIN_PS = 2; } enum Transport { // Unknown TRANSPORT_UNKNOWN = 0; // Transport type for Wireless Wide Area Networks (i.e. Cellular) TRANSPORT_WWAN = 1; // Transport type for Wireless Local Area Networks (i.e. Wifi) TRANSPORT_WLAN = 2; } // Current registered operator // Current registered operator optional TelephonyOperator voice_operator = 1; optional TelephonyOperator voice_operator = 1; Loading @@ -282,6 +316,9 @@ message TelephonyServiceState { // Current Channel Number // Current Channel Number optional int32 channel_number = 7; optional int32 channel_number = 7; // Network registration info repeated NetworkRegistrationInfo networkRegistrationInfo = 10; } } // Radio access families // Radio access families Loading src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -41,8 +41,10 @@ import android.os.Build; import android.os.SystemClock; import android.os.SystemClock; import android.os.SystemProperties; import android.os.SystemProperties; import android.provider.Telephony.Sms.Intents; import android.provider.Telephony.Sms.Intents; import android.telephony.AccessNetworkConstants; import android.telephony.CallQuality; import android.telephony.CallQuality; import android.telephony.DisconnectCause; import android.telephony.DisconnectCause; import android.telephony.NetworkRegistrationInfo; import android.telephony.Rlog; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.ServiceState; import android.telephony.SmsManager; import android.telephony.SmsManager; Loading Loading @@ -434,6 +436,11 @@ public class TelephonyMetrics { + " Voice RAT " + event.serviceState.voiceRat + " Voice RAT " + event.serviceState.voiceRat + " Channel Number " + event.serviceState.channelNumber + " Channel Number " + event.serviceState.channelNumber + ")"); + ")"); for (int i = 0; i < event.serviceState.networkRegistrationInfo.length; i++) { pw.print("reg info: domain=" + event.serviceState.networkRegistrationInfo[i].domain + ", rat=" + event.serviceState.networkRegistrationInfo[i].rat); } } else { } else { pw.print(telephonyEventToString(event.type)); pw.print(telephonyEventToString(event.type)); } } Loading Loading @@ -908,6 +915,26 @@ public class TelephonyMetrics { ssProto.dataOperator.numeric = serviceState.getDataOperatorNumeric(); ssProto.dataOperator.numeric = serviceState.getDataOperatorNumeric(); } } // Log PS WWAN only because CS WWAN would be exactly the same as voiceRat, and PS WLAN // would be always IWLAN in the rat field. // Note that we intentionally do not log reg state because it changes too frequently that // will grow the proto size too much. List<TelephonyServiceState.NetworkRegistrationInfo> nriList = new ArrayList<>(); NetworkRegistrationInfo nri = serviceState.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (nri != null) { TelephonyServiceState.NetworkRegistrationInfo nriProto = new TelephonyServiceState.NetworkRegistrationInfo(); nriProto.domain = TelephonyServiceState.Domain.DOMAIN_PS; nriProto.transport = TelephonyServiceState.Transport.TRANSPORT_WWAN; nriProto.rat = ServiceState.networkTypeToRilRadioTechnology( nri.getAccessNetworkTechnology()); nriList.add(nriProto); ssProto.networkRegistrationInfo = new TelephonyServiceState.NetworkRegistrationInfo[nriList.size()]; nriList.toArray(ssProto.networkRegistrationInfo); } ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology(); ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology(); ssProto.dataRat = serviceState.getRilDataRadioTechnology(); ssProto.dataRat = serviceState.getRilDataRadioTechnology(); ssProto.channelNumber = serviceState.getChannelNumber(); ssProto.channelNumber = serviceState.getChannelNumber(); Loading Loading
proto/src/telephony.proto +37 −0 Original line number Original line Diff line number Diff line Loading @@ -242,6 +242,17 @@ message TelephonyServiceState { optional string numeric = 3; optional string numeric = 3; } } message NetworkRegistrationInfo { // Network domain optional Domain domain = 1; // Network transport optional Transport transport = 2; // Radio access technology optional RadioAccessTechnology rat = 3; } // Roaming type // Roaming type enum RoamingType { enum RoamingType { Loading @@ -262,6 +273,29 @@ message TelephonyServiceState { ROAMING_TYPE_INTERNATIONAL = 3; ROAMING_TYPE_INTERNATIONAL = 3; } } // Domain type enum Domain { // Unknown DOMAIN_UNKNOWN = 0; // Circuit switching domain DOMAIN_CS = 1; // Packet switching domain DOMAIN_PS = 2; } enum Transport { // Unknown TRANSPORT_UNKNOWN = 0; // Transport type for Wireless Wide Area Networks (i.e. Cellular) TRANSPORT_WWAN = 1; // Transport type for Wireless Local Area Networks (i.e. Wifi) TRANSPORT_WLAN = 2; } // Current registered operator // Current registered operator optional TelephonyOperator voice_operator = 1; optional TelephonyOperator voice_operator = 1; Loading @@ -282,6 +316,9 @@ message TelephonyServiceState { // Current Channel Number // Current Channel Number optional int32 channel_number = 7; optional int32 channel_number = 7; // Network registration info repeated NetworkRegistrationInfo networkRegistrationInfo = 10; } } // Radio access families // Radio access families Loading
src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -41,8 +41,10 @@ import android.os.Build; import android.os.SystemClock; import android.os.SystemClock; import android.os.SystemProperties; import android.os.SystemProperties; import android.provider.Telephony.Sms.Intents; import android.provider.Telephony.Sms.Intents; import android.telephony.AccessNetworkConstants; import android.telephony.CallQuality; import android.telephony.CallQuality; import android.telephony.DisconnectCause; import android.telephony.DisconnectCause; import android.telephony.NetworkRegistrationInfo; import android.telephony.Rlog; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.ServiceState; import android.telephony.SmsManager; import android.telephony.SmsManager; Loading Loading @@ -434,6 +436,11 @@ public class TelephonyMetrics { + " Voice RAT " + event.serviceState.voiceRat + " Voice RAT " + event.serviceState.voiceRat + " Channel Number " + event.serviceState.channelNumber + " Channel Number " + event.serviceState.channelNumber + ")"); + ")"); for (int i = 0; i < event.serviceState.networkRegistrationInfo.length; i++) { pw.print("reg info: domain=" + event.serviceState.networkRegistrationInfo[i].domain + ", rat=" + event.serviceState.networkRegistrationInfo[i].rat); } } else { } else { pw.print(telephonyEventToString(event.type)); pw.print(telephonyEventToString(event.type)); } } Loading Loading @@ -908,6 +915,26 @@ public class TelephonyMetrics { ssProto.dataOperator.numeric = serviceState.getDataOperatorNumeric(); ssProto.dataOperator.numeric = serviceState.getDataOperatorNumeric(); } } // Log PS WWAN only because CS WWAN would be exactly the same as voiceRat, and PS WLAN // would be always IWLAN in the rat field. // Note that we intentionally do not log reg state because it changes too frequently that // will grow the proto size too much. List<TelephonyServiceState.NetworkRegistrationInfo> nriList = new ArrayList<>(); NetworkRegistrationInfo nri = serviceState.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (nri != null) { TelephonyServiceState.NetworkRegistrationInfo nriProto = new TelephonyServiceState.NetworkRegistrationInfo(); nriProto.domain = TelephonyServiceState.Domain.DOMAIN_PS; nriProto.transport = TelephonyServiceState.Transport.TRANSPORT_WWAN; nriProto.rat = ServiceState.networkTypeToRilRadioTechnology( nri.getAccessNetworkTechnology()); nriList.add(nriProto); ssProto.networkRegistrationInfo = new TelephonyServiceState.NetworkRegistrationInfo[nriList.size()]; nriList.toArray(ssProto.networkRegistrationInfo); } ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology(); ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology(); ssProto.dataRat = serviceState.getRilDataRadioTechnology(); ssProto.dataRat = serviceState.getRilDataRadioTechnology(); ssProto.channelNumber = serviceState.getChannelNumber(); ssProto.channelNumber = serviceState.getChannelNumber(); Loading