Skip to content

fix: Behavior for API below 26#4

Open
OS-pedrogustavobilro wants to merge 4 commits intofeat/RMET-4099/android-implementationfrom
fix/RMET-4099/api-below-26
Open

fix: Behavior for API below 26#4
OS-pedrogustavobilro wants to merge 4 commits intofeat/RMET-4099/android-implementationfrom
fix/RMET-4099/api-below-26

Conversation

@OS-pedrogustavobilro
Copy link
Contributor

Description

This PR fixes an issue where the library was accessing APIs available only in 26, but minSdk of library is below 26.
These APIs were for getting file creation date (for MediaResult#Metadata). The 3 options I saw to overcome this:

  1. No creationDate for Android API version below 26.
  2. Use lastModifiedDate as a fallback for APIs below 26.
  3. Use core library desugaring to make Java 8+ APIs available in older Android versions.

I ended up going with option 2. This allows to still return relevant information for Metadata, and is simpler than enabling core library desugaring - we didn't do this either for FileSystem (see docs for ctime), and since it's just a couple API levels that are pretty old, I think this option is fine.

This Lib currently had minSdk 23, I updated to 24, also updated compileSdk and targetSdk, to match current native library that this one is ported from.

Context

Capacitor has minSdk 24, but current native libary had minSdk 26, the one incompatibility was in Java NIO file APIs available only in minSdk 26 (without core library desugaring)

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

@OS-pedrogustavobilro
Copy link
Contributor Author

FYI @OS-ruimoreiramendes @alexgerardojacinto, I'm comparing this against the branch in #3 (if I did it against the unification branch would have to resolve conflicts later). We can wait til the other PR is merged, then switch the branch in this one and merge it after

Base automatically changed from feat/RMET-4099/edit-media-processor to feat/RMET-4099/android-implementation March 16, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants