Merge "Notify client of all window movements." into mnc-dev

This commit is contained in:
Craig Mautner
2015-04-28 20:33:46 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 21 deletions

View File

@@ -9940,18 +9940,20 @@ public class WindowManagerService extends IWindowManager.Stub
final WindowStateAnimator winAnimator = w.mWinAnimator; final WindowStateAnimator winAnimator = w.mWinAnimator;
// If the window has moved due to its containing // If the window has moved due to its containing content frame changing, then
// content frame changing, then we'd like to animate // notify the listeners and optionally animate it.
// it. if (w.hasMoved()) {
if (w.mHasSurface && w.shouldAnimateMove()) { // Frame has moved, containing content frame has also moved, and we're not
// Frame has moved, containing content frame // currently animating... let's do something.
// has also moved, and we're not currently animating... final int left = w.mFrame.left;
// let's do something. final int top = w.mFrame.top;
Animation a = AnimationUtils.loadAnimation(mContext, if ((w.mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0) {
com.android.internal.R.anim.window_move_from_decor); Animation a = AnimationUtils.loadAnimation(mContext,
winAnimator.setAnimation(a); com.android.internal.R.anim.window_move_from_decor);
winAnimator.mAnimDw = w.mLastFrame.left - w.mFrame.left; winAnimator.setAnimation(a);
winAnimator.mAnimDh = w.mLastFrame.top - w.mFrame.top; winAnimator.mAnimDw = w.mLastFrame.left - left;
winAnimator.mAnimDh = w.mLastFrame.top - top;
}
//TODO (multidisplay): Accessibility supported only for the default display. //TODO (multidisplay): Accessibility supported only for the default display.
if (mAccessibilityController != null if (mAccessibilityController != null
@@ -9960,7 +9962,7 @@ public class WindowManagerService extends IWindowManager.Stub
} }
try { try {
w.mClient.moved(w.mFrame.left, w.mFrame.top); w.mClient.moved(left, top);
} catch (RemoteException e) { } catch (RemoteException e) {
} }
} }

View File

@@ -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.FLAG_SHOW_WHEN_LOCKED;
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW; 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_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.PRIVATE_FLAG_KEYGUARD;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; 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 * Return whether this window has moved. (Only makes
* animation applied to it for an in-progress move. (Only makes
* sense to call from performLayoutAndPlaceSurfacesLockedInner().) * sense to call from performLayoutAndPlaceSurfacesLockedInner().)
*/ */
boolean shouldAnimateMove() { boolean hasMoved() {
return mContentChanged && !mExiting && !mWinAnimator.mLastHidden && mService.okToDisplay() return mHasSurface && mContentChanged && !mExiting && !mWinAnimator.mLastHidden
&& (mFrame.top != mLastFrame.top && mService.okToDisplay() && (mFrame.top != mLastFrame.top
|| mFrame.left != mLastFrame.left) || mFrame.left != mLastFrame.left)
&& (mAttrs.privateFlags&PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0 && (mAttachedWindow == null || !mAttachedWindow.hasMoved());
&& (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove());
} }
boolean isFullscreen(int screenWidth, int screenHeight) { boolean isFullscreen(int screenWidth, int screenHeight) {