OpenableColumns makes it clear that a DocumentProvider is only required to implement two columns: OpenableColumns.DISPLAY_NAME and OpenableColumns.SIZE. All other columns are optional and can cause modernstorage to crash because it expects last_modified and mime_type to be always present.
FATAL EXCEPTION: main
Process: me.saket.teleport.debug, PID: 9944
java.lang.IllegalArgumentException: Invalid column last_modified
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:481)
at android.content.ContentResolver.query(ContentResolver.java:1219)
at android.content.ContentResolver.query(ContentResolver.java:1151)
at android.content.ContentResolver.query(ContentResolver.java:1107)
at com.google.modernstorage.storage.AndroidFileSystem.fetchMetadataFromDocumentProvider(AndroidFileSystem.kt:302)
at com.google.modernstorage.storage.AndroidFileSystem.metadataOrNull(AndroidFileSystem.kt:185)
FATAL EXCEPTION: main
Process: me.saket.teleport.debug, PID: 9439
java.lang.IllegalStateException: Couldn't read row 0, col 3 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetLong(Native Method)
at android.database.CursorWindow.getLong(CursorWindow.java:539)
at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:78)
at android.database.CursorWrapper.getLong(CursorWrapper.java:131)
at com.google.modernstorage.storage.AndroidFileSystem.fetchMetadataFromDocumentProvider(AndroidFileSystem.kt:327)
at com.google.modernstorage.storage.AndroidFileSystem.metadataOrNull(AndroidFileSystem.kt:185)
This PR treats those two columns as nullable. Thoughts?
OpenableColumns makes it clear that a
DocumentProvider
is only required to implement two columns:OpenableColumns.DISPLAY_NAME
andOpenableColumns.SIZE
. All other columns are optional and can causemodernstorage
to crash because it expectslast_modified
andmime_type
to be always present.Example 1: Files by Google
Example 2: Cx file explorer
This PR treats those two columns as nullable. Thoughts?