Keep FLAG_SHOW_WALLPAPER flag on NotificationShade.
Before this change, we controlled wallpaper visibility on the Lockscreen by combination of visibility of NotificationShade window and setting/resetting FLAG_SHOW_WALLPAPER flag on its window. When the flag was removed while NotificationShade was still visible (e.g. OCCLUDE transition starts on the Lockscreen), the wallpaper became immediately invisible and caused a flicker. With this change, we keep the FLAG_SHOW_WALLPAPER on NotificationShade, and only rely on its visibility weather the wallpaper should be visible or not on the Lockscreen. Bug: 191438572 Test: existing tests + manual open GPay app from the lockscreen open emergency dialer and check the key pad reacts Change-Id: I7876c92331125b00931218d9e5aca164a1ea50d9
This commit is contained in:
@@ -20,5 +20,4 @@ interface IKeyguardStateCallback {
|
|||||||
void onSimSecureStateChanged(boolean simSecure);
|
void onSimSecureStateChanged(boolean simSecure);
|
||||||
void onInputRestrictedStateChanged(boolean inputRestricted);
|
void onInputRestrictedStateChanged(boolean inputRestricted);
|
||||||
void onTrustedChanged(boolean trusted);
|
void onTrustedChanged(boolean trusted);
|
||||||
void onHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper);
|
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
private boolean mBouncer; // true if bouncerIsOrWillBeShowing
|
private boolean mBouncer; // true if bouncerIsOrWillBeShowing
|
||||||
private boolean mAuthInterruptActive;
|
private boolean mAuthInterruptActive;
|
||||||
private boolean mNeedsSlowUnlockTransition;
|
private boolean mNeedsSlowUnlockTransition;
|
||||||
private boolean mHasLockscreenWallpaper;
|
|
||||||
private boolean mAssistantVisible;
|
private boolean mAssistantVisible;
|
||||||
private boolean mKeyguardOccluded;
|
private boolean mKeyguardOccluded;
|
||||||
private boolean mOccludingAppRequestingFp;
|
private boolean mOccludingAppRequestingFp;
|
||||||
@@ -2532,31 +2531,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the state whether Keyguard currently has a lockscreen wallpaper.
|
|
||||||
*
|
|
||||||
* @param hasLockscreenWallpaper Whether Keyguard has a lockscreen wallpaper.
|
|
||||||
*/
|
|
||||||
public void setHasLockscreenWallpaper(boolean hasLockscreenWallpaper) {
|
|
||||||
Assert.isMainThread();
|
|
||||||
if (hasLockscreenWallpaper != mHasLockscreenWallpaper) {
|
|
||||||
mHasLockscreenWallpaper = hasLockscreenWallpaper;
|
|
||||||
for (int i = 0; i < mCallbacks.size(); i++) {
|
|
||||||
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
|
|
||||||
if (cb != null) {
|
|
||||||
cb.onHasLockscreenWallpaperChanged(hasLockscreenWallpaper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Whether Keyguard has a lockscreen wallpaper.
|
|
||||||
*/
|
|
||||||
public boolean hasLockscreenWallpaper() {
|
|
||||||
return mHasLockscreenWallpaper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle {@link #MSG_DPM_STATE_CHANGED}
|
* Handle {@link #MSG_DPM_STATE_CHANGED}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -291,11 +291,6 @@ public class KeyguardUpdateMonitorCallback {
|
|||||||
*/
|
*/
|
||||||
public void onStrongAuthStateChanged(int userId) { }
|
public void onStrongAuthStateChanged(int userId) { }
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the state whether we have a lockscreen wallpaper has changed.
|
|
||||||
*/
|
|
||||||
public void onHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper) { }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the dream's window state is changed.
|
* Called when the dream's window state is changed.
|
||||||
* @param dreaming true if the dream's window has been created and is visible
|
* @param dreaming true if the dream's window has been created and is visible
|
||||||
|
|||||||
@@ -673,13 +673,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper) {
|
|
||||||
synchronized (KeyguardViewMediator.this) {
|
|
||||||
notifyHasLockscreenWallpaperChanged(hasLockscreenWallpaper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() {
|
ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() {
|
||||||
@@ -2905,21 +2898,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper) {
|
|
||||||
int size = mKeyguardStateCallbacks.size();
|
|
||||||
for (int i = size - 1; i >= 0; i--) {
|
|
||||||
try {
|
|
||||||
mKeyguardStateCallbacks.get(i).onHasLockscreenWallpaperChanged(
|
|
||||||
hasLockscreenWallpaper);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.w(TAG, "Failed to call onHasLockscreenWallpaperChanged", e);
|
|
||||||
if (e instanceof DeadObjectException) {
|
|
||||||
mKeyguardStateCallbacks.remove(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addStateMonitorCallback(IKeyguardStateCallback callback) {
|
public void addStateMonitorCallback(IKeyguardStateCallback callback) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
mKeyguardStateCallbacks.add(callback);
|
mKeyguardStateCallbacks.add(callback);
|
||||||
@@ -2929,7 +2907,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
|
|||||||
callback.onInputRestrictedStateChanged(mInputRestricted);
|
callback.onInputRestrictedStateChanged(mInputRestricted);
|
||||||
callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust(
|
callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust(
|
||||||
KeyguardUpdateMonitor.getCurrentUser()));
|
KeyguardUpdateMonitor.getCurrentUser()));
|
||||||
callback.onHasLockscreenWallpaperChanged(mUpdateMonitor.hasLockscreenWallpaper());
|
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e);
|
Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ public class LockscreenWallpaper extends IWallpaperManagerCallback.Stub implemen
|
|||||||
LoaderResult result = loadBitmap(mCurrentUserId, mSelectedUser);
|
LoaderResult result = loadBitmap(mCurrentUserId, mSelectedUser);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
mCached = true;
|
mCached = true;
|
||||||
mUpdateMonitor.setHasLockscreenWallpaper(result.bitmap != null);
|
|
||||||
mCache = result.bitmap;
|
mCache = result.bitmap;
|
||||||
}
|
}
|
||||||
return mCache;
|
return mCache;
|
||||||
@@ -235,7 +234,6 @@ public class LockscreenWallpaper extends IWallpaperManagerCallback.Stub implemen
|
|||||||
if (result.success) {
|
if (result.success) {
|
||||||
mCached = true;
|
mCached = true;
|
||||||
mCache = result.bitmap;
|
mCache = result.bitmap;
|
||||||
mUpdateMonitor.setHasLockscreenWallpaper(result.bitmap != null);
|
|
||||||
mMediaManager.updateMediaMetaData(
|
mMediaManager.updateMediaMetaData(
|
||||||
true /* metaDataChanged */, true /* allowEnterAnimation */);
|
true /* metaDataChanged */, true /* allowEnterAnimation */);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import static android.view.KeyEvent.KEYCODE_VOLUME_UP;
|
|||||||
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
|
|
||||||
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_APPLICATION_WINDOW;
|
import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
|
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
|
||||||
@@ -3306,17 +3305,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
final boolean notify = !WindowManagerService.sEnableRemoteKeyguardOccludeAnimation
|
final boolean notify = !WindowManagerService.sEnableRemoteKeyguardOccludeAnimation
|
||||||
|| !transitionStarted;
|
|| !transitionStarted;
|
||||||
mKeyguardDelegate.setOccluded(isOccluded, animate, notify);
|
mKeyguardDelegate.setOccluded(isOccluded, animate, notify);
|
||||||
if (!showing) {
|
return showing;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (mKeyguardCandidate != null) {
|
|
||||||
if (isOccluded) {
|
|
||||||
mKeyguardCandidate.getAttrs().flags &= ~FLAG_SHOW_WALLPAPER;
|
|
||||||
} else if (!mKeyguardDelegate.hasLockscreenWallpaper()) {
|
|
||||||
mKeyguardCandidate.getAttrs().flags |= FLAG_SHOW_WALLPAPER;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|||||||
@@ -234,13 +234,6 @@ public class KeyguardServiceDelegate {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasLockscreenWallpaper() {
|
|
||||||
if (mKeyguardService != null) {
|
|
||||||
return mKeyguardService.hasLockscreenWallpaper();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasKeyguard() {
|
public boolean hasKeyguard() {
|
||||||
return mKeyguardState.deviceHasKeyguard;
|
return mKeyguardState.deviceHasKeyguard;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,10 +267,6 @@ public class KeyguardServiceWrapper implements IKeyguardService {
|
|||||||
return mKeyguardStateMonitor.isTrusted();
|
return mKeyguardStateMonitor.isTrusted();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasLockscreenWallpaper() {
|
|
||||||
return mKeyguardStateMonitor.hasLockscreenWallpaper();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSecure(int userId) {
|
public boolean isSecure(int userId) {
|
||||||
return mKeyguardStateMonitor.isSecure(userId);
|
return mKeyguardStateMonitor.isSecure(userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub {
|
|||||||
private volatile boolean mSimSecure = true;
|
private volatile boolean mSimSecure = true;
|
||||||
private volatile boolean mInputRestricted = true;
|
private volatile boolean mInputRestricted = true;
|
||||||
private volatile boolean mTrusted = false;
|
private volatile boolean mTrusted = false;
|
||||||
private volatile boolean mHasLockscreenWallpaper = false;
|
|
||||||
|
|
||||||
private int mCurrentUserId;
|
private int mCurrentUserId;
|
||||||
|
|
||||||
@@ -79,10 +78,6 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub {
|
|||||||
return mTrusted;
|
return mTrusted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasLockscreenWallpaper() {
|
|
||||||
return mHasLockscreenWallpaper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCurrentUser() {
|
public int getCurrentUser() {
|
||||||
return mCurrentUserId;
|
return mCurrentUserId;
|
||||||
}
|
}
|
||||||
@@ -116,11 +111,6 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub {
|
|||||||
mCallback.onTrustedChanged();
|
mCallback.onTrustedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // Binder interface
|
|
||||||
public void onHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper) {
|
|
||||||
mHasLockscreenWallpaper = hasLockscreenWallpaper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface StateCallback {
|
public interface StateCallback {
|
||||||
void onTrustedChanged();
|
void onTrustedChanged();
|
||||||
void onShowingChanged();
|
void onShowingChanged();
|
||||||
|
|||||||
@@ -914,15 +914,6 @@ public class DisplayPolicy {
|
|||||||
// letterboxed. Hence always let them extend under the cutout.
|
// letterboxed. Hence always let them extend under the cutout.
|
||||||
attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
||||||
break;
|
break;
|
||||||
case TYPE_NOTIFICATION_SHADE:
|
|
||||||
// If the Keyguard is in a hidden state (occluded by another window), we force to
|
|
||||||
// remove the wallpaper and keyguard flag so that any change in-flight after setting
|
|
||||||
// the keyguard as occluded wouldn't set these flags again.
|
|
||||||
// See {@link #processKeyguardSetHiddenResultLw}.
|
|
||||||
if (mService.mPolicy.isKeyguardOccluded()) {
|
|
||||||
attrs.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TYPE_TOAST:
|
case TYPE_TOAST:
|
||||||
// While apps should use the dedicated toast APIs to add such windows
|
// While apps should use the dedicated toast APIs to add such windows
|
||||||
|
|||||||
@@ -2572,13 +2572,17 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// an exit.
|
// an exit.
|
||||||
win.mAnimatingExit = true;
|
win.mAnimatingExit = true;
|
||||||
} else if (win.mDisplayContent.okToAnimate()
|
} else if (win.mDisplayContent.okToAnimate()
|
||||||
&& win.mDisplayContent.mWallpaperController.isWallpaperTarget(win)) {
|
&& win.mDisplayContent.mWallpaperController.isWallpaperTarget(win)
|
||||||
// If the wallpaper is currently behind this
|
&& win.mAttrs.type != TYPE_NOTIFICATION_SHADE) {
|
||||||
// window, we need to change both of them inside
|
// If the wallpaper is currently behind this app window, we need to change both of them
|
||||||
// of a transaction to avoid artifacts.
|
// inside of a transaction to avoid artifacts.
|
||||||
|
// For NotificationShade, sysui is in charge of running window animation and it updates
|
||||||
|
// the client view visibility only after both NotificationShade and the wallpaper are
|
||||||
|
// hidden. So we don't need to care about exit animation, but can destroy its surface
|
||||||
|
// immediately.
|
||||||
win.mAnimatingExit = true;
|
win.mAnimatingExit = true;
|
||||||
} else {
|
} else {
|
||||||
boolean stopped = win.mActivityRecord != null ? win.mActivityRecord.mAppStopped : true;
|
boolean stopped = win.mActivityRecord == null || win.mActivityRecord.mAppStopped;
|
||||||
// We set mDestroying=true so ActivityRecord#notifyAppStopped in-to destroy surfaces
|
// We set mDestroying=true so ActivityRecord#notifyAppStopped in-to destroy surfaces
|
||||||
// will later actually destroy the surface if we do not do so here. Normally we leave
|
// will later actually destroy the surface if we do not do so here. Normally we leave
|
||||||
// this to the exit animation.
|
// this to the exit animation.
|
||||||
|
|||||||
Reference in New Issue
Block a user