Introduction to Android Window System



Similar documents
A Look through the Android Stack

Android Framework. How to use and extend it

How To Develop Android On Your Computer Or Tablet Or Phone

Android Fundamentals 1

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Chapter 14 Virtual Machines

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作

AppScope: Application Energy Metering Framework for Android Smartphones using Kernel Activity Monitoring

Android Developer Fundamental 1

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Oracle Database Security and Audit

Frysk The Systems Monitoring and Debugging Tool. Andrew Cagney

As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

Lab 4 In class Hands-on Android Debugging Tutorial

CSC 2405: Computer Systems II

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Effective Java Programming. efficient software development

ELEC 377. Operating Systems. Week 1 Class 3

Android Architecture. Alexandra Harrison & Jake Saxton

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

Harmonizing policy management with Murphy in GENIVI, AGL and TIZEN IVI

Introduction to Android Development. Ed Burnette

Computer Graphics Hardware An Overview

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Android Development. Marc Mc Loughlin

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Android Virtualization from Sierraware. Simply Secure

Mobile Application Languages XML, Java, J2ME and JavaCard Lesson 04 Java

Android Basics. Xin Yang

ITG Software Engineering

Windows NT. Chapter 11 Case Study 2: Windows Windows 2000 (2) Windows 2000 (1) Different versions of Windows 2000

Programming the Android Platform. Logistics

Android Systems Programming Tips and Tricks

Computer Security: Principles and Practice

Fundamentals of Computer Science (FCPS) CTY Course Syllabus

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Operating Systems. Virtual Memory

Practical Android Projects Lucas Jordan Pieter Greyling

Lecture 3: Modern GPUs A Hardware Perspective Mohamed Zahran (aka Z) mzahran@cs.nyu.edu

Solid State Storage in Massive Data Environments Erik Eyberg

Android Geek Night. Application framework

Inside Android's UI Embedded Linux Conference Europe 2012 Karim

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

CS423 Spring 2015 MP4: Dynamic Load Balancer Due April 27 th at 9:00 am 2015

Android Operating System

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

PIE. Internal Structure

Overview of CS 282 & Android

Network Layers. CSC358 - Introduction to Computer Networks

An Introduction to Android

Introduction to Android. CSG250 Wireless Networks Fall, 2008

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

Admin. Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources. Recap: TinyOS. Recap: J2ME Framework

ABAP for Functional Consultants

Pentesting Android Apps. Sneha Rajguru

Operating System Components and Services

ADB (Android Debug Bridge): How it works?

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

OpenPOWER Outlook AXEL KOEHLER SR. SOLUTION ARCHITECT HPC

PART I: WELCOME TO THE WONDERFUL WORLD OF ACCESSORIES CHAPTER 1: INTRODUCTION TO ANDROID OPEN ACCESSORY 3

Performance Analysis of Android Platform

Research and Design of Universal and Open Software Development Platform for Digital Home

TFE listener architecture. Matt Klein, Staff Software Engineer Twitter Front End

Profiling and Testing with Test and Performance Tools Platform (TPTP)

Example of Standard API

Architecture (SOSP 2011) 11/11/2011 Minsung Jang

Android Operating System:

Running SMB3.x over RDMA on Linux platforms

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Android Programming and Security

Towards Elastic Application Model for Augmenting Computing Capabilities of Mobile Platforms. Mobilware 2010

Exploiting nginx chunked overflow bug, the undisclosed attack vector

SAP NetWeaver Application Server architecture

CCA CYBER SECURITY TRACK

Whitepaper. Trans. for Mobile

Remote Desktop on Mobile

External Sorting. Chapter 13. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1

Optimizing AAA Games for Mobile Platforms

The Classical Architecture. Storage 1 / 36

