zendesk / belvedere

An image picker library for Android
Apache License 2.0
145 stars 23 forks source link

Fixes a runtime crash on Android 11 #111

Closed baz8080 closed 4 years ago

baz8080 commented 4 years ago

Changes

Android 11 seems to have killed the ability to use a LIMIT clause, introduced in VERSION_CODES.O, in the order argument of a ContentProvider query.

This PR changes the query to use a Bundle when the version code is >= VERSION_CODES.O. It also changes the sorting order to use DATE_TAKEN if available, or DATE_MODIFIED otherwise.

Target and Build versions have been set to 30.

Extracted the code to generate the recent images cursor and added some baseline tests

Reviewers

@baz8080 @schlan @e2po @bridgeri127 @fibelatti

References

Risks