Using android adb shell in API level 17 i can enable and disable mobile data using svc data enable/disable but if i tried to do it pragmatically it does work and pass with out any exception here is my code
try{ Log.e(TAG,"Before mobile data thread");
Process proc = Runtime.getRuntime().exec("su");
DataOutputStream os= new DataOutputStream(proc.getOutputStream());
os.writeBytes("svc data disable\n");
os.writeBytes("exit\n");
os.flush();
try{
proc.waitFor();
if(proc.exitValue() !=255)
{
Log.e(TAG,"Disabling mobile data");
}else{
Log.e(TAG,"Error Disabling mobile data");
}
}catch(Exception e){}
} catch (Exception ex){Log.e(TAG,"IN mobile data exception exception");}
any Suggestion how can i disable/enable mobile data