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