Commit 91a4892f authored by peter's avatar peter Committed by Commit bot

Add a group to sync-related Android notifications

This will avoid the system from inappropriately coalescing them with
other kinds of notifications shown by Chrome.

BUG=674927

Review-Url: https://codereview.chromium.org/2627963003
Cr-Commit-Position: refs/heads/master@{#443223}
parent 45aeda55
......@@ -65,4 +65,5 @@ public class NotificationConstants {
public static final String GROUP_MEDIA_PLAYBACK = "MediaPlayback";
public static final String GROUP_MEDIA_PRESENTATION = "MediaPresentation";
public static final String GROUP_MEDIA_REMOTE = "MediaRemote";
public static final String GROUP_SYNC = "Sync";
}
......@@ -97,6 +97,9 @@ public class SyncNotificationController implements ProfileSyncService.SyncStateC
+ mApplicationContext.getString(message);
PendingIntent contentIntent = PendingIntent.getActivity(mApplicationContext, 0, intent, 0);
// There is no need to provide a group summary notification because the NOTIFICATION_ID_SYNC
// notification id ensures there's only one sync notification at a time.
NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplicationContext)
.setAutoCancel(true)
.setContentIntent(contentIntent)
......@@ -104,7 +107,8 @@ public class SyncNotificationController implements ProfileSyncService.SyncStateC
.setContentText(text)
.setSmallIcon(R.drawable.ic_chrome)
.setTicker(text)
.setLocalOnly(true);
.setLocalOnly(true)
.setGroup(NotificationConstants.GROUP_SYNC);
Notification notification =
new NotificationCompat.BigTextStyle(builder).bigText(text).build();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment