dumpsys power 字段含义介绍
在分析app测功耗以及亮灭屏的过程中,经常会执行dumpsys power来获取PowerManagerService的状态。下面就关于dumpsys power的打印的部分字段的含义简要说明下,有不对的地方还请在评论区指出来。
POWER MANAGER (dumpsys power)
Power Manager State:
Settings power_manager_constants:
no_cached_wake_locks=true
mDirty=0x0 (mDirty PMS中的核心参数,用来表示当前发生改变的事件类型)
mWakefulness=Awake 当前所希望的屏幕状态,Awake 表示唤醒状态
mWakefulnessChanging=false mWakefulnessChanging 表示上一个参数mWakefulness是否发生变化,如果变化这个参数会被改成true,然后会调用DIsplayManager来切换屏幕状态
mIsPowered=true 是否充电,true表示在充电中
mPlugType=2 充电类型
mBatteryLevel=82 当前电量
mBatteryLevelWhenDreamStarted=0
mDockState=0
mStayOn=false 屏幕是否需要长亮
mProximityPositive=false 通话时候的距离感应传感器(打电话的时候,手机贴到脸上就灭屏)
mBootCompleted=true 是否启动完毕
mSystemReady=true 系统是否准备好
mHalAutoSuspendModeEnabled=false HAL层是否自己进入Suspend模式
mHalInteractiveModeEnabled=true 向HAL层设置的当前用户活动状态,true表示屏幕打开,用户在使用,false表示用户没有使用
mWakeLockSummary=0x25 记录所有锁的类型
mNotifyLongScheduled=+27s645ms
mNotifyLongDispatched=-51s118ms
mNotifyLongNextCheck=(none)
mUserActivitySummary=0x1 用户活动事件标志
mRequestWaitForNegativeProximity=false
mSandmanScheduled=false
mSandmanSummoned=false
mBatteryLevelLow=false 电池是否是低电状态
mLightDeviceIdleMode=false
mDeviceIdleMode=false
mDeviceIdleWhitelist=[1000, 2000, 10014] 设备在IDLE状态下的app白名单
mDeviceIdleTempWhitelist=[1000]
mLastWakeTime=577519 (32358 ms ago) 重要,表示上次屏幕点亮的事件 32358 ms ago 表示距离当前时间,屏幕在32秒之前点亮的
mLastSleepTime=498525 (111352 ms ago) 上次屏幕灭屏时间,111352 ms ago 表示在111秒之之前息屏的
mLastUserActivityTime=577519 (32358 ms ago) 最后一次用户的活动事件时间,点击,充电,等
mLastUserActivityTimeNoChangeLights=64807 (545070 ms ago) 用户最后一次不影响屏幕亮度的事件
mLastInteractivePowerHintTime=577519 (32358 ms ago)
mLastScreenBrightnessBoostTime=0 (609877 ms ago) 最近一次自动调节屏幕亮度的时间(就是手机由黑暗的地方进入明亮的地方,手机屏幕会自动调整到最大亮度)
mScreenBrightnessBoostInProgress=false 是否正在进行屏幕亮度调整
mDisplayReady=true 显示器是否准备OK
mHoldingWakeLockSuspendBlocker=true 是否持有阻止CPU休眠的锁
mHoldingDisplaySuspendBlocker=true 是否持有阻止显示器息屏的锁
Settings and Configuration: 下面这部分是系统的原始配置参数
mDecoupleHalAutoSuspendModeFromDisplayConfig=false
mDecoupleHalInteractiveModeFromDisplayConfig=false
mWakeUpWhenPluggedOrUnpluggedConfig=true
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mTheaterModeEnabled=false
mSuspendWhenScreenOffDueToProximityConfig=true
mDreamsSupportedConfig=true
mDreamsEnabledByDefaultConfig=true
mDreamsActivatedOnSleepByDefaultConfig=false
mDreamsActivatedOnDockByDefaultConfig=true
mDreamsEnabledOnBatteryConfig=false
mDreamsBatteryLevelMinimumWhenPoweredConfig=-1
mDreamsBatteryLevelMinimumWhenNotPoweredConfig=15
mDreamsBatteryLevelDrainCutoffConfig=5
mDreamsEnabledSetting=true
mDreamsActivateOnSleepSetting=false
mDreamsActivateOnDockSetting=true
mDozeAfterScreenOff=false
mMinimumScreenOffTimeoutConfig=10000
mMaximumScreenDimDurationConfig=7000
mMaximumScreenDimRatioConfig=0.20000005
mScreenOffTimeoutSetting=60000
mSleepTimeoutSetting=-1
mMaximumScreenOffTimeoutFromDeviceAdmin=9223372036854775807 (enforced=false)
mStayOnWhilePluggedInSetting=0
mScreenBrightnessSetting=0
mScreenBrightnessModeSetting=0
mScreenBrightnessOverrideFromWindowManager=-1
mUserActivityTimeoutOverrideFromWindowManager=-1
mUserInactiveOverrideFromWindowManager=false
mDozeScreenStateOverrideFromDreamManager=0
mDrawWakeLockOverrideFromSidekick=false
mDozeScreenBrightnessOverrideFromDreamManager=-1
mScreenBrightnessSettingMinimum=10
mScreenBrightnessSettingMaximum=255
mScreenBrightnessSettingDefault=102
mDoubleTapWakeEnabled=false
mIsVrModeEnabled=false
mForegroundProfile=0
Sleep timeout: -1 ms
Screen off timeout: 60000 ms 用户设置的手机灭屏实现(从最后一个用户事件到屏幕彻底熄灭,这里是60秒)
Screen dim duration: 7000 ms 屏幕熄灭之前变暗所持续的事件
应用的状态信息
UID states (changing=false changed=false):
1000 表示应用的UDI,ACTIVE 表示应用是否是活动状态,count表示此应用申请的锁的数量 state 表示应用的运行等级
应用的运行等级可以百度搜索 PROCESS_STATE_NONEXISTENT 来看看具体都有哪些已经各个状态下的运行状态。
UID 1000: ACTIVE count=0 state=0
UID 1001: ACTIVE count=0 state=0
UID 1027: ACTIVE count=0 state=0
UID 1068: ACTIVE count=0 state=0
UID u0a8: INACTIVE count=0 state=18
UID u0a13: INACTIVE count=0 state=18
UID u0a14: INACTIVE count=0 state=9
UID u0a19: INACTIVE count=0 state=18
UID u0a21: ACTIVE count=0 state=18
UID u0a24: ACTIVE count=0 state=0
UID u0a25: ACTIVE count=0 state=4
UID u0a34: INACTIVE count=0 state=18
UID u0a38: INACTIVE count=0 state=18
UID u0a40: INACTIVE count=0 state=18
UID u0a43: INACTIVE count=0 state=18
UID u0a44: ACTIVE count=0 state=5
UID u0a53: ACTIVE count=0 state=13
UID u0a54: ACTIVE count=2 state=2
Looper state:
待处理的handl消息
Looper (PowerManagerService, tid 34) {6ca4820}
Message 0: { when=+20s642ms what=1 target=com.android.server.power.PowerManagerService$PowerManagerHandler }
Message 1: { when=+27s645ms what=4 target=com.android.server.power.PowerManagerService$PowerManagerHandler }
(Total messages: 2, polling=true, quitting=false)
Wake Locks: size=2 应用申请的锁的数量
锁的类型 锁的tag 当前锁所持有的时间 申请锁的app的UID以及PID
PARTIAL_WAKE_LOCK 'My_Tag_PARTIAL_WAKE_LOCK' ACQ=-24s518ms (uid=10054 pid=15301)
SCREEN_DIM_WAKE_LOCK 'My_Tag_SCREEN_DIM_WAKE_LOCK' ACQ=-24s512ms (uid=10054 pid=15301)
Suspend Blockers: size=4
PowerManagerService.WakeLocks: ref count=1
PowerManagerService.Display: ref count=1
PowerManagerService.Broadcasts: ref count=0
PowerManagerService.WirelessChargerDetector: ref count=0
Display Power: state=ON
Battery saving stats:
Battery Saver is currently: OFF
Last OFF time: 2020-10-30 09:36:09.545 -6h5m54s767ms 距离上次充满电的时间
Times enabled: 0
Drain stats:
Battery saver OFF ON
NonDoze NonIntr: 358m 29mAh( 1%) 4.9mAh/h 0m 0mAh( 0%) 0.0mAh/h
Intr: 1m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h
Deep NonIntr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h
Intr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h
Light NonIntr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h
Intr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h
Battery saver policy (*NOTE* they only apply when battery saver is ON):
Settings: battery_saver_constants
value: null
Settings: (overlay)
value:
mAccessibilityEnabled=false
vibration_disabled:config=true
vibration_disabled:effective=true
animation_disabled=false
fullbackup_deferred=true
keyvaluebackup_deferred=true
firewall_disabled=false
datasaver_disabled=true
launch_boost_disabled=true
adjust_brightness_disabled=true
adjust_brightness_factor=0.5
gps_mode=2
force_all_apps_standby=true
force_background_check=true
optional_sensors_disabled=true
aod_disabled=true
send_tron_log=false
Interactive File values:
Noninteractive File values:
Battery saver state machine:
Enabled=false
mLastChangedIntReason=0
mLastChangedStrReason=null
mBootCompleted=true
mSettingsLoaded=true
mBatteryStatusSet=true
mBatterySaverSnoozing=false
mIsPowered=true
mBatteryLevel=82
mIsBatteryLevelLow=false
mSettingBatterySaverEnabled=false
mSettingBatterySaverEnabledSticky=false
mSettingBatterySaverTriggerThreshold=0
Profile power states: size=0
Wireless Charger Detector State:
mGravitySensor={Sensor name="Gravity Sensor", vendor="AOSP", version=3, type=9, maxRange=19.6133, resolution=0.0012, power=0.002, minDelay=10000}
mPoweredWirelessly=false
mAtRest=false
mRestX=0.0, mRestY=0.0, mRestZ=0.0
mDetectionInProgress=false
mDetectionStartTime=0 (never)
mMustUpdateRestPosition=false
mTotalSamples=0
mMovingSamples=0
mFirstSampleX=0.0, mFirstSampleY=0.0, mFirstSampleZ=0.0
mLastSampleX=0.0, mLastSampleY=0.0, mLastSampleZ=0.0
本文地址:https://blog.csdn.net/zhaojigao/article/details/109388376