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

Commit db3278ab authored by Nick Kralevich's avatar Nick Kralevich Committed by Gerrit Code Review
Browse files

Merge "Map SELinux log levels to Android log levels."

parents d12f4eb8 e0dda3c8
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -443,8 +443,21 @@ static JNINativeMethod method_table[] = {

static int log_callback(int type, const char *fmt, ...) {
    va_list ap;
    int priority;

    switch (type) {
    case SELINUX_WARNING:
        priority = ANDROID_LOG_WARN;
        break;
    case SELINUX_INFO:
        priority = ANDROID_LOG_INFO;
        break;
    default:
        priority = ANDROID_LOG_ERROR;
        break;
    }
    va_start(ap, fmt);
    LOG_PRI_VA(ANDROID_LOG_ERROR, "SELinux", fmt, ap);
    LOG_PRI_VA(priority, "SELinux", fmt, ap);
    va_end(ap);
    return 0;
}