KLTE/LOS16 -- SD Card Content Checking only happens after first manual unlock on boot.
Expected Behavior
SD card contents scanned for updates on startup
Current Behavior
When LOS16 starts up, the message "Checking SD Card Contents" in the status bar only pops up AFTER you've unlocked the device for the first time after boot.
This means that, since media scanner is already running its scan in the background, Android will either REMOVE playlists from its media storage since it no longer sees it there, or set it to zero contents, or a different number of contents depending on how far the media scan was during the time you unlocked the device.
An additional side effect is that you lose your playlist playback position in your audio player as a result of this.
Possible Solution
Suspected reason for this is that the SD card scanning only seems to take place after the device is unlocked for the first time after a boot up. This can be worked around in different ways:
- Make a backup via Titanium Backup of "Media Storage" before the reboot/update and restore it over the top of the current database (not tried, but sounds feasible)
- Unmount and remount the SD card from within Settings and wait for the scanner to do it's thing (though there's no indication when this is done/in progress) -- and it might take a few minutes to a few hours to complete.
Steps to Reproduce
- Ensure you have a playlist on your SD card (doesn't matter if you have a lot of songs or not) I have it essentially as a list of my mp3s in a .m3u file
- Reboot (or install the latest nightly using the updater)
- Leave your device locked after reboot for several minutes (20 mins if you can to be sure)
- Unlock your device
- Look for the "Check SD Card Contents in the status bar" (might need to drag down to see the message and it's quite brief)
- Look at your playlists in something like Apollo, or the native Music app.
- Depending on your app, you'll either have something like zero entries in your playlist, or a reduced quantity, even though you haven't actually deleted or changed the playlist.
Screenshots: This screenshot is my playlist before any change. You'll notice it has over 3000 items
I run an updater (yes, this is an old one, but this problem occurs even now)
After the updater finishes, and reboots, I come back, unlock the device (after it had been sitting there for a while), and this is the playlist item count
/device klte
/version lineage-16.0
/date 2019-Apr-03
/kernel 3.4.113-lineageos-gd402fdb
/baseband G900FXXU1ANG2
/mods OpenGapps, Magisk, MagiskManager
I have read the directions.logcat.log