Merge "Limit when a ranking reconsidering can alert" into oc-dr1-dev
am: 48ab20a645
Change-Id: Iec399c254e41e1c94d67ea2ed5cea637cce148b0
This commit is contained in:
@@ -4004,16 +4004,19 @@ public class NotificationManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
int indexBefore = findNotificationRecordIndexLocked(record);
|
int indexBefore = findNotificationRecordIndexLocked(record);
|
||||||
boolean interceptBefore = record.isIntercepted();
|
boolean interceptBefore = record.isIntercepted();
|
||||||
|
float contactAffinityBefore = record.getContactAffinity();
|
||||||
int visibilityBefore = record.getPackageVisibilityOverride();
|
int visibilityBefore = record.getPackageVisibilityOverride();
|
||||||
recon.applyChangesLocked(record);
|
recon.applyChangesLocked(record);
|
||||||
applyZenModeLocked(record);
|
applyZenModeLocked(record);
|
||||||
mRankingHelper.sort(mNotificationList);
|
mRankingHelper.sort(mNotificationList);
|
||||||
int indexAfter = findNotificationRecordIndexLocked(record);
|
int indexAfter = findNotificationRecordIndexLocked(record);
|
||||||
boolean interceptAfter = record.isIntercepted();
|
boolean interceptAfter = record.isIntercepted();
|
||||||
|
float contactAffinityAfter = record.getContactAffinity();
|
||||||
int visibilityAfter = record.getPackageVisibilityOverride();
|
int visibilityAfter = record.getPackageVisibilityOverride();
|
||||||
changed = indexBefore != indexAfter || interceptBefore != interceptAfter
|
changed = indexBefore != indexAfter || interceptBefore != interceptAfter
|
||||||
|| visibilityBefore != visibilityAfter;
|
|| visibilityBefore != visibilityAfter;
|
||||||
if (interceptBefore && !interceptAfter) {
|
if (interceptBefore && !interceptAfter
|
||||||
|
&& Float.compare(contactAffinityBefore, contactAffinityAfter) != 0) {
|
||||||
buzzBeepBlinkLocked(record);
|
buzzBeepBlinkLocked(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
|
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_NOTIFICATIONS" />
|
||||||
|
|
||||||
<application>
|
<application>
|
||||||
<activity android:name="StatusBarTest" android:label="_StatusBar">
|
<activity android:name="StatusBarTest" android:label="_StatusBar">
|
||||||
|
|||||||
@@ -129,6 +129,42 @@ public class NotificationTestList extends TestActivity
|
|||||||
mNM.notify(7001, n);
|
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()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 50; i++) {
|
||||||
|
Notification n = new Notification.Builder(NotificationTestList.this,
|
||||||
|
"default")
|
||||||
|
.setSmallIcon(R.drawable.icon2)
|
||||||
|
.setContentTitle("Default priority")
|
||||||
|
.build();
|
||||||
|
mNM.notify("default", 7004, n);
|
||||||
|
try {
|
||||||
|
Thread.sleep(100);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
new Test("Post a group") {
|
new Test("Post a group") {
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user