OSDN Git Service

boost starred people to at least high importance
authorChris Wren <cwren@android.com>
Wed, 25 May 2016 20:37:17 +0000 (16:37 -0400)
committerChris Wren <cwren@android.com>
Wed, 25 May 2016 20:45:54 +0000 (16:45 -0400)
Bug: 28949659
Change-Id: If604062a282db5db463642315a8fa5f7cd6e597c

services/core/java/com/android/server/notification/NotificationRecord.java

index 7c89e9f..367f8cb 100644 (file)
@@ -318,8 +318,12 @@ public final class NotificationRecord {
 
     public void setContactAffinity(float contactAffinity) {
         mContactAffinity = contactAffinity;
+        if (mImportance < IMPORTANCE_HIGH &&
+                mContactAffinity >= ValidateNotificationPeople.STARRED_CONTACT) {
+            setImportance(IMPORTANCE_HIGH, getPeopleExplanation());
+        }
         if (mImportance < IMPORTANCE_DEFAULT &&
-                mContactAffinity > ValidateNotificationPeople.VALID_CONTACT) {
+                mContactAffinity >= ValidateNotificationPeople.VALID_CONTACT) {
             setImportance(IMPORTANCE_DEFAULT, getPeopleExplanation());
         }
     }