| /* |
| * Copyright (C) 2018 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package android.system.suspend@1.0; |
| |
| import ISystemSuspendCallback; |
| import IWakeLock; |
| |
| interface ISystemSuspend { |
| /** |
| * Registers a callback for system suspend events. ISystemSuspend must keep |
| * track of all registered callbacks unless the client process that |
| * registered the callback dies. |
| * |
| * @param callback the callback to register. |
| * @return status true on success, false otherwise. |
| */ |
| registerCallback(ISystemSuspendCallback callback) generates (bool success); |
| |
| /** |
| * Starts automatic system suspension. |
| * |
| * @return status true on success, false otherwise. |
| */ |
| enableAutosuspend() generates (bool success); |
| |
| /** |
| * Acquires an IWakeLock instance. Any allocated IWakeLock must block the |
| * device from suspending. This method must be able to be called |
| * independently of enableAutosuspend(). |
| * |
| * @param type type of the requested wake lock. |
| * @param debugName debug string attached to the acquired IWakeLock. Wake |
| * lock names are not necessarily unique. |
| * |
| * @return lock the interface for the created wake lock. |
| */ |
| acquireWakeLock(WakeLockType type, string debugName) |
| generates (IWakeLock lock); |
| }; |