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

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

Snap for 5583738 from 7de2ac9c to qt-c2f2-release

Change-Id: Id1ef67825323b7adad45b29e0398c96acb1fe436
parents b3e31d12 7de2ac9c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -254,6 +254,8 @@ interface IWindowSession {
     */
    boolean startMovingTask(IWindow window, float startX, float startY);

    void finishMovingTask(IWindow window);

    void updatePointerIcon(IWindow window);

    /**
+15 −0
Original line number Diff line number Diff line
@@ -25519,6 +25519,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        return false;
    }
    /**
     * Finish a window move task.
     * @hide
     */
    public void finishMovingTask() {
        if (ViewDebug.DEBUG_POSITIONING) {
            Log.d(VIEW_LOG_TAG, "finishMovingTask");
        }
        try {
            mAttachInfo.mSession.finishMovingTask(mAttachInfo.mWindow);
        } catch (RemoteException e) {
            Log.e(VIEW_LOG_TAG, "Unable to finish moving", e);
        }
    }
    /**
     * Handles drag events sent by the system following a call to
     * {@link android.view.View#startDragAndDrop(ClipData,DragShadowBuilder,Object,int)
+8 −1
Original line number Diff line number Diff line
@@ -188,7 +188,8 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
        final int y = (int) e.getY();
        final boolean fromMouse = e.getToolType(e.getActionIndex()) == MotionEvent.TOOL_TYPE_MOUSE;
        final boolean primaryButton = (e.getButtonState() & MotionEvent.BUTTON_PRIMARY) != 0;
        switch (e.getActionMasked()) {
        final int actionMasked = e.getActionMasked();
        switch (actionMasked) {
            case MotionEvent.ACTION_DOWN:
                if (!mShow) {
                    // When there is no caption we should not react to anything.
@@ -220,6 +221,12 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
                    break;
                }
                // Abort the ongoing dragging.
                if (actionMasked == MotionEvent.ACTION_UP) {
                    // If it receives ACTION_UP event, the dragging is already finished and also
                    // the system can not end drag on ACTION_UP event. So request to finish
                    // dragging.
                    finishMovingTask();
                }
                mDragging = false;
                return !mCheckForDragging;
        }
+3 −47
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@

package com.android.systemui.bubbles;

import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_BADGE;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_NOTIFICATION_LIST;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK;
import static android.service.notification.NotificationListenerService.REASON_APP_CANCEL;
import static android.service.notification.NotificationListenerService.REASON_APP_CANCEL_ALL;
import static android.service.notification.NotificationListenerService.REASON_CANCEL;
@@ -52,7 +49,6 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
import android.service.notification.ZenModeConfig;
import android.util.Log;
import android.view.Display;
import android.view.IPinnedStackController;
@@ -79,7 +75,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.NotificationContentInflater.InflationFlag;
import com.android.systemui.statusbar.phone.StatusBarWindowController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ZenModeController;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@@ -145,7 +140,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi

    // Bubbles get added to the status bar view
    private final StatusBarWindowController mStatusBarWindowController;
    private final ZenModeController mZenModeController;
    private StatusBarStateListener mStatusBarStateListener;

    private final NotificationInterruptionStateProvider mNotificationInterruptionStateProvider;
@@ -207,31 +201,17 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
    @Inject
    public BubbleController(Context context, StatusBarWindowController statusBarWindowController,
            BubbleData data, ConfigurationController configurationController,
            NotificationInterruptionStateProvider interruptionStateProvider,
            ZenModeController zenModeController) {
            NotificationInterruptionStateProvider interruptionStateProvider) {
        this(context, statusBarWindowController, data, null /* synchronizer */,
                configurationController, interruptionStateProvider, zenModeController);
                configurationController, interruptionStateProvider);
    }

    public BubbleController(Context context, StatusBarWindowController statusBarWindowController,
            BubbleData data, @Nullable BubbleStackView.SurfaceSynchronizer synchronizer,
            ConfigurationController configurationController,
            NotificationInterruptionStateProvider interruptionStateProvider,
            ZenModeController zenModeController) {
            NotificationInterruptionStateProvider interruptionStateProvider) {
        mContext = context;
        mNotificationInterruptionStateProvider = interruptionStateProvider;
        mZenModeController = zenModeController;
        mZenModeController.addCallback(new ZenModeController.Callback() {
            @Override
            public void onZenChanged(int zen) {
                updateStackViewForZenConfig();
            }

            @Override
            public void onConfigChanged(ZenModeConfig config) {
                updateStackViewForZenConfig();
            }
        });

        configurationController.addCallback(this /* configurationListener */);

@@ -277,8 +257,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
            if (mExpandListener != null) {
                mStackView.setExpandListener(mExpandListener);
            }

            updateStackViewForZenConfig();
        }
    }

