c19354837/react-native-system-setting

Not allowed to change Do Not Disturb state

azanli opened this issue · 4 comments

Attempting to setVolume either to 0 or from 0 throws the following error:

Not allowed to change Do Not Disturb state`

Remote stack trace:
at
com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1905)
at
com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1847)
at
android.media.IAudioService$Stub.onTransaction(IAudioService.java:139)
at android.os.Binder.execTransact(Binder.java:731)

I have added this use-permission to my AndroidManifest as well as the library's to no avail:
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />

Environment:
OS: macOS Sierra 10.12.6
Node: 6.11.0
Yarn: 1.7.0
npm: 5.3.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: ~0.55.2 => 0.55.4

Thanks for your feedback!

Can you give me your phone info?

Google Pixel 2 XL
Android Version 9

It looks like there needs to be a permission request for notification activity? This didn't happen to me on my Samsung S6 Edge Plus running Android version 5.

V 1.5.2 is available.

I cannot reproduced it in Android 7. While I find this.

Hope you can test this version and tell me the result 😊.

You still need declare the <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /> in AndroidManifest.xml

how can i set Phone Ring and Call silent using React native on button click