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

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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