Widget not updating on Android 9

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).

The Android Central post below reports similar issues. Please try the suggested things in this post:
https://forums.androidcentral.com/google-pixel-pixel-xl/902980-date-time-widgets-not-updating.html

The part of the code that does widget updates have not been changed for ages so I suspect an issue with Android 9.

Also it seems the debug log is not recording any updates. This might be my logging code or the Android system not making the update calls.

If you see similar issues, please post them here.

Cheers, Duane.

1 Like

Hi Duane,
A couple of notes I can add:

  • 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).

1 Like

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.

1 Like

Interesting. The app doesnā€™t actually do anything to the widget after an update.

I might do another search on similar problems with other app widgets on Android Pie.

Cheers, Duane.

1 Like

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).

Quite a few modes :slight_smile:

Regards,
Dmitry.

1 Like

Hi Dmitry,

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.

Cheers, Duane.

1 Like

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.

Cheers, Duane.

1 Like

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).

1 Like

what it stops many times for sure (every time phone goes standby) ā€“ is reacting to its ā€œforced updateā€ icon. Not self-updates.

1 Like

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.

1 Like

Pixel 2 XL Android Pie

I finally took the app off of Battery Optimization - weā€™ll see if that was the problem with the widgets not updating. ?

1 Like

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).

1 Like

It appears that the last update broke this: since then (even after my ā€œSaveā€) itā€™s not updatingā€¦

1 Like

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.

I plan to do this in the next week or two.

1 Like

There seems to many reports of the widget not updating on Android 9:
https://forums.androidcentral.com/google-pixel-pixel-xl/902980-date-time-widgets-not-updating.html
https://forums.androidcentral.com/google-nexus-5/346167-widgets-not-working-not-updating-2.html


So the question is whether I work on fixing the problem or wait to see if Android 9 will fix the problem??

I mean, adding radar is far more fun than jumping around hoops for an Android 9 OS problem.

Cheers, Duane.

1 Like

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:

  1. Itā€™ll take a bit of time.
  2. itā€™ll may introduce issues on other phones.
  3. 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.

How do you feel about this?

Cheers, Duane.

1 Like

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 ?

Regards,
Dmitry

1 Like

No I donā€™t know why but here are the facts:

  1. only on Android 9
  2. the widget stops updating because the Android stops calling widget updates.
  3. predominantly Pixel, Pixel 2 and Pixel 3 phones, plus a modern Huawei and possibly a modern Samsung phone.
  4. the widget update approach has been the same since 2013 and follows the Android documented approach.
  5. 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?

Here is another post about dying widgets:

1 Like

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.

Cheers, Duane.

1 Like

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ā€¦

Regards,
Dmitry.

1 Like