I am trying to start a vpn connection programmatically. I get this error. I am using Android 2.1, and the kernel version for the test phone is 2.6.32.9. I can connect to vpn when I do this manually. But programmatically, I get this error.
java.io.IOException: cannot start service: mtpd E/VpnService(11817): at com.android.vpn.DaemonProxy.start(DaemonProxy.java:75) E/VpnService(11817): at com.android.vpn.VpnDaemons.startDaemon(VpnDaemons.java:106) E/VpnService(11817): at com.android.vpn.VpnDaemons.startMtpd(VpnDaemons.java:127) E/VpnService(11817): at com.android.vpn.VpnDaemons.startL2tp(VpnDaemons.java:50) E/VpnService(11817): at com.android.vpn.L2tpService.connect(L2tpService.java:31) E/VpnService(11817): at com.android.vpn.VpnService.onConnect(VpnService.java:135) E/VpnService(11817): at com.android.vpn.VpnServiceBinder$2.run(VpnServiceBinder.java:130) E/VpnService(11817): at java.lang.Thread.run(Thread.java:1096)
DeamonProxy: 75 points to the following method.
private boolean blockUntil(String expectedState, int waitTime) { String cmd = SVC_STATE_CMD_PREFIX + mName; int sleepTime = 200; // ms int n = waitTime * 1000 / sleepTime; for (int i = 0; i < n; i++) { if (expectedState.equals(SystemProperties.get(cmd))) { if (DBG) { Log.d(mTag, mName + " is " + expectedState + " after " + (i * sleepTime) + " msec"); } break; } sleep(sleepTime); } return expectedState.equals(SystemProperties.get(cmd)); }
This method expires and returns the above error.
Any help / suggestion on this is welcome.
Thanks in advance.
Lorry
source share