Merge "The JE about "android.process.media" will pop up when you eject the SD card after you set SD as internel phone storage"

This commit is contained in:
Treehugger Robot
2018-11-13 03:19:56 +00:00
committed by Gerrit Code Review

View File

@@ -1634,7 +1634,7 @@ public class MediaScanner implements AutoCloseable {
selectionArgs = new String[] { path };
c = mMediaProvider.query(mFilesUriNoNotify, FILES_PRESCAN_PROJECTION,
where, selectionArgs, null, null);
if (c.moveToFirst()) {
if (c != null && c.moveToFirst()) {
long rowId = c.getLong(FILES_PRESCAN_ID_COLUMN_INDEX);
int format = c.getInt(FILES_PRESCAN_FORMAT_COLUMN_INDEX);
long lastModified = c.getLong(FILES_PRESCAN_DATE_MODIFIED_COLUMN_INDEX);