File tree 5 files changed +35
-1
lines changed
5 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ public void run() {
91
91
if (null != result ) {
92
92
result .clear ();
93
93
result .addAll (CpuUtils .getCpuCurFreq (mContext ));
94
+ result .add (getString (R .string .cpu_voltage ));
95
+ result .addAll (CpuUtils .getCpuVoltage ());
94
96
mHandler .sendEmptyMessage (UPDATE_UI );
95
97
}
96
98
Original file line number Diff line number Diff line change @@ -330,4 +330,34 @@ public static List<String> getCpuSceneInfo() {
330
330
}
331
331
return result ;
332
332
}
333
+
334
+ /**
335
+ * CPU 电压
336
+ *
337
+ * @return
338
+ */
339
+ public static List <String > getCpuVoltage () {
340
+ List <String > result = new ArrayList <>();
341
+ BufferedReader br = null ;
342
+ try {
343
+ String line ;
344
+ br = new BufferedReader (new FileReader ("/proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_oppidx" ));
345
+ while ((line = br .readLine ()) != null ) {
346
+ result .add (line );
347
+ }
348
+
349
+ br .close ();
350
+ } catch (IOException e ) {
351
+ e .printStackTrace ();
352
+ } finally {
353
+ if (br != null ) {
354
+ try {
355
+ br .close ();
356
+ } catch (IOException e ) {
357
+ e .printStackTrace ();
358
+ }
359
+ }
360
+ }
361
+ return result ;
362
+ }
333
363
}
Original file line number Diff line number Diff line change 33
33
<string name =" cpu_online_status_online" >开启</string >
34
34
<string name =" cpu_online_status_offline" >关闭</string >
35
35
<string name =" cpu_stoped" >CPU %1$d: 已经停止</string >
36
+ <string name =" cpu_voltage" >CPU 电压:</string >
36
37
37
38
<string name =" phone_mode" >本机型号: </string >
38
39
<string name =" phone_product" >手机制造商: </string >
Original file line number Diff line number Diff line change 33
33
<string name =" cpu_online_status_online" >Online</string >
34
34
<string name =" cpu_online_status_offline" >Offline</string >
35
35
<string name =" cpu_stoped" >CPU %1$d: Stopped</string >
36
+ <string name =" cpu_voltage" >CPU Voltage:</string >
36
37
37
38
<string name =" phone_product" >Phone product: </string >
38
39
<string name =" phone_band" >Phone band: </string >
You can’t perform that action at this time.
0 commit comments