基于android 9
PowerManagerService的主要功能
1. 管理CPU
主要靠mWakeLockSuspendBlocker 实现锁cpu
mWakeLockSuspendBlocker = createSuspendBlockerLocked("PowerManagerService.WakeLocks");
SuspendBlockerImpl-->acquire-->nativeAcquireSuspendBlocker-->acquire_wake_lock
acquire_wake_lock实现在
/hardware/libhardware_legacy/power.c
2.管理屏幕亮暗设置
主要通过mDisplayManagerInternal实现设置屏幕亮暗
mDisplayManagerInternal = getLocalService(DisplayManagerInternal.class);
mDisplayManagerInternal 获取的就是DisplayManagerService的内部类LocalService
mDisplayManagerInternal.requestPowerState
网友评论