Loading proto/src/persist_atoms.proto +3 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,7 @@ message IncomingSms { optional int64 message_id = 14; optional int32 count = 15; optional bool is_managed_profile = 16; optional bool is_ntn = 17; // Internal use only optional int32 hashCode = 10001; Loading @@ -334,6 +335,8 @@ message OutgoingSms { optional int32 send_error_code = 16; optional int32 network_error_code = 17; optional bool is_managed_profile = 18; optional bool is_emergency = 19; optional bool is_ntn = 20; // Internal use only optional int32 hashCode = 10001; Loading src/java/com/android/internal/telephony/ImsSmsDispatcher.java +4 −2 Original line number Diff line number Diff line Loading @@ -247,7 +247,8 @@ public class ImsSmsDispatcher extends SMSDispatcher { networkReasonCode, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -664,7 +665,8 @@ public class ImsSmsDispatcher extends SMSDispatcher { SmsManager.RESULT_SYSTEM_ERROR, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading src/java/com/android/internal/telephony/SMSDispatcher.java +10 −5 Original line number Diff line number Diff line Loading @@ -1063,7 +1063,8 @@ public abstract class SMSDispatcher extends Handler { SmsManager.RESULT_ERROR_NONE, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -1113,7 +1114,8 @@ public abstract class SMSDispatcher extends Handler { getNotInServiceError(ss), tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -1149,7 +1151,8 @@ public abstract class SMSDispatcher extends Handler { errorCode, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading @@ -1175,7 +1178,8 @@ public abstract class SMSDispatcher extends Handler { errorCode, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -2403,7 +2407,8 @@ public abstract class SMSDispatcher extends Handler { error, trackers[0].mMessageId, trackers[0].isFromDefaultSmsApplication(mContext), trackers[0].getInterval()); trackers[0].getInterval(), mTelephonyManager.isEmergencyNumber(trackers[0].mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading src/java/com/android/internal/telephony/metrics/MetricsCollector.java +5 −2 Original line number Diff line number Diff line Loading @@ -1052,7 +1052,8 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback { sms.carrierId, sms.messageId, sms.count, sms.isManagedProfile); sms.isManagedProfile, sms.isNtn); } private static StatsEvent buildStatsEvent(OutgoingSms sms) { Loading @@ -1075,7 +1076,9 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback { sms.count, sms.sendErrorCode, sms.networkErrorCode, sms.isManagedProfile); sms.isManagedProfile, sms.isEmergency, sms.isNtn); } private static StatsEvent buildStatsEvent(DataCallSession dataCallSession) { Loading src/java/com/android/internal/telephony/metrics/SmsStats.java +23 −5 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.PhoneFactory; import com.android.internal.telephony.ServiceStateTracker; import com.android.internal.telephony.flags.Flags; import com.android.internal.telephony.nano.PersistAtomsProto.IncomingSms; import com.android.internal.telephony.nano.PersistAtomsProto.OutgoingShortCodeSms; import com.android.internal.telephony.nano.PersistAtomsProto.OutgoingSms; Loading Loading @@ -157,18 +158,18 @@ public class SmsStats { /** Create a new atom when an outgoing SMS is sent. */ public void onOutgoingSms(boolean isOverIms, boolean is3gpp2, boolean fallbackToCs, @SmsManager.Result int sendErrorCode, long messageId, boolean isFromDefaultApp, long intervalMillis) { long intervalMillis, boolean isEmergency) { onOutgoingSms(isOverIms, is3gpp2, fallbackToCs, sendErrorCode, NO_ERROR_CODE, messageId, isFromDefaultApp, intervalMillis); messageId, isFromDefaultApp, intervalMillis, isEmergency); } /** Create a new atom when an outgoing SMS is sent. */ public void onOutgoingSms(boolean isOverIms, boolean is3gpp2, boolean fallbackToCs, @SmsManager.Result int sendErrorCode, int networkErrorCode, long messageId, boolean isFromDefaultApp, long intervalMillis) { boolean isFromDefaultApp, long intervalMillis, boolean isEmergency) { OutgoingSms proto = getOutgoingDefaultProto(is3gpp2, isOverIms, messageId, isFromDefaultApp, intervalMillis); intervalMillis, isEmergency); // The field errorCode is used for up-to-Android-13 devices. From Android 14, sendErrorCode // and networkErrorCode will be used. The field errorCode will be deprecated when most Loading Loading @@ -234,12 +235,13 @@ public class SmsStats { proto.messageId = RANDOM.nextLong(); proto.count = 1; proto.isManagedProfile = mPhone.isManagedProfile(); proto.isNtn = isNonTerrestrialNetwork(); return proto; } /** Create a proto for a normal {@code OutgoingSms} with default values. */ private OutgoingSms getOutgoingDefaultProto(boolean is3gpp2, boolean isOverIms, long messageId, boolean isFromDefaultApp, long intervalMillis) { long messageId, boolean isFromDefaultApp, long intervalMillis, boolean isEmergency) { OutgoingSms proto = new OutgoingSms(); proto.smsFormat = getSmsFormat(is3gpp2); proto.smsTech = getSmsTech(isOverIms, is3gpp2); Loading @@ -260,6 +262,8 @@ public class SmsStats { proto.intervalMillis = intervalMillis; proto.count = 1; proto.isManagedProfile = mPhone.isManagedProfile(); proto.isEmergency = isEmergency; proto.isNtn = isNonTerrestrialNetwork(); return proto; } Loading Loading @@ -397,6 +401,20 @@ public class SmsStats { return phone.getCarrierId(); } private boolean isNonTerrestrialNetwork() { if (!Flags.carrierEnabledSatelliteFlag()) { return false; } ServiceState ss = getServiceState(); if (ss != null) { return ss.isUsingNonTerrestrialNetwork(); } else { Rlog.e(TAG, "isNonTerrestrialNetwork(), ServiceState is null"); return false; } } private void loge(String format, Object... args) { Rlog.e(TAG, "[" + mPhone.getPhoneId() + "]" + String.format(format, args)); } Loading Loading
proto/src/persist_atoms.proto +3 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,7 @@ message IncomingSms { optional int64 message_id = 14; optional int32 count = 15; optional bool is_managed_profile = 16; optional bool is_ntn = 17; // Internal use only optional int32 hashCode = 10001; Loading @@ -334,6 +335,8 @@ message OutgoingSms { optional int32 send_error_code = 16; optional int32 network_error_code = 17; optional bool is_managed_profile = 18; optional bool is_emergency = 19; optional bool is_ntn = 20; // Internal use only optional int32 hashCode = 10001; Loading
src/java/com/android/internal/telephony/ImsSmsDispatcher.java +4 −2 Original line number Diff line number Diff line Loading @@ -247,7 +247,8 @@ public class ImsSmsDispatcher extends SMSDispatcher { networkReasonCode, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -664,7 +665,8 @@ public class ImsSmsDispatcher extends SMSDispatcher { SmsManager.RESULT_SYSTEM_ERROR, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading
src/java/com/android/internal/telephony/SMSDispatcher.java +10 −5 Original line number Diff line number Diff line Loading @@ -1063,7 +1063,8 @@ public abstract class SMSDispatcher extends Handler { SmsManager.RESULT_ERROR_NONE, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -1113,7 +1114,8 @@ public abstract class SMSDispatcher extends Handler { getNotInServiceError(ss), tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -1149,7 +1151,8 @@ public abstract class SMSDispatcher extends Handler { errorCode, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading @@ -1175,7 +1178,8 @@ public abstract class SMSDispatcher extends Handler { errorCode, tracker.mMessageId, tracker.isFromDefaultSmsApplication(mContext), tracker.getInterval()); tracker.getInterval(), mTelephonyManager.isEmergencyNumber(tracker.mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading Loading @@ -2403,7 +2407,8 @@ public abstract class SMSDispatcher extends Handler { error, trackers[0].mMessageId, trackers[0].isFromDefaultSmsApplication(mContext), trackers[0].getInterval()); trackers[0].getInterval(), mTelephonyManager.isEmergencyNumber(trackers[0].mDestAddress)); if (mPhone != null) { TelephonyAnalytics telephonyAnalytics = mPhone.getTelephonyAnalytics(); if (telephonyAnalytics != null) { Loading
src/java/com/android/internal/telephony/metrics/MetricsCollector.java +5 −2 Original line number Diff line number Diff line Loading @@ -1052,7 +1052,8 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback { sms.carrierId, sms.messageId, sms.count, sms.isManagedProfile); sms.isManagedProfile, sms.isNtn); } private static StatsEvent buildStatsEvent(OutgoingSms sms) { Loading @@ -1075,7 +1076,9 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback { sms.count, sms.sendErrorCode, sms.networkErrorCode, sms.isManagedProfile); sms.isManagedProfile, sms.isEmergency, sms.isNtn); } private static StatsEvent buildStatsEvent(DataCallSession dataCallSession) { Loading
src/java/com/android/internal/telephony/metrics/SmsStats.java +23 −5 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.PhoneFactory; import com.android.internal.telephony.ServiceStateTracker; import com.android.internal.telephony.flags.Flags; import com.android.internal.telephony.nano.PersistAtomsProto.IncomingSms; import com.android.internal.telephony.nano.PersistAtomsProto.OutgoingShortCodeSms; import com.android.internal.telephony.nano.PersistAtomsProto.OutgoingSms; Loading Loading @@ -157,18 +158,18 @@ public class SmsStats { /** Create a new atom when an outgoing SMS is sent. */ public void onOutgoingSms(boolean isOverIms, boolean is3gpp2, boolean fallbackToCs, @SmsManager.Result int sendErrorCode, long messageId, boolean isFromDefaultApp, long intervalMillis) { long intervalMillis, boolean isEmergency) { onOutgoingSms(isOverIms, is3gpp2, fallbackToCs, sendErrorCode, NO_ERROR_CODE, messageId, isFromDefaultApp, intervalMillis); messageId, isFromDefaultApp, intervalMillis, isEmergency); } /** Create a new atom when an outgoing SMS is sent. */ public void onOutgoingSms(boolean isOverIms, boolean is3gpp2, boolean fallbackToCs, @SmsManager.Result int sendErrorCode, int networkErrorCode, long messageId, boolean isFromDefaultApp, long intervalMillis) { boolean isFromDefaultApp, long intervalMillis, boolean isEmergency) { OutgoingSms proto = getOutgoingDefaultProto(is3gpp2, isOverIms, messageId, isFromDefaultApp, intervalMillis); intervalMillis, isEmergency); // The field errorCode is used for up-to-Android-13 devices. From Android 14, sendErrorCode // and networkErrorCode will be used. The field errorCode will be deprecated when most Loading Loading @@ -234,12 +235,13 @@ public class SmsStats { proto.messageId = RANDOM.nextLong(); proto.count = 1; proto.isManagedProfile = mPhone.isManagedProfile(); proto.isNtn = isNonTerrestrialNetwork(); return proto; } /** Create a proto for a normal {@code OutgoingSms} with default values. */ private OutgoingSms getOutgoingDefaultProto(boolean is3gpp2, boolean isOverIms, long messageId, boolean isFromDefaultApp, long intervalMillis) { long messageId, boolean isFromDefaultApp, long intervalMillis, boolean isEmergency) { OutgoingSms proto = new OutgoingSms(); proto.smsFormat = getSmsFormat(is3gpp2); proto.smsTech = getSmsTech(isOverIms, is3gpp2); Loading @@ -260,6 +262,8 @@ public class SmsStats { proto.intervalMillis = intervalMillis; proto.count = 1; proto.isManagedProfile = mPhone.isManagedProfile(); proto.isEmergency = isEmergency; proto.isNtn = isNonTerrestrialNetwork(); return proto; } Loading Loading @@ -397,6 +401,20 @@ public class SmsStats { return phone.getCarrierId(); } private boolean isNonTerrestrialNetwork() { if (!Flags.carrierEnabledSatelliteFlag()) { return false; } ServiceState ss = getServiceState(); if (ss != null) { return ss.isUsingNonTerrestrialNetwork(); } else { Rlog.e(TAG, "isNonTerrestrialNetwork(), ServiceState is null"); return false; } } private void loge(String format, Object... args) { Rlog.e(TAG, "[" + mPhone.getPhoneId() + "]" + String.format(format, args)); } Loading