summaryrefslogtreecommitdiffstats
path: root/health
diff options
context:
space:
mode:
authorYifan Hong2018-08-15 16:41:01 -0500
committerYifan Hong2018-09-12 12:43:49 -0500
commita0082b80bace02f9a5de4336e89fc5a0638b7d8f (patch)
tree87d9796fe86fee81e84b3e5aa77ab46430863123 /health
parenta9d3c6b1364c8d8fc65a5479c2bd40d0de1f5072 (diff)
downloadplatform-hardware-interfaces-a0082b80bace02f9a5de4336e89fc5a0638b7d8f.tar.gz
platform-hardware-interfaces-a0082b80bace02f9a5de4336e89fc5a0638b7d8f.tar.xz
platform-hardware-interfaces-a0082b80bace02f9a5de4336e89fc5a0638b7d8f.zip
health filesystem: update garbageCollect() function.
Bug: 111655771 Test: run dev gc on vold Change-Id: I2cef404f9e2720c1be7822895187a590837763c8
Diffstat (limited to 'health')
-rw-r--r--health/filesystem/1.0/Android.bp1
-rw-r--r--health/filesystem/1.0/IFileSystem.hal28
-rw-r--r--health/filesystem/1.0/IGarbageCollectCallback.hal30
-rw-r--r--health/filesystem/1.0/types.hal4
4 files changed, 53 insertions, 10 deletions
diff --git a/health/filesystem/1.0/Android.bp b/health/filesystem/1.0/Android.bp
index 74b9bc31..cb7cf0e8 100644
--- a/health/filesystem/1.0/Android.bp
+++ b/health/filesystem/1.0/Android.bp
@@ -9,6 +9,7 @@ hidl_interface {
9 srcs: [ 9 srcs: [
10 "types.hal", 10 "types.hal",
11 "IFileSystem.hal", 11 "IFileSystem.hal",
12 "IGarbageCollectCallback.hal",
12 ], 13 ],
13 interfaces: [ 14 interfaces: [
14 "android.hidl.base@1.0", 15 "android.hidl.base@1.0",
diff --git a/health/filesystem/1.0/IFileSystem.hal b/health/filesystem/1.0/IFileSystem.hal
index 33ea3ff8..a5e6487a 100644
--- a/health/filesystem/1.0/IFileSystem.hal
+++ b/health/filesystem/1.0/IFileSystem.hal
@@ -16,18 +16,34 @@
16 16
17package android.hardware.health.filesystem@1.0; 17package android.hardware.health.filesystem@1.0;
18 18
19import IGarbageCollectCallback;
20
19/** 21/**
20 * IFileSystem is an interface that provides operations on underlying storage 22 * IFileSystem is an interface that provides operations on underlying storage
21 * devices, including flash memory. 23 * devices, including flash memory.
22 */ 24 */
23interface IFileSystem { 25interface IFileSystem {
24 /** 26 /**
25 * Start garbage collection on the driver of storage devices. This function 27 * Start garbage collection on the driver of storage devices.
26 * must be called at regular intervals when it is a good time for a 28 *
27 * longer-running cleanup tasks. 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.
28 * 45 *
29 * @return result Execution result. See documentation for Result for
30 * details.
31 */ 46 */
32 garbageCollect() generates (Result result); 47 oneway garbageCollect(uint64_t timeoutSeconds,
48 IGarbageCollectCallback callback);
33}; 49};
diff --git a/health/filesystem/1.0/IGarbageCollectCallback.hal b/health/filesystem/1.0/IGarbageCollectCallback.hal
new file mode 100644
index 00000000..901c35c8
--- /dev/null
+++ b/health/filesystem/1.0/IGarbageCollectCallback.hal
@@ -0,0 +1,30 @@
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 */
16package android.hardware.health.filesystem@1.0;
17
18/**
19 * Callback interface to IFileSystem.garbageCollect.
20 */
21interface IGarbageCollectCallback {
22 /**
23 * When garbage collection has finished, the implementation must
24 * invoke this function to indicate the result of the garbage collection.
25 *
26 * @return result Execution result. See documentation for Result for
27 * details.
28 */
29 oneway onFinish(Result result);
30};
diff --git a/health/filesystem/1.0/types.hal b/health/filesystem/1.0/types.hal
index 00431f75..0d2db2cd 100644
--- a/health/filesystem/1.0/types.hal
+++ b/health/filesystem/1.0/types.hal
@@ -25,10 +25,6 @@ enum Result : uint32_t {
25 */ 25 */
26 SUCCESS = 0, 26 SUCCESS = 0,
27 /** 27 /**
28 * Execution of the method timed out.
29 */
30 TIMEOUT,
31 /**
32 * An IO error is encountered when the HAL communicates with the device. 28 * An IO error is encountered when the HAL communicates with the device.
33 */ 29 */
34 IO_ERROR, 30 IO_ERROR,