fix issue with api29

Because '*' is not a valid columns (yeah android...), we need to supply an existing column to count things.
This commit is contained in:
Adrian Ulrich 2019-12-31 16:34:19 +01:00
parent adc0cedf44
commit 2b9466575f

View File

@ -336,7 +336,7 @@ public class MediaScanner implements Handler.Callback {
private void guessQuickScanPlan() {
int lastSeenDbSize = MediaLibrary.getPreferences(mContext)._nativeLibraryCount;
String selection = MediaStore.Audio.Media.IS_MUSIC + "!= 0";
String[] projection = { "COUNT(*)" };
String[] projection = { "COUNT("+MediaStore.Audio.Media.IS_MUSIC+")" };
Cursor cursor = null;
try {
cursor = mContext.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection, null, null);