Merge "Always set correct policy visibility" into lmp-mr1-dev
This commit is contained in:
@@ -221,6 +221,24 @@ public class WindowAnimator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shouldForceHide(WindowState win) {
|
||||||
|
final WindowState imeTarget = mService.mInputMethodTarget;
|
||||||
|
final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() &&
|
||||||
|
(imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0;
|
||||||
|
|
||||||
|
final WindowState winShowWhenLocked = (WindowState) mPolicy.getWinShowWhenLockedLw();
|
||||||
|
final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ?
|
||||||
|
null : winShowWhenLocked.mAppToken;
|
||||||
|
final boolean hideWhenLocked =
|
||||||
|
!(((win.mIsImWindow || imeTarget == win) && showImeOverKeyguard)
|
||||||
|
|| (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken ||
|
||||||
|
// Show error dialogs over apps that dismiss keyguard.
|
||||||
|
(win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0)));
|
||||||
|
return ((mForceHiding == KEYGUARD_ANIMATING_IN)
|
||||||
|
&& (!win.mWinAnimator.isAnimating() || hideWhenLocked))
|
||||||
|
|| ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateWindowsLocked(final int displayId) {
|
private void updateWindowsLocked(final int displayId) {
|
||||||
++mAnimTransactionSequence;
|
++mAnimTransactionSequence;
|
||||||
|
|
||||||
@@ -256,14 +274,6 @@ public class WindowAnimator {
|
|||||||
|
|
||||||
mForceHiding = KEYGUARD_NOT_SHOWN;
|
mForceHiding = KEYGUARD_NOT_SHOWN;
|
||||||
|
|
||||||
final WindowState imeTarget = mService.mInputMethodTarget;
|
|
||||||
final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() &&
|
|
||||||
(imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0;
|
|
||||||
|
|
||||||
final WindowState winShowWhenLocked = (WindowState) mPolicy.getWinShowWhenLockedLw();
|
|
||||||
final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ?
|
|
||||||
null : winShowWhenLocked.mAppToken;
|
|
||||||
|
|
||||||
boolean wallpaperInUnForceHiding = false;
|
boolean wallpaperInUnForceHiding = false;
|
||||||
boolean startingInUnForceHiding = false;
|
boolean startingInUnForceHiding = false;
|
||||||
ArrayList<WindowStateAnimator> unForceHiding = null;
|
ArrayList<WindowStateAnimator> unForceHiding = null;
|
||||||
@@ -272,7 +282,8 @@ public class WindowAnimator {
|
|||||||
WindowState win = windows.get(i);
|
WindowState win = windows.get(i);
|
||||||
WindowStateAnimator winAnimator = win.mWinAnimator;
|
WindowStateAnimator winAnimator = win.mWinAnimator;
|
||||||
final int flags = win.mAttrs.flags;
|
final int flags = win.mAttrs.flags;
|
||||||
|
boolean canBeForceHidden = mPolicy.canBeForceHidden(win, win.mAttrs);
|
||||||
|
boolean shouldBeForceHidden = shouldForceHide(win);
|
||||||
if (winAnimator.mSurfaceControl != null) {
|
if (winAnimator.mSurfaceControl != null) {
|
||||||
final boolean wasAnimating = winAnimator.mWasAnimating;
|
final boolean wasAnimating = winAnimator.mWasAnimating;
|
||||||
final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime);
|
final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime);
|
||||||
@@ -332,15 +343,8 @@ public class WindowAnimator {
|
|||||||
+ " vis=" + win.mViewVisibility
|
+ " vis=" + win.mViewVisibility
|
||||||
+ " hidden=" + win.mRootToken.hidden
|
+ " hidden=" + win.mRootToken.hidden
|
||||||
+ " anim=" + win.mWinAnimator.mAnimation);
|
+ " anim=" + win.mWinAnimator.mAnimation);
|
||||||
} else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
|
} else if (canBeForceHidden) {
|
||||||
final boolean hideWhenLocked =
|
if (shouldBeForceHidden) {
|
||||||
!(((win.mIsImWindow || imeTarget == win) && showImeOverKeyguard)
|
|
||||||
|| (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken ||
|
|
||||||
// Show error dialogs over apps that dismiss keyguard.
|
|
||||||
(win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0)));
|
|
||||||
if (((mForceHiding == KEYGUARD_ANIMATING_IN)
|
|
||||||
&& (!winAnimator.isAnimating() || hideWhenLocked))
|
|
||||||
|| ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) {
|
|
||||||
if (!win.hideLw(false, false)) {
|
if (!win.hideLw(false, false)) {
|
||||||
// Was already hidden
|
// Was already hidden
|
||||||
continue;
|
continue;
|
||||||
@@ -411,6 +415,16 @@ public class WindowAnimator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the window doesn't have a surface, the only thing we care about is the correct
|
||||||
|
// policy visibility.
|
||||||
|
else if (canBeForceHidden) {
|
||||||
|
if (shouldBeForceHidden) {
|
||||||
|
win.hideLw(false, false);
|
||||||
|
} else {
|
||||||
|
win.showLw(false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final AppWindowToken atoken = win.mAppToken;
|
final AppWindowToken atoken = win.mAppToken;
|
||||||
if (winAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW) {
|
if (winAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW) {
|
||||||
if (atoken == null || atoken.allDrawn) {
|
if (atoken == null || atoken.allDrawn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user