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

Commit e4e38d66 authored by Richard Uhler's avatar Richard Uhler
Browse files

Stub out API to support rollback of staged installs.

Adds isStaged and getSessionId methods to RollbackInfo.

Bug: 112431924
Test: atest RollbackTest
Change-Id: I23d3695021474d52cd39a90bcabdb278d95cd4cc
parent 530c508e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1700,6 +1700,8 @@ package android.content.rollback {
    method public int describeContents();
    method public java.util.List<android.content.rollback.PackageRollbackInfo> getPackages();
    method public int getRollbackId();
    method public int getSessionId();
    method public boolean isStaged();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.rollback.RollbackInfo> CREATOR;
  }
+19 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.content.rollback;

import android.annotation.SystemApi;
import android.content.pm.PackageInstaller;
import android.os.Parcel;
import android.os.Parcelable;

@@ -38,9 +39,6 @@ public final class RollbackInfo implements Parcelable {

    private final List<PackageRollbackInfo> mPackages;

    // TODO: Add a flag to indicate if reboot is required, when rollback of
    // staged installs is supported.

    /** @hide */
    public RollbackInfo(int rollbackId, List<PackageRollbackInfo> packages) {
        this.mRollbackId = rollbackId;
@@ -66,6 +64,24 @@ public final class RollbackInfo implements Parcelable {
        return mPackages;
    }

    /**
     * Returns true if this rollback requires reboot to take effect after
     * being committed.
     */
    public boolean isStaged() {
        // TODO: Support rollback of staged installs.
        return false;
    }

    /**
     * Returns the session ID for the committed rollback for staged rollbacks.
     * Only applicable for rollbacks that have been committed.
     */
    public int getSessionId() {
        // TODO: Support rollback of staged installs.
        return PackageInstaller.SessionInfo.INVALID_ID;
    }

    @Override
    public int describeContents() {
        return 0;