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

Commit f7686065 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Limit when a ranking reconsidering can alert"

parents a1b99b1b 16eb52af
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4194,16 +4194,19 @@ public class NotificationManagerService extends SystemService {
            }
            int indexBefore = findNotificationRecordIndexLocked(record);
            boolean interceptBefore = record.isIntercepted();
            float contactAffinityBefore = record.getContactAffinity();
            int visibilityBefore = record.getPackageVisibilityOverride();
            recon.applyChangesLocked(record);
            applyZenModeLocked(record);
            mRankingHelper.sort(mNotificationList);
            int indexAfter = findNotificationRecordIndexLocked(record);
            boolean interceptAfter = record.isIntercepted();
            float contactAffinityAfter = record.getContactAffinity();
            int visibilityAfter = record.getPackageVisibilityOverride();
            changed = indexBefore != indexAfter || interceptBefore != interceptAfter
                    || visibilityBefore != visibilityAfter;
            if (interceptBefore && !interceptAfter) {
            if (interceptBefore && !interceptAfter
                    && Float.compare(contactAffinityBefore, contactAffinityAfter) != 0) {
                buzzBeepBlinkLocked(record);
            }
        }
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
    <uses-permission android:name="android.permission.MANAGE_NOTIFICATIONS" />

    <application>
        <activity android:name="StatusBarTest" android:label="_StatusBar">
+18 −0
Original line number Diff line number Diff line
@@ -129,6 +129,24 @@ public class NotificationTestList extends TestActivity
                    mNM.notify(7001, n);
                }
            },
            new Test("with zen") {
                public void run()
                {
                    mNM.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALARMS);
                    Notification n = new Notification.Builder(NotificationTestList.this,
                            "default")
                            .setSmallIcon(R.drawable.icon2)
                            .setContentTitle("Default priority")
                            .build();
                    mNM.notify("default", 7004, n);
                    try {
                        Thread.sleep(8000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    mNM.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALL);
                }
            },
            new Test("repeated") {
                public void run()
                {