Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28d138a6 authored by Shaotang Li's avatar Shaotang Li Committed by android-build-merger
Browse files

Merge "Add new telecom metrics for emergency dialer"

am: 0dcc53fd

Change-Id: I0a1537c8dbd6723614869e6bfcd95292ac603872
parents 160adaab 0dcc53fd
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -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;
+12 −0
Original line number Diff line number Diff line
@@ -621,6 +621,18 @@ public class TelecomManager {
    public static final String EXTRA_USE_ASSISTED_DIALING =
            "android.telecom.extra.USE_ASSISTED_DIALING";

    /**
     * Optional extra for {@link #placeCall(Uri, Bundle)} containing an integer that specifies
     * the source where user initiated this call. This data is used in metrics.
     * Valid source are:
     * {@link ParcelableCallAnalytics#CALL_SOURCE_UNSPECIFIED},
     * {@link ParcelableCallAnalytics#CALL_SOURCE_EMERGENCY_DIALPAD},
     * {@link ParcelableCallAnalytics#CALL_SOURCE_EMERGENCY_SHORTCUT}.
     *
     * @hide
     */
    public static final String EXTRA_CALL_SOURCE = "android.telecom.extra.CALL_SOURCE";

    /**
     * The following 4 constants define how properties such as phone numbers and names are
     * displayed to the user.