Wednesday, October 5, 2016

How to reset a Android API constant to it's default value

This was tested on a Galaxy S7 on Android 6 (Marshmallow), but should work on most Android versions that are not many many years old!

If you have accidentally changed a setting constant from the Android API you can reset it to NULL (not a string)
For example if you have changed the constant LOCATION_MODE_HIGH_ACCURACY using adb shell or just shell inside Android like this:

settings put secure location_mode_high_accuracy 5


You can reset it to NULL using this command:

settings delete secure location_mode_high_accuracy

Very handy if you play around with shell commands and accidentally change a constant to a invalid value!

No comments:

Post a Comment