package sto.android.app.manager;

public class SetRegisterManager {

    private SetRegisterManager() {
    }

    public static void setRegister() {

        for (int i = 0; i < 3; i++) {
            ShellExe.getInfo("echo 22c ffcc > /sys/devices/platform/mt-pmic/pmic_access");
            if (getRegisterStatus()) {
                break;
            }
        }

    }

    private static boolean getRegisterStatus() {
        String cmd = "echo 22c >    /sys/devices/platform/mt-pmic/pmic_access";
        ShellExe.getInfo(cmd);
        cmd = "cat /sys/devices/platform/mt-pmic/pmic_access";
        String out = ShellExe.getInfo(cmd).trim();
        if (!"65484".equals(out)) {
            return false;
        }
        return true;
    }
}