设置Systemproperties值
执行 adb 命令即可
例如:adb shell setprop persist.com.caic.virtualassistant.vpa.displayid 1
获取Systemproperties值
public static final String PROPERTIES_KEY = "persist.com.caic.virtualassistant.vpa.displayid";
public static String getConfigDisplayId() {
String property = getProperty(PROPERTIES_KEY,"0");
return property;
}
public static String getProperty(String key, String defaultValue) {
String value = defaultValue;
try {
Class<?> aClass = Class.forName("android.os.SystemProperties");
Method get = aClass.getMethod("get", String.class, String.class);
value = (String) get.invoke(aClass, key, defaultValue);
} catch (Exception e) {
e.printStackTrace();
} finally {
return value;
}
}