Use of the SystemProperties property

First need to be added in system.prop

persist.sys.camera_switch=1

After that, it will take effect in the build.prop under out after make, or export the build.prop when debugging, add it manually, and then push in to replace it, adb shell chmod -R 644 system/build.prop push every time After one time, you need to run this command, otherwise it will not be able to boot

Then the code is called as

import android.os.SystemProperties;

SystemProperties.set("persist.sys.camera_switch","1"); The characters cannot exceed 31, otherwise an error will be reported
String getState=SystemProperties.get("persist.sys.camera_switch");

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324449250&siteId=291194637