Yifan Hong | 66a4144 | 2018-08-08 17:49:29 -0700 | [diff] [blame] | 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.hardware.health.filesystem@1.0; |
| 18 | |
Yifan Hong | a0082b8 | 2018-08-15 14:41:01 -0700 | [diff] [blame^] | 19 | import IGarbageCollectCallback; |
| 20 | |
Yifan Hong | 66a4144 | 2018-08-08 17:49:29 -0700 | [diff] [blame] | 21 | /** |
| 22 | * IFileSystem is an interface that provides operations on underlying storage |
| 23 | * devices, including flash memory. |
| 24 | */ |
| 25 | interface IFileSystem { |
| 26 | /** |
Yifan Hong | a0082b8 | 2018-08-15 14:41:01 -0700 | [diff] [blame^] | 27 | * Start garbage collection on the driver of storage devices. |
Yifan Hong | 66a4144 | 2018-08-08 17:49:29 -0700 | [diff] [blame] | 28 | * |
Yifan Hong | a0082b8 | 2018-08-15 14:41:01 -0700 | [diff] [blame^] | 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 | * |
Yifan Hong | 66a4144 | 2018-08-08 17:49:29 -0700 | [diff] [blame] | 46 | */ |
Yifan Hong | a0082b8 | 2018-08-15 14:41:01 -0700 | [diff] [blame^] | 47 | oneway garbageCollect(uint64_t timeoutSeconds, |
| 48 | IGarbageCollectCallback callback); |
Yifan Hong | 66a4144 | 2018-08-08 17:49:29 -0700 | [diff] [blame] | 49 | }; |