diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2019-02-11 11:07:09 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2019-02-11 11:39:14 -0700 |
| commit | 8805033e7a46befd83b4c3fdeb3736bc08d7b75e (patch) | |
| tree | 3067fd36ecd3f6beee1fa44535a466c16b8e3f96 /core/java/android/os/FileUtils.java | |
| parent | 2c282d75db34c3ae5eacb85b8661692fbc08dd71 (diff) | |
Allow update() to move files on disk.
There are a set of columns available through insert() and query()
which influence placement of files on disk, so it makes sense to
expand update() to allow movement of underlying files, as long as
the changes respect any rules that would have been applied to a
brand new insert().
When a caller updates any placement columns, blend them together
with any current values, and generate the path that would have
been used for an insert.
Bug: 123967243
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I440a3edc5faaebac30e5bfa4c992157be39c8ee1
Diffstat (limited to 'core/java/android/os/FileUtils.java')
| -rw-r--r-- | core/java/android/os/FileUtils.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java index 629289bb7a45..0384faa88be5 100644 --- a/core/java/android/os/FileUtils.java +++ b/core/java/android/os/FileUtils.java @@ -1093,6 +1093,12 @@ public class FileUtils { return buildUniqueFileWithExtension(parent, parts[0], parts[1]); } + /** {@hide} */ + public static File buildNonUniqueFile(File parent, String mimeType, String displayName) { + final String[] parts = splitFileName(mimeType, displayName); + return buildFile(parent, parts[0], parts[1]); + } + /** * Generates a unique file name under the given parent directory, keeping * any extension intact. |
