summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2012-02-21 18:57:12 -0800
committerJim Miller <jaggies@google.com>2012-02-27 18:31:03 -0800
commit92e66dd6835cd5fefad463c79d0589166e8fd3a7 (patch)
tree894b51a7b8b1fb103661684d62b621f34420cdc1 /graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
parent79952ee29a8fc67b6d76a8db747bb72dd7d6ecd1 (diff)
Fix 5797764: don't hold PowerManager lock when changing native brightness
This fixes a bug where the device could see a priority inversion when updating display brightness. The problem occurs because the code that manages screen brightness holds the master lock while waiting for the native method to complete. On some devices, each call can amount to tens to hundreds of ms, which meant clients using PowerManager APIs could block for the duration of the call. In some cases, the animation could block for many seconds because the unfairness of Java locks. The solution is to handle all brightness updates in a separate thread that does not hold the master lock while calling native methods. This also makes the animation more consistent by animating by actual wall clock time rather than depending on the round-trip from the driver. Change-Id: Ifad76fb2fb77e7b2a72dd9150440d87e22581b40
Diffstat (limited to 'graphics/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions