am a27523e3: Merge "Fix for call timer resetting when starting IMS conference call. 1/4" into lmp-mr1-dev
* commit 'a27523e3e0fd6c6cab18255151f2f9ec9a72f3d6': Fix for call timer resetting when starting IMS conference call. 1/4
This commit is contained in:
@@ -32,6 +32,12 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@SystemApi
|
||||
public abstract class Conference implements IConferenceable {
|
||||
|
||||
/**
|
||||
* Used to indicate that the conference connection time is not specified. If not specified,
|
||||
* Telecom will set the connect time.
|
||||
*/
|
||||
public static long CONNECT_TIME_NOT_SPECIFIED = 0;
|
||||
|
||||
/** @hide */
|
||||
public abstract static class Listener {
|
||||
public void onStateChanged(Conference conference, int oldState, int newState) {}
|
||||
@@ -59,6 +65,7 @@ public abstract class Conference implements IConferenceable {
|
||||
private DisconnectCause mDisconnectCause;
|
||||
private int mConnectionCapabilities;
|
||||
private String mDisconnectMessage;
|
||||
private long mConnectTimeMillis = CONNECT_TIME_NOT_SPECIFIED;
|
||||
|
||||
private final Connection.Listener mConnectionDeathListener = new Connection.Listener() {
|
||||
@Override
|
||||
@@ -421,6 +428,26 @@ public abstract class Conference implements IConferenceable {
|
||||
return mUnmodifiableChildConnections.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the connect time of the {@code Conference}.
|
||||
*
|
||||
* @param connectTimeMillis The connection time, in milliseconds.
|
||||
*/
|
||||
public void setConnectTimeMillis(long connectTimeMillis) {
|
||||
mConnectTimeMillis = connectTimeMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the connect time of the {@code Conference}, if specified. A value of
|
||||
* {@link #CONNECT_TIME_NOT_SPECIFIED} indicates that Telecom should determine the start time
|
||||
* of the conference.
|
||||
*
|
||||
* @return The time the {@code Conference} has been connected.
|
||||
*/
|
||||
public long getConnectTimeMillis() {
|
||||
return mConnectTimeMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform this Conference that the state of its audio output has been changed externally.
|
||||
*
|
||||
|
||||
@@ -883,7 +883,8 @@ public abstract class ConnectionService extends Service {
|
||||
conference.getPhoneAccountHandle(),
|
||||
conference.getState(),
|
||||
conference.getConnectionCapabilities(),
|
||||
connectionIds);
|
||||
connectionIds,
|
||||
conference.getConnectTimeMillis());
|
||||
mAdapter.addConferenceCall(id, parcelableConference);
|
||||
|
||||
// Go through any child calls and set the parent.
|
||||
|
||||
@@ -32,6 +32,7 @@ public final class ParcelableConference implements Parcelable {
|
||||
private int mState;
|
||||
private int mConnectionCapabilities;
|
||||
private List<String> mConnectionIds;
|
||||
private long mConnectTimeMillis;
|
||||
|
||||
public ParcelableConference(
|
||||
PhoneAccountHandle phoneAccount,
|
||||
@@ -42,6 +43,17 @@ public final class ParcelableConference implements Parcelable {
|
||||
mState = state;
|
||||
mConnectionCapabilities = connectionCapabilities;
|
||||
mConnectionIds = connectionIds;
|
||||
mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
||||
}
|
||||
|
||||
public ParcelableConference(
|
||||
PhoneAccountHandle phoneAccount,
|
||||
int state,
|
||||
int connectionCapabilities,
|
||||
List<String> connectionIds,
|
||||
long connectTimeMillis) {
|
||||
this(phoneAccount, state, connectionCapabilities, connectionIds);
|
||||
mConnectTimeMillis = connectTimeMillis;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,6 +65,8 @@ public final class ParcelableConference implements Parcelable {
|
||||
.append(Connection.stateToString(mState))
|
||||
.append(", capabilities: ")
|
||||
.append(Connection.capabilitiesToString(mConnectionCapabilities))
|
||||
.append(", connectTime: ")
|
||||
.append(mConnectTimeMillis)
|
||||
.append(", children: ")
|
||||
.append(mConnectionIds)
|
||||
.toString();
|
||||
@@ -74,6 +88,10 @@ public final class ParcelableConference implements Parcelable {
|
||||
return mConnectionIds;
|
||||
}
|
||||
|
||||
public long getConnectTimeMillis() {
|
||||
return mConnectTimeMillis;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<ParcelableConference> CREATOR =
|
||||
new Parcelable.Creator<ParcelableConference> () {
|
||||
@Override
|
||||
@@ -84,8 +102,10 @@ public final class ParcelableConference implements Parcelable {
|
||||
int capabilities = source.readInt();
|
||||
List<String> connectionIds = new ArrayList<>(2);
|
||||
source.readList(connectionIds, classLoader);
|
||||
long connectTimeMillis = source.readLong();
|
||||
|
||||
return new ParcelableConference(phoneAccount, state, capabilities, connectionIds);
|
||||
return new ParcelableConference(phoneAccount, state, capabilities, connectionIds,
|
||||
connectTimeMillis);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,5 +127,6 @@ public final class ParcelableConference implements Parcelable {
|
||||
destination.writeInt(mState);
|
||||
destination.writeInt(mConnectionCapabilities);
|
||||
destination.writeList(mConnectionIds);
|
||||
destination.writeLong(mConnectTimeMillis);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user