Here’s my build of LineageOS 16.0 for Raspberry Pi 4 Model B. It is unofficial and unsupported by the LineageOS team. It’s for advanced users only. This build currently uses Google’s SwiftShader software renderer so graphics performance is probably not what you’d expect. This build is not suitable for media device use or graphics intensive gaming. I’d also recommend using Pi 4 models with 2GB or 4GB of RAM to run this build.

Important! This image includes parts that are licensed under non-commercial license (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International). You may use this build freely in personal/educational/etc use. Commercial use is not allowed with this build!

screenshot

Do not mirror my builds! Please post a link to this page instead.

lineage-16.0-20200212-UNOFFICIAL-KonstaKANG-rpi4.zip
https://www.androidfilehost.com/?fid=4349826312261721851
md5:1ea17c9a6f2966ebf1d3e3f9dc84a6a4

Working:

  • Audio (HDMI, 3.5mm jack, USB microphones, bluetooth speakers/headsets, etc)
  • Bluetooth
  • Camera (using official Pi camera modules & UVC USB webcams)
  • GPIO
  • GPS (using external USB modules e.g. U-Blox 7)
  • Ethernet
  • HDMI display
  • I2C
  • IR remotes (using external GPIO IR modules e.g. TSOP4838)
  • RTC (using external GPIO I2C modules e.g. DS3231)
  • Serial console (using external GPIO serial console adapters e.g. PL2303)
  • SPI
  • Touchscreen/multi-touch (using official 7” display)
  • USB (mouse, keyboard, storage, etc)
  • Wifi
  • Wifi tethering

Not working:

  • Hardware accelerated graphics (V3D)
  • Hardware video decoding & encoding

Issues:

  • SELinux is in permissive mode
  • Recording videos with camera doesn’t work (software video encoding issue)
  • and more…

Sources:

Thanks:

  • peyo-hd and everyone who has contributed to android-rpi
  • brobwind for bluetooth fixes
  • Google for Android Things platform
  • Android-x86 project
  • LineageOS team & everyone who has contributed to LineageOS 16.0

How to install:

  1. Follow the official Raspberry Pi instructions for writing the image to the SD card (Linux, Mac, Windows).

FAQ:

Q: I can’t find developer options, why?
A: Settings -> About tablet -> Click ‘Build number’ several times

Q: I have no root, why? What is that hashtag on my status bar?
A: You need enable root access under Settings -> System -> Developer options -> Root access. Root management is now integrated as part of LineageOS’ Privacy Guard and you can manage per app permissions under Settings -> System -> Developer options -> Manage root access. You’ll have a persistent notification in the status bar when you’re running an app that uses root permissions.

Q: Settings -> Storage shows xx GB used by system. There’s unallocated space on my sdcard. What should I do?
A: This is a 4 GB image, remaining space on your sdcard will remain unallocated. Settings app shows unallocated space as used by system which in reality it is not. You can use e.g. GParted and extend /data partition (/dev/block/mmcblk0p4) to cover the unallocated space. Resizing the partition manually will break support for encrypting /data. Format /data in TWRP recovery (Wipe->Format data) after resizing to leave required space for crypto footer.

Q: My display is not working. I can only see the rainbow screen but no Android boot animation. What should I do?
A: This build uses 1280x720 resolution by default so you need to use a HDMI display that supports it. See this page under ‘Which values are valid for my monitor?’ to see how to check which resolutions your display supports using Raspbian. If your display doesn’t support 1280x720 resolution, you can try changing values in /boot/config.txt to something it does (see this page). 720p is still the maximum resolution that is supported by the graphics drivers used in this build.

Q: I have official 7” LCD display and touchscreen. What should I do?
A: Official 7” touchscreen is supported without any modifications. You will only need to change display size under Settings -> Display -> Display size (or change ro.sf.lcd_density to 120 in /system/build.prop) to adapt to the smaller resolution.

Q: Raspberry Pi doesn’t have power button, how do I power off/reboot my device?
A: Following keyboard keys work as Android buttons: F1 = Home, F2 = Back, F3 = Multi-tasking, F4 = Menu, F5 = Power, F11 = Volume down, and F12 = Volume up. You can also use one of many third party reboot applications.

