jgibeault / roottools

Automatically exported from code.google.com/p/roottools
0 stars 0 forks source link

getShell() timeout in broadcast receiver trigger by AlarmManager when phone is sleeping. #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set up a pending intent in AlarmManager with XXX_WAKEUP flag in 10 seconds.
2. Let the phone sleep. (screen off)
3. Call getShell() in broadcast receiver trigger by pending intent, it throws 
TimeoutException:

02-17 01:00:52.628: W/Cleaner(4137): java.util.concurrent.TimeoutException: 
RootAccess denied?.
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.execution.Shell.<init>(Shell.java:73)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:309)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:295)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:443)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:465)

What is the expected output? What do you see instead?
getShell() should succeed as that when phone is not sleeping.

What version of the product are you using? On what operating system?
2.6

Please provide any additional information below.
This issue is not appearing if SuperSU is installed instead of SuperUser.

Original issue reported on code.google.com by oasisfeng on 16 Feb 2013 at 5:10

GoogleCodeExporter commented 8 years ago
The log of SuperUser shows it granted the privilege successfully.

Original comment by oasisfeng on 16 Feb 2013 at 5:12

GoogleCodeExporter commented 8 years ago
Have the same problem:
03-27 11:34:31.742: W/System.err(2242): java.util.concurrent.TimeoutException: 
RootAccess denied?.
03-27 11:34:31.742: W/System.err(2242):     at 
com.stericson.RootTools.execution.Shell.<init>(Shell.java:73)
03-27 11:34:31.742: W/System.err(2242):     at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:309)
03-27 11:34:31.742: W/System.err(2242):     at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:295)
03-27 11:34:31.742: W/System.err(2242):     at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:443)
03-27 11:34:31.742: W/System.err(2242):     at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:465)
03-27 11:34:31.742: W/System.err(2242):     at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:482)

When trying RootTools.isRootAvailable() it take long time (about 10 sec) and 
causes ANR error

Original comment by Odrin...@gmail.com on 27 Mar 2013 at 7:43