SlideShare a Scribd company logo
1 of 28
Download to read offline
Android internals
     Egor Elizarov
     SPbSU 2012
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
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
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
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
Linux suspend/resume flow




            6          Egor Elizarov SPbSU 2012
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
Power Managment subsystem




            8         Egor Elizarov SPbSU 2012
HID Input device classes


    Keyboards (qwerty, hard keys)

    Cursor (Mouse, trackball)

    Multitouch (Touchscreen)

    External (IR/Bluetooth remote control)

    etc. (frameworks/base/services/input/EventHub.h)


                            9                     Egor Elizarov SPbSU 2012
Input subsystem




       10         Egor Elizarov SPbSU 2012
Control points


    Driver and Firmware Configuration

    Board Configuration Properties

    Resource Overlays
    (frameworks/base/core/res/res/values/config.xml)


    Key Maps (Ex: device/samsung/tuna/tuna-gpio-keypad.kl)

    Input Device Configuration Files (Ex:
    device/samsung/tuna/Melfas_MMSxxx_Touchscreen.idc)

                               11                      Egor Elizarov SPbSU 2012
Event codes




     12       Egor Elizarov SPbSU 2012
System files
●
    Key layout files
    (device/samsung/tuna/tuna-gpio-keypad.kl)



●
    Key character map files
    (device/samsung/tuna/tuna-gpio-keypad.kl)



●
    Input device
    configuration files
    (device/samsung/tuna/Melfas_MMSxxx_T
    ouchscreen.idc)




                                        13      Egor Elizarov SPbSU 2012
Sensor types




     14        Egor Elizarov SPbSU 2012
Sensor subsystem




       15          Egor Elizarov SPbSU 2012
HAL/Kernel interaction



    No unified interface

    SysFs

    DevFs

    Industrial input output system
    (kernel/drivers/staging/iio)



                                   16   Egor Elizarov SPbSU 2012
Sensor settings




       17         Egor Elizarov SPbSU 2012
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
Raw data example




       19          Egor Elizarov SPbSU 2012
Noise reduction approaches


    Polynomial approximation

    Evaluation of derivatives

    Integrators

    Kalman filters

    etc


                          20    Egor Elizarov SPbSU 2012
Data storage


    Shared preferencies

    Internal storage

    External storage

    SQLite DB

    Network connection


                          21    Egor Elizarov SPbSU 2012
FS types


    RootFs (linux permission support)
    
        Ext*
    
        yaffs
    
        ubifs

●
    External storage (same uid/gid for all files)
    
        Fat
    
        Ntfs / ntfs-3g

                            22                      Egor Elizarov SPbSU 2012
External storage




       23          Egor Elizarov SPbSU 2012
SQLite DB




    24      Egor Elizarov SPbSU 2012
Next Time




    Profiling /
    Debugging

    WiFi / BT / RIL




                      25      Egor Elizarov SPbSU 2012
Useful links


    http://vk.com/android_internals


    http://docs.fedoraproject.org/en-
    US/Fedora/15/html/Power_Management_Guide/index.html


    http://kzjblog.appspot.com/2010/11/20/suspend-en.html


    http://developer.android.com/reference/android/os/PowerManager.html


    http://source.android.com/tech/input/overview.html



                                  26                        Egor Elizarov SPbSU 2012
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
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

More Related Content

What's hot

Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Egor Elizarov
 
Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Egor Elizarov
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updatesGary Bisson
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Playing Video with ExoPlayer : Android Bangkok 2018
Playing Video with ExoPlayer : Android Bangkok 2018Playing Video with ExoPlayer : Android Bangkok 2018
Playing Video with ExoPlayer : Android Bangkok 2018Minseo Chayabanjonglerd
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesChris Simmonds
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Sarath C
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 

What's hot (18)

Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)
 
Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Exoplayer 2
Exoplayer  2Exoplayer  2
Exoplayer 2
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Hacking Android OS
Hacking Android OSHacking Android OS
Hacking Android OS
 
