MCPcopy Create free account
hub / github.com/afkT/DevUtils / getCpuModel

Method getCpuModel

lib/DevApp/src/main/java/dev/utils/app/CPUUtils.java:92–109  ·  view source on GitHub ↗

获取 CPU 型号 @return CPU 型号

()

Source from the content-addressed store, hash-verified

90 * @return CPU 型号
91 */
92 public static String getCpuModel() {
93 FileReader fr = null;
94 BufferedReader br = null;
95 try {
96 fr = new FileReader("/proc/cpuinfo");
97 br = new BufferedReader(fr);
98 String text = br.readLine();
99 if (text == null) {
100 return "";
101 }
102 return text.split(":\\s+", 2)[1];
103 } catch (Exception e) {
104 LogPrintUtils.eTag(TAG, e, "getCpuModel");
105 } finally {
106 CloseUtils.closeIOQuietly(br, fr);
107 }
108 return "";
109 }
110
111 /**
112 * 获取 CPU 最大频率 ( 单位 KHZ )

Callers

nothing calls this directly

Calls 3

eTagMethod · 0.95
closeIOQuietlyMethod · 0.95
splitMethod · 0.45

Tested by

no test coverage detected