IllegalArgumentException can happen, if unbindService() is called
after the service is stopped.
Bug:
63439915
Test: Passed MediaBrowserTest
Change-Id: I70ecb9e907af66b9b65960dd4029e55e81639c03
*/
private void forceCloseConnection() {
if (mServiceConnection != null) {
- mContext.unbindService(mServiceConnection);
+ try {
+ mContext.unbindService(mServiceConnection);
+ } catch (IllegalArgumentException e) {
+ if (DBG) {
+ Log.d(TAG, "unbindService failed", e);
+ }
+ }
}
mState = CONNECT_STATE_DISCONNECTED;
mServiceConnection = null;