diff options
Diffstat (limited to 'services/core/java/com/android/server/wm')
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 31 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 15 |
2 files changed, 22 insertions, 24 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index c5bdbb0..d4b3dab 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2345,7 +2345,6 @@ public class WindowManagerService extends IWindowManager.Stub boolean reportNewConfig = false; WindowState attachedWindow = null; - WindowState win = null; long origId; final int type = attrs.type; @@ -2482,7 +2481,7 @@ public class WindowManagerService extends IWindowManager.Stub addToken = true; } - win = new WindowState(this, session, client, token, + WindowState win = new WindowState(this, session, client, token, attachedWindow, appOp[0], seq, attrs, viewVisibility, displayContent); if (win.mDeathRecipient == null) { // Client has apparently died, so there is no reason to @@ -9941,18 +9940,20 @@ public class WindowManagerService extends IWindowManager.Stub final WindowStateAnimator winAnimator = w.mWinAnimator; - // If the window has moved due to its containing - // content frame changing, then we'd like to animate - // it. - if (w.mHasSurface && w.shouldAnimateMove()) { - // Frame has moved, containing content frame - // has also moved, and we're not currently animating... - // let's do something. - Animation a = AnimationUtils.loadAnimation(mContext, - com.android.internal.R.anim.window_move_from_decor); - winAnimator.setAnimation(a); - winAnimator.mAnimDw = w.mLastFrame.left - w.mFrame.left; - winAnimator.mAnimDh = w.mLastFrame.top - w.mFrame.top; + // If the window has moved due to its containing content frame changing, then + // notify the listeners and optionally animate it. + if (w.hasMoved()) { + // Frame has moved, containing content frame has also moved, and we're not + // currently animating... let's do something. + final int left = w.mFrame.left; + final int top = w.mFrame.top; + if ((w.mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0) { + Animation a = AnimationUtils.loadAnimation(mContext, + com.android.internal.R.anim.window_move_from_decor); + winAnimator.setAnimation(a); + winAnimator.mAnimDw = w.mLastFrame.left - left; + winAnimator.mAnimDh = w.mLastFrame.top - top; + } //TODO (multidisplay): Accessibility supported only for the default display. if (mAccessibilityController != null @@ -9961,7 +9962,7 @@ public class WindowManagerService extends IWindowManager.Stub } try { - w.mClient.moved(w.mFrame.left, w.mFrame.top); + w.mClient.moved(left, top); } catch (RemoteException e) { } } diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index ec70879..ad25462 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -20,7 +20,6 @@ import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW; import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED; import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW; -import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; @@ -1081,16 +1080,14 @@ final class WindowState implements WindowManagerPolicy.WindowState { } /** - * Return whether this window is wanting to have a translation - * animation applied to it for an in-progress move. (Only makes + * Return whether this window has moved. (Only makes * sense to call from performLayoutAndPlaceSurfacesLockedInner().) */ - boolean shouldAnimateMove() { - return mContentChanged && !mExiting && !mWinAnimator.mLastHidden && mService.okToDisplay() - && (mFrame.top != mLastFrame.top + boolean hasMoved() { + return mHasSurface && mContentChanged && !mExiting && !mWinAnimator.mLastHidden + && mService.okToDisplay() && (mFrame.top != mLastFrame.top || mFrame.left != mLastFrame.left) - && (mAttrs.privateFlags&PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0 - && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove()); + && (mAttachedWindow == null || !mAttachedWindow.hasMoved()); } boolean isFullscreen(int screenWidth, int screenHeight) { @@ -1709,7 +1706,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { pw.println(mWallpaperDisplayOffsetY); } if (mDrawLock != null) { - pw.println("mDrawLock=" + mDrawLock); + pw.print(prefix); pw.println("mDrawLock=" + mDrawLock); } } |