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 5da216539fd6e5f752cda62954ae0e60dd24a1b0..1fcc1750d2aefbecc8b24ca0720e72c16e3b016f 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 |
@@ -159,9 +159,6 @@ public class MediaCaptureNotificationService extends Service { |
notificationIconId = R.drawable.webrtc_audio; |
} |
- Intent tabIntent = Tab.createBringTabToFrontIntent(notificationId); |
- PendingIntent contentIntent = PendingIntent.getActivity( |
- mContext, notificationId, tabIntent, 0); |
String contentText = mContext.getResources().getString(notificationContentTextId) + ". " |
+ mContext.getResources().getString( |
R.string.media_notification_link_text, url); |
@@ -169,12 +166,18 @@ public class MediaCaptureNotificationService extends Service { |
NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext) |
.setAutoCancel(false) |
.setOngoing(true) |
- .setContentIntent(contentIntent) |
.setContentTitle(mContext.getString(R.string.app_name)) |
.setContentText(contentText) |
.setSmallIcon(notificationIconId) |
.setLocalOnly(true); |
+ Intent tabIntent = Tab.createBringTabToFrontIntent(notificationId); |
+ if (tabIntent != null) { |
+ PendingIntent contentIntent = PendingIntent.getActivity( |
+ mContext, notificationId, tabIntent, 0); |
+ builder.setContentIntent(contentIntent); |
+ } |
+ |
Notification notification = new NotificationCompat.BigTextStyle(builder) |
.bigText(contentText).build(); |
mNotificationManager.notify(NOTIFICATION_NAMESPACE, notificationId, notification); |