Michael Bestas | 77df5ad | 2017-12-27 23:57:24 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The CyanogenMod Project |
Sam Mortimer | 07564a9 | 2020-09-12 00:07:06 -0700 | [diff] [blame] | 3 | * 2017,2020 The LineageOS Project |
Michael Bestas | 77df5ad | 2017-12-27 23:57:24 +0200 | [diff] [blame] | 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
Sam Mortimer | 07564a9 | 2020-09-12 00:07:06 -0700 | [diff] [blame] | 18 | #include <nativehelper/JNIHelp.h> |
| 19 | |
Michael Bestas | 77df5ad | 2017-12-27 23:57:24 +0200 | [diff] [blame] | 20 | #include "jni.h" |
| 21 | #include "utils/Log.h" |
| 22 | #include "utils/misc.h" |
| 23 | |
| 24 | namespace android { |
| 25 | |
| 26 | int register_org_lineageos_platform_internal_LineageAudioService(JNIEnv* env); |
| 27 | |
| 28 | }; |
| 29 | |
| 30 | using namespace android; |
| 31 | |
| 32 | extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */) |
| 33 | { |
| 34 | JNIEnv* env = NULL; |
| 35 | jint result = -1; |
| 36 | |
| 37 | if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { |
| 38 | ALOGE("GetEnv failed!"); |
| 39 | return result; |
| 40 | } |
| 41 | ALOG_ASSERT(env, "Could not retrieve the env!"); |
| 42 | |
| 43 | register_org_lineageos_platform_internal_LineageAudioService(env); |
| 44 | |
| 45 | return JNI_VERSION_1_4; |
| 46 | } |
| 47 | |