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

Commit 6a99a2a9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rename getConfigFlag to isConfigFlagSet."

parents 36a8e2bc 3dd452a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -113,12 +113,12 @@ interface ITunerSession {
     *                NOT_SUPPORTED if the flag is not supported at all.
     * @return value The current value of the flag, if result is OK.
     */
    getConfigFlag(ConfigFlag flag) generates (Result result, bool value);
    isConfigFlagSet(ConfigFlag flag) generates (Result result, bool value);

    /**
     * Sets the config flag.
     *
     * The success/failure result must be consistent with getConfigFlag.
     * The success/failure result must be consistent with isConfigFlagSet.
     *
     * @param flag Flag to set.
     * @param value The new value of a given flag.
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ Return<void> TunerSession::stopProgramListUpdates() {
    return {};
}

Return<void> TunerSession::getConfigFlag(ConfigFlag flag, getConfigFlag_cb _hidl_cb) {
Return<void> TunerSession::isConfigFlagSet(ConfigFlag flag, isConfigFlagSet_cb _hidl_cb) {
    ALOGV("%s(%s)", __func__, toString(flag).c_str());

    _hidl_cb(Result::NOT_SUPPORTED, false);
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ struct TunerSession : public ITunerSession {
    virtual Return<void> cancel() override;
    virtual Return<Result> startProgramListUpdates(const ProgramFilter& filter);
    virtual Return<void> stopProgramListUpdates();
    virtual Return<void> getConfigFlag(ConfigFlag flag, getConfigFlag_cb _hidl_cb);
    virtual Return<void> isConfigFlagSet(ConfigFlag flag, isConfigFlagSet_cb _hidl_cb);
    virtual Return<Result> setConfigFlag(ConfigFlag flag, bool value);
    virtual Return<void> setParameters(const hidl_vec<VendorKeyValue>& parameters,
                                       setParameters_cb _hidl_cb) override;
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ enum Result : int32_t {
};

/**
 * Configuration flags to be used with getConfigFlag and setConfigFlag methods
 * Configuration flags to be used with isConfigFlagSet and setConfigFlag methods
 * of ITunerSession.
 */
enum ConfigFlag : uint32_t {
+5 −5
Original line number Diff line number Diff line
@@ -617,16 +617,16 @@ TEST_F(BroadcastRadioHalTest, GetNoImage) {
 * Test getting config flags.
 *
 * Verifies that:
 * - getConfigFlag either succeeds or ends with NOT_SUPPORTED or INVALID_STATE;
 * - isConfigFlagSet either succeeds or ends with NOT_SUPPORTED or INVALID_STATE;
 * - call success or failure is consistent with setConfigFlag.
 */
TEST_F(BroadcastRadioHalTest, GetConfigFlags) {
TEST_F(BroadcastRadioHalTest, FetchConfigFlags) {
    ASSERT_TRUE(openSession());

    for (auto flag : gConfigFlagValues) {
        auto halResult = Result::UNKNOWN_ERROR;
        auto cb = [&](Result result, bool) { halResult = result; };
        auto hidlResult = mSession->getConfigFlag(flag, cb);
        auto hidlResult = mSession->isConfigFlagSet(flag, cb);
        EXPECT_TRUE(hidlResult.isOk());

        if (halResult != Result::NOT_SUPPORTED && halResult != Result::INVALID_STATE) {
@@ -646,7 +646,7 @@ TEST_F(BroadcastRadioHalTest, GetConfigFlags) {
 *
 * Verifies that:
 * - setConfigFlag either succeeds or ends with NOT_SUPPORTED or INVALID_STATE;
 * - getConfigFlag reflects the state requested immediately after the set call.
 * - isConfigFlagSet reflects the state requested immediately after the set call.
 */
TEST_F(BroadcastRadioHalTest, SetConfigFlags) {
    ASSERT_TRUE(openSession());
@@ -658,7 +658,7 @@ TEST_F(BroadcastRadioHalTest, SetConfigFlags) {
            halResult = result;
            gotValue = value;
        };
        auto hidlResult = mSession->getConfigFlag(flag, cb);
        auto hidlResult = mSession->isConfigFlagSet(flag, cb);
        EXPECT_TRUE(hidlResult.isOk());
        EXPECT_EQ(Result::OK, halResult);
        return gotValue;