Commit f1854090 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Switch cast_shell to use implicit JNI registration

Explicit registration is needed only when using the custom linker.
Cast shell 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: I88e92480d355fc0a19ffdd4c816efbf749dd9964
Reviewed-on: https://chromium-review.googlesource.com/c/1317340Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605446}
parent f9f3ebce
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//base/android/jni_generator/jni_exception_list.gni")
import("//build/buildflag_header.gni") import("//build/buildflag_header.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
...@@ -593,12 +592,6 @@ buildflag_header("chromecast_buildflags") { ...@@ -593,12 +592,6 @@ buildflag_header("chromecast_buildflags") {
} }
if (is_android) { if (is_android) {
generate_jni_registration("cast_shell_jni_registration") {
target = ":cast_shell_apk"
output = "$root_gen_dir/chromecast/android/${target_name}.h"
exception_files = jni_exception_files
}
android_assets("cast_shell_apk_assets") { android_assets("cast_shell_apk_assets") {
assert(v8_use_external_startup_data) assert(v8_use_external_startup_data)
......
...@@ -15,7 +15,6 @@ cast_shared_library("libcast_shell_android") { ...@@ -15,7 +15,6 @@ cast_shared_library("libcast_shell_android") {
deps = [ deps = [
"//base", "//base",
"//chromecast:cast_shell_jni_registration",
"//chromecast:cast_shell_lib", "//chromecast:cast_shell_lib",
"//chromecast:chromecast_buildflags", "//chromecast:chromecast_buildflags",
"//chromecast/app", "//chromecast/app",
...@@ -30,19 +29,6 @@ cast_shared_library("libcast_shell_android") { ...@@ -30,19 +29,6 @@ cast_shared_library("libcast_shell_android") {
"//skia", "//skia",
] ]
# Explicit dependencies required for JNI registration to be able to find the
# native side functions.
if (is_component_build) {
deps += [
"//device/bluetooth",
"//device/gamepad",
"//media/midi",
"//ui/android",
"//ui/events/devices",
"//ui/shell_dialogs",
]
}
if (is_cast_using_cma_backend) { if (is_cast_using_cma_backend) {
deps += [ "//chromecast/media/cma/backend/android:cast_media_android" ] deps += [ "//chromecast/media/cma/backend/android:cast_media_android" ]
} }
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "base/android/jni_android.h" #include "base/android/jni_android.h"
#include "base/android/library_loader/library_loader_hooks.h"
#include "base/bind.h"
#include "chromecast/android/cast_shell_jni_registration.h"
#include "chromecast/app/cast_main_delegate.h" #include "chromecast/app/cast_main_delegate.h"
#include "content/public/app/content_jni_onload.h" #include "content/public/app/content_jni_onload.h"
#include "content/public/app/content_main.h" #include "content/public/app/content_main.h"
...@@ -14,10 +11,6 @@ ...@@ -14,10 +11,6 @@
// This is called by the VM when the shared library is first loaded. // This is called by the VM when the shared library is first loaded.
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
base::android::InitVM(vm); base::android::InitVM(vm);
JNIEnv* env = base::android::AttachCurrentThread();
if (!RegisterMainDexNatives(env) || !RegisterNonMainDexNatives(env)) {
return -1;
}
if (!content::android::OnJNIOnLoadInit()) if (!content::android::OnJNIOnLoadInit())
return false; return false;
......
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