summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross2012-09-21 20:39:17 -0500
committerColin Cross2012-09-21 20:39:17 -0500
commitb98865586bcf7779150c461b64e4fe49972f6351 (patch)
treec4e2e66f82233ac5935c9dcf3b2781995c221bfb /libsuspend
parent96094ae27c4deac8b0dde8e3c6a479b249cecb72 (diff)
downloadplatform-system-core-b98865586bcf7779150c461b64e4fe49972f6351.tar.gz
platform-system-core-b98865586bcf7779150c461b64e4fe49972f6351.tar.xz
platform-system-core-b98865586bcf7779150c461b64e4fe49972f6351.zip
libsuspend: force autosleep off during init
If autosuspend_autosleep_init is called when autosleep is enabled, for example after a runtime restart with the screen off, the kernel autosleep state will be enabled, but autosuspend_enabled is false. Further calls to autosuspend_disable by the framework will not result in autosleep being disabled. Call autosuspend_autosleep_disable from autosuspend_autosleep_init to get the kernel state into a known state that matches the autosuspend_enabled flag. Bug: 7119416 Change-Id: I8611e4fd256838272aad4382c2340508805b0376
Diffstat (limited to 'libsuspend')
-rw-r--r--libsuspend/autosuspend_autosleep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsuspend/autosuspend_autosleep.c b/libsuspend/autosuspend_autosleep.c
index dd0dfefe7..5451615c3 100644
--- a/libsuspend/autosuspend_autosleep.c
+++ b/libsuspend/autosuspend_autosleep.c
@@ -95,5 +95,8 @@ struct autosuspend_ops *autosuspend_autosleep_init(void)
95 } 95 }
96 96
97 ALOGI("Selected autosleep\n"); 97 ALOGI("Selected autosleep\n");
98
99 autosuspend_autosleep_disable();
100
98 return &autosuspend_autosleep_ops; 101 return &autosuspend_autosleep_ops;
99} 102}