Add connection properties to Connections.
- Per suggestion of API council, moving properties of a Connection from CAPABILITIES_* to PROPERTIES_*. Bug: 27458894 Change-Id: Icce921b03cda514a991646ed39a26559c7e91230
This commit is contained in:
@@ -89,6 +89,17 @@ public final class RemoteConnection {
|
||||
RemoteConnection connection,
|
||||
int connectionCapabilities) {}
|
||||
|
||||
/**
|
||||
* Indicates that the call properties of this {@code RemoteConnection} have changed.
|
||||
* See {@link #getConnectionProperties()}.
|
||||
*
|
||||
* @param connection The {@code RemoteConnection} invoking this method.
|
||||
* @param connectionProperties The new properties of the {@code RemoteConnection}.
|
||||
*/
|
||||
public void onConnectionPropertiesChanged(
|
||||
RemoteConnection connection,
|
||||
int connectionProperties) {}
|
||||
|
||||
/**
|
||||
* Invoked when the post-dial sequence in the outgoing {@code Connection} has reached a
|
||||
* pause character. This causes the post-dial signals to stop pending user confirmation. An
|
||||
@@ -588,6 +599,7 @@ public final class RemoteConnection {
|
||||
private boolean mRingbackRequested;
|
||||
private boolean mConnected;
|
||||
private int mConnectionCapabilities;
|
||||
private int mConnectionProperties;
|
||||
private int mVideoState;
|
||||
private VideoProvider mVideoProvider;
|
||||
private boolean mIsVoipAudioMode;
|
||||
@@ -624,6 +636,7 @@ public final class RemoteConnection {
|
||||
mDisconnectCause = connection.getDisconnectCause();
|
||||
mRingbackRequested = connection.isRingbackRequested();
|
||||
mConnectionCapabilities = connection.getConnectionCapabilities();
|
||||
mConnectionProperties = connection.getConnectionProperties();
|
||||
mVideoState = connection.getVideoState();
|
||||
mVideoProvider = new RemoteConnection.VideoProvider(connection.getVideoProvider());
|
||||
mIsVoipAudioMode = connection.getIsVoipAudioMode();
|
||||
@@ -718,6 +731,16 @@ public final class RemoteConnection {
|
||||
return mConnectionCapabilities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains the properties of this {@code RemoteConnection}.
|
||||
*
|
||||
* @return A bitmask of the properties of the {@code RemoteConnection}, as defined in the
|
||||
* {@code PROPERTY_*} constants in class {@link Connection}.
|
||||
*/
|
||||
public int getConnectionProperties() {
|
||||
return mConnectionProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the audio mode of this {@code RemoteConnection} is VOIP.
|
||||
*
|
||||
@@ -1111,6 +1134,23 @@ public final class RemoteConnection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
void setConnectionProperties(final int connectionProperties) {
|
||||
mConnectionProperties = connectionProperties;
|
||||
for (CallbackRecord record : mCallbackRecords) {
|
||||
final RemoteConnection connection = this;
|
||||
final Callback callback = record.getCallback();
|
||||
record.getHandler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
callback.onConnectionPropertiesChanged(connection, connectionProperties);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user