When we create a file that already exists, we try attaching a suffix
like "(1)" to the filename to avoid the conflict. The newly added
rename method should do the same, since developers may not have
access to delete the conflicting file.
Test: boots, rename via UI, new unit tests
Bug: 31545404
Change-Id: Ie397eebb0fbf98cf079eee3bbbb6c6b7ca627d91
Otherwise we'll throw when trying to create the second (visible)
filename because we just deleted it.
Bug: 30087518
Change-Id: I940a8f81c264fc17d477fadf46fd48eae29f2f6f
The media scanner always records visible paths, so we need to use
visible paths when cleaning up deleted records.
Bug: 28581384
Change-Id: I8a2c65001216e4a96b2375579363a771de782bcc
There is no regular file representation for archive documents, so
the call to getFileForDocId(archivedDocId) was throwing an exception.
Bug: 27383423
Change-Id: Icbc1e8ecdddc7698cfdb79b41da6e1d3cecf11ae
A variety of related fixes:
- don't force size enable when browsing from device mounted notifications.
- don't show settings menu item as action (put in overflow).
- add sd card icon (not quite yet used, need to suss that out).
Bug:26880985,26883578,26771127
Change-Id: I36f153c42217f8092f157ded2a756c02525593ab
Add DIRECTORY_HOME to android.os.Environment...use that for dir name,
so we don't use a localized name when creating directory.
Mark all of the DIRECTORY_* fields final.
Bug: 26814341
Change-Id: I5a11bcb180674c619de2f5ce9ed598521e60cc25
It opens a an alert dialog that tells user application X is requesting
access to folder Y on volume Z; if user accepts, it returns the proper
URI, otherwise it returns RESULT_CANCELED.
The requested path must satisfy the following requirements:
1.It's directory (getName()) must be one of the pre-definied folders on
Environment.
2.It's root (getParent()) must be a valid external storage root.
In order to satisfy #2, DocumentsUI calls the ExternalStorageProvider,
through a custom call() implementation.
BUG: 23011462
Change-Id: I8e491e82ae320df88f7b8923286c4c1ad050ae80
Update FilesActivityUiTests to verify Home is present
and that clicking a root sets the title accordingly.
Guard addition of WRITABLE flag with a volume test.
Bug: 25147243
Change-Id: Ic20372737cae08a82af0aade0c0dbbd8c22d5f34
When deleting files directly from external storage devices, remove
any matching entries from MediaStore so we don't end up showing
stale entries to clients, such as MTP/PTP.
Also handles the case where an entire directory is deleted.
Bug: 24045921
Change-Id: I802470fa1aa03e0bec147ea113f1a49e26a0f3f9
Transient volumes like USB drives are not mounted as visible, so we
shouldn't be kicking off media scanner for them.
Bug: 22545248
Change-Id: Ic8f2d3134f1edb8b2a12e8ff283eceeeb230f48b
... the storage list view
1. Change to ExternalStorageProvider
When available volumes have changed, it now notifies on
"content://com.android.externalstorage.documents" rather than on
"content://com.android.externalstorage.documents/root/", because it'll also
affect "content://com.android.externalstorage.documents/document/*/children".
2. Change to DocumentUI
- DirectoryLoader now won't crash when a provider returns null.
- DirectoryFragment now closes itself (i.e. emulate a back press) when a load
failed.
- It now correctly reloads contents when a volume is ejected thanks to 1.
Bug 21472170
Change-Id: Icf4bbc2ebb9067313dbbb67083cd4115b0a75c58
Per UX, default strings should have space between value and units
resulting in "12.3 GB". Add a formatting variant that returns the
various components for callers who want to build their own strings.
For now there is only one mounted emulated volume at a time, and
it's always the primary storage, so give it the default rootId to
keep old Uris working.
Change-Id: Ifcc72a91a6b397ee65dc92642153286186eb64ac
Move code for checking file extensions and MIME types from
ExternalStorageProvider into android.os.FileUtils, so it can be used by
other clients (e.g. DownloadsProvider).
BUG=20157955
Change-Id: Ib16a16af723c21fb8d2912c8917dfd68653ea6fa
Send limited broadcast intent when certain volume state changes
occur; the only customer for now is ExternalStorageProvider.
Change notification flow to be less bumpy. Pick USB icon based on
disk type, and avoid using "generic" disk labels.
Bug: 19993667
Change-Id: I263bc9e9aae2ae57eb4d1afe76da686aee5475fb