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

Commit 40779e50 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

Remove dead code.

Setting capabiltities is handled by dalvik. This code
is never called.

Change-Id: I903952c43cf60ea59ec954c9168a7604d05ccaf7
parent 6fc73697
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -733,17 +733,6 @@ public class ZygoteInit {
    static native long capgetPermitted(int pid)
            throws IOException;

    /**
     * Sets the permitted and effective capability sets of this process.
     *
     * @param permittedCapabilities permitted set
     * @param effectiveCapabilities effective set
     * @throws IOException on error
     */
    static native void setCapabilities(
            long permittedCapabilities,
            long effectiveCapabilities) throws IOException;

    /**
     * Invokes select() on the provider array of file descriptors (selecting
     * for readability only). Array elements of null are ignored.
+0 −28
Original line number Diff line number Diff line
@@ -163,32 +163,6 @@ static void com_android_internal_os_ZygoteInit_setCloseOnExec (JNIEnv *env,
    }
}

static void com_android_internal_os_ZygoteInit_setCapabilities (JNIEnv *env,
    jobject clazz, jlong permitted, jlong effective)
{
    struct __user_cap_header_struct capheader;
    struct __user_cap_data_struct capdata;
    int err;

    memset (&capheader, 0, sizeof(capheader));
    memset (&capdata, 0, sizeof(capdata));

    capheader.version = _LINUX_CAPABILITY_VERSION;
    capheader.pid = 0;

    // As of this writing, capdata is __u32, but that's expected
    // to change...
    capdata.effective = effective;
    capdata.permitted = permitted;

    err = capset (&capheader, &capdata);

    if (err < 0) {
        jniThrowIOException(env, errno);
        return;
    }
}

static jlong com_android_internal_os_ZygoteInit_capgetPermitted (JNIEnv *env,
    jobject clazz, jint pid)
{
@@ -304,8 +278,6 @@ static JNINativeMethod gMethods[] = {
            (void *) com_android_internal_os_ZygoteInit_reopenStdio},
    { "setCloseOnExec", "(Ljava/io/FileDescriptor;Z)V",
        (void *)  com_android_internal_os_ZygoteInit_setCloseOnExec},
    { "setCapabilities", "(JJ)V",
        (void *) com_android_internal_os_ZygoteInit_setCapabilities },
    { "capgetPermitted", "(I)J",
        (void *) com_android_internal_os_ZygoteInit_capgetPermitted },
    { "selectReadable", "([Ljava/io/FileDescriptor;)I",