Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1235c2d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Moving alarm manager native code to apex"

parents 74802eea 1baab8c3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,4 +19,8 @@ java_library {

    // Rename classes shared with the framework
    jarjar_rules: "jarjar-rules.txt",

    required: [
        "libalarm_jni",
    ],
}
+1 −0
Original line number Diff line number Diff line
@@ -3831,6 +3831,7 @@ public class AlarmManagerService extends SystemService {
        }

        void init() {
            System.loadLibrary("alarm_jni");
            mNativeData = AlarmManagerService.init();
        }

+41 −0
Original line number Diff line number Diff line
cc_library_shared {
    name: "libalarm_jni",

    cpp_std: "c++2a",
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
        "-Wthread-safety",
    ],

    srcs: [
        "com_android_server_alarm_AlarmManagerService.cpp",
        "onload.cpp",
    ],

    shared_libs: [
         "libnativehelper",
         "liblog",
         "libbase",
    ],

    product_variables: {
        arc: {
            exclude_srcs: [
                "com_android_server_alarm_AlarmManagerService.cpp",
            ],
            srcs: [
                ":arctimersrcs",
            ],
        }
    }

}

filegroup {
    name: "lib_alarmManagerService_native",
    srcs: [
        "com_android_server_alarm_AlarmManagerService.cpp",
    ],
}
+41 −0
Original line number Diff line number Diff line
/*
 * 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;
}
Loading