-
-
Notifications
You must be signed in to change notification settings - Fork 742
Allow background start activity for configure widget #5351
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?
Allow background start activity for configure widget #5351
Conversation
app/src/main/kotlin/io/homeassistant/companion/android/widgets/BaseWidgetConfigureActivity.kt
Fixed
Show fixed
Hide fixed
Tested the debug APK here but still got the same error, here are some more logs just above in case its helpful
|
I didn't find any way to make it works on Android 15. The only solution seems to move away from getting the result in the activity to get the result in a BroadcastReceiver which works on all the version. |
I agree. The callback intent currently used already forwards the data to the AppWidgetProvider (which is a BroadcastReceiver) so that should be possible without changes to the flow for the user. |
Summary
Since Android 15, we need to opt-in to be able to start an activity in background. Even if we are not actually starting a new activity when pinning a widget the activity is put in background when dragging so we need to opt-in. This PR generalize the creation of the PendingIntent to avoid duplicating the logic on all our configure screens.
Checklist
Any other notes
Fixes #5349