Comments for renameTo from the Android API reference for DocumentFile which is what the Native member of ExternalFile is
Renames this file to displayName.
Note that this method does not throw IOException on failure. Callers must check the return value.
Some providers may need to create a new document to reflect the rename, potentially with a different MIME type, so getUri and getType may change to reflect the rename.
When renaming a directory, children previously enumerated through listFiles may no longer be valid.