1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/android/base_jni_onload.h"
6 #include "base/android/base_jni_registrar.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h"
9 #include "base/android/jni_utils.h"
10 #include "net/android/net_jni_registrar.h"
11 #include "remoting/client/jni/chromoting_jni_runtime.h"
12 #include "ui/gfx/android/gfx_jni_registrar.h"
16 base::android::RegistrationMethod kRemotingRegisteredMethods
[] = {
17 {"base", base::android::RegisterJni
},
18 {"gfx", gfx::android::RegisterJni
},
19 {"net", net::android::RegisterJni
},
20 {"remoting", remoting::RegisterJni
},
23 bool RegisterJNI(JNIEnv
* env
) {
24 return base::android::RegisterNativeMethods(env
,
25 kRemotingRegisteredMethods
, arraysize(kRemotingRegisteredMethods
));
30 JNIEXPORT jint
JNI_OnLoad(JavaVM
* vm
, void* reserved
) {
31 std::vector
<base::android::RegisterCallback
> register_callbacks
;
32 register_callbacks
.push_back(base::Bind(&RegisterJNI
));
33 std::vector
<base::android::InitCallback
> init_callbacks
;
34 if (!base::android::OnJNIOnLoadRegisterJNI(vm
, register_callbacks
) ||
35 !base::android::OnJNIOnLoadInit(init_callbacks
)) {
38 return JNI_VERSION_1_4
;