Slide 1

Slide 1 text

AOSP building blocks

Slide 2

Slide 2 text

Daniele Bonaldo @danybony_ +DanieleBonaldo danybony Android Software Craftsman

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Repo and manifest Usually a single project = single repository

Slide 5

Slide 5 text

Repo and manifest AOSP = more than 450 repositories

Slide 6

Slide 6 text

Repo and manifest Enter repo

Slide 7

Slide 7 text

Repo and manifest repo init -u http://your.company.repo/manifest -b working_branch -m manifest_name.xml

Slide 8

Slide 8 text

Repo and manifest [...]

Slide 9

Slide 9 text

Repo and manifest

Slide 10

Slide 10 text

Repo and manifest

Slide 11

Slide 11 text

Repo and manifest

Slide 12

Slide 12 text

Repo and manifest

Slide 13

Slide 13 text

Repo and manifest repo sync -j (--jobs)

Slide 14

Slide 14 text

AOSP Source Code http://elinux.org/Master-android

Slide 15

Slide 15 text

AOSP Source Code Some examples: ● development ● frameworks ● packages ● vendor

Slide 16

Slide 16 text

Edit the source Jack M. on Flickr

Slide 17

Slide 17 text

IDE ./development/tools/idegen/idegen.sh Project definition files generated in the root of the working dir

Slide 18

Slide 18 text

Search the source

Slide 19

Slide 19 text

@hide Context.sendBroadcastAsUser(Intent, UserHandle); Context.startActivityAsUser(Intent, UserHandle); Context.startServiceAsUser(Intent, UserHandle); @hide public UserHandle(int userId)

Slide 20

Slide 20 text

@hide public UserHandle(int userId) @hide

Slide 21

Slide 21 text

@hide public static UserHandle getUserHandleForUser(int userId) { try { Class userHandleClass = UserHandle.class; Constructor constructor = userHandleClass.getDeclaredConstructor(int.class); constructor.setAccessible(true); return constructor.newInstance(userId); } catch (InvocationTargetException e) { logUnableToFetchUserHandleForUser(userId, e); } catch (NoSuchMethodException e) { logUnableToFetchUserHandleForUser(userId, e); } catch (InstantiationException e) { logUnableToFetchUserHandleForUser(userId, e); } catch (IllegalAccessException e) { logUnableToFetchUserHandleForUser(userId, e); } return null; } REFLECTION

Slide 22

Slide 22 text

Build environment https://source.android.com/ source/initializing.html

Slide 23

Slide 23 text

Mac OS X build environment Case-sensitive disk image Chris McVeigh on Flickr

Slide 24

Slide 24 text

source build/envsetup.sh Setting up the build environment Check for missing dependencies

Slide 25

Slide 25 text

lunch Choose the target product and build variant ● eng ● userdebug ● release

Slide 26

Slide 26 text

make export USE_CCACHE=1 make -jX X = # of working threads

Slide 27

Slide 27 text

Build for devices Additional proprietary libraries required Placed under vendor/

Slide 28

Slide 28 text

Install In out/target/product/DEVICE_NAME/ ● recovery.img ● boot.img ● system.img ● userdata.img

Slide 29

Slide 29 text

Install adb reboot bootloader fastboot flashall -w

Slide 30

Slide 30 text

Speeding up the dev cycle make alias for single projects m = make from the top of the tree mm = make from the current directory mmm = make from the given directory mmma = make from the given directory WITH dependencies

Slide 31

Slide 31 text

Speeding up the dev cycle adb shell stop adb sync adb shell start

Slide 32

Slide 32 text

Contributing to AOSP https://source.android.com/ source/contributing.html

Slide 33

Slide 33 text

Contributing to AOSP

Slide 34

Slide 34 text

Questions? Daniele Bonaldo on G+

Slide 35

Slide 35 text

We’re hiring! [email protected]