| Index: device/sensors/sensor_manager_android.cc
|
| diff --git a/device/sensors/sensor_manager_android.cc b/device/sensors/sensor_manager_android.cc
|
| index 7571c5652421932a9be9db4f450b2c1e1f1c22ad..10d3d0c73d925bd65d284b67509e8f9bd7d82bca 100644
|
| --- a/device/sensors/sensor_manager_android.cc
|
| +++ b/device/sensors/sensor_manager_android.cc
|
| @@ -55,7 +55,6 @@ namespace device {
|
|
|
| SensorManagerAndroid::SensorManagerAndroid()
|
| : number_active_device_motion_sensors_(0),
|
| - device_light_buffer_(nullptr),
|
| device_motion_buffer_(nullptr),
|
| device_orientation_buffer_(nullptr),
|
| motion_buffer_initialized_(false),
|
| @@ -197,28 +196,12 @@ void SensorManagerAndroid::GotRotationRate(JNIEnv*,
|
| }
|
| }
|
|
|
| -void SensorManagerAndroid::GotLight(JNIEnv*,
|
| - const JavaParamRef<jobject>&,
|
| - double value) {
|
| - base::AutoLock autolock(light_buffer_lock_);
|
| -
|
| - if (!device_light_buffer_)
|
| - return;
|
| -
|
| - device_light_buffer_->seqlock.WriteBegin();
|
| - device_light_buffer_->data.value = value;
|
| - device_light_buffer_->seqlock.WriteEnd();
|
| -}
|
| -
|
| bool SensorManagerAndroid::Start(ConsumerType consumer_type) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| DCHECK(!device_sensors_.is_null());
|
| - int rate_in_microseconds = (consumer_type == CONSUMER_TYPE_LIGHT)
|
| - ? kLightSensorIntervalMicroseconds
|
| - : kDeviceSensorIntervalMicroseconds;
|
| return Java_DeviceSensors_start(
|
| AttachCurrentThread(), device_sensors_, reinterpret_cast<intptr_t>(this),
|
| - static_cast<jint>(consumer_type), rate_in_microseconds);
|
| + static_cast<jint>(consumer_type), kDeviceSensorIntervalMicroseconds);
|
| }
|
|
|
| void SensorManagerAndroid::Stop(ConsumerType consumer_type) {
|
| @@ -245,48 +228,6 @@ SensorManagerAndroid::GetOrientationSensorTypeUsed() {
|
|
|
| // ----- Shared memory API methods
|
|
|
| -// --- Device Light
|
| -
|
| -void SensorManagerAndroid::StartFetchingDeviceLightData(
|
| - DeviceLightHardwareBuffer* buffer) {
|
| - DCHECK(thread_checker_.CalledOnValidThread());
|
| - DCHECK(buffer);
|
| - if (is_shutdown_)
|
| - return;
|
| -
|
| - {
|
| - base::AutoLock autolock(light_buffer_lock_);
|
| - device_light_buffer_ = buffer;
|
| - SetLightBufferValue(-1);
|
| - }
|
| - bool success = Start(CONSUMER_TYPE_LIGHT);
|
| - if (!success) {
|
| - base::AutoLock autolock(light_buffer_lock_);
|
| - SetLightBufferValue(std::numeric_limits<double>::infinity());
|
| - }
|
| -}
|
| -
|
| -void SensorManagerAndroid::StopFetchingDeviceLightData() {
|
| - DCHECK(thread_checker_.CalledOnValidThread());
|
| - if (is_shutdown_)
|
| - return;
|
| -
|
| - Stop(CONSUMER_TYPE_LIGHT);
|
| - {
|
| - base::AutoLock autolock(light_buffer_lock_);
|
| - if (device_light_buffer_) {
|
| - SetLightBufferValue(-1);
|
| - device_light_buffer_ = nullptr;
|
| - }
|
| - }
|
| -}
|
| -
|
| -void SensorManagerAndroid::SetLightBufferValue(double lux) {
|
| - device_light_buffer_->seqlock.WriteBegin();
|
| - device_light_buffer_->data.value = lux;
|
| - device_light_buffer_->seqlock.WriteEnd();
|
| -}
|
| -
|
| // --- Device Motion
|
|
|
| void SensorManagerAndroid::StartFetchingDeviceMotionData(
|
|
|