← Back to home

🔕 Notification Filtering System

Block all notifications except essential messaging apps

Overview

The Notification Filtering System blocks ALL notifications from all apps by default, allowing only essential communication apps (SMS, WhatsApp, Email) to show notifications. This eliminates distractions from social media, games, and other non-essential apps.

🎯 Key Principle: Zero distractions. Only critical communications get through. Everything else is silently blocked.

How It Works

  1. Notification Posted - Android system posts notification from any app
  2. Service Intercepts - NotificationFilterService intercepts the notification
  3. Package Check - Checks if app package is in allowed whitelist
  4. Decision Made - If NOT in whitelist → Cancel immediately
  5. Silent Block - Notification is removed before user sees it
  6. Essential Pass Through - SMS/WhatsApp/Email notifications show normally

Allowed Apps (Whitelist)

Only these apps can show notifications:

📱 SMS/Text Messaging

Package Name App Name Status
com.android.mms Stock Messaging ALLOWED
com.android.messaging Android Messages ALLOWED
com.google.android.apps.messaging Google Messages ALLOWED
com.samsung.android.messaging Samsung Messages ALLOWED

💬 WhatsApp

Package Name App Name Status
com.whatsapp WhatsApp ALLOWED
com.whatsapp.w4b WhatsApp Business ALLOWED

📧 Email Clients

Package Name App Name Status
com.google.android.gm Gmail ALLOWED
com.microsoft.office.outlook Outlook ALLOWED
com.samsung.android.email.provider Samsung Email ALLOWED
com.android.email Stock Email ALLOWED
com.yahoo.mobile.client.android.mail Yahoo Mail ALLOWED

💬 Optional Messaging (Contact Support to Add)

Telegram, Signal, and other messaging apps are not in the default whitelist. If you need notifications from these apps, contact support and we can add them to your custom allowlist.

Package Name App Name Status
org.telegram.messenger Telegram OPTIONAL (on request)
org.thoughtcrime.securesms Signal OPTIONAL (on request)

Blocked Apps (Everything Else)

ALL other apps are blocked from showing notifications, including:

⚠️ Setup Required: You must manually enable "GhostFirewall Notification Filter" in Settings → Notification Access. Android requires user permission for notification listening.

Enabling Notification Filter

Step 1: Open Settings

Settings → Apps → Special Access → Notification Access

Step 2: Find GhostFirewall

Scroll down and find "GhostFirewall Notification Filter"

Step 3: Toggle ON

Enable the toggle switch. Accept the permission warning.

Step 4: Verify

# Check Android logs adb logcat -s "NotificationFilter:I" # Expected output: NotificationFilter: NotificationFilterService started - filtering: true NotificationFilter: Blocked notification from: com.facebook.katana NotificationFilter: Allowed notification from: com.whatsapp

Benefits

🧠 Mental Health

🔋 Battery Life

📊 Productivity

Technical Implementation

Architecture

NotificationFilterService extends NotificationListenerService → Android system calls onNotificationPosted() → Service checks package against ALLOWED_PACKAGES → If not in list: cancelNotification(key) → If in list: Allow to show

Key Methods

onNotificationPosted(StatusBarNotification sbn) - Called when ANY notification is posted - Package name extracted: sbn.packageName - Whitelist checked: ALLOWED_PACKAGES.contains() - Block decision made: cancelNotification() cancelNotification(String key) - Immediately removes notification - User never sees it - Silent blocking (no indication)

Configuration

Notification filtering can be enabled or disabled from the app settings. Changes take effect immediately.

Customization (Future)

Planned features for future updates:

Testing the Filter

Test 1: Blocked App

  1. Open Facebook/Instagram/any game
  2. Generate a notification (like, comment, friend request)
  3. Notification should NOT appear
  4. Check logs: "Blocked notification from: [package]"

Test 2: Allowed App

  1. Send yourself a WhatsApp message or SMS
  2. Notification SHOULD appear normally
  3. Check logs: "Allowed notification from: com.whatsapp"

Test 3: Verify Service Running

# Check if service is enabled adb shell settings get secure enabled_notification_listeners # Should contain: com.ghostfirewall.personal/...NotificationFilterService

Performance Impact

Privacy & Security

💡 Pro Tip: If you need temporary notifications from a blocked app, disable the filter in GhostFirewall settings, receive the notification, then re-enable.

Troubleshooting

Filter Not Working

Essential Notifications Blocked