1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright 2019 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport @1.0::IBootControl; 20*4d7e907cSAndroid Build Coastguard Worker 21*4d7e907cSAndroid Build Coastguard Workerinterface IBootControl extends @1.0::IBootControl { 22*4d7e907cSAndroid Build Coastguard Worker /** 23*4d7e907cSAndroid Build Coastguard Worker * Sets whether a snapshot-merge of any dynamic partition is in progress. 24*4d7e907cSAndroid Build Coastguard Worker * 25*4d7e907cSAndroid Build Coastguard Worker * After the merge status is set to a given value, subsequent calls to 26*4d7e907cSAndroid Build Coastguard Worker * getSnapshotMergeStatus must return the set value. 27*4d7e907cSAndroid Build Coastguard Worker * 28*4d7e907cSAndroid Build Coastguard Worker * The merge status must be persistent across reboots. That is, getSnapshotMergeStatus 29*4d7e907cSAndroid Build Coastguard Worker * must return the same value after a reboot if the merge status is not altered in any way 30*4d7e907cSAndroid Build Coastguard Worker * (e.g. set by setSnapshotMergeStatus or set to CANCELLED by bootloader). 31*4d7e907cSAndroid Build Coastguard Worker * 32*4d7e907cSAndroid Build Coastguard Worker * Read/write access to the merge status must be atomic. When the HAL is processing a 33*4d7e907cSAndroid Build Coastguard Worker * setSnapshotMergeStatus call, all subsequent calls to getSnapshotMergeStatus must block until 34*4d7e907cSAndroid Build Coastguard Worker * setSnapshotMergeStatus has returned. 35*4d7e907cSAndroid Build Coastguard Worker * 36*4d7e907cSAndroid Build Coastguard Worker * A MERGING state indicates that dynamic partitions are partially comprised by blocks in the 37*4d7e907cSAndroid Build Coastguard Worker * userdata partition. 38*4d7e907cSAndroid Build Coastguard Worker * 39*4d7e907cSAndroid Build Coastguard Worker * When the merge status is set to MERGING, the following operations must be prohibited from the 40*4d7e907cSAndroid Build Coastguard Worker * bootloader: 41*4d7e907cSAndroid Build Coastguard Worker * - Flashing or erasing "userdata" or "metadata". 42*4d7e907cSAndroid Build Coastguard Worker * 43*4d7e907cSAndroid Build Coastguard Worker * The following operations may be prohibited when the status is set to MERGING. If not 44*4d7e907cSAndroid Build Coastguard Worker * prohibited, it is recommended that the user receive a warning. 45*4d7e907cSAndroid Build Coastguard Worker * - Changing the active slot (e.g. via "fastboot set_active") 46*4d7e907cSAndroid Build Coastguard Worker * 47*4d7e907cSAndroid Build Coastguard Worker * @param status Merge status. 48*4d7e907cSAndroid Build Coastguard Worker * 49*4d7e907cSAndroid Build Coastguard Worker * @return success True on success, false otherwise. 50*4d7e907cSAndroid Build Coastguard Worker */ 51*4d7e907cSAndroid Build Coastguard Worker setSnapshotMergeStatus(MergeStatus status) generates (bool success); 52*4d7e907cSAndroid Build Coastguard Worker 53*4d7e907cSAndroid Build Coastguard Worker /** 54*4d7e907cSAndroid Build Coastguard Worker * Returns whether a snapshot-merge of any dynamic partition is in progress. 55*4d7e907cSAndroid Build Coastguard Worker * 56*4d7e907cSAndroid Build Coastguard Worker * This function must return the merge status set by the last setSnapshotMergeStatus call and 57*4d7e907cSAndroid Build Coastguard Worker * recorded by the bootloader with one exception. If the partitions are being flashed from the 58*4d7e907cSAndroid Build Coastguard Worker * bootloader such that the pending merge must be canceled (for example, if the super partition 59*4d7e907cSAndroid Build Coastguard Worker * is being flashed), this function must return CANCELLED. 60*4d7e907cSAndroid Build Coastguard Worker * 61*4d7e907cSAndroid Build Coastguard Worker * @return success True if the merge status is read successfully, false otherwise. 62*4d7e907cSAndroid Build Coastguard Worker * @return status Merge status. 63*4d7e907cSAndroid Build Coastguard Worker */ 64*4d7e907cSAndroid Build Coastguard Worker getSnapshotMergeStatus() generates (MergeStatus status); 65*4d7e907cSAndroid Build Coastguard Worker}; 66*4d7e907cSAndroid Build Coastguard Worker 67