You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked into this. When Gallery has a modification date from MediaStore, it uses that (DATE_MODIFIED in MediaFetcher) instead of reading the file itself. touch only changes the file, and MediaStore keeps the old value until the file is scanned again.
I checked it on an emulator (Android 17) with adb shell:
After a media scan: file mtime 1577876400, MediaStore date_modified1577876400
After touch -m -t 201901011200: file mtime 1546340400, MediaStore still 1577876400
After scanning the file again: both 1546340400
So as a workaround, running a media scan after the bulk touch should make Gallery pick up the new times. In Termux that's termux-media-scan -r <folder> from the Termux:API package.
Fixing it in the app would mean also checking the file's own mtime, which costs an extra file access per item, so I'll leave it to the maintainers to decide whether that's wanted.
Activity
PedroFlores199 commentedon Nov 27, 2026
I looked into this. When Gallery has a modification date from MediaStore, it uses that (
DATE_MODIFIEDinMediaFetcher) instead of reading the file itself.touchonly changes the file, and MediaStore keeps the old value until the file is scanned again.I checked it on an emulator (Android 17) with
adb shell:1577876400, MediaStoredate_modified1577876400touch -m -t 201901011200: file mtime1546340400, MediaStore still15778764001546340400So as a workaround, running a media scan after the bulk
touchshould make Gallery pick up the new times. In Termux that'stermux-media-scan -r <folder>from the Termux:API package.Fixing it in the app would mean also checking the file's own mtime, which costs an extra file access per item, so I'll leave it to the maintainers to decide whether that's wanted.