mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Rename getConfigFlag to isConfigFlagSet."
This commit is contained in:
committed by
Android (Google) Code Review
commit
6a99a2a901
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user