[Android] Screen off does not work when wakelocks are released.

Recently I run into an issue that the screen would never sleep when the timeout is arrived.  And the lock pattern also did not go back to screen off state when no input in the time limit. This issue can be reproduced when you use an android-2.1_r2 system.img built from the framework in the emulator.

1. menu -> Settings -> About phone -> Status -> Battery status. Check if the battery status is “Charging (AC)”.

2. menu -> Settings -> Applications -> Development -> Stay awake. Check if it is enabled. If  yes, the screen will never sleep while charging.

We can simply turn off the “Stay awake” switch to allow the screen off when charging.

Leave a comment