blob: 980cf45de77db89dcc1f88d01dd6df5421ab4436 [file] [log] [blame]
Yifan Hong66a41442018-08-08 17:49:29 -07001/*
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
Yifan Hongec75d332018-09-19 10:17:40 -070017package android.hardware.health.storage@1.0;
Yifan Hong66a41442018-08-08 17:49:29 -070018
Yifan Honga0082b82018-08-15 14:41:01 -070019import IGarbageCollectCallback;
20
Yifan Hong66a41442018-08-08 17:49:29 -070021/**
Yifan Hongec75d332018-09-19 10:17:40 -070022 * IStorage is an interface that provides operations on underlying storage
Yifan Hong66a41442018-08-08 17:49:29 -070023 * devices, including flash memory.
24 */
Yifan Hongec75d332018-09-19 10:17:40 -070025interface IStorage {
Yifan Hong66a41442018-08-08 17:49:29 -070026 /**
Yifan Honga0082b82018-08-15 14:41:01 -070027 * Start garbage collection on the driver of storage devices.
Yifan Hong66a41442018-08-08 17:49:29 -070028 *
Yifan Honga0082b82018-08-15 14:41:01 -070029 * 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 *
Yifan Hong66a41442018-08-08 17:49:29 -070046 */
Yifan Honga0082b82018-08-15 14:41:01 -070047 oneway garbageCollect(uint64_t timeoutSeconds,
48 IGarbageCollectCallback callback);
Yifan Hong66a41442018-08-08 17:49:29 -070049};