summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2012-05-11 19:33:17 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-05-11 19:33:17 -0700
commit11cfd0d41f3c848ffd54ba650aa921d5224e7917 (patch)
tree28a3e3533b5677c07a2bd690353363e6b7682edc
parent58770232216cd735afdfd3dd53151070e06de5ce (diff)
parent30e5eb4826a2b6880fb8ef3844206cc5ffd13ed9 (diff)
Merge "Tell power HAL when user activity occurs." into jb-dev
-rw-r--r--services/jni/com_android_server_PowerManagerService.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/jni/com_android_server_PowerManagerService.cpp b/services/jni/com_android_server_PowerManagerService.cpp
index 2077469f809c..a47f8fddd492 100644
--- a/services/jni/com_android_server_PowerManagerService.cpp
+++ b/services/jni/com_android_server_PowerManagerService.cpp
@@ -83,6 +83,13 @@ bool android_server_PowerManagerService_isScreenBright() {
}
void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType) {
+ if (gPowerModule) {
+ // Tell the power HAL when user activity occurs.
+ if (gPowerModule->powerHint) {
+ gPowerModule->powerHint(gPowerModule, POWER_HINT_INTERACTION, NULL);
+ }
+ }
+
if (gPowerManagerServiceObj) {
// Throttle calls into user activity by event type.
// We're a little conservative about argument checking here in case the caller
@@ -264,6 +271,8 @@ int register_android_server_PowerManagerService(JNIEnv* env) {
}
gScreenOn = true;
gScreenBright = true;
+ gPowerManagerServiceObj = NULL;
+ gPowerModule = NULL;
return 0;
}