Android 功耗(4)---MTK平台待机功耗分析流程( 三 )


(4) 仅限于JB2之后的Android版本 , JB2之前流程相对比较简单;
kernel-Check Point【1】:按键中断
<5>[ 78.721504] 1)[Power/PMIC] [pwrkey_int_handler] Press pwrkey ——————————————————————————————————————————————————– Check Point【2】:上层收到按键事件 01-09 03:37:40.102 513 561 D WindowManager: interceptKeyTq keycode=26 ——————————————————————————————————————————————————– Check Point【3】:PMS的wakeUp被调用 01-09 03:37:40.171 513 531 D PowerManager_performance: wakeUpNoUpdateLocked: eventTime=78826 ——————————————————————————————————————————————————– Check Point【4】:发出MSG_BROADCAST 01-09 03:37:40.171 513 531 D PowerManagerNotifier: onWakeUpStarted ——————————————————————————————————————————————————– Check Point【5】:发出第一个MSG_UPDATE_POWER_STATE 01-09 03:37:40.174 513 531 D PowerManagerDisplayController: sendMessage ——————————————————————————————————————————————————– Check Point【6】:收到并处理MSG_BROADCAST , 并且状态是从2变到1 01-09 03:37:40.194 513 530 D PowerManagerNotifier: sendNextBroadcast, mBroadcastedPowerState=2, mActualPowerState=1 ——————————————————————————————————————————————————– Check Point【7】:开始绘制keyguard的流程 , 发出NOTIFY_SCREEN_ON , 等windowToken 01-09 03:37:40.217 513 530 D KeyguardViewMediator: notifyScreenOnLocked ——————————————————————————————————————————————————– Check Point【8】:收到并处理NOTIFY_SCREEN_ON 01-09 03:37:40.224 513 531 D KeyguardViewMediator: handleNotifyScreenOn ——————————————————————————————————————————————————– Check Point【9】:完成绘制keyguard , 拿到windowToken 01-09 03:37:40.370 513 531 I WindowManager: Lock screen displayed ——————————————————————————————————————————————————– Check Point【10】:调用回调函数mSceenOnListener , 解除Screen on Blocker , mNestCount必须是0 01-09 03:37:40.371 513 531 D PowerManagerService: Screen on unblocked: mNestCount=0 ——————————————————————————————————————————————————– Check Point【11】:处理第一个MSG_UPDATE_POWER_STATE , 这里会第一次scheduleScreenUpdate 01-09 03:37:40.254 513 546 D PowerManagerDisplayState: setScreenOn: on=true ——————————————————————————————————————————————————– Check Point【12】:第一次执行scheduleScreenUpdate , 进入setState 01-09 03:37:40.330 513 546 D PowerManagerDisplayState: Requesting new screen state: on=true, backlight=0 Check Point【13】:发出第二个MSG_UPDATE_POWER_STATE 01-09 03:37:40.334 513 546 D PowerManagerDisplayController: sendMessage. ——————————————————————————————————————————————————– Check Point【14】:第一次执行mTask ,on跟onChanged 必须都是true 01-09 03:37:40.334 513 546 D PowerManagerDisplayState: mTask: on = true, onChanged = true, backlightChanged = false ——————————————————————————————————————————————————– kernel-Check Point【15】:进入unblankAllDisplays , 开始底层late_resume流程 01-09 03:37:40.334 513 546 D PowerManagerService: unblankAllDisplays in … ——————————————————————————————————————————————————– Check Point【16】:底层late_resume流程结束 01-09 03:37:40.673 513 546 D PowerManagerService-JNI: Excessive delay in autosuspend_disable() while turning screen on: 337ms ——————————————————————————————————————————————————– Check Point【17】:unblankAllDisplays流程结束 01-09 03:37:40.701 513 546 D PowerManager_performance: unblankAllDisplays out … ——————————————————————————————————————————————————– Check Point【18】:处理第二个MSG_UPDATE_POWER_STATE 01-09 03:37:40.702 513 546 D PowerManagerDisplayController: setScreenOn true ——————————————————————————————————————————————————– Check Point【19】:前面的Screen On Blocker被解除 , 才会调用这里 01-09 03:37:40.702 513 546 D PowerManagerDisplayController: Unblocked screen on after 447 ms ——————————————————————————————————————————————————– Check Point【20】:设置ElectronBeamLevel , 值不为0才能点亮背光 , 并且这里会第二次scheduleScreenUpdate 01-09 03:37:40.704 513 546 D PowerManagerDisplayState: setElectronBeamLevel: level=1.0 ——————————————————————————————————————————————————– Check Point【21】:第二次执行scheduleScreenUpdate , 进入setState , 注意backlight值不为0 01-09 03:37:40.718 513 546 D PowerManagerDisplayState: Requesting new screen state: on=true, backlight=86, ——————————————————————————————————————————————————– Check Point【22】:第二次执行mTask , backlightChanged必须是true 01-09 03:37:40.721 513 546 D PowerManagerDisplayState: mTask: on = true, onChanged = false, backlightChanged = true ——————————————————————————————————————————————————– Check Point【23】:调用light service , 写backlight节点 , light 0表示backlight 01-09 03:37:40.721 513 546 D LightsService: setLight_native: light=0, colorARGB=0xff565656, flashMode=0, ——————————————————————————————————————————————————– kernel-Check Point【24】:驱动底层背光生效