}
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);
}
}
<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">
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()
{