Merge "Avoid calling BluetoothSocket.destroyNative twice" into ics-aah
This commit is contained in:
committed by
Android (Google) Code Review
commit
1903a73248
@@ -242,8 +242,10 @@ public final class BluetoothSocket implements Closeable {
|
||||
// abortNative(), so this lock should immediately acquire
|
||||
mLock.writeLock().lock();
|
||||
try {
|
||||
mSocketState = SocketState.CLOSED;
|
||||
destroyNative();
|
||||
if (mSocketState != SocketState.CLOSED) {
|
||||
mSocketState = SocketState.CLOSED;
|
||||
destroyNative();
|
||||
}
|
||||
} finally {
|
||||
mLock.writeLock().unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user