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

Commit ddedcdd1 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [8079698, 8079679, 8079411, 8079680, 8079412, 8079413,...

Merge cherrypicks of [8079698, 8079679, 8079411, 8079680, 8079412, 8079413, 8079414, 8079681, 8079682, 8079602, 8079699, 8078954a, 8079700] into qt-c2f2-release

Change-Id: I8b97b7bec78053fda3f1b473f675a25aee906b53
parents 6c886797 bfa00499
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@ import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
public class CrossFadeHelper {
    public static final long ANIMATION_DURATION_LENGTH = 210;

    public static void fadeOut(final View view) {
        fadeOut(view, null);
    }

    public static void fadeOut(final View view, final Runnable endRunnable) {
        fadeOut(view, ANIMATION_DURATION_LENGTH, 0, endRunnable);
    }
+9 −1
Original line number Diff line number Diff line
@@ -49,6 +49,14 @@ class KeyguardBypassController {
        private set

    var bouncerShowing: Boolean = false
    var qSExpanded = false
        set(value) {
            val changed = field != value
            field = value
            if (changed && !value) {
                maybePerformPendingUnlock()
            }
        }

    @Inject
    constructor(context: Context, tunerService: TunerService,
@@ -98,7 +106,7 @@ class KeyguardBypassController {
                // to unlock
                return false
            }
            if (isPulseExpanding) {
            if (isPulseExpanding || qSExpanded) {
                pendingUnlockType = biometricSourceType
                return false
            }
+40 −12
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.systemui.R;
import com.android.systemui.plugins.DarkIconDispatcher;
import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.CrossFadeHelper;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.NotificationMediaManager;
import com.android.systemui.statusbar.NotificationShelf;
@@ -92,6 +93,7 @@ public class NotificationIconAreaController implements DarkReceiver,
    private boolean mAnimationsEnabled;
    private int mAodIconTint;
    private boolean mFullyHidden;
    private boolean mAodIconsVisible;

    public NotificationIconAreaController(Context context, StatusBar statusBar,
            StatusBarStateController statusBarStateController,
@@ -147,10 +149,10 @@ public class NotificationIconAreaController implements DarkReceiver,
        mAodIcons = mStatusBar.getStatusBarWindow().findViewById(
                R.id.clock_notification_icon_container);
        mAodIcons.setOnLockScreen(true);
        updateAodIconsVisibility();
        updateAodIconsVisibility(false /* animate */);
        updateAnimations();
        if (changed) {
            updateAodIcons();
            updateAodNotificationIcons();
        }
    }

@@ -293,7 +295,7 @@ public class NotificationIconAreaController implements DarkReceiver,
        updateStatusBarIcons();
        updateShelfIcons();
        updateCenterIcon();
        updateAodIcons();
        updateAodNotificationIcons();

        applyNotificationIconsTint();
    }
@@ -331,7 +333,7 @@ public class NotificationIconAreaController implements DarkReceiver,
                false /* hidePulsing */);
    }

    public void updateAodIcons() {
    public void updateAodNotificationIcons() {
        updateIconsForLayout(entry -> entry.aodIcon, mAodIcons,
                false /* showAmbient */,
                mShowLowPriority /* showLowPriority */,
@@ -532,7 +534,7 @@ public class NotificationIconAreaController implements DarkReceiver,

    @Override
    public void onStateChanged(int newState) {
        updateAodIconsVisibility();
        updateAodIconsVisibility(false /* animate */);
        updateAnimations();
    }

@@ -583,21 +585,25 @@ public class NotificationIconAreaController implements DarkReceiver,

    @Override
    public void onFullyHiddenChanged(boolean fullyHidden) {
        if (fullyHidden && !mBypassController.getBypassEnabled()) {
            appearAodIcons();
        boolean animate = true;
        if (!mBypassController.getBypassEnabled()) {
            animate = mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking();
            // We only want the appear animations to happen when the notifications get fully hidden,
            // since otherwise the unhide animation overlaps
            animate &= fullyHidden;
        }
        updateAodIconsVisibility();
        updateAodIcons();
        updateAodIconsVisibility(animate);
        updateAodNotificationIcons();
    }

    @Override
    public void onPulseExpansionChanged(boolean expandingChanged) {
        if (expandingChanged) {
            updateAodIconsVisibility();
            updateAodIconsVisibility(true /* animate */);
        }
    }

    private void updateAodIconsVisibility() {
    private void updateAodIconsVisibility(boolean animate) {
        boolean visible = mBypassController.getBypassEnabled()
                || mWakeUpCoordinator.getNotificationsFullyHidden();
        if (mStatusBarStateController.getState() != StatusBarState.KEYGUARD) {
@@ -606,6 +612,28 @@ public class NotificationIconAreaController implements DarkReceiver,
        if (visible && mWakeUpCoordinator.isPulseExpanding()) {
            visible = false;
        }
        if (mAodIconsVisible != visible) {
            mAodIconsVisible = visible;
            mAodIcons.animate().cancel();
            if (animate) {
                boolean wasFullyInvisible = mAodIcons.getVisibility() != View.VISIBLE;
                if (mAodIconsVisible) {
                    if (wasFullyInvisible) {
                        // No fading here, let's just appear the icons instead!
                        mAodIcons.setVisibility(View.VISIBLE);
                        mAodIcons.setAlpha(1.0f);
                        appearAodIcons();
                    } else {
                        // We were fading out, let's fade in instead
                        CrossFadeHelper.fadeIn(mAodIcons);
                    }
                } else {
                    CrossFadeHelper.fadeOut(mAodIcons);
                }
            } else {
                mAodIcons.setAlpha(1.0f);
                mAodIcons.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
            }
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -1384,6 +1384,7 @@ public class NotificationPanelView extends PanelView implements
            mStatusBar.setQsExpanded(expanded);
            mNotificationContainerParent.setQsExpanded(expanded);
            mPulseExpansionHandler.setQsExpanded(expanded);
            mKeyguardBypassController.setQSExpanded(expanded);
        }
    }