summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src/com
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-11-20 18:04:05 -0800
committerJoe LaPenna <jlapenna@google.com>2015-02-20 10:54:09 -0800
commitc2932a1be3e320679034212698aff376d5104dbe (patch)
treef765fdebae103b5201b0838c64712412603c78d1 /tools/layoutlib/bridge/src/com
parent823bf307a248f332f708fd8b359008df837722eb (diff)
downloadframeworks_base-c2932a1be3e320679034212698aff376d5104dbe.zip
frameworks_base-c2932a1be3e320679034212698aff376d5104dbe.tar.gz
frameworks_base-c2932a1be3e320679034212698aff376d5104dbe.tar.bz2
Hold a wake lock while dozing when display updates are pending.
When the display state is DOZE or DOZE_SUSPEND, assume this means that the AP may go to sleep at any time so hold a wake lock for a little while starting when traversals are scheduled to ensure that the AP remains awake long enough to draw and post the frame to the display hardware. This patch is somewhat approximate but should be good enough for most devices today. Note that the implementation uses the window manager to ensure that the window which wants to draw is actually visible before acquiring the wake lock. There is a cost to this test (a round-trip) which should not be significant today since we do not expect apps to draw more than one frame or two while dozing. However, if we wanted to support animations in general, we might want to optimize it or eliminate the check altogether (since we can already account for the app's use of the wake lock). Another way to implement this functionality might be for the view hierarchy to listen for the power manager to report that it has entered a non-interactive power state before deciding to poke draw locks. This would be somewhat more accurate than watching the display state. Also, the draw lock timeout logic could be implemented more directly instead of using an ordinary timed wake lock. Bug: 18284212 Change-Id: I84b341c678303e8b7481bd1620e634fe82cc4350
Diffstat (limited to 'tools/layoutlib/bridge/src/com')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
index 0f51d00..25f7078 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
@@ -212,4 +212,9 @@ public final class BridgeWindowSession implements IWindowSession {
// pass for now.
return null;
}
+
+ @Override
+ public void pokeDrawLock(IBinder window) {
+ // pass for now.
+ }
}