java.lang.SecurityException

Not allowed to change Do Not Disturb state

Samebug tips5

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()


rafaelrafael

You need the permission android.permission.READ_EXTERNAL_STORAGE. Write <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> on the Android Manifest


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web1297

  • via GitHub by adrcotfas
    ,
  • Stack trace

    • java.lang.SecurityException: Not allowed to change Do Not Disturb state at android.os.Parcel.readException(Parcel.java:1683) at android.os.Parcel.readException(Parcel.java:1636) at android.media.IAudioService$Stub$Proxy.setRingerModeExternal(IAudioService.java:962) at android.media.AudioManager.setRingerMode(AudioManager.java:1022) at controllers.SearchResultController.mutePhone(SearchResultController.java:185)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown UserUnknown User
    14 times, last one
    PierrePierre
    3 times, last one
    Hiren AmaliyarHiren Amaliyar
    669 times, last one
    filipebatistafilipebatista
    48 times, last one
    SacchiSacchi
    138 times, last one
    232 more bugmates