michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 1 | // Copyright 2015 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. |
| 4 | |
| 5 | #include "base/android/base_jni_onload.h" |
| 6 | |
| 7 | #include "base/android/jni_android.h" |
torne | 103bf19 | 2015-02-20 23:06:33 | [diff] [blame] | 8 | #include "base/android/jni_utils.h" |
michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 9 | #include "base/android/library_loader/library_loader_hooks.h" |
michaelbai | 5237cb89a | 2015-02-21 01:29:40 | [diff] [blame] | 10 | #include "base/bind.h" |
michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 11 | |
| 12 | namespace base { |
| 13 | namespace android { |
| 14 | |
tobiasjs | b9e287e | 2017-02-08 11:09:50 | [diff] [blame] | 15 | bool OnJNIOnLoadInit() { |
michaelbai | f40324b | 2015-03-11 22:20:37 | [diff] [blame] | 16 | InitAtExitManager(); |
torne | 103bf19 | 2015-02-20 23:06:33 | [diff] [blame] | 17 | JNIEnv* env = base::android::AttachCurrentThread(); |
torne | 103bf19 | 2015-02-20 23:06:33 | [diff] [blame] | 18 | base::android::InitReplacementClassLoader(env, |
| 19 | base::android::GetClassLoader(env)); |
michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 20 | return true; |
| 21 | } |
| 22 | |
michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 23 | } // namespace android |
| 24 | } // namespace base |