SlideShare utilise les cookies pour améliorer les fonctionnalités et les performances, et également pour vous montrer des publicités pertinentes. Si vous continuez à naviguer sur ce site, vous acceptez l’utilisation de cookies. Consultez nos Conditions d’utilisation et notre Politique de confidentialité.
SlideShare utilise les cookies pour améliorer les fonctionnalités et les performances, et également pour vous montrer des publicités pertinentes. Si vous continuez à naviguer sur ce site, vous acceptez l’utilisation de cookies. Consultez notre Politique de confidentialité et nos Conditions d’utilisation pour en savoir plus.
UzumApps Copyright 2013
What is wakelock?
Wakelock is the Android feature which can
be used by apps to override deep sleep and
control power management of device:
● Keep CPU awake (at high frequency)
● Turn on the screen
● Keep the screen on
Like in any other portable device when there is no User Interaction,
the device enters into deep sleep mode, in which it uses the minimum
power to prolong battery life.
Usually, before entering into deep sleep mode:
○ First screen dims
○ Then screen turns off
○ Finally, CPU switches to the lowest frequency (sleeps)
Why wakelock is bad?
● Wakelock enables apps to do tasks transparently in the
background, without user's awareness. Which might
waste battery power, network data and other resources.
● Apps can switch on the screen without user's intention.
This can be quite annoying for the users.
● Buggy apps; Whenever the wakelock is acquired, it
must be released, otherwise it can cause sleepless
(insomniac) phone. The phone's CPU keeps running or
the screen won't turn off
Who benefits from
● People who suffer from extreme battery drain, even
when they are not using phone (this is caused by CPU
● People who are annoyed by random Screen wake-ups
(this one is caused by screen-wakelocks)
● People who don’t know which app is keeping their
screen on continuously (this one caused by unreleased
Wakelock Types in Android System
Android PowerManager supports 4 kind of wakelocks
for developers, which are used in acquire/release method :
Wakelock Type CPU Screen Keyboard
PARTIAL_WAKE_LOCK On* Off Off
SCREEN_DIM_WAKE_LOCK On Dim Off
SCREEN_BRIGHT_WAKE_LOCK On Bright Off
FULL_WAKE_LOCK On Bright Bright
○ PARTIAL_WAKE_LOCK must be released by developer after acquiring, otherwise it
causes sleepless mode
○ Other wakelock types(screen related wakelocks) are released automatically when
the user presses Power Button
○ By using ACQUIRE_CAUSES_WAKE_UP flag developers can turn on the screen
while acquiring one of above wakelock types
Wakelock types in WLD
To simplify the types of wakelocks “Wakelock detector”
combines them into 2 types:
● CPU wakelocks
● Screen wakelocks
What is “Wakeup triggers”
In Android, there is a feature called “AlarmManager”
which can be used by other apps to schedule periodic tasks
(e.g: Facebook schedules a task that checks for new
events every 5 minutes).
This causes the phone to wake-up from its deep sleep
mode for certain period of time.
“Wakeup triggers” shows those apps which triggered the
periodic tasks. It shows the exact amount of how many times the
phone has been awaken by the app. By reducing these wakeups
the battery life will be prolonged significantly (e.g: Reduce
update(refresh) rate of Weather widgets..)
Since when wakelock statistics
in WLD is shown
The Battery management service of Android resets
(nullifies) accumulated battery statistics (including wakelock
statistics) in two cases:
● while rebooting phone
● when the phone is unplugged with battery level above
In Wakelock detector you can see statistics either since
the time when it was reset or since the time when you
unplugged the cable.
If you choose “since unplug” then you have shorter
duration but more sophisticated wakelock statistics shown.