diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d46636d..77ee81f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -103,6 +103,15 @@
+
+
+
+
+
"userId/packageName". Keyed to dedupe updates. */
+ private val keyToPackage = HashMap()
+
+ override fun onListenerConnected() {
+ super.onListenerConnected()
+ synchronized(keyToPackage) {
+ keyToPackage.clear()
+ activeNotifications.forEach { sbn ->
+ if (isCounted(sbn)) keyToPackage[sbn.key] = userIdKey(sbn)
+ }
+ publish()
+ }
+ }
+
+ override fun onNotificationPosted(sbn: StatusBarNotification) {
+ if (!isCounted(sbn)) return
+ synchronized(keyToPackage) {
+ // A posted notification with an existing key is just an update.
+ if (keyToPackage.containsKey(sbn.key)) return
+ keyToPackage[sbn.key] = userIdKey(sbn)
+ publish()
+ }
+ }
+
+ override fun onNotificationRemoved(sbn: StatusBarNotification) {
+ synchronized(keyToPackage) {
+ if (keyToPackage.remove(sbn.key) != null) publish()
+ }
+ }
+
+ /** Only swipe-away, non-ongoing notifications get a dot. */
+ private fun isCounted(sbn: StatusBarNotification): Boolean {
+ val notification = sbn.notification
+ if (!sbn.isClearable) return false
+ if (notification.flags and Notification.FLAG_ONGOING_EVENT != 0) return false
+ return true
+ }
+
+ private fun userIdKey(sbn: StatusBarNotification) =
+ "${sbn.userId}/" + sbn.packageName
+
+ private fun publish() {
+ val counts = HashMap()
+ keyToPackage.values.forEach { key ->
+ counts[key] = (counts[key] ?: 0) + 1
+ }
+ notificationCounts.value = counts
+ }
+
+ companion object {
+ /** Active notification count per app, keyed by "userId/packageName". */
+ val notificationCounts: MutableStateFlow
Lock Settings
Disable Animations
+ Notification Dots
+ Cannot open notification access settings.
Size
Color
@@ -200,6 +202,7 @@
Disable
Easy Launcher Actions Service
+ Easy Launcher - notification dots
Please turn on accessibility service to use double tap to lock feature in Easy Launcher.\n\nThis permission is used only to turn off your screen. Our
accessibility service does not collect or share any data.