Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: device/generic_sensor/platform_sensor_android.cc

Issue 2726093003: [sensors][android] Add support for AbsoluteOrientation sensor (Closed)
Patch Set: Rebased to master, rename enum Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « device/generic_sensor/platform_sensor_android.h ('k') | device/generic_sensor/public/cpp/sensor_reading.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698