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...");
|
if (VDBG) Log.d(TAG, "Unbinding service...");
|
||||||
try {
|
try {
|
||||||
mServiceLock.writeLock().lock();
|
mServiceLock.writeLock().lock();
|
||||||
|
if (mService != null) {
|
||||||
mService = null;
|
mService = null;
|
||||||
mContext.unbindService(mConnection);
|
mContext.unbindService(mConnection);
|
||||||
|
}
|
||||||
} catch (Exception re) {
|
} catch (Exception re) {
|
||||||
Log.e(TAG, "", re);
|
Log.e(TAG, "", re);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -232,8 +232,10 @@ public final class BluetoothHidHost implements BluetoothProfile {
|
|||||||
if (VDBG) Log.d(TAG, "Unbinding service...");
|
if (VDBG) Log.d(TAG, "Unbinding service...");
|
||||||
synchronized (mConnection) {
|
synchronized (mConnection) {
|
||||||
try {
|
try {
|
||||||
|
if (mService != null) {
|
||||||
mService = null;
|
mService = null;
|
||||||
mContext.unbindService(mConnection);
|
mContext.unbindService(mConnection);
|
||||||
|
}
|
||||||
} catch (Exception re) {
|
} catch (Exception re) {
|
||||||
Log.e(TAG, "", re);
|
Log.e(TAG, "", re);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,8 +120,10 @@ public class BluetoothPbap implements BluetoothProfile {
|
|||||||
log("Unbinding service...");
|
log("Unbinding service...");
|
||||||
synchronized (mConnection) {
|
synchronized (mConnection) {
|
||||||
try {
|
try {
|
||||||
|
if (mService != null) {
|
||||||
mService = null;
|
mService = null;
|
||||||
mContext.unbindService(mConnection);
|
mContext.unbindService(mConnection);
|
||||||
|
}
|
||||||
} catch (Exception re) {
|
} catch (Exception re) {
|
||||||
Log.e(TAG, "", re);
|
Log.e(TAG, "", re);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user