The Android 9 Pie device configuration for Raspberry Pi 3 Model B & B+
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
apps Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
boot Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
build/tasks Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
dhcp Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
hals Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
overlay/frameworks/base Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
sepolicy Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
vndk Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
AndroidProducts.mk Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
BoardConfig.mk Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
README.md Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
bootanimation.zip Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
compatibility_matrix.xml Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
fstab.rpi3 Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
fstab_swap.rpi3 Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
init.rpi3-net.sh Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
init.rpi3.rc Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
local_manifest.xml Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
manifest.xml Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
media_codecs.xml Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
media_profiles.xml Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
mini_common.mk Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
mini_rpi3_common.mk Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
mkshrc Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
rpi3.mk Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
tablet_core_hardware.xml Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
ueventd.rpi3.rc Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019
vendorsetup.sh Init Android 9 Pie device configuration for Raspbery Pi 3 Feb 10, 2019

README.md

Android 9 Pie device configuration for Raspbery Pi 3 Model B & B+

Setup build environment

The build host is x86_64 platform run ubuntu-16.04 (refer: https://source.android.com/setup/build/initializing)

  1. Install JDK
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk
  1. Install other tools
$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip
  1. Install repo command to download Android 9 Pie project source code
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl -sSL 'https://gerrit-googlesource.proxy.ustclug.org/git-repo/+/master/repo?format=TEXT' | base64 -d > ~/bin/repo
$ chmod a+x ~/bin/repo

Download source code

  1. Download The Android 9 Pie official source code The source code can download either from https://android.googlesource.com or https://lug.ustc.edu.cn/wiki/mirrors/help/aosp Run following command to download from ustc.edu.cn
$ repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-9.0.0_r8 --repo-url=git://mirrors.ustc.edu.cn/aosp/tools/repo
  1. Download Raspbery Pi 3 device configuration files
$ mkdir -pv device/brobwind
$ git clone git://github.com/brobwind/pie-device-brobwind-rpi3 device/brobwind/rpi3
  1. Add local manifest file
$ mkdir -p .repo/local_manifests
$ ln -sv ../../device/brobwind/rpi3/local_manifest.xml .repo/local_manifests/
  1. Downloading
$ repo sync

Apply patch to Android framework

The following patch must be applyed:

diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index cd8fdbf..6918bc3 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -769,7 +769,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
         // appropriately arbitrary number. Eventually we would like to give SurfaceFlinger
         // layers the ability to match their parent sizes and be able to skip
         // such arbitrary size settings.
-        mSurfaceSize = Math.max(mBaseDisplayHeight, mBaseDisplayWidth) * 2;
+        mSurfaceSize = (int)(Math.max(mBaseDisplayHeight, mBaseDisplayWidth) * 1.4);
 
         final SurfaceControl.Builder b = mService.makeSurfaceBuilder(mSession)
                 .setSize(mSurfaceSize, mSurfaceSize)

Configure build environment

$ . build/envsetup.sh
$ lunch rpi3-eng

Build target

$ m -j

It will take about 1 hour 32 minutes for CPU: intel I5 8500T; RAM: 8G DDR42666; HDD: 1TB

Then you will get following images in the out/target/product/rpi3 folder:

  1. rpiboot.img
  2. boot.img
  3. system.img
  4. vendor.img
  5. userdata.img

For detail info, please refer:

  1. https://www.brobwind.com/archives/1575
  2. https://www.brobwind.com/archives/1541