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

Commit 180f0174 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Do not clear recent intrusive flag if still intrusive" into oc-dev

parents c50b731f 309d1c83
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -66,8 +66,12 @@ public class NotificationIntrusivenessExtractor implements NotificationSignalExt

            @Override
            public void applyChangesLocked(NotificationRecord record) {
                // there will be another reconsideration in the message queue HANG_TIME_MS
                // from each time this record alerts, which can finally clear this flag.
                if ((System.currentTimeMillis() - record.getLastIntrusive()) >= HANG_TIME_MS) {
                    record.setRecentlyIntrusive(false);
                }
            }
        };
    }

+8 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public final class NotificationRecord {
    // to communicate with the ranking module.
    private float mContactAffinity;
    private boolean mRecentlyIntrusive;
    private long mLastIntrusive;

    // is this notification currently being intercepted by Zen Mode?
    private boolean mIntercept;
@@ -515,12 +516,19 @@ public final class NotificationRecord {

    public void setRecentlyIntrusive(boolean recentlyIntrusive) {
        mRecentlyIntrusive = recentlyIntrusive;
        if (recentlyIntrusive) {
            mLastIntrusive = System.currentTimeMillis();
        }
    }

    public boolean isRecentlyIntrusive() {
        return mRecentlyIntrusive;
    }

    public long getLastIntrusive() {
        return mLastIntrusive;
    }

    public void setPackagePriority(int packagePriority) {
        mPackagePriority = packagePriority;
    }