├── audio
├── config
│ └── audioPolicy
│ │ ├── api
│ │ ├── last_current.txt
│ │ ├── last_removed.txt
│ │ └── removed.txt
│ │ ├── engine
│ │ ├── api
│ │ │ ├── last_current.txt
│ │ │ ├── last_removed.txt
│ │ │ └── removed.txt
│ │ └── Android.bp
│ │ ├── capengine
│ │ ├── api
│ │ │ ├── last_current.txt
│ │ │ ├── last_removed.txt
│ │ │ └── removed.txt
│ │ └── Android.bp
│ │ └── Android.bp
├── manifest.json
├── file_contexts
├── alsa_utils
│ ├── Android.bp
│ └── include
│ │ ├── alsa_format.h
│ │ └── alsa_logging.h
├── libeffects
│ ├── loudness
│ │ ├── dsp
│ │ │ └── core
│ │ │ │ ├── interpolation.h
│ │ │ │ └── interpolator_linear.h
│ │ ├── Android.bp
│ │ └── aidl
│ │ │ ├── LoudnessEnhancerContext.h
│ │ │ └── EffectLoudnessEnhancer.h
│ ├── downmix
│ │ ├── Android.bp
│ │ └── aidl
│ │ │ ├── DownmixContext.h
│ │ │ └── EffectDownmix.h
│ ├── visualizer
│ │ ├── Android.bp
│ │ └── aidl
│ │ │ └── Visualizer.h
│ ├── reverb
│ │ ├── Android.bp
│ │ └── aidl
│ │ │ └── EffectReverb.h
│ ├── bundle
│ │ └── Android.bp
│ └── dynamicsproc
│ │ ├── Android.bp
│ │ ├── dsp
│ │ └── SHCircularBuffer.h
│ │ └── aidl
│ │ └── DynamicsProcessing.h
├── primary
│ ├── PrimaryMixer.cpp
│ └── PrimaryMixer.h
├── include
│ ├── core-impl
│ │ ├── Configuration.h
│ │ ├── AidlConversionXsdc.h
│ │ ├── ModuleAlsa.h
│ │ ├── Config.h
│ │ ├── Telephony.h
│ │ ├── StreamStub.h
│ │ ├── DriverStubImpl.h
│ │ ├── ModuleStub.h
│ │ ├── ChildInterface.h
│ │ ├── ModulePrimary.h
│ │ ├── Bluetooth.h
│ │ ├── ModuleUsb.h
│ │ ├── ModuleRemoteSubmix.h
│ │ └── StreamUsb.h
│ └── effect-impl
│ │ ├── EffectRange.h
│ │ └── EffectThread.h
├── android.hardware.audio.service.rpi.rc
├── android.hardware.audio.service.rpi.xml
├── stub
│ ├── StreamStub.cpp
│ ├── ApeHeader.h
│ └── ApeHeader.cpp
├── usb
│ └── UsbAlsaMixerControl.h
├── AidlConversionXsdc.cpp
├── usb_audio_policy_configuration.xml
├── alsa
│ └── ModuleAlsa.cpp
├── Config.cpp
└── EffectMain.cpp
├── sepolicy
├── bootanim.te
├── priv_app.te
├── device.te
├── mediaserver.te
├── mediaswcodec.te
├── platform_app.te
├── system_app.te
├── surfaceflinger.te
├── system_server.te
├── untrusted_app_all.te
├── keystore.te
├── proc_net.te
├── hal_keymint_default.te
├── hal_audio_default.te
├── hal_graphics_allocator_default.te
├── init.te
├── netd.te
├── hal_tv_hdmi_connection_default.te
├── file.te
├── mediacodec.te
├── hal_tv_hdmi_cec_default.te
├── suspend_blocker.te
├── hal_drm_clearkey.te
├── kernel.te
├── property.te
├── vendor_init.te
├── hal_graphics_composer_default.te
├── te_macros
├── hal_drm_widevine.te
├── hal_camera.te
├── service_contexts
├── property_contexts
├── file_contexts
└── genfs_contexts
├── product_manifest.xml
├── README.md
├── manifest.xml
├── light
├── apex_manifest.json
├── android.hardware.light-service.rpi.xml
├── apex_file_contexts
├── android.hardware.light-service.rpi.rc
├── Lights.h
├── Android.bp
└── main.cpp
├── seccomp_policy
├── mediaswcodec.policy
└── mediacodec.policy
├── health
├── apex_manifest.json
├── android.hardware.health-service.rpi.xml
├── apex_file_contexts
├── android.hardware.health-service.rpi.rc
├── main.cpp
├── HealthImpl.h
└── Android.bp
├── usb
├── apex_manifest.json
├── android.hardware.usb.gadget-service.rpi.rc
├── apex_file_contexts
├── android.hardware.usb.gadget-service.rpi.xml
├── main.cpp
└── Android.bp
├── bluetooth
├── apex_manifest.json
├── android.hardware.bluetooth-service.rpi.xml
├── apex_file_contexts
├── android.hardware.bluetooth-service.rpi.rc
├── net_bluetooth_mgmt.h
├── main.cpp
├── Android.bp
└── BluetoothHci.h
├── hdmi
├── cec
│ ├── apex_manifest.json
│ ├── android.hardware.tv.hdmi.cec-service.rpi.rc
│ ├── apex_file_contexts
│ ├── android.hardware.tv.hdmi.cec-service.rpi.xml
│ ├── HdmiCecPort.h
│ ├── main.cpp
│ └── Android.bp
└── connection
│ ├── apex_manifest.json
│ ├── android.hardware.tv.hdmi.connection-service.rpi.rc
│ ├── apex_file_contexts
│ ├── android.hardware.tv.hdmi.connection-service.rpi.xml
│ ├── main.cpp
│ ├── Android.bp
│ └── HdmiConnection.h
├── wifi
├── apex_manifest_hostapd.json
├── apex_manifest_supplicant.json
├── wpa_supplicant_overlay.conf
├── apex_file_contexts_hostapd
├── apex_file_contexts_supplicant
├── android.hardware.wifi.hostapd-service.rc
├── android.hardware.wifi.supplicant-service.rc
└── Android.bp
├── camera
├── external
│ ├── apex_manifest.json
│ ├── apex_file_contexts
│ ├── android.hardware.camera.provider-V1-external-service.xml
│ ├── android.hardware.camera.provider-V1-external-service.rc
│ ├── Android.bp
│ └── external_camera_config.xml
└── libcamera
│ └── camera_hal.yaml
├── suspend_blocker
├── apex_manifest.json
├── suspend_blocker_rpi.rc
├── apex_file_contexts
├── suspend_blocker_rpi.cpp
└── Android.bp
├── Android.bp
├── ramdisk
├── init.rpi4.rc
├── fstab.rpi4
└── ueventd.rpi4.rc
├── overlay
├── WifiRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── AndroidRpiOverlay
│ ├── Android.bp
│ └── AndroidManifest.xml
├── AndroidTvRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── BluetoothRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── CarServiceRpiOverlay
│ ├── Android.bp
│ └── AndroidManifest.xml
├── SettingsRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── SystemUIRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── SettingsProviderRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── defaults.xml
└── SettingsProviderTvRpiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ └── values
│ └── defaults.xml
├── car
├── display_settings.xml
├── evs_config_override.json
└── car_audio_configuration.xml
├── AndroidProducts.mk
├── framework_compatibility_matrix.xml
├── boot
└── config.txt
├── mkbootimg.mk
├── media
├── media_codecs.xml
└── media_codecs_v4l2_c2_video.xml
├── aosp_rpi4_tv.mk
├── aosp_rpi4.mk
├── BoardConfig.mk
├── vendor.prop
└── mkimg.sh
/audio/config/audioPolicy/api/last_current.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/api/last_removed.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sepolicy/bootanim.te:
--------------------------------------------------------------------------------
1 | gpu_access(bootanim)
2 |
--------------------------------------------------------------------------------
/sepolicy/priv_app.te:
--------------------------------------------------------------------------------
1 | gpu_access(priv_app)
2 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/engine/api/last_current.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/engine/api/last_removed.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sepolicy/device.te:
--------------------------------------------------------------------------------
1 | type cec_device, dev_type;
2 |
--------------------------------------------------------------------------------
/sepolicy/mediaserver.te:
--------------------------------------------------------------------------------
1 | gpu_access(mediaserver)
2 |
--------------------------------------------------------------------------------
/sepolicy/mediaswcodec.te:
--------------------------------------------------------------------------------
1 | gpu_access(mediaswcodec)
2 |
--------------------------------------------------------------------------------
/sepolicy/platform_app.te:
--------------------------------------------------------------------------------
1 | gpu_access(platform_app)
2 |
--------------------------------------------------------------------------------
/sepolicy/system_app.te:
--------------------------------------------------------------------------------
1 | gpu_access(system_app)
2 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/capengine/api/last_current.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/capengine/api/last_removed.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sepolicy/surfaceflinger.te:
--------------------------------------------------------------------------------
1 | gpu_access(surfaceflinger)
2 |
--------------------------------------------------------------------------------
/sepolicy/system_server.te:
--------------------------------------------------------------------------------
1 | gpu_access(system_server)
2 |
--------------------------------------------------------------------------------
/sepolicy/untrusted_app_all.te:
--------------------------------------------------------------------------------
1 | gpu_access(untrusted_app_all)
2 |
--------------------------------------------------------------------------------
/product_manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sepolicy/keystore.te:
--------------------------------------------------------------------------------
1 | hal_client_domain(keystore, hal_gatekeeper)
2 |
--------------------------------------------------------------------------------
/sepolicy/proc_net.te:
--------------------------------------------------------------------------------
1 | allow proc_net proc:filesystem associate;
2 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/api/removed.txt:
--------------------------------------------------------------------------------
1 | // Signature format: 2.0
2 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/engine/api/removed.txt:
--------------------------------------------------------------------------------
1 | // Signature format: 2.0
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Raspberry Vanilla AOSP 16 device configuration for Raspberry Pi 4.
2 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/capengine/api/removed.txt:
--------------------------------------------------------------------------------
1 | // Signature format: 2.0
2 |
--------------------------------------------------------------------------------
/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sepolicy/hal_keymint_default.te:
--------------------------------------------------------------------------------
1 | get_prop(hal_keymint_default, serialno_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/hal_audio_default.te:
--------------------------------------------------------------------------------
1 | get_prop(hal_audio_default, vendor_audio_config_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/hal_graphics_allocator_default.te:
--------------------------------------------------------------------------------
1 | gpu_access(hal_graphics_allocator_default)
2 |
--------------------------------------------------------------------------------
/audio/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.audio.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/sepolicy/init.te:
--------------------------------------------------------------------------------
1 | allow init kernel:system module_request;
2 | allow init tmpfs:lnk_file create;
3 |
--------------------------------------------------------------------------------
/light/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.light.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/seccomp_policy/mediaswcodec.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | sched_getaffinity: 1
3 | sysinfo: 1
4 |
--------------------------------------------------------------------------------
/sepolicy/netd.te:
--------------------------------------------------------------------------------
1 | dontaudit netd self:capability sys_module;
2 | allow netd kernel:system module_request;
3 |
--------------------------------------------------------------------------------
/health/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.health.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/sepolicy/hal_tv_hdmi_connection_default.te:
--------------------------------------------------------------------------------
1 | allow hal_tv_hdmi_connection_default sysfs_hdmi:file r_file_perms;
2 |
--------------------------------------------------------------------------------
/usb/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.usb.gadget.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/bluetooth/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.bluetooth.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/hdmi/cec/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.tv.hdmi.cec.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/wifi/apex_manifest_hostapd.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.wifi.hostapd.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/sepolicy/file.te:
--------------------------------------------------------------------------------
1 | type mediadrm_vendor_data_file, file_type, data_file_type;
2 | type sysfs_hdmi, fs_type, sysfs_type;
3 |
--------------------------------------------------------------------------------
/camera/external/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.camera.external.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/suspend_blocker/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.suspend_blocker.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/wifi/apex_manifest_supplicant.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.wifi.supplicant.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/hdmi/connection/apex_manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.android.hardware.tv.hdmi.connection.rpi4",
3 | "version": 1
4 | }
5 |
--------------------------------------------------------------------------------
/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | soong_namespace {
6 | }
7 |
--------------------------------------------------------------------------------
/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | wowlan_triggers=any
3 | p2p_disabled=1
4 | filter_rssi=-75
5 | no_ctrl_interface=
--------------------------------------------------------------------------------
/sepolicy/mediacodec.te:
--------------------------------------------------------------------------------
1 | gpu_access(mediacodec)
2 | get_prop(mediacodec, vendor_ffmpeg_config_prop)
3 | get_prop(mediacodec, vendor_v4l2_config_prop)
4 |
--------------------------------------------------------------------------------
/sepolicy/hal_tv_hdmi_cec_default.te:
--------------------------------------------------------------------------------
1 | allow hal_tv_hdmi_cec_default cec_device:chr_file rw_file_perms;
2 | get_prop(hal_tv_hdmi_cec_default, vendor_hdmi_config_prop)
3 |
--------------------------------------------------------------------------------
/seccomp_policy/mediacodec.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | _llseek: 1
3 | eventfd2: 1
4 | getcwd: 1
5 | pselect6: 1
6 | recvfrom: 1
7 | sched_getaffinity: 1
8 | sendto: 1
9 | sysinfo: 1
10 |
--------------------------------------------------------------------------------
/suspend_blocker/suspend_blocker_rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.suspend_blocker-rpi /apex/com.android.hardware.suspend_blocker.rpi4/bin/suspend_blocker_rpi
2 | class hal
3 | group system
4 | user root
5 |
--------------------------------------------------------------------------------
/sepolicy/suspend_blocker.te:
--------------------------------------------------------------------------------
1 | type suspend_blocker, domain;
2 | type suspend_blocker_exec, exec_type, vendor_file_type, file_type;
3 |
4 | init_daemon_domain(suspend_blocker);
5 |
6 | wakelock_use(suspend_blocker);
7 |
--------------------------------------------------------------------------------
/suspend_blocker/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/suspend_blocker_rpi u:object_r:suspend_blocker_exec:s0
4 |
--------------------------------------------------------------------------------
/wifi/apex_file_contexts_hostapd:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/hostapd u:object_r:hal_wifi_hostapd_default_exec:s0
4 |
--------------------------------------------------------------------------------
/sepolicy/hal_drm_clearkey.te:
--------------------------------------------------------------------------------
1 | type hal_drm_clearkey, domain;
2 | type hal_drm_clearkey_exec, vendor_file_type, exec_type, file_type;
3 | init_daemon_domain(hal_drm_clearkey)
4 |
5 | hal_server_domain(hal_drm_clearkey, hal_drm)
6 |
--------------------------------------------------------------------------------
/wifi/apex_file_contexts_supplicant:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/wpa_supplicant u:object_r:hal_wifi_supplicant_default_exec:s0
4 |
--------------------------------------------------------------------------------
/usb/android.hardware.usb.gadget-service.rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.usb_gadget-rpi /apex/com.android.hardware.usb.gadget.rpi4/bin/hw/android.hardware.usb.gadget-service.rpi
2 | class hal
3 | user system
4 | group system shell mtp
5 |
--------------------------------------------------------------------------------
/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/android.hardware.bluetooth-service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.bluetooth
4 | IBluetoothHci/default
5 |
6 |
7 |
--------------------------------------------------------------------------------
/light/android.hardware.light-service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.light
4 | 2
5 | ILights/default
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ramdisk/init.rpi4.rc:
--------------------------------------------------------------------------------
1 | import /vendor/etc/init/hw/init.rpi4.usb.rc
2 |
3 | on init
4 | symlink /sdcard /storage/sdcard0
5 |
6 | on fs
7 | mount_all /vendor/etc/fstab.rpi4 --early
8 |
9 | on late-fs
10 | mount_all /vendor/etc/fstab.rpi4 --late
11 |
--------------------------------------------------------------------------------
/sepolicy/property.te:
--------------------------------------------------------------------------------
1 | vendor_internal_prop(vendor_audio_config_prop)
2 | vendor_internal_prop(vendor_ffmpeg_config_prop)
3 | vendor_internal_prop(vendor_hdmi_config_prop)
4 | vendor_internal_prop(vendor_hwc_config_prop)
5 | vendor_internal_prop(vendor_v4l2_config_prop)
6 |
--------------------------------------------------------------------------------
/health/android.hardware.health-service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.health
4 | 4
5 | IHealth/default
6 |
7 |
8 |
--------------------------------------------------------------------------------
/light/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.light-service\.rpi u:object_r:hal_light_default_exec:s0
4 |
--------------------------------------------------------------------------------
/health/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.health-service\.rpi u:object_r:hal_health_default_exec:s0
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor_init.te:
--------------------------------------------------------------------------------
1 | set_prop(vendor_init, vendor_audio_config_prop)
2 | set_prop(vendor_init, vendor_ffmpeg_config_prop)
3 | set_prop(vendor_init, vendor_hdmi_config_prop)
4 | set_prop(vendor_init, vendor_hwc_config_prop)
5 | set_prop(vendor_init, vendor_v4l2_config_prop)
6 |
--------------------------------------------------------------------------------
/health/android.hardware.health-service.rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.health-rpi /apex/com.android.hardware.health.rpi4/bin/hw/android.hardware.health-service.rpi
2 | class hal
3 | user system
4 | group system
5 | capabilities WAKE_ALARM BLOCK_SUSPEND
6 | file /dev/kmsg w
7 |
--------------------------------------------------------------------------------
/bluetooth/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.bluetooth-service\.rpi u:object_r:hal_bluetooth_default_exec:s0
4 |
--------------------------------------------------------------------------------
/overlay/WifiRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "WifiRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/usb/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.usb\.gadget-service\.rpi u:object_r:hal_usb_gadget_default_exec:s0
4 |
--------------------------------------------------------------------------------
/hdmi/cec/android.hardware.tv.hdmi.cec-service.rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.cec-rpi /apex/com.android.hardware.tv.hdmi.cec.rpi4/bin/hw/android.hardware.tv.hdmi.cec-service.rpi
2 | interface aidl android.hardware.tv.hdmi.cec.IHdmiCec/default
3 | class hal
4 | user system
5 | group system
6 |
--------------------------------------------------------------------------------
/overlay/AndroidRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "AndroidRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/hdmi/cec/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.tv\.hdmi\.cec-service\.rpi u:object_r:hal_tv_hdmi_cec_default_exec:s0
4 |
--------------------------------------------------------------------------------
/overlay/AndroidTvRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "AndroidTvRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/overlay/BluetoothRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "BluetoothRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/overlay/CarServiceRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2023 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "CarServiceRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/overlay/SettingsRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "SettingsRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/overlay/SystemUIRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "SystemUIRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/sepolicy/hal_graphics_composer_default.te:
--------------------------------------------------------------------------------
1 | vndbinder_use(hal_graphics_composer_default)
2 | gpu_access(hal_graphics_composer_default)
3 | get_prop(hal_graphics_composer_default, vendor_hwc_config_prop)
4 |
5 | allow hal_graphics_composer_default self:netlink_kobject_uevent_socket { bind create read };
6 |
--------------------------------------------------------------------------------
/overlay/SettingsProviderRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "SettingsProviderRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/overlay/SettingsProviderTvRpiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021-2022 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | runtime_resource_overlay {
6 | name: "SettingsProviderTvRpiOverlay",
7 | resource_dirs: ["res"],
8 | sdk_version: "current",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/bluetooth/android.hardware.bluetooth-service.rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.bluetooth-rpi /apex/com.android.hardware.bluetooth.rpi4/bin/hw/android.hardware.bluetooth-service.rpi
2 | class hal
3 | capabilities BLOCK_SUSPEND NET_ADMIN SYS_NICE
4 | user bluetooth
5 | group bluetooth
6 | task_profiles HighPerformance
7 |
--------------------------------------------------------------------------------
/car/display_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/camera/external/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.camera\.provider-V1-external-service u:object_r:hal_camera_default_exec:s0
4 |
--------------------------------------------------------------------------------
/hdmi/connection/android.hardware.tv.hdmi.connection-service.rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.hdmi-rpi /apex/com.android.hardware.tv.hdmi.connection.rpi4/bin/hw/android.hardware.tv.hdmi.connection-service.rpi
2 | interface aidl android.hardware.tv.hdmi.connection.IHdmiConnection/default
3 | class hal
4 | user system
5 | group system
6 |
--------------------------------------------------------------------------------
/hdmi/connection/apex_file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.tv\.hdmi\.connection-service\.rpi u:object_r:hal_tv_hdmi_connection_default_exec:s0
4 |
--------------------------------------------------------------------------------
/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 r_dir_perms;
6 | allow $1 gpu_device:chr_file rw_file_perms;
7 | allow $1 sysfs_gpu:dir r_dir_perms;
8 | allow $1 sysfs_gpu:file r_file_perms;
9 | ')
10 |
--------------------------------------------------------------------------------
/usb/android.hardware.usb.gadget-service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.usb.gadget
4 | 1
5 |
6 | IUsbGadget
7 | default
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/hdmi/cec/android.hardware.tv.hdmi.cec-service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.tv.hdmi.cec
4 | 1
5 |
6 | IHdmiCec
7 | default
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/sepolicy/hal_drm_widevine.te:
--------------------------------------------------------------------------------
1 | type hal_drm_widevine, domain;
2 | type hal_drm_widevine_exec, vendor_file_type, exec_type, file_type;
3 | init_daemon_domain(hal_drm_widevine)
4 |
5 | hal_server_domain(hal_drm_widevine, hal_drm)
6 |
7 | allow hal_drm_widevine mediadrm_vendor_data_file:file create_file_perms;
8 | allow hal_drm_widevine mediadrm_vendor_data_file:dir create_dir_perms;
9 |
--------------------------------------------------------------------------------
/audio/file_contexts:
--------------------------------------------------------------------------------
1 | (/.*)? u:object_r:vendor_file:s0
2 | /etc(/.*)? u:object_r:vendor_configs_file:s0
3 | /bin/hw/android\.hardware\.audio\.service.rpi u:object_r:hal_audio_default_exec:s0
4 | /bin/hw/android\.hardware\.audio\.effect\.service.rpi u:object_r:hal_audio_default_exec:s0
5 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | xsd_config {
7 | name: "audio_policy_configuration_aidl_rpi",
8 | srcs: ["audio_policy_configuration.xsd"],
9 | package_name: "android.audio.policy.configuration",
10 | nullability: true,
11 | }
12 |
--------------------------------------------------------------------------------
/hdmi/connection/android.hardware.tv.hdmi.connection-service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.tv.hdmi.connection
4 | 1
5 |
6 | IHdmiConnection
7 | default
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/camera/external/android.hardware.camera.provider-V1-external-service.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.camera.provider
4 | 1
5 |
6 | ICameraProvider
7 | external/0
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/engine/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | xsd_config {
7 | name: "audio_policy_engine_configuration_aidl_rpi",
8 | srcs: ["audio_policy_engine_configuration.xsd"],
9 | package_name: "android.audio.policy.engine.configuration",
10 | nullability: true,
11 | }
12 |
--------------------------------------------------------------------------------
/AndroidProducts.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2021-2023 KonstaKANG
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | PRODUCT_MAKEFILES := \
8 | $(LOCAL_DIR)/aosp_rpi4.mk \
9 | $(LOCAL_DIR)/aosp_rpi4_car.mk \
10 | $(LOCAL_DIR)/aosp_rpi4_tv.mk
11 |
12 | COMMON_LUNCH_CHOICES := \
13 | aosp_rpi4-trunk_staging-userdebug \
14 | aosp_rpi4_car-trunk_staging-userdebug \
15 | aosp_rpi4_tv-trunk_staging-userdebug
16 |
--------------------------------------------------------------------------------
/framework_compatibility_matrix.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.media.c2
4 | 1
5 |
6 | IComponentStore
7 | ffmpeg
8 | v4l2
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/audio/config/audioPolicy/capengine/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | xsd_config {
7 | name: "audio_policy_capengine_configuration_aidl_rpi",
8 | srcs: ["PolicyConfigurableDomains.xsd"],
9 | package_name: "android.audio.policy.capengine.configuration",
10 | nullability: true,
11 | root_elements: ["ConfigurableDomains"],
12 | }
13 |
--------------------------------------------------------------------------------
/camera/external/android.hardware.camera.provider-V1-external-service.rc:
--------------------------------------------------------------------------------
1 | service vendor.camera.provider-ext /apex/com.android.hardware.camera.external.rpi4/bin/hw/android.hardware.camera.provider-V1-external-service
2 | interface aidl android.hardware.camera.provider.ICameraProvider/external/0
3 | class hal
4 | user cameraserver
5 | group audio camera input drmrpc usb
6 | ioprio rt 4
7 | capabilities SYS_NICE
8 | task_profiles CameraServiceCapacity MaxPerformance
9 |
--------------------------------------------------------------------------------
/sepolicy/hal_camera.te:
--------------------------------------------------------------------------------
1 | vndbinder_use(hal_camera_default);
2 |
3 | allow hal_camera_default hal_graphics_mapper_hwservice:hwservice_manager find;
4 | hal_client_domain(hal_camera_default, hal_graphics_allocator);
5 | hal_client_domain(hal_camera_default, hal_graphics_composer);
6 |
7 | allow cameraserver device:dir r_dir_perms;
8 | allow cameraserver video_device:dir r_dir_perms;
9 | allow cameraserver video_device:chr_file rw_file_perms;
10 |
11 | gpu_access(hal_camera_default)
12 | gpu_access(cameraserver)
13 |
--------------------------------------------------------------------------------
/sepolicy/service_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | android.hardware.camera.provider.ICameraProvider/external/0 u:object_r:hal_camera_service:s0
3 | android.hardware.camera.provider.ICameraProvider/libcamera/0 u:object_r:hal_camera_service:s0
4 |
5 | # DRM
6 | android.hardware.drm.IDrmFactory/widevine u:object_r:hal_drm_service:s0
7 |
8 | # Gatekeeper
9 | android.hardware.security.sharedsecret.ISharedSecret/gatekeeper u:object_r:hal_gatekeeper_service:s0
10 |
11 | # Graphics
12 | mapper/minigbm_gbm_mesa u:object_r:hal_graphics_mapper_service:s0
13 |
--------------------------------------------------------------------------------
/wifi/android.hardware.wifi.hostapd-service.rc:
--------------------------------------------------------------------------------
1 | on property:apex.all.ready=true
2 | mkdir /data/vendor/wifi 0770 wifi wifi
3 | mkdir /data/vendor/wifi/hostapd 0770 wifi wifi
4 | mkdir /data/vendor/wifi/hostapd/sockets 0770 wifi wifi
5 |
6 | service hostapd /apex/com.android.hardware.wifi.hostapd.rpi4/bin/hw/hostapd
7 | interface aidl android.hardware.wifi.hostapd.IHostapd/default
8 | class main
9 | capabilities NET_ADMIN NET_RAW
10 | user wifi
11 | group wifi net_raw net_admin
12 | disabled
13 | oneshot
14 |
--------------------------------------------------------------------------------
/suspend_blocker/suspend_blocker_rpi.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | * Copyright (C) 2021-2022 KonstaKANG
4 | *
5 | * SPDX-License-Identifier: Apache-2.0
6 | */
7 |
8 | #include
9 | #include
10 |
11 | int main() {
12 | auto wl = android::wakelock::WakeLock::tryGet("suspend_blocker_rpi"); // RAII object
13 | if (!wl.has_value()) {
14 | return EXIT_FAILURE;
15 | }
16 |
17 | sigset_t mask;
18 | sigemptyset(&mask);
19 | return sigsuspend(&mask); // Infinite sleep
20 | }
21 |
--------------------------------------------------------------------------------
/overlay/AndroidRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/AndroidTvRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/BluetoothRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/SettingsRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/SystemUIRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/SettingsProviderRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/SettingsProviderTvRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/overlay/WifiRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/overlay/CarServiceRpiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/camera/libcamera/camera_hal.yaml:
--------------------------------------------------------------------------------
1 | cameras:
2 | "/base/soc/i2c0mux/i2c@1/imx219@10":
3 | location: back
4 | rotation: 0
5 | "/base/soc/i2c0mux/i2c@1/imx296@1a":
6 | location: back
7 | rotation: 0
8 | "/base/soc/i2c0mux/i2c@1/imx477@1a":
9 | location: back
10 | rotation: 0
11 | "/base/soc/i2c0mux/i2c@1/imx500@1a":
12 | location: back
13 | rotation: 0
14 | "/base/soc/i2c0mux/i2c@1/imx519@1a":
15 | location: back
16 | rotation: 0
17 | "/base/soc/i2c0mux/i2c@1/imx708@1a":
18 | location: back
19 | rotation: 0
20 | "/base/soc/i2c0mux/i2c@1/ov5647@36":
21 | location: back
22 | rotation: 0
23 | "/base/soc/i2c0mux/i2c@1/ov64a40@36":
24 | location: back
25 | rotation: 0
26 |
--------------------------------------------------------------------------------
/boot/config.txt:
--------------------------------------------------------------------------------
1 | # Kernel
2 | arm_64bit=1
3 | kernel=Image
4 |
5 | # Ramdisk
6 | initramfs ramdisk.img followkernel
7 |
8 | # Audio
9 | dtparam=audio=on
10 |
11 | # Camera
12 | camera_auto_detect=1
13 | start_x=1
14 |
15 | # CPU
16 | arm_boost=1
17 |
18 | # Display
19 | disable_overscan=1
20 |
21 | # Display panel
22 | #dtoverlay=vc4-kms-dsi-7inch
23 | #dtoverlay=vc4-kms-dsi-ili9881-5inch
24 | #dtoverlay=vc4-kms-dsi-ili9881-7inch
25 |
26 | # Graphics acceleration
27 | disable_fw_kms_setup=1
28 | dtoverlay=vc4-kms-v3d
29 |
30 | # I2C
31 | #dtparam=i2c_arm=on
32 |
33 | # I2S
34 | #dtparam=i2s=on
35 |
36 | # Serial console
37 | enable_uart=1
38 |
39 | # SPI
40 | #dtparam=spi=on
41 |
42 | # USB
43 | dtoverlay=dwc2,dr_mode=peripheral
44 | [cm4]
45 | dtoverlay=dwc2,dr_mode=otg
46 | [all]
47 |
--------------------------------------------------------------------------------
/wifi/android.hardware.wifi.supplicant-service.rc:
--------------------------------------------------------------------------------
1 | on property:apex.all.ready=true
2 | mkdir /data/vendor/wifi 0770 wifi wifi
3 | mkdir /data/vendor/wifi/wpa 0770 wifi wifi
4 | mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
5 |
6 | service wpa_supplicant /apex/com.android.hardware.wifi.supplicant.rpi4/bin/hw/wpa_supplicant \
7 | -O/data/vendor/wifi/wpa/sockets -dd \
8 | -g@android:wpa_wlan0
9 | # we will start as root and wpa_supplicant will switch to user wifi
10 | # after setting up the capabilities required for WEXT
11 | # user wifi
12 | # group wifi inet keystore
13 | interface aidl android.hardware.wifi.supplicant.ISupplicant/default
14 | class main
15 | socket wpa_wlan0 dgram 660 wifi wifi
16 | user root
17 | disabled
18 | oneshot
19 |
--------------------------------------------------------------------------------
/audio/alsa_utils/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2015 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library {
7 | name: "libalsautilsv2-rpi",
8 | vendor_available: true,
9 | srcs: [
10 | "alsa_device_profile.c",
11 | "alsa_device_proxy.c",
12 | "alsa_format.c",
13 | "alsa_logging.c",
14 | ],
15 | export_include_dirs: ["include"],
16 | header_libs: [
17 | "libaudio_system_headers",
18 | ],
19 | export_header_lib_headers: [
20 | "libaudio_system_headers",
21 | ],
22 | shared_libs: [
23 | "libasound",
24 | "libaudioutils",
25 | "libcutils",
26 | "liblog",
27 | "libtinyalsav2",
28 | ],
29 | cflags: [
30 | "-Wall",
31 | "-Werror",
32 | "-Wno-unused-parameter",
33 | ],
34 | }
35 |
--------------------------------------------------------------------------------
/suspend_blocker/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2019 The Android Open Source Project
2 | // Copyright (C) 2021-2022 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "suspend_blocker_rpi",
8 | vendor: true,
9 | srcs: ["suspend_blocker_rpi.cpp"],
10 | shared_libs: ["libpower"],
11 | installable: false,
12 | }
13 |
14 | prebuilt_etc {
15 | name: "suspend_blocker_rpi.rc",
16 | src: "suspend_blocker_rpi.rc",
17 | installable: false,
18 | }
19 |
20 | apex {
21 | name: "com.android.hardware.suspend_blocker.rpi4",
22 | manifest: "apex_manifest.json",
23 | file_contexts: "apex_file_contexts",
24 | key: "com.android.hardware.key",
25 | certificate: ":com.android.hardware.certificate",
26 | updatable: false,
27 | vendor: true,
28 |
29 | binaries: ["suspend_blocker_rpi"],
30 | prebuilts: [
31 | "suspend_blocker_rpi.rc",
32 | ],
33 | }
34 |
--------------------------------------------------------------------------------
/audio/libeffects/loudness/dsp/core/interpolation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 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 | #ifndef LE_FX_ENGINE_DSP_CORE_INTERPOLATION_H_
17 | #define LE_FX_ENGINE_DSP_CORE_INTERPOLATION_H_
18 |
19 | #include "dsp/core/interpolator_base.h"
20 | #include "dsp/core/interpolator_linear.h"
21 |
22 | #endif // LE_FX_ENGINE_DSP_CORE_INTERPOLATION_H_
23 |
24 |
--------------------------------------------------------------------------------
/mkbootimg.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2021-2022 KonstaKANG
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | DEVICE_PATH := device/brcm/rpi4
8 | KERNEL_PATH := device/brcm/rpi4-kernel
9 | VENDOR_PATH := vendor/brcm
10 |
11 | RPI_BOOT_OUT := $(PRODUCT_OUT)/rpiboot
12 | $(RPI_BOOT_OUT): $(INSTALLED_RAMDISK_TARGET)
13 | mkdir -p $(RPI_BOOT_OUT)
14 | mkdir -p $(RPI_BOOT_OUT)/overlays
15 | cp $(DEVICE_PATH)/boot/* $(RPI_BOOT_OUT)
16 | cp $(KERNEL_PATH)/Image $(RPI_BOOT_OUT)
17 | cp $(KERNEL_PATH)/bcm2711-rpi-*.dtb $(RPI_BOOT_OUT)
18 | cp $(KERNEL_PATH)/overlays/* $(RPI_BOOT_OUT)/overlays
19 | cp $(PRODUCT_OUT)/ramdisk.img $(RPI_BOOT_OUT)
20 | cp $(VENDOR_PATH)/rpi4/proprietary/boot/* $(RPI_BOOT_OUT)
21 | echo $(BOARD_KERNEL_CMDLINE) > $(RPI_BOOT_OUT)/cmdline.txt
22 |
23 | $(INSTALLED_BOOTIMAGE_TARGET): $(RPI_BOOT_OUT)
24 | $(call pretty,"Target boot image: $@")
25 | dd if=/dev/zero of=$@ bs=1M count=128
26 | mkfs.fat -F 32 -n "boot" $@
27 | mcopy -s -i $@ $(RPI_BOOT_OUT)/* ::
28 |
--------------------------------------------------------------------------------
/sepolicy/property_contexts:
--------------------------------------------------------------------------------
1 | # Audio
2 | persist.vendor.audio.device u:object_r:vendor_audio_config_prop:s0
3 | persist.vendor.audio.pcm.card u:object_r:vendor_audio_config_prop:s0
4 |
5 | # CEC
6 | persist.vendor.hdmi.cec_device u:object_r:vendor_hdmi_config_prop:s0
7 |
8 | # FFmpeg
9 | persist.vendor.ffmpeg_codec2.rank.audio u:object_r:vendor_ffmpeg_config_prop:s0
10 | persist.vendor.ffmpeg_codec2.rank.video u:object_r:vendor_ffmpeg_config_prop:s0
11 | persist.vendor.ffmpeg_codec2.v4l2.h264 u:object_r:vendor_ffmpeg_config_prop:s0
12 | persist.vendor.ffmpeg_codec2.v4l2.h265 u:object_r:vendor_ffmpeg_config_prop:s0
13 |
14 | # Graphics
15 | vendor.hwc.drm.ctm u:object_r:vendor_hwc_config_prop:s0
16 | vendor.hwc.drm.disable_hdr u:object_r:vendor_hwc_config_prop:s0
17 | vendor.hwc.drm.force_mode u:object_r:vendor_hwc_config_prop:s0
18 |
19 | # V4L2
20 | persist.vendor.v4l2_codec2.rank.decoder u:object_r:vendor_v4l2_config_prop:s0
21 | persist.vendor.v4l2_codec2.rank.encoder u:object_r:vendor_v4l2_config_prop:s0
22 |
--------------------------------------------------------------------------------
/light/android.hardware.light-service.rpi.rc:
--------------------------------------------------------------------------------
1 | on early-boot
2 | chown system system /sys/class/backlight/10-0045/brightness
3 | chown system system /sys/class/backlight/10-0045/max_brightness
4 | chown system system /sys/class/backlight/11-0045/brightness
5 | chown system system /sys/class/backlight/11-0045/max_brightness
6 | chown system system /sys/class/backlight/rpi_backlight/brightness
7 | chown system system /sys/class/backlight/rpi_backlight/max_brightness
8 | chmod 660 /sys/class/backlight/10-0045/brightness
9 | chmod 440 /sys/class/backlight/10-0045/max_brightness
10 | chmod 660 /sys/class/backlight/11-0045/brightness
11 | chmod 440 /sys/class/backlight/11-0045/max_brightness
12 | chmod 660 /sys/class/backlight/rpi_backlight/brightness
13 | chmod 440 /sys/class/backlight/rpi_backlight/max_brightness
14 |
15 | service vendor.light-rpi /apex/com.android.hardware.light.rpi4/bin/hw/android.hardware.light-service.rpi
16 | class hal
17 | user system
18 | group system
19 | shutdown critical
20 |
--------------------------------------------------------------------------------
/audio/alsa_utils/include/alsa_format.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 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 | #ifndef ANDROID_SYSTEM_MEDIA_ALSA_UTILS_ALSA_FORMAT_H
18 | #define ANDROID_SYSTEM_MEDIA_ALSA_UTILS_ALSA_FORMAT_H
19 |
20 | #include
21 |
22 | #include
23 |
24 | enum pcm_format get_pcm_format_for_mask(const struct pcm_mask* mask);
25 |
26 | #endif /* ANDROID_SYSTEM_MEDIA_ALSA_UTILS_ALSA_FORMAT_H */
27 |
--------------------------------------------------------------------------------
/audio/primary/PrimaryMixer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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 "AHAL_PrimaryMixer"
18 |
19 | #include "PrimaryMixer.h"
20 |
21 | namespace aidl::android::hardware::audio::core::primary {
22 |
23 | // static
24 | PrimaryMixer& PrimaryMixer::getInstance() {
25 | static PrimaryMixer gInstance;
26 | return gInstance;
27 | }
28 |
29 | } // namespace aidl::android::hardware::audio::core::primary
30 |
--------------------------------------------------------------------------------
/overlay/BluetoothRpiOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 | true
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ramdisk/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 | /dev/block/mmcblk0p5 /system ext4 ro,barrier=1 wait,first_stage_mount
7 | /dev/block/mmcblk0p6 /vendor ext4 ro,barrier=1 wait,first_stage_mount
8 | /dev/block/mmcblk0p7 /metadata ext4 nodev,noatime,nosuid wait,check,formattable,first_stage_mount
9 | /dev/block/mmcblk0p3 /data ext4 nodev,noatime,nosuid,errors=panic wait,check,formattable,quota
10 | /devices/platform/scb/*.pcie/*/*/*/usb* auto auto defaults voldmanaged=usb:auto
11 | /devices/platform/soc/*.usb/usb* auto auto defaults voldmanaged=usb:auto
12 |
--------------------------------------------------------------------------------
/overlay/SystemUIRpiOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 | internet,bt,dnd,location,airplane,hotspot,dark,dream,screenrecord
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/media/media_codecs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/audio/include/core-impl/Configuration.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 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 "Module.h"
22 |
23 | namespace aidl::android::hardware::audio::core::internal {
24 |
25 | std::unique_ptr getConfiguration(Module::Type moduleType);
26 | std::vector
27 | getStandard16And24BitPcmAudioProfiles();
28 |
29 | } // namespace aidl::android::hardware::audio::core::internal
30 |
--------------------------------------------------------------------------------
/camera/external/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 KonstaKANG
2 | //
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | prebuilt_etc {
6 | name: "android.hardware.camera.provider-V1-external-service.rc",
7 | src: "android.hardware.camera.provider-V1-external-service.rc",
8 | installable: false,
9 | }
10 |
11 | prebuilt_etc {
12 | name: "android.hardware.camera.provider-V1-external-service.xml",
13 | src: "android.hardware.camera.provider-V1-external-service.xml",
14 | sub_dir: "vintf",
15 | installable: false,
16 | }
17 |
18 | apex {
19 | name: "com.android.hardware.camera.external.rpi4",
20 | manifest: "apex_manifest.json",
21 | file_contexts: "apex_file_contexts",
22 | key: "com.android.hardware.key",
23 | certificate: ":com.android.hardware.certificate",
24 | updatable: false,
25 | vendor: true,
26 |
27 | binaries: [
28 | "android.hardware.camera.provider-V1-external-service",
29 | ],
30 | prebuilts: [
31 | "android.hardware.camera.provider-V1-external-service.rc",
32 | "android.hardware.camera.provider-V1-external-service.xml",
33 | ],
34 | }
35 |
--------------------------------------------------------------------------------
/audio/android.hardware.audio.service.rpi.rc:
--------------------------------------------------------------------------------
1 | service vendor.audio-rpi /apex/com.android.hardware.audio.rpi4/bin/hw/android.hardware.audio.service.rpi
2 | class hal
3 | user audioserver
4 | # media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
5 | group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock context_hub
6 | capabilities BLOCK_SUSPEND SYS_NICE
7 | # setting RLIMIT_RTPRIO allows binder RT priority inheritance
8 | rlimit rtprio 10 10
9 | ioprio rt 4
10 | task_profiles ProcessCapacityHigh HighPerformance
11 | onrestart restart audioserver
12 |
13 | service vendor.audio-effect-rpi /apex/com.android.hardware.audio.rpi4/bin/hw/android.hardware.audio.effect.service.rpi
14 | class hal
15 | user audioserver
16 | # media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
17 | group audio media
18 | capabilities BLOCK_SUSPEND
19 | # setting RLIMIT_RTPRIO allows binder RT priority inheritance
20 | rlimit rtprio 10 10
21 | ioprio rt 4
22 | task_profiles ProcessCapacityHigh HighPerformance
23 | onrestart restart audioserver
24 |
--------------------------------------------------------------------------------
/audio/alsa_utils/include/alsa_logging.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 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 | #ifndef ANDROID_SYSTEM_MEDIA_ALSA_UTILS_ALSA_LOGGING_H
18 | #define ANDROID_SYSTEM_MEDIA_ALSA_UTILS_ALSA_LOGGING_H
19 |
20 | #include
21 |
22 | void log_pcm_mask(const char* mask_name, const struct pcm_mask* mask);
23 | void log_pcm_params(const struct pcm_params * alsa_hw_params);
24 | void log_pcm_config(const struct pcm_config * config, const char* label);
25 |
26 | #endif /* ANDROID_SYSTEM_MEDIA_ALSA_UTILS_ALSA_LOGGING_H */
27 |
--------------------------------------------------------------------------------
/sepolicy/file_contexts:
--------------------------------------------------------------------------------
1 | # CEC
2 | /dev/cec0 u:object_r:cec_device:s0
3 | /dev/cec1 u:object_r:cec_device:s0
4 |
5 | # DRM
6 | /data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0
7 |
8 | # Graphics
9 | /dev/dri(/.*)? u:object_r:gpu_device:s0
10 |
11 | # Partitions
12 | /dev/block/mmcblk0p1 u:object_r:boot_block_device:s0
13 | /dev/block/mmcblk0p3 u:object_r:userdata_block_device:s0
14 | /dev/block/mmcblk0p5 u:object_r:system_block_device:s0
15 | /dev/block/mmcblk0p6 u:object_r:system_block_device:s0
16 | /dev/block/mmcblk0p7 u:object_r:metadata_block_device:s0
17 | /dev/block/nvme0n1p1 u:object_r:boot_block_device:s0
18 | /dev/block/nvme0n1p3 u:object_r:userdata_block_device:s0
19 | /dev/block/nvme0n1p5 u:object_r:system_block_device:s0
20 | /dev/block/nvme0n1p6 u:object_r:system_block_device:s0
21 | /dev/block/nvme0n1p7 u:object_r:metadata_block_device:s0
22 | /dev/block/sda1 u:object_r:boot_block_device:s0
23 | /dev/block/sda3 u:object_r:userdata_block_device:s0
24 | /dev/block/sda5 u:object_r:system_block_device:s0
25 | /dev/block/sda6 u:object_r:system_block_device:s0
26 | /dev/block/sda7 u:object_r:metadata_block_device:s0
27 |
--------------------------------------------------------------------------------
/sepolicy/genfs_contexts:
--------------------------------------------------------------------------------
1 | # CEC
2 | genfscon sysfs /devices/platform/gpu/drm/card0/card0-HDMI-A-1/status u:object_r:sysfs_hdmi:s0
3 | genfscon sysfs /devices/platform/gpu/drm/card0/card0-HDMI-A-2/status u:object_r:sysfs_hdmi:s0
4 |
5 | # Graphics
6 | genfscon sysfs /devices/platform/v3dbus/fec00000.v3d u:object_r:sysfs_gpu:s0
7 | genfscon sysfs /devices/platform/gpu u:object_r:sysfs_gpu:s0
8 |
9 | # Lights
10 | genfscon sysfs /class/backlight/10-0045/brightness u:object_r:sysfs_leds:s0
11 | genfscon sysfs /class/backlight/10-0045/max_brightness u:object_r:sysfs_leds:s0
12 | genfscon sysfs /class/backlight/11-0045/brightness u:object_r:sysfs_leds:s0
13 | genfscon sysfs /class/backlight/11-0045/max_brightness u:object_r:sysfs_leds:s0
14 | genfscon sysfs /class/backlight/rpi_backlight/brightness u:object_r:sysfs_leds:s0
15 | genfscon sysfs /class/backlight/rpi_backlight/max_brightness u:object_r:sysfs_leds:s0
16 |
17 | # Serial number
18 | genfscon sysfs /firmware/devicetree/base/serial-number u:object_r:sysfs_dt_firmware_android:s0
19 |
20 | # Suspend
21 | 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
22 |
--------------------------------------------------------------------------------
/audio/android.hardware.audio.service.rpi.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.audio.core
4 | 3
5 | IModule/default
6 |
7 |
8 | android.hardware.audio.core
9 | 3
10 | IModule/r_submix
11 |
12 |
13 | android.hardware.audio.core
14 | 3
15 | IModule/bluetooth
16 |
17 |
18 | android.hardware.audio.core
19 | 3
20 | IConfig/default
21 |
22 |
29 |
30 | android.hardware.audio.core
31 | 3
32 | IModule/usb
33 |
34 |
35 | android.hardware.audio.effect
36 | 3
37 | IFactory/default
38 |
39 |
40 |
--------------------------------------------------------------------------------
/audio/primary/PrimaryMixer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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 "alsa/Mixer.h"
20 |
21 | namespace aidl::android::hardware::audio::core::primary {
22 |
23 | class PrimaryMixer : public alsa::Mixer {
24 | public:
25 | static constexpr int kInvalidAlsaCard = -1;
26 | static constexpr int kInvalidAlsaDevice = -1;
27 | static constexpr int kAlsaCard = 0;
28 | static constexpr int kAlsaDevice = 0;
29 |
30 | static PrimaryMixer& getInstance();
31 |
32 | private:
33 | PrimaryMixer() : alsa::Mixer(kAlsaCard) {}
34 | };
35 |
36 | } // namespace aidl::android::hardware::audio::core::primary
37 |
--------------------------------------------------------------------------------
/light/Lights.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 The Android Open Source Project
3 | * Copyright (C) 2023 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #pragma once
19 |
20 | #include
21 |
22 | namespace aidl::android::hardware::light {
23 |
24 | class Lights : public BnLights {
25 | public:
26 | Lights();
27 |
28 | ndk::ScopedAStatus setLightState(int id, const HwLightState& state) override;
29 | ndk::ScopedAStatus getLights(std::vector* types) override;
30 |
31 | private:
32 | uint32_t maxBrightness;
33 | uint32_t rgbToScaledBrightness(const HwLightState& state, uint32_t maxBrightness);
34 | };
35 |
36 | } // aidl::android::hardware::light
37 |
--------------------------------------------------------------------------------
/audio/libeffects/downmix/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library_shared {
7 | name: "libdownmixaidl_rpi",
8 | relative_install_path: "soundfx",
9 | vendor: true,
10 | srcs: [
11 | ":effectCommonFileRpi",
12 | "aidl/DownmixContext.cpp",
13 | "aidl/EffectDownmix.cpp",
14 | ],
15 | shared_libs: [
16 | "android.hardware.audio.effect-V3-ndk",
17 | "android.hardware.common-V2-ndk",
18 | "android.hardware.common.fmq-V1-ndk",
19 | "android.media.audio.common.types-V4-ndk",
20 | "libaudio_aidl_conversion_common_ndk",
21 | "libaudioaidlcommon",
22 | "libaudioutils",
23 | "libbase",
24 | "libbinder_ndk",
25 | "libcutils",
26 | "libfmq",
27 | "liblog",
28 | "libutils",
29 | ],
30 | header_libs: [
31 | "libaudio_system_headers",
32 | "libaudioaidl_rpi_headers",
33 | "libaudioeffects",
34 | "libhardware_headers",
35 | "libsystem_headers",
36 | ],
37 | cflags: [
38 | "-DBACKEND_NDK",
39 | "-Wall",
40 | "-Werror",
41 | "-Wextra",
42 | "-Wthread-safety",
43 | ],
44 | }
45 |
--------------------------------------------------------------------------------
/health/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 The Android Open Source Project
3 | * Copyright (C) 2023 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include "HealthImpl.h"
19 |
20 | #include
21 | #include
22 |
23 | using ::aidl::android::hardware::health::HalHealthLoop;
24 | using ::aidl::android::hardware::health::HealthImpl;
25 |
26 | int main() {
27 | auto config = std::make_unique();
28 | android::hardware::health::InitHealthdConfig(config.get());
29 | auto binder = ndk::SharedRefBase::make("default", std::move(config));
30 | auto hal_health_loop = std::make_shared(binder, binder);
31 | return hal_health_loop->StartLoop();
32 | }
33 |
--------------------------------------------------------------------------------
/bluetooth/net_bluetooth_mgmt.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | * Copyright (C) 2024 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #pragma once
19 |
20 | #include
21 |
22 | namespace aidl::android::hardware::bluetooth::impl {
23 |
24 | class NetBluetoothMgmt {
25 | public:
26 | NetBluetoothMgmt() {}
27 | ~NetBluetoothMgmt() {
28 | ::close(bt_fd_);
29 | }
30 |
31 | int openHci(int hci_interface = 0);
32 | void closeHci();
33 |
34 | private:
35 | int waitHciDev(int hci_interface);
36 | int findRfKill();
37 | int rfKill(int block);
38 | char *rfkill_state_;
39 |
40 | // File descriptor opened to the bluetooth user channel.
41 | int bt_fd_{-1};
42 | };
43 |
44 | } // namespace aidl::android::hardware::bluetooth::impl
45 |
--------------------------------------------------------------------------------
/overlay/SettingsProviderTvRpiOverlay/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 | Raspberry Pi 4
23 |
24 |
25 | 128
26 |
27 |
28 | 0
29 |
30 |
31 | true
32 | true
33 |
34 |
35 |
--------------------------------------------------------------------------------
/audio/libeffects/visualizer/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library_shared {
7 | name: "libvisualizeraidl_rpi",
8 | relative_install_path: "soundfx",
9 | vendor: true,
10 | srcs: [
11 | ":effectCommonFileRpi",
12 | "aidl/Visualizer.cpp",
13 | "aidl/VisualizerContext.cpp",
14 | ],
15 | shared_libs: [
16 | "android.hardware.audio.effect-V3-ndk",
17 | "android.hardware.common-V2-ndk",
18 | "android.hardware.common.fmq-V1-ndk",
19 | "android.media.audio.common.types-V4-ndk",
20 | "libaudio_aidl_conversion_common_ndk",
21 | "libaudioaidlcommon",
22 | "libaudioutils",
23 | "libbase",
24 | "libbinder_ndk",
25 | "libcutils",
26 | "libfmq",
27 | "liblog",
28 | "libutils",
29 | ],
30 | header_libs: [
31 | "libaudio_system_headers",
32 | "libaudioaidl_rpi_headers",
33 | "libaudioeffects",
34 | "libaudioutils_headers",
35 | "libsystem_headers",
36 | ],
37 | cflags: [
38 | "-DBACKEND_NDK",
39 | "-DBUILD_FLOAT",
40 | "-DSUPPORT_MC",
41 | "-Wall",
42 | "-Werror",
43 | "-Wextra",
44 | "-Wthread-safety",
45 | ],
46 | }
47 |
--------------------------------------------------------------------------------
/audio/libeffects/loudness/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library_shared {
7 | name: "libloudnessenhanceraidl_rpi",
8 | relative_install_path: "soundfx",
9 | vendor: true,
10 | srcs: [
11 | ":effectCommonFileRpi",
12 | "aidl/EffectLoudnessEnhancer.cpp",
13 | "aidl/LoudnessEnhancerContext.cpp",
14 | "dsp/core/dynamic_range_compression.cpp",
15 | ],
16 | shared_libs: [
17 | "android.hardware.audio.effect-V3-ndk",
18 | "android.hardware.common-V2-ndk",
19 | "android.hardware.common.fmq-V1-ndk",
20 | "android.media.audio.common.types-V4-ndk",
21 | "libaudio_aidl_conversion_common_ndk",
22 | "libaudioaidlcommon",
23 | "libaudioutils",
24 | "libbase",
25 | "libbinder_ndk",
26 | "libcutils",
27 | "libfmq",
28 | "liblog",
29 | "libutils",
30 | ],
31 | header_libs: [
32 | "libaudio_system_headers",
33 | "libaudioaidl_rpi_headers",
34 | "libaudioeffects",
35 | "libhardware_headers",
36 | "libsystem_headers",
37 | ],
38 | cflags: [
39 | "-DBACKEND_NDK",
40 | "-Wall",
41 | "-Werror",
42 | "-Wextra",
43 | "-Wthread-safety",
44 | ],
45 | }
46 |
--------------------------------------------------------------------------------
/light/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2020 The Android Open Source Project
2 | // Copyright (C) 2023 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "android.hardware.light-service.rpi",
8 | relative_install_path: "hw",
9 | vendor: true,
10 | srcs: [
11 | "Lights.cpp",
12 | "main.cpp",
13 | ],
14 | shared_libs: [
15 | "android.hardware.light-V2-ndk",
16 | "libbase",
17 | "libbinder_ndk",
18 | ],
19 | installable: false,
20 | }
21 |
22 | prebuilt_etc {
23 | name: "android.hardware.light-service.rpi.rc",
24 | src: "android.hardware.light-service.rpi.rc",
25 | installable: false,
26 | }
27 |
28 | prebuilt_etc {
29 | name: "android.hardware.light-service.rpi.xml",
30 | src: "android.hardware.light-service.rpi.xml",
31 | sub_dir: "vintf",
32 | installable: false,
33 | }
34 |
35 | apex {
36 | name: "com.android.hardware.light.rpi4",
37 | manifest: "apex_manifest.json",
38 | file_contexts: "apex_file_contexts",
39 | key: "com.android.hardware.key",
40 | certificate: ":com.android.hardware.certificate",
41 | updatable: false,
42 | vendor: true,
43 |
44 | binaries: ["android.hardware.light-service.rpi"],
45 | prebuilts: [
46 | "android.hardware.light-service.rpi.rc",
47 | "android.hardware.light-service.rpi.xml",
48 | ],
49 | }
50 |
--------------------------------------------------------------------------------
/audio/libeffects/reverb/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library_shared {
7 | name: "libreverbaidl_rpi",
8 | relative_install_path: "soundfx",
9 | vendor: true,
10 | srcs: [
11 | ":effectCommonFileRpi",
12 | "aidl/EffectReverb.cpp",
13 | "aidl/ReverbContext.cpp",
14 | ],
15 | local_include_dirs: ["aidl"],
16 | static_libs: [
17 | "libreverb",
18 | ],
19 | shared_libs: [
20 | "android.hardware.audio.effect-V3-ndk",
21 | "android.hardware.common-V2-ndk",
22 | "android.hardware.common.fmq-V1-ndk",
23 | "android.media.audio.common.types-V4-ndk",
24 | "libaudio_aidl_conversion_common_ndk",
25 | "libaudioaidlcommon",
26 | "libaudioutils",
27 | "libbase",
28 | "libbinder_ndk",
29 | "libcutils",
30 | "libfmq",
31 | "liblog",
32 | "libutils",
33 | ],
34 | header_libs: [
35 | "libaudio_system_headers",
36 | "libaudioaidl_rpi_headers",
37 | "libaudioeffects",
38 | "libhardware_headers",
39 | "libsystem_headers",
40 | ],
41 | cflags: [
42 | "-DBACKEND_NDK",
43 | "-Wall",
44 | "-Werror",
45 | "-Wextra",
46 | "-Wthread-safety",
47 | ],
48 | }
49 |
--------------------------------------------------------------------------------
/light/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | * Copyright (C) 2025 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include "Lights.h"
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | using ::aidl::android::hardware::light::Lights;
25 |
26 | int main() {
27 | ABinderProcess_setThreadPoolMaxThreadCount(0);
28 | std::shared_ptr lights = ndk::SharedRefBase::make();
29 |
30 | const std::string instance = std::string() + Lights::descriptor + "/default";
31 | binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str());
32 | CHECK(status == STATUS_OK);
33 |
34 | ABinderProcess_joinThreadPool();
35 | return EXIT_FAILURE; // should not reach
36 | }
37 |
--------------------------------------------------------------------------------
/audio/include/core-impl/AidlConversionXsdc.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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 | #include
21 | #include
22 | #include
23 |
24 | namespace aidl::android::hardware::audio::core::internal {
25 |
26 | ConversionResult<::aidl::android::media::audio::common::AudioFormatDescription>
27 | xsdc2aidl_AudioFormatDescription(const std::string& xsdc);
28 |
29 | ConversionResult xsdc2aidl_SurroundSoundConfig(
30 | const ::android::audio::policy::configuration::SurroundSound& xsdc);
31 |
32 | } // namespace aidl::android::hardware::audio::core::internal
33 |
--------------------------------------------------------------------------------
/hdmi/cec/HdmiCecPort.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 The Android Open Source Project
3 | * Copyright (C) 2025 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include
19 |
20 | namespace android {
21 | namespace hardware {
22 | namespace tv {
23 | namespace hdmi {
24 | namespace cec {
25 | namespace implementation {
26 |
27 | using ::aidl::android::hardware::tv::hdmi::cec::Result;
28 |
29 | class HdmiCecPort {
30 | public:
31 | HdmiCecPort(unsigned int portId);
32 | ~HdmiCecPort();
33 | Result init(const char* path);
34 | void release();
35 |
36 | unsigned int mPortId;
37 | int mCecFd;
38 | int mExitFd;
39 | };
40 |
41 | } // namespace implementation
42 | } // namespace cec
43 | } // namespace hdmi
44 | } // namespace tv
45 | } // namespace hardware
46 | } // namespace android
47 |
--------------------------------------------------------------------------------
/usb/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | * Copyright (C) 2024 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include "UsbGadget.h"
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | using ::aidl::android::hardware::usb::gadget::UsbGadget;
25 |
26 | int main() {
27 | ABinderProcess_setThreadPoolMaxThreadCount(0);
28 | std::shared_ptr usbgadget = ndk::SharedRefBase::make();
29 |
30 | const std::string instance = std::string() + UsbGadget::descriptor + "/default";
31 | binder_status_t status = AServiceManager_addService(usbgadget->asBinder().get(), instance.c_str());
32 | CHECK(status == STATUS_OK);
33 |
34 | ABinderProcess_joinThreadPool();
35 | return EXIT_FAILURE; // should not reach
36 | }
37 |
--------------------------------------------------------------------------------
/aosp_rpi4_tv.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2021-2023 KonstaKANG
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | DEVICE_PATH := device/brcm/rpi4
8 |
9 | # Inherit device configuration
10 | $(call inherit-product, device/brcm/rpi4/device.mk)
11 |
12 | PRODUCT_AAPT_PREF_CONFIG := xhdpi
13 | PRODUCT_CHARACTERISTICS := tv
14 |
15 | $(call inherit-product, device/google/atv/products/atv_base.mk)
16 | $(call enforce-product-packages-exist,com.android.ranging)
17 |
18 | # Android TV
19 | PRODUCT_PACKAGES += \
20 | DocumentsUI \
21 | LeanbackIME \
22 | TvProvision \
23 | TvSampleLeanbackLauncher \
24 | TvSettingsTwoPanel
25 |
26 | # Bluetooth
27 | PRODUCT_VENDOR_PROPERTIES += \
28 | bluetooth.device.class_of_device=34,4,36
29 |
30 | # Boot animation
31 | PRODUCT_COPY_FILES += \
32 | device/google/atv/products/bootanimations/bootanimation.zip:$(TARGET_COPY_OUT_SYSTEM)/media/bootanimation.zip
33 |
34 | # Keylayout
35 | PRODUCT_COPY_FILES += \
36 | $(DEVICE_PATH)/keylayout/Generic-tv.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
37 |
38 | # Overlays
39 | PRODUCT_PACKAGES += \
40 | AndroidTvRpiOverlay \
41 | BluetoothRpiOverlay \
42 | SettingsProviderTvRpiOverlay \
43 | WifiRpiOverlay
44 |
45 | # Device identifier. This must come after all inclusions.
46 | PRODUCT_DEVICE := rpi4
47 | PRODUCT_NAME := aosp_rpi4_tv
48 | PRODUCT_BRAND := Raspberry
49 | PRODUCT_MODEL := Pi 4
50 | PRODUCT_MANUFACTURER := Raspberry
51 |
--------------------------------------------------------------------------------
/audio/libeffects/bundle/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library_shared {
7 | name: "libbundleaidl_rpi",
8 | relative_install_path: "soundfx",
9 | vendor: true,
10 | srcs: [
11 | ":effectCommonFileRpi",
12 | "aidl/BundleContext.cpp",
13 | "aidl/EffectBundleAidl.cpp",
14 | ],
15 | local_include_dirs: ["aidl"],
16 | static_libs: [
17 | "libmusicbundle",
18 | ],
19 | shared_libs: [
20 | "android.hardware.audio.effect-V3-ndk",
21 | "android.hardware.common-V2-ndk",
22 | "android.hardware.common.fmq-V1-ndk",
23 | "android.media.audio.common.types-V4-ndk",
24 | "libaudio_aidl_conversion_common_ndk",
25 | "libaudioaidlcommon",
26 | "libaudioutils",
27 | "libbase",
28 | "libbinder_ndk",
29 | "libcutils",
30 | "libfmq",
31 | "liblog",
32 | "libstagefright_foundation",
33 | "libutils",
34 | ],
35 | header_libs: [
36 | "libaudio_system_headers",
37 | "libaudioaidl_rpi_headers",
38 | "libaudioeffects",
39 | "libhardware_headers",
40 | "libsystem_headers",
41 | ],
42 | cflags: [
43 | "-DBACKEND_NDK",
44 | "-Wall",
45 | "-Werror",
46 | "-Wextra",
47 | "-Wthread-safety",
48 | ],
49 | }
50 |
--------------------------------------------------------------------------------
/bluetooth/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | * Copyright (C) 2024 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include "BluetoothHci.h"
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | using ::aidl::android::hardware::bluetooth::impl::BluetoothHci;
25 |
26 | int main() {
27 | ABinderProcess_setThreadPoolMaxThreadCount(0);
28 | std::shared_ptr bluetooth = ndk::SharedRefBase::make();
29 |
30 | const std::string instance = std::string() + BluetoothHci::descriptor + "/default";
31 | binder_status_t status = AServiceManager_addService(bluetooth->asBinder().get(), instance.c_str());
32 | CHECK(status == STATUS_OK);
33 |
34 | ABinderProcess_joinThreadPool();
35 | return EXIT_FAILURE; // should not reach
36 | }
37 |
--------------------------------------------------------------------------------
/audio/libeffects/dynamicsproc/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_library_shared {
7 | name: "libdynamicsprocessingaidl_rpi",
8 | relative_install_path: "soundfx",
9 | vendor: true,
10 | srcs: [
11 | ":effectCommonFileRpi",
12 | "aidl/DynamicsProcessing.cpp",
13 | "aidl/DynamicsProcessingContext.cpp",
14 | "dsp/DPBase.cpp",
15 | "dsp/DPFrequency.cpp",
16 | ],
17 | static_libs: [
18 | "libaudioaidlranges",
19 | ],
20 | shared_libs: [
21 | "android.hardware.audio.effect-V3-ndk",
22 | "android.hardware.common-V2-ndk",
23 | "android.hardware.common.fmq-V1-ndk",
24 | "android.media.audio.common.types-V4-ndk",
25 | "libaudio_aidl_conversion_common_ndk",
26 | "libaudioaidlcommon",
27 | "libaudioutils",
28 | "libbase",
29 | "libbinder_ndk",
30 | "libcutils",
31 | "libfmq",
32 | "liblog",
33 | "libutils",
34 | ],
35 | header_libs: [
36 | "libaudio_system_headers",
37 | "libaudioaidl_rpi_headers",
38 | "libaudioeffects",
39 | "libeigen",
40 | "libsystem_headers",
41 | ],
42 | cflags: [
43 | "-DBACKEND_NDK",
44 | "-Wall",
45 | "-Werror",
46 | "-Wextra",
47 | "-Wthread-safety",
48 | ],
49 | }
50 |
--------------------------------------------------------------------------------
/hdmi/cec/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | * Copyright (C) 2025 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include "HdmiCec.h"
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | using android::hardware::tv::hdmi::cec::implementation::HdmiCec;
25 |
26 | int main() {
27 | ABinderProcess_setThreadPoolMaxThreadCount(1);
28 | ABinderProcess_startThreadPool();
29 |
30 | std::shared_ptr hdmiCecAidl = ndk::SharedRefBase::make();
31 | const std::string instance = std::string() + HdmiCec::descriptor + "/default";
32 | binder_status_t status = AServiceManager_addService(hdmiCecAidl->asBinder().get(), instance.c_str());
33 | CHECK_EQ(status, STATUS_OK);
34 |
35 | ABinderProcess_joinThreadPool();
36 | return EXIT_FAILURE; // should not reach
37 | }
38 |
--------------------------------------------------------------------------------
/aosp_rpi4.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2021-2023 KonstaKANG
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | DEVICE_PATH := device/brcm/rpi4
8 |
9 | # Inherit device configuration
10 | $(call inherit-product, device/brcm/rpi4/device.mk)
11 |
12 | PRODUCT_AAPT_CONFIG := normal mdpi hdpi
13 | PRODUCT_AAPT_PREF_CONFIG := hdpi
14 | PRODUCT_CHARACTERISTICS := tablet,nosdcard
15 |
16 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
17 | $(call enforce-product-packages-exist,com.android.ranging)
18 |
19 | # Freeform windows
20 | PRODUCT_COPY_FILES += \
21 | frameworks/native/data/etc/android.software.freeform_window_management.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.freeform_window_management.xml
22 |
23 | # Keylayout
24 | PRODUCT_COPY_FILES += \
25 | $(DEVICE_PATH)/keylayout/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
26 |
27 | # Overlays
28 | PRODUCT_PACKAGES += \
29 | AndroidRpiOverlay \
30 | BluetoothRpiOverlay \
31 | SettingsProviderRpiOverlay \
32 | SettingsRpiOverlay \
33 | SystemUIRpiOverlay \
34 | WifiRpiOverlay
35 |
36 | # Permissions
37 | PRODUCT_COPY_FILES += \
38 | frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml
39 |
40 | # Device identifier. This must come after all inclusions.
41 | PRODUCT_DEVICE := rpi4
42 | PRODUCT_NAME := aosp_rpi4
43 | PRODUCT_BRAND := Raspberry
44 | PRODUCT_MODEL := Pi 4
45 | PRODUCT_MANUFACTURER := Raspberry
46 |
--------------------------------------------------------------------------------
/hdmi/connection/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | * Copyright (C) 2025 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include "HdmiConnection.h"
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | using android::hardware::tv::hdmi::connection::implementation::HdmiConnection;
25 |
26 | int main() {
27 | ABinderProcess_setThreadPoolMaxThreadCount(1);
28 | ABinderProcess_startThreadPool();
29 |
30 | std::shared_ptr hdmiAidl = ndk::SharedRefBase::make();
31 | const std::string instance = std::string() + HdmiConnection::descriptor + "/default";
32 | binder_status_t status = AServiceManager_addService(hdmiAidl->asBinder().get(), instance.c_str());
33 | CHECK_EQ(status, STATUS_OK);
34 |
35 | ABinderProcess_joinThreadPool();
36 | return EXIT_FAILURE; // should not reach
37 | }
38 |
--------------------------------------------------------------------------------
/usb/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2020 The Android Open Source Project
2 | // Copyright (C) 2024 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "android.hardware.usb.gadget-service.rpi",
8 | relative_install_path: "hw",
9 | vendor: true,
10 | srcs: [
11 | "MonitorFfs.cpp",
12 | "UsbGadget.cpp",
13 | "UsbGadgetUtils.cpp",
14 | "main.cpp",
15 | ],
16 | shared_libs: [
17 | "android.hardware.usb.gadget-V1-ndk",
18 | "libbase",
19 | "libbinder_ndk",
20 | "liblog",
21 | "libutils",
22 | ],
23 | installable: false,
24 | }
25 |
26 | prebuilt_etc {
27 | name: "android.hardware.usb.gadget-service.rpi.rc",
28 | src: "android.hardware.usb.gadget-service.rpi.rc",
29 | installable: false,
30 | }
31 |
32 | prebuilt_etc {
33 | name: "android.hardware.usb.gadget-service.rpi.xml",
34 | src: "android.hardware.usb.gadget-service.rpi.xml",
35 | sub_dir: "vintf",
36 | installable: false,
37 | }
38 |
39 | apex {
40 | name: "com.android.hardware.usb.gadget.rpi4",
41 | manifest: "apex_manifest.json",
42 | file_contexts: "apex_file_contexts",
43 | key: "com.android.hardware.key",
44 | certificate: ":com.android.hardware.certificate",
45 | updatable: false,
46 | vendor: true,
47 |
48 | binaries: ["android.hardware.usb.gadget-service.rpi"],
49 | prebuilts: [
50 | "android.hardware.usb.gadget-service.rpi.rc",
51 | "android.hardware.usb.gadget-service.rpi.xml",
52 | ],
53 | }
54 |
--------------------------------------------------------------------------------
/hdmi/connection/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "android.hardware.tv.hdmi.connection-service.rpi",
8 | relative_install_path: "hw",
9 | vendor: true,
10 | srcs: [
11 | "HdmiConnection.cpp",
12 | "main.cpp",
13 | ],
14 | shared_libs: [
15 | "android.hardware.tv.hdmi.connection-V1-ndk",
16 | "libbase",
17 | "libbinder_ndk",
18 | "liblog",
19 | ],
20 | installable: false,
21 | }
22 |
23 | prebuilt_etc {
24 | name: "android.hardware.tv.hdmi.connection-service.rpi.rc",
25 | src: "android.hardware.tv.hdmi.connection-service.rpi.rc",
26 | installable: false,
27 | }
28 |
29 | prebuilt_etc {
30 | name: "android.hardware.tv.hdmi.connection-service.rpi.xml",
31 | src: "android.hardware.tv.hdmi.connection-service.rpi.xml",
32 | sub_dir: "vintf",
33 | installable: false,
34 | }
35 |
36 | apex {
37 | name: "com.android.hardware.tv.hdmi.connection.rpi4",
38 | manifest: "apex_manifest.json",
39 | file_contexts: "apex_file_contexts",
40 | key: "com.android.hardware.key",
41 | certificate: ":com.android.hardware.certificate",
42 | updatable: false,
43 | vendor: true,
44 |
45 | binaries: ["android.hardware.tv.hdmi.connection-service.rpi"],
46 | prebuilts: [
47 | "android.hardware.tv.hdmi.connection-service.rpi.rc",
48 | "android.hardware.tv.hdmi.connection-service.rpi.xml",
49 | ],
50 | }
51 |
--------------------------------------------------------------------------------
/hdmi/cec/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2021 The Android Open Source Project
2 | // Copyright (C) 2025 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "android.hardware.tv.hdmi.cec-service.rpi",
8 | relative_install_path: "hw",
9 | vendor: true,
10 | srcs: [
11 | "HdmiCec.cpp",
12 | "HdmiCecPort.cpp",
13 | "main.cpp",
14 | ],
15 | shared_libs: [
16 | "android.hardware.tv.hdmi.cec-V1-ndk",
17 | "libbase",
18 | "libbinder_ndk",
19 | "libcutils",
20 | "libhardware",
21 | "liblog",
22 | ],
23 | installable: false,
24 | }
25 |
26 | prebuilt_etc {
27 | name: "android.hardware.tv.hdmi.cec-service.rpi.rc",
28 | src: "android.hardware.tv.hdmi.cec-service.rpi.rc",
29 | installable: false,
30 | }
31 |
32 | prebuilt_etc {
33 | name: "android.hardware.tv.hdmi.cec-service.rpi.xml",
34 | src: "android.hardware.tv.hdmi.cec-service.rpi.xml",
35 | sub_dir: "vintf",
36 | installable: false,
37 | }
38 |
39 | apex {
40 | name: "com.android.hardware.tv.hdmi.cec.rpi4",
41 | manifest: "apex_manifest.json",
42 | file_contexts: "apex_file_contexts",
43 | key: "com.android.hardware.key",
44 | certificate: ":com.android.hardware.certificate",
45 | updatable: false,
46 | vendor: true,
47 |
48 | binaries: ["android.hardware.tv.hdmi.cec-service.rpi"],
49 | prebuilts: [
50 | "android.hardware.tv.hdmi.cec-service.rpi.rc",
51 | "android.hardware.tv.hdmi.cec-service.rpi.xml",
52 | ],
53 | }
54 |
--------------------------------------------------------------------------------
/health/HealthImpl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 The Android Open Source Project
3 | * Copyright (C) 2023 KonstaKANG
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #pragma once
19 |
20 | #include
21 |
22 | using ::aidl::android::hardware::health::Health;
23 |
24 | namespace aidl::android::hardware::health {
25 |
26 | class HealthImpl : public Health {
27 | public:
28 | using Health::Health;
29 | virtual ~HealthImpl() {}
30 |
31 | ndk::ScopedAStatus getChargeCounterUah(int32_t* out) override;
32 | ndk::ScopedAStatus getCurrentNowMicroamps(int32_t* out) override;
33 | ndk::ScopedAStatus getCurrentAverageMicroamps(int32_t* out) override;
34 | ndk::ScopedAStatus getCapacity(int32_t* out) override;
35 | ndk::ScopedAStatus getChargeStatus(BatteryStatus* out) override;
36 | ndk::ScopedAStatus getBatteryHealthData(BatteryHealthData* out) override;
37 |
38 | protected:
39 | void UpdateHealthInfo(HealthInfo* health_info) override;
40 | };
41 |
42 | } // namespace aidl::android::hardware::health
43 |
--------------------------------------------------------------------------------
/health/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Android Open Source Project
2 | // Copyright (C) 2023 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "android.hardware.health-service.rpi",
8 | relative_install_path: "hw",
9 | vendor: true,
10 | srcs: [
11 | "HealthImpl.cpp",
12 | "main.cpp",
13 | ],
14 | static_libs: [
15 | "libbatterymonitor",
16 | "libhealth_aidl_impl",
17 | "libhealthloop",
18 | ],
19 | shared_libs: [
20 | "android.hardware.health-V4-ndk",
21 | "libbase",
22 | "libbinder_ndk",
23 | "libcutils",
24 | "liblog",
25 | "libutils",
26 | ],
27 | overrides: ["charger"],
28 | installable: false,
29 | }
30 |
31 | prebuilt_etc {
32 | name: "android.hardware.health-service.rpi.rc",
33 | src: "android.hardware.health-service.rpi.rc",
34 | installable: false,
35 | }
36 |
37 | prebuilt_etc {
38 | name: "android.hardware.health-service.rpi.xml",
39 | src: "android.hardware.health-service.rpi.xml",
40 | sub_dir: "vintf",
41 | installable: false,
42 | }
43 |
44 | apex {
45 | name: "com.android.hardware.health.rpi4",
46 | manifest: "apex_manifest.json",
47 | file_contexts: "apex_file_contexts",
48 | key: "com.android.hardware.key",
49 | certificate: ":com.android.hardware.certificate",
50 | updatable: false,
51 | vendor: true,
52 |
53 | binaries: ["android.hardware.health-service.rpi"],
54 | prebuilts: [
55 | "android.hardware.health-service.rpi.rc",
56 | "android.hardware.health-service.rpi.xml",
57 | ],
58 | }
59 |
--------------------------------------------------------------------------------
/bluetooth/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2020 The Android Open Source Project
2 | // Copyright (C) 2024 KonstaKANG
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 |
6 | cc_binary {
7 | name: "android.hardware.bluetooth-service.rpi",
8 | relative_install_path: "hw",
9 | vendor: true,
10 | srcs: [
11 | "BluetoothHci.cpp",
12 | "main.cpp",
13 | "net_bluetooth_mgmt.cpp",
14 | ],
15 | static_libs: [
16 | "android.hardware.bluetooth.async",
17 | "android.hardware.bluetooth.hci",
18 | ],
19 | shared_libs: [
20 | "android.hardware.bluetooth-V1-ndk",
21 | "libbase",
22 | "libbinder_ndk",
23 | "liblog",
24 | "libutils",
25 | ],
26 | installable: false,
27 | }
28 |
29 | prebuilt_etc {
30 | name: "android.hardware.bluetooth-service.rpi.rc",
31 | src: "android.hardware.bluetooth-service.rpi.rc",
32 | installable: false,
33 | }
34 |
35 | prebuilt_etc {
36 | name: "android.hardware.bluetooth-service.rpi.xml",
37 | src: "android.hardware.bluetooth-service.rpi.xml",
38 | sub_dir: "vintf",
39 | installable: false,
40 | }
41 |
42 | apex {
43 | name: "com.android.hardware.bluetooth.rpi4",
44 | manifest: "apex_manifest.json",
45 | file_contexts: "apex_file_contexts",
46 | key: "com.android.hardware.key",
47 | certificate: ":com.android.hardware.certificate",
48 | updatable: false,
49 | vendor: true,
50 |
51 | binaries: ["android.hardware.bluetooth-service.rpi"],
52 | prebuilts: [
53 | "android.hardware.bluetooth-service.rpi.rc",
54 | "android.hardware.bluetooth-service.rpi.xml",
55 | ],
56 | }
57 |
--------------------------------------------------------------------------------
/audio/include/core-impl/ModuleAlsa.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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 "core-impl/Module.h"
20 |
21 | namespace aidl::android::hardware::audio::core {
22 |
23 | // This class is intended to be used as a base class for implementations
24 | // that use TinyAlsa. This can be either a primary module or a USB Audio
25 | // module. This class does not define a complete module implementation,
26 | // and should never be used on its own. Derived classes are expected to
27 | // provide necessary overrides for all interface methods omitted here.
28 | class ModuleAlsa : public Module {
29 | public:
30 | ModuleAlsa(Type type, std::unique_ptr&& config)
31 | : Module(type, std::move(config)) {}
32 |
33 | protected:
34 | // Extension methods of 'Module'.
35 | ndk::ScopedAStatus populateConnectedDevicePort(
36 | ::aidl::android::media::audio::common::AudioPort* audioPort,
37 | int32_t nextPortId) override;
38 | };
39 |
40 | } // namespace aidl::android::hardware::audio::core
41 |
--------------------------------------------------------------------------------
/overlay/SettingsProviderRpiOverlay/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 | Raspberry Pi 4
23 |
24 |
25 | 128
26 |
27 |
28 | false
29 |
30 |
31 | 0
32 |
33 |
34 | true
35 |
36 |
37 | true
38 |
39 |
40 | true
41 | true
42 |
43 |
44 |
--------------------------------------------------------------------------------
/overlay/SettingsRpiOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 | false
23 |
24 |
25 | false
26 |
27 |
28 | false
29 |
30 |
31 | false
32 |
33 |
34 | false
35 |
36 |
37 | false
38 |
39 |
40 |
--------------------------------------------------------------------------------
/ramdisk/ueventd.rpi4.rc:
--------------------------------------------------------------------------------
1 | # Bluetooth
2 | /dev/rfkill 0660 bluetooth bluetooth
3 |
4 | # Camera
5 | /dev/media* 0660 system camera
6 | /dev/v4l-subdev* 0660 system camera
7 | /dev/video* 0660 system camera
8 |
9 | # CEC
10 | /dev/cec0 0660 system graphics
11 | /dev/cec1 0660 system graphics
12 |
13 | # DMA
14 | /dev/dma_heap/linux,cma 0666 system graphics
15 |
16 | # FFmpeg
17 | /dev/media0 0660 media media
18 | /dev/video19 0660 media media
19 |
20 | # USB
21 | /sys/class/udc/fe980000.usb current_speed 0664 system system
22 |
23 | # V4L2
24 | /dev/media1 0660 media media
25 | /dev/video10 0660 media media
26 | /dev/video11 0660 media media
27 | /dev/video12 0660 media media
28 | /dev/video18 0660 media media
29 | /dev/video31 0660 media media
30 |
--------------------------------------------------------------------------------
/audio/include/core-impl/Config.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 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 | #include
21 |
22 | #include "AudioPolicyConfigXmlConverter.h"
23 | #include "EngineConfigXmlConverter.h"
24 |
25 | namespace aidl::android::hardware::audio::core {
26 | static const std::string kEngineConfigFileName = "audio_policy_engine_configuration.xml";
27 |
28 | class Config : public BnConfig {
29 | public:
30 | explicit Config(internal::AudioPolicyConfigXmlConverter& apConverter)
31 | : mAudioPolicyConverter(apConverter) {}
32 |
33 | private:
34 | ndk::ScopedAStatus getSurroundSoundConfig(SurroundSoundConfig* _aidl_return) override;
35 | ndk::ScopedAStatus getEngineConfig(
36 | aidl::android::media::audio::common::AudioHalEngineConfig* _aidl_return) override;
37 |
38 | internal::AudioPolicyConfigXmlConverter& mAudioPolicyConverter;
39 | internal::EngineConfigXmlConverter mEngConfigConverter{
40 | ::android::audio_find_readable_configuration_file(kEngineConfigFileName.c_str())};
41 | };
42 |
43 | } // namespace aidl::android::hardware::audio::core
44 |
--------------------------------------------------------------------------------
/car/evs_config_override.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "car" : {
4 | "width" : 76.7,
5 | "wheelBase" : 117.9,
6 | "frontExtent" : 44.7,
7 | "rearExtent" : 40
8 | },
9 | "displays" : [
10 | {
11 | "_comment": "Display0",
12 | "displayPort" : 0,
13 | "frontRange" : 100,
14 | "rearRange" : 100
15 | },
16 | {
17 | "_comment": "Display1",
18 | "displayPort" : 1,
19 | "frontRange" : 100,
20 | "rearRange" : 100
21 | }
22 | ],
23 | "graphic" : {
24 | "frontPixel" : -20,
25 | "rearPixel" : 260
26 | },
27 | "cameras" : [
28 | {
29 | "cameraId" : "/dev/video0",
30 | "function" : "reverse",
31 | "x" : 0.0,
32 | "y" : 20.0,
33 | "z" : 48,
34 | "yaw" : 180,
35 | "pitch" : -10,
36 | "roll" : 0,
37 | "hfov" : 115,
38 | "vfov" : 80,
39 | "hflip" : true,
40 | "vflip" : false
41 | },
42 | {
43 | "cameraId" : "1",
44 | "function" : "front",
45 | "x" : 0.0,
46 | "y" : 100.0,
47 | "z" : 48,
48 | "yaw" : 0,
49 | "pitch" : -10,
50 | "roll" : 0,
51 | "hfov" : 115,
52 | "vfov" : 80,
53 | "hflip" : false,
54 | "vflip" : false
55 | },
56 | {
57 | "cameraId" : "2",
58 | "function" : "right",
59 | "x" : -25.0,
60 | "y" : 60.0,
61 | "z" : 88,
62 | "yaw" : -90,
63 | "pitch" : -10,
64 | "roll" : 0,
65 | "hfov" : 60,
66 | "vfov" : 62,
67 | "hflip" : false,
68 | "vflip" : false
69 | },
70 | {
71 | "cameraId" : "3",
72 | "function" : "left",
73 | "x" : 20.0,
74 | "y" : 60.0,
75 | "z" : 88,
76 | "yaw" : 90,
77 | "pitch" : -10,
78 | "roll" : 0,
79 | "hfov" : 60,
80 | "vfov" : 62,
81 | "hflip" : false,
82 | "vflip" : false
83 | }
84 | ]
85 | }
86 |
--------------------------------------------------------------------------------
/audio/include/effect-impl/EffectRange.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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 | #include
21 | #include
22 | #include
23 |
24 | namespace aidl::android::hardware::audio::effect {
25 |
26 | template
27 | bool isInRange(const T& value, const T& low, const T& high) {
28 | return (value >= low) && (value <= high);
29 | }
30 |
31 | template
32 | bool isTupleInRange(const T& test, const T& min, const T& max, std::index_sequence) {
33 | return (isInRange(std::get(test), std::get(min), std::get(max)) && ...);
34 | }
35 |
36 | template >
37 | bool isTupleInRange(const T& test, const T& min, const T& max) {
38 | return isTupleInRange(test, min, max, std::make_index_sequence{});
39 | }
40 |
41 | template
42 | bool isTupleInRange(const std::vector& cfgs, const T& min, const T& max, const F& func) {
43 | auto minT = func(min), maxT = func(max);
44 | return std::all_of(cfgs.cbegin(), cfgs.cend(),
45 | [&](const T& cfg) { return isTupleInRange(func(cfg), minT, maxT); });
46 | }
47 |
48 | } // namespace aidl::android::hardware::audio::effect
49 |
--------------------------------------------------------------------------------
/audio/include/core-impl/Telephony.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 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 | namespace aidl::android::hardware::audio::core {
24 |
25 | class Telephony : public BnTelephony {
26 | public:
27 | Telephony();
28 |
29 | private:
30 | ndk::ScopedAStatus getSupportedAudioModes(
31 | std::vector<::aidl::android::media::audio::common::AudioMode>* _aidl_return) override;
32 | ndk::ScopedAStatus switchAudioMode(
33 | ::aidl::android::media::audio::common::AudioMode in_mode) override;
34 | ndk::ScopedAStatus setTelecomConfig(const TelecomConfig& in_config,
35 | TelecomConfig* _aidl_return) override;
36 |
37 | const std::vector<::aidl::android::media::audio::common::AudioMode> mSupportedAudioModes = {
38 | ::aidl::android::media::audio::common::AudioMode::NORMAL,
39 | ::aidl::android::media::audio::common::AudioMode::RINGTONE,
40 | ::aidl::android::media::audio::common::AudioMode::IN_CALL,
41 | ::aidl::android::media::audio::common::AudioMode::IN_COMMUNICATION,
42 | // Omit CALL_SCREEN for a better VTS coverage.
43 | };
44 | TelecomConfig mTelecomConfig;
45 | };
46 |
47 | } // namespace aidl::android::hardware::audio::core
48 |
--------------------------------------------------------------------------------
/media/media_codecs_v4l2_c2_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/overlay/AndroidTvRpiOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
22 | 128
23 |
24 |
26 | 20
27 |
28 |
31 | 20
32 |
33 |
35 | true
36 |
37 |
38 | false
39 | true
40 |
41 |
42 |
--------------------------------------------------------------------------------
/audio/stub/StreamStub.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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 "AHAL_Stream"
18 | #include
19 |
20 | #include "core-impl/Module.h"
21 | #include "core-impl/StreamStub.h"
22 |
23 | using aidl::android::hardware::audio::common::SinkMetadata;
24 | using aidl::android::hardware::audio::common::SourceMetadata;
25 | using aidl::android::media::audio::common::AudioDevice;
26 | using aidl::android::media::audio::common::AudioOffloadInfo;
27 | using aidl::android::media::audio::common::MicrophoneInfo;
28 |
29 | namespace aidl::android::hardware::audio::core {
30 |
31 | StreamStub::StreamStub(StreamContext* context, const Metadata& metadata)
32 | : StreamCommonImpl(context, metadata), DriverStubImpl(getContext()) {}
33 |
34 | StreamStub::~StreamStub() {
35 | cleanupWorker();
36 | }
37 |
38 | StreamInStub::StreamInStub(StreamContext&& context, const SinkMetadata& sinkMetadata,
39 | const std::vector& microphones)
40 | : StreamIn(std::move(context), microphones), StreamStub(&mContextInstance, sinkMetadata) {}
41 |
42 | StreamOutStub::StreamOutStub(StreamContext&& context, const SourceMetadata& sourceMetadata,
43 | const std::optional& offloadInfo)
44 | : StreamOut(std::move(context), offloadInfo), StreamStub(&mContextInstance, sourceMetadata) {}
45 |
46 | } // namespace aidl::android::hardware::audio::core
47 |
--------------------------------------------------------------------------------
/audio/libeffects/loudness/aidl/LoudnessEnhancerContext.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 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 "dsp/core/dynamic_range_compression.h"
22 | #include "effect-impl/EffectContext.h"
23 |
24 | namespace aidl::android::hardware::audio::effect {
25 |
26 | enum LoudnessEnhancerState {
27 | LOUDNESS_ENHANCER_STATE_UNINITIALIZED,
28 | LOUDNESS_ENHANCER_STATE_INITIALIZED,
29 | LOUDNESS_ENHANCER_STATE_ACTIVE,
30 | };
31 |
32 | class LoudnessEnhancerContext final : public EffectContext {
33 | public:
34 | LoudnessEnhancerContext(int statusDepth, const Parameter::Common& common);
35 | ~LoudnessEnhancerContext() = default;
36 |
37 | RetCode enable() override;
38 | RetCode disable() override;
39 | RetCode reset() override;
40 | RetCode setLeGain(int gainMb);
41 | int getLeGain() const { return mGain; }
42 |
43 | IEffect::Status process(float* in, float* out, int samples);
44 |
45 | private:
46 | LoudnessEnhancerState mState = LOUDNESS_ENHANCER_STATE_UNINITIALIZED;
47 | int mGain = LOUDNESS_ENHANCER_DEFAULT_TARGET_GAIN_MB;
48 | // In this implementation, there is no coupling between the compression on the left and right
49 | // channels
50 | std::unique_ptr mCompressor;
51 |
52 | void init_params();
53 | };
54 | } // namespace aidl::android::hardware::audio::effect
55 |
--------------------------------------------------------------------------------
/audio/usb/UsbAlsaMixerControl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 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