Loading proto/telecom.proto +21 −1 Original line number Diff line number Diff line Loading @@ -149,6 +149,23 @@ message EventTimingEntry { optional int64 time_millis = 2; } message InCallServiceInfo { // Keep this up-to-date with com.android.server.telecom.InCallController. enum InCallServiceType { IN_CALL_SERVICE_TYPE_INVALID = 0; IN_CALL_SERVICE_TYPE_DIALER_UI = 1; IN_CALL_SERVICE_TYPE_SYSTEM_UI = 2; IN_CALL_SERVICE_TYPE_CAR_MODE_UI = 3; IN_CALL_SERVICE_TYPE_NON_UI = 4; } // The shortened component name of the in-call service. optional string in_call_service_name = 1; // The type of the in-call service optional InCallServiceType in_call_service_type = 2; } // Information about each call. message CallLog { Loading Loading @@ -227,7 +244,7 @@ message CallLog { // A bitmask with bits corresponding to call technologies that were used // during the call. The ones that we will record are CDMA, GSM, IMS, SIP, // and third-party. // https://googleplex-android-review.git.corp.google.com/#/c/816516/6/src/com/android/server/telecom/Analytics.java // See the com.android.server.telecom.Analytics.*_PHONE constants. optional int32 call_technologies = 6; // Indicates the call termination code. Loading @@ -253,4 +270,7 @@ message CallLog { // A list of the video events during the call. repeated VideoEvent video_events = 15; // A list of the in-call services bound during the call. repeated InCallServiceInfo in_call_services = 16; } src/com/android/server/telecom/Analytics.java +31 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,9 @@ public class Analytics { public void addVideoEvent(int eventId, int videoState) { } public void addInCallService(String serviceName, int type) { } } /** Loading Loading @@ -207,6 +210,7 @@ public class Analytics { public boolean isVideo = false; public List<TelecomLogClass.VideoEvent> videoEvents; public List<TelecomLogClass.InCallServiceInfo> inCallServiceInfos; private long mTimeOfLastVideoEvent = -1; CallInfoImpl(String callId, int callDirection) { Loading @@ -217,6 +221,7 @@ public class Analytics { callTechnologies = 0; connectionService = ""; videoEvents = new LinkedList<>(); inCallServiceInfos = new LinkedList<>(); } CallInfoImpl(CallInfoImpl other) { Loading Loading @@ -323,6 +328,13 @@ public class Analytics { .setVideoState(videoState)); } @Override public void addInCallService(String serviceName, int type) { inCallServiceInfos.add(new TelecomLogClass.InCallServiceInfo() .setInCallServiceName(serviceName) .setInCallServiceType(type)); } @Override public String toString() { return "{\n" Loading @@ -335,6 +347,7 @@ public class Analytics { + " callTerminationReason: " + getCallDisconnectReasonString() + '\n' + " connectionService: " + connectionService + '\n' + " isVideoCall: " + isVideo + '\n' + " inCallServices: " + getInCallServicesString() + '\n' + "}\n"; } Loading Loading @@ -413,6 +426,9 @@ public class Analytics { } result.videoEvents = videoEvents.toArray(new TelecomLogClass.VideoEvent[videoEvents.size()]); result.inCallServices = inCallServiceInfos.toArray( new TelecomLogClass.InCallServiceInfo[inCallServiceInfos.size()]); return result; } Loading Loading @@ -448,6 +464,21 @@ public class Analytics { return "NOT SET"; } } private String getInCallServicesString() { StringBuilder s = new StringBuilder(); s.append("[\n"); for (TelecomLogClass.InCallServiceInfo service : inCallServiceInfos) { s.append(" "); s.append("name: "); s.append(service.getInCallServiceName()); s.append(" type: "); s.append(service.getInCallServiceType()); s.append("\n"); } s.append("]"); return s.toString(); } } public static final String TAG = "TelecomAnalytics"; Loading src/com/android/server/telecom/InCallController.java +18 −4 Original line number Diff line number Diff line Loading @@ -79,12 +79,16 @@ public final class InCallController extends CallsManagerListenerBase { } private class InCallServiceInfo { private ComponentName mComponentName; private final ComponentName mComponentName; private boolean mIsExternalCallsSupported; private final int mType; public InCallServiceInfo(ComponentName componentName, boolean isExternalCallsSupported) { public InCallServiceInfo(ComponentName componentName, boolean isExternalCallsSupported, int type) { mComponentName = componentName; mIsExternalCallsSupported = isExternalCallsSupported; mType = type; } public ComponentName getComponentName() { Loading @@ -95,6 +99,10 @@ public final class InCallController extends CallsManagerListenerBase { return mIsExternalCallsSupported; } public int getType() { return mType; } @Override public boolean equals(Object o) { if (this == o) { Loading Loading @@ -192,6 +200,12 @@ public final class InCallController extends CallsManagerListenerBase { mIsConnected = false; } if (call != null && mIsConnected) { call.getAnalytics().addInCallService( mInCallServiceInfo.getComponentName().flattenToShortString(), mInCallServiceInfo.getType()); } return mIsConnected; } Loading Loading @@ -920,7 +934,7 @@ public final class InCallController extends CallsManagerListenerBase { // Last Resort: Try to bind to the ComponentName given directly. Log.e(this, new Exception(), "Package Manager could not find ComponentName: " + componentName +". Trying to bind anyway."); return new InCallServiceInfo(componentName, false); return new InCallServiceInfo(componentName, false, type); } } Loading Loading @@ -974,7 +988,7 @@ public final class InCallController extends CallsManagerListenerBase { retval.add(new InCallServiceInfo( new ComponentName(serviceInfo.packageName, serviceInfo.name), isExternalCallsSupported)); isExternalCallsSupported, requestedType)); } } } Loading Loading
proto/telecom.proto +21 −1 Original line number Diff line number Diff line Loading @@ -149,6 +149,23 @@ message EventTimingEntry { optional int64 time_millis = 2; } message InCallServiceInfo { // Keep this up-to-date with com.android.server.telecom.InCallController. enum InCallServiceType { IN_CALL_SERVICE_TYPE_INVALID = 0; IN_CALL_SERVICE_TYPE_DIALER_UI = 1; IN_CALL_SERVICE_TYPE_SYSTEM_UI = 2; IN_CALL_SERVICE_TYPE_CAR_MODE_UI = 3; IN_CALL_SERVICE_TYPE_NON_UI = 4; } // The shortened component name of the in-call service. optional string in_call_service_name = 1; // The type of the in-call service optional InCallServiceType in_call_service_type = 2; } // Information about each call. message CallLog { Loading Loading @@ -227,7 +244,7 @@ message CallLog { // A bitmask with bits corresponding to call technologies that were used // during the call. The ones that we will record are CDMA, GSM, IMS, SIP, // and third-party. // https://googleplex-android-review.git.corp.google.com/#/c/816516/6/src/com/android/server/telecom/Analytics.java // See the com.android.server.telecom.Analytics.*_PHONE constants. optional int32 call_technologies = 6; // Indicates the call termination code. Loading @@ -253,4 +270,7 @@ message CallLog { // A list of the video events during the call. repeated VideoEvent video_events = 15; // A list of the in-call services bound during the call. repeated InCallServiceInfo in_call_services = 16; }
src/com/android/server/telecom/Analytics.java +31 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,9 @@ public class Analytics { public void addVideoEvent(int eventId, int videoState) { } public void addInCallService(String serviceName, int type) { } } /** Loading Loading @@ -207,6 +210,7 @@ public class Analytics { public boolean isVideo = false; public List<TelecomLogClass.VideoEvent> videoEvents; public List<TelecomLogClass.InCallServiceInfo> inCallServiceInfos; private long mTimeOfLastVideoEvent = -1; CallInfoImpl(String callId, int callDirection) { Loading @@ -217,6 +221,7 @@ public class Analytics { callTechnologies = 0; connectionService = ""; videoEvents = new LinkedList<>(); inCallServiceInfos = new LinkedList<>(); } CallInfoImpl(CallInfoImpl other) { Loading Loading @@ -323,6 +328,13 @@ public class Analytics { .setVideoState(videoState)); } @Override public void addInCallService(String serviceName, int type) { inCallServiceInfos.add(new TelecomLogClass.InCallServiceInfo() .setInCallServiceName(serviceName) .setInCallServiceType(type)); } @Override public String toString() { return "{\n" Loading @@ -335,6 +347,7 @@ public class Analytics { + " callTerminationReason: " + getCallDisconnectReasonString() + '\n' + " connectionService: " + connectionService + '\n' + " isVideoCall: " + isVideo + '\n' + " inCallServices: " + getInCallServicesString() + '\n' + "}\n"; } Loading Loading @@ -413,6 +426,9 @@ public class Analytics { } result.videoEvents = videoEvents.toArray(new TelecomLogClass.VideoEvent[videoEvents.size()]); result.inCallServices = inCallServiceInfos.toArray( new TelecomLogClass.InCallServiceInfo[inCallServiceInfos.size()]); return result; } Loading Loading @@ -448,6 +464,21 @@ public class Analytics { return "NOT SET"; } } private String getInCallServicesString() { StringBuilder s = new StringBuilder(); s.append("[\n"); for (TelecomLogClass.InCallServiceInfo service : inCallServiceInfos) { s.append(" "); s.append("name: "); s.append(service.getInCallServiceName()); s.append(" type: "); s.append(service.getInCallServiceType()); s.append("\n"); } s.append("]"); return s.toString(); } } public static final String TAG = "TelecomAnalytics"; Loading
src/com/android/server/telecom/InCallController.java +18 −4 Original line number Diff line number Diff line Loading @@ -79,12 +79,16 @@ public final class InCallController extends CallsManagerListenerBase { } private class InCallServiceInfo { private ComponentName mComponentName; private final ComponentName mComponentName; private boolean mIsExternalCallsSupported; private final int mType; public InCallServiceInfo(ComponentName componentName, boolean isExternalCallsSupported) { public InCallServiceInfo(ComponentName componentName, boolean isExternalCallsSupported, int type) { mComponentName = componentName; mIsExternalCallsSupported = isExternalCallsSupported; mType = type; } public ComponentName getComponentName() { Loading @@ -95,6 +99,10 @@ public final class InCallController extends CallsManagerListenerBase { return mIsExternalCallsSupported; } public int getType() { return mType; } @Override public boolean equals(Object o) { if (this == o) { Loading Loading @@ -192,6 +200,12 @@ public final class InCallController extends CallsManagerListenerBase { mIsConnected = false; } if (call != null && mIsConnected) { call.getAnalytics().addInCallService( mInCallServiceInfo.getComponentName().flattenToShortString(), mInCallServiceInfo.getType()); } return mIsConnected; } Loading Loading @@ -920,7 +934,7 @@ public final class InCallController extends CallsManagerListenerBase { // Last Resort: Try to bind to the ComponentName given directly. Log.e(this, new Exception(), "Package Manager could not find ComponentName: " + componentName +". Trying to bind anyway."); return new InCallServiceInfo(componentName, false); return new InCallServiceInfo(componentName, false, type); } } Loading Loading @@ -974,7 +988,7 @@ public final class InCallController extends CallsManagerListenerBase { retval.add(new InCallServiceInfo( new ComponentName(serviceInfo.packageName, serviceInfo.name), isExternalCallsSupported)); isExternalCallsSupported, requestedType)); } } } Loading