├── Provision
├── MODULE_LICENSE_APACHE2
├── proguard.flags
├── Android.bp
├── AndroidManifest.xml
├── CleanSpec.mk
└── src
│ └── com
│ └── android
│ └── provision
│ └── DefaultActivity.java
├── sepolicy
├── bootanim.te
├── priv_app.te
├── mediaserver.te
├── mediaswcodec.te
├── mediaprovider.te
├── surfaceflinger.te
├── property.te
├── untrusted_app_all.te
├── bluetooth.te
├── hal_graphics_allocator_default.te
├── hal_power_default.te
├── netd.te
├── platform_app.te
├── device.te
├── cameraserver.te
├── init.te
├── system_server.te
├── hal_camera_default.te
├── system_app.te
├── hal_graphics_composer_default.te
├── btuart.te
├── file.te
├── kernel.te
├── te_macros
├── gpiosetd.te
├── switch_boot.te
├── hal_bluetooth_rpi4.te
├── property_contexts
├── hal_drm_widevine.te
├── gpiod.te
├── genfs_contexts
└── file_contexts
├── wifi
├── p2p_supplicant_overlay.conf
└── wpa_supplicant_overlay.conf
├── scripts
├── fix_quotas.zip
├── resize_userdata.zip
├── switch_boot_rom.zip
├── fix_quotas.sh
├── switch_boot_recovery.sh
├── switch_boot.sh
├── resize_userdata.sh
├── update-raspi64-image.sh
└── mk-raspi64-large-image.sh
├── hostapd
├── hostapd.deny
└── hostapd.accept
├── recovery
├── root
│ ├── sbin
│ │ ├── keystore
│ │ ├── keystore_auth
│ │ ├── servicemanager
│ │ ├── hwservicemanager
│ │ ├── android.hardware.gatekeeper@1.0-service
│ │ └── android.hardware.keymaster@3.0-service
│ ├── vendor
│ │ ├── lib
│ │ │ ├── hw
│ │ │ │ ├── gatekeeper.rpi4.so
│ │ │ │ ├── android.hardware.gatekeeper@1.0-impl.so
│ │ │ │ └── android.hardware.keymaster@3.0-impl.so
│ │ │ ├── libkeymaster3device.so
│ │ │ └── libpuresoftkeymasterdevice.so
│ │ ├── lib64
│ │ │ ├── hw
│ │ │ │ ├── gatekeeper.rpi4.so
│ │ │ │ ├── android.hardware.keymaster@3.0-impl.so
│ │ │ │ └── android.hardware.gatekeeper@1.0-impl.so
│ │ │ ├── libkeymaster3device.so
│ │ │ └── libpuresoftkeymasterdevice.so
│ │ ├── compatibility_matrix.xml
│ │ └── manifest.xml
│ ├── system
│ │ ├── etc
│ │ │ ├── recovery.sd.fstab
│ │ │ └── recovery.usb.fstab
│ │ └── manifest.xml
│ └── init.recovery.rpi4.rc
├── recovery.fstab
└── init.rc
├── bluetooth
├── btuart
│ ├── BCM4345C0.hcd
│ ├── BCM4345C5.hcd
│ ├── Android.mk
│ └── hciattach_rpi4.h
├── cfg
│ ├── bt_vendor.conf
│ ├── bdroid_buildcfg.h
│ └── vnd_rpi4.txt
├── hal
│ ├── android.hardware.bluetooth@1.0-service.rpi4.rc
│ ├── Android.bp
│ ├── service.cc
│ ├── hci_packetizer.h
│ ├── hci_internals.h
│ ├── h4_protocol.h
│ ├── async_fd_watcher.h
│ ├── bluetooth_hci.h
│ ├── hci_packetizer.cc
│ ├── h4_protocol.cc
│ └── async_fd_watcher.cc
└── Android.mk
├── DeviceParts
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxxhdpi
│ │ └── ic_launcher.png
│ ├── values
│ │ ├── styles.xml
│ │ ├── arrays.xml
│ │ └── strings.xml
│ └── xml
│ │ └── main.xml
├── Android.mk
├── src
│ └── org
│ │ └── omnirom
│ │ └── device
│ │ ├── Startup.java
│ │ ├── DeviceSettingsActivity.java
│ │ ├── KeyHandler.java
│ │ └── Utils.java
└── AndroidManifest.xml
├── compatibility_matrix.device.xml
├── repo
└── local_manifest.xml
├── overlay
├── packages
│ └── apps
│ │ ├── OpenDelta
│ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ │ ├── Launcher3
│ │ └── quickstep
│ │ │ └── res
│ │ │ ├── values
│ │ │ └── config.xml
│ │ │ └── xml
│ │ │ ├── default_workspace_5x5.xml
│ │ │ └── device_profiles.xml
│ │ ├── Bluetooth
│ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ │ ├── ThemePicker
│ │ └── res
│ │ │ └── values
│ │ │ └── override.xml
│ │ └── Settings
│ │ └── res
│ │ └── values
│ │ └── config.xml
└── frameworks
│ └── base
│ ├── core
│ └── res
│ │ └── res
│ │ ├── values
│ │ ├── dimens.xml
│ │ └── arrays.xml
│ │ └── values-land
│ │ └── dimens.xml
│ └── packages
│ └── SystemUI
│ └── res
│ ├── values-sw600dp-port
│ └── dimens.xml
│ ├── values-sw720dp-land
│ └── dimens.xml
│ ├── values-sw900dp-land
│ └── dimens.xml
│ ├── values-sw600dp-land
│ └── dimens.xml
│ ├── values-sw900dp
│ ├── dimens.xml
│ └── config.xml
│ ├── values-land
│ └── dimens.xml
│ ├── values-sw600dp
│ └── config.xml
│ ├── values-sw720dp
│ └── config.xml
│ └── values
│ ├── dimens.xml
│ ├── arrays.xml
│ └── config.xml
├── init
├── Android.bp
└── init_rpi4.cpp
├── TODO
├── gps
├── gnsshal
│ └── Android.bp
├── README.md
└── LICENSE
├── gpio
├── scripts
│ └── template.sh
├── Android.bp
└── src
│ ├── tools-common.h
│ ├── tools-common.cpp
│ └── gpiosetd.cpp
├── AndroidProducts.mk
├── media_codecs.xml
├── ueventd.rpi4.rc
├── power
├── Android.bp
├── utils.h
├── power.c
└── utils.c
├── system.prop
├── external_camera_config.xml
├── omni_rpi4.mk
├── fstab.rpi4
├── init.system.rpi4.rc
├── init.rpi4.usb.rc
├── omni.dependencies
├── init.vendor.rpi4.rc
├── README.build
├── audio_policy_configuration.xml
├── README.gpio
├── BoardConfig.mk
└── manifest.xml
/Provision/MODULE_LICENSE_APACHE2:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sepolicy/bootanim.te:
--------------------------------------------------------------------------------
1 | gpu_access(bootanim)
2 |
--------------------------------------------------------------------------------
/sepolicy/priv_app.te:
--------------------------------------------------------------------------------
1 | gpu_access(priv_app)
2 |
--------------------------------------------------------------------------------
/sepolicy/mediaserver.te:
--------------------------------------------------------------------------------
1 | gpu_access(mediaserver)
2 |
--------------------------------------------------------------------------------
/sepolicy/mediaswcodec.te:
--------------------------------------------------------------------------------
1 | gpu_access(mediaswcodec)
2 |
--------------------------------------------------------------------------------
/sepolicy/mediaprovider.te:
--------------------------------------------------------------------------------
1 | gpu_access(mediaprovider)
2 |
--------------------------------------------------------------------------------
/sepolicy/surfaceflinger.te:
--------------------------------------------------------------------------------
1 | gpu_access(surfaceflinger)
2 |
--------------------------------------------------------------------------------
/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
--------------------------------------------------------------------------------
/sepolicy/property.te:
--------------------------------------------------------------------------------
1 | system_public_prop(rpi4_system_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/untrusted_app_all.te:
--------------------------------------------------------------------------------
1 | gpu_access(untrusted_app_all)
2 |
--------------------------------------------------------------------------------
/Provision/proguard.flags:
--------------------------------------------------------------------------------
1 | -keep class * extends android.app.Activity
2 |
--------------------------------------------------------------------------------
/sepolicy/bluetooth.te:
--------------------------------------------------------------------------------
1 | allow bluetooth rfkill_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/hal_graphics_allocator_default.te:
--------------------------------------------------------------------------------
1 | gpu_access(hal_graphics_allocator_default)
2 |
--------------------------------------------------------------------------------
/sepolicy/hal_power_default.te:
--------------------------------------------------------------------------------
1 | allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms;
--------------------------------------------------------------------------------
/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | tdls_external_control=1
--------------------------------------------------------------------------------
/sepolicy/netd.te:
--------------------------------------------------------------------------------
1 | dontaudit netd self:capability sys_module;
2 | allow netd kernel:system module_request;
3 |
--------------------------------------------------------------------------------
/sepolicy/platform_app.te:
--------------------------------------------------------------------------------
1 | gpu_access(platform_app)
2 | allow platform_app sysfs_thermal:file r_file_perms;
--------------------------------------------------------------------------------
/scripts/fix_quotas.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/scripts/fix_quotas.zip
--------------------------------------------------------------------------------
/hostapd/hostapd.deny:
--------------------------------------------------------------------------------
1 | # List of MAC addresses that are not allowed to authenticate (IEEE 802.11)
2 | # with the AP.
3 |
--------------------------------------------------------------------------------
/sepolicy/device.te:
--------------------------------------------------------------------------------
1 | type rfkill_device, dev_type, mlstrustedobject;
2 | type gpio_dev, dev_type, mlstrustedobject;
3 |
--------------------------------------------------------------------------------
/recovery/root/sbin/keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/sbin/keystore
--------------------------------------------------------------------------------
/scripts/resize_userdata.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/scripts/resize_userdata.zip
--------------------------------------------------------------------------------
/scripts/switch_boot_rom.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/scripts/switch_boot_rom.zip
--------------------------------------------------------------------------------
/bluetooth/btuart/BCM4345C0.hcd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/bluetooth/btuart/BCM4345C0.hcd
--------------------------------------------------------------------------------
/bluetooth/btuart/BCM4345C5.hcd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/bluetooth/btuart/BCM4345C5.hcd
--------------------------------------------------------------------------------
/sepolicy/cameraserver.te:
--------------------------------------------------------------------------------
1 | allow cameraserver gpu_device:chr_file rw_file_perms;
2 | allow cameraserver gpu_device:dir search;
3 |
--------------------------------------------------------------------------------
/recovery/root/sbin/keystore_auth:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/sbin/keystore_auth
--------------------------------------------------------------------------------
/recovery/root/sbin/servicemanager:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/sbin/servicemanager
--------------------------------------------------------------------------------
/recovery/root/sbin/hwservicemanager:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/sbin/hwservicemanager
--------------------------------------------------------------------------------
/DeviceParts/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/DeviceParts/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceParts/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/DeviceParts/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceParts/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/DeviceParts/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceParts/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/DeviceParts/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceParts/res/drawable-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/DeviceParts/res/drawable-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/recovery/root/vendor/lib/hw/gatekeeper.rpi4.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib/hw/gatekeeper.rpi4.so
--------------------------------------------------------------------------------
/recovery/root/vendor/lib/libkeymaster3device.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib/libkeymaster3device.so
--------------------------------------------------------------------------------
/recovery/root/vendor/lib64/hw/gatekeeper.rpi4.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib64/hw/gatekeeper.rpi4.so
--------------------------------------------------------------------------------
/sepolicy/init.te:
--------------------------------------------------------------------------------
1 | allow init kernel:system module_request;
2 | allow init tmpfs:lnk_file create;
3 | allow init sysfs_devices_system_cpu:file rw_file_perms;
4 |
--------------------------------------------------------------------------------
/sepolicy/system_server.te:
--------------------------------------------------------------------------------
1 | gpu_access(system_server)
2 | allow system_server self:capability sys_module;
3 | allow system_server gpio_dev:chr_file rw_file_perms;
--------------------------------------------------------------------------------
/recovery/root/vendor/lib64/libkeymaster3device.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib64/libkeymaster3device.so
--------------------------------------------------------------------------------
/recovery/root/vendor/lib/libpuresoftkeymasterdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib/libpuresoftkeymasterdevice.so
--------------------------------------------------------------------------------
/compatibility_matrix.device.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/recovery/root/sbin/android.hardware.gatekeeper@1.0-service:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/sbin/android.hardware.gatekeeper@1.0-service
--------------------------------------------------------------------------------
/recovery/root/sbin/android.hardware.keymaster@3.0-service:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/sbin/android.hardware.keymaster@3.0-service
--------------------------------------------------------------------------------
/recovery/root/vendor/lib64/libpuresoftkeymasterdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib64/libpuresoftkeymasterdevice.so
--------------------------------------------------------------------------------
/sepolicy/hal_camera_default.te:
--------------------------------------------------------------------------------
1 | vndbinder_use(hal_camera_default);
2 | allow hal_camera_default gpu_device:chr_file rw_file_perms;
3 | allow hal_camera_default gpu_device:dir search;
4 |
--------------------------------------------------------------------------------
/sepolicy/system_app.te:
--------------------------------------------------------------------------------
1 | allow system_app selinuxfs:file r_file_perms;
2 | gpu_access(system_app)
3 | allow system_app gpio_dev:chr_file rw_file_perms;
4 | set_prop(system_app, rpi4_system_prop);
5 |
--------------------------------------------------------------------------------
/recovery/root/vendor/lib/hw/android.hardware.gatekeeper@1.0-impl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib/hw/android.hardware.gatekeeper@1.0-impl.so
--------------------------------------------------------------------------------
/recovery/root/vendor/lib/hw/android.hardware.keymaster@3.0-impl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib/hw/android.hardware.keymaster@3.0-impl.so
--------------------------------------------------------------------------------
/recovery/root/vendor/lib64/hw/android.hardware.keymaster@3.0-impl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib64/hw/android.hardware.keymaster@3.0-impl.so
--------------------------------------------------------------------------------
/recovery/root/vendor/lib64/hw/android.hardware.gatekeeper@1.0-impl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxwen/android_device_brcm_rpi4/HEAD/recovery/root/vendor/lib64/hw/android.hardware.gatekeeper@1.0-impl.so
--------------------------------------------------------------------------------
/repo/local_manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/sepolicy/hal_graphics_composer_default.te:
--------------------------------------------------------------------------------
1 | vndbinder_use(hal_graphics_composer_default)
2 | gpu_access(hal_graphics_composer_default)
3 | allow hal_graphics_composer_default self:netlink_kobject_uevent_socket read;
4 |
--------------------------------------------------------------------------------
/sepolicy/btuart.te:
--------------------------------------------------------------------------------
1 | # btuart service
2 | type btuart, domain;
3 | type btuart_exec, exec_type, file_type, vendor_file_type;
4 |
5 | init_daemon_domain(btuart)
6 |
7 | allow btuart hci_attach_dev:chr_file {rw_file_perms};
--------------------------------------------------------------------------------
/overlay/packages/apps/OpenDelta/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 | true
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sepolicy/file.te:
--------------------------------------------------------------------------------
1 | type sysfs_gpu, fs_type, sysfs_type;
2 | type mediadrm_vendor_data_file, file_type, data_file_type;
3 | type sysfs_gpio, fs_type, sysfs_type;
4 | type gpiod_data_file, file_type, data_file_type, core_data_file_type;
5 |
6 |
--------------------------------------------------------------------------------
/sepolicy/kernel.te:
--------------------------------------------------------------------------------
1 | allow kernel self:capability mknod;
2 | allow kernel self:system module_request;
3 | allow kernel device:dir { create write add_name remove_name rmdir };
4 | allow kernel device:chr_file { create setattr getattr unlink };
5 |
--------------------------------------------------------------------------------
/bluetooth/cfg/bt_vendor.conf:
--------------------------------------------------------------------------------
1 | # UART device port where Bluetooth controller is attached
2 | UartPort = /dev/ttyAMA0
3 | # Firmware patch file location
4 | FwPatchFilePath = /lib/firmware/brcm
5 | # Firmware Name
6 | FwPatchFileName = BCM43430A1.hcd
7 |
--------------------------------------------------------------------------------
/hostapd/hostapd.accept:
--------------------------------------------------------------------------------
1 | # List of MAC addresses that are allowed to authenticate (IEEE 802.11)
2 | # with the AP. Optional VLAN ID can be assigned for clients based on the
3 | # MAC address if dynamic VLANs (hostapd.conf dynamic_vlan option) are used.
4 |
--------------------------------------------------------------------------------
/bluetooth/hal/android.hardware.bluetooth@1.0-service.rpi4.rc:
--------------------------------------------------------------------------------
1 | service btrpi4-1.0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service.rpi4
2 | class hal
3 | user bluetooth
4 | group bluetooth net_admin net_bt_admin
5 | capabilities NET_ADMIN
6 |
--------------------------------------------------------------------------------
/bluetooth/cfg/bdroid_buildcfg.h:
--------------------------------------------------------------------------------
1 | #ifndef _BDROID_BUILDCFG_H
2 | #define _BDROID_BUILDCFG_H
3 |
4 | #define BTM_DEF_LOCAL_NAME "RPI4"
5 |
6 | #define BTA_DM_COD {0x1A, 0x01, 0x20}
7 |
8 | #define KERNEL_MISSING_CLOCK_BOOTTIME_ALARM TRUE
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Launcher3/quickstep/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 | true
3 | true
4 | false
5 | false
6 |
7 |
--------------------------------------------------------------------------------
/init/Android.bp:
--------------------------------------------------------------------------------
1 | cc_library_static {
2 | name: "libinit_rpi4",
3 |
4 | include_dirs: [
5 | "system/core/base/include",
6 | "system/core/init",
7 | ],
8 | cflags: [
9 | "-Wall",
10 | ],
11 | srcs: ["init_rpi4.cpp"],
12 | recovery_available: true,
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/sepolicy/te_macros:
--------------------------------------------------------------------------------
1 | #####################################
2 | # gpu_access(client_domain)
3 | # Allow client_domain to communicate with the GPU
4 | define(`gpu_access', `
5 | allow $1 gpu_device:dir { open read search getattr };
6 | allow $1 gpu_device:chr_file { open read getattr ioctl map };
7 | allow $1 sysfs_gpu:file { getattr open read };
8 | ')
9 |
--------------------------------------------------------------------------------
/sepolicy/gpiosetd.te:
--------------------------------------------------------------------------------
1 | # gpiod service
2 | type gpiosetd, domain;
3 | type gpiosetd_exec, exec_type, file_type, system_file_type;
4 | typeattribute gpiosetd coredomain;
5 |
6 | init_daemon_domain(gpiosetd)
7 |
8 | allow gpiosetd gpio_dev:chr_file rw_file_perms;
9 | allow gpiosetd sysfs_gpio:file r_file_perms;
10 | allow gpiosetd device:dir r_file_perms;
--------------------------------------------------------------------------------
/sepolicy/switch_boot.te:
--------------------------------------------------------------------------------
1 | # switch_boot service
2 | type switch_boot, domain;
3 | type switch_boot_exec, exec_type, file_type, system_file_type;
4 | typeattribute switch_boot coredomain;
5 |
6 | init_daemon_domain(switch_boot)
7 |
8 | allow switch_boot shell_exec:file rx_file_perms;
9 | # TODO
10 | #allow switch_boot su_exec:file rx_file_perms;
11 |
--------------------------------------------------------------------------------
/Provision/Android.bp:
--------------------------------------------------------------------------------
1 | android_app {
2 | name: "Provision",
3 | srcs: ["**/*.java"],
4 | platform_apis: true,
5 | system_ext_specific: true,
6 | certificate: "platform",
7 | privileged: true,
8 | required: ["privapp_whitelist_com.android.provision"],
9 | optimize: {
10 | proguard_flags_files: ["proguard.flags"],
11 | },
12 | }
13 |
--------------------------------------------------------------------------------
/bluetooth/cfg/vnd_rpi4.txt:
--------------------------------------------------------------------------------
1 | BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyAMA0"
2 | FW_PATCHFILE_LOCATION = "/lib/firmware/"
3 | BT_WAKE_VIA_PROC = FALSE
4 | BT_WAKE_VIA_USERIAL_IOCTL = FALSE
5 | LPM_IDLE_TIMEOUT_MULTIPLE = 5
6 | SCO_CFG_INCLUDED = FALSE
7 | SCO_PCM_IF_CLOCK_RATE = 2
8 | BTVND_DBG = FALSE
9 | BTHW_DBG = FALSE
10 | VNDUSERIAL_DBG = FALSE
11 | UPIO_DBG = FALSE
12 | UART_TARGET_BAUD_RATE = 921600
13 | USE_CONTROLLER_BDADDR = FALSE
14 |
--------------------------------------------------------------------------------
/sepolicy/hal_bluetooth_rpi4.te:
--------------------------------------------------------------------------------
1 | type hal_bluetooth_rpi4, domain;
2 | hal_server_domain(hal_bluetooth_rpi4, hal_bluetooth)
3 |
4 | type hal_bluetooth_rpi4_exec, exec_type, vendor_file_type, file_type;
5 | init_daemon_domain(hal_bluetooth_rpi4)
6 |
7 | allow hal_bluetooth_rpi4 self:bluetooth_socket { create bind read write };
8 |
9 | r_dir_file(hal_bluetooth_rpi4, sysfs_type)
10 | allow hal_bluetooth_rpi4 sysfs_bluetooth_writable:file rw_file_perms;
11 |
--------------------------------------------------------------------------------
/TODO:
--------------------------------------------------------------------------------
1 | TODO:
2 |
3 | -p2p e.g. screencast
4 | -fix chromium
5 | -think about how to handle OTA
6 | -kernel cmdline option for default gps device (custom init sets property then)
7 | -support usb cameras - preview works capture not (v3d_bo_map_unsynchronized)
8 | -screen distortion on higher resolutions (seems to be on hdmi 1 only - maybe my device port is broken)
9 | -video playback - lets start easy with even a simple screen record (v3d_bo_map_unsynchronized)
10 |
--------------------------------------------------------------------------------
/gps/gnsshal/Android.bp:
--------------------------------------------------------------------------------
1 | cc_library_shared {
2 | name: "gps.rpi4",
3 | relative_install_path: "hw",
4 | proprietary: true,
5 | srcs: ["gps_zkw.c"],
6 | header_libs: ["libhardware_headers"],
7 | shared_libs: [
8 | "liblog",
9 | "libcutils",
10 | "libhardware",
11 | "libc",
12 | "libutils"
13 | ],
14 | cflags: ["-Wall", "-Werror", "-Wno-unused-parameter", "-Wno-unused-variable", "-Wno-format", "-Wno-unused-function"],
15 | }
16 |
--------------------------------------------------------------------------------
/gpio/scripts/template.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 |
3 | # $1 gpio
4 | # $2 0 rising 1 falling edge
5 | # $3 timestamp
6 | # log -t gpiod $*
7 |
8 | case $1 in
9 | 23)
10 | if [ $2 -eq 0 ]; then
11 | log -t gpiod "23 rising edge" $3
12 | am start "org.omnirom.omnijaws/.WeatherActivity"
13 | fi
14 | ;;
15 | 3)
16 | if [ $2 -eq 1 ]; then
17 | log -t gpiod "3 falling edge" $3
18 | reboot -p
19 | fi
20 | ;;
21 | esac
--------------------------------------------------------------------------------
/gps/README.md:
--------------------------------------------------------------------------------
1 | # 卫星定位接收机HAL驱动
2 |
3 | 针对Android7.0或以上版本.
4 | 对于Android4.x 5.x 或 6.x, 请使用项目[android_hal_gpsbds](https://github.com/zxcwhale/android_hal_gpsbds).
5 |
6 | ## 使用方法
7 |
8 | 1. 修改gps_zkw.c文件中的`GPS_CHANNEL_NAME`为接收机的TTY号.
9 | 2. 修改gps_zkw.c文件中的`TTY_BAUD`为接收机实际的波特率, 默认为`B9600`.
10 | 3. 在Android开发环境下编译.
11 | 4. 将编译结果gps.XXXX.so文件用adb push到Android设备的/system/lib/hw目录下. 如果是64位Android, 则push到/system/lib64/hw目录.
12 |
13 | ## 可能的问题
14 |
15 | 1. 如果编译出现找不到`ALOGD`, `ALOGE`的报错, 可以尝试将`ALOGD`改为`LOGD`, `ALOGE`改为`LOGE`.
16 |
--------------------------------------------------------------------------------
/sepolicy/property_contexts:
--------------------------------------------------------------------------------
1 | persist.rpi4.cpufreq.max_freq u:object_r:rpi4_system_prop:s0 exact string
2 | persist.rpi4.cpufreq.governor u:object_r:rpi4_system_prop:s0 exact string
3 | persist.rpi4.gpiod.lines u:object_r:rpi4_system_prop:s0 exact string
4 | persist.rpi4.gpiod.options u:object_r:rpi4_system_prop:s0 exact string
5 | persist.rpi4.gpiosetd.values u:object_r:rpi4_system_prop:s0 exact string
6 | persist.rpi4.gpiosetd.options u:object_r:rpi4_system_prop:s0 exact string
7 |
--------------------------------------------------------------------------------
/scripts/fix_quotas.sh:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 | # called from recovery
3 | # based on resize script from https://konstakang.com/
4 |
5 | # detect storage device
6 | if [ -b "/dev/block/mmcblk0" ]; then
7 | DEVICE=mmcblk0
8 | PARTITION=p4
9 | else
10 | DEVICE=sda
11 | PARTITION=4
12 | fi
13 |
14 | # make sure we have project quotas
15 | tune2fs -O project,quota /dev/block/$DEVICE$PARTITION 1>> /tmp/tune2fs.log 2>&1
16 |
17 | EXIT=$?
18 | if [ $EXIT != "0" ]; then
19 | echo $EXIT >> /tmp/tune2fs.log
20 | exit $EXIT
21 | fi
22 |
23 | exit 0
24 |
--------------------------------------------------------------------------------
/recovery/root/vendor/compatibility_matrix.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | android.hidl.manager
8 | 1.0
9 |
10 | IServiceManager
11 | default
12 |
13 |
14 |
15 | 29
16 |
17 |
18 |
--------------------------------------------------------------------------------
/gpio/Android.bp:
--------------------------------------------------------------------------------
1 | cc_binary {
2 | name: "gpiod",
3 | srcs: ["src/gpiod.cpp", "src/tools-common.cpp"],
4 | shared_libs: [
5 | "libgpiod",
6 | "liblog",
7 | "libutils",
8 | ],
9 | cflags: [
10 | "-Werror",
11 | "-Wno-format-security"
12 | ],
13 | }
14 |
15 | cc_binary {
16 | name: "gpiosetd",
17 | srcs: ["src/gpiosetd.cpp", "src/tools-common.cpp"],
18 | shared_libs: [
19 | "libgpiod",
20 | "liblog",
21 | "libutils",
22 | ],
23 | cflags: [
24 | "-Werror",
25 | "-Wno-format-security"
26 | ],
27 | }
--------------------------------------------------------------------------------
/sepolicy/hal_drm_widevine.te:
--------------------------------------------------------------------------------
1 | # define SELinux domain
2 | type hal_drm_widevine, domain;
3 | hal_server_domain(hal_drm_widevine, hal_drm)
4 |
5 | type hal_drm_widevine_exec, exec_type, vendor_file_type, file_type;
6 | init_daemon_domain(hal_drm_widevine)
7 |
8 | allow hal_drm mediacodec:fd use;
9 | allow hal_drm { appdomain -isolated_app }:fd use;
10 |
11 | vndbinder_use(hal_drm_widevine);
12 | hal_client_domain(hal_drm_widevine, hal_graphics_composer);
13 | allow hal_drm_widevine hal_allocator_server:fd use;
14 | allow hal_drm_widevine mediadrm_vendor_data_file:dir create_dir_perms;
15 | allow hal_drm_widevine mediadrm_vendor_data_file:file create_file_perms;
16 |
--------------------------------------------------------------------------------
/sepolicy/gpiod.te:
--------------------------------------------------------------------------------
1 | # gpiod service
2 | type gpiod, domain;
3 | type gpiod_exec, exec_type, file_type, system_file_type;
4 | typeattribute gpiod coredomain;
5 |
6 | init_daemon_domain(gpiod)
7 |
8 | allow gpiod gpio_dev:chr_file rw_file_perms;
9 | allow gpiod sysfs_gpio:file r_file_perms;
10 | allow gpiod device:dir r_file_perms;
11 | allow gpiod gpiod_data_file:file r_file_perms;
12 | allow gpiod gpiod_data_file:dir search;
13 | allow gpiod shell_exec:file rx_file_perms;
14 | allow gpiod toolbox_exec:file rx_file_perms;
15 | allow gpiod system_file:file execute_no_trans;
16 | allow gpiod system_server:binder { call transfer };
17 | allow gpiod servicemanager:binder { call };
18 |
--------------------------------------------------------------------------------
/bluetooth/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2018 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH := $(call my-dir)
16 |
17 | include $(call all-makefiles-under,$(LOCAL_PATH))
18 |
--------------------------------------------------------------------------------
/AndroidProducts.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2020 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | PRODUCT_MAKEFILES := \
18 | $(LOCAL_DIR)/omni_rpi4.mk
19 |
20 | COMMON_LUNCH_CHOICES := \
21 | omni_rpi4-userdebug
22 |
--------------------------------------------------------------------------------
/scripts/switch_boot_recovery.sh:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 | # called from recovery
3 |
4 | if [ -u $1 ]; then
5 | # shortcut called from flashable zip
6 | CONFIG_FILE_SOURCE=config.txt.rom
7 | fi
8 |
9 | CONFIG_FILE_TARGET=config.txt
10 |
11 | if [ $1 == "rom" ]; then
12 | CONFIG_FILE_SOURCE=config.txt.rom
13 | elif [ $1 == "recovery" ]; then
14 | CONFIG_FILE_SOURCE=config.txt.twrp
15 | else
16 | echo "will switch to rom"
17 | fi
18 |
19 | if [ -b "/dev/block/mmcblk0p1" ]; then
20 | mount /dev/block/mmcblk0p1 /boot
21 | cp /boot/$CONFIG_FILE_SOURCE /boot/$CONFIG_FILE_TARGET
22 | umount /boot
23 | #/system/bin/reboot
24 | elif [ -b "/dev/block/sda1" ]; then
25 | mount /dev/block/sda1 /boot
26 | cp /boot/$CONFIG_FILE_SOURCE /boot/$CONFIG_FILE_TARGET
27 | umount /boot
28 | #/system/bin/reboot
29 | fi
30 |
31 | exit 1
--------------------------------------------------------------------------------
/recovery/root/system/etc/recovery.sd.fstab:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
4 | #
5 | #
6 |
7 | # these partitions are defined by default from dt using overlay so just keeping here for reference or if ever needed
8 |
9 | /dev/block/mmcblk0p1 /boot vfat defaults
10 | /dev/block/mmcblk0p2 /system ext4 defaults
11 | /dev/block/mmcblk0p3 /vendor ext4 defaults
12 | /dev/block/mmcblk0p4 /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc fileencryption=aes-256-xts
13 | /dev/block/sda1 /usb auto defaults
14 |
--------------------------------------------------------------------------------
/recovery/root/system/etc/recovery.usb.fstab:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
4 | #
5 | #
6 |
7 | # these partitions are defined by default from dt using overlay so just keeping here for reference or if ever needed
8 |
9 | /dev/block/sda1 /boot vfat defaults
10 | /dev/block/sda2 /system ext4 defaults
11 | /dev/block/sda3 /vendor ext4 defaults
12 | /dev/block/sda4 /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc fileencryption=aes-256-xts
13 | /dev/block/sdb1 /usb auto defaults
14 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | 36dp
21 |
22 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Bluetooth/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 | true
17 | true
18 |
19 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw600dp-port/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | 550dp
21 |
22 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 40dp
20 | 168dp
21 |
22 |
--------------------------------------------------------------------------------
/media_codecs.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 8dp
20 | 10dp
21 |
22 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw900dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 8dp
20 | 10dp
21 |
22 |
--------------------------------------------------------------------------------
/ueventd.rpi4.rc:
--------------------------------------------------------------------------------
1 | # Bluetooth
2 | /dev/ttyAMA0 0660 bluetooth bluetooth
3 | /dev/rfkill 0660 bluetooth bluetooth
4 | /sys/devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/rfkill1 state 0660 bluetooth bluetooth
5 | /sys/devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/rfkill1 type 0440 bluetooth bluetooth
6 |
7 | # Camera
8 | /dev/video* 0660 system camera
9 |
10 | # GPS
11 | /dev/ttyACM0 0660 gps gps
12 |
13 | /dev/ion 0664 system system
14 | /dev/video0 0660 system camera
15 | /dev/video1 0660 system camera
16 |
17 | # cpufreq
18 | /sys/devices/system/cpu/cpu* cpufreq/scaling_governor 0664 system system
--------------------------------------------------------------------------------
/gpio/src/tools-common.h:
--------------------------------------------------------------------------------
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 | /*
3 | * This file is part of libgpiod.
4 | *
5 | * Copyright (C) 2017-2018 Bartosz Golaszewski
6 | */
7 |
8 | #ifndef __GPIOD_TOOLS_COMMON_H__
9 | #define __GPIOD_TOOLS_COMMON_H__
10 |
11 | /*
12 | * Various helpers for the GPIO tools.
13 | *
14 | * NOTE: This is not a stable interface - it's only to avoid duplicating
15 | * common code.
16 | */
17 |
18 | #define NORETURN __attribute__((noreturn))
19 | #define PRINTF(fmt, arg) __attribute__((format(printf, fmt, arg)))
20 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
21 |
22 | #define GETOPT_NULL_LONGOPT NULL, 0, NULL, 0
23 |
24 | void die(const char *fmt, ...) NORETURN PRINTF(1, 2);
25 | void die_perror(const char *fmt, ...) NORETURN PRINTF(1, 2);
26 | void die_logd(const char *fmt, ...) NORETURN PRINTF(1, 2);
27 | void print_version(void);
28 |
29 | #endif /* __GPIOD_TOOLS_COMMON_H__ */
30 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw600dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 8dp
20 | 10dp
21 | 128dp
22 |
23 |
--------------------------------------------------------------------------------
/scripts/switch_boot.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 | # called from rom
3 |
4 | if [ -u $1 ]; then
5 | echo "provide argument rom or recovery"
6 | exit 0
7 | fi
8 |
9 | CONFIG_FILE_TARGET=config.txt
10 |
11 | if [ $1 == "rom" ]; then
12 | CONFIG_FILE_SOURCE=config.txt.rom
13 | elif [ $1 == "recovery" ]; then
14 | CONFIG_FILE_SOURCE=config.txt.twrp
15 | else
16 | echo "provide argument rom or recovery"
17 | exit 0
18 | fi
19 |
20 | if [ ! -d "/mnt/boot" ]; then
21 | su root mkdir /mnt/boot
22 | fi
23 |
24 |
25 | if [ -b "/dev/block/mmcblk0p1" ]; then
26 | su root mount /dev/block/mmcblk0p1 /mnt/boot
27 | su root cp /mnt/boot/$CONFIG_FILE_SOURCE /mnt/boot/$CONFIG_FILE_TARGET
28 | su root umount /mnt/boot
29 | #/system/bin/reboot
30 | elif [ -b "/dev/block/sda1" ]; then
31 | su root mount /dev/block/sda1 /mnt/boot
32 | su root cp /mnt/boot/$CONFIG_FILE_SOURCE /mnt/boot/$CONFIG_FILE_TARGET
33 | su root umount /mnt/boot
34 | #/system/bin/reboot
35 | fi
36 |
37 | exit 1
--------------------------------------------------------------------------------
/power/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2011 The Android Open Source Project
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | cc_library_shared {
16 | name: "power.rpi4",
17 | relative_install_path: "hw",
18 | proprietary: true,
19 | srcs: ["power.c", "utils.c"],
20 | cflags: ["-Wall", "-Werror"],
21 | header_libs: [
22 | "libhardware_headers",
23 | "libutils_headers",
24 | ],
25 | shared_libs: ["liblog"],
26 | }
27 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw900dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | 36dp
21 | 128dp
22 | 48dip
23 |
24 |
25 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/sepolicy/genfs_contexts:
--------------------------------------------------------------------------------
1 | genfscon sysfs /devices/platform/v3dbus/fec00000.v3d/uevent u:object_r:sysfs_gpu:s0
2 | genfscon sysfs /devices/platform/gpu/uevent u:object_r:sysfs_gpu:s0
3 | genfscon sysfs /firmware/devicetree/base/serial-number u:object_r:sysfs_dt_firmware_android:s0
4 | genfscon sysfs /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/wakeup/wakeup0/event_count u:object_r:sysfs_wakeup:s0
5 | genfscon sysfs /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/wakeup/wakeup0 u:object_r:sysfs_wakeup:s0
6 | genfscon sysfs /devices/platform/soc/fe200000.gpio/gpiochip0/dev u:object_r:sysfs_gpio:s0
7 | genfscon sysfs /devices/platform/soc/fe200000.gpio/gpiochip1/dev u:object_r:sysfs_gpio:s0
8 | genfscon sysfs /devices/platform/soc/soc:firmware/soc:firmware:gpio/gpiochip0/dev u:object_r:sysfs_gpio:s0
9 | genfscon sysfs /devices/platform/soc/soc:firmware/soc:firmware:gpio/gpiochip1/dev u:object_r:sysfs_gpio:s0
10 | genfscon sysfs /devices/virtual/thermal/thermal_zone0/temp u:object_r:sysfs_thermal:s0
11 |
12 |
--------------------------------------------------------------------------------
/DeviceParts/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
20 |
21 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 8dp
20 | 10dp
21 | 28dp
22 | 48dp
23 |
24 |
--------------------------------------------------------------------------------
/gps/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Jarod Lee
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw600dp/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 |
25 | left;volup,voldown,back,home,recent,power;right
26 |
27 |
28 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw720dp/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 |
25 | left;volup,voldown,back,home,recent,power;right
26 |
27 |
28 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-sw900dp/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 |
25 | left;volup,voldown,back,home,recent,power;right
26 |
27 |
28 |
--------------------------------------------------------------------------------
/system.prop:
--------------------------------------------------------------------------------
1 | # Change for a different screen resolutions
2 | # can be set during ruintime by using persist.debug.drm.mode.force
3 | # but value here will overrule if set
4 | #debug.drm.mode.force=1280x800
5 |
6 | #gralloc.drm.device=/dev/dri/card0
7 | #gralloc.drm.kms=/dev/dri/card1
8 |
9 | hwc.drm.scale_with_gpu=1
10 | ro.hardware.egl=mesa
11 | ro.hardware.hwcomposer=drm
12 | ro.hardware.gralloc=gbm
13 |
14 | ro.opengles.version=131072
15 | ro.sf.lcd_density=180
16 |
17 | # GPS
18 | gps.device.path=/dev/ttyACM0
19 |
20 | # Media
21 | persist.media.treble_omx=false
22 |
23 | # USB
24 | persist.sys.usb.config=mtp
25 |
26 | # Wifi
27 | wifi.interface=wlan0
28 | ro.boot.wificountrycode=00
29 |
30 | # R
31 | ro.kernel.ebpf.supported=true
32 |
33 | # DONT ADD THIS
34 | #ro.apex.updatable=true
35 |
36 | # Audio
37 | # card 0 = hdmi
38 | # card 1 = headphone jack
39 | # can be overwrittem by persist.audio.pcm.card - used in DeviceParts
40 | audio.pcm.card=0
41 | audio.pcm.device=0
42 |
43 | # we are not caf
44 | sys.vendor.qti.servicetracker.disable=true
45 |
46 | # no flickering for now
47 | debug.sf.disable_hwc_overlays=1
48 |
49 | # used in DeviceParts
50 | sys.rpi4.boot_mode=rom
51 |
52 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | 10dp
21 |
22 |
23 | 10dp
24 |
25 |
26 | 10dp
27 |
28 |
29 | 14dp
30 |
31 |
32 | 8dp
33 |
34 |
--------------------------------------------------------------------------------
/DeviceParts/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | ifeq ($(TARGET_DEVICE),$(filter $(TARGET_DEVICE),rpi4))
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE_TAGS := optional
6 | LOCAL_STATIC_ANDROID_LIBRARIES := \
7 | androidx.core_core \
8 | androidx.preference_preference
9 |
10 | LOCAL_SRC_FILES := $(call all-java-files-under, src)
11 | LOCAL_PACKAGE_NAME := DeviceParts
12 | LOCAL_CERTIFICATE := platform
13 | LOCAL_PRIVILEGED_MODULE := true
14 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
15 | LOCAL_USE_AAPT2 := true
16 | LOCAL_PRIVATE_PLATFORM_APIS := true
17 |
18 | package_resource_overlays := $(strip \
19 | $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \
20 | $(addprefix $(dir)/, packages/apps/DeviceParts/res))) \
21 | $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \
22 | $(addprefix $(dir)/, packages/apps/DeviceParts/res))))
23 |
24 | LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR)
25 | LOCAL_PROGUARD_ENABLED := disabled
26 | LOCAL_DEX_PREOPT := false
27 |
28 | include frameworks/base/packages/SettingsLib/common.mk
29 |
30 | include packages/apps/OmniLib/common.mk
31 |
32 | include $(BUILD_PACKAGE)
33 |
34 | include $(call all-makefiles-under,$(LOCAL_PATH))
35 | endif
36 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | - default
22 | - left;volup,voldown,back[120A],home[120A],recent[120A],power;right
23 | - left,back[120A],home[120A],recent[120A],volup,voldown,power,right;space;space
24 | - space;space;left,volup,voldown,power,back[120A],home[120A],recent[120A],right
25 |
26 |
27 |
--------------------------------------------------------------------------------
/overlay/packages/apps/ThemePicker/res/values/override.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | - com.android.settings
22 | - com.android.documentsui
23 | - org.omnirom.logcat
24 | - com.android.contacts
25 | - org.omnirom.omnichange
26 | - org.omnirom.omnistore
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/external_camera_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DeviceParts/src/org/omnirom/device/Startup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014-2020 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 | package org.omnirom.device;
19 |
20 | import android.content.BroadcastReceiver;
21 | import android.content.Context;
22 | import android.content.Intent;
23 | import android.content.SharedPreferences;
24 | import androidx.preference.PreferenceManager;
25 | import android.provider.Settings;
26 | import android.text.TextUtils;
27 |
28 | public class Startup extends BroadcastReceiver {
29 |
30 | @Override
31 | public void onReceive(final Context context, final Intent bootintent) {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/gpio/src/tools-common.cpp:
--------------------------------------------------------------------------------
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 | /*
3 | * This file is part of libgpiod.
4 | *
5 | * Copyright (C) 2017-2018 Bartosz Golaszewski
6 | */
7 |
8 | /* Common code for GPIO tools. */
9 |
10 | #include
11 | #include "tools-common.h"
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | void die(const char *fmt, ...)
23 | {
24 | va_list va;
25 |
26 | va_start(va, fmt);
27 | vfprintf(stderr, fmt, va);
28 | fprintf(stderr, "\n");
29 | va_end(va);
30 |
31 | exit(EXIT_FAILURE);
32 | }
33 |
34 | void die_perror(const char *fmt, ...)
35 | {
36 | va_list va;
37 |
38 | va_start(va, fmt);
39 | vfprintf(stderr, fmt, va);
40 | fprintf(stderr, ": %s\n", strerror(errno));
41 | va_end(va);
42 |
43 | exit(EXIT_FAILURE);
44 | }
45 |
46 | void die_logd(const char *fmt, ...)
47 | {
48 | ALOGE(fmt);
49 |
50 | exit(EXIT_FAILURE);
51 | }
52 |
53 | void print_version(void)
54 | {
55 | printf("Copyright (C) 2017-2018 Bartosz Golaszewski\n");
56 | printf("License: LGPLv2.1\n");
57 | printf("This is free software: you are free to change and redistribute it.\n");
58 | printf("There is NO WARRANTY, to the extent permitted by law.\n");
59 | }
60 |
--------------------------------------------------------------------------------
/bluetooth/hal/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2017 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | cc_binary {
17 | name: "android.hardware.bluetooth@1.0-service.rpi4",
18 | proprietary: true,
19 | relative_install_path: "hw",
20 | srcs: [
21 | "hci_packetizer.cc",
22 | "h4_protocol.cc",
23 | "bluetooth_hci.cc",
24 | "async_fd_watcher.cc",
25 | "service.cc"
26 | ],
27 | cflags: ["-Wall", "-Werror"],
28 | header_libs: ["libbluetooth_headers"],
29 | shared_libs: [
30 | "android.hardware.bluetooth@1.0",
31 | "libbase",
32 | "libcutils",
33 | "libhidlbase",
34 | "liblog",
35 | "libutils",
36 | ],
37 | conlyflags: [
38 | "-std=c99",
39 | ],
40 | init_rc: ["android.hardware.bluetooth@1.0-service.rpi4.rc"],
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/scripts/resize_userdata.sh:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 | # called from recovery
3 | # based on resize script from https://konstakang.com/
4 |
5 | # detect storage device
6 | if [ -b "/dev/block/mmcblk0" ]; then
7 | DEVICE=mmcblk0
8 | PARTITION=p4
9 | else
10 | DEVICE=sda
11 | PARTITION=4
12 | fi
13 |
14 | # unmount partitions
15 | umount /data
16 | umount /sdcard
17 |
18 | # remove existing data partition and create new partition table entry
19 | (
20 | echo d
21 | echo 4
22 | echo n
23 | echo p
24 | echo
25 | echo
26 | echo n
27 | echo w
28 | ) | /tmp/fdisk /dev/block/$DEVICE 1>> /tmp/resize.log 2>&1
29 | EXIT=$?
30 | if [ $EXIT != "0" ]; then
31 | echo $EXIT >> /tmp/resize.log
32 | exit $EXIT
33 | fi
34 |
35 | # calculate new filesystem size
36 | CURSIZE=$(/tmp/fdisk -l /dev/block/$DEVICE | grep $DEVICE$PARTITION | awk '{print $4}')
37 | NEWSIZE=$(expr \( $CURSIZE \* 512 \) / 4096)
38 | echo $CURSIZE >> /tmp/resize.log
39 | echo $NEWSIZE >> /tmp/resize.log
40 |
41 | # resize filesystem
42 | resize2fs -f /dev/block/$DEVICE$PARTITION $NEWSIZE 1>> /tmp/resize.log 2>&1
43 |
44 | EXIT=$?
45 | if [ $EXIT != "0" ]; then
46 | echo $EXIT >> /tmp/resize.log
47 | exit $EXIT
48 | fi
49 |
50 | # make sure we have project quotas
51 | # resize2fs should retain - but better save then sorry
52 | tune2fs -O project,quota /dev/block/$DEVICE$PARTITION 1>> /tmp/resize.log 2>&1
53 |
54 | EXIT=$?
55 | if [ $EXIT != "0" ]; then
56 | echo $EXIT >> /tmp/resize.log
57 | exit $EXIT
58 | fi
59 |
60 | exit 0
61 |
--------------------------------------------------------------------------------
/bluetooth/hal/service.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2017 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #define LOG_TAG "android.hardware.bluetooth@1.0-service.btrpi4"
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | #include "bluetooth_hci.h"
25 |
26 | using ::android::hardware::configureRpcThreadpool;
27 | using ::android::hardware::bluetooth::V1_0::IBluetoothHci;
28 | using ::android::hardware::bluetooth::V1_0::btrpi4::BluetoothHci;
29 | using ::android::hardware::joinRpcThreadpool;
30 | using ::android::sp;
31 |
32 | int main(int /* argc */, char** /* argv */) {
33 | sp bluetooth = new BluetoothHci;
34 | configureRpcThreadpool(1, true);
35 | android::status_t status = bluetooth->registerAsService();
36 | if (status == android::OK)
37 | joinRpcThreadpool();
38 | else
39 | ALOGE("Could not register as a service!");
40 | }
41 |
--------------------------------------------------------------------------------
/omni_rpi4.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2020 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | # Inherit device configuration
18 | DEVICE_PATH := device/brcm/rpi4
19 |
20 | PRODUCT_QUOTA_PROJID := 1
21 | PRODUCT_PROPERTY_OVERRIDES += external_storage.projid.enabled=1
22 | PRODUCT_PROPERTY_OVERRIDES += external_storage.sdcardfs.enabled=0
23 |
24 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
25 | $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
26 |
27 | DEVICE_PACKAGE_OVERLAYS += $(DEVICE_PATH)/overlay
28 |
29 | $(call inherit-product, vendor/omni/config/common_tablet.mk)
30 | $(call inherit-product, device/brcm/rpi4/device.mk)
31 |
32 | # Boot animation
33 | TARGET_BOOTANIMATION_SIZE := 720p
34 |
35 | # Device identifier. This must come after all inclusions
36 | PRODUCT_DEVICE := rpi4
37 | PRODUCT_NAME := omni_rpi4
38 | PRODUCT_BRAND := Raspberry
39 | PRODUCT_MODEL := Raspberry Pi 4
40 | PRODUCT_MANUFACTURER := Raspberry
41 | PRODUCT_RELEASE_NAME := Raspberry Pi 4
42 |
43 | $(call inherit-product, vendor/brcm/rpi4/rpi4-vendor.mk)
44 |
--------------------------------------------------------------------------------
/fstab.rpi4:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
4 | #
5 | #
6 |
7 | # these partitions are defined by default from dt using overlay so just keeping here for reference or if ever needed
8 |
9 | #/dev/block/mmcblk0p2 /system ext4 ro,barrier=1 wait,first_stage_mount
10 | #/dev/block/sda2 /system ext4 ro,barrier=1 wait,first_stage_mount
11 |
12 | #/dev/block/mmcblk0p3 /vendor ext4 ro,barrier=1 wait,first_stage_mount
13 | #/dev/block/sda3 /vendor ext4 ro,barrier=1 wait,first_stage_mount
14 |
15 | # TODO fileencryption=aes-256-xts
16 | #/dev/block/mmcblk0p4 /data ext4 noatime,nosuid,nodev,nomblk_io_submit latemount,wait,check,quota
17 | #/dev/block/sda4 /data ext4 noatime,nosuid,nodev,nomblk_io_submit latemount,wait,check,quota
18 |
19 | # TODO fileencryption=aes-256-xts
20 | # relies on the userdata parition beeing number 4 or named sda4 or mmcblk0p4
21 | /dev/block/by-name/userdata /data ext4 noatime,nosuid,nodev,nomblk_io_submit latemount,wait,check,quota
22 |
23 | /devices/platform/scb/*.pcie/*/*/*/usb* auto auto defaults voldmanaged=usb:auto
24 |
--------------------------------------------------------------------------------
/recovery/recovery.fstab:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
4 | #
5 | #
6 |
7 | # these partitions are defined by default from dt using overlay so just keeping here for reference or if ever needed
8 |
9 | /dev/block/mmcblk0p2 /system ext4 ro,barrier=1 wait,first_stage_mount
10 | #/dev/block/sda2 /system ext4 ro,barrier=1 wait,first_stage_mount
11 |
12 | /dev/block/mmcblk0p3 /vendor ext4 ro,barrier=1 wait,first_stage_mount
13 | #/dev/block/sda3 /vendor ext4 ro,barrier=1 wait,first_stage_mount
14 |
15 | # TODO fileencryption=aes-256-xts
16 | #/dev/block/mmcblk0p4 /data ext4 noatime,nosuid,nodev,nomblk_io_submit latemount,wait,check,quota
17 | #/dev/block/sda4 /data ext4 noatime,nosuid,nodev,nomblk_io_submit latemount,wait,check,quota
18 |
19 | # TODO fileencryption=aes-256-xts
20 | # relies on the userdata parition beeing number 4 or named sda4 or mmcblk0p4
21 | #/dev/block/by-name/userdata /data ext4 noatime,nosuid,nodev,nomblk_io_submit latemount,wait,check,quota
22 |
23 | #/devices/platform/scb/*.pcie/*/*/*/usb* auto auto defaults voldmanaged=usb:auto
24 |
--------------------------------------------------------------------------------
/bluetooth/btuart/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016 http://www.brobwind.com
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH := $(my-dir)
16 |
17 | include $(CLEAR_VARS)
18 |
19 | LOCAL_MODULE_TAGS := optional
20 |
21 | LOCAL_MODULE := BCM4345C0.hcd
22 | LOCAL_MODULE_CLASS := DATA
23 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
24 |
25 | LOCAL_MODULE_PATH := \
26 | $(TARGET_OUT_VENDOR)/etc/firmware/brcm/
27 |
28 | include $(BUILD_PREBUILT)
29 |
30 | include $(CLEAR_VARS)
31 |
32 | LOCAL_MODULE_TAGS := optional
33 |
34 | LOCAL_MODULE := BCM4345C5.hcd
35 | LOCAL_MODULE_CLASS := DATA
36 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
37 |
38 | LOCAL_MODULE_PATH := \
39 | $(TARGET_OUT_VENDOR)/etc/firmware/brcm/
40 |
41 | include $(BUILD_PREBUILT)
42 |
43 | include $(CLEAR_VARS)
44 |
45 | LOCAL_MODULE := btuart
46 | LOCAL_PROPRIETARY_MODULE := true
47 |
48 | LOCAL_REQUIRED_MODULES := \
49 | BCM4345C0.hcd \
50 | BCM4345C5.hcd
51 |
52 | LOCAL_SRC_FILES := \
53 | hciattach_rpi4.c
54 |
55 | LOCAL_CFLAGS := \
56 | -DFIRMWARE_DIR=\"/vendor/etc/firmware/brcm/\"
57 |
58 | LOCAL_SHARED_LIBRARIES := \
59 | libcutils liblog
60 |
61 | include $(BUILD_EXECUTABLE)
62 |
--------------------------------------------------------------------------------
/bluetooth/hal/hci_packetizer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2017 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #pragma once
18 |
19 | #include
20 |
21 | #include
22 |
23 | #include "hci_internals.h"
24 |
25 | namespace android {
26 | namespace hardware {
27 | namespace bluetooth {
28 | namespace hci {
29 |
30 | using ::android::hardware::hidl_vec;
31 | using HciPacketReadyCallback = std::function;
32 |
33 | class HciPacketizer {
34 | public:
35 | HciPacketizer(HciPacketReadyCallback packet_cb)
36 | : packet_ready_cb_(packet_cb){};
37 | void OnDataReady(int fd, HciPacketType packet_type);
38 | void CbHciPacket(uint8_t* data, size_t length);
39 | const hidl_vec& GetPacket() const;
40 |
41 | protected:
42 | enum State { HCI_PREAMBLE, HCI_PAYLOAD };
43 | State state_{HCI_PREAMBLE};
44 | uint8_t preamble_[HCI_PREAMBLE_SIZE_MAX];
45 | hidl_vec packet_;
46 | size_t bytes_remaining_{0};
47 | size_t bytes_read_{0};
48 | HciPacketReadyCallback packet_ready_cb_;
49 | };
50 |
51 | } // namespace hci
52 | } // namespace bluetooth
53 | } // namespace hardware
54 | } // namespace android
55 |
--------------------------------------------------------------------------------
/Provision/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/bluetooth/hal/hci_internals.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2016 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #pragma once
18 |
19 | #include
20 |
21 | // HCI UART transport packet types (Volume 4, Part A, 2)
22 | enum HciPacketType {
23 | HCI_PACKET_TYPE_UNKNOWN = 0,
24 | HCI_PACKET_TYPE_COMMAND = 1,
25 | HCI_PACKET_TYPE_ACL_DATA = 2,
26 | HCI_PACKET_TYPE_SCO_DATA = 3,
27 | HCI_PACKET_TYPE_EVENT = 4
28 | };
29 |
30 | // 2 bytes for opcode, 1 byte for parameter length (Volume 2, Part E, 5.4.1)
31 | const size_t HCI_COMMAND_PREAMBLE_SIZE = 3;
32 | const size_t HCI_LENGTH_OFFSET_CMD = 2;
33 |
34 | // 2 bytes for handle, 2 bytes for data length (Volume 2, Part E, 5.4.2)
35 | const size_t HCI_ACL_PREAMBLE_SIZE = 4;
36 | const size_t HCI_LENGTH_OFFSET_ACL = 2;
37 |
38 | // 2 bytes for handle, 1 byte for data length (Volume 2, Part E, 5.4.3)
39 | const size_t HCI_SCO_PREAMBLE_SIZE = 3;
40 | const size_t HCI_LENGTH_OFFSET_SCO = 2;
41 |
42 | // 1 byte for event code, 1 byte for parameter length (Volume 2, Part E, 5.4.4)
43 | const size_t HCI_EVENT_PREAMBLE_SIZE = 2;
44 | const size_t HCI_LENGTH_OFFSET_EVT = 1;
45 |
46 | const size_t HCI_PREAMBLE_SIZE_MAX = HCI_ACL_PREAMBLE_SIZE;
47 |
48 | // Event codes (Volume 2, Part E, 7.7.14)
49 | const uint8_t HCI_COMMAND_COMPLETE_EVENT = 0x0E;
50 |
--------------------------------------------------------------------------------
/init.system.rpi4.rc:
--------------------------------------------------------------------------------
1 | on post-fs-data
2 | chmod 0660 /sys/class/rfkill/rfkill0/state
3 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
4 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
5 |
6 | # gpio
7 | chown system system /dev/gpiochip0
8 | chmod 0666 /dev/gpiochip0
9 | chown system system /dev/gpiochip1
10 | chmod 0666 /dev/gpiochip1
11 | mkdir /data/gpio 0777 system system
12 |
13 | # cpufreq tuning
14 | on property:persist.rpi4.cpufreq.governor=*
15 | write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ${persist.rpi4.cpufreq.governor}
16 |
17 | on property:persist.rpi4.cpufreq.max_freq=*
18 | write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq ${persist.rpi4.cpufreq.max_freq}
19 |
20 | on property:sys.rpi4.boot_mode=recovery
21 | start switch_boot_recovery
22 |
23 | on property:sys.rpi4.boot_mode=rom
24 | start switch_boot_rom
25 |
26 | service switch_boot_recovery /system/xbin/switch_boot recovery
27 | user root
28 | group system
29 | disabled
30 | oneshot
31 |
32 | service switch_boot_rom /system/xbin/switch_boot rom
33 | user root
34 | group system
35 | disabled
36 | oneshot
37 |
38 | on property:persist.rpi4.gpiod.options=* && property:persist.rpi4.gpiod.lines=* && property:sys.boot_completed=1
39 | stop gpiod
40 | start gpiod
41 |
42 | service gpiod /system/bin/gpiod ${persist.rpi4.gpiod.options} ${persist.rpi4.gpiod.lines}
43 | user root
44 | group system
45 | disabled
46 | oneshot
47 |
48 | on property:persist.rpi4.gpiosetd.options=* && property:persist.rpi4.gpiosetd.values=* && property:sys.boot_completed=1
49 | stop gpiosetd
50 | start gpiosetd
51 |
52 | service gpiosetd /system/bin/gpiosetd ${persist.rpi4.gpiosetd.options} ${persist.rpi4.gpiosetd.values}
53 | user system
54 | group system
55 | disabled
56 | oneshot
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 | false
21 |
22 |
23 | false
24 |
25 |
26 | false
27 |
28 |
29 | false
30 |
31 |
32 | false
33 |
34 |
35 | false
36 |
37 |
38 | false
39 |
40 | false
41 |
42 |
43 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Launcher3/quickstep/res/xml/default_workspace_5x5.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
44 |
45 |
--------------------------------------------------------------------------------
/bluetooth/hal/h4_protocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2017 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #pragma once
18 |
19 | #include
20 |
21 | #include "async_fd_watcher.h"
22 | #include "hci_internals.h"
23 | #include "hci_packetizer.h"
24 |
25 | namespace android {
26 | namespace hardware {
27 | namespace bluetooth {
28 | namespace hci {
29 |
30 | using ::android::hardware::hidl_vec;
31 | using PacketReadCallback = std::function&)>;
32 |
33 | class H4Protocol {
34 | public:
35 | H4Protocol(int fd, PacketReadCallback event_cb, PacketReadCallback acl_cb,
36 | PacketReadCallback sco_cb)
37 | : uart_fd_(fd),
38 | event_cb_(event_cb),
39 | acl_cb_(acl_cb),
40 | sco_cb_(sco_cb),
41 | hci_packetizer_([this]() { OnPacketReady(); }) {}
42 |
43 | size_t Send(uint8_t type, const uint8_t* data, size_t length);
44 |
45 | void OnPacketReady();
46 |
47 | void OnDataReady(int fd);
48 |
49 | private:
50 | int uart_fd_;
51 |
52 | PacketReadCallback event_cb_;
53 | PacketReadCallback acl_cb_;
54 | PacketReadCallback sco_cb_;
55 |
56 | HciPacketType hci_packet_type_{HCI_PACKET_TYPE_UNKNOWN};
57 | HciPacketizer hci_packetizer_;
58 | };
59 |
60 | } // namespace hci
61 | } // namespace bluetooth
62 | } // namespace hardware
63 | } // namespace android
64 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 | left,volup,voldown,back;home;recent,power,right
25 |
26 |
27 | wifi,dnd,bt,airplane,location,hotspot,inversion,dark,work,night,screenrecord,reverse
28 |
29 |
30 |
31 | wifi,bt,location,airplane,dark,screenrecord
32 |
33 |
34 | true
35 |
36 |
37 | /sys/class/thermal/thermal_zone0/temp
38 |
39 |
40 | 1000
41 |
42 |
43 | 0
44 |
45 |
--------------------------------------------------------------------------------
/init.rpi4.usb.rc:
--------------------------------------------------------------------------------
1 | on boot
2 | mount configfs none /config
3 | mkdir /config/usb_gadget/g1 0770 shell shell
4 | mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
5 | write /config/usb_gadget/g1/bcdDevice 0x0223
6 | write /config/usb_gadget/g1/bcdUSB 0x0200
7 | write /config/usb_gadget/g1/idVendor 0x18d1
8 | write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
9 | write /config/usb_gadget/g1/strings/0x409/manufacturer "Raspberry"
10 | write /config/usb_gadget/g1/strings/0x409/product "Pi 4"
11 | mkdir /config/usb_gadget/g1/functions/ffs.adb
12 | mkdir /config/usb_gadget/g1/functions/mtp.gs0
13 | mkdir /config/usb_gadget/g1/functions/accessory.gs2
14 | mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
15 | mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
16 | write /config/usb_gadget/g1/configs/b.1/MaxPower 500
17 | mkdir /dev/usb-ffs 0775 shell shell
18 | mkdir /dev/usb-ffs/adb 0770 shell shell
19 | mkdir /dev/usb-ffs/mtp 0770 mtp mtp
20 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
21 | mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
22 | setprop sys.usb.mtp.device_type 3
23 | setprop sys.usb.configfs 1
24 | symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
25 |
26 | on property:sys.usb.config=mtp && property:sys.usb.configfs=1
27 | write /config/usb_gadget/g1/idProduct 0x4ee1
28 |
29 | on property:sys.usb.config=adb && property:sys.usb.configfs=1
30 | write /config/usb_gadget/g1/idProduct 0x4ee7
31 | #setprop service.adb.tcp.port 5555
32 |
33 | on property:sys.usb.config=accessory && property:sys.usb.configfs=1
34 | write /config/usb_gadget/g1/idVendor 0x18d1
35 | write /config/usb_gadget/g1/idProduct 0x2d00
36 |
37 | on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
38 | write /config/usb_gadget/g1/idVendor 0x18d1
39 | write /config/usb_gadget/g1/idProduct 0x2d01
40 |
--------------------------------------------------------------------------------
/bluetooth/btuart/hciattach_rpi4.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __HCIATTACH_RPI3_H
3 | #define __HCIATTACH_RPI3_H
4 |
5 | #include
6 |
7 | #ifndef N_HCI
8 | #define N_HCI 15
9 | #endif
10 |
11 | #define HCIUARTSETPROTO _IOW('U', 200, int)
12 | #define HCIUARTGETPROTO _IOR('U', 201, int)
13 | #define HCIUARTGETDEVICE _IOR('U', 202, int)
14 | #define HCIUARTSETFLAGS _IOW('U', 203, int)
15 | #define HCIUARTGETFLAGS _IOR('U', 204, int)
16 |
17 | #define HCI_UART_H4 0
18 | #define HCI_UART_BCM 7
19 |
20 | #define HCI_UART_RAW_DEVICE 0
21 | #define HCI_UART_RESET_ON_INIT 1
22 | #define HCI_UART_CREATE_AMP 2
23 | #define HCI_UART_INIT_PENDING 3
24 | #define HCI_UART_EXT_CONFIG 4
25 | #define HCI_UART_VND_DETECT 5
26 |
27 | static inline unsigned int tty_get_speed(int speed)
28 | {
29 | switch (speed) {
30 | case 9600:
31 | return B9600;
32 | case 19200:
33 | return B19200;
34 | case 38400:
35 | return B38400;
36 | case 57600:
37 | return B57600;
38 | case 115200:
39 | return B115200;
40 | case 230400:
41 | return B230400;
42 | case 460800:
43 | return B460800;
44 | case 500000:
45 | return B500000;
46 | case 576000:
47 | return B576000;
48 | case 921600:
49 | return B921600;
50 | case 1000000:
51 | return B1000000;
52 | case 1152000:
53 | return B1152000;
54 | case 1500000:
55 | return B1500000;
56 | case 2000000:
57 | return B2000000;
58 | #ifdef B2500000
59 | case 2500000:
60 | return B2500000;
61 | #endif
62 | #ifdef B3000000
63 | case 3000000:
64 | return B3000000;
65 | #endif
66 | #ifdef B3500000
67 | case 3500000:
68 | return B3500000;
69 | #endif
70 | #ifdef B3710000
71 | case 3710000:
72 | return B3710000;
73 | #endif
74 | #ifdef B4000000
75 | case 4000000:
76 | return B4000000;
77 | #endif
78 | }
79 |
80 | return 0;
81 | }
82 |
83 | int read_hci_event(int fd, unsigned char *buf, int size);
84 | int set_speed(int fd, struct termios *ti, int speed);
85 | int uart_speed(int speed);
86 |
87 | int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
88 | const char *bdaddr);
89 |
90 | #endif
91 |
--------------------------------------------------------------------------------
/DeviceParts/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | - @string/rotation_lock_off
19 | - @string/rotation_lock_landscape
20 | - @string/rotation_lock_portrait
21 | - @string/rotation_lock_portrait_reverse
22 | - @string/rotation_lock_landscape_reverse
23 |
24 |
25 |
26 | - 0
27 | - 1
28 | - 2
29 | - 3
30 | - 4
31 |
32 |
33 |
34 | - @string/audio_card_hdmi
35 | - @string/audio_card_headphone_jack
36 |
37 |
38 |
39 | - 0
40 | - 1
41 |
42 |
43 |
44 | - @string/boot_mode_rom
45 | - @string/boot_mode_recovery
46 |
47 |
48 |
49 | - rom
50 | - recovery
51 |
52 |
--------------------------------------------------------------------------------
/bluetooth/hal/async_fd_watcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2016 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #pragma once
18 |
19 | #include