fix(sdcard): return temporary image URIs in getImage#2045
fix(sdcard): return temporary image URIs in getImage#2045bajrangCoder merged 2 commits intoAcode-Foundation:mainfrom
Conversation
Greptile SummaryThis PR fixes Confidence Score: 5/5Safe to merge — core logic is correct and all remaining findings are minor style suggestions. The fix correctly aligns the Java implementation with Android's permission model for ACTION_GET_CONTENT URIs, type definitions match the new return value, and the two open comments are cosmetic (a no-op intent flag and a documentation improvement). No logic bugs or breaking regressions were found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant JS as JS Caller
participant Plugin as SDcard Plugin (Java)
participant Android as Android Gallery
participant AR as onActivityResult
JS->>Plugin: getImage(mimeType, callback)
Plugin->>Android: startActivityForResult(ACTION_GET_CONTENT, PICK_FROM_GALLERY)
Android-->>AR: RESULT_OK + data (Uri)
AR->>AR: null check data
AR->>AR: data.getData() → uri
alt uri == null && ClipData present
AR->>AR: uri = ClipData.getItemAt(0).getUri()
end
alt uri != null
AR-->>JS: callback.success(uri.toString())
Note over AR,JS: Temporary grant — valid for app process lifetime only
else uri == null
AR-->>JS: callback.error("No file selected")
end
|
No description provided.