am d30cc09d: am 3dc0b80d: Merge "Fix layout state issues." into jb-mr1-dev

* commit 'd30cc09dffaff78099b9a3027f80fd16bb99e7b7':
  Fix layout state issues.
This commit is contained in:
Craig Mautner
2012-09-28 00:36:46 -07:00
committed by Android Git Automerger
2 changed files with 25 additions and 13 deletions

View File

@@ -74,7 +74,6 @@ import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.hardware.display.DisplayManager;
import android.hardware.input.InputManager;
import android.os.Binder;
import android.os.Bundle;
import android.os.Debug;
@@ -2749,7 +2748,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": " + win.mAttrs);
if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility
+ " " + requestedWidth + "x" + requestedHeight + " " + win.mAttrs);
win.mEnforceSizeCompat = (win.mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0;
@@ -4036,7 +4036,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
changed = mFocusedApp != newFocus;
mFocusedApp = newFocus;
if (DEBUG_FOCUS) Slog.v(TAG, "Set focused app to: " + mFocusedApp);
if (DEBUG_FOCUS) Slog.v(TAG, "Set focused app to: " + mFocusedApp
+ " moveFocusNow=" + moveFocusNow);
if (changed) {
mInputMonitor.setFocusedAppLw(newFocus);
}
@@ -8296,7 +8297,8 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_LAYOUT && !win.mLayoutAttached) {
Slog.v(TAG, "1ST PASS " + win
+ ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame
+ " mLayoutAttached=" + win.mLayoutAttached);
+ " mLayoutAttached=" + win.mLayoutAttached
+ " screen changed=" + win.isConfigDiff(ActivityInfo.CONFIG_SCREEN_SIZE));
final AppWindowToken atoken = win.mAppToken;
if (gone) Slog.v(TAG, " GONE: mViewVisibility="
+ win.mViewVisibility + " mRelayoutCalled="
@@ -8318,6 +8320,7 @@ public class WindowManagerService extends IWindowManager.Stub
// windows, since that means "perform layout as normal,
// just don't display").
if (!gone || !win.mHaveFrame || win.mLayoutNeeded
|| win.isConfigDiff(ActivityInfo.CONFIG_SCREEN_SIZE)
|| win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
if (!win.mLayoutAttached) {
if (initial) {
@@ -8753,10 +8756,7 @@ public class WindowManagerService extends IWindowManager.Stub
!w.mLastContentInsets.equals(w.mContentInsets);
w.mVisibleInsetsChanged |=
!w.mLastVisibleInsets.equals(w.mVisibleInsets);
boolean configChanged =
w.mConfiguration != mCurConfiguration
&& (w.mConfiguration == null
|| mCurConfiguration.diff(w.mConfiguration) != 0);
boolean configChanged = w.isConfigChanged();
if (DEBUG_CONFIGURATION && configChanged) {
Slog.v(TAG, "Win " + w + " config changed: "
+ mCurConfiguration);
@@ -9254,10 +9254,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG,
"Reporting new frame to " + win + ": " + win.mCompatFrame);
int diff = 0;
boolean configChanged =
win.mConfiguration != mCurConfiguration
&& (win.mConfiguration == null
|| (diff=mCurConfiguration.diff(win.mConfiguration)) != 0);
boolean configChanged = win.isConfigChanged();
if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION)
&& configChanged) {
Slog.i(TAG, "Sending new config to window " + win + ": "

View File

@@ -574,6 +574,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
return mAttrs;
}
@Override
public boolean getNeedsMenuLw(WindowManagerPolicy.WindowState bottom) {
int index = -1;
WindowState ws = this;
@@ -612,6 +613,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
return mLayer;
}
@Override
public IApplicationToken getAppToken() {
return mAppToken != null ? mAppToken.appToken : null;
}
@@ -801,12 +803,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
return mWinAnimator.mAnimation != null;
}
@Override
public boolean isGoneForLayoutLw() {
final AppWindowToken atoken = mAppToken;
return mViewVisibility == View.GONE
|| !mRelayoutCalled
|| (atoken == null && mRootToken.hidden)
|| (atoken != null && atoken.hiddenRequested)
|| (atoken != null && (atoken.hiddenRequested || atoken.hidden))
|| mAttachedHidden
|| mExiting || mDestroying;
}
@@ -849,6 +852,18 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mFrame.right >= screenWidth && mFrame.bottom >= screenHeight;
}
boolean isConfigChanged() {
return mConfiguration != mService.mCurConfiguration
&& (mConfiguration == null
|| (mConfiguration.diff(mService.mCurConfiguration) != 0));
}
boolean isConfigDiff(int mask) {
return mConfiguration != mService.mCurConfiguration
&& mConfiguration != null
&& (mConfiguration.diff(mService.mCurConfiguration) & mask) != 0;
}
void removeLocked() {
disposeInputChannel();