Open GoogleCodeExporter opened 8 years ago
[deleted comment]
I fond a way to solve this problem!
I just force the wake lock with a pm manager:
PowerManager pm =
(PowerManager)m_context.getSystemService(Context.POWER_SERVICE);
//PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK |
PowerManager.ACQUIRE_CAUSES_WAKEUP, "Sleepytux");
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK|
PowerManager.ACQUIRE_CAUSES_WAKEUP, "Sleepytux");
wl.acquire();
if (RootTools.isAccessGiven())
{
CommandCapture command = new CommandCapture(0, "settings put global airplane_mode_on "+enable, "am broadcast -a android.intent.action.AIRPLANE_MODE --ez state "+state);
try {
RootTools.getShell(true).add(command);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (TimeoutException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RootDeniedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
wl.release();
It should work for all root command. ;)
Original comment by burn2....@gmail.com
on 20 Nov 2013 at 5:20
Original issue reported on code.google.com by
burn2....@gmail.com
on 8 Nov 2013 at 9:45