A few users have been reporting that their Flowx widgets have not been updating. These reports have been all on Pixel phones running Android 9 (Android Pie).
This certainly is not ānever since Android 9 updateā, I think I start observing this fairly recently. Though Google is known for on-the-fly tweaking various settings. Iād prefer things to work without explicit exclusions of course. Maybe during phone āonā state at least.
Strange thing is that when I was observing this yesterday, manual refresh (clicking on the respective widget area) did not work either.
This probably is connected with battery optimizations. At least after including into exclusion list, the widget can be refreshed manually.
I did a few experiments: When not excluded from battery optimization, ārefreshā does not work after getting from standby. Weird thing is that opening Edit Widget (by pressing three dots or something in right-top area) does work, dialog opens. After this, back on home screen, āRefreshā area starts working again (icon briefly appears in top status, time of update changes). Till going to standby or something. This is strange: āmanual updateā should work if āEdit widgetā worksā¦
I sent the corresponding log.
A few other widgets I have do manage to update without any exclusions (though some not too consistently, but Iām ok since they are easy to manually refresh).
Running Pixel 2 XL Android Pie.
The only consistent issue I have seen with the widgets is after an application update. Iāll have to āSaveā the configuration of the Widget and then they will auto update.
Indeed: once I āSaveā config in the app, widget start auto-updating itself.
Though āForced updateā (pressing on the respective widget area) still normally does not work even in this case: it works only after I enter widget configuration and then exit, even doing nothing at all there. Works until the phone goes to standby, then this becomes inactive again. But the widget still auto-updates (after magic enabling by āSaveā above).
Just to clarify, your widget stops updating all the time. In other words, itās stopped updating many times after a new version of the app is updated??
Can you send me your debug log? Itāll be good to read through.
BTW, I do have a plan. Currently, the widget is updated using a set time in a Android system config file. I might try using a repeating alarm instead. In this case, I tell the Android system to set an alarm to trigger an action, in this case, update the widget.
I think it might work. I need testers. Let me know if youād like to test the apk.
Duane, this question I cannot answer: I did not pay attention during earlier updates, and since I did āSaveā today itās doing self-updates consistently so far.
āDebug logā ā for what sequence of my actions?
Regarding testing ā sure (hope this wonāt ultimately mess up normal updates or license checks or whatever).
The debug log records the last couple of days of actions, so Iāll see your manual refreshes of the widget and the automatic system updates.
Re. testing, it should be relatively simple, Iāll start a closed testing track and add your email to it and the app should update like normal from Google Play.
I have to say though that since I did āSaveā of the config a ~week back (see this thread earlier) ā the widget has been updating itself quite fine. (not taking it off battery optimizations or whatever).
I plan to add the new alarm based widget updates to a separate alpha build so it doesnāt go out to everyone as it might cause other issues. When weāre confident it works then we can roll it out to others.
According to debug logs Iāve seen, the Android system is not calling a widget update as they are supposed to. This is an Android OS problem. They are not following their own standards.
This is the Android documentation for widget:
The second grey panel shows the config file with the āandroid:updatePeriodMillisā parameter. This is exactly what Flowx has used from day one of the Flowx widget and now, after 5 years!, it suddenly sporadically works.
The Android OS is simply not calling an update. Iām reluctant to spend time trying to work around this problem for a few reasons:
Itāll take a bit of time.
itāll may introduce issues on other phones.
this is an Android OS issue, it should be fixed at the source.
My gut-feeling is that trying to fix this will a rabbit-hole of a time sink. My preference is that we wait a bit longer to see how other apps respond and how Android OS developers respond.
Itās a bit strange that other widgets seem to work fine.
But do you have understanding why in the previous version (before the update in the last couple of days) auto-update was working after doing āSaveā in widget config?
At least it was usable then. Can this be restored? Or this was some kind of magical coincidence without any logic ?
the widget stops updating because the Android stops calling widget updates.
predominantly Pixel, Pixel 2 and Pixel 3 phones, plus a modern Huawei and possibly a modern Samsung phone.
the widget update approach has been the same since 2013 and follows the Android documented approach.
there has been no major change to the widget code in months, possibly over a year. No minor changes for months.
This clearly points at the only major change in the last 6 months - Android 9 and is probably something to do is aggressive battery savings.
Since you can edit the widget, then save and the widget starts updating, I suspect this is a bug on the Android side.
Why do widgets for other apps update? I know of two other methods for updating widgets, scheduled alarms and using Firebase to trigger an update. Maybe they use this update method. Or maybe they havenāt gone through a app version update.
Why donāt I use one of these methods? I could and itās relatively easy to test the scheduled alarm approach. This might work fine when released to beta tester (~1200 phones) but when released to 70k phones, more bugs can appear. Then Iāll be back to square one, debugging widgets that arenāt updating. This might not happen but it could and that would suck.
To be clear, this is not a Flowx bug, this is a Android 9 bug. Android 9 is not calling widget updates.
So the question arises, do I spend hours working around this Android 9 bug, or do I wait for Android to fix the bug and spend the hours implementing radar, world view or some other cool feature?
Iāve done more searching. Iāve found a new permission requirement in Android 9 for Foreground Services. This may improve updating the widget when you manually update it by clicking on it. I donāt think itāll affect automatic updates.
Iāll also update the libraries and target Android 9 in the next release. We can see if this helps.
Regarding the change in auto-update behavior before and after the most recent update (as I indicated above, doing vs. not doing auto-updates after doing Save once) ā do you see any recent change that couldāve led to that, or this is just because the updated happened and something somewhere in the system was reset? Might give some cluesā¦