diff options
-rw-r--r-- | include/powermanager/IPowerManager.h | 2 | ||||
-rw-r--r-- | services/powermanager/IPowerManager.cpp | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/powermanager/IPowerManager.h b/include/powermanager/IPowerManager.h index e21e6a8a1..2f4c3c46e 100644 --- a/include/powermanager/IPowerManager.h +++ b/include/powermanager/IPowerManager.h | |||
@@ -32,6 +32,8 @@ public: | |||
32 | 32 | ||
33 | virtual status_t acquireWakeLock(int flags, const sp<IBinder>& lock, const String16& tag, | 33 | virtual status_t acquireWakeLock(int flags, const sp<IBinder>& lock, const String16& tag, |
34 | const String16& packageName) = 0; | 34 | const String16& packageName) = 0; |
35 | virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag, | ||
36 | const String16& packageName, int uid) = 0; | ||
35 | virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags) = 0; | 37 | virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags) = 0; |
36 | }; | 38 | }; |
37 | 39 | ||
diff --git a/services/powermanager/IPowerManager.cpp b/services/powermanager/IPowerManager.cpp index 3f5b81e73..9f60e7524 100644 --- a/services/powermanager/IPowerManager.cpp +++ b/services/powermanager/IPowerManager.cpp | |||
@@ -30,7 +30,8 @@ namespace android { | |||
30 | // must be kept in sync with IPowerManager.aidl | 30 | // must be kept in sync with IPowerManager.aidl |
31 | enum { | 31 | enum { |
32 | ACQUIRE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION, | 32 | ACQUIRE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION, |
33 | RELEASE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION + 1, | 33 | ACQUIRE_WAKE_LOCK_UID = IBinder::FIRST_CALL_TRANSACTION + 1, |
34 | RELEASE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION + 2, | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | class BpPowerManager : public BpInterface<IPowerManager> | 37 | class BpPowerManager : public BpInterface<IPowerManager> |
@@ -55,6 +56,20 @@ public: | |||
55 | return remote()->transact(ACQUIRE_WAKE_LOCK, data, &reply); | 56 | return remote()->transact(ACQUIRE_WAKE_LOCK, data, &reply); |
56 | } | 57 | } |
57 | 58 | ||
59 | virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag, | ||
60 | const String16& packageName, int uid) | ||
61 | { | ||
62 | Parcel data, reply; | ||
63 | data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor()); | ||
64 | |||
65 | data.writeStrongBinder(lock); | ||
66 | data.writeInt32(flags); | ||
67 | data.writeString16(tag); | ||
68 | data.writeString16(packageName); | ||
69 | data.writeInt32(uid); // uid to blame for the work | ||
70 | return remote()->transact(ACQUIRE_WAKE_LOCK_UID, data, &reply); | ||
71 | } | ||
72 | |||
58 | virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags) | 73 | virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags) |
59 | { | 74 | { |
60 | Parcel data, reply; | 75 | Parcel data, reply; |