Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e48aeea authored by Issei Suzuki's avatar Issei Suzuki
Browse files

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)
Change-Id: Id13ffbbd2c965e0dcc97effd3faf46fd7a8bb1a5
parent e940625d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -20,5 +20,4 @@ interface IKeyguardStateCallback {
    void onSimSecureStateChanged(boolean simSecure);
    void onInputRestrictedStateChanged(boolean inputRestricted);
    void onTrustedChanged(boolean trusted);
    void onHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper);
}
 No newline at end of file
+0 −26
Original line number Diff line number Diff line
@@ -277,7 +277,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private boolean mBouncer; // true if bouncerIsOrWillBeShowing
    private boolean mAuthInterruptActive;
    private boolean mNeedsSlowUnlockTransition;
    private boolean mHasLockscreenWallpaper;
    private boolean mAssistantVisible;
    private boolean mKeyguardOccluded;
    private boolean mOccludingAppRequestingFp;
@@ -2578,31 +2577,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}
     */
+0 −5
Original line number Diff line number Diff line
@@ -291,11 +291,6 @@ public class KeyguardUpdateMonitorCallback {
     */
    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.
     * @param dreaming true if the dream's window has been created and is visible
+0 −23
Original line number Diff line number Diff line
@@ -670,13 +670,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
                }
            }
        }

        @Override
        public void onHasLockscreenWallpaperChanged(boolean hasLockscreenWallpaper) {
            synchronized (KeyguardViewMediator.this) {
                notifyHasLockscreenWallpaperChanged(hasLockscreenWallpaper);
            }
        }
    };

    ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() {
@@ -2873,21 +2866,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) {
        synchronized (this) {
            mKeyguardStateCallbacks.add(callback);
@@ -2897,7 +2875,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
                callback.onInputRestrictedStateChanged(mInputRestricted);
                callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust(
                        KeyguardUpdateMonitor.getCurrentUser()));
                callback.onHasLockscreenWallpaperChanged(mUpdateMonitor.hasLockscreenWallpaper());
            } catch (RemoteException e) {
                Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e);
            }
+0 −2
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ public class LockscreenWallpaper extends IWallpaperManagerCallback.Stub implemen
        LoaderResult result = loadBitmap(mCurrentUserId, mSelectedUser);
        if (result.success) {
            mCached = true;
            mUpdateMonitor.setHasLockscreenWallpaper(result.bitmap != null);
            mCache = result.bitmap;
        }
        return mCache;
@@ -235,7 +234,6 @@ public class LockscreenWallpaper extends IWallpaperManagerCallback.Stub implemen
                if (result.success) {
                    mCached = true;
                    mCache = result.bitmap;
                    mUpdateMonitor.setHasLockscreenWallpaper(result.bitmap != null);
                    mMediaManager.updateMediaMetaData(
                            true /* metaDataChanged */, true /* allowEnterAnimation */);
                }
Loading