Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c8feecd authored by Tao Bao's avatar Tao Bao Committed by android-build-merger
Browse files

Merge "Add a new API applyPayloadFd() of UpdateEngine" am: f4b0318d am: eca7403b

am: c009d8e0

Change-Id: I1f464891e522c58bfc0aa958a5fed1e00bbc01d2
parents a038e982 c009d8e0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5471,6 +5471,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();
+18 −0
Original line number Diff line number Diff line
@@ -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
@@ -311,6 +313,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.
     *