Jesse Hall | 42cf26e | 2017-07-06 15:30:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "Zygote" |
| 18 | |
| 19 | #include <ui/GraphicBufferMapper.h> |
| 20 | |
| 21 | #include "core_jni_helpers.h" |
| 22 | |
| 23 | namespace { |
| 24 | |
| 25 | void android_internal_os_ZygoteInit_nativePreloadAppProcessHALs(JNIEnv* env, jclass) { |
| 26 | android::GraphicBufferMapper::preloadHal(); |
| 27 | // Add preloading here for other HALs that are (a) always passthrough, and |
| 28 | // (b) loaded by most app processes. |
| 29 | } |
| 30 | |
| 31 | const JNINativeMethod gMethods[] = { |
| 32 | { "nativePreloadAppProcessHALs", "()V", |
| 33 | (void*)android_internal_os_ZygoteInit_nativePreloadAppProcessHALs }, |
| 34 | }; |
| 35 | |
| 36 | } // anonymous namespace |
| 37 | |
| 38 | namespace android { |
| 39 | |
| 40 | int register_com_android_internal_os_ZygoteInit(JNIEnv* env) { |
| 41 | return RegisterMethodsOrDie(env, "com/android/internal/os/ZygoteInit", |
| 42 | gMethods, NELEM(gMethods)); |
| 43 | } |
| 44 | |
| 45 | } // namespace android |