自学内容网 自学内容网

Android 取消充电动画logo,直接显示图片即可

删除充电动画逻辑,直接设置显示图片logo:hvga_low_battery.bmp
vendor/mediatek/proprietary/external/libshowlogo/charging_animation.cpp
void show_battery_capacity(unsigned int capacity)
{
    anim_show_logo(LOW_BATTERY_INDEX);//*/rm animation add set low battery logo
    /*if (MTK_LOG_ENABLE == 1) {
        SLOGD("[libshowlogo: %s %d]capacity =%d\n",__FUNCTION__,__LINE__, capacity);
    }
    int has_fast_charging = getValue("ro.vendor.mtk_pump_express_plus_support" , "0" );
    if (draw_anim_mode == (DRAW_ANIM_MODE_FB)) {
        anim_fb_addr_switch();    
if( has_fast_charging == 1) {
        if (2 != show_animationm_ver && get_fast_charging_state()) {
            fill_animation_battery_by_ver(capacity, (void *)outBuffer.bits, dec_logo_addr, logo_addr, phical_screen, show_animationm_ver);
        } else {
            fill_animation_battery_by_ver(capacity, (void *)fb_addr, dec_logo_addr, logo_addr, phical_screen, show_animationm_ver);
        }
}
else {
        fill_animation_battery_by_ver(capacity, (void *)fb_addr, dec_logo_addr, logo_addr, phical_screen, show_animationm_ver);
}
        anim_fb_disp_update();
    } else {
        ARect tmpRect;
        tmpRect.left = 0;
        tmpRect.top = 0;
        tmpRect.right = phical_screen.width;
        tmpRect.bottom = phical_screen.height;

        status_t  lockResult = surface->lock(&outBuffer, &tmpRect);
        if (MTK_LOG_ENABLE == 1) {
            SLOGD("[libshowlogo: %s %d]outBuffer.bits = %d, surface->lock return =  0x%08x,\n",__FUNCTION__,__LINE__, (int)outBuffer.bits,lockResult);
        }

        if (0 == lockResult)
        {
if(has_fast_charging == 1) {
            if (2 != show_animationm_ver && get_fast_charging_state()) {
                fill_animation_battery_by_ver(capacity, (void *)outBuffer.bits, dec_logo_addr, logo_addr, phical_screen, show_animationm_ver);
            } else {
                fill_animation_battery_by_ver(capacity, (void *)outBuffer.bits, dec_logo_addr, logo_addr, phical_screen, show_animationm_ver);
            }
} else { 
            fill_animation_battery_by_ver(capacity, (void *)outBuffer.bits, dec_logo_addr, logo_addr, phical_screen, show_animationm_ver);
}
            surface->unlockAndPost();
        }
    }*/
}
 


原文地址:https://blog.csdn.net/qq_46687516/article/details/142938346

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!