/** * This method return the current activation status of CE * * @return boolean Must be false when CE is not supported or not activated, or the operation * failed while reading the status; true in any other case. */ public static boolean isEnabled() { try { return Integer.parseInt(FileUtils.readOneLine(FILE_CE)) > 0; } catch (Exception e) { Log.e(TAG, e.getMessage(), e); } return false; }
/** * This method allows to setup CE * * @param status The new CE status * @return boolean Must be false if CE is not supported or the operation failed; true in any other * case. */ public static boolean setEnabled(boolean status) { return FileUtils.writeLine(FILE_CE, status ? "1" : "0"); }