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

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

Issue 2690963002: [DeviceService] Move //device/time_zone_monitor to //services/device (Closed)
Patch Set: Enable device service to register JNI Created 3 years, 10 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
« no previous file with comments | « services/device/android/register_jni.h ('k') | services/device/device_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/device/android/register_jni.cc
diff --git a/services/device/android/register_jni.cc b/services/device/android/register_jni.cc
new file mode 100644
index 0000000000000000000000000000000000000000..345a8699e79c2e501e797720985e6f9863839f3d
--- /dev/null
+++ b/services/device/android/register_jni.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2017 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.
+
+#include "services/device/android/register_jni.h"
+
+#include "base/android/jni_android.h"
+#include "services/device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h"
+
+namespace device {
+
+bool EnsureJniRegistered() {
+ static bool g_jni_init_done = false;
+
+ if (!g_jni_init_done) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+
+ if (!android::RegisterTimeZoneMonitorJni(env))
+ return false;
+
+ g_jni_init_done = true;
+ }
+
+ return true;
+}
+
+} // namespace device
« no previous file with comments | « services/device/android/register_jni.h ('k') | services/device/device_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698