summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen2013-10-02 14:42:20 -0500
committerMarco Nelissen2013-10-03 10:49:07 -0500
commit9a7706bb174cdac279908f705191803dc5bfa0ab (patch)
tree0fed42f56aefb237d6d561a80c510e80480b984f /services/powermanager/IPowerManager.cpp
parent86206b41b2ff000e086301c6bafb8da577e563b2 (diff)
downloadframeworks-native-9a7706bb174cdac279908f705191803dc5bfa0ab.tar.gz
frameworks-native-9a7706bb174cdac279908f705191803dc5bfa0ab.tar.xz
frameworks-native-9a7706bb174cdac279908f705191803dc5bfa0ab.zip
Allow blaming a single uid for work done
This lets audioflinger assign blame for wakelocks to a single uid. Currently this is only used for recording wakelocks. b/10985160 Change-Id: Idc9adb22c29030010ac690d4cb95e7e7ea6b91e6
Diffstat (limited to 'services/powermanager/IPowerManager.cpp')
-rw-r--r--services/powermanager/IPowerManager.cpp17
1 files changed, 16 insertions, 1 deletions
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
31enum { 31enum {
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
36class BpPowerManager : public BpInterface<IPowerManager> 37class 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;