From b98865586bcf7779150c461b64e4fe49972f6351 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 21 Sep 2012 18:39:17 -0700 Subject: [PATCH] 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 --- libsuspend/autosuspend_autosleep.c | 3 +++ 1 file changed, 3 insertions(+) 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) } ALOGI("Selected autosleep\n"); + + autosuspend_autosleep_disable(); + return &autosuspend_autosleep_ops; }