Skip to content
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

[media-library] Fix getAlbumsAsync() crashing on Android 10 #9666

Merged
merged 6 commits into from Aug 12, 2020

Conversation

barthap
Copy link
Contributor

@barthap barthap commented Aug 10, 2020

Why

Fixes #9635

Android 10 seems not to support SQL functions (COUNT(*), GROUP BY etc.) in ContentResolver queries. [source]

Also, MediaLibrary.getAlbumsAsync() did not work properly on Android.

How

Rewrite some expo-media-library methods, which used those statements.

  • Fixed getAlbumsAsync(). Rewritten method in Kotlin.
  • Fixed getAlbum().
  • Fixed MediaLibrary listener onChange() event.
  • Other minor fixes.
  • Cleanup.

Test Plan

  • Native unit tests
  • Test suite
  • NCL
  • Demo app ran on API level 29+.
  • Demo app ran on API level < 29

@barthap barthap requested a review from lukmccall August 10, 2020 13:47
@github-actions
Copy link
Contributor

Native Component List for this branch is ready

@barthap barthap changed the title [media-library] Fix getAlbumsAsync() crashes on Android 10 [media-library] Fix getAlbumsAsync() crashing on Android 10 Aug 11, 2020
@barthap barthap marked this pull request as ready for review August 11, 2020 09:56
@barthap barthap requested a review from tsapeta as a code owner August 11, 2020 09:56
@barthap barthap requested a review from lukmccall August 12, 2020 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[expo-media-library] Invalid column COUNT(*) exception on Android 10.
3 participants