Commit 69d9e273 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Switch Remoting to use implicit JNI registration

Explicit registration is needed only when using the custom linker.
Remoting doesn't use the custom linker, so has no need to jump
through the extra hoops involved with explicit registration.

Change motivated by JNI refactorings, which are made simpler by having
fewer targets use manual JNI registration.

Bug: 898261
Change-Id: I0b03afdd421f8c806886cbf7a6650ec1ca5d7f9c
Reviewed-on: https://chromium-review.googlesource.com/c/1317339Reviewed-by: default avatarLambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605404}
parent 115e9732
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//base/android/jni_generator/jni_exception_list.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//remoting/android/client_java_tmpl.gni")
......@@ -22,12 +21,6 @@ generate_jni("jni_headers") {
jni_package = "remoting"
}
generate_jni_registration("remoting_jni_registration") {
target = ":remoting_apk"
output = "$root_gen_dir/remoting/client/${target_name}.h"
exception_files = jni_exception_files
}
_raw_resources_base_dir = "$target_gen_dir/credits_resources_raw/res"
# The target is named this way, instead of "..._raw_resources", specifically
......
......@@ -19,7 +19,6 @@ group("jni") {
shared_library("remoting_client_jni") {
deps = [
"//remoting/android:jni_headers",
"//remoting/android:remoting_jni_registration",
"//remoting/base",
"//remoting/client",
"//remoting/client/display",
......@@ -45,7 +44,11 @@ shared_library("remoting_client_jni") {
"android",
"EGL",
]
configs += [ "//remoting/build/config:enable_webrtc_remoting_client" ]
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [
"//build/config/android:hide_all_but_jni",
"//remoting/build/config:enable_webrtc_remoting_client",
]
assert_no_deps = [ "//third_party/ffmpeg:*" ]
}
......
......@@ -4,16 +4,9 @@
#include "base/android/base_jni_onload.h"
#include "base/android/jni_android.h"
#include "base/bind.h"
#include "base/macros.h"
#include "remoting/client/remoting_jni_registration.h"
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
base::android::InitVM(vm);
JNIEnv* env = base::android::AttachCurrentThread();
if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) {
return -1;
}
if (!base::android::OnJNIOnLoadInit()) {
return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment