VTS driver files for Power HAL.
Test: manual
Change-Id: Iab0356aa988b2c274f7444bcdddee56aaeab14ea
diff --git a/power/1.0/vts/Android.mk b/power/1.0/vts/Android.mk
new file mode 100644
index 0000000..4d5117b
--- /dev/null
+++ b/power/1.0/vts/Android.mk
@@ -0,0 +1,86 @@
+#
+# Copyright (C) 2016 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# build VTS driver for Power v1.0.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_driver_hidl_power@1.0
+
+LOCAL_SRC_FILES := \
+ Power.vts \
+ types.vts \
+
+LOCAL_C_INCLUDES := \
+ android.hardware.power@1.0 \
+ system/core/base/include \
+ system/core/include \
+
+LOCAL_SHARED_LIBRARIES += \
+ android.hardware.power@1.0 \
+ libbase \
+ libutils \
+ libcutils \
+ liblog \
+ libhidl \
+ libhwbinder \
+ libprotobuf-cpp-full \
+ libvts_common \
+ libvts_datatype \
+ libvts_measurement \
+ libvts_multidevice_proto \
+
+LOCAL_CFLAGS += -DENABLE_TREBLE
+
+LOCAL_STATIC_LIBRARIES := \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+LOCAL_MULTILIB := both
+
+include $(BUILD_SHARED_LIBRARY)
+
+# build profiler for power.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_profiler_hidl_power@1.0
+
+LOCAL_SRC_FILES := \
+ Power.vts \
+ types.vts \
+
+LOCAL_C_INCLUDES += \
+ test/vts/drivers/libprofiling \
+
+LOCAL_VTS_MODE := PROFILER
+
+LOCAL_SHARED_LIBRARIES := \
+ android.hardware.power@1.0 \
+ libbase \
+ libcutils \
+ liblog \
+ libhidl \
+ libhwbinder \
+ libprotobuf-cpp-full \
+ libvts_common \
+ libvts_multidevice_proto \
+ libvts_profiling \
+ libutils \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/power/1.0/vts/Power.vts b/power/1.0/vts/Power.vts
new file mode 100644
index 0000000..1711290
--- /dev/null
+++ b/power/1.0/vts/Power.vts
@@ -0,0 +1,57 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IPower"
+
+package: "android.hardware.power"
+
+import: "android.hardware.power@1.0::types"
+
+interface: {
+ api: {
+ name: "setInteractive"
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "bool_t"
+ }
+ }
+
+ api: {
+ name: "powerHint"
+ arg: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::power::V1_0::PowerHint"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ }
+
+ api: {
+ name: "setFeature"
+ arg: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::power::V1_0::Feature"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "bool_t"
+ }
+ }
+
+ api: {
+ name: "getPlatformLowPowerStats"
+ return_type_hidl: {
+ type: TYPE_VECTOR
+ vector_value: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::power::V1_0::PowerStatePlatformSleepState"
+ }
+ }
+ return_type_hidl: {
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::power::V1_0::Status"
+ }
+ }
+
+}
diff --git a/power/1.0/vts/types.vts b/power/1.0/vts/types.vts
new file mode 100644
index 0000000..94c003b
--- /dev/null
+++ b/power/1.0/vts/types.vts
@@ -0,0 +1,133 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.power"
+
+
+attribute: {
+ name: "::android::hardware::power::V1_0::PowerHint"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint32_t"
+
+ enumerator: "VSYNC"
+ scalar_value: {
+ uint32_t: 1
+ }
+ enumerator: "INTERACTION"
+ scalar_value: {
+ uint32_t: 2
+ }
+ enumerator: "VIDEO_ENCODE"
+ scalar_value: {
+ uint32_t: 3
+ }
+ enumerator: "VIDEO_DECODE"
+ scalar_value: {
+ uint32_t: 4
+ }
+ enumerator: "LOW_POWER"
+ scalar_value: {
+ uint32_t: 5
+ }
+ enumerator: "SUSTAINED_PERFORMANCE"
+ scalar_value: {
+ uint32_t: 6
+ }
+ enumerator: "VR_MODE"
+ scalar_value: {
+ uint32_t: 7
+ }
+ enumerator: "LAUNCH"
+ scalar_value: {
+ uint32_t: 8
+ }
+ enumerator: "DISABLE_TOUCH"
+ scalar_value: {
+ uint32_t: 9
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::power::V1_0::Feature"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint32_t"
+
+ enumerator: "POWER_FEATURE_DOUBLE_TAP_TO_WAKE"
+ scalar_value: {
+ uint32_t: 1
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::power::V1_0::Status"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint32_t"
+
+ enumerator: "SUCCESS"
+ scalar_value: {
+ uint32_t: 0
+ }
+ enumerator: "FILESYSTEM_ERROR"
+ scalar_value: {
+ uint32_t: 1
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::power::V1_0::PowerStateVoter"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "name"
+ type: TYPE_STRING
+ }
+ struct_value: {
+ name: "totalTimeInMsecVotedForSinceBoot"
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ struct_value: {
+ name: "totalNumberOfTimesVotedSinceBoot"
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+}
+
+attribute: {
+ name: "::android::hardware::power::V1_0::PowerStatePlatformSleepState"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "name"
+ type: TYPE_STRING
+ }
+ struct_value: {
+ name: "residencyInMsecSinceBoot"
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ struct_value: {
+ name: "totalTransitions"
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ struct_value: {
+ name: "supportedOnlyInSuspend"
+ type: TYPE_SCALAR
+ scalar_type: "bool_t"
+ }
+ struct_value: {
+ name: "voters"
+ type: TYPE_VECTOR
+ vector_value: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::power::V1_0::PowerStateVoter"
+ }
+ }
+}
+