Status Update
Comments
ra...@google.com <ra...@google.com> #3
redacted
lb...@gmail.com <lb...@gmail.com> #4
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
lb...@gmail.com <lb...@gmail.com> #5
v....@gmail.com <v....@gmail.com> #6
I have turmux
lb...@gmail.com <lb...@gmail.com> #7
Comment has been deleted.
lb...@gmail.com <lb...@gmail.com> #8
This issue is still persisting in the Android 15 public beta 1 as well.
Description
But I don't schedule the work on the widget.
Component used:
Version used:
implementation "androidx.work:work-runtime-ktx:2.5.0"
Devices/Android versions reproduced on:
Pixel 4 R, but here I will show on emulator.
- Sample project to trigger the issue.
Attached.
The steps:
1. Have some app with an appWidget.
2. The appWidget will update its content on calls to onUpdate, as usual.
3. Another thing is to trigger updating the appWidget from within a Worker, which you will trigger using any way you wish. In my case it was a BroadcastReceiver, but you can easily have it as a button on an Activity, like on the sample.
4. As a way to check what happens without using a Worker, have another button that will run the exact same code in some background thread, like what's done on doWork.
The bug:
Only when using Worker, it will call onUpdate in addition to what we called before, manually, to update the widgets.
This means there are 2 updates instead of one.
In the sample, to demonstrate it, each time we update an appWidget, I increase a counter by 1.
For the case of Worker, it gets increased by 2.
- A screenrecord or screenshots showing the issue (if UI related).
Attached.
This happens ONLY with Worker. Not with any other way I've tested.
I want the Worker to be able to update the app-widget only once. onUpdate shouldn't be called.
For now I can't use Worker. I will use IntentService instead.