本篇文章為大家展示了Android中怎么實(shí)現(xiàn)開(kāi)機(jī)充電圖標(biāo)和充電動(dòng)畫(huà)效果,內(nèi)容簡(jiǎn)明扼要并且容易理解,絕對(duì)能使你眼前一亮,通過(guò)這篇文章的詳細(xì)介紹希望你能有所收獲。
我們提供的服務(wù)有:成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、德陽(yáng)ssl等。為上1000家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的德陽(yáng)網(wǎng)站制作公司
kernel\msm-3.18\drivers\usb\phy\phy-msm-usb.c
motg->usb_psy.name = "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_psy.properties = 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_psy.property_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_psy.name = "dc_o2"; bq->batt_psy.type = POWER_SUPPLY_TYPE_BATTERY; bq->batt_psy.properties = 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_psy.property_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; }
充電的閃電圖標(biāo)和充電動(dòng)畫(huà)啟動(dòng)邏輯
閃電圖標(biāo)啟動(dòng)邏輯:POWER_SUPPLY_TYPE_USB的power supply上報(bào)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);
充電動(dòng)畫(huà)的啟動(dòng)邏輯:POWER_SUPPLY_TYPE_BATTERY的power supply上報(bào)充電狀態(tài)
(CHARGE_STATE_NOT_CHARGING,CHARGE_STATE_FASTCHARGE) bq->charge_state = CHARGE_STATE_FASTCHARGE; power_supply_changed(&bq->batt_psy);
利用dumpsys分析當(dāng)前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: 0 status: 2 health: 2 present: true level: 46 scale: 100 voltage: 7 temperature: 270 technology: Li-ion
上述內(nèi)容就是Android中怎么實(shí)現(xiàn)開(kāi)機(jī)充電圖標(biāo)和充電動(dòng)畫(huà)效果,你們學(xué)到知識(shí)或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識(shí)儲(chǔ)備,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
本文標(biāo)題:Android中怎么實(shí)現(xiàn)開(kāi)機(jī)充電圖標(biāo)和充電動(dòng)畫(huà)效果
URL標(biāo)題:http://muchs.cn/article16/gjssgg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、微信公眾號(hào)、全網(wǎng)營(yíng)銷推廣、靜態(tài)網(wǎng)站、關(guān)鍵詞優(yōu)化、定制開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)