summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Reynolds <juliacr@google.com> 2020-02-29 02:14:51 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-02-29 02:14:51 +0000
commitcea962b18ac64502d11e7b963a0eaaea70d3af98 (patch)
treec59c021746462d43abb0aab42b4f40e49b47e887
parent0fe12dad61bf4523dbca09db2ca89a0450494ea9 (diff)
parent670300166260da56b57b77fab9b6aa872e53ad34 (diff)
Merge "Fix crash & history text" into rvc-dev
-rw-r--r--core/res/res/values/strings.xml2
-rw-r--r--core/res/res/values/symbols.xml3
-rwxr-xr-xservices/core/java/com/android/server/notification/NotificationManagerService.java15
3 files changed, 15 insertions, 5 deletions
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index a7e02eea585d..5f390b26ea5d 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4924,6 +4924,8 @@
<string name="importance_from_user">You set the importance of these notifications.</string>
<string name="importance_from_person">This is important because of the people involved.</string>
+ <string name="notification_history_title_placeholder">Custom app notification</string>
+
<!-- Message to user that app trying to create user for an account that already exists. [CHAR LIMIT=none] -->
<string name="user_creation_account_exists">Allow <xliff:g id="app" example="Gmail">%1$s</xliff:g> to create a new User with <xliff:g id="account" example="foobar@gmail.com">%2$s</xliff:g> (a User with this account already exists) ?</string>
<!-- Message to user that app is trying to create user for a specified account. [CHAR LIMIT=none] -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 3399d1466935..61e4000ab49e 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3907,4 +3907,7 @@
<java-symbol type="string" name="loading" />
<java-symbol type="array" name="config_toastCrossUserPackages" />
+
+ <java-symbol type="string" name="notification_history_title_placeholder" />
+
</resources>
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index e6fa61038645..c40f1b65573d 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -570,17 +570,17 @@ public class NotificationManagerService extends SystemService {
public StatusBarNotification[] getArray(int count, boolean includeSnoozed) {
if (count == 0) count = mBufferSize;
- final StatusBarNotification[] a
- = new StatusBarNotification[Math.min(count, mBuffer.size())];
+ List<StatusBarNotification> a = new ArrayList();
Iterator<Pair<StatusBarNotification, Integer>> iter = descendingIterator();
int i=0;
while (iter.hasNext() && i < count) {
Pair<StatusBarNotification, Integer> pair = iter.next();
if (pair.second != REASON_SNOOZED || includeSnoozed) {
- a[i++] = pair.first;
+ i++;
+ a.add(pair.first);
}
}
- return a;
+ return a.toArray(new StatusBarNotification[a.size()]);
}
}
@@ -2697,8 +2697,13 @@ public class NotificationManagerService extends SystemService {
CharSequence title = null;
if (n.extras != null) {
title = n.extras.getCharSequence(Notification.EXTRA_TITLE);
+ if (title == null) {
+ title = n.extras.getCharSequence(Notification.EXTRA_TITLE_BIG);
+ }
}
- return title == null? null : String.valueOf(title);
+ return title == null ? getContext().getResources().getString(
+ com.android.internal.R.string.notification_history_title_placeholder)
+ : String.valueOf(title);
}
/**