Merge "libkeymaster1 was split into libkeymaster and _portable"
diff --git a/automotive/evs/1.0/vts/functional/Android.bp b/automotive/evs/1.0/vts/functional/Android.bp
index 22ceff3..e86e9bc 100644
--- a/automotive/evs/1.0/vts/functional/Android.bp
+++ b/automotive/evs/1.0/vts/functional/Android.bp
@@ -19,7 +19,8 @@
srcs: [
"VtsEvsV1_0TargetTest.cpp",
- "FrameHandler.cpp"
+ "FrameHandler.cpp",
+ "FormatConvert.cpp"
],
defaults: [
diff --git a/automotive/evs/1.0/vts/functional/FormatConvert.cpp b/automotive/evs/1.0/vts/functional/FormatConvert.cpp
new file mode 100644
index 0000000..e5cc8ee
--- /dev/null
+++ b/automotive/evs/1.0/vts/functional/FormatConvert.cpp
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "VtsHalEvsTest"
+
+#include "FormatConvert.h"
+
+#include <algorithm> // std::min
+
+
+// Round up to the nearest multiple of the given alignment value
+template<unsigned alignment>
+int align(int value) {
+ static_assert((alignment && !(alignment & (alignment - 1))),
+ "alignment must be a power of 2");
+
+ unsigned mask = alignment - 1;
+ return (value + mask) & ~mask;
+}
+
+
+// Limit the given value to the provided range. :)
+static inline float clamp(float v, float min, float max) {
+ if (v < min) return min;
+ if (v > max) return max;
+ return v;
+}
+
+
+static uint32_t yuvToRgbx(const unsigned char Y, const unsigned char Uin, const unsigned char Vin) {
+ // Don't use this if you want to see the best performance. :)
+ // Better to do this in a pixel shader if we really have to, but on actual
+ // embedded hardware we expect to be able to texture directly from the YUV data
+ float U = Uin - 128.0f;
+ float V = Vin - 128.0f;
+
+ float Rf = Y + 1.140f*V;
+ float Gf = Y - 0.395f*U - 0.581f*V;
+ float Bf = Y + 2.032f*U;
+ unsigned char R = (unsigned char)clamp(Rf, 0.0f, 255.0f);
+ unsigned char G = (unsigned char)clamp(Gf, 0.0f, 255.0f);
+ unsigned char B = (unsigned char)clamp(Bf, 0.0f, 255.0f);
+
+ return (R ) |
+ (G << 8) |
+ (B << 16) |
+ 0xFF000000; // Fill the alpha channel with ones
+}
+
+
+void copyNV21toRGB32(unsigned width, unsigned height,
+ uint8_t* src,
+ uint32_t* dst, unsigned dstStridePixels)
+{
+ // The NV21 format provides a Y array of 8bit values, followed by a 1/2 x 1/2 interleaved
+ // U/V array. It assumes an even width and height for the overall image, and a horizontal
+ // stride that is an even multiple of 16 bytes for both the Y and UV arrays.
+ unsigned strideLum = align<16>(width);
+ unsigned sizeY = strideLum * height;
+ unsigned strideColor = strideLum; // 1/2 the samples, but two interleaved channels
+ unsigned offsetUV = sizeY;
+
+ uint8_t* srcY = src;
+ uint8_t* srcUV = src+offsetUV;
+
+ for (unsigned r = 0; r < height; r++) {
+ // Note that we're walking the same UV row twice for even/odd luminance rows
+ uint8_t* rowY = srcY + r*strideLum;
+ uint8_t* rowUV = srcUV + (r/2 * strideColor);
+
+ uint32_t* rowDest = dst + r*dstStridePixels;
+
+ for (unsigned c = 0; c < width; c++) {
+ unsigned uCol = (c & ~1); // uCol is always even and repeats 1:2 with Y values
+ unsigned vCol = uCol | 1; // vCol is always odd
+ rowDest[c] = yuvToRgbx(rowY[c], rowUV[uCol], rowUV[vCol]);
+ }
+ }
+}
+
+
+void copyYV12toRGB32(unsigned width, unsigned height,
+ uint8_t* src,
+ uint32_t* dst, unsigned dstStridePixels)
+{
+ // The YV12 format provides a Y array of 8bit values, followed by a 1/2 x 1/2 U array, followed
+ // by another 1/2 x 1/2 V array. It assumes an even width and height for the overall image,
+ // and a horizontal stride that is an even multiple of 16 bytes for each of the Y, U,
+ // and V arrays.
+ unsigned strideLum = align<16>(width);
+ unsigned sizeY = strideLum * height;
+ unsigned strideColor = align<16>(strideLum/2);
+ unsigned sizeColor = strideColor * height/2;
+ unsigned offsetU = sizeY;
+ unsigned offsetV = sizeY + sizeColor;
+
+ uint8_t* srcY = src;
+ uint8_t* srcU = src+offsetU;
+ uint8_t* srcV = src+offsetV;
+
+ for (unsigned r = 0; r < height; r++) {
+ // Note that we're walking the same U and V rows twice for even/odd luminance rows
+ uint8_t* rowY = srcY + r*strideLum;
+ uint8_t* rowU = srcU + (r/2 * strideColor);
+ uint8_t* rowV = srcV + (r/2 * strideColor);
+
+ uint32_t* rowDest = dst + r*dstStridePixels;
+
+ for (unsigned c = 0; c < width; c++) {
+ rowDest[c] = yuvToRgbx(rowY[c], rowU[c], rowV[c]);
+ }
+ }
+}
+
+
+void copyYUYVtoRGB32(unsigned width, unsigned height,
+ uint8_t* src, unsigned srcStridePixels,
+ uint32_t* dst, unsigned dstStridePixels)
+{
+ uint32_t* srcWords = (uint32_t*)src;
+
+ const int srcRowPadding32 = srcStridePixels/2 - width/2; // 2 bytes per pixel, 4 bytes per word
+ const int dstRowPadding32 = dstStridePixels - width; // 4 bytes per pixel, 4 bytes per word
+
+ for (unsigned r = 0; r < height; r++) {
+ for (unsigned c = 0; c < width/2; c++) {
+ // Note: we're walking two pixels at a time here (even/odd)
+ uint32_t srcPixel = *srcWords++;
+
+ uint8_t Y1 = (srcPixel) & 0xFF;
+ uint8_t U = (srcPixel >> 8) & 0xFF;
+ uint8_t Y2 = (srcPixel >> 16) & 0xFF;
+ uint8_t V = (srcPixel >> 24) & 0xFF;
+
+ // On the RGB output, we're writing one pixel at a time
+ *(dst+0) = yuvToRgbx(Y1, U, V);
+ *(dst+1) = yuvToRgbx(Y2, U, V);
+ dst += 2;
+ }
+
+ // Skip over any extra data or end of row alignment padding
+ srcWords += srcRowPadding32;
+ dst += dstRowPadding32;
+ }
+}
+
+
+void copyMatchedInterleavedFormats(unsigned width, unsigned height,
+ void* src, unsigned srcStridePixels,
+ void* dst, unsigned dstStridePixels,
+ unsigned pixelSize) {
+ for (unsigned row = 0; row < height; row++) {
+ // Copy the entire row of pixel data
+ memcpy(dst, src, width * pixelSize);
+
+ // Advance to the next row (keeping in mind that stride here is in units of pixels)
+ src = (uint8_t*)src + srcStridePixels * pixelSize;
+ dst = (uint8_t*)dst + dstStridePixels * pixelSize;
+ }
+}
diff --git a/automotive/evs/1.0/vts/functional/FormatConvert.h b/automotive/evs/1.0/vts/functional/FormatConvert.h
new file mode 100644
index 0000000..3ff1eec
--- /dev/null
+++ b/automotive/evs/1.0/vts/functional/FormatConvert.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef EVS_VTS_FORMATCONVERT_H
+#define EVS_VTS_FORMATCONVERT_H
+
+#include <queue>
+#include <stdint.h>
+
+
+// Given an image buffer in NV21 format (HAL_PIXEL_FORMAT_YCRCB_420_SP), output 32bit RGBx values.
+// The NV21 format provides a Y array of 8bit values, followed by a 1/2 x 1/2 interleaved
+// U/V array. It assumes an even width and height for the overall image, and a horizontal
+// stride that is an even multiple of 16 bytes for both the Y and UV arrays.
+void copyNV21toRGB32(unsigned width, unsigned height,
+ uint8_t* src,
+ uint32_t* dst, unsigned dstStridePixels);
+
+
+// Given an image buffer in YV12 format (HAL_PIXEL_FORMAT_YV12), output 32bit RGBx values.
+// The YV12 format provides a Y array of 8bit values, followed by a 1/2 x 1/2 U array, followed
+// by another 1/2 x 1/2 V array. It assumes an even width and height for the overall image,
+// and a horizontal stride that is an even multiple of 16 bytes for each of the Y, U,
+// and V arrays.
+void copyYV12toRGB32(unsigned width, unsigned height,
+ uint8_t* src,
+ uint32_t* dst, unsigned dstStridePixels);
+
+
+// Given an image buffer in YUYV format (HAL_PIXEL_FORMAT_YCBCR_422_I), output 32bit RGBx values.
+// The NV21 format provides a Y array of 8bit values, followed by a 1/2 x 1/2 interleaved
+// U/V array. It assumes an even width and height for the overall image, and a horizontal
+// stride that is an even multiple of 16 bytes for both the Y and UV arrays.
+void copyYUYVtoRGB32(unsigned width, unsigned height,
+ uint8_t* src, unsigned srcStrideBytes,
+ uint32_t* dst, unsigned dstStrideBytes);
+
+
+// Given an simple rectangular image buffer with an integer number of bytes per pixel,
+// copy the pixel values into a new rectangular buffer (potentially with a different stride).
+// This is typically used to copy RGBx data into an RGBx output buffer.
+void copyMatchedInterleavedFormats(unsigned width, unsigned height,
+ void* src, unsigned srcStridePixels,
+ void* dst, unsigned dstStridePixels,
+ unsigned pixelSize);
+
+#endif // EVS_VTS_FORMATCONVERT_H
diff --git a/automotive/evs/1.0/vts/functional/FrameHandler.cpp b/automotive/evs/1.0/vts/functional/FrameHandler.cpp
index 58c2f26..a69f72b 100644
--- a/automotive/evs/1.0/vts/functional/FrameHandler.cpp
+++ b/automotive/evs/1.0/vts/functional/FrameHandler.cpp
@@ -17,6 +17,7 @@
#define LOG_TAG "VtsHalEvsTest"
#include "FrameHandler.h"
+#include "FormatConvert.h"
#include <stdio.h>
#include <string.h>
@@ -25,14 +26,6 @@
#include <cutils/native_handle.h>
#include <ui/GraphicBuffer.h>
-#include <algorithm> // std::min
-
-
-// For the moment, we're assuming that the underlying EVS driver we're working with
-// is providing 4 byte RGBx data. This is fine for loopback testing, although
-// real hardware is expected to provide YUV data -- most likly formatted as YV12
-static const unsigned kBytesPerPixel = 4; // assuming 4 byte RGBx pixels
-
FrameHandler::FrameHandler(android::sp <IEvsCamera> pCamera, CameraDesc cameraInfo,
android::sp <IEvsDisplay> pDisplay,
@@ -58,14 +51,18 @@
bool FrameHandler::startStream() {
+ // Tell the camera to start streaming
+ Return<EvsResult> result = mCamera->startVideoStream(this);
+ if (result != EvsResult::OK) {
+ return false;
+ }
+
// Mark ourselves as running
mLock.lock();
mRunning = true;
mLock.unlock();
- // Tell the camera to start streaming
- Return<EvsResult> result = mCamera->startVideoStream(this);
- return (result == EvsResult::OK);
+ return true;
}
@@ -82,7 +79,9 @@
// Wait until the stream has actually stopped
std::unique_lock<std::mutex> lock(mLock);
- mSignal.wait(lock, [this](){ return !mRunning; });
+ if (mRunning) {
+ mSignal.wait(lock, [this]() { return !mRunning; });
+ }
}
@@ -179,13 +178,13 @@
switch (mReturnMode) {
case eAutoReturn:
- // Send the camera buffer back now that we're done with it
+ // Send the camera buffer back now that the client has seen it
ALOGD("Calling doneWithFrame");
// TODO: Why is it that we get a HIDL crash if we pass back the cloned buffer?
mCamera->doneWithFrame(bufferArg);
break;
case eNoAutoReturn:
- // Hang onto the buffer handle for now -- we'll return it explicitly later
+ // Hang onto the buffer handle for now -- the client will return it explicitly later
mHeldBuffers.push(bufferArg);
}
@@ -228,25 +227,41 @@
srcBuffer.width, srcBuffer.height, srcBuffer.format, 1, srcBuffer.usage,
srcBuffer.stride);
- // Lock our source buffer for reading
- unsigned char* srcPixels = nullptr;
+ // Lock our source buffer for reading (current expectation are for this to be NV21 format)
+ uint8_t* srcPixels = nullptr;
src->lock(GRALLOC_USAGE_SW_READ_OFTEN, (void**)&srcPixels);
- // Lock our target buffer for writing
- unsigned char* tgtPixels = nullptr;
+ // Lock our target buffer for writing (should be RGBA8888 format)
+ uint32_t* tgtPixels = nullptr;
tgt->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)&tgtPixels);
if (srcPixels && tgtPixels) {
- for (unsigned row = 0; row < height; row++) {
- // Copy the entire row of pixel data
- memcpy(tgtPixels, srcPixels, width * kBytesPerPixel);
-
- // Advance to the next row (keeping in mind that stride here is in units of pixels)
- tgtPixels += tgtBuffer.stride * kBytesPerPixel;
- srcPixels += srcBuffer.stride * kBytesPerPixel;
+ if (tgtBuffer.format != HAL_PIXEL_FORMAT_RGBA_8888) {
+ // We always expect 32 bit RGB for the display output for now. Is there a need for 565?
+ ALOGE("Diplay buffer is always expected to be 32bit RGBA");
+ success = false;
+ } else {
+ if (srcBuffer.format == HAL_PIXEL_FORMAT_YCRCB_420_SP) { // 420SP == NV21
+ copyNV21toRGB32(width, height,
+ srcPixels,
+ tgtPixels, tgtBuffer.stride);
+ } else if (srcBuffer.format == HAL_PIXEL_FORMAT_YV12) { // YUV_420P == YV12
+ copyYV12toRGB32(width, height,
+ srcPixels,
+ tgtPixels, tgtBuffer.stride);
+ } else if (srcBuffer.format == HAL_PIXEL_FORMAT_YCBCR_422_I) { // YUYV
+ copyYUYVtoRGB32(width, height,
+ srcPixels, srcBuffer.stride,
+ tgtPixels, tgtBuffer.stride);
+ } else if (srcBuffer.format == tgtBuffer.format) { // 32bit RGBA
+ copyMatchedInterleavedFormats(width, height,
+ srcPixels, srcBuffer.stride,
+ tgtPixels, tgtBuffer.stride,
+ tgtBuffer.pixelSize);
+ }
}
} else {
- ALOGE("Failed to copy buffer contents");
+ ALOGE("Failed to lock buffer contents for contents transfer");
success = false;
}
diff --git a/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp b/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp
index 50b6581..2e80afe 100644
--- a/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp
+++ b/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp
@@ -107,6 +107,8 @@
* call to closeCamera. Then repeats the test to ensure all cameras can be reopened.
*/
TEST_F(EvsHidlTest, CameraOpenClean) {
+ ALOGI("Starting CameraOpenClean test");
+
// Get the camera list
loadCameraList();
@@ -137,6 +139,8 @@
* the system to be tolerant of shutdown/restart race conditions.
*/
TEST_F(EvsHidlTest, CameraOpenAggressive) {
+ ALOGI("Starting CameraOpenAggressive test");
+
// Get the camera list
loadCameraList();
@@ -183,6 +187,8 @@
* Test both clean shut down and "aggressive open" device stealing behavior.
*/
TEST_F(EvsHidlTest, DisplayOpen) {
+ ALOGI("Starting DisplayOpen test");
+
// Request exclusive access to the EVS display, then let it go
{
sp<IEvsDisplay> pDisplay = pEnumerator->openDisplay();
@@ -229,6 +235,8 @@
* object itself or the owning enumerator.
*/
TEST_F(EvsHidlTest, DisplayStates) {
+ ALOGI("Starting DisplayStates test");
+
// Ensure the display starts in the expected state
EXPECT_EQ((DisplayState)pEnumerator->getDisplayState(), DisplayState::NOT_OPEN);
@@ -270,15 +278,14 @@
}
// TODO: This hack shouldn't be necessary. b/36122635
-// NOTE: Calling flushCommand here did not avoid the race. Going back to sleep... :(
-// android::hardware::IPCThreadState::self()->flushCommands();
sleep(1);
// Now that the display pointer has gone out of scope, causing the IEvsDisplay interface
// object to be destroyed, we should be back to the "not open" state.
// NOTE: If we want this to pass without the sleep above, we'd have to add the
// (now recommended) closeDisplay() call instead of relying on the smarter pointer
- // going out of scope.
+ // going out of scope. I've not done that because I want to verify that the deletion
+ // of the object does actually clean up (eventually).
EXPECT_EQ((DisplayState)pEnumerator->getDisplayState(), DisplayState::NOT_OPEN);
}
@@ -288,6 +295,8 @@
* Measure and qualify the stream start up time and streaming frame rate of each reported camera
*/
TEST_F(EvsHidlTest, CameraStreamPerformance) {
+ ALOGI("Starting CameraStreamPerformance test");
+
// Get the camera list
loadCameraList();
@@ -304,7 +313,7 @@
// Start the camera's video stream
nsecs_t start = systemTime(SYSTEM_TIME_MONOTONIC);
bool startResult = frameHandler->startStream();
- EXPECT_EQ(startResult, true);
+ ASSERT_TRUE(startResult);
// Ensure the first frame arrived within the expected time
frameHandler->waitForFrameCount(1);
@@ -344,6 +353,8 @@
* than one frame time. The camera must cleanly skip frames until the client is ready again.
*/
TEST_F(EvsHidlTest, CameraStreamBuffering) {
+ ALOGI("Starting CameraStreamBuffering test");
+
// Arbitrary constant (should be > 1 and less than crazy)
static const unsigned int kBuffersToHold = 6;
@@ -372,14 +383,14 @@
// Start the camera's video stream
bool startResult = frameHandler->startStream();
- EXPECT_TRUE(startResult);
+ ASSERT_TRUE(startResult);
// Check that the video stream stalls once we've gotten exactly the number of buffers
// we requested since we told the frameHandler not to return them.
- sleep(1); // 1 second would be enough for at least 5 frames to be delivered worst case
+ sleep(2); // 1 second should be enough for at least 5 frames to be delivered worst case
unsigned framesReceived = 0;
frameHandler->getFramesCounters(&framesReceived, nullptr);
- EXPECT_EQ(kBuffersToHold, framesReceived);
+ ASSERT_EQ(kBuffersToHold, framesReceived) << "Stream didn't stall at expected buffer limit";
// Give back one buffer
@@ -390,7 +401,7 @@
// filled since we require 10fps minimum -- but give a 10% allowance just in case.
usleep(110 * kMillisecondsToMicroseconds);
frameHandler->getFramesCounters(&framesReceived, nullptr);
- EXPECT_EQ(kBuffersToHold+1, framesReceived);
+ EXPECT_EQ(kBuffersToHold+1, framesReceived) << "Stream should've resumed";
// Even when the camera pointer goes out of scope, the FrameHandler object will
// keep the stream alive unless we tell it to shutdown.
@@ -411,6 +422,8 @@
* which a human could observe to see the operation of the system on the physical display.
*/
TEST_F(EvsHidlTest, CameraToDisplayRoundTrip) {
+ ALOGI("Starting CameraToDisplayRoundTrip test");
+
// Get the camera list
loadCameraList();
@@ -434,7 +447,7 @@
// Start the camera's video stream
bool startResult = frameHandler->startStream();
- EXPECT_EQ(startResult, true);
+ ASSERT_TRUE(startResult);
// Wait a while to let the data flow
static const int kSecondsToWait = 5;
diff --git a/automotive/vehicle/2.0/default/Android.mk b/automotive/vehicle/2.0/default/Android.mk
index ee6d134..c63899d 100644
--- a/automotive/vehicle/2.0/default/Android.mk
+++ b/automotive/vehicle/2.0/default/Android.mk
@@ -123,6 +123,9 @@
tests/VehicleObjectPool_test.cpp \
tests/VehiclePropConfigIndex_test.cpp \
+LOCAL_HEADER_LIBRARIES := \
+ libbase_headers
+
LOCAL_SHARED_LIBRARIES := \
libhidlbase \
libhidltransport \
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
index ea40cc5..fe34a3f 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#define LOG_TAG "DefaultVehicleHal_v2_0"
+
#include <android/log.h>
+#include <android-base/macros.h>
#include "EmulatedVehicleHal.h"
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
index 04335b5..4864d5d 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
@@ -17,6 +17,7 @@
#include <unordered_map>
#include <iostream>
+#include <android-base/macros.h>
#include <utils/SystemClock.h>
#include <gtest/gtest.h>
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index e831069..2c965ed 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -59,13 +59,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index c56499a..807ae02 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -52,13 +52,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml
new file mode 100644
index 0000000..cd3904e
--- /dev/null
+++ b/compatibility_matrix.xml
@@ -0,0 +1,34 @@
+<compatibility-matrix version="1.0" type="framework">
+ <hal format="hidl" optional="true">
+ <name>android.hardware.bluetooth</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.boot</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.configstore</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.ir</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.nfc</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.radio</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.renderscript</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.wifi</name>
+ <version>1.0</version>
+ </hal>
+</compatibility-matrix>
diff --git a/configstore/1.0/Android.bp b/configstore/1.0/Android.bp
index bd203cc..4993dc3 100644
--- a/configstore/1.0/Android.bp
+++ b/configstore/1.0/Android.bp
@@ -52,13 +52,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/contexthub/1.0/default/Android.bp b/contexthub/1.0/default/Android.bp
index 78d27cc..9f5131d 100644
--- a/contexthub/1.0/default/Android.bp
+++ b/contexthub/1.0/default/Android.bp
@@ -32,3 +32,23 @@
"android.hardware.contexthub@1.0",
],
}
+
+cc_binary {
+ name: "android.hardware.contexthub@1.0-service",
+ relative_install_path: "hw",
+ proprietary: true,
+ init_rc: ["android.hardware.contexthub@1.0-service.rc"],
+ srcs: ["service.cpp"],
+
+ shared_libs: [
+ "libbase",
+ "libcutils",
+ "libdl",
+ "libhardware",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ "android.hardware.contexthub@1.0",
+ ],
+}
diff --git a/contexthub/1.0/default/Android.mk b/contexthub/1.0/default/Android.mk
deleted file mode 100644
index 917bfe0..0000000
--- a/contexthub/1.0/default/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE := android.hardware.contexthub@1.0-service
-LOCAL_INIT_RC := android.hardware.contexthub@1.0-service.rc
-LOCAL_SRC_FILES := \
- service.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libbase \
- libcutils \
- libdl \
- libhardware \
- libhidlbase \
- libhidltransport \
- liblog \
- libutils \
- android.hardware.contexthub@1.0 \
-
-include $(BUILD_EXECUTABLE)
diff --git a/contexthub/1.0/default/Contexthub.h b/contexthub/1.0/default/Contexthub.h
index 236e079..e587930 100644
--- a/contexthub/1.0/default/Contexthub.h
+++ b/contexthub/1.0/default/Contexthub.h
@@ -19,6 +19,7 @@
#include <unordered_map>
+#include <android-base/macros.h>
#include <android/hardware/contexthub/1.0/IContexthub.h>
#include <hardware/context_hub.h>
diff --git a/current.txt b/current.txt
index 1f6d592..089f128 100644
--- a/current.txt
+++ b/current.txt
@@ -98,7 +98,7 @@
17971eb8a482893dadcfc16e0583f492d42a034ef95d9b0b709417af30838396 android.hardware.graphics.allocator@2.0::IAllocator
60bf42a4898e4fb70dbd720b263aeafd7f35f5e1a5effeabb4d5d659878a5f18 android.hardware.graphics.bufferqueue@1.0::IGraphicBufferProducer
b8a75617b9ec12bea641f3a73d4025a33e8b9a2f9169dd46094af56adf9249c5 android.hardware.graphics.bufferqueue@1.0::IProducerListener
-862cd4c41884b6c06d843b88061a021ed117e751b60b8efe8916eb64a0b3c062 android.hardware.graphics.common@1.0::types
+4f6dedbcdd21c309dfc650acea81a096d6b242493ffe49c8d61bd3c43aad354e android.hardware.graphics.common@1.0::types
b3aac6c3817f039964fcd62268274b3039e17bd7d0d5b40b4d1d1c7b19a1f866 android.hardware.graphics.composer@2.1::IComposer
b19d00eb8a8b3b0034a0321f22e8f32162bf4c2aebbce6da22c025f56e459ea2 android.hardware.graphics.composer@2.1::IComposerCallback
e992684e690dfe67a8cbeab5005bfa3fa9c2bf3d4b0b75657fb1f0c2d5dd2bae android.hardware.graphics.composer@2.1::IComposerClient
diff --git a/graphics/common/1.0/types.hal b/graphics/common/1.0/types.hal
index 76b3bec..3369fad 100644
--- a/graphics/common/1.0/types.hal
+++ b/graphics/common/1.0/types.hal
@@ -505,26 +505,29 @@
/**
* Transformation definitions
- *
- * IMPORTANT NOTE:
- * ROT_90 is applied CLOCKWISE and AFTER FLIP_{H|V}.
- *
*/
@export(name="android_transform_t", value_prefix="HAL_TRANSFORM_")
enum Transform : int32_t {
- /** flip source image horizontally (around the vertical axis) */
- FLIP_H = 0x01,
/**
- * flip source image vertically (around the horizontal axis)*/
- FLIP_V = 0x02,
- /** rotate source image 90 degrees clockwise */
- ROT_90 = 0x04,
- /** rotate source image 180 degrees */
- ROT_180 = 0x03,
- /** rotate source image 270 degrees clockwise */
- ROT_270 = 0x07,
+ * Horizontal flip. FLIP_H/FLIP_V is applied before ROT_90.
+ */
+ FLIP_H = 1 << 0,
- /** 0x08 is reserved */
+ /**
+ * Vertical flip. FLIP_H/FLIP_V is applied before ROT_90.
+ */
+ FLIP_V = 1 << 1,
+
+ /**
+ * 90 degree clockwise rotation. FLIP_H/FLIP_V is applied before ROT_90.
+ */
+ ROT_90 = 1 << 2,
+
+ /**
+ * Commonly used combinations.
+ */
+ ROT_180 = FLIP_H | FLIP_V,
+ ROT_270 = FLIP_H | FLIP_V | ROT_90,
};
/**
@@ -1222,209 +1225,209 @@
*/
@export(name="android_color_mode_t", value_prefix="HAL_COLOR_MODE_")
enum ColorMode : int32_t {
- /**
- * DEFAULT is the "native" gamut of the display.
- * White Point: Vendor/OEM defined
- * Panel Gamma: Vendor/OEM defined (typically 2.2)
- * Rendering Intent: Vendor/OEM defined (typically 'enhanced')
- */
- NATIVE = 0,
+ /**
+ * DEFAULT is the "native" gamut of the display.
+ * White Point: Vendor/OEM defined
+ * Panel Gamma: Vendor/OEM defined (typically 2.2)
+ * Rendering Intent: Vendor/OEM defined (typically 'enhanced')
+ */
+ NATIVE = 0,
- /**
- * STANDARD_BT601_625 corresponds with display
- * settings that implement the ITU-R Recommendation BT.601
- * or Rec 601. Using 625 line version
- * Rendering Intent: Colorimetric
- * Primaries:
- * x y
- * green 0.290 0.600
- * blue 0.150 0.060
- * red 0.640 0.330
- * white (D65) 0.3127 0.3290
- *
- * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
- * for RGB conversion from the one purely determined by the primaries
- * to minimize the color shift into RGB space that uses BT.709
- * primaries.
- *
- * Gamma Correction (GC):
- *
- * if Vlinear < 0.018
- * Vnonlinear = 4.500 * Vlinear
- * else
- * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
- */
- STANDARD_BT601_625 = 1,
+ /**
+ * STANDARD_BT601_625 corresponds with display
+ * settings that implement the ITU-R Recommendation BT.601
+ * or Rec 601. Using 625 line version
+ * Rendering Intent: Colorimetric
+ * Primaries:
+ * x y
+ * green 0.290 0.600
+ * blue 0.150 0.060
+ * red 0.640 0.330
+ * white (D65) 0.3127 0.3290
+ *
+ * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
+ * for RGB conversion from the one purely determined by the primaries
+ * to minimize the color shift into RGB space that uses BT.709
+ * primaries.
+ *
+ * Gamma Correction (GC):
+ *
+ * if Vlinear < 0.018
+ * Vnonlinear = 4.500 * Vlinear
+ * else
+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+ */
+ STANDARD_BT601_625 = 1,
- /**
- * Primaries:
- * x y
- * green 0.290 0.600
- * blue 0.150 0.060
- * red 0.640 0.330
- * white (D65) 0.3127 0.3290
- *
- * Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation
- * for RGB conversion.
- *
- * Gamma Correction (GC):
- *
- * if Vlinear < 0.018
- * Vnonlinear = 4.500 * Vlinear
- * else
- * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
- */
- STANDARD_BT601_625_UNADJUSTED = 2,
+ /**
+ * Primaries:
+ * x y
+ * green 0.290 0.600
+ * blue 0.150 0.060
+ * red 0.640 0.330
+ * white (D65) 0.3127 0.3290
+ *
+ * Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation
+ * for RGB conversion.
+ *
+ * Gamma Correction (GC):
+ *
+ * if Vlinear < 0.018
+ * Vnonlinear = 4.500 * Vlinear
+ * else
+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+ */
+ STANDARD_BT601_625_UNADJUSTED = 2,
- /**
- * Primaries:
- * x y
- * green 0.310 0.595
- * blue 0.155 0.070
- * red 0.630 0.340
- * white (D65) 0.3127 0.3290
- *
- * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
- * for RGB conversion from the one purely determined by the primaries
- * to minimize the color shift into RGB space that uses BT.709
- * primaries.
- *
- * Gamma Correction (GC):
- *
- * if Vlinear < 0.018
- * Vnonlinear = 4.500 * Vlinear
- * else
- * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
- */
- STANDARD_BT601_525 = 3,
+ /**
+ * Primaries:
+ * x y
+ * green 0.310 0.595
+ * blue 0.155 0.070
+ * red 0.630 0.340
+ * white (D65) 0.3127 0.3290
+ *
+ * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
+ * for RGB conversion from the one purely determined by the primaries
+ * to minimize the color shift into RGB space that uses BT.709
+ * primaries.
+ *
+ * Gamma Correction (GC):
+ *
+ * if Vlinear < 0.018
+ * Vnonlinear = 4.500 * Vlinear
+ * else
+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+ */
+ STANDARD_BT601_525 = 3,
- /**
- * Primaries:
- * x y
- * green 0.310 0.595
- * blue 0.155 0.070
- * red 0.630 0.340
- * white (D65) 0.3127 0.3290
- *
- * Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation
- * for RGB conversion (as in SMPTE 240M).
- *
- * Gamma Correction (GC):
- *
- * if Vlinear < 0.018
- * Vnonlinear = 4.500 * Vlinear
- * else
- * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
- */
- STANDARD_BT601_525_UNADJUSTED = 4,
+ /**
+ * Primaries:
+ * x y
+ * green 0.310 0.595
+ * blue 0.155 0.070
+ * red 0.630 0.340
+ * white (D65) 0.3127 0.3290
+ *
+ * Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation
+ * for RGB conversion (as in SMPTE 240M).
+ *
+ * Gamma Correction (GC):
+ *
+ * if Vlinear < 0.018
+ * Vnonlinear = 4.500 * Vlinear
+ * else
+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
+ */
+ STANDARD_BT601_525_UNADJUSTED = 4,
- /**
- * REC709 corresponds with display settings that implement
- * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television.
- * Rendering Intent: Colorimetric
- * Primaries:
- * x y
- * green 0.300 0.600
- * blue 0.150 0.060
- * red 0.640 0.330
- * white (D65) 0.3127 0.3290
- *
- * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized
- * (with [0 to 1] range) value of R, G, or B.
- *
- * if Vnonlinear < 0.081
- * Vlinear = Vnonlinear / 4.5
- * else
- * Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45)
- *
- * HDTV REC709 Gamma Correction (GC):
- *
- * if Vlinear < 0.018
- * Vnonlinear = 4.5 * Vlinear
- * else
- * Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099
- */
- STANDARD_BT709 = 5,
+ /**
+ * REC709 corresponds with display settings that implement
+ * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television.
+ * Rendering Intent: Colorimetric
+ * Primaries:
+ * x y
+ * green 0.300 0.600
+ * blue 0.150 0.060
+ * red 0.640 0.330
+ * white (D65) 0.3127 0.3290
+ *
+ * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized
+ * (with [0 to 1] range) value of R, G, or B.
+ *
+ * if Vnonlinear < 0.081
+ * Vlinear = Vnonlinear / 4.5
+ * else
+ * Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45)
+ *
+ * HDTV REC709 Gamma Correction (GC):
+ *
+ * if Vlinear < 0.018
+ * Vnonlinear = 4.5 * Vlinear
+ * else
+ * Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099
+ */
+ STANDARD_BT709 = 5,
- /**
- * DCI_P3 corresponds with display settings that implement
- * SMPTE EG 432-1 and SMPTE RP 431-2
- * Rendering Intent: Colorimetric
- * Primaries:
- * x y
- * green 0.265 0.690
- * blue 0.150 0.060
- * red 0.680 0.320
- * white (D65) 0.3127 0.3290
- *
- * Gamma: 2.6
- */
- DCI_P3 = 6,
+ /**
+ * DCI_P3 corresponds with display settings that implement
+ * SMPTE EG 432-1 and SMPTE RP 431-2
+ * Rendering Intent: Colorimetric
+ * Primaries:
+ * x y
+ * green 0.265 0.690
+ * blue 0.150 0.060
+ * red 0.680 0.320
+ * white (D65) 0.3127 0.3290
+ *
+ * Gamma: 2.6
+ */
+ DCI_P3 = 6,
- /**
- * SRGB corresponds with display settings that implement
- * the sRGB color space. Uses the same primaries as ITU-R Recommendation
- * BT.709
- * Rendering Intent: Colorimetric
- * Primaries:
- * x y
- * green 0.300 0.600
- * blue 0.150 0.060
- * red 0.640 0.330
- * white (D65) 0.3127 0.3290
- *
- * PC/Internet (sRGB) Inverse Gamma Correction (IGC):
- *
- * if Vnonlinear ≤ 0.03928
- * Vlinear = Vnonlinear / 12.92
- * else
- * Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4
- *
- * PC/Internet (sRGB) Gamma Correction (GC):
- *
- * if Vlinear ≤ 0.0031308
- * Vnonlinear = 12.92 * Vlinear
- * else
- * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
- */
- SRGB = 7,
+ /**
+ * SRGB corresponds with display settings that implement
+ * the sRGB color space. Uses the same primaries as ITU-R Recommendation
+ * BT.709
+ * Rendering Intent: Colorimetric
+ * Primaries:
+ * x y
+ * green 0.300 0.600
+ * blue 0.150 0.060
+ * red 0.640 0.330
+ * white (D65) 0.3127 0.3290
+ *
+ * PC/Internet (sRGB) Inverse Gamma Correction (IGC):
+ *
+ * if Vnonlinear ≤ 0.03928
+ * Vlinear = Vnonlinear / 12.92
+ * else
+ * Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4
+ *
+ * PC/Internet (sRGB) Gamma Correction (GC):
+ *
+ * if Vlinear ≤ 0.0031308
+ * Vnonlinear = 12.92 * Vlinear
+ * else
+ * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
+ */
+ SRGB = 7,
- /**
- * ADOBE_RGB corresponds with the RGB color space developed
- * by Adobe Systems, Inc. in 1998.
- * Rendering Intent: Colorimetric
- * Primaries:
- * x y
- * green 0.210 0.710
- * blue 0.150 0.060
- * red 0.640 0.330
- * white (D65) 0.3127 0.3290
- *
- * Gamma: 2.2
- */
- ADOBE_RGB = 8,
+ /**
+ * ADOBE_RGB corresponds with the RGB color space developed
+ * by Adobe Systems, Inc. in 1998.
+ * Rendering Intent: Colorimetric
+ * Primaries:
+ * x y
+ * green 0.210 0.710
+ * blue 0.150 0.060
+ * red 0.640 0.330
+ * white (D65) 0.3127 0.3290
+ *
+ * Gamma: 2.2
+ */
+ ADOBE_RGB = 8,
- /**
- * DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
- * the D65 white point and the SRGB transfer functions.
- * Rendering Intent: Colorimetric
- * Primaries:
- * x y
- * green 0.265 0.690
- * blue 0.150 0.060
- * red 0.680 0.320
- * white (D65) 0.3127 0.3290
- *
- * PC/Internet (sRGB) Gamma Correction (GC):
- *
- * if Vlinear ≤ 0.0030186
- * Vnonlinear = 12.92 * Vlinear
- * else
- * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
- *
- * Note: In most cases sRGB transfer function will be fine.
- */
- DISPLAY_P3 = 9
+ /**
+ * DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
+ * the D65 white point and the SRGB transfer functions.
+ * Rendering Intent: Colorimetric
+ * Primaries:
+ * x y
+ * green 0.265 0.690
+ * blue 0.150 0.060
+ * red 0.680 0.320
+ * white (D65) 0.3127 0.3290
+ *
+ * PC/Internet (sRGB) Gamma Correction (GC):
+ *
+ * if Vlinear ≤ 0.0030186
+ * Vnonlinear = 12.92 * Vlinear
+ * else
+ * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
+ *
+ * Note: In most cases sRGB transfer function will be fine.
+ */
+ DISPLAY_P3 = 9
};
/**
diff --git a/graphics/composer/2.1/default/ComposerClient.cpp b/graphics/composer/2.1/default/ComposerClient.cpp
index 87e4d3b..ce4e17f 100644
--- a/graphics/composer/2.1/default/ComposerClient.cpp
+++ b/graphics/composer/2.1/default/ComposerClient.cpp
@@ -655,18 +655,24 @@
auto fence = readFence();
auto dataspace = readSigned();
auto damage = readRegion((length - 4) / 4);
+ bool closeFence = true;
auto err = lookupBuffer(BufferCache::CLIENT_TARGETS,
slot, useCache, clientTarget, &clientTarget);
if (err == Error::NONE) {
err = mHal.setClientTarget(mDisplay, clientTarget, fence,
dataspace, damage);
-
- updateBuffer(BufferCache::CLIENT_TARGETS, slot, useCache,
- clientTarget);
+ auto updateBufErr = updateBuffer(BufferCache::CLIENT_TARGETS, slot,
+ useCache, clientTarget);
+ if (err == Error::NONE) {
+ closeFence = false;
+ err = updateBufErr;
+ }
+ }
+ if (closeFence) {
+ close(fence);
}
if (err != Error::NONE) {
- close(fence);
mWriter.setError(getCommandLoc(), err);
}
@@ -683,17 +689,23 @@
auto slot = read();
auto outputBuffer = readHandle(&useCache);
auto fence = readFence();
+ bool closeFence = true;
auto err = lookupBuffer(BufferCache::OUTPUT_BUFFERS,
slot, useCache, outputBuffer, &outputBuffer);
if (err == Error::NONE) {
err = mHal.setOutputBuffer(mDisplay, outputBuffer, fence);
-
- updateBuffer(BufferCache::OUTPUT_BUFFERS,
- slot, useCache, outputBuffer);
+ auto updateBufErr = updateBuffer(BufferCache::OUTPUT_BUFFERS,
+ slot, useCache, outputBuffer);
+ if (err == Error::NONE) {
+ closeFence = false;
+ err = updateBufErr;
+ }
+ }
+ if (closeFence) {
+ close(fence);
}
if (err != Error::NONE) {
- close(fence);
mWriter.setError(getCommandLoc(), err);
}
@@ -786,17 +798,23 @@
auto slot = read();
auto buffer = readHandle(&useCache);
auto fence = readFence();
+ bool closeFence = true;
auto err = lookupBuffer(BufferCache::LAYER_BUFFERS,
slot, useCache, buffer, &buffer);
if (err == Error::NONE) {
err = mHal.setLayerBuffer(mDisplay, mLayer, buffer, fence);
-
- updateBuffer(BufferCache::LAYER_BUFFERS,
- slot, useCache, buffer);
+ auto updateBufErr = updateBuffer(BufferCache::LAYER_BUFFERS, slot,
+ useCache, buffer);
+ if (err == Error::NONE) {
+ closeFence = false;
+ err = updateBufErr;
+ }
+ }
+ if (closeFence) {
+ close(fence);
}
if (err != Error::NONE) {
- close(fence);
mWriter.setError(getCommandLoc(), err);
}
@@ -915,8 +933,10 @@
auto err = lookupLayerSidebandStream(stream, &stream);
if (err == Error::NONE) {
err = mHal.setLayerSidebandStream(mDisplay, mLayer, stream);
-
- updateLayerSidebandStream(stream);
+ auto updateErr = updateLayerSidebandStream(stream);
+ if (err == Error::NONE) {
+ err = updateErr;
+ }
}
if (err != Error::NONE) {
mWriter.setError(getCommandLoc(), err);
@@ -1097,21 +1117,24 @@
return Error::NONE;
}
-void ComposerClient::CommandReader::updateBuffer(BufferCache cache,
+Error ComposerClient::CommandReader::updateBuffer(BufferCache cache,
uint32_t slot, bool useCache, buffer_handle_t handle)
{
// handle was looked up from cache
if (useCache) {
- return;
+ return Error::NONE;
}
std::lock_guard<std::mutex> lock(mClient.mDisplayDataMutex);
BufferCacheEntry* entry = nullptr;
- lookupBufferCacheEntryLocked(cache, slot, &entry);
- LOG_FATAL_IF(!entry, "failed to find the cache entry to update");
+ Error error = lookupBufferCacheEntryLocked(cache, slot, &entry);
+ if (error != Error::NONE) {
+ return error;
+ }
*entry = handle;
+ return Error::NONE;
}
} // namespace implementation
diff --git a/graphics/composer/2.1/default/ComposerClient.h b/graphics/composer/2.1/default/ComposerClient.h
index c973351..3d10f80 100644
--- a/graphics/composer/2.1/default/ComposerClient.h
+++ b/graphics/composer/2.1/default/ComposerClient.h
@@ -173,7 +173,7 @@
Error lookupBuffer(BufferCache cache, uint32_t slot,
bool useCache, buffer_handle_t handle,
buffer_handle_t* outHandle);
- void updateBuffer(BufferCache cache, uint32_t slot,
+ Error updateBuffer(BufferCache cache, uint32_t slot,
bool useCache, buffer_handle_t handle);
Error lookupLayerSidebandStream(buffer_handle_t handle,
@@ -182,9 +182,9 @@
return lookupBuffer(BufferCache::LAYER_SIDEBAND_STREAMS,
0, false, handle, outHandle);
}
- void updateLayerSidebandStream(buffer_handle_t handle)
+ Error updateLayerSidebandStream(buffer_handle_t handle)
{
- updateBuffer(BufferCache::LAYER_SIDEBAND_STREAMS,
+ return updateBuffer(BufferCache::LAYER_SIDEBAND_STREAMS,
0, false, handle);
}
diff --git a/ir/1.0/Android.bp b/ir/1.0/Android.bp
index 6f52736..2612bd2 100644
--- a/ir/1.0/Android.bp
+++ b/ir/1.0/Android.bp
@@ -52,13 +52,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index f583a42..d62e0a3 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -59,13 +59,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index 768de49..e89a743 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -80,13 +80,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/radio/deprecated/1.0/Android.bp b/radio/deprecated/1.0/Android.bp
index e81186c..af93ec5 100644
--- a/radio/deprecated/1.0/Android.bp
+++ b/radio/deprecated/1.0/Android.bp
@@ -63,7 +63,6 @@
"libutils",
"libcutils",
"android.hardware.radio@1.0",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
@@ -71,6 +70,5 @@
"libhwbinder",
"libutils",
"android.hardware.radio@1.0",
- "android.hidl.base@1.0",
],
}
diff --git a/renderscript/1.0/Android.bp b/renderscript/1.0/Android.bp
index b82dc4a..b92b6f6 100644
--- a/renderscript/1.0/Android.bp
+++ b/renderscript/1.0/Android.bp
@@ -59,13 +59,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/renderscript/1.0/default/Android.bp b/renderscript/1.0/default/Android.bp
index 29b781e..c4bd1b3 100644
--- a/renderscript/1.0/default/Android.bp
+++ b/renderscript/1.0/default/Android.bp
@@ -17,6 +17,5 @@
"libhidltransport",
"libutils",
"android.hardware.renderscript@1.0",
- "android.hidl.base@1.0",
],
}
diff --git a/sensors/1.0/default/Sensors.h b/sensors/1.0/default/Sensors.h
index 7d715e0..be00a96 100644
--- a/sensors/1.0/default/Sensors.h
+++ b/sensors/1.0/default/Sensors.h
@@ -18,6 +18,7 @@
#define HARDWARE_INTERFACES_SENSORS_V1_0_DEFAULT_SENSORS_H_
+#include <android-base/macros.h>
#include <android/hardware/sensors/1.0/ISensors.h>
#include <hardware/sensors.h>
#include <mutex>
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index f7a6f75..8b2111f 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -81,7 +81,6 @@
"libutils",
"libcutils",
"android.hardware.tests.foo@1.0",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
@@ -89,6 +88,5 @@
"libhwbinder",
"libutils",
"android.hardware.tests.foo@1.0",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index e55a782..22e1e4b 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -73,13 +73,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/baz/1.0/default/Android.bp b/tests/baz/1.0/default/Android.bp
index 794cdf5..ef1c28e 100644
--- a/tests/baz/1.0/default/Android.bp
+++ b/tests/baz/1.0/default/Android.bp
@@ -12,6 +12,5 @@
"libhidltransport",
"libutils",
"android.hardware.tests.baz@1.0",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index 6fcc0f8..9b938b1 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -55,13 +55,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index a631be8..da2120f 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -80,13 +80,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/hash/1.0/Android.bp b/tests/hash/1.0/Android.bp
index aeefeed..db72039 100644
--- a/tests/hash/1.0/Android.bp
+++ b/tests/hash/1.0/Android.bp
@@ -48,13 +48,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/hash/1.0/default/Android.bp b/tests/hash/1.0/default/Android.bp
index e798a66..d6e9630 100644
--- a/tests/hash/1.0/default/Android.bp
+++ b/tests/hash/1.0/default/Android.bp
@@ -10,6 +10,5 @@
"libhidltransport",
"libutils",
"android.hardware.tests.hash@1.0",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
index 11ee4f9..8569c40 100644
--- a/tests/inheritance/1.0/Android.bp
+++ b/tests/inheritance/1.0/Android.bp
@@ -69,13 +69,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index e8d28a3..62e0050 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -55,13 +55,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/memory/1.0/Android.bp b/tests/memory/1.0/Android.bp
index e49f436..4d8febf 100644
--- a/tests/memory/1.0/Android.bp
+++ b/tests/memory/1.0/Android.bp
@@ -48,13 +48,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index 98bdd19..e5d3a82 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -55,13 +55,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/msgq/1.0/default/Android.bp b/tests/msgq/1.0/default/Android.bp
index 16018ac..e3c49e7 100644
--- a/tests/msgq/1.0/default/Android.bp
+++ b/tests/msgq/1.0/default/Android.bp
@@ -31,7 +31,6 @@
"liblog",
"libutils",
"android.hardware.tests.msgq@1.0",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index 48f2ec0..d1eafb0 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -55,13 +55,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/versioning/1.0/Android.bp b/tests/versioning/1.0/Android.bp
index ee41ea4..13c1327 100644
--- a/tests/versioning/1.0/Android.bp
+++ b/tests/versioning/1.0/Android.bp
@@ -48,13 +48,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/versioning/2.2/Android.bp b/tests/versioning/2.2/Android.bp
index bf412a6..910f7b4 100644
--- a/tests/versioning/2.2/Android.bp
+++ b/tests/versioning/2.2/Android.bp
@@ -55,13 +55,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/versioning/2.3/Android.bp b/tests/versioning/2.3/Android.bp
index a8aee8e..6359eba 100644
--- a/tests/versioning/2.3/Android.bp
+++ b/tests/versioning/2.3/Android.bp
@@ -64,7 +64,6 @@
"libcutils",
"android.hardware.tests.versioning@1.0",
"android.hardware.tests.versioning@2.2",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
@@ -73,6 +72,5 @@
"libutils",
"android.hardware.tests.versioning@1.0",
"android.hardware.tests.versioning@2.2",
- "android.hidl.base@1.0",
],
}
diff --git a/tests/versioning/2.4/Android.bp b/tests/versioning/2.4/Android.bp
index 37e787f..67cc318 100644
--- a/tests/versioning/2.4/Android.bp
+++ b/tests/versioning/2.4/Android.bp
@@ -50,7 +50,6 @@
"libcutils",
"android.hardware.tests.versioning@2.2",
"android.hardware.tests.versioning@2.3",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
@@ -59,6 +58,5 @@
"libutils",
"android.hardware.tests.versioning@2.2",
"android.hardware.tests.versioning@2.3",
- "android.hidl.base@1.0",
],
}
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index 9126aaf..256fad4 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -136,13 +136,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index d6cb071..bc57cf7 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -129,13 +129,11 @@
"liblog",
"libutils",
"libcutils",
- "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
- "android.hidl.base@1.0",
],
}