Modern mobile operating systems, including Android 10, function as complex ecosystems, where every user or system action is recorded in special logs. Users are often faced with a situation where an important message from a bank or instant messenger was accidentally brushed off, and there is an urgent need to restore its content. Understanding where this data is physically and logically stored allows you not only to return lost information, but also to conduct in-depth diagnostics of the device.

Unlike previous versions, the tenth version of the OS has made significant changes to the structure of access to system files and application rights. The standard file path is now protected by stricter security protocols, making it more difficult for the average user to directly access the notification database without the use of special debugging tools. However, the system continues to maintain a detailed event log, which is available through standard tools or using ADB commands.

In this article we will analyze in detail the architectural features of storing alerts in Android 10, consider specific file paths and methods for retrieving data. You will learn how to access hidden sections of the system, what utilities can help in reading encrypted databases, and how to prevent the loss of important information in the future by setting up the correct logging settings.

The architecture of storing system logs in Android 10

Notifications are based on a service NotificationManagerServicethat is responsible for receiving and processing and displaying all incoming signals from applications. When an application makes a request to display a banner or sound, the system creates a notification object and places it in a queue. To permanently store this data, an internal SQLite database is used, which resides in a protected section of the device’s memory.

The main storage of notification history is located along the path /data/system/users/0/notification_history.db. This file contains a table with timestamps, message text, application package name, and read status. However, starting from Android 10, access to the directory /data/system/ for third-party applications and file managers without root access is completely closed by the Scoped Storage policy.

⚠️ Attention: Direct editing of a file notification_history.db can lead to unstable operation of the interface and loss of all accumulated notifications. Work with this file in read-only mode or create a backup copy of it before any manipulations.

The system also duplicates critical events to the general system log logcat. This is a text stream that records in real time all processes occurring in the kernel and user space. Although logcat is not a persistent store (it is overwritten cyclically when the buffer overflows), it allows you to track the moment a notification appears with millisecond precision.

💡

For developers and advanced users: use the `adb logcat -s NotificationService` command to filter the data stream and track only notification events in real time.

Access to history through interface settings

Starting with version Android 10, Google has introduced a native “Notification History” feature, which eliminates the need for users to go into system files to view deleted messages. This feature may be disabled by default to save resources, so the first step should always be to check your privacy and notification settings.

To enable logging, you must go to Menu Settings → Notifications → Notification history. Once you turn the switch on, the system will start saving all incoming notifications, even if you swipe them. The interface provides a convenient list, sorted by time, where you can see the application icon, title and short text of the message.

  • 📱 The function saves notifications for the last 24 hours in the standard configuration, but some manufacturers' shells can extend this period.
  • 🔒 Access to history is protected by a screen lock: you will not be able to view old messages without entering a PIN code or fingerprint.
  • 📉 Enabling this option may slightly increase battery consumption due to the constant recording of data to the internal memory.

It is important to note that the content of notifications from applications marked as “Confidential” (for example, banking clients or instant messengers with encryption), may appear in the history in a truncated form or be completely hidden depending on the security settings of a particular application.

📊 Do you use the built-in notification history on Android?
Yes, it is very convenient
No, I immediately read messages
Didn't know about this feature
I prefer third-party applications

Technical paths to database files

For those who need programmatic access to raw data, it is necessary to understand the exact hierarchy of the file system. In Android 10 the directory structure remains the same for devices with root access, but the mechanisms for mounting partitions have become more complex. The main database file is located in the user segment of the system partition.

The full absolute path to the file is as follows:

/data/system/users/0/notification_history.db

Here the number 0 indicates the identifier of the main user. If additional profiles or guest modes are created on the device, data for them will be stored in folders with different IDs (for example, users/10). The file is in SQLite version 3 format and can be opened by any compatible database editor after copying to a computer.

File path Access type Required rights Data format
/data/system/users/0/ System Root / ADB Binary / DB
/data/misc/logd/ Logging Root / ADB Text log
/sdcard/Android/data/ User Without rights Application cache
/proc/last_kmsg Kernel Root Kernel dump

Copying a database file requires executing a command through an emulator terminal or an ADB shell with elevated privileges. Without obtaining superuser (root), direct reading of this directory is not possible due to SELinux restrictions and Unix permissions.

How to copy a database file via ADB?

Connect the device to the PC, enter the command `adb root` (works only on engineering firmware or emulators), then `adb pull /data/system/users/0/notification_history.db C:/backup/`. On regular devices, you will need an unlocked bootloader and custom recovery.

Data extraction via ADB and Logcat

The most secure and universal way to obtain information about notifications on devices without root access is to use a debug bridge Android Debug Bridge (ADB). This tool allows you to query the system for logs in real time or dump accumulated event buffers without violating the integrity of file systems.

