2 * Copyright (C) 2017 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include<radio_hidl_hal_utils.h>
19 void RadioHidlTest::SetUp() {
20 radio = IRadio::getService(hidl_string("rild"));
21 ASSERT_NE(radio, nullptr);
23 radioRsp = new RadioResponse(*this);
24 ASSERT_NE(radioRsp, nullptr);
29 radio->setResponseFunctions(radioRsp, radioInd);
32 void RadioHidlTest::TearDown() {
35 void RadioHidlTest::notify() {
36 std::unique_lock<std::mutex> lock(mtx);
41 std::cv_status RadioHidlTest::wait() {
42 std::unique_lock<std::mutex> lock(mtx);
44 std::cv_status status = std::cv_status::no_timeout;
45 auto now = std::chrono::system_clock::now();
47 status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
48 if (status == std::cv_status::timeout) {