Merge "Update system notification text" into pi-dev am: a90868c525

am: a809ae3808

Change-Id: I6c148b487ce9b0abbd665a0714b0f8c52ebc80a1
This commit is contained in:
Julia Reynolds
2018-03-19 23:16:10 +00:00
committed by android-build-merger
6 changed files with 32 additions and 22 deletions

View File

@@ -319,9 +319,9 @@
<!-- A notification is shown when there is a sync error. This is the text that will scroll through the notification bar (will be seen by the user as he uses another application). -->
<string name="contentServiceSync">Sync</string>
<!-- A notification is shown when there is a sync error. This is the title of the notification. It will be seen in the pull-down notification tray. -->
<string name="contentServiceSyncNotificationTitle">Sync</string>
<string name="contentServiceSyncNotificationTitle">Can\'t sync</string>
<!-- A notification is shown when there is a sync error. This is the message of the notification. It describes the error, in this case is there were too many deletes. The argument is the type of content, for example Gmail or Calendar. It will be seen in the pull-down notification tray. -->
<string name="contentServiceTooManyDeletesNotificationDesc">Too many <xliff:g id="content_type">%s</xliff:g> deletes.</string>
<string name="contentServiceTooManyDeletesNotificationDesc">Attempted to delete too many <xliff:g id="content_type">%s</xliff:g>.</string>
<!-- If MMS discovers there isn't much space left on the device, it will show a toast with this message. -->
<string name="low_memory" product="tablet">Tablet storage is full. Delete some files to free space.</string>
@@ -3007,8 +3007,7 @@
limit</string>
<!-- Notification details to tell the user that a process has exceeded its memory limit. -->
<string name="dump_heap_notification_detail">Heap dump has been collected;
tap to share</string>
<string name="dump_heap_notification_detail">Heap dump collected. Tap to share.</string>
<!-- Title of dialog prompting the user to share a heap dump. -->
<string name="dump_heap_title">Share heap dump?</string>
@@ -3574,7 +3573,7 @@
<string name="vpn_lockdown_disconnected">Disconnected from always-on VPN</string>
<!-- Notification title when error connecting to always-on VPN, a VPN that's set to always stay
connected. -->
<string name="vpn_lockdown_error">Always-on VPN error</string>
<string name="vpn_lockdown_error">Couldn\'t connect to always-on VPN</string>
<!-- Notification body that indicates user can touch to configure always-on VPN, a VPN that's
set to always stay connected. -->
<string name="vpn_lockdown_config">Change network or VPN settings</string>
@@ -3591,8 +3590,8 @@
<!-- Strings for car mode notification -->
<!-- Shown when car mode is enabled -->
<string name="car_mode_disable_notification_title">Car mode enabled</string>
<string name="car_mode_disable_notification_message">Tap to exit car mode.</string>
<string name="car_mode_disable_notification_title">Driving app is running</string>
<string name="car_mode_disable_notification_message">Tap to exit driving app.</string>
<!-- Strings for tethered notification -->
<!-- Shown when the device is tethered -->
@@ -4901,4 +4900,9 @@
<string name="zen_upgrade_notification_title">Do Not Disturb has changed</string>
<!-- Content of notification indicating users can tap on the notification to go to dnd behavior settings -->
<string name="zen_upgrade_notification_content">Tap to check what\'s blocked.</string>
<!-- Application name displayed in notifications [CHAR LIMIT=60] -->
<string name="notification_app_name_system">System</string>
<!-- Application name displayed in notifications [CHAR LIMIT=60] -->
<string name="notification_app_name_settings">Settings</string>
</resources>

View File

@@ -3300,4 +3300,7 @@
<java-symbol type="string" name="config_managed_provisioning_package" />
<java-symbol type="string" name="notification_app_name_system" />
<java-symbol type="string" name="notification_app_name_settings" />
</resources>

View File

@@ -51,10 +51,13 @@ public abstract class SystemUI implements SysUiServiceProvider {
}
}
public static void overrideNotificationAppName(Context context, Notification.Builder n) {
public static void overrideNotificationAppName(Context context, Notification.Builder n,
boolean system) {
final Bundle extras = new Bundle();
extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME,
context.getString(com.android.internal.R.string.android_system_label));
String appName = system
? context.getString(com.android.internal.R.string.notification_app_name_system)
: context.getString(com.android.internal.R.string.notification_app_name_settings);
extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME, appName);
n.addExtras(extras);
}

View File

