I think I need this permission because the Error message says I need this permission when I call
in the OpenCamera function of CamEx2. The error also occurs in the Camera2 example. Works on the previous version of the Tera P166 device running Android 9 but not on the new device running Android 13.
Should I check with the manufacturer for this Java documentation? The full error message is:
Error occurred on line: 61 (CamEx2)
java.lang.SecurityException: com.bizmoblid was not granted this permission: android.permission.WRITE_SETTINGS.
at android.os.Parcel.createExceptionOrNull(Parcel.java:3011)
at android.os.Parcel.createException(Parcel.java:2995)
at android.os.Parcel.readException(Parcel.java:2978)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
at android.provider.Settings$NameValueCache.putStringForUser(Settings.java:3012)
at android.provider.Settings$System.putStringForUser(Settings.java:3817)
at android.provider.Settings$System.putStringForUser(Settings.java:3800)
at android.provider.Settings$System.putStringForUser(Settings.java:3794)
at android.provider.Settings$System.putIntForUser(Settings.java:3918)
at android.provider.Settings$System.putInt(Settings.java:3911)
at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:853)
at anywheresoftware.b4a.objects.Camera2.OpenCamera(Camera2.java:114)
at com.bizmoblid.camex2$ResumableSub_OpenCamera.resume(camex2.java:577)
at com.bizmoblid.camex2._opencamera(camex2.java:490)
at com.bizmoblid.frmidscan$ResumableSub_OpenCamera.resume(frmidscan.java:19432)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:475)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:293)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:150)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
Caused by: android.os.RemoteException: Remote stack trace:
at android.provider.Settings.isCallingPackageAllowedToPerformAppOpsProtectedOperation(Settings.java:18660)
at android.provider.Settings.checkAndNoteWriteSettingsOperation(Settings.java:18548)
at com.android.providers.settings.SettingsProvider.mutateSystemSetting(SettingsProvider.java:1890)
at com.android.providers.settings.SettingsProvider.insertSystemSetting(SettingsProvider.java:1856)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:468)
If I try your suggestion in this post:
https://www.b4x.com/android/forum/threads/permission-write_settings.94311/ I get the Modify System Settings screen
and can toggle the setting to On but then the error message changes to:
Error occurred on line: 61 (CamEx2)
java.lang.IllegalArgumentException: You cannot keep your settings in the secure settings.
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
at android.provider.Settings$NameValueCache.putStringForUser(Settings.java:3012)
at android.provider.Settings$System.putStringForUser(Settings.java:3817)
at android.provider.Settings$System.putStringForUser(Settings.java:3800)
at android.provider.Settings$System.putStringForUser(Settings.java:3794)
at android.provider.Settings$System.putIntForUser(Settings.java:3918)
at android.provider.Settings$System.putInt(Settings.java:3911)
at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:853)
at anywheresoftware.b4a.objects.Camera2.OpenCamera(Camera2.java:114)
at com.bizmoblid.camex2$ResumableSub_OpenCamera.resume(camex2.java:577)
at com.bizmoblid.camex2._opencamera(camex2.java:490)
at com.bizmoblid.frmidscan$ResumableSub_OpenCamera.resume(frmidscan.java:19432)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:475)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:293)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:150)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
Not sure what else I can do to make the camera work on this device.