diff options
author | Shaotang Li <shaotangli@google.com> | 2018-07-19 17:29:39 +0800 |
---|---|---|
committer | Shaotang Li <shaotangli@google.com> | 2018-09-06 12:38:18 +0800 |
commit | 8cec25c3464d38a7c706171d23a7e64c470f51e7 (patch) | |
tree | 1b35e11e9ba97391df9c623c762b1e5182098518 /telecomm/java/android/telecom/ParcelableCallAnalytics.java | |
parent | 460a52947192febdf99f37cb761710a46c63fd46 (diff) |
Add new telecom metrics for emergency dialer
These includes,
1. The source where user initiated the call.
2. The duration between START_CONNECTION and REQUEST_DISCONNECT.
Bug: 111818008
Test: manual and check the result of
'adb shell dumpsys telecom' for metrics data
Change-Id: Iddc7f256362abe9fe252bd12cead05a7d77d329e
Diffstat (limited to 'telecomm/java/android/telecom/ParcelableCallAnalytics.java')
-rw-r--r-- | telecomm/java/android/telecom/ParcelableCallAnalytics.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/ParcelableCallAnalytics.java b/telecomm/java/android/telecom/ParcelableCallAnalytics.java index 383d10baeb12..bb066ad428c6 100644 --- a/telecomm/java/android/telecom/ParcelableCallAnalytics.java +++ b/telecomm/java/android/telecom/ParcelableCallAnalytics.java @@ -195,6 +195,8 @@ public class ParcelableCallAnalytics implements Parcelable { public static final int BLOCK_CHECK_FINISHED_TIMING = 9; public static final int FILTERING_COMPLETED_TIMING = 10; public static final int FILTERING_TIMED_OUT_TIMING = 11; + /** {@hide} */ + public static final int START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING = 12; public static final int INVALID = 999999; @@ -256,6 +258,27 @@ public class ParcelableCallAnalytics implements Parcelable { public static final int SIP_PHONE = 0x8; public static final int THIRD_PARTY_PHONE = 0x10; + /** + * Indicating the call source is not specified. + * + * @hide + */ + public static final int CALL_SOURCE_UNSPECIFIED = 0; + + /** + * Indicating the call is initiated via emergency dialer's dialpad. + * + * @hide + */ + public static final int CALL_SOURCE_EMERGENCY_DIALPAD = 1; + + /** + * Indicating the call is initiated via emergency dialer's shortcut button. + * + * @hide + */ + public static final int CALL_SOURCE_EMERGENCY_SHORTCUT = 2; + public static final long MILLIS_IN_5_MINUTES = 1000 * 60 * 5; public static final long MILLIS_IN_1_SECOND = 1000; @@ -319,6 +342,9 @@ public class ParcelableCallAnalytics implements Parcelable { // A list of video events that have occurred. private List<VideoEvent> videoEvents; + // The source where user initiated this call. ONE OF the CALL_SOURCE_* constants. + private int callSource = CALL_SOURCE_UNSPECIFIED; + public ParcelableCallAnalytics(long startTimeMillis, long callDurationMillis, int callType, boolean isAdditionalCall, boolean isInterrupted, int callTechnologies, int callTerminationCode, boolean isEmergencyCall, String connectionService, @@ -356,6 +382,7 @@ public class ParcelableCallAnalytics implements Parcelable { isVideoCall = readByteAsBoolean(in); videoEvents = new LinkedList<>(); in.readTypedList(videoEvents, VideoEvent.CREATOR); + callSource = in.readInt(); } public void writeToParcel(Parcel out, int flags) { @@ -373,6 +400,7 @@ public class ParcelableCallAnalytics implements Parcelable { out.writeTypedList(eventTimings); writeBooleanAsByte(out, isVideoCall); out.writeTypedList(videoEvents); + out.writeInt(callSource); } /** {@hide} */ @@ -385,6 +413,11 @@ public class ParcelableCallAnalytics implements Parcelable { this.videoEvents = videoEvents; } + /** {@hide} */ + public void setCallSource(int callSource) { + this.callSource = callSource; + } + public long getStartTimeMillis() { return startTimeMillis; } @@ -443,6 +476,11 @@ public class ParcelableCallAnalytics implements Parcelable { return videoEvents; } + /** {@hide} */ + public int getCallSource() { + return callSource; + } + @Override public int describeContents() { return 0; |