Merge branch 'google3' to roll forward up to cl/355791747.

This commit is contained in:
hai007
2021-02-08 03:58:04 -08:00
8 changed files with 191 additions and 24 deletions
+4
View File
@@ -14,6 +14,10 @@ class FeatureFlags {
struct Flags {
bool enable_cancellation_flag = false;
bool resume_before_disconnect = true;
// Disable ServiceController API (using StoppableServiceController) when
// ServiceController is released to prevent calls to that API from
// other threads.
bool disable_released_service_controller = true;
};
static const FeatureFlags& GetInstance() {
+2
View File
@@ -38,6 +38,8 @@ class AtomicBoolean final : public api::AtomicBoolean {
bool Get() const override { return impl_->Get(); }
bool Set(bool value) override { return impl_->Set(value); }
explicit operator bool() const { return Get(); }
private:
std::unique_ptr<api::AtomicBoolean> impl_;
};
@@ -33,6 +33,17 @@ TEST(AtomicBooleanTest, GetReturnsWhatWasSet) {
EXPECT_TRUE(value.Get());
}
TEST(AtomicBooleanTest, ImplicitGetTrueValue) {
AtomicBoolean value(true);
EXPECT_TRUE(value);
}
TEST(AtomicBooleanTest, ImplicitGetFalseValue) {
AtomicBoolean value(false);
EXPECT_FALSE(value);
}
} // namespace
} // namespace nearby
} // namespace location