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

Unified Diff: device/generic_sensor/platform_sensor_android.h

Issue 2898433002: Revert of Move //device/generic_sensor to be part of the internal implementation of the Device Service. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/platform_sensor_android.h
diff --git a/device/generic_sensor/platform_sensor_android.h b/device/generic_sensor/platform_sensor_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..48937e0b453be570d8b1031128d107754349d89c
--- /dev/null
+++ b/device/generic_sensor/platform_sensor_android.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_ANDROID_H_
+#define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_ANDROID_H_
+
+#include "device/generic_sensor/platform_sensor.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/memory/ref_counted.h"
+
+namespace device {
+
+class PlatformSensorAndroid : public PlatformSensor {
+ public:
+ // Register C++ methods exposed to Java using JNI.
+ static bool RegisterJNI(JNIEnv* env);
+
+ PlatformSensorAndroid(mojom::SensorType type,
+ mojo::ScopedSharedBufferMapping mapping,
+ PlatformSensorProvider* provider,
+ const base::android::JavaRef<jobject>& java_sensor);
+
+ mojom::ReportingMode GetReportingMode() override;
+ PlatformSensorConfiguration GetDefaultConfiguration() override;
+ double GetMaximumSupportedFrequency() override;
+
+ void NotifyPlatformSensorError(JNIEnv*,
+ const base::android::JavaRef<jobject>& caller);
+
+ void UpdatePlatformSensorReading(
+ JNIEnv*,
+ const base::android::JavaRef<jobject>& caller,
+ jdouble timestamp,
+ jdouble value1,
+ jdouble value2,
+ jdouble value3,
+ jdouble value4);
+
+ protected:
+ ~PlatformSensorAndroid() override;
+ bool StartSensor(const PlatformSensorConfiguration& configuration) override;
+ void StopSensor() override;
+ bool CheckSensorConfiguration(
+ const PlatformSensorConfiguration& configuration) override;
+
+ private:
+ // Java object org.chromium.device.sensors.PlatformSensor
+ base::android::ScopedJavaGlobalRef<jobject> j_object_;
+ DISALLOW_COPY_AND_ASSIGN(PlatformSensorAndroid);
+};
+
+} // namespace device
+
+#endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_ANDROID_H_
« no previous file with comments | « device/generic_sensor/platform_sensor_and_provider_unittest_win.cc ('k') | device/generic_sensor/platform_sensor_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698