1b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross/* 2b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * Copyright (C) 2011 The Android Open Source Project 3b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * 4b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * Licensed under the Apache License, Version 2.0 (the "License"); 5b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * you may not use this file except in compliance with the License. 6b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * You may obtain a copy of the License at 7b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * 8b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * http://www.apache.org/licenses/LICENSE-2.0 9b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * 10b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * Unless required by applicable law or agreed to in writing, software 11b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * distributed under the License is distributed on an "AS IS" BASIS, 12b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * See the License for the specific language governing permissions and 14b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross * limitations under the License. 15b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross */ 16b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 17b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross#ifndef ANDROID_IPOWERMANAGER_H 18b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross#define ANDROID_IPOWERMANAGER_H 19b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 20b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross#include <utils/Errors.h> 21b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross#include <binder/IInterface.h> 22ca13fa7dd4662921bc399e021e2ad92ddf5f5366Ruchi Kandoi#include <hardware/power.h> 23b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 24b731ae01b15682a3326dc4145f614f919b2789b5Colin Crossnamespace android { 25b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 26b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross// ---------------------------------------------------------------------------- 27b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 28b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross// must be kept in sync with interface defined in IPowerManager.aidl 29b731ae01b15682a3326dc4145f614f919b2789b5Colin Crossclass IPowerManager : public IInterface 30b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross{ 31b731ae01b15682a3326dc4145f614f919b2789b5Colin Crosspublic: 32b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross DECLARE_META_INTERFACE(PowerManager); 33b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 34a602086872ad725d257b3be659a774f032f06d71Glenn Kasten // FIXME remove the bool isOneWay parameters as they are not oneway in the .aidl 3580d7fd86e05e6f14dffc9f0c9bf176a7c8680f8cDianne Hackborn virtual status_t acquireWakeLock(int flags, const sp<IBinder>& lock, const String16& tag, 36a602086872ad725d257b3be659a774f032f06d71Glenn Kasten const String16& packageName, bool isOneWay = false) = 0; 379a7706bb174cdac279908f705191803dc5bfa0abMarco Nelissen virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag, 38a602086872ad725d257b3be659a774f032f06d71Glenn Kasten const String16& packageName, int uid, bool isOneWay = false) = 0; 39a602086872ad725d257b3be659a774f032f06d71Glenn Kasten virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags, bool isOneWay = false) = 0; 40a602086872ad725d257b3be659a774f032f06d71Glenn Kasten virtual status_t updateWakeLockUids(const sp<IBinder>& lock, int len, const int *uids, 41a602086872ad725d257b3be659a774f032f06d71Glenn Kasten bool isOneWay = false) = 0; 42a602086872ad725d257b3be659a774f032f06d71Glenn Kasten // oneway in the .aidl 43ca13fa7dd4662921bc399e021e2ad92ddf5f5366Ruchi Kandoi virtual status_t powerHint(int hintId, int data) = 0; 44b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross}; 45b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 46b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross// ---------------------------------------------------------------------------- 47b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 48b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross}; // namespace android 49b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross 50b731ae01b15682a3326dc4145f614f919b2789b5Colin Cross#endif // ANDROID_IPOWERMANAGER_H 51