The command adb logcat prints a stream of system messages. To filter only notifications, you can use grep-like filters directly in the command. However, it is worth remembering that the standard buffer main may not contain the full texts of old notifications if they have been supplanted by new entries.

To access the special notification buffer (if supported by the firmware), use the following instruction:

adb logcat -b events | grep notification

This command requests events from the buffer events, where system daemons record the appearance and disappearance of notifications. The output will contain the timestamp, application UID, and event type. To decode numeric event codes, you may need to access the source codes Android Framework.

⚠️ Warning: The `adb logcat` command outputs a huge amount of data. Be sure to redirect the output to a file (for example, `>log.txt`), otherwise the console may hang due to display buffer overflow.

If the device has been rebooted, the contents of the RAM buffer logcat are cleared. In this case, the only way to recover data is to access the file notification_history.dbwhich is saved on the media and survives a system reboot.

☑️ Preparing to work with ADB

Done: 0 / 4

Third-party monitoring applications

Since direct access to system files is limited, the market filled with applications that use legitimate APIs to intercept and save notifications. apps such as Notification History Log or NotifLogrun in the background and create their own database every time the system broadcasts a new alert.

Their operating principle is based on the accessibility service (Accessibility Service) or a special system permission to read notifications. They don't go into the protected section /data/system/, but intercept data at the moment of its transmission from the system to the status bar. This allows you to save even those messages that the user instantly deleted.

  • 🛡️ Applications require special permissions that give them access to all incoming messages, including verification codes.
  • 💾 Data is stored in clear text in the memory of the application itself, which simplifies export to CSV or TXT.
  • ⚡ Some utilities can take screenshots of notification banners for visual archiving.

The use of such solutions is a compromise between convenience and privacy. You trust a third-party developer with the entire flow of your personal correspondence and banking transactions. Always check the developer's reputation and privacy policy before installing such tools.

💡

Third-party apps are the only way to keep a detailed history of notifications on Android 10 without rooting, but they require careful control of security permissions.

Access issues and security restrictions

Q Android 10 Google has tightened its security policy by introducing strict restrictions on access to the file system. Even having root access does not guarantee instant access to all data, since the file encryption mechanism (FBE - File Based Encryption) binds decryption keys to the user's unlocking state.

The notification history file is encrypted with a key that becomes available only after the first entry of a pattern or password after turning on the device (Direct Boot mode is limited). This means that automatic backup scripts run before logging in will not be able to read the contents of the database.

In addition, some smartphone manufacturers (for example Xiaomi, Samsung) modify the standard file path or use proprietary log storage formats. In such cases, standard instructions may not work, and you will need to search for specific paths for a specific device model.

⚠️ Attention: Interfaces and system paths may differ depending on the firmware version and the manufacturer's shell. Always check the latest data for your specific model in the official documentation or on developer forums.

Attempts to forcefully change access rights to system folders through the terminal may lead to a “bootlap” (cyclic reboot) or triggering of protection mechanisms Knox (on Samsung devices), which will irreversibly block some device functions.

What to do if the file is damaged?

If the `notification_history.db` database is damaged, the system may stop displaying new notifications. Solution: delete the damaged file (after making a backup) and reboot the device. The system will create a new clean file, but the old history will be lost.

Frequently asked questions (FAQ)

Can notifications be restored after a factory reset?

No, when performing a factory reset (Factory Reset) section /data/ fully formatted. All files, including notification_history.db and application logs, are permanently deleted. Restoration is only possible from a full system backup (Nandroid backup), made in advance through custom recovery.

Why are there no messages from WhatsApp or Telegram in the notification history?

Many instant messengers use their own high-priority notification channels or encrypt the content before display. In addition, users may accidentally disable history saving for specific applications in Settings Settings → Notifications → Notification history. Check whether the checkbox next to the desired application is checked.

Does the notification history file take up a lot of space on the phone?

Usually the file notification_history.db occupies no more than a few megabytes even with active use for months. The system automatically manages the size of the database, deleting the oldest records when the limit is reached. However, when installing third-party loggers with the function of saving images, the amount of space occupied may increase significantly.

How to view notifications on the locked screen if they have disappeared?

If the “Notification History” function was enabled before deletion, you can unlock the device, go to settings and view the list there. The lock screen itself shows only active, non-dismissed notifications. Alerts removed from the lock screen are only available through the deep system settings menu.

Is it safe to give access to notifications to third-party apps?

This carries certain risks. An application with this access can read two-factor authentication codes, personal messages and notifications from banks. Use only proven open source utilities or from well-known developers, and revoke permission immediately after completing the required task.