diff options
author | 2019-07-13 16:29:49 +0000 | |
---|---|---|
committer | 2019-07-13 16:29:49 +0000 | |
commit | f4b0318d6f9ff9078fc5fda5be7046105bca3fb1 (patch) | |
tree | 0f21d01418f0a4952d1477ad860c8d9c1701bf03 | |
parent | 0eea7ac8f4784beaefec68f1bd063b736bcde995 (diff) | |
parent | bcc56339bb74737b235376c338efd21db843d796 (diff) |
Merge "Add a new API applyPayloadFd() of UpdateEngine"
-rw-r--r-- | api/system-current.txt | 1 | ||||
-rw-r--r-- | core/java/android/os/UpdateEngine.java | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 7f29b1d05fc4..593b45db5809 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4270,6 +4270,7 @@ package android.os { public class UpdateEngine { ctor public UpdateEngine(); method public void applyPayload(String, long, long, String[]); + method public void applyPayload(java.io.FileDescriptor, long, long, String[]); method public boolean bind(android.os.UpdateEngineCallback, android.os.Handler); method public boolean bind(android.os.UpdateEngineCallback); method public void cancel(); diff --git a/core/java/android/os/UpdateEngine.java b/core/java/android/os/UpdateEngine.java index 8f2826c16b63..69bdde35a967 100644 --- a/core/java/android/os/UpdateEngine.java +++ b/core/java/android/os/UpdateEngine.java @@ -21,6 +21,8 @@ import android.os.IUpdateEngine; import android.os.IUpdateEngineCallback; import android.os.RemoteException; +import java.io.FileDescriptor; + /** * UpdateEngine handles calls to the update engine which takes care of A/B OTA * updates. It wraps up the update engine Binder APIs and exposes them as @@ -187,6 +189,22 @@ public class UpdateEngine { } /** + * Applies the payload passed as file descriptor {@code fd} instead of + * using the {@code file://} scheme. + * + * <p>See {@link #applyPayload(String)} for {@code offset}, {@code size} and + * {@code headerKeyValuePairs} parameters. + */ + public void applyPayload(FileDescriptor fd, long offset, long size, + String[] headerKeyValuePairs) { + try { + mUpdateEngine.applyPayloadFd(fd, offset, size, headerKeyValuePairs); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** * Permanently cancels an in-progress update. * * <p>See {@link #resetStatus} to undo a finshed update (only available |