Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f04688cb authored by Connor O'Brien's avatar Connor O'Brien
Browse files

Fix incomplete Power HAL VTS tests



Add missing Android.mk files and the option to test either binderized
or pass-through implementation.

Bug: 32022775
Test: Built and ran tests.
Change-Id: Ie28a53c92b3512c946416e43e8410ca5bef1274f
Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
parent 100b491d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -77,3 +77,5 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_PROTOC_OPTIMIZE_TYPE := full

include $(BUILD_SHARED_LIBRARY)

include $(call all-makefiles-under,$(LOCAL_PATH))
+19 −0
Original line number Diff line number Diff line
#
# 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)

include $(call all-subdir-makefiles)
+13 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#define LOG_TAG "power_hidl_hal_test"
#include <android-base/logging.h>

#include <cutils/properties.h>

#include <android/hardware/power/1.0/IPower.h>

#include <gtest/gtest.h>
@@ -33,8 +35,18 @@ using ::android::sp;
class PowerHidlTest : public ::testing::Test {
 public:
  virtual void SetUp() override {
    power = IPower::getService("power");
    // TODO(b/33385836) Delete copied code
    bool getStub = false;
    char getSubProperty[PROPERTY_VALUE_MAX];
    if (property_get("vts.hidl.get_stub", getSubProperty, "") > 0) {
        if (!strcmp(getSubProperty, "true") || !strcmp(getSubProperty, "True") ||
            !strcmp(getSubProperty, "1")) {
            getStub = true;
        }
    }
    power = IPower::getService("power", getStub);
    ASSERT_NE(power, nullptr);
    ASSERT_EQ(!getStub, power->isRemote());
  }

  virtual void TearDown() override {}
+19 −0
Original line number Diff line number Diff line
#
# 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)

include $(call all-subdir-makefiles)
+19 −0
Original line number Diff line number Diff line
#
# 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)

include $(call all-subdir-makefiles)
Loading