Prefs: Implement and use Prefs::GetBoolean/SetBoolean.
Adds a pair of functions GetBoolean/SetBoolean to the list Prefs
class to read and write persisted boolean values. The stored
values are not compatible with the SetInt64 and will return
false when attempting to get or set a value of the other type.
These functions are now used to store the update over cellular
user setting.
BUG=chromium:213401
TEST=sudo ./update_engine_unittests
Change-Id: I44107e33f8e81ae900671d9ba6a4f5779c2353db
Reviewed-on: https://gerrit.chromium.org/gerrit/61352
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/prefs.h b/prefs.h
index e128eda..55f721f 100644
--- a/prefs.h
+++ b/prefs.h
@@ -29,6 +29,8 @@
bool SetString(const std::string& key, const std::string& value);
bool GetInt64(const std::string& key, int64_t* value);
bool SetInt64(const std::string& key, const int64_t value);
+ bool GetBoolean(const std::string& key, bool* value);
+ bool SetBoolean(const std::string& key, const bool value);
bool Exists(const std::string& key);
bool Delete(const std::string& key);