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

Commit 0002a450 authored by Adrian Roos's avatar Adrian Roos
Browse files

Show bouncer when opening notification in occluded mode

When showing apps on top of keyguard, properly put up
a bouncer when a notification is clicked.

Bug: 15588412

Change-Id: I48bcc5cc17c32856c11e7ab28182cdc3f253ad98
parent 30afdcad
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ import android.view.IWindowManager;
import android.view.ViewGroup;
import android.view.WindowManagerGlobal;
import android.view.WindowManagerPolicy;

import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.android.internal.policy.IKeyguardExitCallback;
import com.android.internal.policy.IKeyguardShowCallback;
import com.android.internal.telephony.IccCardConstants;
@@ -261,6 +262,12 @@ public class KeyguardViewMediator extends SystemUI {
    private int mUnlockSoundId;
    private int mLockSoundStreamId;

    /**
     * The animation used for hiding keyguard. This is used to fetch the animation timings if
     * WindowManager is not providing us with them.
     */
    private Animation mHideAnimation;

    /**
     * The volume applied to the lock/unlock sounds.
     */
@@ -482,6 +489,9 @@ public class KeyguardViewMediator extends SystemUI {
        int lockSoundDefaultAttenuation = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_lockSoundVolumeDb);
        mLockSoundVolume = (float)Math.pow(10, (float)lockSoundDefaultAttenuation/20);

        mHideAnimation = AnimationUtils.loadAnimation(mContext,
                com.android.internal.R.anim.lock_screen_behind_enter);
    }

    @Override
@@ -1192,7 +1202,7 @@ public class KeyguardViewMediator extends SystemUI {
            if (DEBUG) Log.d(TAG, "handleHide");
            try {
                mHiding = true;
                if (mShowing) {
                if (mShowing && !mOccluded) {

                    // Don't actually hide the Keyguard at the moment, wait for window manager until
                    // it tells us it's safe to do so with startKeyguardExitAnimation.
@@ -1201,7 +1211,9 @@ public class KeyguardViewMediator extends SystemUI {

                    // Don't try to rely on WindowManager - if Keyguard wasn't showing, window
                    // manager won't start the exit animation.
                    handleStartKeyguardExitAnimation(0, 0);
                    handleStartKeyguardExitAnimation(
                            SystemClock.uptimeMillis() + mHideAnimation.getStartOffset(),
                            mHideAnimation.getDuration());
                }
            } catch (RemoteException e) {
                Log.e(TAG, "Error while calling WindowManager", e);
+10 −15
Original line number Diff line number Diff line
@@ -2902,7 +2902,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    }

    public boolean onBackPressed() {
        if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
        if (mStatusBarKeyguardViewManager.onBackPressed()) {
            return true;
        }
@@ -2910,15 +2909,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            mNotificationPanel.animateCloseQs();
            return true;
        }
            return false;
        } else {
            if (mNotificationPanel.isQsExpanded()) {
                mNotificationPanel.animateCloseQs();
            } else {
        if (mState != StatusBarState.KEYGUARD && mState != StatusBarState.SHADE_LOCKED) {
            animateCollapsePanels();
            }
            return true;
        }
        return false;
    }

    public boolean onSpacePressed() {
+2 −2
Original line number Diff line number Diff line
@@ -108,14 +108,14 @@ public class StatusBarKeyguardViewManager {
    }

    private void showBouncer() {
        if (!mOccluded) {
        if (mShowing) {
            mBouncer.show();
        }
        updateStates();
    }

    public void dismissWithAction(OnDismissAction r) {
        if (!mOccluded) {
        if (mShowing) {
            mBouncer.showWithDismissAction(r);
        }
        updateStates();
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public class StatusBarWindowManager {

    private void applyHeight(State state) {
        boolean expanded = state.isKeyguardShowingAndNotOccluded() || state.statusBarExpanded
                || state.keyguardFadingAway;
                || state.keyguardFadingAway || state.bouncerShowing;
        if (expanded) {
            mLp.height = ViewGroup.LayoutParams.MATCH_PARENT;
        } else {