@@ -582,28 +560,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
    };

    /**
     * Updates the stack view's suppression flags from the latest config from the zen (do not
     * disturb) controller.
     */
    private void updateStackViewForZenConfig() {
        final int suppressedEffects = mZenModeController.getConfig().suppressedVisualEffects;
        final boolean hideNotificationDotsSelected =
                (suppressedEffects & SUPPRESSED_EFFECT_BADGE) != 0;
        final boolean dontPopNotifsOnScreenSelected =
                (suppressedEffects & SUPPRESSED_EFFECT_PEEK) != 0;
        final boolean hideFromPullDownShadeSelected =
                (suppressedEffects & SUPPRESSED_EFFECT_NOTIFICATION_LIST) != 0;

        final boolean dndEnabled = mZenModeController.getZen() != Settings.Global.ZEN_MODE_OFF;

        mStackView.setSuppressNewDot(
                dndEnabled && hideNotificationDotsSelected);
        mStackView.setSuppressFlyout(
                dndEnabled && (dontPopNotifsOnScreenSelected || hideFromPullDownShadeSelected));
    }

    /**
     * Lets any listeners know if bubble state has changed.
     * Updates the visibility of the bubbles based on current state.
     * Does not un-bubble, just hides or un-hides. Notifies any
     * {@link BubbleStateChangeListener}s of visibility changes.
+7 −63
Original line number Diff line number Diff line
@@ -286,9 +286,6 @@ public class BubbleStackView extends FrameLayout {
    private BubbleDismissView mDismissContainer;
    private Runnable mAfterMagnet;

    private boolean mSuppressNewDot = false;
    private boolean mSuppressFlyout = false;

    public BubbleStackView(Context context, BubbleData data,
                           @Nullable SurfaceSynchronizer synchronizer) {
        super(context);
@@ -690,9 +687,6 @@ public class BubbleStackView extends FrameLayout {
        mBubbleContainer.addView(bubble.iconView, 0,
                new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
        ViewClippingUtil.setClippingDeactivated(bubble.iconView, true, mClippingParameters);
        if (bubble.iconView != null) {
            bubble.iconView.setSuppressDot(mSuppressNewDot, false /* animate */);
        }
        animateInFlyoutForBubble(bubble);
        requestUpdate();
        logBubbleEvent(bubble, StatsLog.BUBBLE_UICHANGED__ACTION__POSTED);
@@ -1310,29 +1304,6 @@ public class BubbleStackView extends FrameLayout {
        }
    }

    /** Sets whether all bubbles in the stack should not show the 'new' dot. */
    void setSuppressNewDot(boolean suppressNewDot) {
        mSuppressNewDot = suppressNewDot;

        for (int i = 0; i < mBubbleContainer.getChildCount(); i++) {
            BubbleView bv = (BubbleView) mBubbleContainer.getChildAt(i);
            bv.setSuppressDot(suppressNewDot, true /* animate */);
        }
    }

    /**
     * Sets whether the flyout should not appear, even if the notif otherwise would generate one.
     */
    void setSuppressFlyout(boolean suppressFlyout) {
        mSuppressFlyout = suppressFlyout;
    }

    /**
     * Callback to run after the flyout hides. Also called if a new flyout is shown before the
     * previous one animates out.
     */
    private Runnable mAfterFlyoutHides;

    /**
     * Animates in the flyout for the given bubble, if available, and then hides it after some time.
     */
@@ -1344,44 +1315,22 @@ public class BubbleStackView extends FrameLayout {
        if (updateMessage != null
                && !isExpanded()
                && !mIsExpansionAnimating
                && !mIsGestureInProgress
                && !mSuppressFlyout) {
                && !mIsGestureInProgress) {
            if (bubble.iconView != null) {
                // Temporarily suppress the dot while the flyout is visible.
                bubble.iconView.setSuppressDot(
                        true /* suppressDot */, false /* animate */);

                bubble.iconView.setSuppressDot(true /* suppressDot */, false /* animate */);
                mFlyoutDragDeltaX = 0f;
                mFlyout.setAlpha(0f);

                if (mAfterFlyoutHides != null) {
                    mAfterFlyoutHides.run();
                }

                mAfterFlyoutHides = () -> {
                    // If we're going to suppress the dot, make it visible first so it'll
                    // visibly animate away.
                    if (mSuppressNewDot) {
                        bubble.iconView.setSuppressDot(
                                false /* suppressDot */, false /* animate */);
                    }

                    // Reset dot suppression. If we're not suppressing due to DND, then
                    // stop suppressing it with no animation (since the flyout has
                    // transformed into the dot). If we are suppressing due to DND, animate
                    // it away.
                    bubble.iconView.setSuppressDot(
                            mSuppressNewDot /* suppressDot */,
                            mSuppressNewDot /* animate */);
                };

                // Post in case layout isn't complete and getWidth returns 0.
                post(() -> mFlyout.showFlyout(
                        updateMessage, mStackAnimationController.getStackPosition(), getWidth(),
                        mStackAnimationController.isStackOnLeftSide(),
                        bubble.iconView.getBadgeColor(), mAfterFlyoutHides));
                        bubble.iconView.getBadgeColor(),
                        () -> {
                            bubble.iconView.setSuppressDot(
                                    false /* suppressDot */, false /* animate */);
                        }));
            }

            mFlyout.removeCallbacks(mHideFlyout);
            mFlyout.postDelayed(mHideFlyout, FLYOUT_HIDE_AFTER);
            logBubbleEvent(bubble, StatsLog.BUBBLE_UICHANGED__ACTION__FLYOUT);
@@ -1390,10 +1339,6 @@ public class BubbleStackView extends FrameLayout {

    /** Hide the flyout immediately and cancel any pending hide runnables. */
    private void hideFlyoutImmediate() {
        if (mAfterFlyoutHides != null) {
            mAfterFlyoutHides.run();
        }

        mFlyout.removeCallbacks(mHideFlyout);
        mFlyout.hideFlyout();
    }
@@ -1496,7 +1441,6 @@ public class BubbleStackView extends FrameLayout {
        int bubbsCount = mBubbleContainer.getChildCount();
        for (int i = 0; i < bubbsCount; i++) {
            BubbleView bv = (BubbleView) mBubbleContainer.getChildAt(i);
            bv.updateDotVisibility(true /* animate */);
            bv.setZ((BubbleController.MAX_BUBBLES
                    * getResources().getDimensionPixelSize(R.dimen.bubble_elevation)) - i);

Loading