當前位置: 首頁>>代碼示例>>Java>>正文


Java RootTools.exists方法代碼示例

本文整理匯總了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);
}
 
開發者ID:JohnNPhillips,項目名稱:HistoryCleanerPro,代碼行數:20,代碼來源:SimpleDatabaseItem.java

示例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'"
	);
}
 
開發者ID:JohnNPhillips,項目名稱:HistoryCleanerPro,代碼行數:18,代碼來源:_System_FrequentContacts.java

示例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;"
		}
	);
}
 
開發者ID:JohnNPhillips,項目名稱:HistoryCleanerPro,代碼行數:22,代碼來源:_System_FrequentContacts.java

示例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;
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:17,代碼來源:VoltageControl.java

示例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;
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:17,代碼來源:VoltageControl.java

示例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;
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:19,代碼來源:CpuControl.java

示例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;
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:18,代碼來源:CpuControl.java

示例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;
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:17,代碼來源:CpuControl.java

示例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);
}
 
開發者ID:JohnNPhillips,項目名稱:HistoryCleanerPro,代碼行數:10,代碼來源:SimpleDatabaseItem.java

示例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));
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:10,代碼來源:CpuControl.java

示例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));
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:10,代碼來源:CpuControl.java

示例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));
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:10,代碼來源:CpuControl.java

示例13: isSupported

import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
	return ((RootTools.exists(minCpuPath)) && (RootTools.exists(maxCpuPath))); 
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:4,代碼來源:MPDecision.java

示例14: isSupported

import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
	return ((RootTools.exists(uvTablePath)) || (RootTools.exists(vddLevelsPath))); 
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:4,代碼來源:VoltageControl.java

示例15: isSupported

import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public boolean isSupported() {
	return (RootTools.exists(colourPath)); 
}
 
開發者ID:shaun2029,項目名稱:Multi-Core-Control,代碼行數:4,代碼來源:ColourControl.java


注:本文中的com.stericson.RootTools.RootTools.exists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。