Merge "Avoid calling BluetoothSocket.destroyNative twice" into ics-aah

This commit is contained in:
Jason Simmons
2012-05-07 09:12:00 -07:00
committed by Android (Google) Code Review

View File

@@ -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();
}