Skip to content

Instantly share code, notes, and snippets.

@iscle
Created June 17, 2018 10:45
Show Gist options
  • Save iscle/a9f58c75f4cd25f86ec1218b19a0c59b to your computer and use it in GitHub Desktop.
Save iscle/a9f58c75f4cd25f86ec1218b19a0c59b to your computer and use it in GitHub Desktop.
if (isChecked) {
try {
Runtime.getRuntime().exec("su -c echo 1 > /sys/bus/i2c/devices/3-0038/wakeup_mode");
editor.putBoolean("dt2w_toggle", true).apply();
} catch (IOException e) {
e.printStackTrace();
}
} else {
try {
Runtime.getRuntime().exec("su -c echo 0 > /sys/bus/i2c/devices/3-0038/wakeup_mode");
editor.putBoolean("dt2w_toggle", false).apply();
} catch (IOException e) {
e.printStackTrace();
}
}
editor.commit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment