blob: 66df4fea3f23bf079f3568e96c91ebc97edb6eef [file] [log] [blame]
Richard Uhlerb29f1452018-09-12 16:38:15 +01001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.content.rollback;
18
Richard Uhlerc739c8c2018-12-12 11:03:34 +000019import android.annotation.SystemApi;
Richard Uhlerb29f1452018-09-12 16:38:15 +010020import android.os.Parcel;
21import android.os.Parcelable;
22
23/**
24 * Information about a set of packages that can be, or already have been
25 * rolled back together.
26 *
Richard Uhlerc739c8c2018-12-12 11:03:34 +000027 * @hide
Richard Uhlerb29f1452018-09-12 16:38:15 +010028 */
Richard Uhlerc739c8c2018-12-12 11:03:34 +000029@SystemApi
Richard Uhlerb29f1452018-09-12 16:38:15 +010030public final class RollbackInfo implements Parcelable {
31
32 /**
33 * The package that needs to be rolled back.
34 */
35 public final PackageRollbackInfo targetPackage;
36
37 // TODO: Add a list of additional packages rolled back due to atomic
38 // install dependencies when rollback of atomic installs is supported.
39 // TODO: Add a flag to indicate if reboot is required, when rollback of
40 // staged installs is supported.
41
Richard Uhlerc739c8c2018-12-12 11:03:34 +000042 /** @hide */
Richard Uhlerb29f1452018-09-12 16:38:15 +010043 public RollbackInfo(PackageRollbackInfo targetPackage) {
44 this.targetPackage = targetPackage;
45 }
46
47 private RollbackInfo(Parcel in) {
48 this.targetPackage = PackageRollbackInfo.CREATOR.createFromParcel(in);
49 }
50
51 @Override
52 public int describeContents() {
53 return 0;
54 }
55
56 @Override
57 public void writeToParcel(Parcel out, int flags) {
58 targetPackage.writeToParcel(out, flags);
59 }
60
61 public static final Parcelable.Creator<RollbackInfo> CREATOR =
62 new Parcelable.Creator<RollbackInfo>() {
63 public RollbackInfo createFromParcel(Parcel in) {
64 return new RollbackInfo(in);
65 }
66
67 public RollbackInfo[] newArray(int size) {
68 return new RollbackInfo[size];
69 }
70 };
71}