diff options
| author | Zim <zezeozue@google.com> | 2020-03-04 11:56:32 +0000 |
|---|---|---|
| committer | Zim <zezeozue@google.com> | 2020-03-04 15:38:48 +0000 |
| commit | 71fcf13cf2b280d10026fa7ec3a59c3447dec10a (patch) | |
| tree | 51f13f784f9d6627d18be3ae57669f867377ad95 /core/java/android | |
| parent | bed09965dd5cf3d3da2c6cf0e6378d090e802d64 (diff) | |
Replace String for 'path' to File
This addresses API review feedback
Bug: 150685654
Test: m
Change-Id: I45d6eb1fc02272e4e4fd729b6535a950aefe8f20
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/service/storage/ExternalStorageService.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/service/storage/ExternalStorageService.java b/core/java/android/service/storage/ExternalStorageService.java index cc8116d09013..fe797eb02602 100644 --- a/core/java/android/service/storage/ExternalStorageService.java +++ b/core/java/android/service/storage/ExternalStorageService.java @@ -31,6 +31,7 @@ import android.os.ParcelableException; import android.os.RemoteCallback; import android.os.RemoteException; +import java.io.File; import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -109,10 +110,17 @@ public abstract class ExternalStorageService extends Service { * * <p> Additional calls to start a session for the same {@code sessionId} while the session * is still starting or already started should have no effect. + * + * @param sessionId uniquely identifies a running session and used in {@link #onEndSession} + * @param flag specifies the type or additional attributes of a session + * @param deviceFd for intercepting IO from other apps + * @param upperFileSystemPath is the root path on which we are intercepting IO from other apps + * @param lowerFileSystemPath is the root path matching {@code upperFileSystemPath} containing + * the actual data apps are trying to access */ public abstract void onStartSession(@NonNull String sessionId, @SessionFlag int flag, - @NonNull ParcelFileDescriptor deviceFd, @NonNull String upperFileSystemPath, - @NonNull String lowerFileSystemPath) throws IOException; + @NonNull ParcelFileDescriptor deviceFd, @NonNull File upperFileSystemPath, + @NonNull File lowerFileSystemPath) throws IOException; /** * Called when the system ends the session identified by {@code sessionId}. Implementors should @@ -136,7 +144,8 @@ public abstract class ExternalStorageService extends Service { RemoteCallback callback) throws RemoteException { mHandler.post(() -> { try { - onStartSession(sessionId, flag, deviceFd, upperPath, lowerPath); + onStartSession(sessionId, flag, deviceFd, new File(upperPath), + new File(lowerPath)); sendResult(sessionId, null /* throwable */, callback); } catch (Throwable t) { sendResult(sessionId, t, callback); |
