java.lang.SecurityException: Not allowed to change Do Not Disturb state

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Android SDK 23 introduced a new way to handle permissions, so as a temporary workaround you can set it to build for SDK below 23. As a permanent solution you have to ask user during runtime for permissions with checkSelfPermission() or requestPermissions()

,
Expert tip

MANAGE_USERS has a protection level of signature|system, so your application must be signed with the platform key. Take a look on this https://goo.gl/nXsTvH for more information about it.

Solutions on the web

via GitHub by pfent
, 1 year ago
Not allowed to change Do Not Disturb state
via GitHub by kordianbruck
, 2 months ago
Not allowed to change Do Not Disturb state
via xda-developers.com by Unknown author, 1 year ago
Caller uid=2000 is not privileged to communicate w th user=-2
via Stack Overflow by Virat Puar
, 2 years ago
Sending SMS message: uid 10058 does not have android.permission.SEND_SMS.
java.lang.SecurityException: Not allowed to change Do Not Disturb state
at android.os.Parcel.readException(Parcel.java:1666)
at android.os.Parcel.readException(Parcel.java:1619)
at android.media.IAudioService$Stub$Proxy.setRingerModeExternal(IAudioService.java:962)
at android.media.AudioManager.setRingerMode(AudioManager.java:1022)
at de.tum.in.tumcampusapp.services.SilenceService.onHandleIntent(SilenceService.java:101)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 23 hours ago
Samebug visitor profile picture
Unknown user
Once, 2 days ago
2 times, 2 days ago
Samebug visitor profile picture
Unknown user
Once, 2 days ago
Samebug visitor profile picture
Unknown user
Once, 3 days ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.