system/hardware/interfaces
修訂 | 3b083e7c940d144eebf75ae63816fbe266a10875 (tree) |
---|---|
時間 | 2018-08-15 09:32:14 |
作者 | Tri Vo <trong@goog...> |
Commiter | Tri Vo |
System suspend HAL interface.
Bug: 78888165
Test: SystemSuspendV1_0UnitTest
Change-Id: I3c3537a72dac65d316aeb77fd7b2d7cff4fb67e5
Merged-In: I3c3537a72dac65d316aeb77fd7b2d7cff4fb67e5
(cherry picked from commit 2fbf967c4f47b7f3977893fd4a2988d32eff4c27)
@@ -0,0 +1,16 @@ | ||
1 | +hidl_interface { | |
2 | + name: "android.system.suspend@1.0", | |
3 | + root: "android.system", | |
4 | + vndk: { | |
5 | + enabled: true, | |
6 | + }, | |
7 | + srcs: [ | |
8 | + "ISystemSuspend.hal", | |
9 | + "IWakeLock.hal", | |
10 | + ], | |
11 | + interfaces: [ | |
12 | + "android.hidl.base@1.0", | |
13 | + ], | |
14 | + gen_java: false, | |
15 | +} | |
16 | + |
@@ -0,0 +1,37 @@ | ||
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.system.suspend@1.0; | |
18 | + | |
19 | +import IWakeLock; | |
20 | + | |
21 | +interface ISystemSuspend { | |
22 | + /** | |
23 | + * Starts automatic system suspension. | |
24 | + * | |
25 | + * @return status true on success, false otherwise. | |
26 | + */ | |
27 | + enableAutosuspend() generates (bool success); | |
28 | + | |
29 | + /** | |
30 | + * Acquires an IWakeLock instance. Any allocated IWakeLock must block the | |
31 | + * device from suspending. This method must be able to be called | |
32 | + * independently of enableAutosuspend(). | |
33 | + * | |
34 | + * @return lock the interface for the created wake lock. | |
35 | + */ | |
36 | + acquireWakeLock() generates (IWakeLock lock); | |
37 | +}; |
@@ -0,0 +1,23 @@ | ||
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.system.suspend@1.0; | |
18 | + | |
19 | +/** | |
20 | + * Allocating an IWakeLock instance must block system suspend. Deallocating an | |
21 | + * IWakeLock must initiate system suspend if no other wake lock is allocated. | |
22 | + */ | |
23 | +interface IWakeLock {}; |