-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update/refresh is unreliable on Marshmallow and newer due to App Doze #26
Comments
The widget should automatically update any time the available alerts change. What version of Android are you on? |
On December 16, 2016 1:31:05 AM CST, Dave Miller ***@***.***> wrote:
The widget should automatically update any time the available alerts
change. What version of Android are you on?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#26 (comment)
Andriod ver 6.0.1
Doesn't seem to matter whether on wifi or cell, if that might mean anything. It has updated on its own before but most often I have to do it manually thru the app. While I have your attention, thank-you for making the app/ widget.
|
Are you using a custom home screen app (like Apex or similar)? What model phone is it? The only thing I can think of that might cause this is if something is causing the background service to get killed. The OS in theory should be restarting it after 30 minutes if it does get killed though (although in my experience it usually restarts it almost immediately). |
The other thing I should ask: how long are you waiting to see if it updates? Right now it polls the NWS server every 5 minutes. If an alert expires or a new one shows up right after it checks, it wouldn't get picked up until it checks again 5 minutes later. Polling more frequently than that runs a risk of getting your IP address blacklisted by the NWS. They supposedly have push notifications available now, but I've been having trouble finding documentation for it. One thing I can do, in the case of expired alerts, is to automatically remove them when their expiration time passes, whether we've polled again yet or not. I don't do that yet, but it's on the to-do list. |
It's a samsung edge with no 3rd party app launchers. (Just samsung's stock goofy version) |
And it was hours for old vs new data. |
Sorry to bombard you but for giggles I just opened the app and there's a fog advisory issued almost 8 hours ago that wasn't displayed in the widget. |
Do you have access to USB Debugging by any chance? If so, getting some logs might be useful. |
Got prepared to do that but thanks to the wife's %#$* cat, I don't have a suitable usb cable. I don't have root on the phone, so, unless you can point me in another direction (I'm no developer or coder), I'm stuck until I find a cable. So sorry if this is a hassle for you. I can update you as my situation changes. |
I hope this helps- widget.txt is nws and widget1 is NWS. grepped from logcat |
The only important thing I see in there is: This is the right log to get the debug data out of to track this down, we're just going to have to catch it in the act to find out what's going on (i.e. keep it recording to a file and then go look at what shows up in the file if you catch it not updating. I would probably |
I was hoping you would say that it was the timer task not logging every 5 minutes. |
Oh, shame on me for not noticing the timestamps. Indeed, there are 4 ocurrences of the timer task running in the log, the last 3 are 5 minutes apart from each other like they should be, but the first 2 have 45 minutes between them. So there is certainly something happening that's keeping the timer task from firing. Was the phone stationary at the time? (laying on a desk, etc) If so, see https://developer.android.com/training/monitoring-device-state/doze-standby.html Since the app doesn't do notifications yet, I haven't seen the need to work around that, since in theory as soon as you pick up the phone, Doze would release and it would update. |
Well, that sounds like nothing but trouble. But I guess I see the point, if only it worked more gracefully. I can monkey around with adb again tomorrow using the instructions your link gave to force doze and see what happens in the log if you want. Google ought to allow devs to make doze whitelisting a user option for apps like yours. I hope we're onto something. |
FWIW- I found a 'hidden' (because I find the 'more' button less than intuitive) bunch of power saving options that toggles 'battery optimization' for apps. Last night, I turned this off for some apps that are supposed to do polling and this morn, I opened my phone to see that everything was current. This doze culprit makes sense because previously, it seemed that alot would happen when I woke my phone and it would take a while for it to catch-up. This leads me (the dumb user) to believe that apps aren't dealing well with doze. For now, I'm happy with the workaround. |
Yeah, once I get notifications working, this'll need to get dealt with anyway, since notifications will need to fire when they happen, not wait until you pick up your phone. |
I know I've already made you miserable opening this can of worms but I hope you'll consider allowing a user to choose what gets notified- for me, getting notifications on warnings would be important while hearing a ding on watches and advisories would be crying wolf. While this app will likely be on all my androids, warning notification would make it indispensable. |
Oh, definitely, I'd have the same issue. I couldn't care less about the flood warnings because I don't live near the river, etc. :-) My plan was actually to let you set distinct tones for different alerts, even. There's a lot of potential alerts though, so it'd probably need a few "default sets" to start from. |
Wow! That sounds... (i can't believe i'm saying this) awesome! I'm thinking of my wife here, in that, if there were a particular tone for different events, it would be less tempting for her to pick up her phone while driving to see what the warning is. |
If only there were more hours in the day. I don't actually get time to work on this all that often. If you know anyone that can code I'm happy to take the help :) |
Nope :( I guess i'll just be patient and look forward to the next version. Thanks, Dave. |
I think I have a patch to fix this finally, unfortunately it's crashing on me when I install it :( Continuing to poke at it. |
Hi, Dave. I hope you weren’t counting on my helping but it’s not that I wouldn’t be happy to. My wife had to get us iphones. You can delete this when you read it since it’s off topic. Just didn’t want you to think I flaked on you. Good luck. |
I have working code on the antidoze branch that prompts the user for exemption for battery optimization on first run, however, the compiler is throwing this warning when it builds: Use of 'REQUEST_IGNORE_BATTERY_OPTIMIZATIONS' violates the Play Store Content Policy regarding acceptable use cases, as described in http://developer.android.com/training/monitoring-device-state/doze-standby.html And I also hear many places that Google will ban apps from the Play Store for using it.... meh. |
I have to open the app to get current info. Would it also be possible to dismiss expired alerts on the widget?
The text was updated successfully, but these errors were encountered: