屏幕关闭原因以及p-sensor

按下电源按键后屏幕关闭的log如下:
D/WindowManager(  250): interceptKeyTq keycode=26 screenIsOn=true keyguardActive=false
I/power   (  250): *** set_screen_state 0

D/SurfaceFlinger(   87): About to give-up screen, flinger = 0x1671960
E/libEGL  (   87): validate_display:188 error 3008 (EGL_BAD_DISPLAY)
I/PowerManagerService(  250): setScreenState: screen_state=false mPartialCount=0err=0
D/Sensors (  250): PlsSensor::enable en=0; newState=0; what=0; mEnabled=1
D/Sensors (  250): PlsSensor::enable what=0; flags=0; err=0
D/Sensors (  250): PlsSensor::mEnabled=0x0
V/PowerManagerService(  250): unregisterListener mLightListenerKB
D/KeyguardViewMediator(  250): onScreenTurnedOff(2)
D/KeyguardViewMediator(  250): onScreenTurnedOff : doKeyguardLocked is run !
D/KeyguardViewMediator(  250): doKeyguard: showing the lock screen
D/KeyguardViewMediator(  250): showLocked
I/PowerManagerService(  250): mLocks 01sleep_broadcast
D/PowerManagerService(  250): acquireWakeLock flags=0x1 tag=sleep_broadcast
D/PowerManagerService(  250): acquireWakeLock flags=0x1 tag=show keyguard
I/WindowManager(  250): PhoneWindowManager screenTurnedOff is run and why =2


打电话时p-sensor被遮挡后屏幕关闭的log如下:
D/Sensors (  250): PlsSensor: mPendingEvents[Proximity].distance = 0.000000
I/power   (  250): *** set_screen_state 0

I/PowerManagerService(  250): setScreenState: screen_state=false mPartialCount=2err=0
I/PowerManagerService(  250): mLocks 032MsmsPhoneApp
I/PowerManagerService(  250): mLocks 11EmergencyCallHelper
I/PowerManagerService(  250): mLocks 21GSM
I/PowerManagerService(  250): mLocks 3268435482MsmsPhoneApp
D/SurfaceFlinger(   87): About to give-up screen, flinger = 0x1671960
E/libEGL  (   87): validate_display:188 error 3008 (EGL_BAD_DISPLAY)
D/Sensors (  250): PlsSensor::enable en=0; newState=0; what=0; mEnabled=3
D/Sensors (  250): PlsSensor::enable what=0; flags=0; err=0
D/Sensors (  250): PlsSensor::mEnabled=0x2
V/PowerManagerService(  250): unregisterListener mLightListenerKB
I/PowerManagerService(  250): mLocks 032MsmsPhoneApp
I/PowerManagerService(  250): mLocks 11EmergencyCallHelper
I/PowerManagerService(  250): mLocks 21GSM
I/PowerManagerService(  250): mLocks 3268435482MsmsPhoneApp
D/KeyguardViewMediator(  250): onScreenTurnedOff(4)
D/PowerManagerService(  250): acquireWakeLock flags=0x1 tag=sleep_broadcast
I/WindowManager(  250): PhoneWindowManager screenTurnedOff is run and why =4


我们可以看到每次屏幕关闭都会调用到D/KeyguardViewMediator(  250): onScreenTurnedOff(*)
根据这里的参数,我们便可以知道每次屏幕关闭时是基于什么原因
以下是每个数字的含义
~/mywork/403-sync/frameworks/base/core/java/android/view/WindowManagerPolicy.java
 416     // NOTE: screen off reasons are in order of significance, with more
 417     // important ones lower than less important ones.
 418     
 419     /** Screen turned off because of a device admin */
 420     public final int OFF_BECAUSE_OF_ADMIN = 1;
 421     /** Screen turned off because of power button */
 422     public final int OFF_BECAUSE_OF_USER = 2;
 423     /** Screen turned off because of timeout */
 424     public final int OFF_BECAUSE_OF_TIMEOUT = 3;
 425     /** Screen turned off because of proximity sensor */
 426     public final int OFF_BECAUSE_OF_PROX_SENSOR = 4;
 427 


打电话时p-sensor的遮挡移除后屏幕点亮的log如下:
D/Sensors (  250): PlsSensor: mPendingEvents[Proximity].distance = 1.000000
I/power   (  250): *** set_screen_state 1

I/PowerManagerService(  250): setScreenState: screen_state=true mPartialCount=2err=0
I/PowerManagerService(  250): mLocks 032MsmsPhoneApp
I/PowerManagerService(  250): mLocks 11EmergencyCallHelper
I/PowerManagerService(  250): mLocks 21GSM
I/PowerManagerService(  250): mLocks 3268435482MsmsPhoneApp
D/Sensors (  250): PlsSensor::enable en=1; newState=1; what=0; mEnabled=2
D/Sensors (  250): PlsSensor::enable what=0; flags=1; err=0
D/Sensors (  250): PlsSensor::mEnabled=0x3
V/PowerManagerService(  250): registerListener mLightListenerKB
I/PowerManagerService(  250): mLocks 032MsmsPhoneApp
I/PowerManagerService(  250): mLocks 11EmergencyCallHelper
I/PowerManagerService(  250): mLocks 21GSM
I/PowerManagerService(  250): mLocks 3268435482MsmsPhoneApp
D/KeyguardViewMediator(  250): onScreenTurnedOn, seq = 2
D/KeyguardViewMediator(  250): notifyScreenOnLocked
D/KeyguardViewMediator(  250): handleNotifyScreenOn
D/PowerManagerService(  250): acquireWakeLock flags=0x1 tag=sleep_broadcast
I/WindowManager(  250): No lock screen!
D/InCallScreen(  603): onResume()...
D/InCallUiState(  603): dumpState():
D/InCallUiState(  603):   - showDialpad: false
D/InCallUiState(  603):   - pending call status code: none
D/InCallUiState(  603):   - progressIndication: NONE
D/InCallUiState(  603):   - provider overlay: none
D/InCallUiState(  603):   - latestActiveCallOrigin: com.android.contacts.activities.DialtactsActivity
D/PhoneApp(  603): setIgnoreTouchUserActivity(true)...
D/NotificationMgr(  603): updateStatusBar: state = 0x50000
D/NotificationMgr(  603): updateInCallNotification(allowFullScreenIntent = false)...
D/TD      (  603): VideoCT: IDLE CT: OFFHOOK
D/TD      (  603): VideoCT: IDLE CT: OFFHOOK
D/TD      (  603): VideoCT: IDLE CT: IDLE



你可能感兴趣的:(Linux,Sensors)