Privacy Tools Guide

Android notifications provide convenient real-time updates, but they can expose sensitive information when your device sits on a desk or nightstand. Whether it’s banking alerts, private messages, or authentication codes, lock screen notifications represent a significant privacy vulnerability. This guide covers practical methods for controlling what appears on your lock screen—from system settings configurations to programmatic implementations for developers building privacy-conscious applications.

Understanding Android Lock Screen Notification Controls

Android provides multiple layers of notification control, each serving different use cases. Understanding these layers helps you implement the right solution for your privacy requirements.

System Settings Configuration

The most straightforward approach uses Android’s built-in notification privacy settings. Navigate to Settings > Notifications > Notifications on lock screen (or Settings > Security & Privacy > Lock screen messages on newer Android versions). You have three primary options:

For individual app control, long-press any notification and select “Manage notifications” or navigate to Settings > Apps > [App] > Notifications > Additional settings in the lock screen. This granular control lets you hide content from specific apps while keeping others visible.

Conversation-Specific Privacy

Android 12+ introduced conversation-specific notification settings. Access Settings > Notifications > Conversations to prioritize contacts or set specific privacy levels. You can designate conversations as “Silent” (no sound or vibration) or configure them to show as “Bubbles” that offer more controlled visibility.

Programmatic Implementation for Developers

Developers building Android applications should implement proper notification privacy controls. The Notification.Builder class provides methods for controlling lock screen visibility.

Setting Notification Visibility

The setVisibility() method controls how much content appears on the lock screen:

Notification notification = new Notification.Builder(context, channelId)
    .setSmallIcon(R.drawable.ic_notification)
    .setContentTitle("Banking Alert")
    .setContentText("Your account balance is $12,450.00")
    .setVisibility(Notification.VISIBILITY_PRIVATE)
    .setPublicVersion(new Notification.Builder(context, channelId)
        .setSmallIcon(R.drawable.ic_notification)
        .setContentTitle("New Notification")
        .setVisibility(Notification.VISIBILITY_PUBLIC)
        .build())
    .build();

This pattern shows a generic notification on the lock screen while revealing the actual content only after device unlock. The VISIBILITY_PRIVATE constant ensures the full notification is hidden, while the public version provides a suitable replacement.

Visibility Constants Reference

Android defines four visibility levels:

For sensitive applications like banking or healthcare apps, always use VISIBILITY_PRIVATE or provide a public alternative version.

Implementing NotificationListenerService

For users wanting system-wide notification control, implementing a custom NotificationListenerService provides powerful filtering capabilities:

public class NotificationPrivacyService extends NotificationListenerService {

    @Override
    public void onNotificationPosted(StatusBarNotification sbn) {
        PackageName packageName = sbn.getPackageName();

        // Define packages requiring privacy
        Set<String> sensitivePackages = Set.of(
            "com.whatsapp",
            "com.facebook.katana",
            "com.google.android.apps.tachyon",
            "com.android.bankapp"
        );

        if (sensitivePackages.contains(packageName)) {
            // Cancel the original notification
            cancelNotification(sbn.getKey());

            // Optionally post a privacy-preserving version
            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
                NotificationChannel channel = new NotificationChannel(
                    "privacy_channel",
                    "Private Notifications",
                    NotificationManager.IMPORTANCE_DEFAULT
                );

                Notification privacyNotification = new Notification.Builder(this, channel.getId())
                    .setSmallIcon(R.drawable.ic_lock)
                    .setContentTitle("New Message")
                    .setContentText("Tap to view")
                    .setVisibility(Notification.VISIBILITY_PUBLIC)
                    .build();

                NotificationManager nm = getSystemService(NotificationManager.class);
                nm.notify(1001, privacyNotification);
            }
        }
    }

    @Override
    public void onNotificationRemoved(StatusBarNotification sbn) {
        // Handle notification removal if needed
    }
}

Register this service in your AndroidManifest.xml:

<service
    android:name=".NotificationPrivacyService"
    android:exported="false"
    android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
    <intent-filter>
        <action android:name="android.service.notification.NotificationListenerService" />
    </intent-filter>
</service>

Users must grant notification access in Settings > Apps > Special app access > Notification access after installation.

Using ADB for Lock Screen Configuration

Power users can configure notification privacy via Android Debug Bridge commands:

# Check current notification settings for an app
adb shell settings get secure lock_screen_allow_private_notifications

# Enable private notifications (hides content)
adb shell settings put secure lock_screen_allow_private_notifications 0

# View notification dot settings
adb shell settings get secure notification_dots_restricted

# Disable notification dots on lock screen
adb shell settings put secure notification_dots_restricted 1

For app-specific lock screen control:

# Get current notification settings for specific package
adb shell cmd notification get_policy package com.example.app

# Set notification policy (0=allow, 1=show icon only, 2=hide all)
adb shell cmd notification set_policy package com.example.app 1

Enterprise and MDN Solutions

For organizations managing fleet devices, Android’s Device Owner (MDM/MDN) capabilities provide centralized notification control:

DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName adminComponent = new ComponentName(context, DeviceAdminReceiver.class);

// Set notification listener policy
dpm.setNotificationListenerAccessGranted(adminComponent, packageName, true);

// Configure lock screen display
dpm.setLockScreenDisabled(adminComponent, false);

// Control app notifications at enterprise level
dpm.setApplicationHidden(adminComponent, packageName, false);

These APIs enable IT administrators to enforce privacy policies across managed devices, ensuring sensitive enterprise data never appears on lock screens.

Practical Privacy Recommendations

Implementing effective lock screen privacy requires a layered approach:

  1. Enable “Sensitive” notification privacy Go to Settings and hide sensitive content when locked—this affects all apps uniformly
  2. Review app-specific permissions Check which apps can show notifications on the lock screen monthly
  3. Use conversation controls Set messaging apps to show sender but hide content
  4. Consider notification dots Disable dots for sensitive apps to prevent visual exposure
  5. Test your configuration Lock your device and walk around to verify what remains visible

Third-Party Privacy Apps

Several applications in the Google Play Store provide enhanced notification privacy features. These apps typically require notification listener access and offer features like:

When selecting third-party solutions, verify the app’s privacy policy and ensure it doesn’t exfiltrate notification data.

Built by theluckystrike — More at zovo.one