-
Notifications
You must be signed in to change notification settings - Fork 11
fix(configuration): properly propagate the appWidgetId back to the Launcher #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Allow the appWidgetId to be relayed to the launcher if it is not provided in the configuration activity intent.
marcelpinto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this happening after certain steps or can you always reproduce it in the same device?
The only issue I could see here is with activity recreation.
...ain/java/com/google/android/glance/appwidget/configuration/AppWidgetConfigurationScaffold.kt
Outdated
Show resolved
Hide resolved
Seem to be able to always recreate this on my Pixel 3 XL. Default launcher with no Intent modification. |
|
Ohhh... I just remember there was an issue in certain Android version that modified the intent and that's why we changed our guidance to always include the widget ID again when setting the result https://developer.android.com/develop/ui/views/appwidgets/configuration#update |
marcelpinto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you follow https://developer.android.com/develop/ui/views/appwidgets/configuration#update and:
- Create a new intent instead of reusing the activity one when setting the cancel result
- Pass the Intent instead of the widget ID and change the result on apply instead.
marcelpinto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the change, but could you fix the remaining issues.
...ain/java/com/google/android/glance/appwidget/configuration/AppWidgetConfigurationScaffold.kt
Outdated
Show resolved
Hide resolved
...ain/java/com/google/android/glance/appwidget/configuration/AppWidgetConfigurationScaffold.kt
Outdated
Show resolved
Hide resolved
...ain/java/com/google/android/glance/appwidget/configuration/AppWidgetConfigurationScaffold.kt
Show resolved
Hide resolved
setResult with the created Intent per updated spec. https://developer.android.com/develop/ui/views/appwidgets/configuration#update
Allow the appWidgetId to be relayed to the launcher if it is not provided in the configuration activity intent.
This prevents the following error when applyConfiguration is called on at least the Pixel 3 XL running Android 12.