diff options
author | Santos Cordon <santoscordon@google.com> | 2014-09-11 19:50:24 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2014-09-11 19:50:24 -0700 |
commit | 29f2f2e56adfddd2f33a66b71eceb6505f0d288b (patch) | |
tree | 33cedd1eb60a6be2ea8fd8076074d8b948488042 /telecomm | |
parent | 5f5df97df96895c92f0d067c90d527aab2d7f1e3 (diff) | |
download | frameworks_base-29f2f2e56adfddd2f33a66b71eceb6505f0d288b.zip frameworks_base-29f2f2e56adfddd2f33a66b71eceb6505f0d288b.tar.gz frameworks_base-29f2f2e56adfddd2f33a66b71eceb6505f0d288b.tar.bz2 |
Disconnect all connections if telecomm unbinds to the service.
Bug: 1748658
Change-Id: I7bd3d6f28b7fa25f2ee0b308b5dc16d70d67949f
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecomm/ConnectionService.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 833aa26..68066da 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -507,6 +507,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 @@ -965,4 +972,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(); + } + } } |