Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #include <aidl/Gtest.h> |
| 17 | #include <aidl/Vintf.h> |
| 18 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 19 | #include <aidl/android/hardware/power/BnPower.h> |
| 20 | #include <aidl/android/hardware/power/BnPowerHintSession.h> |
Dan Stoza | cca8027 | 2020-01-13 13:06:13 -0800 | [diff] [blame] | 21 | #include <android-base/properties.h> |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 22 | #include <android/binder_ibinder.h> |
| 23 | #include <android/binder_manager.h> |
| 24 | #include <android/binder_process.h> |
Wei Wang | 9df909d | 2021-06-12 18:26:38 -0700 | [diff] [blame] | 25 | #include <android/binder_status.h> |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 26 | |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 27 | #include <fmq/AidlMessageQueue.h> |
| 28 | #include <fmq/EventFlag.h> |
| 29 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 30 | #include <unistd.h> |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 31 | #include <cstdint> |
| 32 | #include "aidl/android/hardware/common/fmq/SynchronizedReadWrite.h" |
| 33 | #include "fmq/EventFlag.h" |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 34 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 35 | namespace aidl::android::hardware::power { |
| 36 | namespace { |
| 37 | |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 38 | using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; |
| 39 | using ::android::AidlMessageQueue; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 40 | using android::hardware::power::Boost; |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 41 | using android::hardware::power::ChannelConfig; |
| 42 | using android::hardware::power::ChannelMessage; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 43 | using android::hardware::power::IPower; |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 44 | using android::hardware::power::IPowerHintSession; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 45 | using android::hardware::power::Mode; |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 46 | using android::hardware::power::SessionHint; |
Matt Buckley | 1fde90c | 2023-06-28 19:55:26 +0000 | [diff] [blame] | 47 | using android::hardware::power::SessionMode; |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 48 | using android::hardware::power::WorkDuration; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 49 | |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 50 | using SessionMessageQueue = AidlMessageQueue<ChannelMessage, SynchronizedReadWrite>; |
| 51 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 52 | const std::vector<Boost> kBoosts{ndk::enum_range<Boost>().begin(), ndk::enum_range<Boost>().end()}; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 53 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 54 | const std::vector<Mode> kModes{ndk::enum_range<Mode>().begin(), ndk::enum_range<Mode>().end()}; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 55 | |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 56 | const std::vector<SessionHint> kSessionHints{ndk::enum_range<SessionHint>().begin(), |
| 57 | ndk::enum_range<SessionHint>().end()}; |
| 58 | |
Matt Buckley | 1fde90c | 2023-06-28 19:55:26 +0000 | [diff] [blame] | 59 | const std::vector<SessionMode> kSessionModes{ndk::enum_range<SessionMode>().begin(), |
| 60 | ndk::enum_range<SessionMode>().end()}; |
| 61 | |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 62 | const std::vector<Boost> kInvalidBoosts = { |
| 63 | static_cast<Boost>(static_cast<int32_t>(kBoosts.front()) - 1), |
| 64 | static_cast<Boost>(static_cast<int32_t>(kBoosts.back()) + 1), |
| 65 | }; |
| 66 | |
| 67 | const std::vector<Mode> kInvalidModes = { |
| 68 | static_cast<Mode>(static_cast<int32_t>(kModes.front()) - 1), |
| 69 | static_cast<Mode>(static_cast<int32_t>(kModes.back()) + 1), |
| 70 | }; |
| 71 | |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 72 | const std::vector<SessionHint> kInvalidSessionHints = { |
| 73 | static_cast<SessionHint>(static_cast<int32_t>(kSessionHints.front()) - 1), |
| 74 | static_cast<SessionHint>(static_cast<int32_t>(kSessionHints.back()) + 1), |
| 75 | }; |
| 76 | |
Matt Buckley | 1fde90c | 2023-06-28 19:55:26 +0000 | [diff] [blame] | 77 | const std::vector<SessionMode> kInvalidSessionModes = { |
| 78 | static_cast<SessionMode>(static_cast<int32_t>(kSessionModes.front()) - 1), |
| 79 | static_cast<SessionMode>(static_cast<int32_t>(kSessionModes.back()) + 1), |
| 80 | }; |
| 81 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 82 | class DurationWrapper : public WorkDuration { |
| 83 | public: |
| 84 | DurationWrapper(int64_t dur, int64_t time) { |
| 85 | durationNanos = dur; |
| 86 | timeStampNanos = time; |
| 87 | } |
| 88 | }; |
| 89 | |
| 90 | const std::vector<int32_t> kSelfTids = { |
| 91 | gettid(), |
| 92 | }; |
| 93 | |
| 94 | const std::vector<int32_t> kEmptyTids = {}; |
| 95 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 96 | const std::vector<WorkDuration> kDurationsWithZero = { |
| 97 | DurationWrapper(1000L, 1L), |
| 98 | DurationWrapper(0L, 2L), |
| 99 | }; |
| 100 | |
| 101 | const std::vector<WorkDuration> kDurationsWithNegative = { |
| 102 | DurationWrapper(1000L, 1L), |
| 103 | DurationWrapper(-1000L, 2L), |
| 104 | }; |
| 105 | |
| 106 | const std::vector<WorkDuration> kDurations = { |
| 107 | DurationWrapper(1L, 1L), |
| 108 | DurationWrapper(1000L, 2L), |
| 109 | DurationWrapper(1000000L, 3L), |
| 110 | DurationWrapper(1000000000L, 4L), |
| 111 | }; |
| 112 | |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 113 | class PowerAidl : public testing::TestWithParam<std::string> { |
| 114 | public: |
| 115 | virtual void SetUp() override { |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 116 | AIBinder* binder = AServiceManager_waitForService(GetParam().c_str()); |
| 117 | ASSERT_NE(binder, nullptr); |
| 118 | power = IPower::fromBinder(ndk::SpAIBinder(binder)); |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 119 | auto status = power->getInterfaceVersion(&mServiceVersion); |
| 120 | ASSERT_TRUE(status.isOk()); |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 121 | } |
| 122 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 123 | std::shared_ptr<IPower> power; |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 124 | int32_t mServiceVersion; |
| 125 | }; |
| 126 | |
| 127 | class HintSessionAidl : public PowerAidl { |
| 128 | public: |
| 129 | virtual void SetUp() override { |
| 130 | PowerAidl::SetUp(); |
| 131 | if (mServiceVersion < 2) { |
| 132 | GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; |
| 133 | } |
| 134 | |
| 135 | auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession); |
| 136 | ASSERT_TRUE(status.isOk()); |
| 137 | ASSERT_NE(nullptr, mSession); |
| 138 | } |
| 139 | std::shared_ptr<IPowerHintSession> mSession; |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 140 | }; |
| 141 | |
| 142 | TEST_P(PowerAidl, setMode) { |
| 143 | for (const auto& mode : kModes) { |
| 144 | ASSERT_TRUE(power->setMode(mode, true).isOk()); |
| 145 | ASSERT_TRUE(power->setMode(mode, false).isOk()); |
| 146 | } |
| 147 | for (const auto& mode : kInvalidModes) { |
| 148 | ASSERT_TRUE(power->setMode(mode, true).isOk()); |
| 149 | ASSERT_TRUE(power->setMode(mode, false).isOk()); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | TEST_P(PowerAidl, isModeSupported) { |
| 154 | for (const auto& mode : kModes) { |
| 155 | bool supported; |
| 156 | ASSERT_TRUE(power->isModeSupported(mode, &supported).isOk()); |
| 157 | } |
| 158 | for (const auto& mode : kInvalidModes) { |
| 159 | bool supported; |
| 160 | ASSERT_TRUE(power->isModeSupported(mode, &supported).isOk()); |
Dan Stoza | cca8027 | 2020-01-13 13:06:13 -0800 | [diff] [blame] | 161 | // Should return false for values outside enum |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 162 | ASSERT_FALSE(supported); |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | TEST_P(PowerAidl, setBoost) { |
| 167 | for (const auto& boost : kBoosts) { |
| 168 | ASSERT_TRUE(power->setBoost(boost, 0).isOk()); |
| 169 | ASSERT_TRUE(power->setBoost(boost, 1000).isOk()); |
| 170 | ASSERT_TRUE(power->setBoost(boost, -1).isOk()); |
| 171 | } |
| 172 | for (const auto& boost : kInvalidBoosts) { |
| 173 | ASSERT_TRUE(power->setBoost(boost, 0).isOk()); |
| 174 | ASSERT_TRUE(power->setBoost(boost, 1000).isOk()); |
| 175 | ASSERT_TRUE(power->setBoost(boost, -1).isOk()); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | TEST_P(PowerAidl, isBoostSupported) { |
| 180 | for (const auto& boost : kBoosts) { |
| 181 | bool supported; |
| 182 | ASSERT_TRUE(power->isBoostSupported(boost, &supported).isOk()); |
| 183 | } |
| 184 | for (const auto& boost : kInvalidBoosts) { |
| 185 | bool supported; |
| 186 | ASSERT_TRUE(power->isBoostSupported(boost, &supported).isOk()); |
Dan Stoza | cca8027 | 2020-01-13 13:06:13 -0800 | [diff] [blame] | 187 | // Should return false for values outside enum |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 188 | ASSERT_FALSE(supported); |
| 189 | } |
| 190 | } |
| 191 | |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 192 | TEST_P(PowerAidl, getHintSessionPreferredRate) { |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 193 | if (mServiceVersion < 2) { |
| 194 | GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 195 | } |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 196 | |
| 197 | int64_t rate = -1; |
| 198 | ASSERT_TRUE(power->getHintSessionPreferredRate(&rate).isOk()); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 199 | // At least 1ms rate limit from HAL |
| 200 | ASSERT_GE(rate, 1000000); |
| 201 | } |
| 202 | |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 203 | TEST_P(PowerAidl, createHintSessionWithConfig) { |
| 204 | if (mServiceVersion < 5) { |
| 205 | GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; |
| 206 | } |
| 207 | std::shared_ptr<IPowerHintSession> session; |
| 208 | SessionConfig config; |
| 209 | |
| 210 | auto status = power->createHintSessionWithConfig(getpid(), getuid(), kSelfTids, 16666666L, |
| 211 | SessionTag::OTHER, &config, &session); |
| 212 | ASSERT_TRUE(status.isOk()); |
| 213 | ASSERT_NE(nullptr, session); |
| 214 | } |
| 215 | |
| 216 | TEST_P(PowerAidl, getAndCloseSessionChannel) { |
| 217 | if (mServiceVersion < 5) { |
| 218 | GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; |
| 219 | } |
| 220 | ChannelConfig config; |
| 221 | auto status = power->getSessionChannel(getpid(), getuid(), &config); |
| 222 | ASSERT_TRUE(status.isOk()); |
| 223 | auto messageQueue = std::make_shared<SessionMessageQueue>(config.channelDescriptor, true); |
| 224 | ASSERT_TRUE(messageQueue->isValid()); |
| 225 | ASSERT_TRUE(power->closeSessionChannel(getpid(), getuid()).isOk()); |
| 226 | } |
| 227 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 228 | TEST_P(HintSessionAidl, createAndCloseHintSession) { |
| 229 | ASSERT_TRUE(mSession->pause().isOk()); |
| 230 | ASSERT_TRUE(mSession->resume().isOk()); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 231 | // Test normal destroy operation |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 232 | ASSERT_TRUE(mSession->close().isOk()); |
| 233 | mSession.reset(); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 234 | } |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 235 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 236 | TEST_P(HintSessionAidl, createHintSessionFailed) { |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 237 | std::shared_ptr<IPowerHintSession> session; |
| 238 | auto status = power->createHintSession(getpid(), getuid(), kEmptyTids, 16666666L, &session); |
Peiyong Lin | 3e0eb72 | 2022-10-17 19:55:20 +0000 | [diff] [blame] | 239 | |
| 240 | // Regardless of whether V2 and beyond is supported, the status is always not STATUS_OK. |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 241 | ASSERT_FALSE(status.isOk()); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 242 | ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); |
| 243 | } |
| 244 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 245 | TEST_P(HintSessionAidl, updateAndReportDurations) { |
| 246 | ASSERT_TRUE(mSession->updateTargetWorkDuration(16666667LL).isOk()); |
| 247 | ASSERT_TRUE(mSession->reportActualWorkDuration(kDurations).isOk()); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 248 | } |
| 249 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 250 | TEST_P(HintSessionAidl, sendSessionHint) { |
| 251 | if (mServiceVersion < 4) { |
| 252 | GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 253 | } |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 254 | |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 255 | for (const auto& sessionHint : kSessionHints) { |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 256 | ASSERT_TRUE(mSession->sendHint(sessionHint).isOk()); |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 257 | } |
| 258 | for (const auto& sessionHint : kInvalidSessionHints) { |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 259 | ASSERT_TRUE(mSession->sendHint(sessionHint).isOk()); |
Matt Buckley | 1384388 | 2022-09-15 22:32:56 +0000 | [diff] [blame] | 260 | } |
| 261 | } |
| 262 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 263 | TEST_P(HintSessionAidl, setThreads) { |
| 264 | if (mServiceVersion < 4) { |
| 265 | GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; |
Peiyong Lin | c785459 | 2022-10-13 00:10:31 +0000 | [diff] [blame] | 266 | } |
Peiyong Lin | c785459 | 2022-10-13 00:10:31 +0000 | [diff] [blame] | 267 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 268 | auto status = mSession->setThreads(kEmptyTids); |
Peiyong Lin | c785459 | 2022-10-13 00:10:31 +0000 | [diff] [blame] | 269 | ASSERT_FALSE(status.isOk()); |
| 270 | ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); |
| 271 | |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 272 | ASSERT_TRUE(mSession->setThreads(kSelfTids).isOk()); |
Peiyong Lin | c785459 | 2022-10-13 00:10:31 +0000 | [diff] [blame] | 273 | } |
| 274 | |
Matt Buckley | 1fde90c | 2023-06-28 19:55:26 +0000 | [diff] [blame] | 275 | TEST_P(HintSessionAidl, setSessionMode) { |
| 276 | if (mServiceVersion < 5) { |
| 277 | GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; |
| 278 | } |
| 279 | |
| 280 | for (const auto& sessionMode : kSessionModes) { |
| 281 | ASSERT_TRUE(mSession->setMode(sessionMode, true).isOk()); |
| 282 | ASSERT_TRUE(mSession->setMode(sessionMode, false).isOk()); |
| 283 | } |
| 284 | for (const auto& sessionMode : kInvalidSessionModes) { |
| 285 | ASSERT_TRUE(mSession->setMode(sessionMode, true).isOk()); |
| 286 | ASSERT_TRUE(mSession->setMode(sessionMode, false).isOk()); |
| 287 | } |
| 288 | } |
| 289 | |
Matt Buckley | caac147 | 2023-12-12 03:55:50 +0000 | [diff] [blame] | 290 | TEST_P(HintSessionAidl, getSessionConfig) { |
| 291 | if (mServiceVersion < 5) { |
| 292 | GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; |
| 293 | } |
| 294 | SessionConfig config; |
| 295 | ASSERT_TRUE(mSession->getSessionConfig(&config).isOk()); |
| 296 | } |
| 297 | |
Dan Stoza | cca8027 | 2020-01-13 13:06:13 -0800 | [diff] [blame] | 298 | // FIXED_PERFORMANCE mode is required for all devices which ship on Android 11 |
| 299 | // or later |
| 300 | TEST_P(PowerAidl, hasFixedPerformance) { |
Peiyong Lin | 3e0eb72 | 2022-10-17 19:55:20 +0000 | [diff] [blame] | 301 | bool supported; |
| 302 | ASSERT_TRUE(power->isModeSupported(Mode::FIXED_PERFORMANCE, &supported).isOk()); |
| 303 | ASSERT_TRUE(supported); |
Dan Stoza | cca8027 | 2020-01-13 13:06:13 -0800 | [diff] [blame] | 304 | } |
| 305 | |
Dan Shi | ba4d532 | 2020-07-28 13:09:30 -0700 | [diff] [blame] | 306 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PowerAidl); |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 307 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HintSessionAidl); |
| 308 | |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 309 | INSTANTIATE_TEST_SUITE_P(Power, PowerAidl, |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 310 | testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)), |
| 311 | ::android::PrintInstanceNameToString); |
Matt Buckley | 42027e0 | 2023-08-07 23:50:04 +0000 | [diff] [blame] | 312 | INSTANTIATE_TEST_SUITE_P(Power, HintSessionAidl, |
| 313 | testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)), |
| 314 | ::android::PrintInstanceNameToString); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 315 | |
| 316 | } // namespace |
Xiang Wang | dd0edc6 | 2023-02-08 16:47:06 -0800 | [diff] [blame] | 317 | } // namespace aidl::android::hardware::power |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 318 | |
| 319 | int main(int argc, char** argv) { |
| 320 | ::testing::InitGoogleTest(&argc, argv); |
Wei Wang | 0500341 | 2021-04-01 10:44:29 -0700 | [diff] [blame] | 321 | ABinderProcess_setThreadPoolMaxThreadCount(1); |
| 322 | ABinderProcess_startThreadPool(); |
Wei Wang | 61c2a33 | 2020-01-08 16:51:47 -0800 | [diff] [blame] | 323 | return RUN_ALL_TESTS(); |
| 324 | } |