【移動應(yīng)用開發(fā)技術(shù)】Android中怎么實現(xiàn)開機充電圖標和充電動畫效果_第1頁
【移動應(yīng)用開發(fā)技術(shù)】Android中怎么實現(xiàn)開機充電圖標和充電動畫效果_第2頁
【移動應(yīng)用開發(fā)技術(shù)】Android中怎么實現(xiàn)開機充電圖標和充電動畫效果_第3頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

【移動應(yīng)用開發(fā)技術(shù)】Android中怎么實現(xiàn)開機充電圖標和充電動畫效果

本篇文章為大家展示了Android中怎么實現(xiàn)開機充電圖標和充電動畫效果,內(nèi)容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。kernel\msm-3.18\drivers\usb\phy\phy-msm-usb.cmotg->usb_

=

"usb";

motg->usb_psy.type

=

POWER_SUPPLY_TYPE_USB;

motg->usb_psy.supplied_to

=

otg_pm_power_supplied_to;

motg->usb_psy.num_supplicants

=

ARRAY_SIZE(otg_pm_power_supplied_to);

motg->usb_perties

=

otg_pm_power_props_usb;

motg->usb_psy.num_properties

=

ARRAY_SIZE(otg_pm_power_props_usb);

motg->usb_psy.get_property

=

otg_power_get_property_usb;

motg->usb_psy.set_property

=

otg_power_set_property_usb;

motg->usb_perty_is_writeable

=

otg_power_property_is_writeable_usb;

if

(!msm_otg_register_power_supply(pdev,

motg))

psy

=

&motg->usb_psy;kernel\msm-3.18\drivers\power\bq2570x\bq2570x_charger.c

usb_psy

=

power_supply_get_by_name("usb");

static

int

bq2570x_psy_register(struct

bq2570x

*bq)

{

int

ret;

bq->batt_

=

"dc_o2";

bq->batt_psy.type

=

POWER_SUPPLY_TYPE_BATTERY;

bq->batt_perties

=

bq2570x_charger_props;

bq->batt_psy.num_properties

=

ARRAY_SIZE(bq2570x_charger_props);

bq->batt_psy.get_property

=

bq2570x_charger_get_property;

bq->batt_psy.set_property

=

bq2570x_charger_set_property;

bq->batt_psy.external_power_changed

=

bq2570x_external_power_changed;

bq->batt_perty_is_writeable

=

bq2570x_charger_is_writeable;

ret

=

power_supply_register(bq->dev,

&bq->batt_psy);

if

(ret

<

0)

{

pr_err("failed

to

register

batt_psy:%d\n",

ret);

return

ret;

}

return

0;

}充電的閃電圖標和充電動畫啟動邏輯閃電圖標啟動邏輯:POWER_SUPPLY_TYPE_USB的powersupply上報USB類型(CDP,DCP,USB)power_supply_set_supply_type(bq->usb_psy,

POWER_SUPPLY_TYPE_USB);

ret

=

power_supply_set_online(bq->usb_psy,

true);

power_supply_changed(bq->usb_psy);充電動畫的啟動邏輯:POWER_SUPPLY_TYPE_BATTERY的powersupply上報充電狀態(tài)(CHARGE_STATE_NOT_CHARGING,CHARGE_STATE_FASTCHARGE)

bq->charge_state

=

CHARGE_STATE_FASTCHARGE;

power_supply_changed(&bq->batt_psy);利用dumpsys分析當前battery狀態(tài)V2_PRO:/

#

dumpsys

battery

Current

Battery

Service

state:

AC

powered:

false

USB

powered:

true

Wireless

powered:

false

Max

charging

current:

0

Max

charging

voltage:

0

Charge

counter

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論