When we disconnect shutdown the StateMachine.

Need to stop the StateMachine threads and release
all resources when we disconnect.

bug: 6342470
Change-Id: Ibf7a2ebf4f7ecd667c5d95579e66ecd5086103ea
This commit is contained in:
Wink Saville
2012-05-27 22:12:07 -07:00
parent bbf30dfd76
commit f3110dfc84
4 changed files with 41 additions and 20 deletions

View File

@@ -444,6 +444,16 @@ public class AsyncChannel {
if ((mConnection != null) && (mSrcContext != null)) {
mSrcContext.unbindService(mConnection);
}
try {
// Send the DISCONNECTED, although it may not be received
// but its the best we can do.
Message msg = Message.obtain();
msg.what = CMD_CHANNEL_DISCONNECTED;
msg.replyTo = mSrcMessenger;
mDstMessenger.send(msg);
} catch(Exception e) {
}
// Tell source we're disconnected.
if (mSrcHandler != null) {
replyDisconnected(STATUS_SUCCESSFUL);
}