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 17package [email protected]; 18 19import IGarbageCollectCallback; 20 21/** 22 * IStorage is an interface that provides operations on underlying storage 23 * devices, including flash memory. 24 */ 25interface IStorage { 26 /** 27 * Start garbage collection on the driver of storage devices. 28 * 29 * Garbage collection must be started at regular intervals when it is a good 30 * time for a longer-running cleanup tasks, roughly daily. 31 * 32 * When garbage collection finishes or encounters an error before the 33 * specified timeout, the implementation must call IGarbageCollect.finish 34 * immediately with appropriate result. 35 * 36 * If garbage collection does not finish within the specified timeout, 37 * the implementation must stop garbage collection, and must not call 38 * IGarbageCollect.finish. 39 * 40 * @param timeoutSeconds timeout in seconds. The implementation must 41 * return after the timeout is reached. 42 * 43 * @param callback callback interface. Callback must be null if the client 44 * does not need to receive any callbacks. 45 * 46 */ 47 oneway garbageCollect(uint64_t timeoutSeconds, 48 IGarbageCollectCallback callback); 49}; 50