Allocate space using new StorageManager API.
Local storage devices might be willing to delete cached data to make room for user-demanded data, such as copy operations. So if the source size is known, and the target supports allocation, then use the new StorageManager APIs to pre-allocate that space. Because this uses fallocate() internally it has multiple benefits, including optimizing the on-disk layout, reducing fragmentation, and preventing us from running out of space mid-copy. Bug: 63057877 Test: bit DocumentsUITests:com.android.documentsui.services.CopyJobTest Test: bit DocumentsUITests:com.android.documentsui.services.MoveJobTest Change-Id: I8406e6e04294748993e8918351e37d70e5d02a45
Loading
Please register or sign in to comment