mercredi 6 juillet 2016

How to turn off the capacitive buttons light on Samsung devices programmatically?

I need to turn off the capacitive buttons light in my app.

I found this popular implementation

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

Sadly, I get this exception on more recent Samsung devices

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

Is there a known way to implement something like this?

I have found this app and it seems to work fine with even the most recent devices, so I tried to decompile it and could only find the same line of code I mentioned above, which I really don't understand. Maybe the decompilation process changed a saved String in the system to "button_key_light"?

Maybe it's because of more recent build tools?

So does anyone have a known way of getting it to work? Or at least an explanation for why my current code doesn't work?

Aucun commentaire:

Enregistrer un commentaire