Track conference start in system elapsed time.
This is important so that Telecom can track the duration of the call, which is tracked using wall clock time. Test: Manual, unit test Bug: 64068300 Change-Id: If642d282cd8134060acf6ffe8d81215c394d800c
This commit is contained in:
@@ -20,7 +20,6 @@ import com.android.internal.os.SomeArgs;
|
||||
import com.android.internal.telecom.IVideoCallback;
|
||||
import com.android.internal.telecom.IVideoProvider;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
@@ -37,14 +36,13 @@ import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SystemClock;
|
||||
import android.util.ArraySet;
|
||||
import android.view.Surface;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -1696,6 +1694,7 @@ public abstract class Connection extends Conferenceable {
|
||||
private VideoProvider mVideoProvider;
|
||||
private boolean mAudioModeIsVoip;
|
||||
private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
||||
private long mConnectElapsedTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
||||
private StatusHints mStatusHints;
|
||||
private int mVideoState;
|
||||
private DisconnectCause mDisconnectCause;
|
||||
@@ -1839,6 +1838,22 @@ public abstract class Connection extends Conferenceable {
|
||||
return mConnectTimeMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the connection start time of the {@link Connection}, if specified. A value of
|
||||
* {@link Conference#CONNECT_TIME_NOT_SPECIFIED} indicates that Telecom should determine the
|
||||
* start time of the conference.
|
||||
*
|
||||
* Based on the value of {@link SystemClock#elapsedRealtime()}, which ensures that wall-clock
|
||||
* changes do not impact the call duration.
|
||||
*
|
||||
* @return The time at which the {@link Connection} was connected.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public final long getConnectElapsedTimeMillis() {
|
||||
return mConnectElapsedTimeMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The status hints for this connection.
|
||||
*/
|
||||
@@ -2250,7 +2265,8 @@ public abstract class Connection extends Conferenceable {
|
||||
* Sets the time at which a call became active on this Connection. This is set only
|
||||
* when a conference call becomes active on this connection.
|
||||
*
|
||||
* @param connectionTimeMillis The connection time, in milliseconds.
|
||||
* @param connectTimeMillis The connection time, in milliseconds. Should be set using a value
|
||||
* obtained from {@link System#currentTimeMillis()}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@@ -2258,6 +2274,19 @@ public abstract class Connection extends Conferenceable {
|
||||
mConnectTimeMillis = connectTimeMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the time at which a call became active on this Connection. This is set only
|
||||
* when a conference call becomes active on this connection.
|
||||
*
|
||||
* @param connectElapsedTimeMillis The connection time, in milliseconds. Stored in the format
|
||||
* {@link SystemClock#elapsedRealtime()}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public final void setConnectElapsedTimeMillis(long connectElapsedTimeMillis) {
|
||||
mConnectElapsedTimeMillis = connectElapsedTimeMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the label and icon status to display in the in-call UI.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user