From 6f074dddc0a530ead7658a082da76b0de4c0075c Mon Sep 17 00:00:00 2001 From: ianwen Date: Wed, 9 Sep 2015 15:58:19 -0700 Subject: [PATCH] Let WebRTC notification not show "touch to return" in custom tab If the WebRTC is initiated from a custom tab, there is no way to return to the tab by clicking the notification. This CL fixes the string discrepency by removing it. BUG=524855 Review URL: https://codereview.chromium.org/1327193004 Cr-Commit-Position: refs/heads/master@{#348031} --- .../browser/media/MediaCaptureNotificationService.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 1fcc1750d2ae..344de2d9d310 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,24 +159,26 @@ public class MediaCaptureNotificationService extends Service { notificationIconId = R.drawable.webrtc_audio; } - String contentText = mContext.getResources().getString(notificationContentTextId) + ". " - + mContext.getResources().getString( - R.string.media_notification_link_text, url); - NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext) .setAutoCancel(false) .setOngoing(true) .setContentTitle(mContext.getString(R.string.app_name)) - .setContentText(contentText) .setSmallIcon(notificationIconId) .setLocalOnly(true); + StringBuilder contentText = new StringBuilder( + mContext.getResources().getString(notificationContentTextId)).append('.'); Intent tabIntent = Tab.createBringTabToFrontIntent(notificationId); if (tabIntent != null) { PendingIntent contentIntent = PendingIntent.getActivity( mContext, notificationId, tabIntent, 0); builder.setContentIntent(contentIntent); + contentText.append(url); + } else { + contentText.append( + mContext.getResources().getString(R.string.media_notification_link_text, url)); } + builder.setContentText(contentText); Notification notification = new NotificationCompat.BigTextStyle(builder) .bigText(contentText).build(); -- 2.11.4.GIT