Skip to content

3.1.0

Latest

Choose a tag to compare

@anggrayudi anggrayudi released this 08 Sep 09:35

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_URI is attached to picker intents only on API 26+ again — addInitialPathToIntent()
    and DocumentFileCompat.getDefaultExternalStorageIntent(). Below 26 the extra was ignored anyway;
    the initialPath parameters carry that note in their KDoc again.
  • The DocumentsContract.moveDocument() fast path in moveFolderTo() and moveFileTo() checks for
    API 24+ again before using it.
  • getSdCardRootAccessIntent() and the SD-card arm of RequestStorageAccessContract are gated on
    API 24+ again, since neither StorageManager.getStorageVolumes() nor createAccessIntent() exists
    below that.
  • Context.dataDirectory falls back to filesDir.parentFile below API 24, where Context.getDataDir()
    is not available.
  • DocumentFileCompat.getStorageIds() and StorageType.fromStorageId() no longer consult
    StorageManager.storageVolumes below API 24; they fall back to the storage-ID regex, as before.
  • OpenFolderPickerContract persists the URI permission for a picked SD-card root below API 24 again.

API:

  • @RequiresApi(24) on DocumentFileCompat.isMountedVolumeId(), StorageAccessManager.resolveBookmark()
    and StorageAccessManager.createBookmark() — all three read StorageManager.getStorageVolumes().
    The rest of StorageAccessManager (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.