@@ -177,7 +177,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setContentText(mContext.getString(R.string.invalid_charger_text))
.setColor(mContext.getColor(
com.android.internal.R.color.system_notification_accent_color));
SystemUI.overrideNotificationAppName(mContext, nb);
SystemUI.overrideNotificationAppName(mContext, nb, false);
final Notification n = nb.build();
mNoMan.cancelAsUser(TAG_BATTERY, SystemMessage.NOTE_POWER_LOW, UserHandle.ALL);
mNoMan.notifyAsUser(TAG_BATTERY, SystemMessage.NOTE_BAD_CHARGER, n, UserHandle.ALL);
@@ -222,7 +222,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
pendingBroadcast(ACTION_START_SAVER));
nb.setOnlyAlertOnce(!mPlaySound);
mPlaySound = false;
SystemUI.overrideNotificationAppName(mContext, nb);
SystemUI.overrideNotificationAppName(mContext, nb, false);
final Notification n = nb.build();
mNoMan.cancelAsUser(TAG_BATTERY, SystemMessage.NOTE_BAD_CHARGER, UserHandle.ALL);
mNoMan.notifyAsUser(TAG_BATTERY, SystemMessage.NOTE_POWER_LOW, n, UserHandle.ALL);
@@ -289,7 +289,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setContentIntent(pendingBroadcast(ACTION_CLICKED_TEMP_WARNING))
.setDeleteIntent(pendingBroadcast(ACTION_DISMISSED_TEMP_WARNING))
.setColor(Utils.getColorAttr(mContext, android.R.attr.colorError));
SystemUI.overrideNotificationAppName(mContext, nb);
SystemUI.overrideNotificationAppName(mContext, nb, false);
final Notification n = nb.build();
mNoMan.notifyAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, n, UserHandle.ALL);
}
@@ -339,7 +339,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setDeleteIntent(
pendingBroadcast(ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING))
.setColor(Utils.getColorAttr(mContext, android.R.attr.colorError));
SystemUI.overrideNotificationAppName(mContext, nb);
SystemUI.overrideNotificationAppName(mContext, nb, false);
final Notification n = nb.build();
mNoMan.notifyAsUser(
TAG_TEMPERATURE, SystemMessage.NOTE_THERMAL_SHUTDOWN, n, UserHandle.ALL);

View File

@@ -195,7 +195,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
.setShowWhen(true)
.setColor(r.getColor(
com.android.internal.R.color.system_notification_accent_color));
SystemUI.overrideNotificationAppName(context, mPublicNotificationBuilder);
SystemUI.overrideNotificationAppName(context, mPublicNotificationBuilder, true);
mNotificationBuilder = new Notification.Builder(context,
NotificationChannels.SCREENSHOTS_HEADSUP)
@@ -210,7 +210,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
.setStyle(mNotificationStyle)
.setPublicVersion(mPublicNotificationBuilder.build());
mNotificationBuilder.setFlag(Notification.FLAG_NO_CLEAR, true);
SystemUI.overrideNotificationAppName(context, mNotificationBuilder);
SystemUI.overrideNotificationAppName(context, mNotificationBuilder, true);
mNotificationManager.notify(SystemMessage.NOTE_GLOBAL_SCREENSHOT,
mNotificationBuilder.build());
@@ -889,7 +889,7 @@ class GlobalScreenshot {
b.setContentIntent(pendingIntent);
}
SystemUI.overrideNotificationAppName(context, b);
SystemUI.overrideNotificationAppName(context, b, true);
Notification n = new Notification.BigTextStyle(b)
.bigText(errorMsg)

View File

@@ -219,7 +219,7 @@ public class StorageNotification extends SystemUI {
.setCategory(Notification.CATEGORY_SYSTEM)
.setDeleteIntent(buildSnoozeIntent(fsUuid))
.extend(new Notification.TvExtender());
SystemUI.overrideNotificationAppName(mContext, builder);
SystemUI.overrideNotificationAppName(mContext, builder, false);
mNotificationManager.notifyAsUser(fsUuid, SystemMessage.NOTE_STORAGE_PRIVATE,
builder.build(), UserHandle.ALL);
@@ -247,7 +247,7 @@ public class StorageNotification extends SystemUI {
.setLocalOnly(true)
.setCategory(Notification.CATEGORY_ERROR)
.extend(new Notification.TvExtender());
SystemUI.overrideNotificationAppName(mContext, builder);
SystemUI.overrideNotificationAppName(mContext, builder, false);
mNotificationManager.notifyAsUser(disk.getId(), SystemMessage.NOTE_STORAGE_DISK,
builder.build(), UserHandle.ALL);
@@ -498,7 +498,7 @@ public class StorageNotification extends SystemUI {
.setCategory(Notification.CATEGORY_PROGRESS)
.setProgress(100, status, false)
.setOngoing(true);
SystemUI.overrideNotificationAppName(mContext, builder);
SystemUI.overrideNotificationAppName(mContext, builder, false);
mNotificationManager.notifyAsUser(move.packageName, SystemMessage.NOTE_STORAGE_MOVE,
builder.build(), UserHandle.ALL);
@@ -548,7 +548,7 @@ public class StorageNotification extends SystemUI {
.setLocalOnly(true)
.setCategory(Notification.CATEGORY_SYSTEM)
.setAutoCancel(true);
SystemUI.overrideNotificationAppName(mContext, builder);
SystemUI.overrideNotificationAppName(mContext, builder, false);
mNotificationManager.notifyAsUser(move.packageName, SystemMessage.NOTE_STORAGE_MOVE,
builder.build(), UserHandle.ALL);
@@ -582,7 +582,7 @@ public class StorageNotification extends SystemUI {
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setLocalOnly(true)
.extend(new Notification.TvExtender());
overrideNotificationAppName(mContext, builder);
overrideNotificationAppName(mContext, builder, false);
return builder;
}