Loading proto/telecom.proto +16 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ message EventTimingEntry { BLOCK_CHECK_FINISHED_TIMING = 9; FILTERING_COMPLETED_TIMING = 10; FILTERING_TIMED_OUT_TIMING = 11; START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING = 12; } // The name of the event timing. Loading Loading @@ -230,6 +231,18 @@ message CallLog { CONNECTION_MANAGER_NOT_SUPPORTED = 10; } // The source where user initiated this call. enum CallSource { // Call source is not specified. CALL_SOURCE_UNSPECIFIED = 0; // Dialpad at emergency dialer. CALL_SOURCE_EMERGENCY_DIALPAD = 1; // Shortcut button at emergency dialer. CALL_SOURCE_EMERGENCY_SHORTCUT = 2; } // Start time of the connection. // Rounded to the nearest 5 minute interval. optional int64 start_time_5min = 1; Loading Loading @@ -283,4 +296,7 @@ message CallLog { // A bitmask of the properties that were set at any point during the call. // Bits are defined by android.telecom.Connection.PROPERTY_* constants. optional int32 connection_properties = 17; // Call source. optional CallSource call_source = 18; } src/com/android/server/telecom/Analytics.java +39 −1 Original line number Diff line number Diff line Loading @@ -141,6 +141,9 @@ public class Analytics { ParcelableCallAnalytics.EventTiming.FILTERING_COMPLETED_TIMING); put(LogUtils.Events.Timings.FILTERING_TIMED_OUT_TIMING, ParcelableCallAnalytics.EventTiming.FILTERING_TIMED_OUT_TIMING); put(LogUtils.Events.Timings.START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING, ParcelableCallAnalytics.EventTiming. START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING); }}; public static final Map<Integer, String> sSessionIdToLogSession = new HashMap<>(); Loading Loading @@ -192,6 +195,9 @@ public class Analytics { public void addCallProperties(int properties) { } public void setCallSource(int callSource) { } } /** Loading Loading @@ -225,6 +231,7 @@ public class Analytics { public List<TelecomLogClass.VideoEvent> videoEvents; public List<TelecomLogClass.InCallServiceInfo> inCallServiceInfos; public int callProperties = 0; public int callSource = CALL_SOURCE_UNSPECIFIED; private long mTimeOfLastVideoEvent = -1; Loading Loading @@ -254,6 +261,7 @@ public class Analytics { this.isVideo = other.isVideo; this.videoEvents = other.videoEvents; this.callProperties = other.callProperties; this.callSource = other.callSource; if (other.callTerminationReason != null) { this.callTerminationReason = new DisconnectCause( Loading Loading @@ -362,6 +370,11 @@ public class Analytics { this.callProperties |= properties; } @Override public void setCallSource(int callSource) { this.callSource = callSource; } @Override public String toString() { return "{\n" Loading @@ -378,6 +391,7 @@ public class Analytics { + " inCallServices: " + getInCallServicesString() + '\n' + " callProperties: " + Connection.propertiesToStringShort(callProperties) + '\n' + " callSource: " + getCallSourceString() + '\n' + "}\n"; } Loading Loading @@ -420,6 +434,8 @@ public class Analytics { videoEventProto.getVideoState()) ).collect(Collectors.toList())); result.setCallSource(analyticsProto.getCallSource()); return result; } Loading @@ -446,7 +462,8 @@ public class Analytics { .setIsCreatedFromExistingConnection(createdFromExistingConnection) .setIsEmergencyCall(isEmergency) .setIsVideoCall(isVideo) .setConnectionProperties(callProperties); .setConnectionProperties(callProperties) .setCallSource(callSource); result.connectionService = new String[] {connectionService}; if (callEvents != null) { Loading Loading @@ -510,6 +527,19 @@ public class Analytics { s.append("]"); return s.toString(); } private String getCallSourceString() { switch (callSource) { case CALL_SOURCE_UNSPECIFIED: return "UNSPECIFIED"; case CALL_SOURCE_EMERGENCY_DIALPAD: return "EMERGENCY_DIALPAD"; case CALL_SOURCE_EMERGENCY_SHORTCUT: return "EMERGENCY_SHORTCUT"; default: return "UNSPECIFIED"; } } } public static final String TAG = "TelecomAnalytics"; Loading @@ -525,6 +555,14 @@ public class Analytics { public static final int SIP_PHONE = ParcelableCallAnalytics.SIP_PHONE; public static final int THIRD_PARTY_PHONE = ParcelableCallAnalytics.THIRD_PARTY_PHONE; // Constants for call source public static final int CALL_SOURCE_UNSPECIFIED = ParcelableCallAnalytics.CALL_SOURCE_UNSPECIFIED; public static final int CALL_SOURCE_EMERGENCY_DIALPAD = ParcelableCallAnalytics.CALL_SOURCE_EMERGENCY_DIALPAD; public static final int CALL_SOURCE_EMERGENCY_SHORTCUT = ParcelableCallAnalytics.CALL_SOURCE_EMERGENCY_SHORTCUT; // Constants for video events public static final int SEND_LOCAL_SESSION_MODIFY_REQUEST = ParcelableCallAnalytics.VideoEvent.SEND_LOCAL_SESSION_MODIFY_REQUEST; Loading src/com/android/server/telecom/CallsManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -1292,6 +1292,7 @@ public class CallsManager extends Call.ListenerBase } } setIntentExtrasAndStartTime(call, extras); setCallSourceToAnalytics(call, originalIntent); if ((isPotentialMMICode(handle) || isPotentialInCallMMICode) && !needsAccountSelection) { // Do not add the call if it is a potential MMI code. Loading Loading @@ -3481,6 +3482,18 @@ public class CallsManager extends Call.ListenerBase call.setIntentExtras(extras); } private void setCallSourceToAnalytics(Call call, Intent originalIntent) { if (originalIntent == null) { return; } int callSource = originalIntent.getIntExtra(TelecomManager.EXTRA_CALL_SOURCE, Analytics.CALL_SOURCE_UNSPECIFIED); // Call source is only used by metrics, so we simply set it to Analytics directly. call.getAnalytics().setCallSource(callSource); } /** * Notifies the {@link android.telecom.ConnectionService} associated with a * {@link PhoneAccountHandle} that the attempt to create a new connection has failed. Loading src/com/android/server/telecom/LogUtils.java +4 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ public class LogUtils { public static final String BLOCK_CHECK_FINISHED_TIMING = "block_check_finished"; public static final String FILTERING_COMPLETED_TIMING = "filtering_completed"; public static final String FILTERING_TIMED_OUT_TIMING = "filtering_timed_out"; public static final String START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING = "start_connection_to_request_disconnect"; private static final TimedEventPair[] sTimedEvents = { new TimedEventPair(REQUEST_ACCEPT, SET_ACTIVE, ACCEPT_TIMING), Loading @@ -171,6 +173,8 @@ public class LogUtils { FILTERING_COMPLETED_TIMING), new TimedEventPair(FILTERING_INITIATED, FILTERING_TIMED_OUT, FILTERING_TIMED_OUT_TIMING, 6000L), new TimedEventPair(START_CONNECTION, REQUEST_DISCONNECT, START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING), }; } } Loading Loading
proto/telecom.proto +16 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ message EventTimingEntry { BLOCK_CHECK_FINISHED_TIMING = 9; FILTERING_COMPLETED_TIMING = 10; FILTERING_TIMED_OUT_TIMING = 11; START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING = 12; } // The name of the event timing. Loading Loading @@ -230,6 +231,18 @@ message CallLog { CONNECTION_MANAGER_NOT_SUPPORTED = 10; } // The source where user initiated this call. enum CallSource { // Call source is not specified. CALL_SOURCE_UNSPECIFIED = 0; // Dialpad at emergency dialer. CALL_SOURCE_EMERGENCY_DIALPAD = 1; // Shortcut button at emergency dialer. CALL_SOURCE_EMERGENCY_SHORTCUT = 2; } // Start time of the connection. // Rounded to the nearest 5 minute interval. optional int64 start_time_5min = 1; Loading Loading @@ -283,4 +296,7 @@ message CallLog { // A bitmask of the properties that were set at any point during the call. // Bits are defined by android.telecom.Connection.PROPERTY_* constants. optional int32 connection_properties = 17; // Call source. optional CallSource call_source = 18; }
src/com/android/server/telecom/Analytics.java +39 −1 Original line number Diff line number Diff line Loading @@ -141,6 +141,9 @@ public class Analytics { ParcelableCallAnalytics.EventTiming.FILTERING_COMPLETED_TIMING); put(LogUtils.Events.Timings.FILTERING_TIMED_OUT_TIMING, ParcelableCallAnalytics.EventTiming.FILTERING_TIMED_OUT_TIMING); put(LogUtils.Events.Timings.START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING, ParcelableCallAnalytics.EventTiming. START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING); }}; public static final Map<Integer, String> sSessionIdToLogSession = new HashMap<>(); Loading Loading @@ -192,6 +195,9 @@ public class Analytics { public void addCallProperties(int properties) { } public void setCallSource(int callSource) { } } /** Loading Loading @@ -225,6 +231,7 @@ public class Analytics { public List<TelecomLogClass.VideoEvent> videoEvents; public List<TelecomLogClass.InCallServiceInfo> inCallServiceInfos; public int callProperties = 0; public int callSource = CALL_SOURCE_UNSPECIFIED; private long mTimeOfLastVideoEvent = -1; Loading Loading @@ -254,6 +261,7 @@ public class Analytics { this.isVideo = other.isVideo; this.videoEvents = other.videoEvents; this.callProperties = other.callProperties; this.callSource = other.callSource; if (other.callTerminationReason != null) { this.callTerminationReason = new DisconnectCause( Loading Loading @@ -362,6 +370,11 @@ public class Analytics { this.callProperties |= properties; } @Override public void setCallSource(int callSource) { this.callSource = callSource; } @Override public String toString() { return "{\n" Loading @@ -378,6 +391,7 @@ public class Analytics { + " inCallServices: " + getInCallServicesString() + '\n' + " callProperties: " + Connection.propertiesToStringShort(callProperties) + '\n' + " callSource: " + getCallSourceString() + '\n' + "}\n"; } Loading Loading @@ -420,6 +434,8 @@ public class Analytics { videoEventProto.getVideoState()) ).collect(Collectors.toList())); result.setCallSource(analyticsProto.getCallSource()); return result; } Loading @@ -446,7 +462,8 @@ public class Analytics { .setIsCreatedFromExistingConnection(createdFromExistingConnection) .setIsEmergencyCall(isEmergency) .setIsVideoCall(isVideo) .setConnectionProperties(callProperties); .setConnectionProperties(callProperties) .setCallSource(callSource); result.connectionService = new String[] {connectionService}; if (callEvents != null) { Loading Loading @@ -510,6 +527,19 @@ public class Analytics { s.append("]"); return s.toString(); } private String getCallSourceString() { switch (callSource) { case CALL_SOURCE_UNSPECIFIED: return "UNSPECIFIED"; case CALL_SOURCE_EMERGENCY_DIALPAD: return "EMERGENCY_DIALPAD"; case CALL_SOURCE_EMERGENCY_SHORTCUT: return "EMERGENCY_SHORTCUT"; default: return "UNSPECIFIED"; } } } public static final String TAG = "TelecomAnalytics"; Loading @@ -525,6 +555,14 @@ public class Analytics { public static final int SIP_PHONE = ParcelableCallAnalytics.SIP_PHONE; public static final int THIRD_PARTY_PHONE = ParcelableCallAnalytics.THIRD_PARTY_PHONE; // Constants for call source public static final int CALL_SOURCE_UNSPECIFIED = ParcelableCallAnalytics.CALL_SOURCE_UNSPECIFIED; public static final int CALL_SOURCE_EMERGENCY_DIALPAD = ParcelableCallAnalytics.CALL_SOURCE_EMERGENCY_DIALPAD; public static final int CALL_SOURCE_EMERGENCY_SHORTCUT = ParcelableCallAnalytics.CALL_SOURCE_EMERGENCY_SHORTCUT; // Constants for video events public static final int SEND_LOCAL_SESSION_MODIFY_REQUEST = ParcelableCallAnalytics.VideoEvent.SEND_LOCAL_SESSION_MODIFY_REQUEST; Loading
src/com/android/server/telecom/CallsManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -1292,6 +1292,7 @@ public class CallsManager extends Call.ListenerBase } } setIntentExtrasAndStartTime(call, extras); setCallSourceToAnalytics(call, originalIntent); if ((isPotentialMMICode(handle) || isPotentialInCallMMICode) && !needsAccountSelection) { // Do not add the call if it is a potential MMI code. Loading Loading @@ -3481,6 +3482,18 @@ public class CallsManager extends Call.ListenerBase call.setIntentExtras(extras); } private void setCallSourceToAnalytics(Call call, Intent originalIntent) { if (originalIntent == null) { return; } int callSource = originalIntent.getIntExtra(TelecomManager.EXTRA_CALL_SOURCE, Analytics.CALL_SOURCE_UNSPECIFIED); // Call source is only used by metrics, so we simply set it to Analytics directly. call.getAnalytics().setCallSource(callSource); } /** * Notifies the {@link android.telecom.ConnectionService} associated with a * {@link PhoneAccountHandle} that the attempt to create a new connection has failed. Loading
src/com/android/server/telecom/LogUtils.java +4 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ public class LogUtils { public static final String BLOCK_CHECK_FINISHED_TIMING = "block_check_finished"; public static final String FILTERING_COMPLETED_TIMING = "filtering_completed"; public static final String FILTERING_TIMED_OUT_TIMING = "filtering_timed_out"; public static final String START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING = "start_connection_to_request_disconnect"; private static final TimedEventPair[] sTimedEvents = { new TimedEventPair(REQUEST_ACCEPT, SET_ACTIVE, ACCEPT_TIMING), Loading @@ -171,6 +173,8 @@ public class LogUtils { FILTERING_COMPLETED_TIMING), new TimedEventPair(FILTERING_INITIATED, FILTERING_TIMED_OUT, FILTERING_TIMED_OUT_TIMING, 6000L), new TimedEventPair(START_CONNECTION, REQUEST_DISCONNECT, START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING), }; } } Loading