Bluetooth AIDL: SetTerminalRaw on fd
Call SetTerminalRaw on the fd that was opened, since mFD has not been set. If SetTerminalRaw fails, log it but continue, since some platforms do not need this call.
Bug: 279870989
Test: start Bluetooth on a device that doesn't need SetTerminalRaw
(cherry picked from https://android-review.googlesource.com/q/commit:eb744bc14c0d1e64c4291b3f869d6055db36b0f3)
Merged-In: I97c92c407b7c80442a0ba0812a630525219670a0
Change-Id: I97c92c407b7c80442a0ba0812a630525219670a0
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index d4e4b34..ac2eabc 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -117,11 +117,9 @@
strerror(errno));
return fd;
}
- if (int ret = SetTerminalRaw(mFd) < 0) {
- ALOGE("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
+ if (int ret = SetTerminalRaw(fd) < 0) {
+ ALOGI("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
strerror(errno));
- ::close(fd);
- return -1;
}
return fd;
}