minSdk goes back to 23. 3.0.0 raised it to 26 and deleted every pre-O code path along with it;
#157 pointed out that this locks out apps
still shipping to 23 without the library gaining anything for it. This release restores those
branches. Apps already on 26+ see no behavioural change.
Version changes:
- minSdk 26 → 23. compileSdk / targetSdk stay at 37 (Android 17).
Restored pre-26 behaviour:
EXTRA_INITIAL_URIis attached to picker intents only on API 26+ again —addInitialPathToIntent()
andDocumentFileCompat.getDefaultExternalStorageIntent(). Below 26 the extra was ignored anyway;
theinitialPathparameters carry that note in their KDoc again.- The
DocumentsContract.moveDocument()fast path inmoveFolderTo()andmoveFileTo()checks for
API 24+ again before using it. getSdCardRootAccessIntent()and the SD-card arm ofRequestStorageAccessContractare gated on
API 24+ again, since neitherStorageManager.getStorageVolumes()norcreateAccessIntent()exists
below that.Context.dataDirectoryfalls back tofilesDir.parentFilebelow API 24, whereContext.getDataDir()
is not available.DocumentFileCompat.getStorageIds()andStorageType.fromStorageId()no longer consult
StorageManager.storageVolumesbelow API 24; they fall back to the storage-ID regex, as before.OpenFolderPickerContractpersists the URI permission for a picked SD-card root below API 24 again.
API:
@RequiresApi(24)onDocumentFileCompat.isMountedVolumeId(),StorageAccessManager.resolveBookmark()
andStorageAccessManager.createBookmark()— all three readStorageManager.getStorageVolumes().
The rest ofStorageAccessManager(ensureAccess,pickFolder,pickFiles,pickMedia,
createFile,requestStoragePermission) works at 23.
Credit: @LagradOst authored the revert in
#158.
Caveat: the restored pre-26 paths are verified by build, lint and unit tests at minSdk 23, not by
a run on a physical API 23 device. @LagradOst reports the library working for sub-26 users of their app.