summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-04-11 18:46:22 -0700
committerJeff Brown <jeffbrown@google.com>2014-04-11 18:46:22 -0700
commitd912e1f6a111fb33118d116bd72da1a328041bca (patch)
tree912fc4a7932bc111c59f452e2d052f05d07cd128 /core/java/android/view/View.java
parentcd4c1c714c37a1bc7ba35ebd2509eca4f0f6a314 (diff)
downloadframeworks_base-d912e1f6a111fb33118d116bd72da1a328041bca.zip
frameworks_base-d912e1f6a111fb33118d116bd72da1a328041bca.tar.gz
frameworks_base-d912e1f6a111fb33118d116bd72da1a328041bca.tar.bz2
Use the display's actual state in the view hierarchy.
Previously, the view hierarchy would suppress drawing whenever the PowerManager.isScreenOn() method returned false. However, this method really describes the interactive state of the device rather than the actual display state. This is especially a problem when there are multiple displays but it also breaks drawing while in doze mode. This change makes the view hierarchy consider the actual state of the display instead on an individual basis. Bug: 13133142 Change-Id: I69870b6b14a3504607a30562aa48c3452f777c1f
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 80725dc..8d69477 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -16840,8 +16840,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// If the screen is off assume the animation start time is now instead of
// the next frame we draw. Keeping the START_ON_FIRST_FRAME start time
// would cause the animation to start when the screen turns back on
- if (mAttachInfo != null && !mAttachInfo.mScreenOn &&
- animation.getStartTime() == Animation.START_ON_FIRST_FRAME) {
+ if (mAttachInfo != null && mAttachInfo.mDisplayState == Display.STATE_OFF
+ && animation.getStartTime() == Animation.START_ON_FIRST_FRAME) {
animation.setStartTime(AnimationUtils.currentAnimationTimeMillis());
}
animation.reset();
@@ -18713,7 +18713,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* A set of information given to a view when it is attached to its parent
* window.
*/
- static class AttachInfo {
+ final static class AttachInfo {
interface Callbacks {
void playSoundEffect(int effectId);
boolean performHapticFeedback(int effectId, boolean always);
@@ -18779,7 +18779,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
boolean mHardwareAccelerationRequested;
HardwareRenderer mHardwareRenderer;
- boolean mScreenOn;
+ /**
+ * The state of the display to which the window is attached, as reported
+ * by {@link Display#getState()}. Note that the display state constants
+ * declared by {@link Display} do not exactly line up with the screen state
+ * constants declared by {@link View} (there are more display states than
+ * screen states).
+ */
+ int mDisplayState = Display.STATE_UNKNOWN;
/**
* Scale factor used by the compatibility mode