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

Commit 4a823189 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Add the invalidation reason to existing log statements

This ensures logs are richer while adding minimal memory usage, and without adding more log statements which might churn through our buffers faster.

Bug: 236140753
Test: atest KeyguardCoordinatorTest SentitiveContentCoordinatorTest SmartspaceDedupingCoordinatorTest VisualStabilityCoordinatorTest ShadeListBuilderTest
Change-Id: Ie16987a834039d038bb817e3886b0695c2f81976
parent f0e063d1
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -314,60 +314,62 @@ public class ShadeListBuilder implements Dumpable {
                }
            };

    private void onPreRenderInvalidated(Invalidator invalidator) {
    private void onPreRenderInvalidated(Invalidator invalidator, @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logPreRenderInvalidated(invalidator.getName(), mPipelineState.getState());
        mLogger.logPreRenderInvalidated(invalidator, mPipelineState.getState(), reason);

        rebuildListIfBefore(STATE_FINALIZING);
    }

    private void onPreGroupFilterInvalidated(NotifFilter filter) {
    private void onPreGroupFilterInvalidated(NotifFilter filter, @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logPreGroupFilterInvalidated(filter.getName(), mPipelineState.getState());
        mLogger.logPreGroupFilterInvalidated(filter, mPipelineState.getState(), reason);

        rebuildListIfBefore(STATE_PRE_GROUP_FILTERING);
    }

    private void onReorderingAllowedInvalidated(NotifStabilityManager stabilityManager) {
    private void onReorderingAllowedInvalidated(NotifStabilityManager stabilityManager,
            @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logReorderingAllowedInvalidated(
                stabilityManager.getName(),
                mPipelineState.getState());
                stabilityManager,
                mPipelineState.getState(),
                reason);

        rebuildListIfBefore(STATE_GROUPING);
    }

    private void onPromoterInvalidated(NotifPromoter promoter) {
    private void onPromoterInvalidated(NotifPromoter promoter, @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logPromoterInvalidated(promoter.getName(), mPipelineState.getState());
        mLogger.logPromoterInvalidated(promoter, mPipelineState.getState(), reason);

        rebuildListIfBefore(STATE_TRANSFORMING);
    }

    private void onNotifSectionInvalidated(NotifSectioner section) {
    private void onNotifSectionInvalidated(NotifSectioner section, @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logNotifSectionInvalidated(section.getName(), mPipelineState.getState());
        mLogger.logNotifSectionInvalidated(section, mPipelineState.getState(), reason);

        rebuildListIfBefore(STATE_SORTING);
    }

    private void onFinalizeFilterInvalidated(NotifFilter filter) {
    private void onFinalizeFilterInvalidated(NotifFilter filter, @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logFinalizeFilterInvalidated(filter.getName(), mPipelineState.getState());
        mLogger.logFinalizeFilterInvalidated(filter, mPipelineState.getState(), reason);

        rebuildListIfBefore(STATE_FINALIZE_FILTERING);
    }

    private void onNotifComparatorInvalidated(NotifComparator comparator) {
    private void onNotifComparatorInvalidated(NotifComparator comparator, @Nullable String reason) {
        Assert.isMainThread();

        mLogger.logNotifComparatorInvalidated(comparator.getName(), mPipelineState.getState());
        mLogger.logNotifComparatorInvalidated(comparator, mPipelineState.getState(), reason);

        rebuildListIfBefore(STATE_SORTING);
    }
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ public class BubbleCoordinator implements Coordinator {

        @Override
        public void invalidateNotifications(String reason) {
            mNotifFilter.invalidateList();
            mNotifFilter.invalidateList(reason);
        }

        @Override
+4 −4
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@ class DebugModeCoordinator @Inject constructor(
) : Coordinator {

    override fun attach(pipeline: NotifPipeline) {
        pipeline.addPreGroupFilter(preGroupFilter)
        debugModeFilterProvider.registerInvalidationListener(preGroupFilter::invalidateList)
        pipeline.addPreGroupFilter(filter)
        debugModeFilterProvider.registerInvalidationListener { filter.invalidateList(null) }
    }

    private val preGroupFilter = object : NotifFilter("DebugModeCoordinator") {
    private val filter = object : NotifFilter("DebugModeFilter") {
        override fun shouldFilterOut(entry: NotificationEntry, now: Long) =
            debugModeFilterProvider.shouldFilterOut(entry)
    }
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public class DeviceProvisionedCoordinator implements Coordinator {
            new DeviceProvisionedController.DeviceProvisionedListener() {
                @Override
                public void onDeviceProvisionedChanged() {
                    mNotifFilter.invalidateList();
                    mNotifFilter.invalidateList("onDeviceProvisionedChanged");
                }
            };
}
+4 −3
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.systemui.statusbar.notification.collection.render.NodeControl
import com.android.systemui.statusbar.notification.dagger.IncomingHeader
import com.android.systemui.statusbar.notification.interruption.HeadsUpViewBinder
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider
import com.android.systemui.statusbar.notification.logKey
import com.android.systemui.statusbar.notification.stack.BUCKET_HEADS_UP
import com.android.systemui.statusbar.policy.HeadsUpManager
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener
@@ -278,8 +279,8 @@ class HeadsUpCoordinator @Inject constructor(
        .firstOrNull()
        ?.let { posted ->
            posted.entry.takeIf { entry ->
                locationLookupByKey(entry.key) == GroupLocation.Isolated
                        && entry.sbn.notification.groupAlertBehavior == GROUP_ALERT_SUMMARY
                locationLookupByKey(entry.key) == GroupLocation.Isolated &&
                        entry.sbn.notification.groupAlertBehavior == GROUP_ALERT_SUMMARY
            }
        }

@@ -512,7 +513,7 @@ class HeadsUpCoordinator @Inject constructor(
    private val mOnHeadsUpChangedListener = object : OnHeadsUpChangedListener {
        override fun onHeadsUpStateChanged(entry: NotificationEntry, isHeadsUp: Boolean) {
            if (!isHeadsUp) {
                mNotifPromoter.invalidateList()
                mNotifPromoter.invalidateList("headsUpEnded: ${entry.logKey}")
                mHeadsUpViewBinder.unbindHeadsUpView(entry)
                endNotifLifetimeExtensionIfExtended(entry)
            }
Loading