系統的設定–>電池–>使用方式中,統計的能耗的使用方式也是以power_profile.xml的value作為基礎參數的
1、My Phone中power_profile.xml的內容: HTC t328w
複製代碼 代碼如下:
<?xml version="1.0" encoding="utf-8"?>
<device name="Android">
<item name="none">0</item>
<item name="screen.on">100</item>
<item name="bluetooth.active">142</item>
<item name="bluetooth.on">0.3</item>
<item name="bluetooth.at">35690</item>
<item name="screen.full">160</item>
<item name="wifi.on">4</item>
<item name="wifi.active">120</item>
<item name="wifi.scan">220</item>
<item name="dsp.audio">88</item>
<item name="dsp.video">88</item>
<item name="radio.active">300</item>
<item name="gps.on">170</item>
<item name="battery.capacity">1390</item>
<item name="radio.scanning">70</item>
<array name="radio.on">
<value>3</value>
<value>3</value>
</array>
<array name="cpu.speeds">
<value>245000</value>
<value>384000</value>
<value>460800</value>
<value>499200</value>
<value>576000</value>
<value>614400</value>
<value>652800</value>
<value>691200</value>
<value>768000</value>
<value>806400</value>
<value>844800</value>
<value>998400</value>
</array>
<item name="cpu.idle">2.8</item>
<array name="cpu.active">
<value>66.6</value>
<value>84</value>
<value>90.8</value>
<value>96</value>
<value>105</value>
<value>111.5</value>
<value>117.3</value>
<value>123.6</value>
<value>134.5</value>
<value>141.8</value>
<value>148.5</value>
<value>168.4</value>
</array>
</device>
2、擷取的方法: 先從手機上擷取framework-res.apk,然後使用apktool工具反編譯
該檔案位於手機目錄: /system/framework/framework-res.apk,在linux下進入終端,執行一下命令:
複製代碼 代碼如下:
adb pull /system/framework/framework-res.apk ./
這就將 framework-res.apk 拉到本地pc上了,下面使用apktool進行反編譯。
複製代碼 代碼如下:
dell@OptiPlex-7010:~/apktool/apktool-install-linux-r05-ibot$ ls
aapt apktool apktool.jar framework-res.apk
dell@OptiPlex-7010:~/apktool/apktool-install-linux-r05-ibot$ ./apktool d framework-res.apk newapk
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
dell@OptiPlex-7010:~/apktool/apktool-install-linux-r05-ibot$ ls
aapt apktool apktool.jar framework-res.apk newapk
dell@OptiPlex-7010:~/apktool/apktool-install-linux-r05-ibot/newapk/res/xml$ ls
apns.xml password_kbd_qwerty_shifted.xml storage_list.xml
autotext.xml password_kbd_qwerty.xml time_zones_by_country.xml
eri.xml password_kbd_symbols_shift.xml zzz_cdmaapns.xml
password_kbd_extension.xml password_kbd_symbols.xml zzz_m_pdp_limit.xml
password_kbd_numeric.xml power_profile.xml
password_kbd_popup_template.xml preferred_time_zones.xml
power_profile.xml在framework-res.apk的目錄:/res/xml/power_profile.xml