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

Commit 6626f54e authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Add animation when unoccluding windows (1/2)

Before there was a jump-cut when a window that was occluding Keyguard
was going away, leading to an ugly flicker. To fix this, we do the
following.

- Always show windows with FLAG_SHOW_WHEN_LOCKED above lockscreen, even
if they don't "match" the currently occluding app (which is null in the
animation case)
- Move wallpaper behind last window that is not hidden by policy, so the
window doesn't get occluded by the wallpaper.
- Add a flag in the setOccluded call whether to animate or not. SystemUI
then plays a nice animation when it's set.
- Override the animation to always be the animation that happens when we
exit a window which is revealing the wallpaper behind, to make it
consistent with the home screen case.

Fixes: 30829255
Change-Id: Ib3fe20fc9003a0f9f291c974740f044ed8707e75
parent 02405fb3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -507,6 +507,11 @@ public interface WindowManagerPolicy {
         * Retrieves the {@param outBounds} from the stack with id {@param stackId}.
         */
        void getStackBounds(int stackId, Rect outBounds);

        /**
         * Overrides all currently playing app animations with {@param a}.
         */
        void overridePlayingAppAnimationsLw(Animation a);
    }

    public interface PointerEventListener {
+2 −1
Original line number Diff line number Diff line
@@ -28,8 +28,9 @@ oneway interface IKeyguardService {
     * FLAG_SHOW_ON_LOCK_SCREEN.
     *
     * @param isOccluded Whether the Keyguard is occluded by another window.
     * @param animate Whether to play an animation for the state change.
     */
    void setOccluded(boolean isOccluded);
    void setOccluded(boolean isOccluded, boolean animate);

    void addStateMonitorCallback(IKeyguardStateCallback callback);
    void verifyUnlock(IKeyguardExitCallback callback);
+1 −0
Original line number Diff line number Diff line
@@ -1942,6 +1942,7 @@
  <java-symbol type="anim" name="lock_screen_behind_enter_fade_in" />
  <java-symbol type="anim" name="lock_screen_wallpaper_exit" />
  <java-symbol type="anim" name="launch_task_behind_source" />
  <java-symbol type="anim" name="wallpaper_open_exit" />

  <java-symbol type="bool" name="config_alwaysUseCdmaRssi" />
  <java-symbol type="dimen" name="status_bar_icon_size" />
+2 −2
Original line number Diff line number Diff line
@@ -90,10 +90,10 @@ public class KeyguardService extends Service {
        }

        @Override // Binder interface
        public void setOccluded(boolean isOccluded) {
        public void setOccluded(boolean isOccluded, boolean animate) {
            Trace.beginSection("KeyguardService.mBinder#setOccluded");
            checkPermission();
            mKeyguardViewMediator.setOccluded(isOccluded);
            mKeyguardViewMediator.setOccluded(isOccluded, animate);
            Trace.endSection();
        }

+5 −5
Original line number Diff line number Diff line
@@ -1114,11 +1114,11 @@ public class KeyguardViewMediator extends SystemUI {
    /**
     * Notify us when the keyguard is occluded by another window
     */
    public void setOccluded(boolean isOccluded) {
    public void setOccluded(boolean isOccluded, boolean animate) {
        Trace.beginSection("KeyguardViewMediator#setOccluded");
        if (DEBUG) Log.d(TAG, "setOccluded " + isOccluded);
        mHandler.removeMessages(SET_OCCLUDED);
        Message msg = mHandler.obtainMessage(SET_OCCLUDED, (isOccluded ? 1 : 0), 0);
        Message msg = mHandler.obtainMessage(SET_OCCLUDED, isOccluded ? 1 : 0, animate ? 1 : 0);
        mHandler.sendMessage(msg);
        Trace.endSection();
    }
@@ -1126,7 +1126,7 @@ public class KeyguardViewMediator extends SystemUI {
    /**
     * Handles SET_OCCLUDED message sent by setOccluded()
     */
    private void handleSetOccluded(boolean isOccluded) {
    private void handleSetOccluded(boolean isOccluded, boolean animate) {
        Trace.beginSection("KeyguardViewMediator#handleSetOccluded");
        synchronized (KeyguardViewMediator.this) {
            if (mHiding && isOccluded) {
@@ -1137,7 +1137,7 @@ public class KeyguardViewMediator extends SystemUI {

            if (mOccluded != isOccluded) {
                mOccluded = isOccluded;
                mStatusBarKeyguardViewManager.setOccluded(isOccluded);
                mStatusBarKeyguardViewManager.setOccluded(isOccluded, animate);
                updateActivityLockScreenState();
                adjustStatusBarLocked();
            }
@@ -1468,7 +1468,7 @@ public class KeyguardViewMediator extends SystemUI {
                    break;
                case SET_OCCLUDED:
                    Trace.beginSection("KeyguardViewMediator#handleMessage SET_OCCLUDED");
                    handleSetOccluded(msg.arg1 != 0);
                    handleSetOccluded(msg.arg1 != 0, msg.arg2 != 0);
                    Trace.endSection();
                    break;
                case KEYGUARD_TIMEOUT:
Loading