Loading include/binder/Parcel.h +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public: status_t writeString16(const char16_t* str, size_t len); status_t writeStrongBinder(const sp<IBinder>& val); status_t writeWeakBinder(const wp<IBinder>& val); status_t writeInt32Array(size_t len, const int32_t *val); template<typename T> status_t write(const Flattenable<T>& val); Loading include/powermanager/IPowerManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public: virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag, 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; }; // ---------------------------------------------------------------------------- Loading libs/binder/Parcel.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -617,6 +617,16 @@ status_t Parcel::writeInt32(int32_t val) { return writeAligned(val); } status_t Parcel::writeInt32Array(size_t len, const int32_t *val) { if (!val) { return writeAligned(-1); } status_t ret = writeAligned(len); if (ret == NO_ERROR) { ret = write(val, len * sizeof(*val)); } return ret; } status_t Parcel::writeInt64(int64_t val) { Loading services/powermanager/IPowerManager.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ enum { ACQUIRE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION, 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, }; class BpPowerManager : public BpInterface<IPowerManager> Loading Loading @@ -78,6 +79,16 @@ public: data.writeInt32(flags); return remote()->transact(RELEASE_WAKE_LOCK, data, &reply); } virtual status_t updateWakeLockUids(const sp<IBinder>& lock, int len, const int *uids) { Parcel data, reply; data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor()); data.writeStrongBinder(lock); data.writeInt32Array(len, uids); // We don't really care too much if this succeeds (there's nothing we can do if it doesn't) // but it should return ASAP return remote()->transact(UPDATE_WAKE_LOCK_UIDS, data, &reply, IBinder::FLAG_ONEWAY); } }; IMPLEMENT_META_INTERFACE(PowerManager, "android.os.IPowerManager"); Loading Loading
include/binder/Parcel.h +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public: status_t writeString16(const char16_t* str, size_t len); status_t writeStrongBinder(const sp<IBinder>& val); status_t writeWeakBinder(const wp<IBinder>& val); status_t writeInt32Array(size_t len, const int32_t *val); template<typename T> status_t write(const Flattenable<T>& val); Loading
include/powermanager/IPowerManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public: virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag, 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; }; // ---------------------------------------------------------------------------- Loading
libs/binder/Parcel.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -617,6 +617,16 @@ status_t Parcel::writeInt32(int32_t val) { return writeAligned(val); } status_t Parcel::writeInt32Array(size_t len, const int32_t *val) { if (!val) { return writeAligned(-1); } status_t ret = writeAligned(len); if (ret == NO_ERROR) { ret = write(val, len * sizeof(*val)); } return ret; } status_t Parcel::writeInt64(int64_t val) { Loading
services/powermanager/IPowerManager.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ enum { ACQUIRE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION, 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, }; class BpPowerManager : public BpInterface<IPowerManager> Loading Loading @@ -78,6 +79,16 @@ public: data.writeInt32(flags); return remote()->transact(RELEASE_WAKE_LOCK, data, &reply); } virtual status_t updateWakeLockUids(const sp<IBinder>& lock, int len, const int *uids) { Parcel data, reply; data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor()); data.writeStrongBinder(lock); data.writeInt32Array(len, uids); // We don't really care too much if this succeeds (there's nothing we can do if it doesn't) // but it should return ASAP return remote()->transact(UPDATE_WAKE_LOCK_UIDS, data, &reply, IBinder::FLAG_ONEWAY); } }; IMPLEMENT_META_INTERFACE(PowerManager, "android.os.IPowerManager"); Loading