@@ -138,7 +138,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
138138 if (droppedExpired > 0 ) {
139139 rebuildPendingActionEventKeysLocked()
140140 Logger .debug(
141- Logger .tags( " Notification " ) ,
141+ NOTIFICATION_LOG_TAGS ,
142142 " Dropped expired pending actionPerformed events=$droppedExpired "
143143 )
144144 }
@@ -183,7 +183,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
183183 val key = event.optString(" key" ).ifEmpty { buildActionEventKey(payload) }
184184 if (pendingActionEventKeys.contains(key)) {
185185 Logger .debug(
186- Logger .tags( " Notification " ) ,
186+ NOTIFICATION_LOG_TAGS ,
187187 " Skipping duplicate restored actionPerformed event key=$key "
188188 )
189189 continue
@@ -193,12 +193,12 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
193193 pendingActionEventKeys.add(key)
194194 }
195195 Logger .debug(
196- Logger .tags( " Notification " ) ,
196+ NOTIFICATION_LOG_TAGS ,
197197 " Restored pending actionPerformed events=${pendingActionEvents.size} "
198198 )
199199 } catch (error: Throwable ) {
200200 Logger .error(
201- Logger .tags( " Notification " ) ,
201+ NOTIFICATION_LOG_TAGS ,
202202 " Failed to restore pending actionPerformed events" ,
203203 error
204204 )
@@ -221,7 +221,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
221221
222222 super .load(webView)
223223 this .webView = webView
224- Logger .debug(Logger .tags( " Notification " ) , " Plugin load started" )
224+ Logger .debug(NOTIFICATION_LOG_TAGS , " Plugin load started" )
225225 synchronized(this ) {
226226 pendingActionEvents.clear()
227227 pendingActionEventKeys.clear()
@@ -241,7 +241,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
241241 this .manager = manager
242242
243243 notificationManager = activity.getSystemService(Context .NOTIFICATION_SERVICE ) as NotificationManager
244- Logger .debug(Logger .tags( " Notification " ) , " Plugin load complete; awaiting notification intents" )
244+ Logger .debug(NOTIFICATION_LOG_TAGS , " Plugin load complete; awaiting notification intents" )
245245
246246 val intent = activity.intent
247247 intent?.let {
@@ -251,21 +251,21 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
251251
252252 override fun onNewIntent (intent : Intent ) {
253253 super .onNewIntent(intent)
254- Logger .debug(Logger .tags( " Notification " ) , " onNewIntent received action=${intent.action} " )
254+ Logger .debug(NOTIFICATION_LOG_TAGS , " onNewIntent received action=${intent.action} " )
255255 onIntent(intent)
256256 }
257257
258258 fun onIntent (intent : Intent ) {
259259 if (Intent .ACTION_MAIN != intent.action) {
260- Logger .debug(Logger .tags( " Notification " ) , " Ignoring intent action=${intent.action} " )
260+ Logger .debug(NOTIFICATION_LOG_TAGS , " Ignoring intent action=${intent.action} " )
261261 return
262262 }
263- Logger .debug(Logger .tags( " Notification " ) , " Processing ACTION_MAIN intent for notification action" )
263+ Logger .debug(NOTIFICATION_LOG_TAGS , " Processing ACTION_MAIN intent for notification action" )
264264 val dataJson = manager.handleNotificationActionPerformed(intent, notificationStorage)
265265 if (dataJson != null ) {
266266 dispatchActionPerformed(dataJson)
267267 } else {
268- Logger .debug(Logger .tags( " Notification " ) , " No action payload extracted from intent" )
268+ Logger .debug(NOTIFICATION_LOG_TAGS , " No action payload extracted from intent" )
269269 }
270270 }
271271
@@ -277,7 +277,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
277277 // Without this key check, the same action can be enqueued twice across reload boundaries.
278278 if (pendingActionEventKeys.contains(key)) {
279279 Logger .debug(
280- Logger .tags( " Notification " ) ,
280+ NOTIFICATION_LOG_TAGS ,
281281 " Skipping duplicate queued actionPerformed event key=$key "
282282 )
283283 return
@@ -286,21 +286,21 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
286286 pendingActionEventKeys.add(key)
287287 persistPendingActionEventsLocked()
288288 Logger .debug(
289- Logger .tags( " Notification " ) ,
289+ NOTIFICATION_LOG_TAGS ,
290290 " Queued actionPerformed event; listener not ready (pending=${pendingActionEvents.size} )"
291291 )
292292 return
293293 }
294294 }
295- Logger .debug(Logger .tags( " Notification " ) , " Dispatching actionPerformed event immediately" )
295+ Logger .debug(NOTIFICATION_LOG_TAGS , " Dispatching actionPerformed event immediately" )
296296 trigger(" actionPerformed" , payload)
297297 }
298298
299299 @Command
300300 fun show (invoke : Invoke ) {
301301 val notification = invoke.parseArgs(Notification ::class .java)
302302 Logger .debug(
303- Logger .tags( " Notification " ) ,
303+ NOTIFICATION_LOG_TAGS ,
304304 " show called id=${notification.id} title=${notification.title} actionTypeId=${notification.actionTypeId} hasSchedule=${notification.schedule != null } "
305305 )
306306 val id = manager.schedule(notification)
@@ -312,29 +312,29 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
312312 fun batch (invoke : Invoke ) {
313313 val args = invoke.parseArgs(BatchArgs ::class .java)
314314 Logger .debug(
315- Logger .tags( " Notification " ) ,
315+ NOTIFICATION_LOG_TAGS ,
316316 " batch called notifications=${args.notifications.size} "
317317 )
318318
319319 val ids = manager.schedule(args.notifications)
320320 notificationStorage.appendNotifications(args.notifications)
321- Logger .debug(Logger .tags( " Notification " ) , " batch scheduled ids=$ids " )
321+ Logger .debug(NOTIFICATION_LOG_TAGS , " batch scheduled ids=$ids " )
322322
323323 invoke.resolveObject(ids)
324324 }
325325
326326 @Command
327327 fun cancel (invoke : Invoke ) {
328328 val args = invoke.parseArgs(CancelArgs ::class .java)
329- Logger .debug(Logger .tags( " Notification " ) , " cancel called notifications=${args.notifications} " )
329+ Logger .debug(NOTIFICATION_LOG_TAGS , " cancel called notifications=${args.notifications} " )
330330 manager.cancel(args.notifications)
331331 invoke.resolve()
332332 }
333333
334334 @Command
335335 fun removeActive (invoke : Invoke ) {
336336 val args = invoke.parseArgs(RemoveActiveArgs ::class .java)
337- Logger .debug(Logger .tags( " Notification " ) , " removeActive called notifications=${args.notifications.size} " )
337+ Logger .debug(NOTIFICATION_LOG_TAGS , " removeActive called notifications=${args.notifications.size} " )
338338
339339 if (args.notifications.isEmpty()) {
340340 notificationManager.cancelAll()
@@ -354,7 +354,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
354354 @Command
355355 fun getPending (invoke : Invoke ) {
356356 val notifications= notificationStorage.getSavedNotifications()
357- Logger .debug(Logger .tags( " Notification " ) , " getPending returning count=${notifications.size} " )
357+ Logger .debug(NOTIFICATION_LOG_TAGS , " getPending returning count=${notifications.size} " )
358358 val result = Notification .buildNotificationPendingList(notifications)
359359 invoke.resolveObject(result)
360360 }
@@ -363,7 +363,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
363363 fun registerActionTypes (invoke : Invoke ) {
364364 val args = invoke.parseArgs(RegisterActionTypesArgs ::class .java)
365365 Logger .debug(
366- Logger .tags( " Notification " ) ,
366+ NOTIFICATION_LOG_TAGS ,
367367 " registerActionTypes called types=${args.types.size} "
368368 )
369369 notificationStorage.writeActionGroup(args.types)
@@ -385,7 +385,7 @@ class NotificationPlugin(private val activity: Activity): Plugin(activity) {
385385 persistPendingActionEventsLocked()
386386 }
387387 Logger .debug(
388- Logger .tags( " Notification " ) ,
388+ NOTIFICATION_LOG_TAGS ,
389389 " Action listener marked ready; drained pending actionPerformed events=$drainedCount "
390390 )
391391 invoke.resolveObject(pending)
0 commit comments