Widget not updating on Android 9

There was absolutely no changes to the widget code in the last update, nor of ages before that. Here is a screenshot of the changes to the widget provider, the class the Android OS calls for an update.

Apart from the logging for debugging this problem on the 27th of March, there was something late October 2018 and then nothing major.

Widgets are a different beast to an app on Android. You essentially tell the Android OS, here is an image to show in the widget, if user clicks here do this, if here do that. The app doesnā€™t actually control the widget directly for security reasons.

Hereā€™s a good description (I found today when searching about this bug) about developing widgets

Honestly, I have not changed any code to try to fix this widget bug. This is a Android OS bug, it happens before Flowx even gets a call to update the widget.

In the next release, Iā€™ve added a new permission (which I hate doing) and updated all libraries to the most recent. Weā€™ll see if this helps.

Cheers, Duane.

1 Like

I think we can conclude:

  • I donā€™t know what exactly is causing this. I know the general area.
  • I donā€™t know how to fix it.

This would have to be one of my hardest bugs to find and fix.

1 Like

Hi all,

Iā€™ve decided to rewrite the widget updating code from scratch to use the latest approaches. Hopefully this will fix all the issues surrounding the widget.

I would like to keep working on other features (radar, more data sources) at the same time so this will take some weeks to complete and it will add new bugs but we can fix those over time. It one of those ā€œtake a step backwards to step forwardsā€ things.

So please be patient.

Iā€™ll start a new post to reflect this development.

Cheers, Duane.

1 Like

Duane, any way to code your app to use old widget approach if Android version < 9 and phone != Pixel, and new widget code with Android >= 9 and phone = Pixel?

Not an Android programmer (or much of any programmer at that), so just talking out my hearse.

1 Like

Is this relevant?

1 Like

I donā€™t think I can do the version < 9 or >9 check for widgets. I could have two widgets but I think that would double the widget code to maintain. I think I just need to bite the bullet.

The article looks interesting. Iā€™ve seem some of the advice in many other articles. Iā€™ve even hacked some of them in and I think this is partly the cause of the issues.

1 Like

Not to toss a wrench in this, but I have a rooted Pixel 2 (not a carrier model, bought it from Google), Pie 9 April security updates, and my widget updates every 30 mins (:19 and :49) without fail.

I also own Weather(bug) Elite, and that widget doesnā€™t update anymore unless I tell the OS to not battery optimize that app, then it updates fine.

I did not have to do this for Flowx, itā€™s been installed for about 2 weeks and no issue with widget updating.

Happy to help with any further relevant info I can provide.

1 Like

That is a welcome first post to the forum. Thanks Kevin. That info does help.

Not sure if youā€™ve gone through an Flowx version update but a update can cause issue. Iā€™m hoping to do a release this week. Let me know if that fails or not.

In any case, I think Iā€™ll have to rewrite the widget update code from scratch. I can only see this problem getting worse.

Cheers, Duane.

1 Like

Hi Duane, thanks and no worries, Iā€™ll let you know how it goes after the update, glad to be a part of the Flowx discussion, and just for posterity, I LOVE this app, brilliant work!

I do agree with your hesitation to tackle the bug as stated earlier in the thread. Google devs seem to tweak on the fly without much heads up, particularly with Pie. A number of apps I have have broken in odd ways, itā€™s always a Google OS change and a dev scrambling to fix their app, andā€¦ Q is already out for beta consumption.

Regardless, as stated, please donā€™t hesitate to ask if thereā€™s anything I can do to assist; logs, patch test, etc. You know my hardware/software platform. Have a great day Duane, thanks again for all you do!

1 Like

Thanks. Will do.

1 Like

Edit 2:. Got me thinking, so I force stopped the app, fired it back up, and the widget is still updating. Pie on a rooted Pixel 2, April sec update. Iā€™d say aside from immediately after taking the update, the widget reliably updates as it should. Hope this was helpful in some way.

Edit. I rebooted the phone after posting this, and the widget is updating again every 30 minutes. I imagine it was the same as force stopping the app and restarting it with regard to receiving the update. Probably doesnā€™t change your trajectory with changing how the widget performs updates, but may help to pinpoint the path knowing that on Pie it appears to be fine after updating, just needed to restart/reboot.

Original post: Probably behind the ball, but I promised Iā€™d return after the update. You were correct, post update widget isnā€™t updating anymore here either. I didnā€™t doubt it for a second, just confirming.

World view is incredible though, looks amazing! Itā€™ll be even better with optimization, but the tiling is not bad at all here in itā€™s current state considering how much data is represented in the biggest views.

Thanks for working on the widget issue. Not as fun as tweaking n adding features Iā€™m sure.

1 Like

FWIW ā€“ since the recent update (7 hrs ago) the widget auto-updates fine on my pixel2 xl pie unrooted, without any special actions on my part. Apparently when the phone is on, judging by the timestamp on the widget.

