summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-04-14 13:38:12 -0700
committerAndrew Lee <anwlee@google.com>2015-04-15 11:05:19 -0700
commitedc625f52e5db5d0cb3d60387218f8f8365167f7 (patch)
tree57a53cc0c46e7e7d519c187581dd29967b29a3d3 /telecomm
parent6b91ebf58c928987ead635bb1c49a16965d4c835 (diff)
downloadframeworks_base-edc625f52e5db5d0cb3d60387218f8f8365167f7.zip
frameworks_base-edc625f52e5db5d0cb3d60387218f8f8365167f7.tar.gz
frameworks_base-edc625f52e5db5d0cb3d60387218f8f8365167f7.tar.bz2
Add StatusHints to Conference object.
+ Consolidated ParcelableConference constructors; only one is used. Bug: 20181703 Change-Id: Iad49f10404e1c1eedc4ef68525bde0f10a8dfc97
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecom/Conference.java21
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java9
-rw-r--r--telecomm/java/android/telecom/ParcelableConference.java26
3 files changed, 42 insertions, 14 deletions
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 33bbb29..8c3b066 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -49,6 +49,7 @@ public abstract class Conference implements IConferenceable {
public void onDestroyed(Conference conference) {}
public void onConnectionCapabilitiesChanged(
Conference conference, int connectionCapabilities) {}
+ public void onStatusHintsChanged(Conference conference, StatusHints statusHints) {}
}
private final Set<Listener> mListeners = new CopyOnWriteArraySet<>();
@@ -66,6 +67,7 @@ public abstract class Conference implements IConferenceable {
private int mConnectionCapabilities;
private String mDisconnectMessage;
private long mConnectTimeMillis = CONNECT_TIME_NOT_SPECIFIED;
+ private StatusHints mStatusHints;
private final Connection.Listener mConnectionDeathListener = new Connection.Listener() {
@Override
@@ -484,4 +486,23 @@ public abstract class Conference implements IConferenceable {
}
mConferenceableConnections.clear();
}
+
+ /**
+ * Sets the label and icon status to display in the InCall UI.
+ *
+ * @param statusHints The status label and icon to set.
+ */
+ public final void setStatusHints(StatusHints statusHints) {
+ mStatusHints = statusHints;
+ for (Listener l : mListeners) {
+ l.onStatusHintsChanged(this, statusHints);
+ }
+ }
+
+ /**
+ * @return The status hints for this conference.
+ */
+ public final StatusHints getStatusHints() {
+ return mStatusHints;
+ }
}
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index dfdc3e1..6ec3fa3 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -415,6 +415,12 @@ public abstract class ConnectionService extends Service {
Connection.capabilitiesToString(connectionCapabilities));
mAdapter.setConnectionCapabilities(id, connectionCapabilities);
}
+
+ @Override
+ public void onStatusHintsChanged(Conference conference, StatusHints statusHints) {
+ String id = mIdByConference.get(conference);
+ mAdapter.setStatusHints(id, statusHints);
+ }
};
private final Connection.Listener mConnectionListener = new Connection.Listener() {
@@ -884,7 +890,8 @@ public abstract class ConnectionService extends Service {
conference.getState(),
conference.getConnectionCapabilities(),
connectionIds,
- conference.getConnectTimeMillis());
+ conference.getConnectTimeMillis(),
+ conference.getStatusHints());
mAdapter.addConferenceCall(id, parcelableConference);
// Go through any child calls and set the parent.
diff --git a/telecomm/java/android/telecom/ParcelableConference.java b/telecomm/java/android/telecom/ParcelableConference.java
index dcc2713..d127855 100644
--- a/telecomm/java/android/telecom/ParcelableConference.java
+++ b/telecomm/java/android/telecom/ParcelableConference.java
@@ -32,28 +32,22 @@ public final class ParcelableConference implements Parcelable {
private int mState;
private int mConnectionCapabilities;
private List<String> mConnectionIds;
- private long mConnectTimeMillis;
+ private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
+ private StatusHints mStatusHints;
public ParcelableConference(
PhoneAccountHandle phoneAccount,
int state,
int connectionCapabilities,
- List<String> connectionIds) {
+ List<String> connectionIds,
+ long connectTimeMillis,
+ StatusHints statusHints) {
mPhoneAccount = phoneAccount;
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;
+ mStatusHints = statusHints;
}
@Override
@@ -92,6 +86,10 @@ public final class ParcelableConference implements Parcelable {
return mConnectTimeMillis;
}
+ public StatusHints getStatusHints() {
+ return mStatusHints;
+ }
+
public static final Parcelable.Creator<ParcelableConference> CREATOR =
new Parcelable.Creator<ParcelableConference> () {
@Override
@@ -103,9 +101,10 @@ public final class ParcelableConference implements Parcelable {
List<String> connectionIds = new ArrayList<>(2);
source.readList(connectionIds, classLoader);
long connectTimeMillis = source.readLong();
+ StatusHints statusHints = source.readParcelable(classLoader);
return new ParcelableConference(phoneAccount, state, capabilities, connectionIds,
- connectTimeMillis);
+ connectTimeMillis, statusHints);
}
@Override
@@ -128,5 +127,6 @@ public final class ParcelableConference implements Parcelable {
destination.writeInt(mConnectionCapabilities);
destination.writeList(mConnectionIds);
destination.writeLong(mConnectTimeMillis);
+ destination.writeParcelable(mStatusHints, 0);
}
}