Merge "Rename getConfigFlag to isConfigFlagSet."

This commit is contained in:
TreeHugger Robot
2018-01-20 02:22:21 +00:00
committed by Android (Google) Code Review
5 changed files with 10 additions and 10 deletions

View File

@@ -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.

View File

@@ -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);

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;