2

Where are per-app per-notification preferences (the kind, sound, vibration, etc. settings for each type of notification for each app) stored on Android?

I'd like to back them up to be able to restore them later. (I have root permissions.)

If there's already an app for doing this, I'd appreciate knowing about that as well.

7
  • 1
    /data/system/notification_policy.xml. But this cannot be backed up / restored by simply copying the file. Per app notification settings are set through channels which are generated on app installation (or on a notification of new category) with random IDs. Sep 8, 2020 at 0:29
  • @IrfanLatif: Thank you! It seems like I should be able to just write a script (or even sed) to modify the bits I'm interested in regardless of the ID, right? Do you know if changes become visible immediately by just modifying the file, or if they require some kind of signaling to the system?
    – user541686
    Sep 8, 2020 at 0:42
  • I didn't try but changing configuration files never immediately reflects in apps because system_server caches everything on boot and app launch. Killing the app immediately after modifying the file may work, or a reboot might be needed before the file is overwritten by OS. Also, modifying files directly (and not going through proper APIs) usually doesn't work (at least in first attempt). If some piece of configuration is saved somewhere else, you are highly likely to break some functionality or settings may reset back. You might need to go through hit and trial before success. Sep 8, 2020 at 6:22
  • 1
    Very interesting question, every time I reinstall the OS it takes a lot of time to remember and re-apply the notification settings (e.g. custom sounds for different callers). Why it's not possible to backup & restore them
    – virtualdj
    Jun 13, 2021 at 13:20
  • 1
    Agreed, why is this not backed up as part of Android's Google Backup? Considering how complex and customisable notification settings have become recently (with per-app notification categories, which finally allow me to turn off focus-sucking promotional notifications from 100s of apps, and with Conversations), this range of customizations needs to be possible to backup and restore, otherwise all the user's hard work is wasted every time your device dies or is replaced.
    – awreccan
    Aug 7, 2022 at 5:48

0

You must log in to answer this question.

Browse other questions tagged .