Merge "Catch IAE from unbind onServiceDisconnected()" into pi-dev

am: c83cf90166

Change-Id: I0fbb92d38a7e711e01dc9c0860e16ef4e102ce6e
This commit is contained in:
Bernardo Rufino
2018-04-05 04:38:46 -07:00
committed by android-build-merger

View File

@@ -439,8 +439,17 @@ public class TransportClient {
synchronized (mStateLock) {
log(Priority.ERROR, "Service disconnected: client UNUSABLE");
setStateLocked(State.UNUSABLE, null);
// After unbindService() no calls back to mConnection
mContext.unbindService(mConnection);
try {
// After unbindService() no calls back to mConnection
mContext.unbindService(mConnection);
} catch (IllegalArgumentException e) {
// TODO: Investigate why this is happening
// We're UNUSABLE, so any calls to mConnection will be no-op, so it's safe to
// swallow this one
log(
Priority.WARN,
"Exception trying to unbind onServiceDisconnected(): " + e.getMessage());
}
}
}