Notify apps when insets change.
Activities that handle their own configuration get layout when hidden and the configuration changes but not when the content insets change if they are hidden. They need to get a fresh layout for both situations. Fixes bug 11544694. Change-Id: Iff3a9adb72ea7dfc3e5cd38e1b9cd7cf2006f8f5
This commit is contained in:
@@ -53,7 +53,7 @@ class AppWindowToken extends WindowToken {
|
||||
int groupId = -1;
|
||||
boolean appFullscreen;
|
||||
int requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||
int configChanges;
|
||||
boolean layoutConfigChanges;
|
||||
boolean showWhenLocked;
|
||||
|
||||
// The input dispatching timeout for this application token in nanoseconds.
|
||||
|
||||
@@ -271,6 +271,8 @@ public class TaskStack {
|
||||
for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
|
||||
final WindowState win = windows.get(winNdx);
|
||||
if (!resizingWindows.contains(win)) {
|
||||
if (WindowManagerService.DEBUG_RESIZE) Slog.d(TAG,
|
||||
"setBounds: Resizing " + win);
|
||||
resizingWindows.add(win);
|
||||
}
|
||||
win.mUnderStatusBar = underStatusBar;
|
||||
|
||||
@@ -3439,7 +3439,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
atoken.appFullscreen = fullscreen;
|
||||
atoken.showWhenLocked = showWhenLocked;
|
||||
atoken.requestedOrientation = requestedOrientation;
|
||||
atoken.configChanges = configChanges;
|
||||
atoken.layoutConfigChanges = (configChanges &
|
||||
(ActivityInfo.CONFIG_SCREEN_SIZE | ActivityInfo.CONFIG_ORIENTATION)) != 0;
|
||||
if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
|
||||
+ " to stack=" + stackId + " task=" + taskId + " at " + addPos);
|
||||
|
||||
@@ -8269,10 +8270,9 @@ 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.isConfigChanged() && (win.mAttrs.type == TYPE_KEYGUARD ||
|
||||
(win.mAppToken != null && (win.mAppToken.configChanges &
|
||||
(ActivityInfo.CONFIG_SCREEN_SIZE | ActivityInfo.CONFIG_ORIENTATION))
|
||||
!= 0))
|
||||
|| ((win.isConfigChanged() || win.setInsetsChanged()) &&
|
||||
(win.mAttrs.type == TYPE_KEYGUARD ||
|
||||
win.mAppToken != null && win.mAppToken.layoutConfigChanges))
|
||||
|| win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
|
||||
if (!win.mLayoutAttached) {
|
||||
if (initial) {
|
||||
@@ -8706,12 +8706,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
private void updateResizingWindows(final WindowState w) {
|
||||
final WindowStateAnimator winAnimator = w.mWinAnimator;
|
||||
if (w.mHasSurface && w.mLayoutSeq == mLayoutSeq) {
|
||||
w.mOverscanInsetsChanged |=
|
||||
!w.mLastOverscanInsets.equals(w.mOverscanInsets);
|
||||
w.mContentInsetsChanged |=
|
||||
!w.mLastContentInsets.equals(w.mContentInsets);
|
||||
w.mVisibleInsetsChanged |=
|
||||
!w.mLastVisibleInsets.equals(w.mVisibleInsets);
|
||||
w.setInsetsChanged();
|
||||
boolean configChanged = w.isConfigChanged();
|
||||
if (DEBUG_CONFIGURATION && configChanged) {
|
||||
Slog.v(TAG, "Win " + w + " config changed: "
|
||||
|
||||
@@ -701,6 +701,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
return mAppToken != null ? mAppToken.appToken : null;
|
||||
}
|
||||
|
||||
boolean setInsetsChanged() {
|
||||
mOverscanInsetsChanged |= !mLastOverscanInsets.equals(mOverscanInsets);
|
||||
mContentInsetsChanged |= !mLastContentInsets.equals(mContentInsets);
|
||||
mVisibleInsetsChanged |= !mLastVisibleInsets.equals(mVisibleInsets);
|
||||
return mOverscanInsetsChanged || mContentInsetsChanged || mVisibleInsetsChanged;
|
||||
}
|
||||
|
||||
public int getDisplayId() {
|
||||
return mDisplayContent.getDisplayId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user