Merge "Fix crash & history text" into rvc-dev am: cea962b18a am: 5a4a6d2c5c

Change-Id: I7056a17665dd3a84164bf63ebe7c27a4f5e54b18
This commit is contained in:
Automerger Merge Worker
2020-02-29 02:36:50 +00:00
3 changed files with 15 additions and 5 deletions

View File

@@ -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] -->

View File

@@ -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>

View File

@@ -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);
}
/**