本文整理匯總了Java中com.stericson.RootTools.RootTools.exists方法的典型用法代碼示例。如果您正苦於以下問題:Java RootTools.exists方法的具體用法?Java RootTools.exists怎麽用?Java RootTools.exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.stericson.RootTools.RootTools
的用法示例。
在下文中一共展示了RootTools.exists方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: clean
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
@Override
public void clean() throws IOException
{
if (!RootTools.exists(getDatabaseFile()))
{
return;
}
RootDatabase db = new RootDatabase(getDatabaseFile(), Globals.getRootShell());
for (DatabaseTest precondition : cleanPreconditions)
{
if (!precondition.passes(db))
{
throw new IOException("Precondition failed");
}
}
DBHelper.updateDatabase(getDatabaseFile(), cleanQueries);
}
示例2: getSavedData
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
@Override
public List<String[]> getSavedData()
{
if (!RootTools.exists("/data/data/com.android.providers.contacts/databases/contacts2.db"))
{
return new ArrayList<String[]>();
}
return DBHelper.queryDatabase
(
"/data/data/com.android.providers.contacts/databases/contacts2.db",
new String[] { "Name", "Times Contacted" },
"raw_contacts",
new String[] { "display_name", "times_contacted" },
"times_contacted>'0'"
);
}
示例3: clean
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
@Override
public void clean() throws IOException
{
if (!RootTools.exists("/data/data/com.android.providers.contacts/databases/contacts2.db"))
{
return;
}
DBHelper.updateDatabase
(
"/data/data/com.android.providers.contacts/databases/contacts2.db",
new String[]
{
"UPDATE contacts SET times_contacted='0';",
"UPDATE contacts SET last_time_contacted='0';",
"UPDATE raw_contacts SET times_contacted='0';",
"UPDATE raw_contacts SET last_time_contacted='0';",
"DELETE FROM data_usage_stat;"
}
);
}
示例4: getUVTable
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
protected String[] getUVTable() throws Exception {
output = "";
String tablePath = "";
String [] table = null;
if (RootTools.exists(uvTablePath)) {
tablePath = uvTablePath;
} else {
throw new Exception("Failed to find voltage table, unsupported kernel.");
}
output = getTable(tablePath);
output = output.replaceAll("[ ]", "");
table = output.split("[:;]+");
return table;
}
示例5: getVddTable
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
protected String[] getVddTable() throws Exception {
output = "";
String tablePath = "";
String [] table = null;
if (RootTools.exists(vddLevelsPath)) {
tablePath = vddLevelsPath;
} else {
throw new Exception("Failed to find voltage table, unsupported kernel.");
}
output = getTable(tablePath);
output = output.replaceAll("[ ]", "");
table = output.split("[:;]+");
return table;
}
示例6: isSupported
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
boolean pathsExist = ((RootTools.exists("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq")) &&
(RootTools.exists("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq")) &&
(RootTools.exists("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")) &&
(RootTools.exists("/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq")) &&
(RootTools.exists("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")) &&
(RootTools.exists("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies")));
if (pathsExist) {
try {
getAvaliableFrequencies(0);
return true;
} catch (Exception e) {
}
}
return false;
}
示例7: getCpusPresent
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public int getCpusPresent() {
String path = "/sys/devices/system/cpu/present";
int cpuTotal = 1;
if (RootTools.exists(path)) {
String[] present;
try {
present = getSetting(path).split("[ -]+");
if (present.length == 2) {
cpuTotal = Integer.parseInt(present[1]) - Integer.parseInt(present[0]) + 1;
}
} catch (Exception e) {
}
}
return cpuTotal;
}
示例8: getAvaliableFrequencies
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public int[] getAvaliableFrequencies(int cpuNo) throws Exception {
String path = "/sys/devices/system/cpu/cpu" + cpuNo + "/cpufreq/scaling_available_frequencies";
if (!RootTools.exists(path)) {
throw new Exception("Error: Unsupported kernel.");
}
String[] freqs = getSetting(path).split("[ ]+");
int[] frequencies = new int[freqs.length];
for (int i=0; i<frequencies.length; i++){
frequencies[i] = Integer.parseInt(freqs[i]);
}
return frequencies;
}
示例9: query
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public List<String[]> query(String dbFile, boolean successIfNonexistant)
{
if (!RootTools.exists(dbFile) && successIfNonexistant)
{
return new ArrayList<>();
}
return DBHelper.queryDatabase(dbFile, headings, table, colNames, where);
}
示例10: getCpuFrequency
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public int getCpuFrequency(int cpuNo) throws Exception {
String path = "/sys/devices/system/cpu/cpu" + cpuNo + "/cpufreq/cpuinfo_cur_freq";
if (!RootTools.exists(path)) {
return -1; //Cpu not avaliable
}
return Integer.parseInt(getSetting(path));
}
示例11: getCpuMinFrequency
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public int getCpuMinFrequency(int cpuNo) throws Exception {
String path = "/sys/devices/system/cpu/cpu" + cpuNo + "/cpufreq/cpuinfo_min_freq";
if (!RootTools.exists(path)) {
return -1; //Cpu not avaliable
}
return Integer.parseInt(getSetting(path));
}
示例12: getCpuMaxFrequency
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public int getCpuMaxFrequency(int cpuNo) throws Exception {
String path = "/sys/devices/system/cpu/cpu" + cpuNo + "/cpufreq/cpuinfo_max_freq";
if (!RootTools.exists(path)) {
return -1; //Cpu not avaliable
}
return Integer.parseInt(getSetting(path));
}
示例13: isSupported
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
return ((RootTools.exists(minCpuPath)) && (RootTools.exists(maxCpuPath)));
}
示例14: isSupported
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
return ((RootTools.exists(uvTablePath)) || (RootTools.exists(vddLevelsPath)));
}
示例15: isSupported
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
return (RootTools.exists(colourPath));
}