Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

State whether register are registered #16713

Closed
Arthur-Milchior opened this issue Jul 10, 2024 · 0 comments · Fixed by #16717 · May be fixed by #16714
Closed

State whether register are registered #16713

Arthur-Milchior opened this issue Jul 10, 2024 · 0 comments · Fixed by #16717 · May be fixed by #16714
Milestone

Comments

@Arthur-Milchior
Copy link
Member

Arthur-Milchior commented Jul 10, 2024

This became mandatory with Android 14.
https://developer.android.com/about/versions/14/behavior-changes-14

I'll try to work on it tonight, or update why it failed

@Arthur-Milchior Arthur-Milchior self-assigned this Jul 10, 2024
This was referenced Jul 10, 2024
Arthur-Milchior added a commit to Arthur-Milchior/Anki-Android that referenced this issue Jul 10, 2024
RECEIVER_EXPORTED is mandatory for receivers when target SDK is
14. However, this flag is only available since API 33. So we need to use
Compat.kt to register broadcast receivers.

By default, receivers were exported, so adding this flag creates no change in behaviour.

I checked whether we could try to not export the receiver for "downloaded decks" broadcast.  The app certainly builds, but the intent is never received. So I assume the webview used to download the deck is considered to be an external app.

The app does not crash on api 24 on simulator. So it seems it's still okay not to use those flags when they are not available. I hope the play store will agree with this logic.

There was a slight problem, with variables that could potentially be null. To ensure the type checker agreed with the code, without using !!, I had to rewrite some of the logic.

I also ensured that some of the code that was copy/pasted in various activity now entirely belong to AnkiActivity. As a side effect, all activities that used to listen to the "unmount" notification and finished, will now also show a toast when the card gets unmounted. Currently it was only the deck picker.

Fixes State whether register are received ankidroid#16713
Arthur-Milchior added a commit to Arthur-Milchior/Anki-Android that referenced this issue Jul 10, 2024
This does not change the behaviour of the app, but allows to target
sdk 14.

This version of the CL is actually by DavidA

Fixed ankidroid#16713
@Arthur-Milchior Arthur-Milchior changed the title State whether register are received State whether register are registered Jul 10, 2024
@github-actions github-actions bot added this to the 2.19 release milestone Jul 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
1 participant