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

Unified Diff: services/device/android/register_jni.cc

Issue 2774783003: [DeviceService] Add service tests for VibrationManager. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: services/device/android/register_jni.cc
diff --git a/services/device/android/register_jni.cc b/services/device/android/register_jni.cc
index 345a8699e79c2e501e797720985e6f9863839f3d..8c3c5a5e68d87f290fe6990f5c63b4eeb7d2e026 100644
--- a/services/device/android/register_jni.cc
+++ b/services/device/android/register_jni.cc
@@ -5,16 +5,33 @@
#include "services/device/android/register_jni.h"
#include "base/android/jni_android.h"
+#include "base/android/jni_registrar.h"
+#include "mojo/android/system/core_impl.h"
+#include "mojo/android/system/watcher_impl.h"
#include "services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h"
namespace device {
+namespace {
+
+const base::android::RegistrationMethod kRegisteredMethods[] = {
leonhsl(Using Gerrit) 2017/03/28 07:27:52 We must register these JNIs to enable InterfaceReg
blundell 2017/03/28 12:40:47 It seems like we should put this somewhere inside
leonhsl(Using Gerrit) 2017/03/29 07:37:16 To make sure I understand the suggestion clearly:
+ {"CoreImpl", mojo::android::RegisterCoreImpl},
+ {"WatcherImpl", mojo::android::RegisterWatcherImpl},
+};
+
+} // namespace
+
bool EnsureJniRegistered() {
static bool g_jni_init_done = false;
if (!g_jni_init_done) {
JNIEnv* env = base::android::AttachCurrentThread();
+ if (!RegisterNativeMethods(env, kRegisteredMethods,
+ arraysize(kRegisteredMethods))) {
+ return false;
+ }
+
if (!android::RegisterTimeZoneMonitorJni(env))
return false;

Powered by Google App Engine
This is Rietveld 408576698