diff options
author | Ruchi Kandoi <kandoiruchi@google.com> | 2014-04-02 12:54:45 -0700 |
---|---|---|
committer | Ruchi Kandoi <kandoiruchi@google.com> | 2014-04-02 21:24:01 +0000 |
commit | ca13fa7dd4662921bc399e021e2ad92ddf5f5366 (patch) | |
tree | 7b27283e4ed03c842c17e7fa9d5722fcaaae15f4 | |
parent | e6ef753ef6f134b6ff4fa1b30f0c3340a90f61af (diff) | |
download | frameworks_native-ca13fa7dd4662921bc399e021e2ad92ddf5f5366.zip frameworks_native-ca13fa7dd4662921bc399e021e2ad92ddf5f5366.tar.gz frameworks_native-ca13fa7dd4662921bc399e021e2ad92ddf5f5366.tar.bz2 |
PowerManager: add powerHint binder method
Change-Id: Ide1d50bb1580698b25296fbfc1cc63c3b21a00bc
-rw-r--r-- | include/powermanager/IPowerManager.h | 2 | ||||
-rw-r--r-- | services/powermanager/IPowerManager.cpp | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/powermanager/IPowerManager.h b/include/powermanager/IPowerManager.h index d85003f..511797a 100644 --- a/include/powermanager/IPowerManager.h +++ b/include/powermanager/IPowerManager.h @@ -19,6 +19,7 @@ #include <utils/Errors.h> #include <binder/IInterface.h> +#include <hardware/power.h> namespace android { @@ -36,6 +37,7 @@ public: const String16& packageName, int uid) = 0; virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags) = 0; virtual status_t updateWakeLockUids(const sp<IBinder>& lock, int len, const int *uids) = 0; + virtual status_t powerHint(int hintId, int data) = 0; }; // ---------------------------------------------------------------------------- diff --git a/services/powermanager/IPowerManager.cpp b/services/powermanager/IPowerManager.cpp index 5ecd299..0c43e90 100644 --- a/services/powermanager/IPowerManager.cpp +++ b/services/powermanager/IPowerManager.cpp @@ -33,6 +33,7 @@ enum { ACQUIRE_WAKE_LOCK_UID = IBinder::FIRST_CALL_TRANSACTION + 1, RELEASE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION + 2, UPDATE_WAKE_LOCK_UIDS = IBinder::FIRST_CALL_TRANSACTION + 3, + POWER_HINT = IBinder::FIRST_CALL_TRANSACTION + 4, }; class BpPowerManager : public BpInterface<IPowerManager> @@ -89,6 +90,15 @@ public: // but it should return ASAP return remote()->transact(UPDATE_WAKE_LOCK_UIDS, data, &reply, IBinder::FLAG_ONEWAY); } + + virtual status_t powerHint(int hintId, int param) + { + Parcel data, reply; + data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor()); + data.writeInt32(hintId); + data.writeInt32(param); + return remote()->transact(POWER_HINT, data, &reply, IBinder::FLAG_ONEWAY); + } }; IMPLEMENT_META_INTERFACE(PowerManager, "android.os.IPowerManager"); |