Cleanup: Delete dead code.
Bug: 15413389 Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
This commit is contained in:
@@ -543,8 +543,6 @@ public class ConnectivityManager {
|
||||
|
||||
private final IConnectivityManager mService;
|
||||
|
||||
private final String mPackageName;
|
||||
|
||||
private INetworkManagementService mNMService;
|
||||
|
||||
/**
|
||||
@@ -645,23 +643,6 @@ public class ConnectivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given network type should be exempt from VPN routing rules
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static boolean isNetworkTypeExempt(int networkType) {
|
||||
switch (networkType) {
|
||||
case TYPE_MOBILE_MMS:
|
||||
case TYPE_MOBILE_SUPL:
|
||||
case TYPE_MOBILE_HIPRI:
|
||||
case TYPE_MOBILE_IA:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the preferred network type. When the device has more
|
||||
* than one type available the preferred network type will be used.
|
||||
@@ -1236,13 +1217,7 @@ public class ConnectivityManager {
|
||||
* {@link #setProcessDefaultNetwork} and {@link Network#getSocketFactory} api.
|
||||
*/
|
||||
public boolean requestRouteToHost(int networkType, int hostAddress) {
|
||||
InetAddress inetAddress = NetworkUtils.intToInetAddress(hostAddress);
|
||||
|
||||
if (inetAddress == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return requestRouteToHostAddress(networkType, inetAddress);
|
||||
return requestRouteToHostAddress(networkType, NetworkUtils.intToInetAddress(hostAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1260,9 +1235,8 @@ public class ConnectivityManager {
|
||||
* {@link #setProcessDefaultNetwork} api.
|
||||
*/
|
||||
public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) {
|
||||
byte[] address = hostAddress.getAddress();
|
||||
try {
|
||||
return mService.requestRouteToHostAddress(networkType, address, mPackageName);
|
||||
return mService.requestRouteToHostAddress(networkType, hostAddress.getAddress());
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
@@ -1433,9 +1407,8 @@ public class ConnectivityManager {
|
||||
/**
|
||||
* {@hide}
|
||||
*/
|
||||
public ConnectivityManager(IConnectivityManager service, String packageName) {
|
||||
public ConnectivityManager(IConnectivityManager service) {
|
||||
mService = checkNotNull(service, "missing IConnectivityManager");
|
||||
mPackageName = checkNotNull(packageName, "missing package name");
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
|
||||
@@ -69,9 +69,7 @@ interface IConnectivityManager
|
||||
|
||||
int stopUsingNetworkFeature(int networkType, in String feature);
|
||||
|
||||
boolean requestRouteToHost(int networkType, int hostAddress, String packageName);
|
||||
|
||||
boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress, String packageName);
|
||||
boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);
|
||||
|
||||
/** Policy control over specific {@link NetworkStateTracker}. */
|
||||
void setPolicyDataEnable(int networkType, boolean enabled);
|
||||
|
||||
@@ -36,12 +36,6 @@ public class NetworkUtils {
|
||||
|
||||
private static final String TAG = "NetworkUtils";
|
||||
|
||||
/** Bring the named network interface up. */
|
||||
public native static int enableInterface(String interfaceName);
|
||||
|
||||
/** Bring the named network interface down. */
|
||||
public native static int disableInterface(String interfaceName);
|
||||
|
||||
/** Setting bit 0 indicates reseting of IPv4 addresses required */
|
||||
public static final int RESET_IPV4_ADDRESSES = 0x01;
|
||||
|
||||
|
||||
@@ -79,26 +79,6 @@ static struct fieldIds {
|
||||
jmethodID setVendorInfo;
|
||||
} dhcpResultsFieldIds;
|
||||
|
||||
static jint android_net_utils_enableInterface(JNIEnv* env, jobject clazz, jstring ifname)
|
||||
{
|
||||
int result;
|
||||
|
||||
const char *nameStr = env->GetStringUTFChars(ifname, NULL);
|
||||
result = ::ifc_enable(nameStr);
|
||||
env->ReleaseStringUTFChars(ifname, nameStr);
|
||||
return (jint)result;
|
||||
}
|
||||
|
||||
static jint android_net_utils_disableInterface(JNIEnv* env, jobject clazz, jstring ifname)
|
||||
{
|
||||
int result;
|
||||
|
||||
const char *nameStr = env->GetStringUTFChars(ifname, NULL);
|
||||
result = ::ifc_disable(nameStr);
|
||||
env->ReleaseStringUTFChars(ifname, nameStr);
|
||||
return (jint)result;
|
||||
}
|
||||
|
||||
static jint android_net_utils_resetConnections(JNIEnv* env, jobject clazz,
|
||||
jstring ifname, jint mask)
|
||||
{
|
||||
@@ -280,9 +260,6 @@ static jboolean android_net_utils_protectFromVpn(JNIEnv *env, jobject thiz, jint
|
||||
*/
|
||||
static JNINativeMethod gNetworkUtilMethods[] = {
|
||||
/* name, signature, funcPtr */
|
||||
|
||||
{ "enableInterface", "(Ljava/lang/String;)I", (void *)android_net_utils_enableInterface },
|
||||
{ "disableInterface", "(Ljava/lang/String;)I", (void *)android_net_utils_disableInterface },
|
||||
{ "resetConnections", "(Ljava/lang/String;I)I", (void *)android_net_utils_resetConnections },
|
||||
{ "runDhcp", "(Ljava/lang/String;Landroid/net/DhcpResults;)Z", (void *)android_net_utils_runDhcp },
|
||||
{ "runDhcpRenew", "(Ljava/lang/String;Landroid/net/DhcpResults;)Z", (void *)android_net_utils_runDhcpRenew },
|
||||
|
||||
Reference in New Issue
Block a user