Fix black frame flicker in UNOCCLUDE transition. am: f5a613e528

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16117045

Change-Id: I75a8c7f5c826b3d59d0751ad3befef3643485687
This commit is contained in:
Issei Suzuki
2021-10-27 17:33:53 +00:00
committed by Automerger Merge Worker
5 changed files with 31 additions and 1 deletions

View File

@@ -4625,6 +4625,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return mKeyguardDelegate.isInputRestricted();
}
/** {@inheritDoc} */
@Override
public boolean isKeyguardUnoccluding() {
return keyguardOn() && !mWindowManagerFuncs.isAppTransitionStateIdle();
}
@Override
public void dismissKeyguardLw(IKeyguardDismissCallback callback, CharSequence message) {
if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) {

View File

@@ -370,6 +370,12 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
* as the top display.
*/
void moveDisplayToTop(int displayId);
/**
* Return whether the app transition state is idle.
* @return {@code true} if app transition state is idle on the default display.
*/
boolean isAppTransitionStateIdle();
}
/**
@@ -969,6 +975,14 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
*/
public boolean isKeyguardOccluded();
/**
* Return whether the keyguard is unoccluding.
* @return {@code true} if the keyguard is unoccluding.
*/
default boolean isKeyguardUnoccluding() {
return false;
}
/**
* @return true if in keyguard is on.
*/

View File

@@ -367,6 +367,10 @@ public class AppTransition implements Dump {
setAppTransitionState(APP_STATE_IDLE);
}
boolean isIdle() {
return mAppTransitionState == APP_STATE_IDLE;
}
boolean isTimeout() {
return mAppTransitionState == APP_STATE_TIMEOUT;
}

View File

@@ -165,7 +165,8 @@ class WallpaperController {
boolean needsShowWhenLockedWallpaper = false;
if ((w.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0
&& mService.mPolicy.isKeyguardLocked()
&& mService.mPolicy.isKeyguardOccluded()) {
&& (mService.mPolicy.isKeyguardOccluded()
|| mService.mPolicy.isKeyguardUnoccluding())) {
// The lowest show when locked window decides whether we need to put the wallpaper
// behind.
needsShowWhenLockedWallpaper = !isFullscreen(w.mAttrs)

View File

@@ -3092,6 +3092,11 @@ public class WindowManagerService extends IWindowManager.Stub
syncInputTransactions(true /* waitForAnimations */);
}
@Override
public boolean isAppTransitionStateIdle() {
return getDefaultDisplayContentLocked().mAppTransition.isIdle();
}
/**
* Notifies activity manager that some Keyguard flags have changed and that it needs to
* reevaluate the visibilities of the activities.