Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4233f032 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Test if allocation supported; @removed clean up.

SM.allocateBytes() doesn't offer a clear way to detect if a failed
request could ever succeed.  (For example, we can never work with
pipes, or files on an unsupported storage device.)  So give
developers a first-class API to test if allocation is supported.

If the underlying filesystem doesn't support fallocate(), fall back
to ftruncate() instead of failing completely.

Clean up @removed APIs that were refactoring during API 26 review
process.

Remove support for storing downloads on the /cache partition, which
doesn't exist on many devices.

Bug: 63057877
Test: bit DownloadProviderTests:*
Test: bit DocumentsUITests:com.android.documentsui.services.CopyJobTest
Test: bit DocumentsUITests:com.android.documentsui.services.MoveJobTest
Change-Id: I85d42a1a7240034b4f2a6f359011ac182bdce36e
parent 53313d7e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31900,6 +31900,7 @@ package android.os.storage {
    method public android.os.storage.StorageVolume getStorageVolume(java.io.File);
    method public java.util.List<android.os.storage.StorageVolume> getStorageVolumes();
    method public java.util.UUID getUuidForPath(java.io.File) throws java.io.IOException;
    method public boolean isAllocationSupported(java.io.FileDescriptor);
    method public boolean isCacheBehaviorGroup(java.io.File) throws java.io.IOException;
    method public boolean isCacheBehaviorTombstone(java.io.File) throws java.io.IOException;
    method public boolean isEncrypted(java.io.File);
+0 −10
Original line number Diff line number Diff line
@@ -302,18 +302,8 @@ package android.os {
package android.os.storage {

  public class StorageManager {
    method public deprecated void allocateBytes(java.io.File, long, int) throws java.io.IOException;
    method public deprecated long getAllocatableBytes(java.io.File, int) throws java.io.IOException;
    method public deprecated long getCacheQuotaBytes(java.io.File) throws java.io.IOException;
    method public deprecated long getCacheQuotaBytes() throws java.io.IOException;
    method public deprecated long getCacheSizeBytes(java.io.File) throws java.io.IOException;
    method public deprecated long getCacheSizeBytes() throws java.io.IOException;
    method public deprecated long getExternalCacheQuotaBytes() throws java.io.IOException;
    method public deprecated long getExternalCacheSizeBytes() throws java.io.IOException;
    method public android.os.storage.StorageVolume getPrimaryVolume();
    method public android.os.storage.StorageVolume[] getVolumeList();
    method public deprecated boolean isCacheBehaviorAtomic(java.io.File) throws java.io.IOException;
    method public deprecated void setCacheBehaviorAtomic(java.io.File, boolean) throws java.io.IOException;
  }

}
+1 −0
Original line number Diff line number Diff line
@@ -34780,6 +34780,7 @@ package android.os.storage {
    method public android.os.storage.StorageVolume getStorageVolume(java.io.File);
    method public java.util.List<android.os.storage.StorageVolume> getStorageVolumes();
    method public java.util.UUID getUuidForPath(java.io.File) throws java.io.IOException;
    method public boolean isAllocationSupported(java.io.FileDescriptor);
    method public boolean isCacheBehaviorGroup(java.io.File) throws java.io.IOException;
    method public boolean isCacheBehaviorTombstone(java.io.File) throws java.io.IOException;
    method public boolean isEncrypted(java.io.File);
+0 −10
Original line number Diff line number Diff line
@@ -295,18 +295,8 @@ package android.os {
package android.os.storage {

  public class StorageManager {
    method public deprecated void allocateBytes(java.io.File, long, int) throws java.io.IOException;
    method public deprecated long getAllocatableBytes(java.io.File, int) throws java.io.IOException;
    method public deprecated long getCacheQuotaBytes(java.io.File) throws java.io.IOException;
    method public deprecated long getCacheQuotaBytes() throws java.io.IOException;
    method public deprecated long getCacheSizeBytes(java.io.File) throws java.io.IOException;
    method public deprecated long getCacheSizeBytes() throws java.io.IOException;
    method public deprecated long getExternalCacheQuotaBytes() throws java.io.IOException;
    method public deprecated long getExternalCacheSizeBytes() throws java.io.IOException;
    method public android.os.storage.StorageVolume getPrimaryVolume();
    method public android.os.storage.StorageVolume[] getVolumeList();
    method public deprecated boolean isCacheBehaviorAtomic(java.io.File) throws java.io.IOException;
    method public deprecated void setCacheBehaviorAtomic(java.io.File, boolean) throws java.io.IOException;
  }

}
+1 −0
Original line number Diff line number Diff line
@@ -32041,6 +32041,7 @@ package android.os.storage {
    method public android.os.storage.StorageVolume getStorageVolume(java.io.File);
    method public java.util.List<android.os.storage.StorageVolume> getStorageVolumes();
    method public java.util.UUID getUuidForPath(java.io.File) throws java.io.IOException;
    method public boolean isAllocationSupported(java.io.FileDescriptor);
    method public boolean isCacheBehaviorGroup(java.io.File) throws java.io.IOException;
    method public boolean isCacheBehaviorTombstone(java.io.File) throws java.io.IOException;
    method public boolean isEncrypted(java.io.File);
Loading