Merge RP1A.200123.001
Change-Id: I91fea1c6186382188fe874e2f92d6c894873f219
diff --git a/automotive/OWNERS b/automotive/OWNERS
new file mode 100644
index 0000000..e5a11e8
--- /dev/null
+++ b/automotive/OWNERS
@@ -0,0 +1,3 @@
+haoxiangl@google.com
+swan@google.com
+changyeon@google.com
diff --git a/automotive/display/1.0/Android.bp b/automotive/display/1.0/Android.bp
new file mode 100644
index 0000000..25ff06a
--- /dev/null
+++ b/automotive/display/1.0/Android.bp
@@ -0,0 +1,20 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+ name: "android.frameworks.automotive.display@1.0",
+ root: "android.frameworks",
+ vndk: {
+ enabled: true,
+ },
+ srcs: [
+ "ICarWindowService.hal",
+ ],
+ interfaces: [
+ "android.hardware.graphics.bufferqueue@2.0",
+ "android.hardware.graphics.common@1.0",
+ "android.hardware.graphics.common@1.1",
+ "android.hardware.graphics.common@1.2",
+ "android.hidl.base@1.0",
+ ],
+ gen_java: true,
+}
diff --git a/automotive/display/1.0/ICarWindowService.hal b/automotive/display/1.0/ICarWindowService.hal
new file mode 100644
index 0000000..62851f3
--- /dev/null
+++ b/automotive/display/1.0/ICarWindowService.hal
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.frameworks.automotive.display@1.0;
+
+import android.hardware.graphics.bufferqueue@2.0::IGraphicBufferProducer;
+
+interface ICarWindowService {
+ /**
+ * Gets an IGraphicBufferProducer instance from the service.
+ *
+ * @return igbp Returns an IGraphicBufferProducer object, that can be
+ * converted to an ANativeWindow object.
+ */
+ getIGraphicBufferProducer() generates (IGraphicBufferProducer igbp);
+
+ /**
+ * Sets the ANativeWindow, which is associated with the
+ * IGraphicBufferProducer, to be visible and to take over the display.
+ *
+ * @return success Returns true on success.
+ */
+ showWindow() generates (bool success);
+
+ /**
+ * Sets the ANativeWindow, which is associated with the
+ * IGraphicBufferProducer, to be invisible and to release the control
+ * over display.
+ *
+ * @return success Returns true on success.
+ */
+ hideWindow() generates (bool success);
+};
diff --git a/automotive/display/1.0/vts/functional/Android.bp b/automotive/display/1.0/vts/functional/Android.bp
new file mode 100644
index 0000000..6960387
--- /dev/null
+++ b/automotive/display/1.0/vts/functional/Android.bp
@@ -0,0 +1,44 @@
+//
+// Copyright (C) 2019 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.
+//
+
+cc_test {
+ name: "VtsHalAutomotiveDisplayV1_0TargetTest",
+ srcs: [
+ "VtsHalAutomotiveDisplayV1_0TargetTest.cpp",
+ ],
+ defaults: ["VtsHalTargetTestDefaults"],
+ shared_libs: [
+ "libui",
+ "libgui",
+ ],
+ static_libs: [
+ "android.frameworks.automotive.display@1.0",
+ "android.hardware.graphics.bufferqueue@2.0",
+ "android.hardware.automotive.evs@common-default-lib",
+ "android.hardware.graphics.common@1.0",
+ "android.hardware.graphics.common@1.1",
+ "android.hardware.graphics.common@1.2",
+ "android.hardware.camera.device@3.2",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts-core",
+ ],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
diff --git a/automotive/display/1.0/vts/functional/VtsHalAutomotiveDisplayV1_0TargetTest.cpp b/automotive/display/1.0/vts/functional/VtsHalAutomotiveDisplayV1_0TargetTest.cpp
new file mode 100644
index 0000000..f407b16
--- /dev/null
+++ b/automotive/display/1.0/vts/functional/VtsHalAutomotiveDisplayV1_0TargetTest.cpp
@@ -0,0 +1,72 @@
+//
+// Copyright (C) 2020 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 "VtsHalAutomotiveDisplayTest"
+#include <android-base/logging.h>
+
+#include <android/frameworks/automotive/display/1.0/ICarWindowService.h>
+#include <android/hardware/graphics/bufferqueue/2.0/IGraphicBufferProducer.h>
+#include <utils/Log.h>
+
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
+
+using namespace ::android::frameworks::automotive::display::V1_0;
+using ::android::hardware::graphics::bufferqueue::V2_0::IGraphicBufferProducer;
+using ::android::sp;
+
+// The main test class for Automotive Display Service
+class AutomotiveDisplayHidlTest : public ::testing::TestWithParam<std::string> {
+public:
+ virtual void SetUp() override {
+ // Make sure we can connect to the service
+ mCarWindowService = ICarWindowService::getService(GetParam());
+ ASSERT_NE(mCarWindowService.get(), nullptr);
+ }
+
+ virtual void TearDown() override {}
+
+ sp<ICarWindowService> mCarWindowService; // Every test needs access to the service
+};
+
+TEST_P(AutomotiveDisplayHidlTest, getIGBP) {
+ ALOGI("Test getIGraphicBufferProducer method");
+
+ sp<IGraphicBufferProducer> igbp = mCarWindowService->getIGraphicBufferProducer();
+ ASSERT_NE(igbp, nullptr);
+}
+
+TEST_P(AutomotiveDisplayHidlTest, showWindow) {
+ ALOGI("Test showWindow method");
+
+ ASSERT_EQ(mCarWindowService->showWindow(), true);
+}
+
+TEST_P(AutomotiveDisplayHidlTest, hideWindow) {
+ ALOGI("Test hideWindow method");
+
+ ASSERT_EQ(mCarWindowService->hideWindow(), true);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance,
+ AutomotiveDisplayHidlTest,
+ testing::ValuesIn(
+ android::hardware::getAllHalInstanceNames(ICarWindowService::descriptor)
+ ),
+ android::hardware::PrintInstanceNameToString
+);
diff --git a/stats/1.0/test_client/Android.bp b/stats/1.0/test_client/Android.bp
index 9ebb3b9..85d2882 100644
--- a/stats/1.0/test_client/Android.bp
+++ b/stats/1.0/test_client/Android.bp
@@ -6,7 +6,6 @@
shared_libs: [
"libbase",
"libhidlbase",
- "libmetricslogger",
"libutils",
"libstatslog",
"android.frameworks.stats@1.0",