diff options
author | Xin Li <delphij@google.com> | 2023-10-06 05:34:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-10-06 05:34:14 +0000 |
commit | 6e5271930fc3dbb222217ef4342fe59d1fbf3629 (patch) | |
tree | c2afa35bd2da06539e6af4629b6060cb424da10e | |
parent | 6ee9b599f8d779bb8af88509ed57a010a437a62d (diff) | |
parent | 0ebec9584d0a6e625497b9d8bb0ffdaa6ea05572 (diff) | |
download | libhardware-6e5271930fc3dbb222217ef4342fe59d1fbf3629.tar.gz |
Merge "Merge Android 14" into main
-rw-r--r-- | modules/gralloc/gralloc.cpp | 4 | ||||
-rw-r--r-- | modules/sensors/dynamic_sensor/HidRawDevice.cpp | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp index 87bda975..f7ea01cf 100644 --- a/modules/gralloc/gralloc.cpp +++ b/modules/gralloc/gralloc.cpp @@ -224,7 +224,11 @@ static int gralloc_alloc(alloc_device_t* dev, case HAL_PIXEL_FORMAT_RAW16: bytesPerPixel = 2; break; + case HAL_PIXEL_FORMAT_BLOB: + bytesPerPixel = 1; + break; default: + ALOGE("gralloc_alloc bad format %d", format); return -EINVAL; } diff --git a/modules/sensors/dynamic_sensor/HidRawDevice.cpp b/modules/sensors/dynamic_sensor/HidRawDevice.cpp index 2588483a..6032ed95 100644 --- a/modules/sensors/dynamic_sensor/HidRawDevice.cpp +++ b/modules/sensors/dynamic_sensor/HidRawDevice.cpp @@ -204,7 +204,7 @@ bool HidRawDevice::getFeature(uint8_t id, std::vector<uint8_t> *out) { int res = ::ioctl(mDevFd, HIDIOCGFEATURE(size), mIoBuffer.data()); if (res < 0) { LOG_E << "HidRawDevice::getFeature: feature " << static_cast<int>(id) - << " ioctl returns " << res << " (" << ::strerror(res) << ")" << LOG_ENDL; + << " ioctl returned " << res << ", errno: " << ::strerror(errno) << LOG_ENDL; return false; } @@ -249,8 +249,8 @@ bool HidRawDevice::setFeature(uint8_t id, const std::vector<uint8_t> &in) { std::copy(in.begin(), in.end(), &mIoBuffer[1]); int res = ::ioctl(mDevFd, HIDIOCSFEATURE(size), mIoBuffer.data()); if (res < 0) { - LOG_E << "HidRawDevice::setFeature: feature " << id << " ioctl returns " << res - << " (" << ::strerror(res) << ")" << LOG_ENDL; + LOG_E << "HidRawDevice::setFeature: feature " << id << " ioctl returned " << res + << ", errno: " << ::strerror(errno) << LOG_ENDL; return false; } return true; @@ -287,8 +287,8 @@ bool HidRawDevice::sendReport(uint8_t id, std::vector<uint8_t> &data) { res = ::write(mDevFd, data.data(), size); } if (res < 0) { - LOG_E << "HidRawDevice::sendReport: output " << id << " write returns " << res - << " (" << ::strerror(res) << ")" << LOG_ENDL; + LOG_E << "HidRawDevice::sendReport: output " << id << " write returned " + << res << ", errno: " << ::strerror(errno) << LOG_ENDL; return false; } return true; @@ -302,8 +302,8 @@ bool HidRawDevice::receiveReport(uint8_t *id, std::vector<uint8_t> *data) { uint8_t buffer[256]; int res = ::read(mDevFd, buffer, 256); if (res < 0) { - LOG_E << "HidRawDevice::receiveReport: read returns " << res - << " (" << ::strerror(res) << ")" << LOG_ENDL; + LOG_E << "HidRawDevice::receiveReport: read returned " << res + << ", errno: " << ::strerror(errno) << LOG_ENDL; return false; } |