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

Commit 72be22ba authored by Ned Burns's avatar Ned Burns
Browse files

Dedupe smartspace and notification content on lockscreen

If a notification has been marked as the source of smartspace content,
then hide it on the lockscreen. Supports filtering in both the old and
new notification pipelines.

Bug: 186481467
Test: atest
Change-Id: Id3be493038508f0b24f3924936fd57598d7be9e4
parent 8386a055
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,4 +49,6 @@
    <bool name="flag_ongoing_call_status_bar_chip">true</bool>

    <bool name="flag_smartspace">false</bool>

    <bool name="flag_smartspace_deduping">true</bool>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -92,4 +92,8 @@ public class FeatureFlags {
    public boolean isSmartspaceEnabled() {
        return mFlagReader.isEnabled(R.bool.flag_smartspace);
    }

    public boolean isSmartspaceDedupingEnabled() {
        return isSmartspaceEnabled() && mFlagReader.isEnabled(R.bool.flag_smartspace_deduping);
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -185,6 +185,11 @@ public class NotifCollection implements Dumpable {
        mBuildListener = buildListener;
    }

    /** @see NotifPipeline#getEntry(String) () */
    NotificationEntry getEntry(String key) {
        return mNotificationSet.get(key);
    }

    /** @see NotifPipeline#getAllNotifs() */
    Collection<NotificationEntry> getAllNotifs() {
        Assert.isMainThread();
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar.notification.collection;

import androidx.annotation.Nullable;

import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.statusbar.notification.collection.listbuilder.OnBeforeFinalizeFilterListener;
import com.android.systemui.statusbar.notification.collection.listbuilder.OnBeforeRenderListListener;
@@ -89,6 +91,7 @@ public class NotifPipeline implements CommonNotifCollection {
     *
     * The returned collection is read-only, unsorted, unfiltered, and ungrouped.
     */
    @Override
    public Collection<NotificationEntry> getAllNotifs() {
        return mNotifCollection.getAllNotifs();
    }
@@ -98,6 +101,14 @@ public class NotifPipeline implements CommonNotifCollection {
        mNotifCollection.addCollectionListener(listener);
    }

    /**
     * Returns the NotificationEntry associated with [key].
     */
    @Nullable
    public NotificationEntry getEntry(String key) {
        return mNotifCollection.getEntry(key);
    }

    /**
     * Registers a lifetime extender. Lifetime extenders can cause notifications that have been
     * dismissed or retracted by system server to be temporarily retained in the collection.
+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar.notification.collection.coordinator;

import androidx.annotation.NonNull;

import com.android.systemui.statusbar.notification.collection.NotifPipeline;
import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.Pluggable;

@@ -27,5 +29,5 @@ public interface Coordinator {
     * Called after the NewNotifPipeline is initialized.
     * Coordinators should register their listeners and {@link Pluggable}s to the pipeline.
     */
    void attach(NotifPipeline pipeline);
    void attach(@NonNull NotifPipeline pipeline);
}
Loading