am 255632d1: Merge "Prevent dim surface from flashing." into jb-dev

* commit '255632d16064bf8e65b1773c4f0884267b9ec93f':
  Prevent dim surface from flashing.
This commit is contained in:
Craig Mautner
2012-05-18 17:36:44 -07:00
committed by Android Git Automerger

View File

@@ -538,8 +538,16 @@ public class WindowAnimator {
if (mDimAnimator == null) { if (mDimAnimator == null) {
mDimAnimator = new DimAnimator(mService.mFxSession); mDimAnimator = new DimAnimator(mService.mFxSession);
} }
mService.mH.sendMessage(mService.mH.obtainMessage(SET_DIM_PARAMETERS, // Only set dim params on the highest dimmed layer.
new DimAnimator.Parameters(winAnimator, width, height, target))); final WindowStateAnimator dimWinAnimator = mDimParams == null
? null : mDimParams.mDimWinAnimator;
// Don't turn on for an unshown surface, or for any layer but the highest dimmed one.
if (winAnimator.mSurfaceShown &&
(dimWinAnimator == null || !dimWinAnimator.mSurfaceShown
|| dimWinAnimator.mAnimLayer < winAnimator.mAnimLayer)) {
mService.mH.sendMessage(mService.mH.obtainMessage(SET_DIM_PARAMETERS,
new DimAnimator.Parameters(winAnimator, width, height, target)));
}
} }
// TODO(cmautner): Move into Handler // TODO(cmautner): Move into Handler