Java Openbinder Extension

Total Page:16

File Type:pdf, Size:1020Kb

Java Openbinder Extension Java OpenBinder Extension Radu-Corneliu Marin Daniel Urda Nicolae-Vladimir Bozdog School of Computer Science and School of Computer Science and School of Computer Science and Automatic Control Automatic Control Automatic Control Politehnica University Politehnica University Politehnica University Bucharest, Romania Bucharest, Romania Bucharest, Romania Email: [email protected] Email: [email protected] Email: [email protected] Abstract—Although Java is renowned for its myriad feature a Java techonology, is easily integrated into basic Java code, set, we found that it lacks in performant Inter-Process Commu- but because it was designed and implemented for transparent nication. A somewhat recent development in said domain, the remote calls on machines over a network, it has a consistent OpenBinder C/C++ framework, has introduced a novel inter- process communication abstraction which we believe could be overhead in dealing with an IPC call. easily extended into Java by using the Java Native Interface. In our paper, we present a novel inter-process communica- In our paper, we introduce JOBe, namely the Java OpenBinder tion method based on a native C++ solution, namely Open- extension. Such an endeavor has been attempted a few years Binder. The basic difference between this solution and the back, when the Google team that developed Android designed previously mentioned solutions, is that OpenBinder is strictly and implemented the core of the aforementioned software stack: the Binder framework. Based on their concepts, we are extending oriented for IPC, as opposed to the latter. Instead of using the OpenBinder framework into Java as to offer extremly flexible sockets for correspondence between processes, OpenBinder Remote Method Invocation, based on the Binder abstraction. has introduced a unique method: passing a method call to a Linux kernel module, which, in turn, reifies the identity I. INTRODUCTION of the caller and of the callee and forwards the call to the As Java is growing in popularity, its flaws are becoming remote process (and in fact returns the result back to the more apparent each day. One of the most pressing limitations, caller). Therefore, porting such a solution into Java is not it being the one we are interested in, is the lack of performant compatible with most operating systems, other than some IPC - inter-process communication - methods. Linux distributions. This issue is of no concern for us, as A rudimentary technique in Java for communication be- OpenBinder can be ported onto other platforms as well, while tween processes (and even for programs written in different the Java interfaces remain untouched. programming languages) is using a protocol over sockets in Our paper is structured as following: Section 2 presents order to broker correspondence between two ore more entities the background for our work, most importantly it describes running in the same process or in other processes, on the OpenBinder and Android’s Java extension for it. In Section 3, same machine or on remote machines. Such a method is we present the design and architecture of our solution, whilst cumbersome to use, it implies a huge amount of effort to Section 4 entails its implementation and issue coverage. We design, to implement, to maintain and to debug secure inter- end our work with our observations, conclusions and plans for process communication. We consider such a method as being forthcomming features in Section 5, respectively Section 6. obsolete and do not consider it to be valid. For years now, many frameworks and standards have been II. RELATED WORK developed for RPC - remote process calls - or for distributed Although OpenBinder introduces numerous interesting con- objects, such as XML-RPC, respectively CORBA, and most of cepts, it has not yet been popularized or documented. This them have received praise, though none managed to become is mostly due to the fact that the OpenBinder project was a de facto standard in said domain. Although, not one of abandoned about the time that Android’s Binder was being these solutions were designed with respect to inter-process designed and implemented. Therefore, we feel obliged to communication, they represent valid choices in this direction. render a detailed description of the inner-workings of Open- Because these solutions present penalties, usually represented Binder and to provide an overview of Android’s view over by large time to execute the IPC call, we are not interested in the Binder mechanism. This second section is dedicated to them. the aforementioned subjects. Probably one of the most notable solutions for IPC in Java is RMI - Remote Method Invocation - which ”enables the A. OpenBinder programmer to create distributed Java technology-based to Dianne Hackborn, former manager of the OpenBinder Java technology-based applications, in which the methods of project and famous engineer at BeOS, PalmOS and currently remote Java objects can be invoked from other Java virtual Google, described OpenBinder as ”a new approach to operat- machines*, possibly on different hosts” [4]. RMI, being itself ing system design, in the same vein as a lot of other attempts at introducing a modern object oriented approach to operating threads awaiting Binder operations. system design” [2]. 4) BINDER SET REPLY TIMEOUT - sets timeout for The OpenBinder introduces an interesting abstraction, awaiting replies for Binder commands. namely the Binder, which is used to design and implement 5) BINDER SET MAX THREADS - set the number of a distributed component architecture by means of abstract threads in the thread pool. interfaces, their behaviour and their implementation: ”As long A Binder IPC operation is also called a Transaction. as you are using these interfaces, the actual object behind them Last, but not least, the kernel module has another key can be written in any language with Binder bindings, and exist responsability in the communication mechanism: it performs anywhere your own address space, in another process, or even mapping of objects from one process to another. An object (eventually) on another machine” [3]. reference has two mutually exclusive forms: an address - In broad strokes, OpenBinder is similar to CORBA on local references - and a handle - remote references. The local Unix, but unlike most distributed component architectures, the process sees a Binder reference as an address in its own Binder is ”system oriented rather than application oriented” address space, but when initiating a Transaction it sends a [3], in other words it is designed to support system-level com- 32bit handle to that reference, which the remote process sees ponents having its focus not on cross-network communication, as a point to the object in its local address space. The module but on inter-process communication. performs the translation between pointers and handlers, being The core of the framework is the smooved executable which the sole mapping manager. is the main Binder server. Its main purpose is to set up the That having been said, if the Binder module is inserted Binder environment by creating a Root Binder Context by into the kernel, the smooved executable has the responsability dint of which components (such as services) will be made of becoming the global host of the root namespace created available. The smooved executable is also responsible for start- by the kernel module, in other words smooved assumes the ing the Package Manager, which will host the components, role of host of the root SContext namespace. Each Binder and for starting the Process Manager, which will run the is passed in a reference of Context representing the link to components in. the OpenBinder environment. For situations in which Binders The Binder abstraction alone is used only for intra-process are not present, references to Context can be obtained from communication and, in order to take advantage of the multi- the smooved process by means of the SContext class as process bindings, the OpenBinder kernel module needs to be following: built and inserted into the kernel. The module’s main purpose SContext SystemContext() is to create and manage a thread pool which takes care of 1) the inter-process bindings, also called a root namespace. It is This method is a back-door to obtaining the root or sys- designed as a character device placed in /dev/binder and it tem context. Although it is initially created by smooved is interfaced by means of ioctl calls. The Binder module is with full permissions, access to it is restricted and may responsible for reifying the identity of the calling process and not return a valid context. SContext UserContext() the identity of the callee process. It marshals the parameters 2) sent for the remote method invocation and the results returned This method is a back-door to obtaining the global user after execution through the kernel from the host process to context. This returns the least-trusted context which is the remote process and back. The custom kernel module always guaranteed to exist, but the functionality offered is used instead of standard Linux IPC facilities in order by it is fairly limited. to model IPC operations as thread migration. Although this OpenBinder also offers a Support Kit consisting of a suite component is optional (all other OpenBinder features will of classes and utilities which ease the development of Binders. function properly without it), it is the backbone of the inter- The most significant components are the following: process communication solution. 1) SValue The reification process in the kernel module is done by The SValue is a generic container for a blob of bytes that means of file descriptors: if a user-space thread participates has a type code associated with it. Its most significant in Binder IPC, it has to open the /dev/binder and the file feature is its genericity: it can contain complex data descriptor obtained is used to identity the initiator and recipient structures or simple typed data.
Recommended publications
  • Retrofitting Privacy Controls to Stock Android
    Saarland University Faculty of Mathematics and Computer Science Department of Computer Science Retrofitting Privacy Controls to Stock Android Dissertation zur Erlangung des Grades des Doktors der Ingenieurwissenschaften der Fakultät für Mathematik und Informatik der Universität des Saarlandes von Philipp von Styp-Rekowsky Saarbrücken, Dezember 2019 Tag des Kolloquiums: 18. Januar 2021 Dekan: Prof. Dr. Thomas Schuster Prüfungsausschuss: Vorsitzender: Prof. Dr. Thorsten Herfet Berichterstattende: Prof. Dr. Michael Backes Prof. Dr. Andreas Zeller Akademischer Mitarbeiter: Dr. Michael Schilling Zusammenfassung Android ist nicht nur das beliebteste Betriebssystem für mobile Endgeräte, sondern auch ein ein attraktives Ziel für Angreifer. Um diesen zu begegnen, nutzt Androids Sicher- heitskonzept App-Isolation und Zugangskontrolle zu kritischen Systemressourcen. Nutzer haben dabei aber nur wenige Optionen, App-Berechtigungen gemäß ihrer Bedürfnisse einzuschränken, sondern die Entwickler entscheiden über zu gewährende Berechtigungen. Androids Sicherheitsmodell kann zudem nicht durch Dritte angepasst werden, so dass Nutzer zum Schutz ihrer Privatsphäre auf die Gerätehersteller angewiesen sind. Diese Dissertation präsentiert einen Ansatz, Android mit umfassenden Privatsphäreeinstellun- gen nachzurüsten. Dabei geht es konkret um Techniken, die ohne Modifikationen des Betriebssystems oder Zugriff auf Root-Rechte auf regulären Android-Geräten eingesetzt werden können. Der erste Teil dieser Arbeit etabliert Techniken zur Durchsetzung von Sicherheitsrichtlinien
    [Show full text]
  • This Is the Architecture of Android. Android Runs on Top of a Vanilla Kernel with Little Modifications, Which Are Called Androidisms
    4. This is the architecture of Android. Android runs on top of a vanilla kernel with little modifications, which are called Androidisms. The native userspace, includes the init process, a couple of native daemons, hundreds of native libraries and the Hardware Abstraction Layer (HAL). The native libraries are implemented in C/C++ and their functionality is exposed to applications through Java framework APIs. A large part of Android is implemented in Java and until Android version 5.0 the default runtime was Dalvik. Recently a new, more performant runtime, called ART has been integrated in Android (first made available as an option in version 4.4, default runtime from version 5.0). Java runtime libraries are defined in java.* and javax.* packages, and are derived from Apache Harmony project (not Oracle/SUN, in order to avoid copyright and distribution issues.), but several components have been replaced, others extended and improved. Native code can be called from Java through the Java Native Interface (JNI). A large part of the fundamental features of Android are implemented in the system services: display, touch screen, telephony, network connectivity, and so on. A part of these services are implemented in native code and the rest in Java. Each service provides an interface which can be called from other components. Android Framework libraries (also called “the framework API”) include classes for building Android applications. On top, we have the stock applications, that come with the phone. And other applications that are installed by the user. 6. ● Most Linux distributions take the vanilla kernel (from Linux Kernel Archives) and apply their own patches in order to solve bugs, add specific features and improve performance.
    [Show full text]
  • Sarath Singapati Inter Process Communication in Android Master of Science Thesis
    SARATH SINGAPATI INTER PROCESS COMMUNICATION IN ANDROID MASTER OF SCIENCE THESIS Examiner: Professor Tommi Mikkonen Examiner and thesis subject approved by The Faculty of Computing and Electrical Engineering on 7th March 2012 II ABSTRACT TAMPERE UNIVERSITY OF TECHNOLOGY Master’s Degree Programme in Information Technology SARATH SINGAPATI INTER PROCESS COMMUNICATION IN ANDROID Master of Science Thesis, 45 pages, 4 Appendix pages June 2012 Major: Software Systems Examiner: Professor Tommi Mikkonen Keywords: Android, Google, mobile applications, Process, IPC Google's Android mobile phone software platform is currently the big opportunity for application software developers. Android has the potential for removing the barriers to success in the development and sale of a new generation of mobile phone application software. Just as the standardized PC and Macintosh platforms created markets for desktop and server software, Android, by providing a standard mobile phone application environment, creates a market for mobile applications and the opportunity for applica- tions developers to profit from those applications. One of the main intentions of Android platform is to eliminate the duplication of functionality in different applications to allow functionality to be discovered and in- voked on the fly, and to let users replace applications with others that offer similar func- tionality. The main problem here is how to develop applications that must have as few dependencies as possible, and must be able to provide services to other applications. This thesis studies the Android mobile operating system, its capabilities in develop- ing applications that communicate with each other and provide services to other applica- tions. As part of the study, a sample application called “Event Planner”, has been devel- oped to experiment how Inter Process Communication works in Android platform, ex- plains how to implement, and use Inter Process Communication (IPC).
    [Show full text]
  • Android's Security Model
    1 Android’S Security Model This chapter will first briefly introduce Android’s architecture, inter-process communication (IPC) mechanism, and main components. We then describe Android’s security model and how it relates to the underlying Linux security infrastructure and code signing. We conclude with a brief overview of some newer additions to Android’s security model, namely multi-user support, mandatory access control (MAC) based on SELinux, and verified boot. Android’s architecture and security model are built on top of the tra- ditional Unix process, user, and file paradigm, but this paradigm is not described from scratch here. We assume a basic familiarity with Unix-like systems, particularly Linux. Android’s Architecture Let’s briefly examine Android’s architecture from the bottom up. Figure 1-1 shows a simplified representation of the Android stack. Android Security Internals © 2014 by Nikolay Elenkov System Apps User-Installed Apps Settings/Phone/Launcher/... Android Framework Libraries Java android.* Runtime Libraries System Services java.* Activity Mgr./Package Mgr./Window Mgr./... javax.* Dalvik Runtime Native Native Init HAL Daemons Libraries Linux Kernel Figure 1-1: The Android architecture Linux Kernel As you can see in Figure 1-1, Android is built on top of the Linux kernel. As in any Unix system, the kernel provides drivers for hardware, networking, file- system access, and process management. Thanks to the Android Mainlining Project,1 you can now run Android with a recent vanilla kernel (with some effort), but an Android kernel is slightly different from a “regular” Linux kernel that you might find on a desktop machine or a non-Android embed- ded device.
    [Show full text]
  • Android Architecture and Binder
    ANDROID ARCHITECTURE AND BINDER DHINAKARAN PANDIYAN, SAKETH PARANJAPE 1. INTRODUCTION “Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers” [1]. Android is also the world’s most widely used smartphone platform having the highest market share. The platform is made of the open source operating system Android, devices that run it and an extensive repository of applications developed for the OS. The open source nature of the OS allows anybody to freely modify and distribute it. The OS has code written in Assembly, Java, C++ and C. The applications are primarily written in Java; however C++ can also be used. Google PlayStore, the application repository for Android, has more than 700,000 applications. The devices that run Android can have the hardware range from a bare minimum 32MB RAM, 200 MHz processor to those with a state-of-the-art Quad core processor and 2GB of RAM. The primary hardware platform is the ARM architecture. Android’s kernel was based on the Linux 2.6 kernel. The latest version of Android called Jelly Bean has the Linux kernel 3.0.3. Android has added new drivers to the kernel, middleware, libraries and an extensive set of APIs that aid application development on top of the kernel. The relevance of smartphones in today’s world, ubiquity of the Android operating system and intriguing customization of Linux to run on mobile devices make a compelling case to study Android. Through our project we tried to explore the Android software stack and its unique features, primarily the Inter Process Communication (IPC) mechanism – Binder.
    [Show full text]
  • 2020: "Binder IPC and Its Vulnerabilities"
    Binder Étude du mécanisme de communication interprocessus d'Android et de ses vulnérabilités - Binder IPC and its vulnerabilities Présenté 06/03/2020 Pour THCON 2020 Par Jean-Baptiste Cayrou Who I am Jean-Baptiste Cayrou ( @jbcayrou ) Synacktiv: Offensive security company > 60 ninjas 3 teams : pentest, reverse engineering, development Reverser at Synacktiv: Focus on low level reverse, vulnerability research, source code audit Work since several years on Android Binder articles on Synacktiv blog 2 / 97 Introduction Binder : Kernel Module for communications between Android processes in Android Hot topic Exploitation in the wild discovered by Google Recent critical vulnerabilities A lot of documentation for high level parts but missing for low level behavior :( => Start to study Binder internals 3 / 97 Summary Part I : Binder presentation Part II : Binder vulnerabilities Part III : Study of two binder patches 4 / 97 PART I - Presentation of Binder 5 / 97 History Android was bought by Google in 2008 Android is based on the Linux kernel with specific drivers Binder Ashmem Low Memory Killer Binder is based on OpenBinder implementation Developed by Be Inc and Palm. Lead by Dianne Hackborn now working at Google 6 / 97 Binder Features Kernel Module for IPC/RPC ~ 6000 lines of code in linux/drivers/android/binder_... Features : Send messages between applications (sync/async) Call remote function (RPC) Share file descriptors (file, ashmem) Manage references (strong, weak) on remote and local objects Binder messages
    [Show full text]
  • Evaluating Android OS for Embedded Real-Time Systems
    Evaluating Android OS for Embedded Real-Time Systems Claudio´ Maia, Lu´ıs Nogueira, Lu´ıs Miguel Pinho CISTER Research Centre School of Engineering of the Polytechnic Institute of Porto Porto, Portugal Email:{crrm,lmn,lmp}@isep.ipp.pt Abstract—Since its official public release, Android has cap- the use of a VM environment, with both its advantages and tured the interest from companies, developers and the general known problems. audience. From that time up to no!, this software platform Ne&ertheless, there are features which ha&e no' been has been constantly improved either in terms of features or supported hard!are and, at the same time, e"tended to new explored yet, as for instance the suitability of the platform types of devices different from the originally intended mobile to be used in Open Real-Time environments. Taking into ones. However, there is a feature that has not been explored consideration orks !ade in the past such as [4], [9], either yet - its real-time capabilities. concerning the Linux 5ernel or VM environments, there This paper intends to explore this gap and provide a basis is the possibility of introducing temporal guarantees allied for discussion on the suitability of Android in order to be used in Open Real-Time environments. By analysing the software with Quality of Service (QoS) guarantees in each of the platform, with the main focus on the virtual machine and its aforementioned layers, or e&en in both, in a ay that a underlying operating system environments, we are able to point possible integration !ay be achie&ed, fulfilling the temporal out its current limitations and, therefore, provide a hint on constraints imposed #% the applications.
    [Show full text]
  • Jarvis: Bridging the Semantic Gap Between Android Apis and System Calls
    Universitá di Pisa Laurea Magistrale in Computer Engineering Dipartimento di Ingegneria dell’Informazione Jarvis: Bridging the Semantic Gap between Android APIs and System Calls Supervisors: Candidate: Chiar.mo Prof. Gianluca Dini Tommaso Latini Chiar.ma Prof.ssa Cinzia Bernardeschi Chiar.mo Prof. Giovanni Vigna University Year 2013-2014 Abstract Android is an open-source operating system, based on the Linux kernel. Developed by Google, it is currently the most widespread mobile operating system, used by more than one billion users. Different solutions have been proposed to analyze the behavior of An- droid’s applications. Most of this approaches analyze applications at a high-level (e.g., they focus on the executed Java code) and they may miss operations performed by applications’ components natively written. For this reason, other approaches analyze applications’ behavior at the system- call level. However, given the complexity of the Android runtime library, using this low-level information to infer high-level behaviors is problematic. To bridge the semantic gap between high-level Android APIs and low- level system calls, we have developed Jarvis. Jarvis operates in two phases: an online data collection phase, and an offline data analysis phase. Specifically, during the online data collection phase, Jarvis records all the system calls executed by an application. In this phase, particular care is given to system calls used to communicate with Binder. Binder is an Android kernel module that manages most of the Inter-Process Commu- nication among installed applications and system components. Since, in Android, Binder is extensively used by every application to communicate with the operating system, analyzing data exchanged using it is crucial to understand the behavior of an application.
    [Show full text]
  • OS Perspective on Android
    OS Perspective on Android David E. Culler CS162 – Operating Systems and Systems Programming http://cs162.eecs.berkeley.edu/ Lecture 27 December 5, 2019 cs162 Recall: What is an operating system? • Special layer oF soFtware that provides application soFtware access to hardware resources – Convenient abstraction of complex hardware devices – Protected access to Shared resources – Security and Authentication – Communication amongst logical entities appln appln appln OS Hardware 12/5/19 UCB CS162 Fa19 L27 2 In OS news this term … 12/5/19 UCB CS162 Fa19 L27 3 State oF things • Pixel 4 shipped in Oct 2019 with Linux kernel 4.14, an LTS release from November 2017 and will be stuck there – “Thanks to kernel updates never happening, this means every new release of Android usually has to support the last three years of LTS (Long Term Support) kernel releases (the minimum for Android 10 is 4.9, a 2016 release). – it is still supporting kernel 3.18, which is five years old now. • Linux Kernel 5.4 mainline 11/25/2019 12/5/19 UCB CS162 Fa19 L27 4 But, what do you think ? • What direction will the Future of Linux take? • We have seen so many of the enhancements driven by the needs of the cloud – Proportional share scheduling – Cgroups / Containers – KVM – paravirtualization For virtual machines – Concurrency support – Journaling file system • Versus single-user small form factor android experience • Will software engineering aspects of THE most common platForm dictate? 12/5/19 UCB CS162 Fa19 L27 5 The System “stack” you now know Application runtime User
    [Show full text]
  • Android Binder IPC Mechanism
    Android IPC Mechanism Jim Huang ( 黃敬群 ) Developer, 0xlab [email protected] March 19, 2012 / 南台科大 Rights to copy © Copyright 2012 0xlab http://0xlab.org/ [email protected] Attribution – ShareAlike 3.0 You are free Corrections, suggestions, contributions and translations are welcome! to copy, distribute, display, and perform the work to make derivative works Latest update: Mar 21, 2012 to make commercial use of the work 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. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode Agenda (0) IPC: The heart of Android (1) Design Patterns (2) Binder IPC Internals (3) Use case: Graphics Binder IPC: The heart of Android Android Tasks Process A Process B Task Activity Activity Content Activity Provider .apk package Service .apk package 5 • Different component types – Activity Component View – Service – Content Provider – Broadcast Receiver Application Components System IPC = Inter-Process Communication Activity Activity Window Alarm Manager Manager Manager Kernel Why IPC? • Each process has its own address space • Provides data isolation • Prevents harmful direct interaction between two different processes – Sometimes, communication between processes is required for modularization IPC Mechanisms • In GNU/Linux – Signal – Pipe – Socket – Semaphore – Message queue – Shared memory • In Android – Binder: lightweight RPC (Remote Procedure Communication) mechanism 10 Binder History • Developed under the name OpenBinder by Palm Inc.
    [Show full text]
  • Inter-Process Communication Mechanism in Monolithic Kernel and Microkernel
    Inter-Process Communication Mechanism in Monolithic Kernel and Microkernel Rafika Ida Mutia Department of Electrical and Information Technology Lund University Sweden Abstract—The evolution from monolithic kernel to a Hence, microkernel is not a block of system services smaller size of kernel, microkernel, has theoretically proved anymore, instead it represents just several basic ab- an increase in the reliability and security of the system. A straction and primitives to control the communication smaller size of kernel minimized the probability of error in the code and minimized the bugs impact to the system between processes and between a process with the un- as well as makes the bugs fixing easier. However, reducing derlying hardware. Since the communication between the size of kernel means to move some of basic services processes is not done in direct way anymore, a message that used to reside in kernel space under privileged mode system is introduced. The message system allows inde- to the user space under deprivileged mode. The mechanism pendent communication and favour extensibility. for communication between process is no longer the same as in monolithic kernel, when all the process are reside in kernel space. This report aims to describe the details of Inter-Process Communication (IPC) mechanisms in both monolithic kernel and microkernel, with main focus of operating system used in mobile phone. Index Terms—IPC, monolithic kernel, microkernel, an- droid, OKL4 I. INTRODUCTION Kernel is the most important part of an operating system which consists of two parts, kernel space (priv- ileged mode) and user space (unprivileged mode). The early concept of kernel, monolithic kernel, dedicates all the basic system services like memory management, file system, interrupt handling and I/O communication in the privileged mode.
    [Show full text]
  • Android Internals Lecture 3
    Android Internals Lecture 3 Operating Systems Practical 19 October 2016 This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. OSP Android Internals, Lecture 3 1/43 Android Arhitecture Linux Kernel Binder Android Framework Managers OSP Android Internals, Lecture 3 2/43 Outline Android Arhitecture Linux Kernel Binder Android Framework Managers OSP Android Internals, Lecture 3 3/43 Android Architecture OSP Android Internals, Lecture 3 4/43 Outline Android Arhitecture Linux Kernel Binder Android Framework Managers OSP Android Internals, Lecture 3 5/43 Linux Kernel I "Androidized" kernel I Hundreds of patches over the standard kernel I Device-specific functionality, fixes, enhancements I Many features get into the mainline kernel I "Androidisms" I Wakelocks I Low-Memory Killer I Binder I Anonymous Shared Memory I Alarm I Logger OSP Android Internals, Lecture 3 6/43 Wakelocks I On desktops and laptops I The user decides when the system goes to sleep I The Android kernel goes to sleep as often as possible I Sometimes you want to keep the system from going to sleep I Input from the user, critical operations I Wakelocks keep the system awake OSP Android Internals, Lecture 3 7/43 Wakelocks I A wakelock must be obtained by the application when it needs to stay awake I Apps use abstractions that handle locking I Apps can request wakelocks directly from PowerManager Service I Device drivers call in-kernel wakelock primitives I Equivalent
    [Show full text]