"Sleep" hangs - root permissions fail

Post your questions and help other users.

Moderator: Martin

Serum_114
Posts: 59
Joined: 16 Jul 2014 01:28

Re: "Sleep" hangs - root permissions fail

Post by Serum_114 » 26 Jul 2014 22:31

Hi Martin,

I've never successfully captured the issue in a debug log. I was, with repeated tries, able to replicate it.

I get very poor reception in my home and if my telephony antenna isn't disabled, my battery dies in 3 - 4 hours. My solution is to call forward calls and enable the telephony antenna only when the user is present or for only 1 minute, every 15 mins to receive SMS messages. Turning the telephony antenna off independently doesn't work on my Nexus 5 so I must turn on airplane mode then turn WiFi and Bluetooth back on.

What I've discovered is that if I turn off airplane mode during a connection attempt by another antenna, Automagic occasionally fails to obtain root permissions and sleep actions in unrelated flows lock if they happen to be running. Another discovery is turning airplane mode back on from within Automatic seems to be the only root command that still works when this happens and normal operation resumes afterwards.

As a work around, I added a condition before turning airplane mode off to check that WiFi is connected. If it isn't, I kill all antennas with an airplane mode on command before turning airplane mode off. It's been days since I implemented this change and have experienced no issues.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: "Sleep" hangs - root permissions fail

Post by Martin » 28 Jul 2014 17:28

Hi,

I was still not able to reproduce this issue on any of my devices. Could you please capture a debug log and send the log to me (menu->Manage->Log, Menu->Send Log, send to info@automagic4android.com)?

Thanks!

Serum_114
Posts: 59
Joined: 16 Jul 2014 01:28

Re: "Sleep" hangs - root permissions fail

Post by Serum_114 » 30 Jul 2014 02:39

Hi Martin,

I've created two flows that reliably and consistently reproduce the problem. It always does it in under a minute for me - unless debug logging is on. I waited 10 mins and nothing. It's as though debug logging prevents the issue. With no debug logging and no write to SD card it happens quickly, every time. Let me know if I can do anything more. Thanks!
Attachments
flow_Perfect_storm_2_20140729_222420.xml
(1.14 KiB) Downloaded 805 times
flow_Perfect_storm_1_20140729_222351.xml
(3.53 KiB) Downloaded 773 times

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: "Sleep" hangs - root permissions fail

Post by Martin » 30 Jul 2014 19:28

Thanks for the flows!
I'm currently trying to reproduce this issue with your flows but I had no luck yet (Nexus 5/4.4.4, Debug Log/SD card log inactive).
Which sleep action hangs on your device, one of the 10s sleeps?

When you disable the airplane mode action in flow Perfect storm 1, does the problem still occur?

Regards,
Martin

Serum_114
Posts: 59
Joined: 16 Jul 2014 01:28

Re: "Sleep" hangs - root permissions fail

Post by Serum_114 » 30 Jul 2014 22:04

Hi Martin,

I managed to catch a failure in debug and have emailed the log to you. Let me know if you want anything else from me.

I really appreciate you looking into this!

Serum_114
Posts: 59
Joined: 16 Jul 2014 01:28

Re: "Sleep" hangs - root permissions fail

Post by Serum_114 » 30 Jul 2014 22:56

Without the airplane mode actions I've yet to see an issue. I'll keep trying and let you know.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: "Sleep" hangs - root permissions fail

Post by Martin » 01 Aug 2014 06:54

Thanks for the log!
Toggling airplane mode requires that a system broadcast is sent by Automagic. Usually sending such a broadcast is more or less instant, but in your case the command runs into a timeout of 15 seconds. Right at the same time, the system also does not send the broadcast to Automagic that the sleep duration has elapsed anymore.
I suspect that your device has a problem to send broadcasts in general for some reason. I left your flows also running for multiple hours, but was not yet able to reproduce this issue. Are you using tools with root permissions that could interfere somehow?

Could you please try the following modifications and post whether the sleep action runs successfully or stops working?
1. change Perfect storm 1 by removing the airplane toggle action completely (to verify if airplane mode and/or root triggers the problem)
2. change Perfect storm 1 by replacing the airplane toggle with action Execute Root Command: id (to verify if a root command alone triggers the problem)
3. change Perfect storm 1 by replacing the airplane toggle with action Execute Root Command: am broadcast -a test (to verify if sending a broadcast as root in general triggers the problem)

Serum_114
Posts: 59
Joined: 16 Jul 2014 01:28

Re: "Sleep" hangs - root permissions fail

Post by Serum_114 » 01 Aug 2014 13:03

You are absolutely right, Martin!

I'm so sorry for taking up your time. I had an old - discontined - app call AppOpsX installed that selectively blocks permissions to apps. I uninstalled it, installed Xposed framework and AppOpsXposed. Now, I've been trying for a while and I'm no longer able to reproduce the problem.

Thanks again! Your product is incredible and so is your support!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: "Sleep" hangs - root permissions fail

Post by Martin » 02 Aug 2014 06:54

No problem, I'm glad it's working now :)

Post Reply