Skip to content

Commit 30e5eb4

Browse files
author
Jeff Brown
committed
Tell power HAL when user activity occurs.
Bug: 6435382 Change-Id: I78754158b057851fcba807ebbda143899da387ec
1 parent 7304c34 commit 30e5eb4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

services/jni/com_android_server_PowerManagerService.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ bool android_server_PowerManagerService_isScreenBright() {
8383
}
8484

8585
void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType) {
86+
if (gPowerModule) {
87+
// Tell the power HAL when user activity occurs.
88+
if (gPowerModule->powerHint) {
89+
gPowerModule->powerHint(gPowerModule, POWER_HINT_INTERACTION, NULL);
90+
}
91+
}
92+
8693
if (gPowerManagerServiceObj) {
8794
// Throttle calls into user activity by event type.
8895
// We're a little conservative about argument checking here in case the caller
@@ -264,6 +271,8 @@ int register_android_server_PowerManagerService(JNIEnv* env) {
264271
}
265272
gScreenOn = true;
266273
gScreenBright = true;
274+
gPowerManagerServiceObj = NULL;
275+
gPowerModule = NULL;
267276
return 0;
268277
}
269278

0 commit comments

Comments
 (0)