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

Commit d4a3ca8d authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed a bug where an incoming call wasn't launching" into oc-dr1-dev

am: ac77186d

Change-Id: Ia5c6852cce42eb3fe600086c3140266a141bca03
parents ff5416e5 ac77186d
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -298,7 +298,8 @@ public class NotificationShelf extends ActivatableNotificationView implements
    private void updateNotificationClipHeight(ExpandableNotificationRow row,
    private void updateNotificationClipHeight(ExpandableNotificationRow row,
            float notificationClipEnd) {
            float notificationClipEnd) {
        float viewEnd = row.getTranslationY() + row.getActualHeight();
        float viewEnd = row.getTranslationY() + row.getActualHeight();
        boolean isPinned = row.isPinned() || row.isHeadsUpAnimatingAway();
        boolean isPinned = (row.isPinned() || row.isHeadsUpAnimatingAway())
                && !mAmbientState.isDozingAndNotPulsing(row);
        if (viewEnd > notificationClipEnd
        if (viewEnd > notificationClipEnd
                && (mAmbientState.isShadeExpanded() || !isPinned)) {
                && (mAmbientState.isShadeExpanded() || !isPinned)) {
            int clipBottomAmount = (int) (viewEnd - notificationClipEnd);
            int clipBottomAmount = (int) (viewEnd - notificationClipEnd);
@@ -450,7 +451,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
                ? fullTransitionAmount
                ? fullTransitionAmount
                : transitionAmount;
                : transitionAmount;
        iconState.clampedAppearAmount = clampedAmount;
        iconState.clampedAppearAmount = clampedAmount;
        float contentTransformationAmount = !row.isAboveShelf()
        float contentTransformationAmount = !mAmbientState.isAboveShelf(row)
                    && (isLastChild || iconState.translateContent)
                    && (isLastChild || iconState.translateContent)
                ? iconTransitionAmount
                ? iconTransitionAmount
                : 0.0f;
                : 0.0f;
@@ -519,7 +520,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
                iconState.scaleY = 1.0f;
                iconState.scaleY = 1.0f;
                iconState.hidden = false;
                iconState.hidden = false;
            }
            }
            if (row.isAboveShelf() || (!row.isInShelf() && (isLastChild && row.areGutsExposed()
            if (mAmbientState.isAboveShelf(row) || (!row.isInShelf() && (isLastChild && row.areGutsExposed()
                    || row.getTranslationZ() > mAmbientState.getBaseZHeight()))) {
                    || row.getTranslationZ() > mAmbientState.getBaseZHeight()))) {
                iconState.hidden = true;
                iconState.hidden = true;
            }
            }
+3 −0
Original line number Original line Diff line number Diff line
@@ -7240,6 +7240,9 @@ public class StatusBar extends SystemUI implements DemoMode,
            if (mAccessibilityManager.isTouchExplorationEnabled()) {
            if (mAccessibilityManager.isTouchExplorationEnabled()) {
                if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey());
                if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey());
                return false;
                return false;
            } else if (mDozing) {
                // We never want heads up when we are dozing.
                return false;
            } else {
            } else {
                // we only allow head-up on the lockscreen if it doesn't have a fullscreen intent
                // we only allow head-up on the lockscreen if it doesn't have a fullscreen intent
                return !mStatusBarKeyguardViewManager.isShowing()
                return !mStatusBarKeyguardViewManager.isShowing()
+50 −4
Original line number Original line Diff line number Diff line
@@ -21,11 +21,15 @@ import android.view.View;


import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.statusbar.ActivatableNotificationView;
import com.android.systemui.statusbar.ActivatableNotificationView;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.ExpandableView;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.HeadsUpManager;


import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Collection;


/**
/**
 * A global state to track all input states for the algorithm.
 * A global state to track all input states for the algorithm.
@@ -59,7 +63,7 @@ public class AmbientState {
    private boolean mPanelTracking;
    private boolean mPanelTracking;
    private boolean mExpansionChanging;
    private boolean mExpansionChanging;
    private boolean mPanelFullWidth;
    private boolean mPanelFullWidth;
    private boolean mHasPulsingNotifications;
    private Collection<HeadsUpManager.HeadsUpEntry> mPulsing;
    private boolean mUnlockHintRunning;
    private boolean mUnlockHintRunning;
    private boolean mQsCustomizerShowing;
    private boolean mQsCustomizerShowing;
    private int mIntrinsicPadding;
    private int mIntrinsicPadding;
@@ -290,11 +294,23 @@ public class AmbientState {
    }
    }


    public boolean hasPulsingNotifications() {
    public boolean hasPulsingNotifications() {
        return mHasPulsingNotifications;
        return mPulsing != null;
    }
    }


    public void setHasPulsingNotifications(boolean hasPulsing) {
    public void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> hasPulsing) {
        mHasPulsingNotifications = hasPulsing;
        mPulsing = hasPulsing;
    }

    public boolean isPulsing(NotificationData.Entry entry) {
        if (mPulsing == null) {
            return false;
        }
        for (HeadsUpManager.HeadsUpEntry e : mPulsing) {
            if (e.entry == entry) {
                return true;
            }
        }
        return false;
    }
    }


    public boolean isPanelTracking() {
    public boolean isPanelTracking() {
@@ -332,4 +348,34 @@ public class AmbientState {
    public int getIntrinsicPadding() {
    public int getIntrinsicPadding() {
        return mIntrinsicPadding;
        return mIntrinsicPadding;
    }
    }

    /**
     * Similar to the normal is above shelf logic but doesn't allow it to be above in AOD1.
     *
     * @param expandableView the view to check
     */
    public boolean isAboveShelf(ExpandableView expandableView) {
        if (!(expandableView instanceof ExpandableNotificationRow)) {
            return expandableView.isAboveShelf();
        }
        ExpandableNotificationRow row = (ExpandableNotificationRow) expandableView;
        return row.isAboveShelf() && !isDozingAndNotPulsing(row);
    }

    /**
     * @return whether a view is dozing and not pulsing right now
     */
    public boolean isDozingAndNotPulsing(ExpandableView view) {
        if (view instanceof ExpandableNotificationRow) {
            return isDozingAndNotPulsing((ExpandableNotificationRow) view);
        }
        return false;
    }

    /**
     * @return whether a row is dozing and not pulsing right now
     */
    public boolean isDozingAndNotPulsing(ExpandableNotificationRow row) {
        return isDark() && !isPulsing(row.getEntry());
    }
}
}
+5 −9
Original line number Original line Diff line number Diff line
@@ -805,7 +805,7 @@ public class NotificationStackScrollLayout extends ViewGroup
     */
     */
    private float getAppearStartPosition() {
    private float getAppearStartPosition() {
        if (mTrackingHeadsUp && mFirstVisibleBackgroundChild != null) {
        if (mTrackingHeadsUp && mFirstVisibleBackgroundChild != null) {
            if (mFirstVisibleBackgroundChild.isAboveShelf()) {
            if (mAmbientState.isAboveShelf(mFirstVisibleBackgroundChild)) {
                // If we ever expanded beyond the first notification, it's allowed to merge into
                // If we ever expanded beyond the first notification, it's allowed to merge into
                // the shelf
                // the shelf
                return mFirstVisibleBackgroundChild.getPinnedHeadsUpHeight();
                return mFirstVisibleBackgroundChild.getPinnedHeadsUpHeight();
@@ -823,7 +823,8 @@ public class NotificationStackScrollLayout extends ViewGroup
        int notGoneChildCount = getNotGoneChildCount();
        int notGoneChildCount = getNotGoneChildCount();
        if (mEmptyShadeView.getVisibility() == GONE && notGoneChildCount != 0) {
        if (mEmptyShadeView.getVisibility() == GONE && notGoneChildCount != 0) {
            int minNotificationsForShelf = 1;
            int minNotificationsForShelf = 1;
            if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) {
            if (mTrackingHeadsUp
                    || (mHeadsUpManager.hasPinnedHeadsUp() && !mAmbientState.isDark())) {
                appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight();
                appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight();
                minNotificationsForShelf = 2;
                minNotificationsForShelf = 2;
            } else {
            } else {
@@ -2008,12 +2009,7 @@ public class NotificationStackScrollLayout extends ViewGroup
    }
    }


    private boolean isPulsing(NotificationData.Entry entry) {
    private boolean isPulsing(NotificationData.Entry entry) {
        for (HeadsUpManager.HeadsUpEntry e : mPulsing) {
        return mAmbientState.isPulsing(entry);
            if (e.entry == entry) {
                return true;
            }
        }
        return false;
    }
    }


    public boolean hasPulsingNotifications() {
    public boolean hasPulsingNotifications() {
@@ -4148,7 +4144,7 @@ public class NotificationStackScrollLayout extends ViewGroup
            return;
            return;
        }
        }
        mPulsing = pulsing;
        mPulsing = pulsing;
        mAmbientState.setHasPulsingNotifications(hasPulsingNotifications());
        mAmbientState.setPulsing(pulsing);
        updateNotificationAnimationStates();
        updateNotificationAnimationStates();
        updateContentHeight();
        updateContentHeight();
        notifyHeightChangeListener(mShelf);
        notifyHeightChangeListener(mShelf);
+3 −3
Original line number Original line Diff line number Diff line
@@ -413,7 +413,7 @@ public class StackScrollAlgorithm {
            if (mIsExpanded) {
            if (mIsExpanded) {
                // Ensure that the heads up is always visible even when scrolled off
                // Ensure that the heads up is always visible even when scrolled off
                clampHunToTop(ambientState, row, childState);
                clampHunToTop(ambientState, row, childState);
                if (i == 0 && row.isAboveShelf()) {
                if (i == 0 && ambientState.isAboveShelf(row)) {
                    // the first hun can't get off screen.
                    // the first hun can't get off screen.
                    clampHunToMaxTranslation(ambientState, row, childState);
                    clampHunToMaxTranslation(ambientState, row, childState);
                    childState.hidden = false;
                    childState.hidden = false;
@@ -515,7 +515,7 @@ public class StackScrollAlgorithm {
        ExpandableViewState childViewState = resultState.getViewStateForView(child);
        ExpandableViewState childViewState = resultState.getViewStateForView(child);
        int zDistanceBetweenElements = ambientState.getZDistanceBetweenElements();
        int zDistanceBetweenElements = ambientState.getZDistanceBetweenElements();
        float baseZ = ambientState.getBaseZHeight();
        float baseZ = ambientState.getBaseZHeight();
        if (child.mustStayOnScreen()
        if (child.mustStayOnScreen() && !ambientState.isDozingAndNotPulsing(child)
                && childViewState.yTranslation < ambientState.getTopPadding()
                && childViewState.yTranslation < ambientState.getTopPadding()
                + ambientState.getStackTranslation()) {
                + ambientState.getStackTranslation()) {
            if (childrenOnTop != 0.0f) {
            if (childrenOnTop != 0.0f) {
@@ -527,7 +527,7 @@ public class StackScrollAlgorithm {
            }
            }
            childViewState.zTranslation = baseZ
            childViewState.zTranslation = baseZ
                    + childrenOnTop * zDistanceBetweenElements;
                    + childrenOnTop * zDistanceBetweenElements;
        } else if (i == 0 && child.isAboveShelf()) {
        } else if (i == 0 && ambientState.isAboveShelf(child)) {
            // In case this is a new view that has never been measured before, we don't want to
            // In case this is a new view that has never been measured before, we don't want to
            // elevate if we are currently expanded more then the notification
            // elevate if we are currently expanded more then the notification
            int shelfHeight = ambientState.getShelf().getIntrinsicHeight();
            int shelfHeight = ambientState.getShelf().getIntrinsicHeight();