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

Commit 06b6cdae authored by Sreeram Ramachandran's avatar Sreeram Ramachandran
Browse files

Remove unnecessary code and APIs.

This stuff has been replaced by setNetworkForUser() in NetdClient.

Change-Id: If525ee259b74314191d1913f7c2a3e828e05c38f
parent 325503ca
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -42,9 +42,6 @@ import com.android.internal.net.VpnProfile;
/** {@hide} */
interface IConnectivityManager
{
    // Keep this in sync with framework/native/services/connectivitymanager/ConnectivityManager.h
    void markSocketAsUser(in ParcelFileDescriptor socket, int uid);

    NetworkInfo getActiveNetworkInfo();
    NetworkInfo getActiveNetworkInfoForUid(int uid);
    NetworkInfo getNetworkInfo(int networkType);
+0 −5
Original line number Diff line number Diff line
@@ -105,11 +105,6 @@ public class NetworkUtils {
     */
    public native static String getDhcpError();

    /**
     * Set the SO_MARK of {@code socketfd} to {@code mark}
     */
    public native static void markSocket(int socketfd, int mark);

    /**
     * Binds the current process to the network designated by {@code netId}.  All sockets created
     * in the future (and not explicitly bound via a bound {@link SocketFactory} (see
+0 −5
Original line number Diff line number Diff line
@@ -335,11 +335,6 @@ interface INetworkManagementService
     */
    void removeVpnUidRanges(int netId, in UidRange[] ranges);

    /**
     * Get the SO_MARK associated with routing packets for user {@code uid}
     */
    int getMarkForUid(int uid);

    /**
     * Exempts {@code host} from the routing set up by {@link setMarkedForwardingRoute}
     * All connects to {@code host} will use the global routing table
+0 −8
Original line number Diff line number Diff line
@@ -246,13 +246,6 @@ static jstring android_net_utils_getDhcpError(JNIEnv* env, jobject clazz)
    return env->NewStringUTF(::dhcp_get_errmsg());
}

static void android_net_utils_markSocket(JNIEnv *env, jobject thiz, jint socket, jint mark)
{
    if (setsockopt(socket, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0) {
        jniThrowException(env, "java/lang/IllegalStateException", "Error marking socket");
    }
}

static jboolean android_net_utils_bindProcessToNetwork(JNIEnv *env, jobject thiz, jint netId)
{
    return (jboolean) !setNetworkForProcess(netId);
@@ -296,7 +289,6 @@ static JNINativeMethod gNetworkUtilMethods[] = {
    { "stopDhcp", "(Ljava/lang/String;)Z",  (void *)android_net_utils_stopDhcp },
    { "releaseDhcpLease", "(Ljava/lang/String;)Z",  (void *)android_net_utils_releaseDhcpLease },
    { "getDhcpError", "()Ljava/lang/String;", (void*) android_net_utils_getDhcpError },
    { "markSocket", "(II)V", (void*) android_net_utils_markSocket },
    { "bindProcessToNetwork", "(I)Z", (void*) android_net_utils_bindProcessToNetwork },
    { "getNetworkBoundToProcess", "()I", (void*) android_net_utils_getNetworkBoundToProcess },
    { "bindProcessToNetworkForHostResolution", "(I)Z", (void*) android_net_utils_bindProcessToNetworkForHostResolution },
+0 −10
Original line number Diff line number Diff line
@@ -2602,16 +2602,6 @@
        android:description="@string/permdesc_modifyNetworkAccounting"
        android:protectionLevel="signature|system" />

    <!-- @SystemApi Allows an application to mark traffic as from another user for per user routing.
         Used by system wide services like media server that execute delegated network connections
         for users.
         @hide
    -->
    <permission android:name="android.permission.MARK_NETWORK_SOCKET"
        android:label="@string/permlab_markNetworkSocket"
        android:description="@string/permdesc_markNetworkSocket"
        android:protectionLevel="signature|system" />

    <!-- C2DM permission.
         @hide Used internally.
     -->
Loading