diff options
Diffstat (limited to 'services/java/com/android')
| -rw-r--r-- | services/java/com/android/server/wm/Session.java | 5 | ||||
| -rwxr-xr-x | services/java/com/android/server/wm/WindowManagerService.java | 18 | ||||
| -rw-r--r-- | services/java/com/android/server/wm/WindowState.java | 68 |
3 files changed, 69 insertions, 22 deletions
diff --git a/services/java/com/android/server/wm/Session.java b/services/java/com/android/server/wm/Session.java index 77575f2..53c0e07 100644 --- a/services/java/com/android/server/wm/Session.java +++ b/services/java/com/android/server/wm/Session.java @@ -151,13 +151,14 @@ final class Session extends IWindowSession.Stub public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewFlags, - int flags, Rect outFrame, Rect outContentInsets, + int flags, Rect outFrame, Rect outSystemInsets, Rect outContentInsets, Rect outVisibleInsets, Configuration outConfig, Surface outSurface) { if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from " + Binder.getCallingPid()); int res = mService.relayoutWindow(this, window, seq, attrs, requestedWidth, requestedHeight, viewFlags, flags, - outFrame, outContentInsets, outVisibleInsets, outConfig, outSurface); + outFrame, outSystemInsets, outContentInsets, outVisibleInsets, + outConfig, outSurface); if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to " + Binder.getCallingPid()); return res; diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 1dce5dd..16aeb35 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -2647,8 +2647,8 @@ public class WindowManagerService extends IWindowManager.Stub public int relayoutWindow(Session session, IWindow client, int seq, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, int flags, - Rect outFrame, Rect outContentInsets, Rect outVisibleInsets, - Configuration outConfig, Surface outSurface) { + Rect outFrame, Rect outSystemInsets, Rect outContentInsets, + Rect outVisibleInsets, Configuration outConfig, Surface outSurface) { boolean displayed = false; boolean inTouchMode; boolean configChanged; @@ -2939,6 +2939,7 @@ public class WindowManagerService extends IWindowManager.Stub win.mAppToken.updateReportedVisibilityLocked(); } outFrame.set(win.mCompatFrame); + outSystemInsets.set(win.mSystemInsets); outContentInsets.set(win.mContentInsets); outVisibleInsets.set(win.mVisibleInsets); if (localLOGV) Slog.v( @@ -8092,10 +8093,12 @@ public class WindowManagerService extends IWindowManager.Stub private void updateResizingWindows(final WindowState w) { final WindowStateAnimator winAnimator = w.mWinAnimator; if (w.mHasSurface && !w.mAppFreezing && w.mLayoutSeq == mLayoutSeq) { + w.mSystemInsetsChanged |= + !w.mLastSystemInsets.equals(w.mSystemInsets); w.mContentInsetsChanged |= - !w.mLastContentInsets.equals(w.mContentInsets); + !w.mLastContentInsets.equals(w.mContentInsets); w.mVisibleInsetsChanged |= - !w.mLastVisibleInsets.equals(w.mVisibleInsets); + !w.mLastVisibleInsets.equals(w.mVisibleInsets); boolean configChanged = w.mConfiguration != mCurConfiguration && (w.mConfiguration == null @@ -8108,7 +8111,8 @@ public class WindowManagerService extends IWindowManager.Stub + ": configChanged=" + configChanged + " last=" + w.mLastFrame + " frame=" + w.mFrame); w.mLastFrame.set(w.mFrame); - if (w.mContentInsetsChanged + if (w.mSystemInsetsChanged + || w.mContentInsetsChanged || w.mVisibleInsetsChanged || winAnimator.mSurfaceResized || configChanged) { @@ -8120,6 +8124,7 @@ public class WindowManagerService extends IWindowManager.Stub + " configChanged=" + configChanged); } + w.mLastSystemInsets.set(w.mSystemInsets); w.mLastContentInsets.set(w.mContentInsets); w.mLastVisibleInsets.set(w.mVisibleInsets); makeWindowFreezingScreenIfNeededLocked(w); @@ -8505,10 +8510,11 @@ public class WindowManagerService extends IWindowManager.Stub winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i( TAG, "Resizing " + win + " WITH DRAW PENDING"); win.mClient.resized((int)winAnimator.mSurfaceW, - (int)winAnimator.mSurfaceH, + (int)winAnimator.mSurfaceH, win.mLastSystemInsets, win.mLastContentInsets, win.mLastVisibleInsets, winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING, configChanged ? win.mConfiguration : null); + win.mSystemInsetsChanged = false; win.mContentInsetsChanged = false; win.mVisibleInsetsChanged = false; winAnimator.mSurfaceResized = false; diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index 4de6425..05e7d3a 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -124,7 +124,8 @@ final class WindowState implements WindowManagerPolicy.WindowState { boolean mVisibleInsetsChanged; /** - * Insets that are covered by system windows. These are in the application's + * Insets that are covered by system windows (such as the status bar) and + * transient docking windows (such as the IME). These are in the application's * coordinate space (without compatibility scale applied). */ final Rect mContentInsets = new Rect(); @@ -132,6 +133,14 @@ final class WindowState implements WindowManagerPolicy.WindowState { boolean mContentInsetsChanged; /** + * Insets that are covered by system windows such as the status bar. These + * are in the application's coordinate space (without compatibility scale applied). + */ + final Rect mSystemInsets = new Rect(); + final Rect mLastSystemInsets = new Rect(); + boolean mSystemInsetsChanged; + + /** * Set to true if we are waiting for this window to receive its * given internal insets before laying out other windows based on it. */ @@ -178,6 +187,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { final Rect mContainingFrame = new Rect(); final Rect mDisplayFrame = new Rect(); + final Rect mSystemFrame = new Rect(); final Rect mContentFrame = new Rect(); final Rect mParentFrame = new Rect(); final Rect mVisibleFrame = new Rect(); @@ -346,7 +356,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { } @Override - public void computeFrameLw(Rect pf, Rect df, Rect cf, Rect vf) { + public void computeFrameLw(Rect pf, Rect df, Rect sf, Rect cf, Rect vf) { mHaveFrame = true; final Rect container = mContainingFrame; @@ -403,6 +413,9 @@ final class WindowState implements WindowManagerPolicy.WindowState { mContentChanged = true; } + final Rect system = mSystemFrame; + system.set(sf); + final Rect content = mContentFrame; content.set(cf); @@ -434,8 +447,12 @@ final class WindowState implements WindowManagerPolicy.WindowState { // Now make sure the window fits in the overall display. Gravity.applyDisplay(mAttrs.gravity, df, frame); - // Make sure the content and visible frames are inside of the + // Make sure the system, content and visible frames are inside of the // final window frame. + if (system.left < frame.left) system.left = frame.left; + if (system.top < frame.top) system.top = frame.top; + if (system.right > frame.right) system.right = frame.right; + if (system.bottom > frame.bottom) system.bottom = frame.bottom; if (content.left < frame.left) content.left = frame.left; if (content.top < frame.top) content.top = frame.top; if (content.right > frame.right) content.right = frame.right; @@ -445,6 +462,12 @@ final class WindowState implements WindowManagerPolicy.WindowState { if (visible.right > frame.right) visible.right = frame.right; if (visible.bottom > frame.bottom) visible.bottom = frame.bottom; + final Rect systemInsets = mSystemInsets; + systemInsets.left = system.left-frame.left; + systemInsets.top = system.top-frame.top; + systemInsets.right = frame.right-system.right; + systemInsets.bottom = frame.bottom-system.bottom; + final Rect contentInsets = mContentInsets; contentInsets.left = content.left-frame.left; contentInsets.top = content.top-frame.top; @@ -462,6 +485,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { // If there is a size compatibility scale being applied to the // window, we need to apply this to its insets so that they are // reported to the app in its coordinate space. + systemInsets.scale(mInvGlobalScale); contentInsets.scale(mInvGlobalScale); visibleInsets.scale(mInvGlobalScale); @@ -482,6 +506,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { + mRequestedWidth + ", mRequestedheight=" + mRequestedHeight + ") to" + " (pw=" + pw + ", ph=" + ph + "): frame=" + mFrame.toShortString() + + " si=" + systemInsets.toShortString() + " ci=" + contentInsets.toShortString() + " vi=" + visibleInsets.toShortString()); //} @@ -504,6 +529,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { } @Override + public Rect getSystemFrameLw() { + return mSystemFrame; + } + + @Override public Rect getContentFrameLw() { return mContentFrame; } @@ -723,6 +753,14 @@ final class WindowState implements WindowManagerPolicy.WindowState { || mWinAnimator.mAnimating); } + /** + * Return true if this window (or a window it is attached to, but not + * considering its app token) is currently animating. + */ + public boolean isAnimatingLw() { + return mWinAnimator.mAnimation != null; + } + public boolean isGoneForLayoutLw() { final AppWindowToken atoken = mAppToken; return mViewVisibility == View.GONE @@ -1035,20 +1073,22 @@ final class WindowState implements WindowManagerPolicy.WindowState { pw.println(); } if (dumpAll) { - pw.print(prefix); pw.print("mContainingFrame="); + pw.print(prefix); pw.print("Frames: containing="); mContainingFrame.printShortString(pw); - pw.print(" mParentFrame="); - mParentFrame.printShortString(pw); - pw.print(" mDisplayFrame="); - mDisplayFrame.printShortString(pw); + pw.print(" parent="); mParentFrame.printShortString(pw); + pw.print(" display="); mDisplayFrame.printShortString(pw); + pw.println(); + pw.print(prefix); pw.print(" system="); mSystemFrame.printShortString(pw); + pw.print(" content="); mContentFrame.printShortString(pw); + pw.print(" visible="); mVisibleFrame.printShortString(pw); pw.println(); - pw.print(prefix); pw.print("mContentFrame="); mContentFrame.printShortString(pw); - pw.print(" mVisibleFrame="); mVisibleFrame.printShortString(pw); + pw.print(prefix); pw.print("Cur insets: system="); mSystemInsets.printShortString(pw); + pw.print(" content="); mContentInsets.printShortString(pw);; + pw.print(" visible="); mVisibleInsets.printShortString(pw); pw.println(); - pw.print(prefix); pw.print("mContentInsets="); mContentInsets.printShortString(pw); - pw.print(" last="); mLastContentInsets.printShortString(pw); - pw.print(" mVisibleInsets="); mVisibleInsets.printShortString(pw); - pw.print(" last="); mLastVisibleInsets.printShortString(pw); + pw.print(prefix); pw.print("Lst insets: system="); mLastSystemInsets.printShortString(pw); + pw.print(" content="); mLastContentInsets.printShortString(pw);; + pw.print(" visible="); mLastVisibleInsets.printShortString(pw); pw.println(); } mWinAnimator.dump(pw, prefix, dumpAll); |
