Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java

Issue 1656243002: Implementation of renotify flag for Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.notifications; 5 package org.chromium.chrome.browser.notifications;
6 6
7 import android.app.Notification; 7 import android.app.Notification;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.res.Resources; 9 import android.content.res.Resources;
10 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 NotificationCompat.Builder builder = new NotificationCompat.Builder(mCon text); 119 NotificationCompat.Builder builder = new NotificationCompat.Builder(mCon text);
120 builder.setTicker(mTickerText); 120 builder.setTicker(mTickerText);
121 builder.setSmallIcon(mSmallIconId); 121 builder.setSmallIcon(mSmallIconId);
122 builder.setContentIntent(mContentIntent); 122 builder.setContentIntent(mContentIntent);
123 builder.setDeleteIntent(mDeleteIntent); 123 builder.setDeleteIntent(mDeleteIntent);
124 builder.setDefaults(mDefaults); 124 builder.setDefaults(mDefaults);
125 builder.setVibrate(mVibratePattern); 125 builder.setVibrate(mVibratePattern);
126 builder.setWhen(mTimestamp); 126 builder.setWhen(mTimestamp);
127 builder.setOnlyAlertOnce(!mRenotify);
127 builder.setContent(compactView); 128 builder.setContent(compactView);
128 129
129 // Some things are duplicated in the builder to ensure the notification shows correctly on 130 // Some things are duplicated in the builder to ensure the notification shows correctly on
130 // Wear devices and custom lock screens. 131 // Wear devices and custom lock screens.
131 builder.setContentTitle(mTitle); 132 builder.setContentTitle(mTitle);
132 builder.setContentText(mBody); 133 builder.setContentText(mBody);
133 builder.setSubText(mOrigin); 134 builder.setSubText(mOrigin);
134 builder.setLargeIcon(mLargeIcon); 135 builder.setLargeIcon(mLargeIcon);
135 for (Action action : mActions) { 136 for (Action action : mActions) {
136 builder.addAction(action); 137 builder.addAction(action);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, di splayMetrics)); 272 TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, di splayMetrics));
272 } 273 }
273 274
274 /** 275 /**
275 * Whether to use the Material look and feel or fall back to Holo. 276 * Whether to use the Material look and feel or fall back to Holo.
276 */ 277 */
277 private static boolean useMaterial() { 278 private static boolean useMaterial() {
278 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; 279 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
279 } 280 }
280 } 281 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698