summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-09-12 06:21:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-12 06:21:43 +0000
commit094d24c9af60dfcd5137fdbbf7bf2b14f1a48087 (patch)
tree9a4fac87521e5f70f82c52eab3035e306de37554 /telecomm
parent929d5ac5759e5d620e8b1d72208e68ed737f1845 (diff)
parent29f2f2e56adfddd2f33a66b71eceb6505f0d288b (diff)
downloadframeworks_base-094d24c9af60dfcd5137fdbbf7bf2b14f1a48087.zip
frameworks_base-094d24c9af60dfcd5137fdbbf7bf2b14f1a48087.tar.gz
frameworks_base-094d24c9af60dfcd5137fdbbf7bf2b14f1a48087.tar.bz2
Merge "Disconnect all connections if telecomm unbinds to the service." into lmp-dev
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/ConnectionService.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 036d397..05ddc27 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -498,6 +498,13 @@ public abstract class ConnectionService extends Service {
return mBinder;
}
+ /** {@inheritDoc} */
+ @Override
+ public boolean onUnbind(Intent intent) {
+ endAllConnections();
+ return super.onUnbind(intent);
+ }
+
/**
* This can be used by telecomm to either create a new outgoing call or attach to an existing
* incoming call. In either case, telecomm will cycle through a set of services and call
@@ -951,4 +958,17 @@ public abstract class ConnectionService extends Service {
}
return sNullConference;
}
+
+ private void endAllConnections() {
+ // Unbound from telecomm. We should end all connections and conferences.
+ for (Connection connection : mIdByConnection.keySet()) {
+ // only operate on top-level calls. Conference calls will be removed on their own.
+ if (connection.getConference() == null) {
+ connection.onDisconnect();
+ }
+ }
+ for (Conference conference : mIdByConference.keySet()) {
+ conference.onDisconnect();
+ }
+ }
}