blob: b5903eb069fe825f796815364be2888e46f385c5 [file] [log] [blame]
Michael Bestas77df5ad2017-12-27 23:57:24 +02001/*
2 * Copyright (C) 2016 The CyanogenMod Project
Sam Mortimer07564a92020-09-12 00:07:06 -07003 * 2017,2020 The LineageOS Project
Michael Bestas77df5ad2017-12-27 23:57:24 +02004 *
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 Mortimer07564a92020-09-12 00:07:06 -070018#include <nativehelper/JNIHelp.h>
19
Michael Bestas77df5ad2017-12-27 23:57:24 +020020#include "jni.h"
21#include "utils/Log.h"
22#include "utils/misc.h"
23
24namespace android {
25
26int register_org_lineageos_platform_internal_LineageAudioService(JNIEnv* env);
27
28};
29
30using namespace android;
31
32extern "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