Loading core/java/android/app/NotificationHistory.java +1 −3 Original line number Diff line number Diff line Loading @@ -315,9 +315,7 @@ public final class NotificationHistory implements Parcelable { for (int i = 0; i < mNotificationsToWrite.size(); i++) { final HistoricalNotification notification = mNotificationsToWrite.get(i); mStringsToWrite.add(notification.getPackage()); if (!TextUtils.isEmpty(notification.getChannelName())) { mStringsToWrite.add(notification.getChannelName()); } mStringsToWrite.add(notification.getChannelId()); if (!TextUtils.isEmpty(notification.getConversationId())) { mStringsToWrite.add(notification.getConversationId()); Loading services/core/java/com/android/server/notification/NotificationHistoryManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ public class NotificationHistoryManager { final NotificationHistoryDatabase userHistory = getUserHistoryAndInitializeIfNeededLocked(notification.getUserId()); if (userHistory == null) { Slog.v(TAG, "Attempted to add notif for locked/gone/disabled user " Slog.w(TAG, "Attempted to add notif for locked/gone/disabled user " + notification.getUserId()); return; } Loading services/core/java/com/android/server/notification/NotificationManagerService.java +6 −13 Original line number Diff line number Diff line Loading @@ -3872,30 +3872,23 @@ public class NotificationManagerService extends SystemService { @GuardedBy("mNotificationLock") protected void maybeRecordInterruptionLocked(NotificationRecord r) { if (r.isInterruptive() && !r.hasRecordedInterruption()) { String channelId = r.getChannel().getId(); if (android.app.Flags.notificationClassificationUi()) { channelId = r.getNotification().getChannelId(); } mAppUsageStats.reportInterruptiveNotification(r.getSbn().getPackageName(), channelId, r.getChannel().getId(), getRealUserId(r.getSbn().getUserId())); Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "notifHistoryAddItem"); try { if (r.getNotification().getSmallIcon() != null) { final HistoricalNotification.Builder builder = new HistoricalNotification.Builder() mHistoryManager.addNotification(new HistoricalNotification.Builder() .setPackage(r.getSbn().getPackageName()) .setUid(r.getSbn().getUid()) .setUserId(r.getSbn().getNormalizedUserId()) .setChannelId(channelId) .setChannelId(r.getChannel().getId()) .setChannelName(r.getChannel().getName().toString()) .setPostedTimeMs(System.currentTimeMillis()) .setTitle(getHistoryTitle(r.getNotification())) .setText(getHistoryText(r.getNotification())) .setIcon(r.getNotification().getSmallIcon()); if (android.app.Flags.notificationClassificationUi()) { builder.setChannelName(r.getChannel().getName().toString()); } mHistoryManager.addNotification(builder.build()); .setIcon(r.getNotification().getSmallIcon()) .build()); } } finally { Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER); Loading Loading
core/java/android/app/NotificationHistory.java +1 −3 Original line number Diff line number Diff line Loading @@ -315,9 +315,7 @@ public final class NotificationHistory implements Parcelable { for (int i = 0; i < mNotificationsToWrite.size(); i++) { final HistoricalNotification notification = mNotificationsToWrite.get(i); mStringsToWrite.add(notification.getPackage()); if (!TextUtils.isEmpty(notification.getChannelName())) { mStringsToWrite.add(notification.getChannelName()); } mStringsToWrite.add(notification.getChannelId()); if (!TextUtils.isEmpty(notification.getConversationId())) { mStringsToWrite.add(notification.getConversationId()); Loading
services/core/java/com/android/server/notification/NotificationHistoryManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ public class NotificationHistoryManager { final NotificationHistoryDatabase userHistory = getUserHistoryAndInitializeIfNeededLocked(notification.getUserId()); if (userHistory == null) { Slog.v(TAG, "Attempted to add notif for locked/gone/disabled user " Slog.w(TAG, "Attempted to add notif for locked/gone/disabled user " + notification.getUserId()); return; } Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +6 −13 Original line number Diff line number Diff line Loading @@ -3872,30 +3872,23 @@ public class NotificationManagerService extends SystemService { @GuardedBy("mNotificationLock") protected void maybeRecordInterruptionLocked(NotificationRecord r) { if (r.isInterruptive() && !r.hasRecordedInterruption()) { String channelId = r.getChannel().getId(); if (android.app.Flags.notificationClassificationUi()) { channelId = r.getNotification().getChannelId(); } mAppUsageStats.reportInterruptiveNotification(r.getSbn().getPackageName(), channelId, r.getChannel().getId(), getRealUserId(r.getSbn().getUserId())); Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "notifHistoryAddItem"); try { if (r.getNotification().getSmallIcon() != null) { final HistoricalNotification.Builder builder = new HistoricalNotification.Builder() mHistoryManager.addNotification(new HistoricalNotification.Builder() .setPackage(r.getSbn().getPackageName()) .setUid(r.getSbn().getUid()) .setUserId(r.getSbn().getNormalizedUserId()) .setChannelId(channelId) .setChannelId(r.getChannel().getId()) .setChannelName(r.getChannel().getName().toString()) .setPostedTimeMs(System.currentTimeMillis()) .setTitle(getHistoryTitle(r.getNotification())) .setText(getHistoryText(r.getNotification())) .setIcon(r.getNotification().getSmallIcon()); if (android.app.Flags.notificationClassificationUi()) { builder.setChannelName(r.getChannel().getName().toString()); } mHistoryManager.addNotification(builder.build()); .setIcon(r.getNotification().getSmallIcon()) .build()); } } finally { Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER); Loading