1 /** 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 17 package android.content.rollback; 18 19 import android.content.pm.ParceledListSlice; 20 import android.content.rollback.RollbackInfo; 21 import android.content.IntentSender; 22 23 /** {@hide} */ 24 interface IRollbackManager { 25 getAvailableRollbacks()26 ParceledListSlice getAvailableRollbacks(); getRecentlyCommittedRollbacks()27 ParceledListSlice getRecentlyCommittedRollbacks(); 28 commitRollback(int rollbackId, in ParceledListSlice causePackages, String callerPackageName, in IntentSender statusReceiver)29 void commitRollback(int rollbackId, in ParceledListSlice causePackages, 30 String callerPackageName, in IntentSender statusReceiver); 31 32 // Exposed for use from the system server only. Callback from the package 33 // manager during the install flow when user data can be backed up and restored for a given 34 // package. snapshotAndRestoreUserData(String packageName, in int[] userIds, int appId, long ceDataInode, String seInfo, int token)35 void snapshotAndRestoreUserData(String packageName, in int[] userIds, int appId, long ceDataInode, 36 String seInfo, int token); 37 38 // Exposed for test purposes only. reloadPersistedData()39 void reloadPersistedData(); 40 41 // Exposed for test purposes only. expireRollbackForPackage(String packageName)42 void expireRollbackForPackage(String packageName); 43 44 // Used by the staging manager to notify the RollbackManager that a session is 45 // being staged. In the case of multi-package sessions, the specified sessionId 46 // is that of the parent session. 47 // Returns the rollback id if rollback was enabled successfully, or -1 if not. 48 // 49 // NOTE: This call is synchronous. notifyStagedSession(int sessionId)50 int notifyStagedSession(int sessionId); 51 52 // For test purposes only. blockRollbackManager(long millis)53 void blockRollbackManager(long millis); 54 } 55