summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2019-07-13 16:29:49 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-07-13 16:29:49 +0000
commitf4b0318d6f9ff9078fc5fda5be7046105bca3fb1 (patch)
tree0f21d01418f0a4952d1477ad860c8d9c1701bf03 /core/java/android
parent0eea7ac8f4784beaefec68f1bd063b736bcde995 (diff)
parentbcc56339bb74737b235376c338efd21db843d796 (diff)
Merge "Add a new API applyPayloadFd() of UpdateEngine"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/UpdateEngine.java18
1 files changed, 18 insertions, 0 deletions
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