diff options
| author | Zimuzo Ezeozue <zezeozue@google.com> | 2020-03-04 22:18:59 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-04 22:18:59 +0000 |
| commit | e8de8f21bd33e607e842f117df46fb575191aa79 (patch) | |
| tree | ffd110d610a48a2ac767a11590f75cde1aefc0ea /core/java | |
| parent | 0e4f868bb2861be152f5ae61701709054f3e8427 (diff) | |
| parent | 71fcf13cf2b280d10026fa7ec3a59c3447dec10a (diff) | |
Merge "Replace String for 'path' to File" into rvc-dev
Diffstat (limited to 'core/java')
| -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); |
