Home
last modified time | relevance | path

Searched refs:sbn (Results 1 – 25 of 131) sorted by relevance

123456

/frameworks/base/services/core/java/com/android/server/notification/
DGroupHelper.java68 private void updateOngoingGroupCount(StatusBarNotification sbn, boolean add) { in updateOngoingGroupCount() argument
69 if (sbn.getNotification().isGroupSummary()) { in updateOngoingGroupCount()
72 String key = generatePackageKey(sbn.getUserId(), sbn.getPackageName()); in updateOngoingGroupCount()
75 notifications.add(sbn.getKey()); in updateOngoingGroupCount()
78 notifications.remove(sbn.getKey()); in updateOngoingGroupCount()
83 mCallback.updateAutogroupSummary(sbn.getUserId(), sbn.getPackageName(), needsOngoingFlag); in updateOngoingGroupCount()
90 public void onNotificationPosted(StatusBarNotification sbn, boolean autogroupSummaryExists) { in onNotificationPosted() argument
92 updateOngoingGroupCount(sbn, sbn.isOngoing() && !sbn.isAppGroup()); in onNotificationPosted()
95 if (!sbn.isAppGroup()) { in onNotificationPosted()
100 = mUngroupedNotifications.get(sbn.getUserId()); in onNotificationPosted()
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/
DForegroundServiceNotificationListener.java83 private void removeNotification(StatusBarNotification sbn) { in removeNotification() argument
85 sbn.getUserId(), in removeNotification()
89 if (mForegroundServiceController.isDisclosureNotification(sbn)) { in removeNotification()
97 return userState.removeNotification(sbn.getPackageName(), sbn.getKey()); in removeNotification()
107 sbn.getUserId(), sbn)); in removeNotification()
118 final StatusBarNotification sbn = entry.getSbn(); in updateNotification() local
120 sbn.getUserId(), in updateNotification()
122 if (mForegroundServiceController.isDisclosureNotification(sbn)) { in updateNotification()
123 final Bundle extras = sbn.getNotification().extras; in updateNotification()
127 userState.setRunningServices(svcs, sbn.getNotification().when); in updateNotification()
[all …]
DForegroundServiceController.java152 public boolean isDisclosureNotification(StatusBarNotification sbn) { in isDisclosureNotification() argument
153 return sbn.getId() == SystemMessageProto.SystemMessage.NOTE_FOREGROUND_SERVICES in isDisclosureNotification()
154 && sbn.getTag() == null in isDisclosureNotification()
155 && sbn.getPackageName().equals("android"); in isDisclosureNotification()
161 public boolean isSystemAlertNotification(StatusBarNotification sbn) { in isSystemAlertNotification() argument
162 return sbn.getPackageName().equals("android") in isSystemAlertNotification()
163 && sbn.getTag() != null in isSystemAlertNotification()
164 && sbn.getTag().contains("AlertWindowNotification"); in isSystemAlertNotification()
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/
DNotificationRecordTest.java254 StatusBarNotification sbn = getNotification(PKG_N_MR1, true /* noisy */, in testSound_default_preUpgradeUsesNotification() local
258 NotificationRecord record = new NotificationRecord(mMockContext, sbn, defaultChannel); in testSound_default_preUpgradeUsesNotification()
267 StatusBarNotification sbn = getNotification(PKG_N_MR1, true /* noisy */, in testSound_custom_preUpgradeUsesNotification() local
271 NotificationRecord record = new NotificationRecord(mMockContext, sbn, defaultChannel); in testSound_custom_preUpgradeUsesNotification()
281 StatusBarNotification sbn = getNotification(PKG_N_MR1, true /* noisy */, in testSound_default_userLocked_preUpgrade() local
285 NotificationRecord record = new NotificationRecord(mMockContext, sbn, defaultChannel); in testSound_default_userLocked_preUpgrade()
293 StatusBarNotification sbn = getNotification(PKG_N_MR1, false /* noisy */, in testSound_noSound_preUpgrade() local
297 NotificationRecord record = new NotificationRecord(mMockContext, sbn, defaultChannel); in testSound_noSound_preUpgrade()
306 StatusBarNotification sbn = getNotification(PKG_O, true /* noisy */, in testSound_default_upgradeUsesChannel() local
310 NotificationRecord record = new NotificationRecord(mMockContext, sbn, channel); in testSound_default_upgradeUsesChannel()
[all …]
DArchiveTest.java89 StatusBarNotification sbn = getNotification("pkg" + i, i, in testRecordAndRead() local
91 expected.add(sbn.getKey()); in testRecordAndRead()
92 mArchive.record(sbn, REASON_CANCEL); in testRecordAndRead()
97 for (StatusBarNotification sbn : actual) { in testRecordAndRead()
98 assertThat(expected).contains(sbn.getKey()); in testRecordAndRead()
111 for (StatusBarNotification sbn : actual) { in testCrossUser()
112 if (sbn.getUserId() == USER_NULL) { in testCrossUser()
122 StatusBarNotification sbn = getNotification("pkg" + i, i, UserHandle.of(USER_SYSTEM)); in testRecordAndRead_overLimit() local
123 mArchive.record(sbn, REASON_CANCEL); in testRecordAndRead_overLimit()
125 expected.add(sbn.getKey()); in testRecordAndRead_overLimit()
[all …]
DGroupHelperTest.java164 StatusBarNotification sbn = getSbn(pkg, i, String.valueOf(i), UserHandle.SYSTEM); in testPostingOverLimit_addsOngoingFlag() local
166 sbn.getNotification().flags |= Notification.FLAG_ONGOING_EVENT; in testPostingOverLimit_addsOngoingFlag()
168 mGroupHelper.onNotificationPosted(sbn, false); in testPostingOverLimit_addsOngoingFlag()
184 for (StatusBarNotification sbn: notifications) { in testAutoGroupCount_addingNoGroupSBN()
185 sbn.getNotification().flags |= Notification.FLAG_ONGOING_EVENT; in testAutoGroupCount_addingNoGroupSBN()
186 sbn.setOverrideGroupKey(AUTOGROUP_KEY); in testAutoGroupCount_addingNoGroupSBN()
189 for (StatusBarNotification sbn: notifications) { in testAutoGroupCount_addingNoGroupSBN()
190 mGroupHelper.onNotificationPosted(sbn, true); in testAutoGroupCount_addingNoGroupSBN()
209 for (StatusBarNotification sbn: notifications) { in testAutoGroupCount_UpdateNotification()
210 sbn.getNotification().flags |= Notification.FLAG_ONGOING_EVENT; in testAutoGroupCount_UpdateNotification()
[all …]
DNotificationIntrusivenessExtractorTest.java49 StatusBarNotification sbn = new StatusBarNotification("", "", 0, "", 0, in testNonIntrusive() local
51 NotificationRecord r = new NotificationRecord(getContext(), sbn, channel); in testNonIntrusive()
67 StatusBarNotification sbn = new StatusBarNotification("", "", 0, "", 0, in testIntrusive_fillScreen() local
70 NotificationRecord r = new NotificationRecord(getContext(), sbn, channel); in testIntrusive_fillScreen()
86 StatusBarNotification sbn = new StatusBarNotification("", "", 0, "", 0, in testOldNotificationsNotIntrusive() local
90 NotificationRecord r = new NotificationRecord(getContext(), sbn, channel); in testOldNotificationsNotIntrusive()
/frameworks/base/core/java/com/android/internal/util/
DNotificationMessagingUtil.java50 public boolean isImportantMessaging(StatusBarNotification sbn, int importance) { in isImportantMessaging() argument
55 return hasMessagingStyle(sbn) || (isCategoryMessage(sbn) && isDefaultMessagingApp(sbn)); in isImportantMessaging()
58 public boolean isMessaging(StatusBarNotification sbn) { in isMessaging() argument
59 return hasMessagingStyle(sbn) || isDefaultMessagingApp(sbn) || isCategoryMessage(sbn); in isMessaging()
63 private boolean isDefaultMessagingApp(StatusBarNotification sbn) { in isDefaultMessagingApp() argument
64 final int userId = sbn.getUserId(); in isDefaultMessagingApp()
69 return Objects.equals(mDefaultSmsApp.get(userId), sbn.getPackageName()); in isDefaultMessagingApp()
88 private boolean hasMessagingStyle(StatusBarNotification sbn) { in hasMessagingStyle() argument
89 return sbn.getNotification().isStyle(Notification.MessagingStyle.class); in hasMessagingStyle()
92 private boolean isCategoryMessage(StatusBarNotification sbn) { in isCategoryMessage() argument
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
DRemoteInputNotificationRebuilder.java99 StatusBarNotification sbn = entry.getSbn(); in rebuildWithRemoteInputInserted() local
102 .recoverBuilder(mContext, sbn.getNotification().clone()); in rebuildWithRemoteInputInserted()
107 Parcelable[] oldHistoryItems = sbn.getNotification().extras in rebuildWithRemoteInputInserted()
123 newNotification.contentView = sbn.getNotification().contentView; in rebuildWithRemoteInputInserted()
124 newNotification.bigContentView = sbn.getNotification().bigContentView; in rebuildWithRemoteInputInserted()
125 newNotification.headsUpContentView = sbn.getNotification().headsUpContentView; in rebuildWithRemoteInputInserted()
128 sbn.getPackageName(), in rebuildWithRemoteInputInserted()
129 sbn.getOpPkg(), in rebuildWithRemoteInputInserted()
130 sbn.getId(), in rebuildWithRemoteInputInserted()
131 sbn.getTag(), in rebuildWithRemoteInputInserted()
[all …]
DNotificationListener.java121 for (StatusBarNotification sbn : notifications) { in onListenerConnected()
122 newRankings.add(getRankingOrTemporaryStandIn(currentRanking, sbn.getKey())); in onListenerConnected()
126 for (StatusBarNotification sbn : notifications) { in onListenerConnected()
128 listener.onNotificationPosted(sbn, completeMap); in onListenerConnected()
140 public void onNotificationPosted(final StatusBarNotification sbn, in onNotificationPosted() argument
142 if (DEBUG) Log.d(TAG, "onNotificationPosted: " + sbn); in onNotificationPosted()
143 if (sbn != null && !onPluginNotificationPosted(sbn, rankingMap)) { in onNotificationPosted()
145 processForRemoteInput(sbn.getNotification(), mContext); in onNotificationPosted()
148 handler.onNotificationPosted(sbn, rankingMap); in onNotificationPosted()
155 public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap, in onNotificationRemoved() argument
[all …]
/frameworks/base/core/tests/coretests/src/android/service/notification/
DStatusBarNotificationTest.java110 StatusBarNotification sbn = getNotification(PKG, GROUP_ID_1, CHANNEL_ID); in testLogMakerNoStaleData() local
111 final LogMaker logMaker = sbn.getLogMaker(); in testLogMakerNoStaleData()
114 assertNull(sbn.getLogMaker().getTaggedData(extraTag)); in testLogMakerNoStaleData()
163 StatusBarNotification sbn = getNotification(PKG, GROUP_ID_1, CHANNEL_ID); in testLogMakerOverrideGroup() local
165 sbn.getLogMaker().getTaggedData(MetricsEvent.FIELD_NOTIFICATION_GROUP_ID)); in testLogMakerOverrideGroup()
167 sbn.setOverrideGroupKey(GROUP_ID_2); in testLogMakerOverrideGroup()
169 sbn.getLogMaker().getTaggedData(MetricsEvent.FIELD_NOTIFICATION_GROUP_ID)); in testLogMakerOverrideGroup()
171 sbn.setOverrideGroupKey(null); in testLogMakerOverrideGroup()
173 sbn.getLogMaker().getTaggedData(MetricsEvent.FIELD_NOTIFICATION_GROUP_ID)); in testLogMakerOverrideGroup()
196 StatusBarNotification sbn = getNotification(PKG, GROUP_ID_1, CHANNEL_ID); in testIsAppGroup() local
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coalescer/
DGroupCoalescer.java130 public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) {
131 maybeEmitBatch(sbn);
134 final boolean shouldCoalesce = handleNotificationPosted(sbn, rankingMap);
137 mLogger.logEventCoalesced(sbn.getKey());
140 mHandler.onNotificationPosted(sbn, rankingMap);
145 public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap) {
146 maybeEmitBatch(sbn);
148 mHandler.onNotificationRemoved(sbn, rankingMap);
153 StatusBarNotification sbn,
156 maybeEmitBatch(sbn);
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/
DTargetSdkResolver.kt37 override fun onEntryBind(entry: NotificationEntry, sbn: StatusBarNotification) { in initialize()
38 entry.targetSdk = resolveNotificationSdk(sbn) in initialize()
43 private fun resolveNotificationSdk(sbn: StatusBarNotification): Int { in resolveNotificationSdk()
44 val applicationInfo = getApplicationInfoFromExtras(sbn.notification) in resolveNotificationSdk()
45 ?: getApplicationInfoFromPackageManager(sbn) in resolveNotificationSdk()
56 private fun getApplicationInfoFromPackageManager(sbn: StatusBarNotification): ApplicationInfo? { in getApplicationInfoFromExtras()
57 val pmUser = CentralSurfaces.getPackageManagerForUser(context, sbn.user.identifier) in getApplicationInfoFromExtras()
60 pmUser.getApplicationInfo(sbn.packageName, 0) in getApplicationInfoFromExtras()
62 Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.packageName, ex) in getApplicationInfoFromExtras()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/
DTvNotificationHandler.java64 public void onNotificationPosted(StatusBarNotification sbn, in onNotificationPosted() argument
66 if (!new Notification.TvExtender(sbn.getNotification()).isAvailableOnTv()) { in onNotificationPosted()
71 mNotifications.put(sbn.getId(), sbn); in onNotificationPosted() local
79 public void onNotificationRemoved(StatusBarNotification sbn, in onNotificationRemoved() argument
82 if (mNotifications.contains(sbn.getId())) { in onNotificationRemoved()
83 mNotifications.remove(sbn.getId()); in onNotificationRemoved()
93 public void onNotificationRemoved(StatusBarNotification sbn, in onNotificationRemoved() argument
95 onNotificationRemoved(sbn, rankingMap); in onNotificationRemoved()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/
DTargetSdkResolverTest.kt77 val sbn = createSbn(notification) in resolveFromNotificationExtras() constant
78 val entry = createNotificationEntry(sbn) in resolveFromNotificationExtras()
80 notifListener.onEntryBind(entry, sbn) in resolveFromNotificationExtras()
88 val sbn = createSbn(Notification()) in resolveFromPackageManager() constant
89 val entry = createNotificationEntry(sbn) in resolveFromPackageManager()
93 notifListener.onEntryBind(entry, sbn) in resolveFromPackageManager()
101 val sbn = createSbn(Notification()) in resolveFromPackageManager_andPackageManagerCrashes() constant
102 val entry = createNotificationEntry(sbn) in resolveFromPackageManager_andPackageManagerCrashes()
106 notifListener.onEntryBind(entry, sbn) in resolveFromPackageManager_andPackageManagerCrashes()
117 private fun createNotificationEntry(sbn: StatusBarNotification) = in createSbn()
[all …]
DNoManSimulator.java61 public NotifEvent retractNotif(StatusBarNotification sbn, int reason) { in retractNotif() argument
62 assertNotNull(mRankings.remove(sbn.getKey())); in retractNotif()
65 listener.onNotificationRemoved(sbn, rankingMap, reason); in retractNotif()
67 return new NotifEvent(sbn, null, rankingMap); in retractNotif()
99 public final StatusBarNotification sbn; field in NoManSimulator.NotifEvent
104 StatusBarNotification sbn, in NotifEvent() argument
107 this.key = sbn.getKey(); in NotifEvent()
108 this.sbn = sbn; in NotifEvent()
/frameworks/base/packages/SystemUI/src/com/android/systemui/dreams/
DDreamOverlayNotificationCountProvider.java47 StatusBarNotification sbn, NotificationListenerService.RankingMap rankingMap) {
48 if (sbn.isOngoing()) {
52 mNotificationKeys.add(sbn.getKey());
58 StatusBarNotification sbn, NotificationListenerService.RankingMap rankingMap) {
59 mNotificationKeys.remove(sbn.getKey());
65 StatusBarNotification sbn,
68 mNotificationKeys.remove(sbn.getKey());
88 .forEach(sbn -> mNotificationKeys.add(sbn.getKey())); in DreamOverlayNotificationCountProvider()
/frameworks/base/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/
DNotificationListener.kt27 override fun onNotificationPosted(sbn: StatusBarNotification) { in onNotificationPosted()
28 if (DEBUG) Log.d(TAG, "onNotificationPosted: $sbn") in onNotificationPosted()
29 notifications[sbn.key] = sbn in onNotificationPosted()
32 override fun onNotificationRemoved(sbn: StatusBarNotification) { in onNotificationRemoved()
33 if (DEBUG) Log.d(TAG, "onNotificationRemoved: $sbn") in onNotificationRemoved()
34 notifications.remove(sbn.key) in onNotificationRemoved()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/
DGroupCoalescerTest.java102 verify(mListener).onNotificationPosted(notif1.sbn, notif1.rankingMap); in testUngroupedNotificationsAreNotCoalesced()
172 new CoalescedEvent(notif2.key, 1, notif2.sbn, notif2.ranking, null), in testCoalescedNotificationsArePosted()
173 new CoalescedEvent(notif1.key, 0, notif1.sbn, notif1.ranking, null), in testCoalescedNotificationsArePosted()
174 new CoalescedEvent(notif3.key, 2, notif3.sbn, notif3.ranking, null) in testCoalescedNotificationsArePosted()
209 new CoalescedEvent(notif1a.key, 0, notif1a.sbn, notif1a.ranking, null), in testCoalescedEventsThatAreLaterUngroupedAreEmittedImmediatelyAndNotLater()
210 new CoalescedEvent(notif2.key, 1, notif2.sbn, notif2.ranking, null), in testCoalescedEventsThatAreLaterUngroupedAreEmittedImmediatelyAndNotLater()
211 new CoalescedEvent(notif3.key, 2, notif3.sbn, notif3.ranking, null) in testCoalescedEventsThatAreLaterUngroupedAreEmittedImmediatelyAndNotLater()
215 inOrder.verify(mListener).onNotificationPosted(notif1b.sbn, notif1b.rankingMap); in testCoalescedEventsThatAreLaterUngroupedAreEmittedImmediatelyAndNotLater()
249 new CoalescedEvent(notif1.key, 0, notif1.sbn, notif1.ranking, null), in testUpdatingCoalescedNotifTriggersBatchEmit()
250 new CoalescedEvent(notif2a.key, 1, notif2a.sbn, notif2a.ranking, null) in testUpdatingCoalescedNotifTriggersBatchEmit()
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/
DForegroundServiceControllerTest.java391 final StatusBarNotification sbn = mock(StatusBarNotification.class); in makeMockSBN() local
392 when(sbn.getNotification()).thenReturn(n); in makeMockSBN()
393 when(sbn.getId()).thenReturn(id); in makeMockSBN()
394 when(sbn.getPackageName()).thenReturn(pkg); in makeMockSBN()
395 when(sbn.getTag()).thenReturn(tag); in makeMockSBN()
396 when(sbn.getUserId()).thenReturn(userid); in makeMockSBN()
397 when(sbn.getUser()).thenReturn(new UserHandle(userid)); in makeMockSBN()
398 when(sbn.getKey()).thenReturn("MOCK:"+userid+"|"+pkg+"|"+id+"|"+tag); in makeMockSBN()
399 return sbn; in makeMockSBN()
404 StatusBarNotification sbn = makeMockSBN(uid, pkg, id, "foo", 0); in makeMockSBN() local
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DNotificationListenerWithPlugins.java88 public boolean onPluginNotificationPosted(StatusBarNotification sbn, in onPluginNotificationPosted() argument
91 if (plugin.onNotificationPosted(sbn, rankingMap)) { in onPluginNotificationPosted()
102 public boolean onPluginNotificationRemoved(StatusBarNotification sbn, in onPluginNotificationRemoved() argument
105 if (plugin.onNotificationRemoved(sbn, rankingMap)) { in onPluginNotificationRemoved()
159 public void addNotification(StatusBarNotification sbn) { in getProvider() argument
160 onNotificationPosted(sbn, getRankingMap()); in getProvider()
164 public void removeNotification(StatusBarNotification sbn) { in getProvider() argument
165 onNotificationRemoved(sbn, getRankingMap()); in getProvider()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/
DIconManager.kt114 val centeredIcon = if (entry.sbn.notification.isMediaNotification) { in <lambda>()
156 it.notification = entry.sbn in <lambda>()
161 it.notification = entry.sbn in <lambda>()
166 it.notification = entry.sbn in <lambda>()
171 it.notification = entry.sbn in <lambda>()
203 val n = entry.sbn.notification in <lambda>()
222 "No icon in notification from " + entry.sbn.packageName) in <lambda>()
225 entry.sbn.user, in <lambda>()
226 entry.sbn.packageName, in <lambda>()
268 val extras: Bundle = entry.sbn.notification.extras in <lambda>()
[all …]
/frameworks/base/core/java/android/service/notification/
DNotificationAssistantService.java142 abstract public void onNotificationSnoozedUntilContext(@NonNull StatusBarNotification sbn, in onNotificationSnoozedUntilContext() argument
155 abstract public @Nullable Adjustment onNotificationEnqueued(@NonNull StatusBarNotification sbn); in onNotificationEnqueued() argument
167 public @Nullable Adjustment onNotificationEnqueued(@NonNull StatusBarNotification sbn, in onNotificationEnqueued() argument
169 return onNotificationEnqueued(sbn); in onNotificationEnqueued()
181 public @Nullable Adjustment onNotificationEnqueued(@NonNull StatusBarNotification sbn, in onNotificationEnqueued() argument
183 return onNotificationEnqueued(sbn, channel); in onNotificationEnqueued()
209 public void onNotificationRemoved(@NonNull StatusBarNotification sbn, in onNotificationRemoved() argument
212 onNotificationRemoved(sbn, rankingMap, reason); in onNotificationRemoved()
372 StatusBarNotification sbn; in onNotificationEnqueuedWithChannel() local
374 sbn = sbnHolder.get(); in onNotificationEnqueuedWithChannel()
[all …]
/frameworks/base/packages/SystemUI/plugin/src/com/android/systemui/plugins/
DNotificationPersonExtractorPlugin.java41 PersonData extractPerson(StatusBarNotification sbn); in extractPerson() argument
50 default String extractPersonKey(StatusBarNotification sbn) { in extractPersonKey() argument
51 return extractPerson(sbn).key; in extractPersonKey()
58 default boolean isPersonNotification(StatusBarNotification sbn) { in isPersonNotification() argument
59 return extractPersonKey(sbn) != null; in isPersonNotification()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/
DMediaCoordinator.java114 final StatusBarNotification sbn = entry.getSbn(); in reportInflationError() local
118 sbn.getPackageName(), in reportInflationError()
119 sbn.getTag(), in reportInflationError()
120 sbn.getId(), in reportInflationError()
121 sbn.getUid(), in reportInflationError()
122 sbn.getInitialPid(), in reportInflationError()
124 sbn.getUser().getIdentifier()); in reportInflationError()

123456