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

Commit 6d9ec22d authored by Connor O'Brien's avatar Connor O'Brien Committed by Android (Google) Code Review
Browse files

Merge "Fix incomplete Power HAL VTS tests"

parents 163e9d68 f04688cb
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