diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ee616..bb91280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Support for cross-profile interactions allowlisting (e.g. for Gboard). - Removed "Fake Camera" feature as it has not been supported since R. - Version displayed within the app has now been changed to also reflect the exact Git commit when the app is built. +- File Shuttle no longer appends ".null" or ".bin" suffixes unnecessarily. This should make it work much better with file managers such as Material Files. 1.8 === diff --git a/app/src/main/java/net/typeblog/shelter/services/FileShuttleService.java b/app/src/main/java/net/typeblog/shelter/services/FileShuttleService.java index 929da96..6eb419b 100644 --- a/app/src/main/java/net/typeblog/shelter/services/FileShuttleService.java +++ b/app/src/main/java/net/typeblog/shelter/services/FileShuttleService.java @@ -19,6 +19,7 @@ import android.webkit.MimeTypeMap; import androidx.annotation.Nullable; +import net.typeblog.shelter.R; import net.typeblog.shelter.ShelterApplication; import net.typeblog.shelter.util.CrossProfileDocumentsProvider; import net.typeblog.shelter.util.Utility; @@ -66,7 +67,12 @@ public class FileShuttleService extends Service { File f = new File(resolvePath(path)); HashMap map = new HashMap<>(); map.put(DocumentsContract.Document.COLUMN_DOCUMENT_ID, f.getAbsolutePath()); - map.put(DocumentsContract.Document.COLUMN_DISPLAY_NAME, f.getName()); + if (f.equals(Environment.getExternalStorageDirectory())) { + // Show "Shelter" as the name of the root directory + map.put(DocumentsContract.Document.COLUMN_DISPLAY_NAME, getString(R.string.app_name)); + } else { + map.put(DocumentsContract.Document.COLUMN_DISPLAY_NAME, f.getName()); + } map.put(DocumentsContract.Document.COLUMN_SIZE, f.length()); map.put(DocumentsContract.Document.COLUMN_LAST_MODIFIED, f.lastModified());