Suprabh Shukla 1baab8c31b Moving alarm manager native code to apex
Extracting out alarm manager jni from libandroid_servers to its own
library.

Test: lunch coral-userdebug && make -j
lunch bertha_arm-userdebug && make -j
atest CtsAlarmManagerTestCases

Bug: 151976605
Change-Id: Ie9e15b2665a2c51c9b2413af304e228f8a3ae2fc
2020-07-10 14:04:28 -07:00

42 lines
1.2 KiB
C++

/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <nativehelper/JNIHelp.h>
#include "jni.h"
#include "utils/Log.h"
#include "utils/misc.h"
namespace android {
int register_android_server_alarm_AlarmManagerService(JNIEnv* env);
};
using namespace android;
extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
{
JNIEnv* env = NULL;
jint result = -1;
if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
ALOGE("GetEnv failed!");
return result;
}
ALOG_ASSERT(env, "Could not retrieve the env!");
register_android_server_alarm_AlarmManagerService(env);
return JNI_VERSION_1_4;
}