Merge "Avoid IllegalArgumentException when bluetooth is disabled" am: 2a1bdd2429

am: 787e52045f

Change-Id: I3f55d6e7b56170ee4cafaf60e7ef8b908080c182
This commit is contained in:
Deqiang Chen
2019-03-14 15:53:21 -07:00
committed by android-build-merger
3 changed files with 12 additions and 6 deletions

View File

@@ -224,8 +224,10 @@ public final class BluetoothA2dp implements BluetoothProfile {
if (VDBG) Log.d(TAG, "Unbinding service...");
try {
mServiceLock.writeLock().lock();
mService = null;
mContext.unbindService(mConnection);
if (mService != null) {
mService = null;
mContext.unbindService(mConnection);
}
} catch (Exception re) {
Log.e(TAG, "", re);
} finally {

View File

@@ -232,8 +232,10 @@ public final class BluetoothHidHost implements BluetoothProfile {
if (VDBG) Log.d(TAG, "Unbinding service...");
synchronized (mConnection) {
try {
mService = null;
mContext.unbindService(mConnection);
if (mService != null) {
mService = null;
mContext.unbindService(mConnection);
}
} catch (Exception re) {
Log.e(TAG, "", re);
}

View File

@@ -120,8 +120,10 @@ public class BluetoothPbap implements BluetoothProfile {
log("Unbinding service...");
synchronized (mConnection) {
try {
mService = null;
mContext.unbindService(mConnection);
if (mService != null) {
mService = null;
mContext.unbindService(mConnection);
}
} catch (Exception re) {
Log.e(TAG, "", re);
}