Stub out API to support rollback of staged installs.

Adds isStaged and getSessionId methods to RollbackInfo.

Bug: 112431924
Test: atest RollbackTest
Change-Id: I23d3695021474d52cd39a90bcabdb278d95cd4cc
This commit is contained in:
Richard Uhler
2019-01-24 16:12:07 +00:00
parent 530c508ed1
commit e4e38d6631
2 changed files with 21 additions and 3 deletions

View File

@@ -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;