Merge "Seed CL for radio VTS." am: 7d86d72356 am: d7814de27c

am: 83e04fd3e9

Change-Id: I5719abfa0e0e9678655fded4aefa2b4d19889520
This commit is contained in:
Sanket Padawe 2017-02-16 23:54:50 +00:00 committed by android-build-merger
commit 8833640eb3
7 changed files with 1339 additions and 0 deletions

View file

@ -0,0 +1,40 @@
//
// Copyright (C) 2017 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.
//
cc_test {
name: "radio_hidl_hal_test",
gtest: true,
srcs: ["radio_hidl_hal_test.cpp",
"radio_response.cpp",
"radio_hidl_hal_icc.cpp",
"radio_hidl_hal_main.cpp"],
shared_libs: [
"libbase",
"liblog",
"libcutils",
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libnativehelper",
"libutils",
"android.hardware.radio@1.0",
],
static_libs: ["libgtest"],
cflags: [
"-O0",
"-g",
],
}

View file

@ -0,0 +1,105 @@
/*
* Copyright (C) 2017 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.
*/
#include<radio_hidl_hal_utils.h>
/*
* Test IRadio.getIccCardStatus() for the response returned.
*/
TEST_F(RadioHidlTest, getIccCardStatus) {
radio->getIccCardStatus(1);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(1, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
EXPECT_LE(radioRsp->cardStatus.applications.size(), (unsigned int) RadioConst::CARD_MAX_APPS);
EXPECT_LT(radioRsp->cardStatus.gsmUmtsSubscriptionAppIndex, (int) RadioConst::CARD_MAX_APPS);
EXPECT_LT(radioRsp->cardStatus.cdmaSubscriptionAppIndex, (int) RadioConst::CARD_MAX_APPS);
EXPECT_LT(radioRsp->cardStatus.imsSubscriptionAppIndex, (int) RadioConst::CARD_MAX_APPS);
}
/*
* Test IRadio.supplyIccPinForApp() for the response returned.
*/
TEST_F(RadioHidlTest, supplyIccPinForApp) {
radio->supplyIccPinForApp(2, hidl_string("test1"), hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(2, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::PASSWORD_INCORRECT);
}
/*
* Test IRadio.supplyIccPukForApp() for the response returned.
*/
TEST_F(RadioHidlTest, supplyIccPukForApp) {
radio->supplyIccPukForApp(3, hidl_string("test1"), hidl_string("test2"), hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(3, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::PASSWORD_INCORRECT);
}
/*
* Test IRadio.supplyIccPin2ForApp() for the response returned.
*/
TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
radio->supplyIccPin2ForApp(4, hidl_string("test1"), hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(4, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::PASSWORD_INCORRECT);
}
/*
* Test IRadio.supplyIccPuk2ForApp() for the response returned.
*/
TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
radio->supplyIccPuk2ForApp(5, hidl_string("test1"), hidl_string("test2"), hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(5, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::PASSWORD_INCORRECT);
}
/*
* Test IRadio.changeIccPinForApp() for the response returned.
*/
TEST_F(RadioHidlTest, changeIccPinForApp) {
radio->changeIccPinForApp(6, hidl_string("test1"), hidl_string("test2"), hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(6, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::PASSWORD_INCORRECT);
}
/*
* Test IRadio.changeIccPin2ForApp() for the response returned.
*/
TEST_F(RadioHidlTest, changeIccPin2ForApp) {
radio->changeIccPin2ForApp(7, hidl_string("test1"), hidl_string("test2"), hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(7, radioRsp->rspInfo.serial);
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::PASSWORD_INCORRECT);
}

View file

@ -0,0 +1,27 @@
/*
* Copyright (C) 2017 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.
*/
#include<radio_hidl_hal_utils.h>
int main(int argc, char** argv) {
::testing::AddGlobalTestEnvironment(new RadioHidlEnvironment);
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
LOG(INFO) << "Test result = " << status;
return status;
}

View file

@ -0,0 +1,55 @@
/*
* Copyright (C) 2017 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.
*/
#include<radio_hidl_hal_utils.h>
void RadioHidlTest::SetUp() {
radio = IRadio::getService(hidl_string("rild"));
ASSERT_NE(radio, nullptr);
radioRsp = new RadioResponse(*this);
ASSERT_NE(radioRsp, nullptr);
count = 0;
radioInd = NULL;
radio->setResponseFunctions(radioRsp, radioInd);
}
void RadioHidlTest::TearDown() {
}
void RadioHidlTest::notify() {
std::unique_lock<std::mutex> lock(mtx);
count++;
cv.notify_one();
}
std::cv_status RadioHidlTest::wait() {
std::unique_lock<std::mutex> lock(mtx);
std::cv_status status = std::cv_status::no_timeout;
auto now = std::chrono::system_clock::now();
while (count == 0) {
status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
if (status == std::cv_status::timeout) {
return status;
}
}
count--;
return status;
}

View file

@ -0,0 +1,451 @@
/*
* Copyright (C) 2017 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.
*/
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <android/hardware/radio/1.0/IRadio.h>
#include <android/hardware/radio/1.0/IRadioResponse.h>
#include <android/hardware/radio/1.0/IRadioIndication.h>
#include <android/hardware/radio/1.0/types.h>
using ::android::hardware::radio::V1_0::ActivityStatsInfo;
using ::android::hardware::radio::V1_0::CardStatus;
using ::android::hardware::radio::V1_0::Call;
using ::android::hardware::radio::V1_0::CallForwardInfo;
using ::android::hardware::radio::V1_0::CarrierRestrictions;
using ::android::hardware::radio::V1_0::CdmaRoamingType;
using ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo;
using ::android::hardware::radio::V1_0::CdmaSubscriptionSource;
using ::android::hardware::radio::V1_0::CellInfo;
using ::android::hardware::radio::V1_0::ClipStatus;
using ::android::hardware::radio::V1_0::DataRegStateResult;
using ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo;
using ::android::hardware::radio::V1_0::HardwareConfig;
using ::android::hardware::radio::V1_0::IccIoResult;
using ::android::hardware::radio::V1_0::IRadio;
using ::android::hardware::radio::V1_0::IRadioResponse;
using ::android::hardware::radio::V1_0::IRadioIndication;
using ::android::hardware::radio::V1_0::RadioConst;
using ::android::hardware::radio::V1_0::RadioError;
using ::android::hardware::radio::V1_0::RadioResponseInfo;
using ::android::hardware::radio::V1_0::LastCallFailCauseInfo;
using ::android::hardware::radio::V1_0::LceDataInfo;
using ::android::hardware::radio::V1_0::LceStatusInfo;
using ::android::hardware::radio::V1_0::NeighboringCell;
using ::android::hardware::radio::V1_0::OperatorInfo;
using ::android::hardware::radio::V1_0::PreferredNetworkType;
using ::android::hardware::radio::V1_0::RadioBandMode;
using ::android::hardware::radio::V1_0::RadioCapability;
using ::android::hardware::radio::V1_0::RadioResponseType;
using ::android::hardware::radio::V1_0::RadioTechnology;
using ::android::hardware::radio::V1_0::RadioTechnologyFamily;
using ::android::hardware::radio::V1_0::SendSmsResult;
using ::android::hardware::radio::V1_0::SetupDataCallResult;
using ::android::hardware::radio::V1_0::SignalStrength;
using ::android::hardware::radio::V1_0::TtyMode;
using ::android::hardware::radio::V1_0::VoiceRegStateResult;
using ::android::hardware::hidl_string;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
#define TIMEOUT_PERIOD 20
class RadioHidlTest;
/* Callback class for radio response */
class RadioResponse : public IRadioResponse {
private:
RadioHidlTest& parent;
public:
RadioResponseInfo rspInfo;
CardStatus cardStatus;
RadioResponse(RadioHidlTest& parent);
virtual ~RadioResponse() = default;
Return<void> getIccCardStatusResponse(const RadioResponseInfo& info,
const CardStatus& cardStatus);
Return<void> supplyIccPinForAppResponse(const RadioResponseInfo& info,
int32_t remainingRetries);
Return<void> supplyIccPukForAppResponse(const RadioResponseInfo& info,
int32_t remainingRetries);
Return<void> supplyIccPin2ForAppResponse(const RadioResponseInfo& info,
int32_t remainingRetries);
Return<void> supplyIccPuk2ForAppResponse(const RadioResponseInfo& info,
int32_t remainingRetries);
Return<void> changeIccPinForAppResponse(const RadioResponseInfo& info,
int32_t remainingRetries);
Return<void> changeIccPin2ForAppResponse(const RadioResponseInfo& info,
int32_t remainingRetries);
Return<void> supplyNetworkDepersonalizationResponse(
const RadioResponseInfo& info, int32_t remainingRetries);
Return<void> getCurrentCallsResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<Call>& calls);
Return<void> dialResponse(const RadioResponseInfo& info);
Return<void> getIMSIForAppResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& imsi);
Return<void> hangupConnectionResponse(const RadioResponseInfo& info);
Return<void> hangupWaitingOrBackgroundResponse(
const RadioResponseInfo& info);
Return<void> hangupForegroundResumeBackgroundResponse(
const RadioResponseInfo& info);
Return<void> switchWaitingOrHoldingAndActiveResponse(
const RadioResponseInfo& info);
Return<void> conferenceResponse(const RadioResponseInfo& info);
Return<void> rejectCallResponse(const RadioResponseInfo& info);
Return<void> getLastCallFailCauseResponse(const RadioResponseInfo& info,
const LastCallFailCauseInfo& failCauseInfo);
Return<void> getSignalStrengthResponse(const RadioResponseInfo& info,
const SignalStrength& sigStrength);
Return<void> getVoiceRegistrationStateResponse(const RadioResponseInfo& info,
const VoiceRegStateResult& voiceRegResponse);
Return<void> getDataRegistrationStateResponse(const RadioResponseInfo& info,
const DataRegStateResult& dataRegResponse);
Return<void> getOperatorResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& longName,
const ::android::hardware::hidl_string& shortName,
const ::android::hardware::hidl_string& numeric);
Return<void> setRadioPowerResponse(const RadioResponseInfo& info);
Return<void> sendDtmfResponse(const RadioResponseInfo& info);
Return<void> sendSmsResponse(const RadioResponseInfo& info,
const SendSmsResult& sms);
Return<void> sendSMSExpectMoreResponse(const RadioResponseInfo& info,
const SendSmsResult& sms);
Return<void> setupDataCallResponse(const RadioResponseInfo& info,
const SetupDataCallResult& dcResponse);
Return<void> iccIOForAppResponse(const RadioResponseInfo& info,
const IccIoResult& iccIo);
Return<void> sendUssdResponse(const RadioResponseInfo& info);
Return<void> cancelPendingUssdResponse(const RadioResponseInfo& info);
Return<void> getClirResponse(const RadioResponseInfo& info, int32_t n, int32_t m);
Return<void> setClirResponse(const RadioResponseInfo& info);
Return<void> getCallForwardStatusResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<CallForwardInfo>& call_forwardInfos);
Return<void> setCallForwardResponse(const RadioResponseInfo& info);
Return<void> getCallWaitingResponse(const RadioResponseInfo& info,
bool enable, int32_t serviceClass);
Return<void> setCallWaitingResponse(const RadioResponseInfo& info);
Return<void> acknowledgeLastIncomingGsmSmsResponse(const RadioResponseInfo& info);
Return<void> acceptCallResponse(const RadioResponseInfo& info);
Return<void> deactivateDataCallResponse(const RadioResponseInfo& info);
Return<void> getFacilityLockForAppResponse(const RadioResponseInfo& info,int32_t response);
Return<void> setFacilityLockForAppResponse(const RadioResponseInfo& info,int32_t retry);
Return<void> setBarringPasswordResponse(const RadioResponseInfo& info);
Return<void> getNetworkSelectionModeResponse(const RadioResponseInfo& info,bool manual);
Return<void> setNetworkSelectionModeAutomaticResponse(const RadioResponseInfo& info);
Return<void> setNetworkSelectionModeManualResponse(const RadioResponseInfo& info);
Return<void> getAvailableNetworksResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<OperatorInfo>& networkInfos);
Return<void> startDtmfResponse(const RadioResponseInfo& info);
Return<void> stopDtmfResponse(const RadioResponseInfo& info);
Return<void> getBasebandVersionResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& version);
Return<void> separateConnectionResponse(const RadioResponseInfo& info);
Return<void> setMuteResponse(const RadioResponseInfo& info);
Return<void> getMuteResponse(const RadioResponseInfo& info, bool enable);
Return<void> getClipResponse(const RadioResponseInfo& info,ClipStatus status);
Return<void> getDataCallListResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<SetupDataCallResult>& dcResponse);
Return<void> sendOemRilRequestRawResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<uint8_t>& data);
Return<void> sendOemRilRequestStringsResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& data);
Return<void> sendScreenStateResponse(const RadioResponseInfo& info);
Return<void> setSuppServiceNotificationsResponse(
const RadioResponseInfo& info);
Return<void> writeSmsToSimResponse(const RadioResponseInfo& info,int32_t index);
Return<void> deleteSmsOnSimResponse(const RadioResponseInfo& info);
Return<void> setBandModeResponse(const RadioResponseInfo& info);
Return<void> getAvailableBandModesResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<RadioBandMode>& bandModes);
Return<void> sendEnvelopeResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& commandResponse);
Return<void> sendTerminalResponseToSimResponse(const RadioResponseInfo& info);
Return<void> handleStkCallSetupRequestFromSimResponse(
const RadioResponseInfo& info);
Return<void> explicitCallTransferResponse(const RadioResponseInfo& info);
Return<void> setPreferredNetworkTypeResponse(const RadioResponseInfo& info);
Return<void> getPreferredNetworkTypeResponse(const RadioResponseInfo& info,
PreferredNetworkType nwType);
Return<void> getNeighboringCidsResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<NeighboringCell>& cells);
Return<void> setLocationUpdatesResponse(const RadioResponseInfo& info);
Return<void> setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info);
Return<void> setCdmaRoamingPreferenceResponse(const RadioResponseInfo& info);
Return<void> getCdmaRoamingPreferenceResponse(const RadioResponseInfo& info,
CdmaRoamingType type);
Return<void> setTTYModeResponse(const RadioResponseInfo& info);
Return<void> getTTYModeResponse(const RadioResponseInfo& info, TtyMode mode);
Return<void> setPreferredVoicePrivacyResponse(const RadioResponseInfo& info);
Return<void> getPreferredVoicePrivacyResponse(const RadioResponseInfo& info, bool enable);
Return<void> sendCDMAFeatureCodeResponse(const RadioResponseInfo& info);
Return<void> sendBurstDtmfResponse(const RadioResponseInfo& info);
Return<void> sendCdmaSmsResponse(const RadioResponseInfo& info, const SendSmsResult& sms);
Return<void> acknowledgeLastIncomingCdmaSmsResponse(const RadioResponseInfo& info);
Return<void> getGsmBroadcastConfigResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo>& configs);
Return<void> setGsmBroadcastConfigResponse(const RadioResponseInfo& info);
Return<void> setGsmBroadcastActivationResponse(const RadioResponseInfo& info);
Return<void> getCdmaBroadcastConfigResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo>& configs);
Return<void> setCdmaBroadcastConfigResponse(const RadioResponseInfo& info);
Return<void> setCdmaBroadcastActivationResponse(const RadioResponseInfo& info);
Return<void> getCDMASubscriptionResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& mdn,
const ::android::hardware::hidl_string& hSid,
const ::android::hardware::hidl_string& hNid,
const ::android::hardware::hidl_string& min,
const ::android::hardware::hidl_string& prl);
Return<void> writeSmsToRuimResponse(const RadioResponseInfo& info, uint32_t index);
Return<void> deleteSmsOnRuimResponse(const RadioResponseInfo& info);
Return<void> getDeviceIdentityResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& imei,
const ::android::hardware::hidl_string& imeisv,
const ::android::hardware::hidl_string& esn,
const ::android::hardware::hidl_string& meid);
Return<void> exitEmergencyCallbackModeResponse(const RadioResponseInfo& info);
Return<void> getSmscAddressResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& smsc);
Return<void> setSmscAddressResponse(const RadioResponseInfo& info);
Return<void> reportSmsMemoryStatusResponse(const RadioResponseInfo& info);
Return<void> reportStkServiceIsRunningResponse(const RadioResponseInfo& info);
Return<void> getCdmaSubscriptionSourceResponse(const RadioResponseInfo& info,
CdmaSubscriptionSource source);
Return<void> requestIsimAuthenticationResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& response);
Return<void> acknowledgeIncomingGsmSmsWithPduResponse(
const RadioResponseInfo& info);
Return<void> sendEnvelopeWithStatusResponse(const RadioResponseInfo& info,
const IccIoResult& iccIo);
Return<void> getVoiceRadioTechnologyResponse(const RadioResponseInfo& info,
RadioTechnology rat);
Return<void> getCellInfoListResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<CellInfo>& cellInfo);
Return<void> setCellInfoListRateResponse(const RadioResponseInfo& info);
Return<void> setInitialAttachApnResponse(const RadioResponseInfo& info);
Return<void> getImsRegistrationStateResponse(const RadioResponseInfo& info,
bool isRegistered, RadioTechnologyFamily ratFamily);
Return<void> sendImsSmsResponse(const RadioResponseInfo& info,
const SendSmsResult& sms);
Return<void> iccTransmitApduBasicChannelResponse(
const RadioResponseInfo& info, const IccIoResult& result);
Return<void> iccOpenLogicalChannelResponse(const RadioResponseInfo& info,
int32_t channelId, const ::android::hardware::hidl_vec<int8_t>& selectResponse);
Return<void> iccCloseLogicalChannelResponse(const RadioResponseInfo& info);
Return<void> iccTransmitApduLogicalChannelResponse(
const RadioResponseInfo& info, const IccIoResult& result);
Return<void> nvReadItemResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& result);
Return<void> nvWriteItemResponse(const RadioResponseInfo& info);
Return<void> nvWriteCdmaPrlResponse(const RadioResponseInfo& info);
Return<void> nvResetConfigResponse(const RadioResponseInfo& info);
Return<void> setUiccSubscriptionResponse(const RadioResponseInfo& info);
Return<void> setDataAllowedResponse(const RadioResponseInfo& info);
Return<void> getHardwareConfigResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<HardwareConfig>& config);
Return<void> requestIccSimAuthenticationResponse(
const RadioResponseInfo& info, const IccIoResult& result);
Return<void> setDataProfileResponse(const RadioResponseInfo& info);
Return<void> requestShutdownResponse(const RadioResponseInfo& info);
Return<void> getRadioCapabilityResponse(const RadioResponseInfo& info,
const RadioCapability& rc);
Return<void> setRadioCapabilityResponse(const RadioResponseInfo& info,
const RadioCapability& rc);
Return<void> startLceServiceResponse(const RadioResponseInfo& info,
const LceStatusInfo& statusInfo);
Return<void> stopLceServiceResponse(const RadioResponseInfo& info,
const LceStatusInfo& statusInfo);
Return<void> pullLceDataResponse(const RadioResponseInfo& info,
const LceDataInfo& lceInfo);
Return<void> getModemActivityInfoResponse(const RadioResponseInfo& info,
const ActivityStatsInfo& activityInfo);
Return<void> setAllowedCarriersResponse(const RadioResponseInfo& info,
int32_t numAllowed);
Return<void> getAllowedCarriersResponse(const RadioResponseInfo& info,
bool allAllowed, const CarrierRestrictions& carriers);
Return<void> sendDeviceStateResponse(const RadioResponseInfo& info);
Return<void> setIndicationFilterResponse(const RadioResponseInfo& info);
Return<void> acknowledgeRequest(int32_t serial);
};
// The main test class for Radio HIDL.
class RadioHidlTest : public ::testing::Test {
private:
std::mutex mtx;
std::condition_variable cv;
int count;
public:
virtual void SetUp() override;
virtual void TearDown() override;
/* Used as a mechanism to inform the test about data/event callback */
void notify();
/* Test code calls this function to wait for response */
std::cv_status wait();
sp<IRadio> radio;
sp<RadioResponse> radioRsp;
sp<IRadioIndication> radioInd;
};
// A class for test environment setup
class RadioHidlEnvironment : public ::testing::Environment {
public:
virtual void SetUp() {}
virtual void TearDown() {}
};