I wonder, assuming weā€™re talking about the same recent update, why Kevin and me observe exact opposite behavior :slight_smile:
Likely some side effects (I havenā€™t rebooted yet since the update).

Manual update behaves as it has been ā€“ stops working after phone goes standby, starts working after entering application or config, till the next standby.

Regards,
Dmitry

1 Like

Hi Dmitry,

Odd indeed. Short version of my post:. Took the update, just waited, widget didnā€™t update. Rebooted phone, widget updates without fail. Force closed app, restarted, widget updates without fail. In every case I purposely did not fire up the app, just let the widget do itā€™s thing.

In your case, given itā€™s Pie as the OS, have you checked your battery restrictions? Pull down the curtain and touch the battery icon in the upper right screen. Select ā€œadaptive batteryā€. The off/on switch is likely on, and thatā€™s fine. Select ā€œRestricted Appsā€ and make sure FlowX isnt in the restricted apps. Android will add apps that it thinks are wasting battery. The behavior you describe sounds like the OS is restricting background use for FlowX on your phone.

Just thinking out loud as to what could be different from my setup. I didnā€™t have to do this for FlowX, but Weather(bug) Elite did wind up in that list on my phone (that widget did stop updating), removing it from restricted apps got the widget working again and no undue extra usage on the battery. Pie can overreact sometimes.

Hoping maybe thereā€™s something useful in there, good luck!

1 Like

My original issue was after an application update - the widget stopped updating. I had to save the widgets configuration - then the widget would update.
It will take another app update to see if the widget is good. I think Duane is on the right track.
:+1:

1 Like

Hi Kevin,

Thanks for the recommendations. No, the app is not in the restricted list in my case.
Anyway, I see that auto-update works consistently now, and so probably the only difference observed was in whether any reboot or reset of the application was required.

For the sake of completeness ā€“ I wonder though if the manual forecast update works in your case (pressing the ā€œrefreshā€ or whatever itā€™s called area on the widget). From what I see, this has been consistently "not working after phone goes to standby, starts working after e.g. entering config and pressing Save. The stops working again after next standby. While auto-update still works
Not that this is any critical :slight_smile:

Regards,
Dmitry.

1 Like

Hi Dmitry,

Good to hear! Mine has been updating consistently since last post on all counts.

However, I didnā€™t know about the manual update for the widget, thanks for that! So, I did do some testing on that and, indeed, manual update of the widget doesnā€™t work when the phone comes out of locked state.

What I found though, is that about anything you can do kicks it in the pants and brings manual update function back;. Open app (via widget or icon), enter widget config and just cancel, open widget config and save, open widget config and hit the back button on phone, reboot phone. All of these will re-enable the widget manual update on this phone (Pixel 2, Pie, Apr sec update, rooted).

However!!! (Drum roll creschendo, with those giant badass cauldron drums, LOTS of them, in a rowā€¦in a giant empty concert hall), it is NOT sleep mode thatā€™s killing the widget manual update. Itā€™s time. Itā€™s 2 lousy minutes of doing nothing (or anything) that kills it.

I got curious, so I set my sleep function to 30 minutes. Then I made sure the widget manual update was functional, waited one minute, doing nothing, and checked it. Manual update still worked. I then waited 2 minutes, checked it. Manual update was frozen. Dead. Not working.

Recreated the scenario. Same results.

Recreated again, but this time during the 2 minute interval I opened gmail, closed it, etc. Still worked until the 2 min mark, then frozen again.

Confirmed: All it takes to kill the manual update function is a 2 minute wait.

Anyhow, sorry for the winded post. Hoping the data will help keep Duane from falling down the rabbit hole of Android bug chasing, maybe narrow down the options for a fix.

It probably worthwhile to check my results on another platform, but on this one itā€™s definitely confirmed.

Have a great day all,

K

1 Like

Wow, you guys have been busy. It makes this forum all worth it. Usually I would be talking to each one of you independently and try to put the clues together. This is way better.

@Kevin, are you able to turn on debug log and do the wait interval scenario and then send me the log? Please include the time you did it too so I can find the correct part in the log.

In other news, Iā€™m close to finishing ā€œSet Graph Rangeā€ - one of the oldest requested features. I hope to release today.

Cheers, Duane.

1 Like

Glad to help out Duane.

Debug log sent, I annotated the email with the exact itinerary I followed. I did the bare minimum to recreate the issue, so I didnā€™t open apps, etc, to prove these activities have no effect on the 2 minute widget freeze, in order to keep the log clean and to the point.

Let me know if I can be of further assistance, good luck!
K

1 Like

Thank @Kevin.

A bit of good news, I was able to replicate this scenario. So Iā€™ll be able to dig into the code and test it out.

Cheers, Duane.

1 Like

Awwww yeeeaaaahhh!!! :wink:

Thatā€™s great Duane! Iā€™m sure youā€™ll nail it down.

1 Like