Merge "Avoid IllegalArgumentException when bluetooth is disabled"
am: 2a1bdd2429
Change-Id: I536b4ca701bed102c5c2914a6dbfa2393a646c6d
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user