Q: How to create a DIY hardware power button?
A: You can send power button events by connecting GPIO21 to ground.

fritzing

Execute following commands in ‘adb shell’/serial console/terminal (you can enable built-in terminal app from Settings -> System -> Developer options -> Local terminal) to enable the feature and reboot your device:

su
rpi4-powerbutton.sh

You can also use the DIY power button to boot the device to TWRP recovery. Press and hold the button while powering on the device until you see the TWRP screen. If you use this method to boot to recovery, you can ignore what is said about booting into/out of TWRP later in the FAQ.

Q: How to enable audio through 3.5mm jack?
Execute following commands in ‘adb shell’/serial console/terminal (you can enable built-in terminal app from Settings -> System -> Developer options -> Local terminal) to enable the feature and reboot your device:

su
rpi4-audio-jack.sh

Q: How to boot to TWRP recovery?
A: There’s currently no proper way to boot between Android and TWRP, but this can achieved by renaming the ramdisk you want to boot. Execute following commands in ‘adb shell’/serial console/terminal (you can enable built-in terminal app from Settings -> System -> Developer options -> Local terminal) and reboot your device:

su
rpi4-recovery.sh

If mouse cursor doesn’t appear, try replugging your mouse.

Q: How to boot out of TWRP recovery?
A: You can execute the same script in TWRP terminal (Advanced->Terminal) if you have boot and system partitions mounted (Mount->Boot & Mount->System):

rpi4-recovery.sh boot

Or you can flash my recovery2boot zip in TWRP.

Q: How to update from previous LineageOS 16.0 build without losing data?
A:

  1. Boot to TWRP recovery with the build you want to keep the data (see FAQ)
  2. Plug in an external USB storage device and select ‘Backup’
  3. Use ‘Select Storage’ to choose the USB device and ‘Swipe to backup’ (it’s only necessary to backup the data partition so you can uncheck other partitions to speed up the process)
  4. Write new LineageOS 16.0 image to the sdcard following installation instructions
  5. Boot to TWRP recovery with the new build (see FAQ)
  6. Select ‘Restore’ and find the backup you created from the USB device (‘Select Storage’)
  7. Make sure you only have data selected as partitions to restore (uncheck other partitions if available) and select ‘Swipe to Restore’
  8. (Flash Google apps package/other add-ons you had previously installed)
  9. Boot out of recovery (see FAQ)

Q: How to install Google apps?
A: Warning, Raspberry Pi is not a Google Play certified device and you will need to register this build as an exception. You can find more information on this page. Acquiring Google Services Framework Android ID requires some extra steps so I’d recommend getting familiar with the process before proceeding to install gapps. If you are not too familiar executing commands in adb shell’/serial console/terminal I have also created a TWRP flashable zip that will read and print the GSFAID you need to register.

  1. Download open_gapps-arm-9.0-pico-xxxxxxxx.zip and save it to your device’s internal storage or use an external USB drive
  2. Boot to TWRP recovery (see FAQ)
  3. Install open_gapps-arm-9.0-pico-xxxxxxxx.zip from your selected storage
  4. Wipe->Factory reset!
  5. Boot out of recovery (see FAQ)

Merged commits not mentioned in the changelog.

12.2. changelog:

  • add camera HAL to support Pi camera modules and USB webcams (thanks to Android-x86)
  • fix portrait apps on forced landscape orientation (thanks to Ladehunter)
  • update GPS HAL
  • add ir-keytable tool to configure IR remotes
  • enable USB gadget support & fix adb toggle in developer options
  • update to Linux 4.19.103 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 February 2020 (merged)

16.1. changelog:

  • fix USB storage
  • fix wifi tethering
  • update to Linux 4.19.95 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 January 2020 (merged)

6.1. changelog:

  • initial LineageOS 16.0 build
  • use SwiftShader software renderer for graphics
  • option to use DIY hardware power button to boot to TWRP recovery (see FAQ)
  • initial support for IR modules and remotes (tested with TSOP4838)
  • include TWRP 3.3.1-0
  • use Linux 4.19.84 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 December 2019 (merged)

Previous builds: