blob: 0ae03e835161adc992c0b90fa845be1f7691a09d [file] [log] [blame]
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "power_manager/powerd/system/ambient_light_sensor_manager_stub.h"
#include <memory>
#include <string>
namespace power_manager {
namespace system {
AmbientLightSensorManagerStub::AmbientLightSensorManagerStub()
: AmbientLightSensorManagerStub(0) {}
AmbientLightSensorManagerStub::AmbientLightSensorManagerStub(int lux) {
internal_backlight_sensor_ =
std::make_unique<system::AmbientLightSensorStub>(lux);
keyboard_backlight_sensor_ =
std::make_unique<system::AmbientLightSensorStub>(lux);
}
AmbientLightSensorManagerStub::~AmbientLightSensorManagerStub() = default;
bool AmbientLightSensorManagerStub::HasColorSensor() {
return internal_backlight_sensor_->IsColorSensor() ||
keyboard_backlight_sensor_->IsColorSensor();
}
AmbientLightSensorInterface*
AmbientLightSensorManagerStub::GetSensorForInternalBacklight() {
return internal_backlight_sensor_.get();
}
AmbientLightSensorInterface*
AmbientLightSensorManagerStub::GetSensorForKeyboardBacklight() {
return keyboard_backlight_sensor_.get();
}
} // namespace system
} // namespace power_manager