Commit 48005d6b authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Incognito notification: Polish title on Android N+.

Starts from Android N, notification by default has the app name, so the
title should not be same as the app name. Title can be changed to
"Incognito Tabs".

Also updates the comment for incognito notification strings, they are
not related to document modes any more.

Bug: 875906
Change-Id: Ida379e1634326717023957a28e3358d69d3bb049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829744Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701222}
parent 8456d79c
...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.incognito; ...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.incognito;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.content.Context; import android.content.Context;
import android.os.Build;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.chrome.R; import org.chromium.chrome.R;
...@@ -34,7 +35,12 @@ public class IncognitoNotificationManager { ...@@ -34,7 +35,12 @@ public class IncognitoNotificationManager {
Context context = ContextUtils.getApplicationContext(); Context context = ContextUtils.getApplicationContext();
String actionMessage = String actionMessage =
context.getResources().getString(R.string.close_all_incognito_notification); context.getResources().getString(R.string.close_all_incognito_notification);
String title = context.getResources().getString(R.string.app_name);
// From Android N, notification by default has the app name and title should not be the same
// as app name.
String title = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
? context.getResources().getString(R.string.close_all_incognito_notification_title)
: context.getResources().getString(R.string.app_name);
ChromeNotificationBuilder builder = ChromeNotificationBuilder builder =
NotificationBuilderFactory NotificationBuilderFactory
......
...@@ -2555,8 +2555,11 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p ...@@ -2555,8 +2555,11 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Search your history Search your history
</message> </message>
<!-- Document mode messages --> <!-- Close Incognito tabs notification messages -->
<message name="IDS_CLOSE_ALL_INCOGNITO_NOTIFICATION" desc="Message on the notification that closes all incognito tabs in document mode"> <message name="IDS_CLOSE_ALL_INCOGNITO_NOTIFICATION_TITLE" desc="Title on the notification that closes all incognito tabs on Android N+.">
Incognito Tabs
</message>
<message name="IDS_CLOSE_ALL_INCOGNITO_NOTIFICATION" desc="Message on the notification that closes all incognito tabs.">
Close all incognito tabs Close all incognito tabs
</message> </message>
......
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