How To Write A Windows Operating System (Windows) (For Linux) (Windows 2) (Programming) (Operating System) (Permanent) (Powerbook) (Unix) (Amd64) (Win2) (X

Parallel Algorithm Engineering

Chapter 6, The Operating System Machine Level

Citect and Microsoft Windows XP Service Pack 2

ORACLE INSTANCE ARCHITECTURE

Apache and Tomcat Clustering Configuration Table of Contents

Infrastructure that supports (distributed) componentbased application development

DIABLO VALLEY COLLEGE CATALOG

The Case for SE Android. Stephen Smalley Trust Mechanisms (R2X) National Security Agency

Transcription:

Chia-I Wu olv@0xlab.org May 15, 2009

Overview Interested Components Random Topics

Outline Overview Interested Components Overview Interested Components Random Topics

System Architecture Outline Overview Interested Components

System Architecture Outline Overview Interested Components

System Architecture Outline Overview Interested Components

Overview Interested Components There are more, but we focus on SurfaceManager WindowManager ActivityManager

Overview Interested Components SurfaceManager frameworks/base/libs/surfaceflinger/ a.k.a SurfaceFlinger Allocate surfaces. Backed by ashmem/pmem/? Composite surfaces

Overview Interested Components WindowManager frameworks/base/services/java/ com/android/server/windowmanagerservice.java About 9000 SLOC in one file. Poorly documented, bad namings,... (Ask SurfaceManager to) create/layout surfaces on behalf of the clients Dispatch input events to clients Transition animation WindowManagerPolicy

Overview Interested Components ActivityManager frameworks/base/services/java/ com/android/server/am/ Manage lifecycles of activities Manage stacking of activities Dispatch intents Spawn processes

Overview Interested Components Confusions An activity has one or more windows (e.g. dialogs) A window has one or more surfaces (e.g. surface views) However, in window manager, a window is called a session A surface is called a window And an activity becomes roughly a token

Overview Interested Components Special Keys HOME key BACK key

Outline Random Topics Overview Interested Components Random Topics

Random Topics Process View SurfaceManager, WindowManager, and SurfaceManager are threads of a single process (system server) Every application is usually a process of itself

Random Topics Zygote Is a process started on system initialization Preloads java classes and resources Forks system server Listens silently on /dev/socket/zygote

Random Topics Binder Early in the lifetime of an application process, thread(s) are created and blocked on /dev/binder Binder is used mainly for RPC Fragile

Outline Overview Interested Components Random Topics

Build System build/core/core/build-system.html. build/envsetup.sh showcommands export ANDROID JAVA HOME if non-standard

adb ADBHOST for transport over TCP/IP kill-server remount pull/push logcat shell

hierarchyviewer Display view hierarchy Display view Invalidate/Relayout

Graphics: Memory Management SurfaceFlinger has a SurfaceHeapManager Every client has a MemoryDealer, as returned by SurfaceHeapManager Every surface of a client also has dealer(s), from client or GPU

Graphics: Memory Management cont. A dealer consists of a heap and an allocator A heap represents a sharable big chunk of memory An allocator is an algorithm Small chunks of memory from the heap are returned

Graphics: Memory Management cont. Real flow A client asks for a new surface, createsurface

Graphics: Memory Management cont. Real flow A client asks for a new surface, createsurface createsurface calls createnormalsurfacelocked

Graphics: Memory Management cont. Real flow A client asks for a new surface, createsurface createsurface calls createnormalsurfacelocked A layer is created and setbuffers is called to allocate buffers

Graphics: Memory Management cont. Real flow A client asks for a new surface, createsurface createsurface calls createnormalsurfacelocked A layer is created and setbuffers is called to allocate buffers Two dealers are created from client, one for front buffer and one for back buffer

Graphics: Memory Management cont. Real flow A client asks for a new surface, createsurface createsurface calls createnormalsurfacelocked A layer is created and setbuffers is called to allocate buffers Two dealers are created from client, one for front buffer and one for back buffer Two LayerBitmaps are created, initialized with the two dealers

Graphics: Memory Management cont. Real flow A client asks for a new surface, createsurface createsurface calls createnormalsurfacelocked A layer is created and setbuffers is called to allocate buffers Two dealers are created from client, one for front buffer and one for back buffer Two LayerBitmaps are created, initialized with the two dealers Heaps of dealers along with info about the layer are returned

Hello World Outline http://people.debian.org.tw/ olv/surfaceflinger/demo.tar.gz

Many Buffers Surface is double buffered EGLDisplaySurface is double buffered Same technique; Different code pathes, different purposes

Double Buffering Sofware v.s. Hardware Memory copy Page flipping

Dirty Region Associate buffers with dirty regions Copy back

Frame 0 Outline

Frame 1 Outline

Frame 2 Outline

Outline Overview Interested Components Random Topics

Questions?