am ac939d08: Merge change 27291 into eclair

Merge commit 'ac939d086c42afeaef0982cee0e5861184dd82eb' into eclair-plus-aosp

* commit 'ac939d086c42afeaef0982cee0e5861184dd82eb':
  Fix issue #2148939: Sholes slow to wake up in landscape mode
This commit is contained in:
Dianne Hackborn
2009-09-27 14:03:37 -07:00
committed by Android Git Automerger

View File

@@ -4174,7 +4174,7 @@ public class WindowManagerService extends IWindowManager.Stub
final int N = mWindows.size(); final int N = mWindows.size();
for (int i=0; i<N; i++) { for (int i=0; i<N; i++) {
WindowState w = (WindowState)mWindows.get(i); WindowState w = (WindowState)mWindows.get(i);
if (w.isVisibleLw() && !w.isDisplayedLw()) { if (w.isVisibleLw() && !w.isDrawnLw()) {
return; return;
} }
} }
@@ -7664,6 +7664,16 @@ public class WindowManagerService extends IWindowManager.Stub
|| mAnimating); || mAnimating);
} }
/**
* Returns true if the window has a surface that it has drawn a
* complete UI in to.
*/
public boolean isDrawnLw() {
final AppWindowToken atoken = mAppToken;
return mSurface != null && !mDestroying
&& !mDrawPending && !mCommitDrawPending;
}
public boolean fillsScreenLw(int screenWidth, int screenHeight, public boolean fillsScreenLw(int screenWidth, int screenHeight,
boolean shownFrame, boolean onlyOpaque) { boolean shownFrame, boolean onlyOpaque) {
if (mSurface == null) { if (mSurface == null) {
@@ -8268,10 +8278,10 @@ public class WindowManagerService extends IWindowManager.Stub
continue; continue;
} }
if (DEBUG_VISIBILITY) { if (DEBUG_VISIBILITY) {
Log.v(TAG, "Win " + win + ": isDisplayed=" Log.v(TAG, "Win " + win + ": isDrawn="
+ win.isDisplayedLw() + win.isDrawnLw()
+ ", isAnimating=" + win.isAnimating()); + ", isAnimating=" + win.isAnimating());
if (!win.isDisplayedLw()) { if (!win.isDrawnLw()) {
Log.v(TAG, "Not displayed: s=" + win.mSurface Log.v(TAG, "Not displayed: s=" + win.mSurface
+ " pv=" + win.mPolicyVisibility + " pv=" + win.mPolicyVisibility
+ " dp=" + win.mDrawPending + " dp=" + win.mDrawPending
@@ -8284,7 +8294,7 @@ public class WindowManagerService extends IWindowManager.Stub
} }
} }
numInteresting++; numInteresting++;
if (win.isDisplayedLw()) { if (win.isDrawnLw()) {
if (!win.isAnimating()) { if (!win.isAnimating()) {
numVisible++; numVisible++;
} }
@@ -9007,7 +9017,6 @@ public class WindowManagerService extends IWindowManager.Stub
|| !win.mRelayoutCalled || !win.mRelayoutCalled
|| win.mRootToken.hidden || win.mRootToken.hidden
|| (atoken != null && atoken.hiddenRequested) || (atoken != null && atoken.hiddenRequested)
|| !win.mPolicyVisibility
|| win.mAttachedHidden || win.mAttachedHidden
|| win.mExiting || win.mDestroying; || win.mExiting || win.mDestroying;
@@ -9217,10 +9226,10 @@ public class WindowManagerService extends IWindowManager.Stub
== WindowManager.LayoutParams.TYPE_BASE_APPLICATION) == WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
&& !w.mExiting && !w.mDestroying) { && !w.mExiting && !w.mDestroying) {
if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) { if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) {
Log.v(TAG, "Eval win " + w + ": isDisplayed=" Log.v(TAG, "Eval win " + w + ": isDrawn="
+ w.isDisplayedLw() + w.isDrawnLw()
+ ", isAnimating=" + w.isAnimating()); + ", isAnimating=" + w.isAnimating());
if (!w.isDisplayedLw()) { if (!w.isDrawnLw()) {
Log.v(TAG, "Not displayed: s=" + w.mSurface Log.v(TAG, "Not displayed: s=" + w.mSurface
+ " pv=" + w.mPolicyVisibility + " pv=" + w.mPolicyVisibility
+ " dp=" + w.mDrawPending + " dp=" + w.mDrawPending
@@ -9233,7 +9242,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (w != atoken.startingWindow) { if (w != atoken.startingWindow) {
if (!atoken.freezingScreen || !w.mAppFreezing) { if (!atoken.freezingScreen || !w.mAppFreezing) {
atoken.numInterestingWindows++; atoken.numInterestingWindows++;
if (w.isDisplayedLw()) { if (w.isDrawnLw()) {
atoken.numDrawnWindows++; atoken.numDrawnWindows++;
if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) Log.v(TAG, if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) Log.v(TAG,
"tokenMayBeDrawn: " + atoken "tokenMayBeDrawn: " + atoken
@@ -9242,7 +9251,7 @@ public class WindowManagerService extends IWindowManager.Stub
tokenMayBeDrawn = true; tokenMayBeDrawn = true;
} }
} }
} else if (w.isDisplayedLw()) { } else if (w.isDrawnLw()) {
atoken.startingDisplayed = true; atoken.startingDisplayed = true;
} }
} }