blob: 91ecc5aa31e372437b0ea4c0fa1fbd5aa8dba547 [file] [log] [blame]
Colin Crossb731ae02012-03-28 13:55:43 -07001/*
2 * Copyright (C) 2011 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#ifndef ANDROID_IPOWERMANAGER_H
18#define ANDROID_IPOWERMANAGER_H
19
20#include <utils/Errors.h>
21#include <binder/IInterface.h>
Ruchi Kandoica13fa72014-04-02 12:54:45 -070022#include <hardware/power.h>
Colin Crossb731ae02012-03-28 13:55:43 -070023
24namespace android {
25
26// ----------------------------------------------------------------------------
27
28// must be kept in sync with interface defined in IPowerManager.aidl
29class IPowerManager : public IInterface
30{
31public:
32 DECLARE_META_INTERFACE(PowerManager);
33
Glenn Kastena6020862014-09-05 16:46:46 -070034 // FIXME remove the bool isOneWay parameters as they are not oneway in the .aidl
Dianne Hackborn80d7fd82013-05-20 11:24:31 -070035 virtual status_t acquireWakeLock(int flags, const sp<IBinder>& lock, const String16& tag,
Glenn Kastena6020862014-09-05 16:46:46 -070036 const String16& packageName, bool isOneWay = false) = 0;
Marco Nelissen9a7706b2013-10-02 12:42:20 -070037 virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag,
Glenn Kastena6020862014-09-05 16:46:46 -070038 const String16& packageName, int uid, bool isOneWay = false) = 0;
39 virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags, bool isOneWay = false) = 0;
40 virtual status_t updateWakeLockUids(const sp<IBinder>& lock, int len, const int *uids,
41 bool isOneWay = false) = 0;
42 // oneway in the .aidl
Ruchi Kandoica13fa72014-04-02 12:54:45 -070043 virtual status_t powerHint(int hintId, int data) = 0;
Colin Crossb731ae02012-03-28 13:55:43 -070044};
45
46// ----------------------------------------------------------------------------
47
48}; // namespace android
49
50#endif // ANDROID_IPOWERMANAGER_H