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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java

Issue 2699253003: Abstracting over Notification.Builder + NotificationCompat.Builder (Closed)
Patch Set: Abstracting over Notification.Builder + NotificationCompat.Builder Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
index e2649e615249e4de6390d61e9416b29ea403cc08..8b201463bfedbe6201ac26e10caed6e73a2d5ad9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
@@ -12,12 +12,14 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
-import android.support.v4.app.NotificationCompat;
import android.util.SparseIntArray;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeApplication;
+import org.chromium.chrome.browser.notifications.ChromeNotificationBuilder;
+import org.chromium.chrome.browser.notifications.NotificationConstants;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabWebContentsDelegateAndroid;
@@ -160,8 +162,10 @@ public class MediaCaptureNotificationService extends Service {
* @param url Url of the current webrtc call.
*/
private void createNotification(int notificationId, int mediaType, String url) {
- NotificationCompat.Builder builder =
- new NotificationCompat.Builder(mContext)
+ ChromeNotificationBuilder builder =
+ ((ChromeApplication) mContext)
+ .getChromeNotificationBuilder(true, NotificationConstants.TYPE_ID_GENERAL,
+ NotificationConstants.TYPE_NAME_GENERAL)
.setAutoCancel(false)
.setOngoing(true)
.setContentTitle(mContext.getString(R.string.app_name))
@@ -190,10 +194,9 @@ public class MediaCaptureNotificationService extends Service {
} else {
contentText.append(" ").append(url);
}
- builder.setContentText(contentText);
+ builder.setContentText(contentText.toString());
- Notification notification = new NotificationCompat.BigTextStyle(builder)
- .bigText(contentText).build();
+ Notification notification = builder.buildWithBigTextStyle(contentText.toString());
mNotificationManager.notify(NOTIFICATION_NAMESPACE, notificationId, notification);
mNotifications.put(notificationId, mediaType);
updateSharedPreferencesEntry(notificationId, false);

Powered by Google App Engine
This is Rietveld 408576698