Merge "Avoid IllegalArgumentException when bluetooth is disabled"

am: 2a1bdd2429

Change-Id: I536b4ca701bed102c5c2914a6dbfa2393a646c6d
This commit is contained in:
Deqiang Chen
2019-03-14 15:41:33 -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);
}