Skip to content

Commit

Permalink
replace continue w/ return from block
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Aug 19, 2024
1 parent c95f33f commit c987419
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ class NotificationProcessor @Inject constructor(

if (persistedNotifDao.getDuplicates(sbn.key, sbn.packageName, title, text).isNotEmpty()) {
Timber.d("Ignoring duplicate notification ${sbn.key}")
continue
return@withTimeout
}
val resolvedPackage = sbn.queryPackage(context)
if (resolvedPackage == null) {
Timber.d("Ignoring system/unknown notification ${sbn.key}")
continue
return@withTimeout
}
persistedNotifDao.insert(PersistedNotification(
sbn.key, sbn.packageName, sbn.postTime, title, text, sbn.groupKey
Expand All @@ -198,7 +198,7 @@ class NotificationProcessor @Inject constructor(
// Channel should be added to db before this point, by listener
if (!shouldNotify(sbn.packageName, sbn.notification.channelId)) {
Timber.v("Ignoring notification from muted channel/package ${sbn.key}")
continue
return@withTimeout
}

val itemId = uuidFrom(NotificationActionHandler.notificationUuidPrefix + (uuid4().toString()).substring(NotificationActionHandler.notificationUuidPrefix.length))
Expand Down

0 comments on commit c987419

Please sign in to comment.