Unable to execute putInt

Hi, this is not a direct problem with the Galaxy Camera.

I use a Galaxy device made in Japan and many people want to turn off the shutter sound.
So I created an app called Galaxy CamSnd that turns off the shutter sound.
In my app, do the following:

Settings.System.putInt(getContentResolver(), "csc_pref_camera_forced_shuttersound_key", 0);

Here’s the big problem:


The conclusion of the problem I want to convey is that you can’t turn off the shutter sound with just the app on your device, without using ADB.

One UI 6.0 has been upgraded to Android version 14 (34).
This is a very good thing.
And for security reasons, third-party apps with a targetSdkVersion of 22 or less can no longer be installed unless they are via a shell such as ADB.

If you look at the source code of my app, you’ll see that the targetSdk is 22.
This is because if you set targetSdk to M(23) or higher, your app won’t work properly.

The content of this crash is an IllegalArgumentException:

java.lang.IllegalArgumentException: You cannot keep your settings in the secure settings.

In apps with targetSdk is 23 or higher, can putInt() no longer be used?
Or is it just my implementation mistake?


If, as I mentioned earlier, putInt() cannot be used, I would like the Japan version of the device to allow the user to adjust the shutter sound arbitrarily.

Your Japanese variant of the Samsung Phone probably does not allow the shutter notification to be turned off. My research shows this is an industry agreement to prevent camera phones from being used in ways offensive to public morals.

Ron
Samsung Developer Relations

Yes, that’s exactly right.


So, could you tell me about the problem that prevents putInt() etc. from being executed?

It probably is in the OS Variation. Did you try to just turn the sound volume for it to zero or next to nothing?

Ron
Samsung Developer Relations

The sound volume cannot be easily adjusted on the Japan edition of Galaxy. Therefore, it is necessary to improve my app.

My understanding is you cannot disable the Camera notification sound on any phone / camera sold in Japan no matter who the vendor is. You may get some help on an Android Camera discussion site.

Ron
Samsung Developer Relations