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

Commit cabfbf4e authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge "Do not clear recent intrusive flag if still intrusive" into oc-dev am: 180f0174

am: 6f9b0983

Change-Id: I3f20f8da8563f6fc759eed728a279ca7db1a3acd
parents 19980c93 6f9b0983
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;
    }