| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/generic_sensor/platform_sensor_android.h" | 5 #include "device/generic_sensor/platform_sensor_android.h" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "jni/PlatformSensor_jni.h" | 9 #include "jni/PlatformSensor_jni.h" |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 task_runner_->PostTask( | 78 task_runner_->PostTask( |
| 79 FROM_HERE, base::Bind(&PlatformSensorAndroid::NotifySensorError, this)); | 79 FROM_HERE, base::Bind(&PlatformSensorAndroid::NotifySensorError, this)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void PlatformSensorAndroid::UpdatePlatformSensorReading( | 82 void PlatformSensorAndroid::UpdatePlatformSensorReading( |
| 83 JNIEnv*, | 83 JNIEnv*, |
| 84 const base::android::JavaRef<jobject>& caller, | 84 const base::android::JavaRef<jobject>& caller, |
| 85 jdouble timestamp, | 85 jdouble timestamp, |
| 86 jdouble value1, | 86 jdouble value1, |
| 87 jdouble value2, | 87 jdouble value2, |
| 88 jdouble value3) { | 88 jdouble value3, |
| 89 jdouble value4) { |
| 89 SensorReading reading; | 90 SensorReading reading; |
| 90 reading.timestamp = timestamp; | 91 reading.timestamp = timestamp; |
| 91 reading.values[0] = value1; | 92 reading.values[0] = value1; |
| 92 reading.values[1] = value2; | 93 reading.values[1] = value2; |
| 93 reading.values[2] = value3; | 94 reading.values[2] = value3; |
| 95 reading.values[3] = value4; |
| 94 | 96 |
| 95 bool needNotify = (GetReportingMode() == mojom::ReportingMode::ON_CHANGE); | 97 bool needNotify = (GetReportingMode() == mojom::ReportingMode::ON_CHANGE); |
| 96 UpdateSensorReading(reading, needNotify); | 98 UpdateSensorReading(reading, needNotify); |
| 97 } | 99 } |
| 98 | 100 |
| 99 } // namespace device | 101 } // namespace device |
| OLD | NEW |