Android Auto: Home Screen and Thumbnail Loading
Description
This merge request is a correction of three small defects.
-
When fewer than fifty songs are in the media library the Android Auto Home screen will not load. This is a result of the minimum value for the Random function being set to 0, which is an invalid argument. It must be 1, which results in the nextInt() function always returning 0. (The lower bound is inclusive of 0 and exclusive of 1). See: Random | Android Developers
-
If a RuntimeException occurs during menu navigation the exception is currently ignored. This updates the code to log the exception; however, it does not send a null back in the catch clause. I believe if the 'Spinner' continues indefinitely users are more likely to report a defect than if a 'No items.' page appears.
-
This partially reverts the logic in FileProvider.kt back to ccfaa5db and updates isPathValid() to address the current medialibrary issue with invalid cover art paths being returned. This change takes a proactive approach to checking the file is in the proper location, exists, and is readable.
How Has This Been Tested?
- Changes to Random were directly tested and confirmed.
- Update to the catch clause / logger works as expected.
- Thumbnail issue was tested with an MP3 that results in an invalid path. Correct default icon was substituted.
Types of changes
-
Bug fix (non-breaking change which fixes an issue)
Checklist
-
I have read the CONTRIBUTING section of the README document.