add new RadioError am: e29df60bdc
am: 7f565c6ba8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1463522 Change-Id: If81342fb76b224305ce0509ae1b6a91202240bda
This commit is contained in:
commit
b4c9e82e04
8 changed files with 124 additions and 8 deletions
|
@ -34,6 +34,36 @@ import @1.5::LinkAddress;
|
|||
* setResponseFunctions must work with @1.6::IRadioResponse and @1.6::IRadioIndication.
|
||||
*/
|
||||
interface IRadio extends @1.5::IRadio {
|
||||
/**
|
||||
* Toggle radio on and off (for "airplane" mode)
|
||||
* If the radio is turned off/on the radio modem subsystem
|
||||
* is expected return to an initialized state. For instance,
|
||||
* any voice and data calls must be terminated and all associated
|
||||
* lists emptied.
|
||||
*
|
||||
* When setting radio power on to exit from airplane mode to place an emergency call on this
|
||||
* logical modem, powerOn, forEmergencyCall and preferredForEmergencyCall must be true. In
|
||||
* this case, this modem is optimized to scan only emergency call bands, until:
|
||||
* 1) Emergency call is completed; or
|
||||
* 2) Another setRadioPower_1_5 is issued with forEmergencyCall being false or
|
||||
* preferredForEmergencyCall being false; or
|
||||
* 3) Timeout after 30 seconds if dial or emergencyDial is not called.
|
||||
* Once one of these conditions is reached, the modem should move into normal operation.
|
||||
*
|
||||
* @param serial Serial number of request.
|
||||
* @param powerOn To turn on radio -> on = true, to turn off radio -> on = false.
|
||||
* @param forEmergencyCall To indication to radio if this request is due to emergency call.
|
||||
* No effect if powerOn is false.
|
||||
* @param preferredForEmergencyCall indicate whether the following emergency call will be sent
|
||||
* on this modem or not. No effect if forEmergencyCall is false, or powerOn is false.
|
||||
*
|
||||
* Response callback is IRadioConfigResponse. setRadioPowerResponse_1_6.
|
||||
|
||||
* Note this API is the same as the 1.5
|
||||
*/
|
||||
oneway setRadioPower_1_6(int32_t serial, bool powerOn, bool forEmergencyCall,
|
||||
bool preferredForEmergencyCall);
|
||||
|
||||
/**
|
||||
* Returns the data call list. An entry is added when a setupDataCall() is issued and removed
|
||||
* on a deactivateDataCall(). The list is emptied when setRadioPower() off/on issued or when
|
||||
|
|
|
@ -25,6 +25,18 @@ import @1.6::SetupDataCallResult;
|
|||
* Interface declaring response functions to solicited radio requests.
|
||||
*/
|
||||
interface IRadioResponse extends @1.5::IRadioResponse {
|
||||
/**
|
||||
* @param info Response info struct containing response type, serial no. and error
|
||||
*
|
||||
* Valid errors returned:
|
||||
* RadioError:NONE
|
||||
* RadioError:INTERNAL_ERR
|
||||
* RadioError:INVALID_ARGUMENTS
|
||||
* RadioError:RF_HARDWARE_ISSUE
|
||||
* RadioError:NO_RF_CALIBRATION_INFO
|
||||
*/
|
||||
oneway setRadioPowerResponse_1_6(RadioResponseInfo info);
|
||||
|
||||
/**
|
||||
* @param info Response info struct containing response type, serial no. and error
|
||||
* @param dcResponse SetupDataCallResult defined in types.hal
|
||||
|
|
|
@ -111,7 +111,22 @@ enum RadioError : @1.0::RadioError {
|
|||
* SMS is blocked due to call control, e.g., resource unavailable
|
||||
* in the SMR entity.
|
||||
*/
|
||||
BLOCKED_DUE_TO_CALL = 69
|
||||
BLOCKED_DUE_TO_CALL = 69,
|
||||
|
||||
/**
|
||||
* Returned from setRadioPowerResponse when detecting RF HW issues. Some RF
|
||||
* Front-End(RFFE) components like antenna are considered critical for modem
|
||||
* to provide telephony service. This RadioError is used when modem detect
|
||||
* such RFFE problem.
|
||||
*/
|
||||
RF_HARDWARE_ISSUE = 70,
|
||||
|
||||
/**
|
||||
* Returned from setRadioPowerResponse when detecting no RF calibration
|
||||
* issue. Unlike RF_HARDWARE_ISSUE, this is a SW problem and no HW repair is
|
||||
* needed.
|
||||
*/
|
||||
NO_RF_CALIBRATION_INFO = 71,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,5 +38,8 @@ cc_test {
|
|||
"android.hardware.radio.config@1.1",
|
||||
],
|
||||
header_libs: ["radio.util.header@1.0"],
|
||||
test_suites: ["general-tests", "vts"]
|
||||
test_suites: [
|
||||
"general-tests",
|
||||
"vts",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -227,3 +227,35 @@ TEST_P(RadioHidlTest_v1_6, sendCdmaSmsExpectMore_1_6) {
|
|||
CHECK_GENERAL_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Test IRadio.setRadioPower_1_6() for the response returned by
|
||||
* IRadio.setRadioPowerResponse_1_6().
|
||||
*/
|
||||
TEST_P(RadioHidlTest_v1_6, setRadioPower_1_6_emergencyCall_cancelled) {
|
||||
// Set radio power to off.
|
||||
serial = GetRandomSerialNumber();
|
||||
radio_v1_6->setRadioPower_1_6(serial, false, false, false);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
|
||||
EXPECT_EQ(::android::hardware::radio::V1_6::RadioError::NONE, radioRsp_v1_6->rspInfo.error);
|
||||
|
||||
// Set radio power to on with forEmergencyCall being true. This should put modem to only scan
|
||||
// emergency call bands.
|
||||
serial = GetRandomSerialNumber();
|
||||
radio_v1_6->setRadioPower_1_6(serial, true, true, true);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
|
||||
EXPECT_EQ(::android::hardware::radio::V1_6::RadioError::NONE, radioRsp_v1_6->rspInfo.error);
|
||||
|
||||
// Set radio power to on with forEmergencyCall being false. This should put modem in regular
|
||||
// operation modem.
|
||||
serial = GetRandomSerialNumber();
|
||||
radio_v1_6->setRadioPower_1_6(serial, true, false, false);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
|
||||
EXPECT_EQ(::android::hardware::radio::V1_6::RadioError::NONE, radioRsp_v1_6->rspInfo.error);
|
||||
}
|
||||
|
|
|
@ -30,10 +30,11 @@ void RadioHidlTest_v1_6::SetUp() {
|
|||
|
||||
radio_v1_6->setResponseFunctions(radioRsp_v1_6, radioInd_v1_6);
|
||||
|
||||
getDataCallList();
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
|
||||
EXPECT_EQ(::android::hardware::radio::V1_6::RadioError::NONE, radioRsp_v1_6->rspInfo.error);
|
||||
updateSimCardStatus();
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo_v1_0.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo_v1_0.serial);
|
||||
EXPECT_EQ(::android::hardware::radio::V1_0::RadioError::NONE,
|
||||
radioRsp_v1_6->rspInfo_v1_0.error);
|
||||
|
||||
sp<::android::hardware::radio::config::V1_1::IRadioConfig> radioConfig =
|
||||
::android::hardware::radio::config::V1_1::IRadioConfig::getService();
|
||||
|
@ -73,6 +74,12 @@ std::cv_status RadioHidlTest_v1_6::wait() {
|
|||
return status;
|
||||
}
|
||||
|
||||
void RadioHidlTest_v1_6::updateSimCardStatus() {
|
||||
serial = GetRandomSerialNumber();
|
||||
radio_v1_6->getIccCardStatus(serial);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
}
|
||||
|
||||
void RadioHidlTest_v1_6::getDataCallList() {
|
||||
serial = GetRandomSerialNumber();
|
||||
radio_v1_6->getDataCallList_1_6(serial);
|
||||
|
|
|
@ -66,6 +66,7 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon
|
|||
public:
|
||||
hidl_vec<RadioBandMode> radioBandModes;
|
||||
|
||||
::android::hardware::radio::V1_0::RadioResponseInfo rspInfo_v1_0;
|
||||
::android::hardware::radio::V1_6::RadioResponseInfo rspInfo;
|
||||
|
||||
// Call
|
||||
|
@ -738,6 +739,9 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon
|
|||
const ::android::hardware::radio::V1_5::CardStatus& card_status);
|
||||
|
||||
/* 1.6 Api */
|
||||
Return<void> setRadioPowerResponse_1_6(
|
||||
const ::android::hardware::radio::V1_6::RadioResponseInfo& info);
|
||||
|
||||
Return<void> setupDataCallResponse_1_6(
|
||||
const ::android::hardware::radio::V1_6::RadioResponseInfo& info,
|
||||
const android::hardware::radio::V1_6::SetupDataCallResult& dcResponse);
|
||||
|
@ -995,6 +999,9 @@ class RadioHidlTest_v1_6 : public ::testing::TestWithParam<std::string> {
|
|||
/* Clear Potential Established Calls */
|
||||
void clearPotentialEstablishedCalls();
|
||||
|
||||
/* Update Sim Card Status */
|
||||
void updateSimCardStatus();
|
||||
|
||||
/* Get current data call list */
|
||||
void getDataCallList();
|
||||
|
||||
|
|
|
@ -1032,12 +1032,22 @@ Return<void> RadioResponse_v1_6::supplySimDepersonalizationResponse(
|
|||
}
|
||||
|
||||
Return<void> RadioResponse_v1_6::getIccCardStatusResponse_1_5(
|
||||
const ::android::hardware::radio::V1_0::RadioResponseInfo& /*info*/,
|
||||
const ::android::hardware::radio::V1_5::CardStatus& /*card_status*/) {
|
||||
const ::android::hardware::radio::V1_0::RadioResponseInfo& info,
|
||||
const ::android::hardware::radio::V1_5::CardStatus& card_status) {
|
||||
rspInfo_v1_0 = info;
|
||||
cardStatus = card_status;
|
||||
parent_v1_6.notify(info.serial);
|
||||
return Void();
|
||||
}
|
||||
|
||||
/* 1.6 Apis */
|
||||
Return<void> RadioResponse_v1_6::setRadioPowerResponse_1_6(
|
||||
const ::android::hardware::radio::V1_6::RadioResponseInfo& info) {
|
||||
rspInfo = info;
|
||||
parent_v1_6.notify(info.serial);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse_v1_6::setupDataCallResponse_1_6(
|
||||
const ::android::hardware::radio::V1_6::RadioResponseInfo& info,
|
||||
const android::hardware::radio::V1_6::SetupDataCallResult& /* dcResponse */) {
|
||||
|
|
Loading…
Reference in a new issue