# HG changeset patch
# Parent 00f5129cb0728770d376d09b698d07d645f7c444
Enable RNDIS mode on Epic.

diff --git a/native/tether/tetherStartStop.cpp b/native/tether/tetherStartStop.cpp
--- a/native/tether/tetherStartStop.cpp
+++ b/native/tether/tetherStartStop.cpp
@@ -128,6 +128,9 @@
 	if (file_exists((char*)"/sys/devices/platform/msm_hsusb/usb_function_switch") == 0) {
 		writelog(system("echo 3 > /sys/devices/platform/msm_hsusb/usb_function_switch"),(char *)"USB interface disabled");
 	}	
+	if (file_exists((char*)"/sys/devices/virtual/sec/switch/tethering") == 0) {
+		writelog(system("echo 0 > /sys/devices/virtual/sec/switch/tethering"),(char *)"USB interface disabled");
+	}
 }
 
 void startint() {
@@ -143,6 +146,9 @@
 	if (file_exists((char*)"/sys/devices/platform/msm_hsusb/usb_function_switch") == 0) {
 		writelog(system("echo 4 > /sys/devices/platform/msm_hsusb/usb_function_switch"),(char *)"USB interface enabled");
 	}	
+	if (file_exists((char*)"/sys/devices/virtual/sec/switch/tethering") == 0) {
+		writelog(system("echo 1 > /sys/devices/virtual/sec/switch/tethering"),(char *)"USB interface enabled");
+	}
 	char command[100];
 	sprintf(command, "/data/data/android.tether.usb/bin/ifconfig usb0 %s netmask 255.255.255.252", GATEWAY);
 	int returncode = system(command);
diff --git a/src/android/tether/usb/MainActivity.java b/src/android/tether/usb/MainActivity.java
--- a/src/android/tether/usb/MainActivity.java
+++ b/src/android/tether/usb/MainActivity.java
@@ -128,7 +128,7 @@
 	        if (!(new File("/proc/net/netfilter")).exists()) {
 	        	unsupportedKernel = true;
 	    	}
-	        if (!(new File("/sys/devices/virtual/net/usb0/enable")).exists() && !(new File("/sys/devices/virtual/usb_composite/rndis/enable")).exists() && !(new File("/sys/devices/platform/msm_hsusb/usb_function_switch")).exists()) {
+	        if (!(new File("/sys/devices/virtual/net/usb0/enable")).exists() && !(new File("/sys/devices/virtual/usb_composite/rndis/enable")).exists() && !(new File("/sys/devices/platform/msm_hsusb/usb_function_switch")).exists() && !(new File("/sys/devices/virtual/sec/switch/tethering")).exists()) {
 	        	unsupportedKernel = true;
 	        }
 	        if (unsupportedKernel)
