Samsung Gallery edit/save leaves video in MediaStore.IS_PENDING=1 state


I’m encountering an issue where videos edited in Samsung Gallery become permanently inaccessible to my code (and even to other third-party apps).

Problem: <br> After editing a video in Samsung Gallery and tapping “Save” (overwrite), the video does not appear in the “Videos” tab of any media picker. The video appears in Gallery under “Collections -&gt; Camera”. My code and other External apps cannot open the file.

note: MediaStore shows IS_PENDING = 1 and it never resets.<br> The other option Save as copy works correctly (a new duplicate file is accessible).

Reproduction steps: <br> Open Samsung Gallery and Select a video from camera roll.<br> Edit the video. Tap “Save” (overwrite) then try to access the video.

Result: <br> Video is missing from Videos tab. Visible in Gallery, but cannot be opened externally

This is my code to read the file, but I get the result of "pending" and no file access:

val projection = arrayOf(MediaStore.Video.Media.IS_PENDING)
val cursor = contentResolver.query(
    MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
    projection,
    &quot;${MediaStore.Video.Media._ID} = ?&quot;,
    arrayOf(videoId.toString()),
    null
)
cursor?.use {
    val pendingCol = it.getColumnIndexOrThrow(MediaStore.Video.Media.IS_PENDING)
    val isPending = it.getInt(pendingCol)
    Log.d(&quot;MediaStore&quot;, &quot;Video $videoId IS_PENDING: $isPending&quot;)
}

Code result: This consistently logs IS_PENDING = 1 and never changes.

Additional context: <br> This occurs on multiple Samsung devices (Z Fold 3 and others). It was tested on Android 13+ / One UI 5+. “Save as copy” works correctly (a "new file" copy is accessible)

Questions
When and how is IS_PENDING expected to be reset to =0 after saving?
How can my app access a media file owned by another app (eg: Gallery) while IS_PENDING=1?

Looking for clarification or possible workarounds.

1
Apr 6 at 3:35 AM
User AvatarCzle
#android#kotlin#video#video-processing#samsung-galaxy

No answer found for this question yet.