In MediaScanEngine.java, the scanMedia() method has:
if( android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.Q ) {
Log.w( TAG, "Android takes care itself." );
return;
}
This assumes Android automatically updates MediaStore after
file operations on API 30+, but this is not always true —
especially for direct File.renameTo()/move operations that
bypass the MediaStore API on scoped storage.
Steps to reproduce:
Expected: MediaStore should reflect the change (old entry removed,
new path scanned), similar to behavior on Android 10 and below.
Suggested fix: call MediaScannerConnection.scanFile() or
MediaStore.scanFile() explicitly even on newer Android versions,
or use ContentResolver.update() to reflect path changes.