Playing Video with ExoPlayer : Android Bangkok 2018
Playing Video with ExoPlayer : Android Bangkok 2018Playing Video with ExoPlayer : Android Bangkok 2018
Playing Video with ExoPlayer : Android Bangkok 2018
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
How To Build Android for ARM Chip boards
How To Build Android for ARM Chip boardsHow To Build Android for ARM Chip boards
How To Build Android for ARM Chip boards
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
Android 10
Android 10Android 10
Android 10
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Android Custom Kernel/ROM design
Android Custom Kernel/ROM designAndroid Custom Kernel/ROM design
Android Custom Kernel/ROM design
 

Similar to Android internals 09 - Sensors, Power Management, Input subsystem, Data storage (rev_1.1)

Useful USB Gadgets on Linux
Useful USB Gadgets on LinuxUseful USB Gadgets on Linux
Useful USB Gadgets on LinuxGary Bisson
 
Implementing a LED LightBar solution on Android system
Implementing a LED LightBar solution on Android systemImplementing a LED LightBar solution on Android system
Implementing a LED LightBar solution on Android systemCheng Wig
 
Introduction to Test Execution Automation Framework for Embedded Systems
Introduction to Test Execution Automation Framework for Embedded SystemsIntroduction to Test Execution Automation Framework for Embedded Systems
Introduction to Test Execution Automation Framework for Embedded SystemsHiroshiMisawa
 
SiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_DoinSiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_DoinJonny Doin
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSLYoss Cohen
 
Fine-grained fault tolerance using device checkpoints
Fine-grained fault tolerance using device checkpointsFine-grained fault tolerance using device checkpoints
Fine-grained fault tolerance using device checkpointsasimkadav
 
All your legos are belong to Us Gr8Conf.EU 2015
All your legos are belong to Us Gr8Conf.EU 2015All your legos are belong to Us Gr8Conf.EU 2015
All your legos are belong to Us Gr8Conf.EU 2015Ryan Vanderwerf
 
Designing An Android Sensor Subsystem and Solving Common Sensor Problems
Designing An Android Sensor Subsystem and Solving Common Sensor ProblemsDesigning An Android Sensor Subsystem and Solving Common Sensor Problems
Designing An Android Sensor Subsystem and Solving Common Sensor ProblemsJen Costillo
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Roger Brinkley
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughBenjamin Zores
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in actionStefano Sanna
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation Jiann-Fuh Liaw
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...jaxLondonConference
 
The Architecture of Intel Processor Graphics: Gen 11
The Architecture of Intel Processor Graphics: Gen 11The Architecture of Intel Processor Graphics: Gen 11
The Architecture of Intel Processor Graphics: Gen 11DESMOND YUEN
 
The Architecture of 11th Generation Intel® Processor Graphics
The Architecture of 11th Generation Intel® Processor GraphicsThe Architecture of 11th Generation Intel® Processor Graphics
The Architecture of 11th Generation Intel® Processor GraphicsIntel® Software
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Anna Shymchenko
 
Eclipse Neon Webinar - JSDT 2.0
Eclipse Neon Webinar - JSDT 2.0Eclipse Neon Webinar - JSDT 2.0
Eclipse Neon Webinar - JSDT 2.0Ilya Buziuk
 

Similar to Android internals 09 - Sensors, Power Management, Input subsystem, Data storage (rev_1.1) (20)

Useful USB Gadgets on Linux
Useful USB Gadgets on LinuxUseful USB Gadgets on Linux
Useful USB Gadgets on Linux
 
Implementing a LED LightBar solution on Android system
Implementing a LED LightBar solution on Android systemImplementing a LED LightBar solution on Android system
Implementing a LED LightBar solution on Android system
 
Introduction to Test Execution Automation Framework for Embedded Systems
Introduction to Test Execution Automation Framework for Embedded SystemsIntroduction to Test Execution Automation Framework for Embedded Systems
Introduction to Test Execution Automation Framework for Embedded Systems
 
SiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_DoinSiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_Doin
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
 
Fine-grained fault tolerance using device checkpoints
Fine-grained fault tolerance using device checkpointsFine-grained fault tolerance using device checkpoints
Fine-grained fault tolerance using device checkpoints
 
All your legos are belong to Us Gr8Conf.EU 2015
All your legos are belong to Us Gr8Conf.EU 2015All your legos are belong to Us Gr8Conf.EU 2015
All your legos are belong to Us Gr8Conf.EU 2015
 
