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

Commit 3d8fc642 authored by Beverly's avatar Beverly
Browse files

Add visual stability manager to data-layer

Create OnUserInteractionCallback (to repace OnDimissCallback) which will
handle user interactions with notifications (ExpandableNotificationRow)
and send this information to the relevant notification pipeline.

While we still have both notification pipelines in SystemUI, the new
pipeline will use a VisualStabilityManagerStub (used by
HeadsUpManagerPhone and MediaCarouselController) since the view layer no
longer needs visual stability since this will be taken care of by the
VisualStabilityCoordinator in the data-layer. Once we migrate to the new
pipeline, the legacy VisualStabilityManager + Stub should deleted.

Notes:
- Currently only one coordinator can attach a visual stability manager
or an IllegalStateException will be thrown.
- The suppressed group and section changes are logged in the
suppressedAttachState on the ListAttachState object on each entry.
- Currently we do not suppress the ordering of children as part of the
new VisualStabilityCoordinator; however the old pipeline does
suppress ordering.

Test: atest VisualStabilityCoordinatorTest
Test: SystemUITests
Change-Id: Ia26844ba885ac9ed3b8526af82e772f19e5dcd19
parent 3b6d0385
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -39,6 +39,10 @@ public interface StatusBarStateController {
     */
    boolean isDozing();

    /**
     * Is the status bar panel expanded.
     */
    boolean isExpanded();

    /**
     * Is device pulsing.
@@ -113,5 +117,10 @@ public interface StatusBarStateController {
         * Callback to be notified when the pulsing state changes
         */
        default void onPulsingChanged(boolean pulsing) {}

        /**
         * Callback to be notified when the expanded state of the status bar changes
         */
        default void onExpandedChanged(boolean isExpanded) {}
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ import com.android.systemui.statusbar.VibratorHelper;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.NotificationEntryManager.KeyguardEnvironment;
import com.android.systemui.statusbar.notification.NotificationFilter;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
import com.android.systemui.statusbar.notification.collection.legacy.VisualStabilityManager;
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
import com.android.systemui.statusbar.notification.row.NotificationBlockingHelperManager;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.qs.PageIndicator
import com.android.systemui.statusbar.notification.VisualStabilityManager
import com.android.systemui.statusbar.notification.collection.legacy.VisualStabilityManager
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.Utils
import com.android.systemui.util.animation.UniqueObjectHostView
@@ -155,6 +155,7 @@ class MediaCarouselController @Inject constructor(
        inflateSettingsButton()
        mediaContent = mediaCarousel.requireViewById(R.id.media_carousel)
        configurationController.addCallback(configListener)
        // TODO (b/162832756): remove visual stability manager when migrating to new pipeline
        visualStabilityCallback = VisualStabilityManager.Callback {
            if (needsReordering) {
                needsReordering = false
+1 −2
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.content.res.Resources;
import android.os.Handler;
import android.os.Trace;
import android.os.UserHandle;
import android.service.notification.NotificationListenerService.Ranking;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
@@ -35,9 +34,9 @@ import com.android.systemui.statusbar.notification.AssistantFeedbackController;
import com.android.systemui.statusbar.notification.DynamicChildBindController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.inflation.LowPriorityInflationHelper;
import com.android.systemui.statusbar.notification.collection.legacy.VisualStabilityManager;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.stack.ForegroundServiceSectionController;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
+25 −0
Original line number Diff line number Diff line
@@ -102,6 +102,11 @@ public class StatusBarStateControllerImpl implements SysuiStatusBarStateControll
     */
    private boolean mIsDozing;

    /**
     * If the status bar is currently expanded or not.
     */
    private boolean mIsExpanded;

    /**
     * Current {@link #mDozeAmount} animator.
     */
@@ -189,6 +194,26 @@ public class StatusBarStateControllerImpl implements SysuiStatusBarStateControll
        return mDozeAmount;
    }

    @Override
    public boolean isExpanded() {
        return mIsExpanded;
    }

    @Override
    public boolean setPanelExpanded(boolean expanded) {
        if (mIsExpanded == expanded) {
            return false;
        }
        mIsExpanded = expanded;
        String tag = getClass().getSimpleName() + "#setIsExpanded";
        DejankUtils.startDetectingBlockingIpcs(tag);
        for (RankedListener rl : new ArrayList<>(mListeners)) {
            rl.mListener.onExpandedChanged(mIsExpanded);
        }
        DejankUtils.stopDetectingBlockingIpcs(tag);
        return true;
    }

    @Override
    public float getInterpolatedDozeAmount() {
        return mDozeInterpolator.getInterpolation(mDozeAmount);
Loading