View file

@ -0,0 +1,660 @@
/*
* Copyright (C) 2017 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.
*/
#include<radio_hidl_hal_utils.h>
RadioResponse::RadioResponse(RadioHidlTest& parent) : parent(parent) {
}
Return<void> RadioResponse::getIccCardStatusResponse(
const RadioResponseInfo& info, const CardStatus& card_status) {
rspInfo = info;
cardStatus = card_status;
parent.notify();
return Void();
}
Return<void> RadioResponse::supplyIccPinForAppResponse(
const RadioResponseInfo& info, int32_t remainingRetries) {
rspInfo = info;
parent.notify();
return Void();
}
Return<void> RadioResponse::supplyIccPukForAppResponse(
const RadioResponseInfo& info, int32_t remainingRetries) {
rspInfo = info;
parent.notify();
return Void();
}
Return<void> RadioResponse::supplyIccPin2ForAppResponse(
const RadioResponseInfo& info, int32_t remainingRetries) {
rspInfo = info;
parent.notify();
return Void();
}
Return<void> RadioResponse::supplyIccPuk2ForAppResponse(
const RadioResponseInfo& info, int32_t remainingRetries) {
rspInfo = info;
parent.notify();
return Void();
}
Return<void> RadioResponse::changeIccPinForAppResponse(
const RadioResponseInfo& info, int32_t remainingRetries) {
rspInfo = info;
parent.notify();
return Void();
}
Return<void> RadioResponse::changeIccPin2ForAppResponse(
const RadioResponseInfo& info, int32_t remaining_retries) {
rspInfo = info;
parent.notify();
return Void();
}
Return<void> RadioResponse::supplyNetworkDepersonalizationResponse(
const RadioResponseInfo& info, int32_t remainingRetries) {
return Void();
}
Return<void> RadioResponse::getCurrentCallsResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_vec<Call>& calls) {
return Void();
}
Return<void> RadioResponse::dialResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getIMSIForAppResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& imsi) {
return Void();
}
Return<void> RadioResponse::hangupConnectionResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::hangupWaitingOrBackgroundResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::hangupForegroundResumeBackgroundResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::switchWaitingOrHoldingAndActiveResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::conferenceResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::rejectCallResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getLastCallFailCauseResponse(
const RadioResponseInfo& info, const LastCallFailCauseInfo& failCauseInfo) {
return Void();
}
Return<void> RadioResponse::getSignalStrengthResponse(
const RadioResponseInfo& info, const SignalStrength& sig_strength) {
return Void();
}
Return<void> RadioResponse::getVoiceRegistrationStateResponse(
const RadioResponseInfo& info, const VoiceRegStateResult& voiceRegResponse) {
return Void();
}
Return<void> RadioResponse::getDataRegistrationStateResponse(
const RadioResponseInfo& info, const DataRegStateResult& dataRegResponse) {
return Void();
}
Return<void> RadioResponse::getOperatorResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& longName,
const ::android::hardware::hidl_string& shortName,
const ::android::hardware::hidl_string& numeric) {
return Void();
}
Return<void> RadioResponse::setRadioPowerResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::sendDtmfResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::sendSmsResponse(const RadioResponseInfo& info,
const SendSmsResult& sms) {
return Void();
}
Return<void> RadioResponse::sendSMSExpectMoreResponse(
const RadioResponseInfo& info, const SendSmsResult& sms) {
return Void();
}
Return<void> RadioResponse::setupDataCallResponse(
const RadioResponseInfo& info, const SetupDataCallResult& dcResponse) {
return Void();
}
Return<void> RadioResponse::iccIOForAppResponse(
const RadioResponseInfo& info, const IccIoResult& iccIo) {
return Void();
}
Return<void> RadioResponse::sendUssdResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::cancelPendingUssdResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getClirResponse(const RadioResponseInfo& info, int32_t n, int32_t m) {
return Void();
}
Return<void> RadioResponse::setClirResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getCallForwardStatusResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CallForwardInfo>&
callForwardInfos) {
return Void();
}
Return<void> RadioResponse::setCallForwardResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getCallWaitingResponse(
const RadioResponseInfo& info, bool enable, int32_t serviceClass) {
return Void();
}
Return<void> RadioResponse::setCallWaitingResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::acknowledgeLastIncomingGsmSmsResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::acceptCallResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::deactivateDataCallResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getFacilityLockForAppResponse(const RadioResponseInfo& info,
int32_t response) {
return Void();
}
Return<void> RadioResponse::setFacilityLockForAppResponse(const RadioResponseInfo& info,
int32_t retry) {
return Void();
}
Return<void> RadioResponse::setBarringPasswordResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getNetworkSelectionModeResponse(
const RadioResponseInfo& info, bool manual) {
return Void();
}
Return<void> RadioResponse::setNetworkSelectionModeAutomaticResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setNetworkSelectionModeManualResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getAvailableNetworksResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<OperatorInfo>& networkInfos) {
return Void();
}
Return<void> RadioResponse::startDtmfResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::stopDtmfResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getBasebandVersionResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& version) {
return Void();
}
Return<void> RadioResponse::separateConnectionResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setMuteResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getMuteResponse(const RadioResponseInfo& info, bool enable) {
return Void();
}
Return<void> RadioResponse::getClipResponse(const RadioResponseInfo& info, ClipStatus status) {
return Void();
}
Return<void> RadioResponse::getDataCallListResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<SetupDataCallResult>& dcResponse) {
return Void();
}
Return<void> RadioResponse::sendOemRilRequestRawResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<uint8_t>& data) {
return Void();
}
Return<void> RadioResponse::sendOemRilRequestStringsResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& data) {
return Void();
}
Return<void> RadioResponse::sendScreenStateResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setSuppServiceNotificationsResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::writeSmsToSimResponse(
const RadioResponseInfo& info, int32_t index) {
return Void();
}
Return<void> RadioResponse::deleteSmsOnSimResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setBandModeResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getAvailableBandModesResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<RadioBandMode>& bandModes) {
return Void();
}
Return<void> RadioResponse::sendEnvelopeResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& commandResponse) {
return Void();
}
Return<void> RadioResponse::sendTerminalResponseToSimResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::handleStkCallSetupRequestFromSimResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::explicitCallTransferResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setPreferredNetworkTypeResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getPreferredNetworkTypeResponse(
const RadioResponseInfo& info, PreferredNetworkType nw_type) {
return Void();
}
Return<void> RadioResponse::getNeighboringCidsResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<NeighboringCell>& cells) {
return Void();
}
Return<void> RadioResponse::setLocationUpdatesResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getCdmaRoamingPreferenceResponse(
const RadioResponseInfo& info, CdmaRoamingType type) {
return Void();
}
Return<void> RadioResponse::setTTYModeResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getTTYModeResponse(const RadioResponseInfo& info, TtyMode mode) {
return Void();
}
Return<void> RadioResponse::setPreferredVoicePrivacyResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getPreferredVoicePrivacyResponse(
const RadioResponseInfo& info, bool enable) {
return Void();
}
Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::sendBurstDtmfResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::sendCdmaSmsResponse(
const RadioResponseInfo& info, const SendSmsResult& sms) {
return Void();
}
Return<void> RadioResponse::acknowledgeLastIncomingCdmaSmsResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getGsmBroadcastConfigResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo>& configs) {
return Void();
}
Return<void> RadioResponse::setGsmBroadcastConfigResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setGsmBroadcastActivationResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getCdmaBroadcastConfigResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo>& configs) {
return Void();
}
Return<void> RadioResponse::setCdmaBroadcastConfigResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setCdmaBroadcastActivationResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getCDMASubscriptionResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& mdn,
const ::android::hardware::hidl_string& hSid, const ::android::hardware::hidl_string& hNid,
const ::android::hardware::hidl_string& min,
const ::android::hardware::hidl_string& prl) {
return Void();
}
Return<void> RadioResponse::writeSmsToRuimResponse(
const RadioResponseInfo& info, uint32_t index) {
return Void();
}
Return<void> RadioResponse::deleteSmsOnRuimResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getDeviceIdentityResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& imei,
const ::android::hardware::hidl_string& imeisv, const ::android::hardware::hidl_string& esn,
const ::android::hardware::hidl_string& meid) {
return Void();
}
Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getSmscAddressResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& smsc) {
return Void();
}
Return<void> RadioResponse::setSmscAddressResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::reportSmsMemoryStatusResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::reportStkServiceIsRunningResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getCdmaSubscriptionSourceResponse(
const RadioResponseInfo& info, CdmaSubscriptionSource source) {
return Void();
}
Return<void> RadioResponse::requestIsimAuthenticationResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& response) {
return Void();
}
Return<void> RadioResponse::acknowledgeIncomingGsmSmsWithPduResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::sendEnvelopeWithStatusResponse(
const RadioResponseInfo& info, const IccIoResult& iccIo) {
return Void();
}
Return<void> RadioResponse::getVoiceRadioTechnologyResponse(
const RadioResponseInfo& info, RadioTechnology rat) {
return Void();
}
Return<void> RadioResponse::getCellInfoListResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CellInfo>& cellInfo) {
return Void();
}
Return<void> RadioResponse::setCellInfoListRateResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getImsRegistrationStateResponse(
const RadioResponseInfo& info, bool isRegistered, RadioTechnologyFamily ratFamily) {
return Void();
}
Return<void> RadioResponse::sendImsSmsResponse(
const RadioResponseInfo& info, const SendSmsResult& sms) {
return Void();
}
Return<void> RadioResponse::iccTransmitApduBasicChannelResponse(
const RadioResponseInfo& info, const IccIoResult& result) {
return Void();
}
Return<void> RadioResponse::iccOpenLogicalChannelResponse(
const RadioResponseInfo& info, int32_t channelId,
const ::android::hardware::hidl_vec<int8_t>& selectResponse) {
return Void();
}
Return<void> RadioResponse::iccCloseLogicalChannelResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::iccTransmitApduLogicalChannelResponse(
const RadioResponseInfo& info, const IccIoResult& result) {
return Void();
}
Return<void> RadioResponse::nvReadItemResponse(
const RadioResponseInfo& info, const ::android::hardware::hidl_string& result) {
return Void();
}
Return<void> RadioResponse::nvWriteItemResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::nvResetConfigResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setUiccSubscriptionResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setDataAllowedResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getHardwareConfigResponse(
const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<HardwareConfig>& config) {
return Void();
}
Return<void> RadioResponse::requestIccSimAuthenticationResponse(
const RadioResponseInfo& info, const IccIoResult& result) {
return Void();
}
Return<void> RadioResponse::setDataProfileResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::requestShutdownResponse(const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::getRadioCapabilityResponse(
const RadioResponseInfo& info, const RadioCapability& rc) {
return Void();
}
Return<void> RadioResponse::setRadioCapabilityResponse(
const RadioResponseInfo& info, const RadioCapability& rc) {
return Void();
}
Return<void> RadioResponse::startLceServiceResponse(
const RadioResponseInfo& info, const LceStatusInfo& statusInfo) {
return Void();
}
Return<void> RadioResponse::stopLceServiceResponse(
const RadioResponseInfo& info, const LceStatusInfo& statusInfo) {
return Void();
}
Return<void> RadioResponse::pullLceDataResponse(
const RadioResponseInfo& info, const LceDataInfo& lceInfo) {
return Void();
}
Return<void> RadioResponse::getModemActivityInfoResponse(
const RadioResponseInfo& info, const ActivityStatsInfo& activityInfo) {
return Void();
}
Return<void> RadioResponse::setAllowedCarriersResponse(
const RadioResponseInfo& info, int32_t numAllowed) {
return Void();
}
Return<void> RadioResponse::getAllowedCarriersResponse(
const RadioResponseInfo& info, bool allAllowed, const CarrierRestrictions& carriers) {
return Void();
}
Return<void> RadioResponse::sendDeviceStateResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::setIndicationFilterResponse(
const RadioResponseInfo& info) {
return Void();
}
Return<void> RadioResponse::acknowledgeRequest(int32_t serial) {
return Void();
}

View file

@ -1,4 +1,5 @@
// This is an autogenerated file, do not edit.
subdirs = [
"1.0",
"1.0/vts/functional",
]