Merge "Rename onFreeCacheRequested API" into sc-dev

This commit is contained in:
Biswarup Pal
2021-02-05 17:22:01 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 3 deletions

View File

@@ -10331,7 +10331,7 @@ package android.service.storage {
ctor public ExternalStorageService();
method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
method public abstract void onEndSession(@NonNull String) throws java.io.IOException;
method public void onFreeCacheRequested(@NonNull java.util.UUID, long);
method public void onFreeCache(@NonNull java.util.UUID, long) throws java.io.IOException;
method public abstract void onStartSession(@NonNull String, int, @NonNull android.os.ParcelFileDescriptor, @NonNull java.io.File, @NonNull java.io.File) throws java.io.IOException;
method public abstract void onVolumeStateChanged(@NonNull android.os.storage.StorageVolume) throws java.io.IOException;
field public static final int FLAG_SESSION_ATTRIBUTE_INDEXABLE = 2; // 0x2

View File

@@ -158,7 +158,7 @@ public abstract class ExternalStorageService extends Service {
* @param volumeUuid uuid of the {@link StorageVolume} from which cache needs to be freed
* @param bytes number of bytes which need to be freed
*/
public void onFreeCacheRequested(@NonNull UUID volumeUuid, @BytesLong long bytes) {
public void onFreeCache(@NonNull UUID volumeUuid, @BytesLong long bytes) throws IOException {
throw new UnsupportedOperationException("onFreeCacheRequested not implemented");
}
@@ -202,7 +202,7 @@ public abstract class ExternalStorageService extends Service {
RemoteCallback callback) {
mHandler.post(() -> {
try {
onFreeCacheRequested(StorageManager.convert(volumeUuid), bytes);
onFreeCache(StorageManager.convert(volumeUuid), bytes);
sendResult(sessionId, null /* throwable */, callback);
} catch (Throwable t) {
sendResult(sessionId, t, callback);