Designing An Android Sensor Subsystem and Solving Common Sensor Problems
Designing An Android Sensor Subsystem and Solving Common Sensor ProblemsDesigning An Android Sensor Subsystem and Solving Common Sensor Problems
Designing An Android Sensor Subsystem and Solving Common Sensor Problems
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40
 
Slimline Open Firmware
Slimline Open FirmwareSlimline Open Firmware
Slimline Open Firmware
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
 
The Architecture of Intel Processor Graphics: Gen 11
The Architecture of Intel Processor Graphics: Gen 11The Architecture of Intel Processor Graphics: Gen 11
The Architecture of Intel Processor Graphics: Gen 11
 
The Architecture of 11th Generation Intel® Processor Graphics
The Architecture of 11th Generation Intel® Processor GraphicsThe Architecture of 11th Generation Intel® Processor Graphics
The Architecture of 11th Generation Intel® Processor Graphics
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9
 
Eclipse Neon Webinar - JSDT 2.0
Eclipse Neon Webinar - JSDT 2.0Eclipse Neon Webinar - JSDT 2.0
Eclipse Neon Webinar - JSDT 2.0
 

Recently uploaded

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Android internals 09 - Sensors, Power Management, Input subsystem, Data storage (rev_1.1)

  • 1. Android internals Egor Elizarov SPbSU 2012
  • 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
  • 6. Linux suspend/resume flow 6 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
  • 8. Power Managment subsystem 8 Egor Elizarov SPbSU 2012
  • 9. HID Input device classes  Keyboards (qwerty, hard keys)  Cursor (Mouse, trackball)  Multitouch (Touchscreen)  External (IR/Bluetooth remote control)  etc. (frameworks/base/services/input/EventHub.h) 9 Egor Elizarov SPbSU 2012
  • 10. Input subsystem 10 Egor Elizarov SPbSU 2012
  • 11. Control points  Driver and Firmware Configuration  Board Configuration Properties  Resource Overlays (frameworks/base/core/res/res/values/config.xml)  Key Maps (Ex: device/samsung/tuna/tuna-gpio-keypad.kl)  Input Device Configuration Files (Ex: device/samsung/tuna/Melfas_MMSxxx_Touchscreen.idc) 11 Egor Elizarov SPbSU 2012
  • 12. Event codes 12 Egor Elizarov SPbSU 2012
  • 13. System files ● Key layout files (device/samsung/tuna/tuna-gpio-keypad.kl) ● Key character map files (device/samsung/tuna/tuna-gpio-keypad.kl) ● Input device configuration files (device/samsung/tuna/Melfas_MMSxxx_T ouchscreen.idc) 13 Egor Elizarov SPbSU 2012
  • 14. Sensor types 14 Egor Elizarov SPbSU 2012
  • 15. Sensor subsystem 15 Egor Elizarov SPbSU 2012
  • 16. HAL/Kernel interaction  No unified interface  SysFs  DevFs  Industrial input output system (kernel/drivers/staging/iio) 16 Egor Elizarov SPbSU 2012
  • 17. Sensor settings 17 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
  • 19. Raw data example 19 Egor Elizarov SPbSU 2012
  • 20. Noise reduction approaches  Polynomial approximation  Evaluation of derivatives  Integrators  Kalman filters  etc 20 Egor Elizarov SPbSU 2012
  • 21. Data storage  Shared preferencies  Internal storage  External storage  SQLite DB  Network connection 21 Egor Elizarov SPbSU 2012
  • 22. FS types  RootFs (linux permission support)  Ext*  yaffs  ubifs ● External storage (same uid/gid for all files)  Fat  Ntfs / ntfs-3g 22 Egor Elizarov SPbSU 2012
  • 23. External storage 23 Egor Elizarov SPbSU 2012
  • 24. SQLite DB 24 Egor Elizarov SPbSU 2012
  • 25. Next Time  Profiling / Debugging  WiFi / BT / RIL 25 Egor Elizarov SPbSU 2012
  • 26. Useful links  http://vk.com/android_internals  http://docs.fedoraproject.org/en- US/Fedora/15/html/Power_Management_Guide/index.html  http://kzjblog.appspot.com/2010/11/20/suspend-en.html  http://developer.android.com/reference/android/os/PowerManager.html  http://source.android.com/tech/input/overview.html 26 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