2. Legal info
Android internals by Egor Elizarov is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
You are free to
– copy, distribute, display, and perform the work
– make derivative works
Under the following conditions
– Attribution. You must give the original author credit
– Share Alike. If you alter, transform, or build upon this work, you may
distribute the resulting work only under a license identical to this one
All pictures and trademarks are the property of their respective owners. Use of
these trademarks and pictures is subject to owners permissions.
Corrections, suggestions, contributions and translations are welcome!
2 Egor Elizarov SPbSU 2012
3. Lecture 9
Power Management
Input subsystem
Sensors
Data storage
yegor.yelizarov(at)gmail.com
Rev: 1.1 http://vk.com/android_internals
Last update: 06/01/2012
3 Egor Elizarov SPbSU 2012
4. Previous time
Linux boot flow
Android boot flow
Android init
Main media related services
Standard media player components
Video HW acceleration
4 Egor Elizarov SPbSU 2012
5. Power Managment basics
An idle CPU should only wake up when needed
Unused hardware and devices should be disabled
completely
Low activity should translate to low wattage
PM standards
– ACPI (Advanced Configuration and Power Interface) -
Mostly x86 specific
– APM (Advanced Power Management) - outdated
5 Egor Elizarov SPbSU 2012
7. Android Power Managment
Wakelocks
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
*If you hold a partial wakelock, the CPU will continue to run, irrespective of any timers and even after the user presses the power
button. In all other wakelocks, the CPU will run, but the user can still put the device to sleep using the power button.
Early Suspend (disable some devices)
Interaction with kernel through SysFs
Android kernel PM on top of Linux PM
7 Egor Elizarov SPbSU 2012
18. Input noise reduction
Needed for both sensors and input devices
Usually implemented in HW or FW
Precision vs jittering
Using of previous/next values
18 Egor Elizarov SPbSU 2012
27. Useful links (2)
http://developer.android.com/guide/topics/sensors/index.html
Savitzky, A.; Golay, M.J.E. (1964). "Smoothing and
Differentiation of Data by Simplified Least Squares Procedures".
Analytical Chemistry 36 (8): 1627–1639.
doi:10.1021/ac60214a047
http://developer.android.com/guide/topics/data/data-storage.html
27 Egor Elizarov SPbSU 2012
28. Thanks to
Sergey Matyukevich for review and advices
(www.linkedin.com/pub/sergey-
matyukevich/31/889/769)
Nikolay F. Fominykh for review and advices
Vladimir Barinov for review and advices
(http://www.linkedin.com/pub/vladimir-
barinov/2a/18a/bab)
28 Egor Elizarov SPbSU 2012