diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp index ac2eabc86d..47886bf460 100644 --- a/bluetooth/aidl/default/BluetoothHci.cpp +++ b/bluetooth/aidl/default/BluetoothHci.cpp @@ -221,6 +221,7 @@ ndk::ScopedAStatus BluetoothHci::initialize( ALOGI("Unable to open Linux interface, trying default path."); mFd = getFdFromDevPath(); if (mFd < 0) { + mState = HalState::READY; cb->initializationComplete(Status::UNABLE_TO_OPEN_INTERFACE); return ndk::ScopedAStatus::ok(); } @@ -278,6 +279,7 @@ ndk::ScopedAStatus BluetoothHci::close() { { std::lock_guard guard(mStateMutex); if (mState != HalState::ONE_CLIENT) { + ASSERT(mState != HalState::INITIALIZING); ALOGI("Already closed"); return ndk::ScopedAStatus::ok(); }