Dear all,
I am not able to access RINGING_MODE_SILENT in my application it crashes my application. I am using android oreo 8.1 API level 27. Here is the log file
2019-01-18 14:42:58.818 5658-5658/com.example.user.speakercontrol E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.user.speakercontrol, PID: 5658
java.lang.SecurityException: Not allowed to change Do Not Disturb state
at android.os.Parcel.readException(Parcel.java:2013)
at android.os.Parcel.readException(Parcel.java:1959)
at android.media.IAudioService$Stub$Proxy.setRingerModeExternal(IAudioService.java:1127)
at android.media.AudioManager.setRingerMode(AudioManager.java:1007)
at com.example.user.speakercontrol.MainActivity$3.onClick(MainActivity.java:50)
at android.view.View.performClick(View.java:6300)
at android.view.View$PerformClick.run(View.java:24941)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
Please help me with this issue.
Thanks and Regards,
Thippeswamy H U
0 Answer(s)