Hi everyone
I use this code to set the ringtone volume to the maximum value
Unfortunately, this error appears on Lg G6 ( SDK "26")
On the "19" SDK, the code worked well. This error only appears when the ringer is turned off. Can this blockade be bypassed?
I use this code to set the ringtone volume to the maximum value
B4X:
Dim p As Phone
' p.SetMute(p.VOLUME_RING,False)
p.SetVolume(p.VOLUME_RING, p.GetMaxVolume(p.VOLUME_RING), False)
Unfortunately, this error appears on Lg G6 ( SDK "26")
B4X:
Error occurred on line: 287 (Main)
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.setStreamVolume(IAudioService.java:1053)
at android.media.AudioManager.setStreamVolume(AudioManager.java:1130)
at android.media.AudioManagerEx.setStreamVolume(AudioManagerEx.java:396)
at anywheresoftware.b4a.phone.Phone.SetVolume(Phone.java:380)
at finder.finder.main._startalarm(main.java:1566)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6316)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
On the "19" SDK, the code worked well. This error only appears when the ringer is turned off. Can this blockade be bypassed?
Last edited: