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

Commit e29df60b authored by Tim Lin's avatar Tim Lin
Browse files

add new RadioError

Support RadioError:RF_HARDWARE_ISSUE and RadioError:NO_RF_CALIBRATION_INFO for
setRadioPowerResponse_1_6().

Bug: 170938075
Test: build. VTS on Cuttlefish.
Change-Id: Iaf582c31f439810db34693c61e58ff1f4dfd19fd
parent f8e858b4
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -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
+12 −0
Original line number Diff line number Diff line
@@ -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
+16 −1
Original line number Diff line number Diff line
@@ -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,
};

/**
+4 −1
Original line number Diff line number Diff line
@@ -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",
    ],
}
+32 −0
Original line number Diff line number Diff line
@@ -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);
}
Loading