DO NOT MERGE Directly acquire wake locks from the Bluetooth stack.
The wake lock callouts go through JNI and then across Binder to PowerManager. As a result, the cost of each callout is very high. There are cases where the stack is acquiring and releasing the wake lock tens of times per second. When that happens, the CPU load on some devices can reach 100% and the RFCOMM throughput can drop by 50% or more. This change reduces the cost of acqiring / releasing a wake lock. Instead of JNI + Binder + PowerManager overhead, we simply write to the /sys/power/wake_lock and /sys/power/wake_unlock nodes. The cost of each is a single syscall. Bug: 23375670 Change-Id: I760a86b557b02c3d70be7a902c943b7ee2f515b1
Loading
Please register or sign in to comment