1

This might seem weird, but I installed a regular Android app using ADB to my Huawei Watch 2 and the app requires notification access which when attempting in app causes it to crash as it trys to open the settings to allow it's access which doesn't exist in the settings.

I just need to grant this one permission in order to get the app to work

2
  • found any solution? (sorry for answer, and not comment, but I have less than 50 reputation :P )
    – Mirco
    Commented Dec 27, 2017 at 12:44
  • @mirco no I have not
    – DanHolli
    Commented Dec 28, 2017 at 1:08

2 Answers 2

5

For Android 9 or above use this:

adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener

For any other Android version below 9 use this:

adb shell settings put secure enabled_notification_listeners %nlisteners: com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept
1
  • How does one figure out the necessary listener for the app? Commented Jul 11, 2021 at 22:40
1

adb shell into your device and do

cmd appops set package.name PERMISSION_NAME {allow/ignore}

Edit: I don' think this will work with notification access. Anyway, the command for changing system settings is

adb shell settings put setting_name value

But I cannot find any setting name corresponding to notification access. You can take a look all the available settings here

Other alternative if you are rooted is to extract the settings.db where all the preferences are store, modify it there using sqlite and reboot.

1
  • Thanks for trying to help, but I need the permission name
    – DanHolli
    Commented Dec 28, 2017 at 2:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .