Commit d58f5cfa authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

Remove Sensor::IsActivated().

Its implementation is identical to that of Sensor::activated(), so stick to
the latter.

Change-Id: I598e889fa91ec8deca3ac2a16203e0343b5b9c39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214386
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771981}
parent b83e2dfc
......@@ -72,7 +72,7 @@ void AmbientLightSensor::OnSensorReadingChanged() {
// The platform sensor may start sending readings before the sensor is fully
// activated on the Blink side. In this case, bail out early, otherwise we
// will set |latest_reading_| and not send a "reading" event.
if (!IsActivated())
if (!activated())
return;
const double new_reading = GetReading().als.value;
......
......@@ -187,7 +187,7 @@ TEST(AmbientLightSensorTest, PlatformSensorReadingsBeforeActivation) {
// a fully activated state.
mock_observer->WaitForSensorInitialization();
context.sensor_provider()->UpdateAmbientLightSensorData(42);
ASSERT_FALSE(sensor->IsActivated());
ASSERT_FALSE(sensor->activated());
EXPECT_FALSE(sensor->illuminance().has_value());
SensorTestUtils::WaitForEvent(sensor, event_type_names::kReading);
......
......@@ -109,7 +109,7 @@ bool Sensor::activated() const {
}
bool Sensor::hasReading() const {
if (!IsActivated())
if (!activated())
return false;
DCHECK(sensor_proxy_);
return sensor_proxy_->GetReading().timestamp() != 0.0;
......
......@@ -86,7 +86,6 @@ class MODULES_EXPORT Sensor : public EventTargetWithInlineData,
// parameters if needed.
virtual SensorConfigurationPtr CreateSensorConfig();
bool IsActivated() const { return state_ == SensorState::kActivated; }
bool IsIdleOrErrored() const;
const device::SensorReading& GetReading() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment