@@ -1037,7 +1037,7 @@ private void releaseWakeLockLocked(IBinder lock, int flags, boolean death) {
10371037 mWakeLockState = mLocks .gatherState ();
10381038 // goes in the middle to reduce flicker
10391039 if ((wl .flags & PowerManager .ON_AFTER_RELEASE ) != 0 ) {
1040- userActivity (SystemClock .uptimeMillis (), -1 , false , OTHER_EVENT , false , true );
1040+ userActivity (SystemClock .uptimeMillis (), -1 , false , PowerManager . USER_ACTIVITY_EVENT_OTHER , false , true );
10411041 }
10421042 setPowerState (mWakeLockState | mUserState );
10431043 }
@@ -2467,7 +2467,7 @@ private void forceUserActivityLocked() {
24672467
24682468 public void userActivityWithForce (long time , boolean noChangeLights , boolean force ) {
24692469 mContext .enforceCallingOrSelfPermission (android .Manifest .permission .DEVICE_POWER , null );
2470- userActivity (time , -1 , noChangeLights , OTHER_EVENT , force , false );
2470+ userActivity (time , -1 , noChangeLights , PowerManager . USER_ACTIVITY_EVENT_OTHER , force , false );
24712471 }
24722472
24732473 public void userActivity (long time , boolean noChangeLights ) {
@@ -2480,7 +2480,7 @@ public void userActivity(long time, boolean noChangeLights) {
24802480 return ;
24812481 }
24822482
2483- userActivity (time , -1 , noChangeLights , OTHER_EVENT , false , false );
2483+ userActivity (time , -1 , noChangeLights , PowerManager . USER_ACTIVITY_EVENT_OTHER , false , false );
24842484 }
24852485
24862486 public void userActivity (long time , boolean noChangeLights , int eventType ) {
@@ -2498,13 +2498,13 @@ public void userActivity(long time, boolean noChangeLights, int eventType, boole
24982498 public void clearUserActivityTimeout (long now , long timeout ) {
24992499 mContext .enforceCallingOrSelfPermission (android .Manifest .permission .DEVICE_POWER , null );
25002500 Slog .i (TAG , "clearUserActivity for " + timeout + "ms from now" );
2501- userActivity (now , timeout , false , OTHER_EVENT , false , false );
2501+ userActivity (now , timeout , false , PowerManager . USER_ACTIVITY_EVENT_OTHER , false , false );
25022502 }
25032503
25042504 private void userActivity (long time , long timeoutOverride , boolean noChangeLights ,
25052505 int eventType , boolean force , boolean ignoreIfScreenOff ) {
25062506
2507- if (((mPokey & POKE_LOCK_IGNORE_TOUCH_EVENTS ) != 0 ) && (eventType == TOUCH_EVENT )) {
2507+ if (((mPokey & POKE_LOCK_IGNORE_TOUCH_EVENTS ) != 0 ) && (eventType == PowerManager . USER_ACTIVITY_EVENT_TOUCH )) {
25082508 if (false ) {
25092509 Slog .d (TAG , "dropping touch mPokey=0x" + Integer .toHexString (mPokey ));
25102510 }
@@ -2541,7 +2541,7 @@ private void userActivity(long time, long timeoutOverride, boolean noChangeLight
25412541 if ((mUserActivityAllowed && !mProximitySensorActive ) || force ) {
25422542 // Only turn on button backlights if a button was pressed
25432543 // and auto brightness is disabled
2544- if (eventType == BUTTON_EVENT && !mUseSoftwareAutoBrightness ) {
2544+ if (eventType == PowerManager . USER_ACTIVITY_EVENT_BUTTON && !mUseSoftwareAutoBrightness ) {
25452545 mUserState = (mKeyboardVisible ? ALL_BRIGHT : SCREEN_BUTTON_BRIGHT );
25462546 } else {
25472547 // don't clear button/keyboard backlights when the screen is touched.
@@ -2869,7 +2869,7 @@ public void setKeyboardVisibility(boolean visible) {
28692869 lightSensorChangedLocked (value , false );
28702870 }
28712871 }
2872- userActivity (SystemClock .uptimeMillis (), false , BUTTON_EVENT , true );
2872+ userActivity (SystemClock .uptimeMillis (), false , PowerManager . USER_ACTIVITY_EVENT_BUTTON , true );
28732873 }
28742874 }
28752875 }
@@ -3086,7 +3086,7 @@ void bootCompleted() {
30863086 Slog .d (TAG , "bootCompleted" );
30873087 synchronized (mLocks ) {
30883088 mBootCompleted = true ;
3089- userActivity (SystemClock .uptimeMillis (), false , BUTTON_EVENT , true );
3089+ userActivity (SystemClock .uptimeMillis (), false , PowerManager . USER_ACTIVITY_EVENT_BUTTON , true );
30903090 updateWakeLockLocked ();
30913091 mLocks .notifyAll ();
30923092 }
0 commit comments