Compare commits
97 Commits
android-15
...
android-16
Author | SHA1 | Date | |
---|---|---|---|
|
89cbccc94b | ||
|
fa17a27a8d | ||
|
48843429d4 | ||
|
91ac806cc6 | ||
|
79d71dad3e | ||
|
77332f861e | ||
|
3f5dba6729 | ||
|
de401a1c18 | ||
|
a7460bb97a | ||
|
df33a89dc2 | ||
|
c0402d3acc | ||
|
3af1a6e4e9 | ||
|
cefbd94c9a | ||
|
057d5bb186 | ||
|
e83c2e570c | ||
|
11bcd723fc | ||
|
467fdeed87 | ||
|
2117ba7dac | ||
|
0450c28673 | ||
|
b4409695e6 | ||
|
305b81cdf5 | ||
|
14b993ba1e | ||
|
8709904958 | ||
|
45fad47629 | ||
|
4ce5bf57b6 | ||
|
02b1412be8 | ||
|
17821d6cb2 | ||
|
e2ac9269f4 | ||
|
8b53a5a790 | ||
|
e9e4222534 | ||
|
7120a38fea | ||
|
d7a91d0681 | ||
|
426c50ad5a | ||
|
a7c86cf925 | ||
|
cd4f885fe2 | ||
|
38780decd0 | ||
|
90e9be8f36 | ||
|
1ac59c93f7 | ||
|
bfd873f4aa | ||
|
6ff636f6ba | ||
|
91aa0a3e83 | ||
|
e31b63ccc8 | ||
|
6f57d4d8af | ||
|
87e473d8ff | ||
|
ff19fe9878 | ||
|
66f0ae7d82 | ||
|
a6ff435674 | ||
|
291b0d0e44 | ||
|
9f07c74401 | ||
|
74b3908af7 | ||
|
608f723562 | ||
|
fea8235247 | ||
|
f9917417c1 | ||
|
17fce4b6a0 | ||
|
b26a4d8c30 | ||
|
37863d4b4f | ||
|
22a75c85a4 | ||
|
4596a7546d | ||
|
4dc3e0f0d8 | ||
|
59af7f93eb | ||
|
39a71902e0 | ||
|
24aa53a993 | ||
|
f75f3f933b | ||
|
32cf720294 | ||
|
e248cd4d77 | ||
|
f200aca4ce | ||
|
e1d92d2183 | ||
|
c692c4354c | ||
|
61e83a2939 | ||
|
c7eeef4b58 | ||
|
0a67b3fd59 | ||
|
2e3182f4cc | ||
|
14b1e06e9d | ||
|
aeca9d70ff | ||
|
0106e97a16 | ||
|
909a21f5d1 | ||
|
2a653366d0 | ||
|
67ea1fb3ae | ||
|
16d401ff12 | ||
|
e47f8c6791 | ||
|
57aaa02c1f | ||
|
9797a324ca | ||
|
8ac0967b8c | ||
|
acfacd0969 | ||
|
1bd1c53659 | ||
|
6e3aa4099e | ||
|
47d647f7a5 | ||
|
0658026dcf | ||
|
22f4f46410 | ||
|
fff80dc383 | ||
|
aa51dae2c2 | ||
|
9d4665d9c8 | ||
|
7dc457033f | ||
|
484c9906ae | ||
|
dc248dcb02 | ||
|
27b5b2e8ed | ||
|
23377856d8 |
@@ -6,42 +6,22 @@
|
||||
|
||||
DEVICE_PATH := device/brcm/rpi5
|
||||
|
||||
# Platform
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
TARGET_NO_RECOVERY := true
|
||||
|
||||
TARGET_BOARD_PLATFORM := rpi
|
||||
|
||||
# Architecture
|
||||
TARGET_ARCH := arm64
|
||||
TARGET_ARCH_VARIANT := armv8-a
|
||||
TARGET_CPU_ABI := arm64-v8a
|
||||
TARGET_CPU_ABI2 :=
|
||||
TARGET_CPU_VARIANT := cortex-a76
|
||||
|
||||
TARGET_2ND_ARCH := arm
|
||||
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
|
||||
TARGET_2ND_CPU_ABI := armeabi-v7a
|
||||
TARGET_2ND_CPU_ABI2 := armeabi
|
||||
TARGET_2ND_CPU_VARIANT := generic
|
||||
|
||||
# Bluetooth
|
||||
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth
|
||||
BOARD_HAVE_BLUETOOTH := true
|
||||
|
||||
# Camera
|
||||
BOARD_LIBCAMERA_IPAS := rpi/pisp
|
||||
BOARD_LIBCAMERA_PIPELINES := rpi/pisp
|
||||
BOARD_LIBCAMERA_USES_MESON_BUILD := true
|
||||
# Bootloader
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
|
||||
# Display
|
||||
TARGET_SCREEN_DENSITY := 240
|
||||
|
||||
# Graphics
|
||||
BOARD_MESA3D_BUILD_LIBGBM := true
|
||||
BOARD_MESA3D_USES_MESON_BUILD := true
|
||||
BOARD_MESA3D_GALLIUM_DRIVERS := vc4 v3d
|
||||
BOARD_MESA3D_VULKAN_DRIVERS := broadcom
|
||||
|
||||
# Kernel
|
||||
BOARD_CUSTOM_BOOTIMG := true
|
||||
BOARD_CUSTOM_BOOTIMG_MK := $(DEVICE_PATH)/mkbootimg.mk
|
||||
@@ -50,29 +30,33 @@ BOARD_KERNEL_CMDLINE := console=ttyAMA10,115200 no_console_suspend root=/dev/ram
|
||||
# Manifest
|
||||
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(DEVICE_PATH)/framework_compatibility_matrix.xml
|
||||
DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/manifest.xml
|
||||
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/compatibility_matrix.xml
|
||||
PRODUCT_MANIFEST_FILES := $(DEVICE_PATH)/product_manifest.xml
|
||||
|
||||
# Partition sizes
|
||||
BOARD_FLASH_BLOCK_SIZE := 4096
|
||||
BOARD_BOOTIMAGE_PARTITION_SIZE := 134217728 # 128M
|
||||
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2048M
|
||||
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2560M
|
||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 134217728 # 128M
|
||||
BOARD_VENDORIMAGE_PARTITION_SIZE := 268435456 # 256M
|
||||
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
|
||||
TARGET_USERIMAGES_USE_EXT4 := true
|
||||
|
||||
# Platform
|
||||
TARGET_BOARD_PLATFORM := bcm2712
|
||||
TARGET_BOOTLOADER_BOARD_NAME := bcm2712
|
||||
|
||||
# Properties
|
||||
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
|
||||
|
||||
# Recovery
|
||||
TARGET_NO_RECOVERY := true
|
||||
|
||||
# SELinux
|
||||
BOARD_SEPOLICY_DIRS += device/brcm/rpi5/sepolicy
|
||||
BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
|
||||
|
||||
# Treble
|
||||
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
|
||||
BOARD_VNDK_VERSION := current
|
||||
PRODUCT_FULL_TREBLE_OVERRIDE := true
|
||||
TARGET_COPY_OUT_VENDOR := vendor
|
||||
|
||||
# Virtualization
|
||||
@@ -84,5 +68,5 @@ BOARD_HOSTAPD_DRIVER := NL80211
|
||||
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
|
||||
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
|
||||
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
||||
BOARD_KERNEL_CMDLINE += androidboot.wificountrycode=00
|
||||
|
@@ -1 +1 @@
|
||||
Raspberry Vanilla AOSP 15 device configuration for Raspberry Pi 5.
|
||||
Raspberry Vanilla AOSP 16 device configuration for Raspberry Pi 5.
|
||||
|
11
aosp_rpi5.mk
11
aosp_rpi5.mk
@@ -4,13 +4,21 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
DEVICE_PATH := device/brcm/rpi5
|
||||
|
||||
# Inherit device configuration
|
||||
$(call inherit-product, device/brcm/rpi5/device.mk)
|
||||
|
||||
PRODUCT_AAPT_CONFIG := normal mdpi hdpi
|
||||
PRODUCT_AAPT_PREF_CONFIG := hdpi
|
||||
PRODUCT_CHARACTERISTICS := tablet,nosdcard
|
||||
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
|
||||
$(call enforce-product-packages-exist,com.android.ranging)
|
||||
|
||||
# Keylayout
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/keylayout/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
|
||||
|
||||
# Overlays
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -29,6 +37,5 @@ PRODUCT_COPY_FILES += \
|
||||
PRODUCT_DEVICE := rpi5
|
||||
PRODUCT_NAME := aosp_rpi5
|
||||
PRODUCT_BRAND := Raspberry
|
||||
PRODUCT_MODEL := Raspberry Pi 5
|
||||
PRODUCT_MODEL := Pi 5
|
||||
PRODUCT_MANUFACTURER := Raspberry
|
||||
PRODUCT_RELEASE_NAME := Raspberry Pi 5
|
||||
|
@@ -4,23 +4,25 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
DEVICE_PATH := device/brcm/rpi5
|
||||
|
||||
# Inherit device configuration
|
||||
$(call inherit-product, device/brcm/rpi5/device.mk)
|
||||
|
||||
DEVICE_CAR_PATH := device/brcm/rpi5/car
|
||||
|
||||
PRODUCT_AAPT_CONFIG := normal mdpi hdpi
|
||||
PRODUCT_AAPT_PREF_CONFIG := hdpi
|
||||
PRODUCT_CHARACTERISTICS := automotive,nosdcard
|
||||
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
|
||||
$(call inherit-product, packages/services/Car/car_product/build/car.mk)
|
||||
$(call enforce-product-packages-exist,Bluetooth Keyguard Launcher2 OverviewApp RotaryIME RotaryPlayground com.android.ranging libnfc_ndef libvariablespeed pppd)
|
||||
|
||||
# Audio
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.automotive.audiocontrol-service.example
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_CAR_PATH)/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml
|
||||
$(DEVICE_PATH)/car/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_VENDOR_PROPERTIES += \
|
||||
@@ -35,7 +37,6 @@ PRODUCT_VENDOR_PROPERTIES += \
|
||||
bluetooth.profile.hfp.ag.enabled=false \
|
||||
bluetooth.profile.hid.device.enabled=false \
|
||||
bluetooth.profile.hid.host.enabled=false \
|
||||
bluetooth.profile.map.client.enabled=false \
|
||||
bluetooth.profile.map.server.enabled=false \
|
||||
bluetooth.profile.mcp.server.enabled=false \
|
||||
bluetooth.profile.opp.enabled=false \
|
||||
@@ -64,16 +65,27 @@ PRODUCT_PACKAGES += \
|
||||
|
||||
# Display
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_CAR_PATH)/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml
|
||||
$(DEVICE_PATH)/car/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml
|
||||
|
||||
# EVS
|
||||
ENABLE_CAREVSSERVICE_SAMPLE := true
|
||||
ENABLE_EVS_SAMPLE := true
|
||||
ENABLE_EVS_SERVICE := true
|
||||
ENABLE_REAR_VIEW_CAMERA_SAMPLE := true
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.automotive.evs-v4l2 \
|
||||
cardisplayproxyd \
|
||||
CarEvsCameraPreviewApp \
|
||||
evs_app \
|
||||
evsmanagerd
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_CAR_PATH)/evs_config_override.json:${TARGET_COPY_OUT_VENDOR}/etc/automotive/evs/config_override.json
|
||||
packages/services/Car/cpp/evs/manager/aidl/init.evs.rc:$(TARGET_COPY_OUT_SYSTEM)/etc/init/init.evs.rc
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/car/evs_config_override.json:${TARGET_COPY_OUT_VENDOR}/etc/automotive/evs/config_override.json
|
||||
|
||||
include packages/services/Car/cpp/evs/apps/sepolicy/evsapp.mk
|
||||
|
||||
# Keylayout
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/keylayout/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
|
||||
|
||||
# Occupant awareness
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -96,12 +108,11 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# Vehicle
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.automotive.vehicle@V3-default-service
|
||||
android.hardware.automotive.vehicle@V4-default-service
|
||||
|
||||
# Device identifier. This must come after all inclusions.
|
||||
PRODUCT_DEVICE := rpi5
|
||||
PRODUCT_NAME := aosp_rpi5_car
|
||||
PRODUCT_BRAND := Raspberry
|
||||
PRODUCT_MODEL := Raspberry Pi 5
|
||||
PRODUCT_MODEL := Pi 5
|
||||
PRODUCT_MANUFACTURER := Raspberry
|
||||
PRODUCT_RELEASE_NAME := Raspberry Pi 5
|
||||
|
@@ -4,12 +4,16 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
DEVICE_PATH := device/brcm/rpi5
|
||||
|
||||
# Inherit device configuration
|
||||
$(call inherit-product, device/brcm/rpi5/device.mk)
|
||||
|
||||
PRODUCT_AAPT_PREF_CONFIG := tvdpi
|
||||
PRODUCT_CHARACTERISTICS := tv
|
||||
|
||||
$(call inherit-product, device/google/atv/products/atv_base.mk)
|
||||
$(call enforce-product-packages-exist,com.android.ranging)
|
||||
|
||||
# Android TV
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -27,6 +31,10 @@ PRODUCT_VENDOR_PROPERTIES += \
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/atv/products/bootanimations/bootanimation.zip:$(TARGET_COPY_OUT_SYSTEM)/media/bootanimation.zip
|
||||
|
||||
# Keylayout
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/keylayout/Generic-tv.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
|
||||
|
||||
# Overlays
|
||||
PRODUCT_PACKAGES += \
|
||||
AndroidTvRpiOverlay \
|
||||
@@ -38,6 +46,5 @@ PRODUCT_PACKAGES += \
|
||||
PRODUCT_DEVICE := rpi5
|
||||
PRODUCT_NAME := aosp_rpi5_tv
|
||||
PRODUCT_BRAND := Raspberry
|
||||
PRODUCT_MODEL := Raspberry Pi 5
|
||||
PRODUCT_MODEL := Pi 5
|
||||
PRODUCT_MANUFACTURER := Raspberry
|
||||
PRODUCT_RELEASE_NAME := Raspberry Pi 5
|
||||
|
@@ -57,6 +57,9 @@
|
||||
#define CHANNEL_STEREO 2
|
||||
#define MIN_WRITE_SLEEP_US 5000
|
||||
|
||||
int pcm_card;
|
||||
int pcm_device;
|
||||
|
||||
struct stub_stream_in {
|
||||
struct audio_stream_in stream;
|
||||
};
|
||||
@@ -90,7 +93,7 @@ static int probe_pcm_out_card() {
|
||||
char card_id[16];
|
||||
|
||||
char card_prop[PROPERTY_VALUE_MAX];
|
||||
property_get("persist.audio.device", card_prop, "");
|
||||
property_get("persist.vendor.audio.device", card_prop, "");
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
snprintf(card_node, sizeof(card_node), "/proc/asound/card%d/id", i);
|
||||
@@ -118,18 +121,18 @@ static int probe_pcm_out_card() {
|
||||
static int get_pcm_card()
|
||||
{
|
||||
char card[PROPERTY_VALUE_MAX];
|
||||
property_get("persist.audio.pcm.card.auto", card, "false");
|
||||
property_get("persist.vendor.audio.pcm.card.auto", card, "false");
|
||||
if (!strcmp(card, "true"))
|
||||
return probe_pcm_out_card();
|
||||
|
||||
property_get("persist.audio.pcm.card", card, "0");
|
||||
property_get("persist.vendor.audio.pcm.card", card, "0");
|
||||
return atoi(card);
|
||||
}
|
||||
|
||||
static int get_pcm_device()
|
||||
{
|
||||
char device[PROPERTY_VALUE_MAX];
|
||||
property_get("persist.audio.pcm.device", device, "0");
|
||||
property_get("persist.vendor.audio.pcm.device", device, "0");
|
||||
return atoi(device);
|
||||
}
|
||||
|
||||
@@ -148,7 +151,7 @@ static int start_output_stream(struct alsa_stream_out *out)
|
||||
out->config.start_threshold = PLAYBACK_PERIOD_START_THRESHOLD * PERIOD_SIZE;
|
||||
out->config.avail_min = PERIOD_SIZE;
|
||||
|
||||
out->pcm = pcm_open(get_pcm_card(), get_pcm_device(), PCM_OUT | PCM_MMAP | PCM_NOIRQ | PCM_MONOTONIC, &out->config);
|
||||
out->pcm = pcm_open(pcm_card, pcm_device, PCM_OUT | PCM_MMAP | PCM_NOIRQ | PCM_MONOTONIC, &out->config);
|
||||
|
||||
if (!pcm_is_ready(out->pcm)) {
|
||||
ALOGE("cannot open pcm_out driver: %s", pcm_get_error(out->pcm));
|
||||
@@ -484,7 +487,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
|
||||
struct pcm_params *params;
|
||||
int ret = 0;
|
||||
|
||||
params = pcm_params_get(get_pcm_card(), get_pcm_device(), PCM_OUT);
|
||||
params = pcm_params_get(pcm_card, pcm_device, PCM_OUT);
|
||||
if (!params)
|
||||
return -ENOSYS;
|
||||
|
||||
@@ -690,6 +693,10 @@ static int adev_open(const hw_module_t* module, const char* name,
|
||||
|
||||
ALOGV("adev_open: %s", name);
|
||||
|
||||
pcm_card = get_pcm_card();
|
||||
pcm_device = get_pcm_device();
|
||||
ALOGI("adev_open: pcm_card %d, pcm_device %d", pcm_card, pcm_device);
|
||||
|
||||
if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
|
||||
return -EINVAL;
|
||||
|
||||
|
@@ -55,6 +55,8 @@
|
||||
#define CHANNEL_STEREO 2
|
||||
#define MIN_WRITE_SLEEP_US 5000
|
||||
|
||||
char device_name[PROPERTY_VALUE_MAX];
|
||||
|
||||
struct stub_stream_in {
|
||||
struct audio_stream_in stream;
|
||||
};
|
||||
@@ -87,7 +89,7 @@ struct alsa_stream_out {
|
||||
|
||||
static void get_alsa_device_name(char *name) {
|
||||
char hdmi_device[PROPERTY_VALUE_MAX];
|
||||
property_get("persist.audio.hdmi.device", hdmi_device, "vc4hdmi0");
|
||||
property_get("persist.vendor.audio.hdmi.device", hdmi_device, "vc4hdmi0");
|
||||
|
||||
// use card configured in vc4-hdmi.conf to get IEC958 subframe conversion
|
||||
sprintf(name, "default:CARD=%s", hdmi_device);
|
||||
@@ -101,8 +103,6 @@ static int start_output_stream(struct alsa_stream_out *out)
|
||||
if (out->unavailable)
|
||||
return -ENODEV;
|
||||
|
||||
char device_name[PROPERTY_VALUE_MAX];
|
||||
get_alsa_device_name(device_name);
|
||||
ALOGI("start_output_stream: %s", device_name);
|
||||
|
||||
int r;
|
||||
@@ -717,6 +717,9 @@ static int adev_open(const hw_module_t* module, const char* name,
|
||||
|
||||
ALOGV("adev_open: %s", name);
|
||||
|
||||
get_alsa_device_name(device_name);
|
||||
ALOGI("adev_open: %s", device_name);
|
||||
|
||||
if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
|
||||
return -EINVAL;
|
||||
|
||||
|
@@ -6,28 +6,51 @@
|
||||
cc_binary {
|
||||
name: "android.hardware.bluetooth-service.rpi",
|
||||
relative_install_path: "hw",
|
||||
init_rc: ["bluetooth-service-rpi.rc"],
|
||||
vintf_fragments: ["bluetooth-service-rpi.xml"],
|
||||
vendor: true,
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
],
|
||||
srcs: [
|
||||
"BluetoothHci.cpp",
|
||||
"main.cpp",
|
||||
"net_bluetooth_mgmt.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.bluetooth-V1-ndk",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"libhidlbase",
|
||||
"liblog",
|
||||
"libutils",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.bluetooth.async",
|
||||
"android.hardware.bluetooth.hci",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.bluetooth-V1-ndk",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"liblog",
|
||||
"libutils",
|
||||
],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.bluetooth-service.rpi.rc",
|
||||
src: "android.hardware.bluetooth-service.rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.bluetooth-service.rpi.xml",
|
||||
src: "android.hardware.bluetooth-service.rpi.xml",
|
||||
sub_dir: "vintf",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.bluetooth.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["android.hardware.bluetooth-service.rpi"],
|
||||
prebuilts: [
|
||||
"android.hardware.bluetooth-service.rpi.rc",
|
||||
"android.hardware.bluetooth-service.rpi.xml",
|
||||
],
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
service vendor.bluetooth-default /vendor/bin/hw/android.hardware.bluetooth-service.rpi
|
||||
service vendor.bluetooth-rpi /apex/com.android.hardware.bluetooth.rpi5/bin/hw/android.hardware.bluetooth-service.rpi
|
||||
class hal
|
||||
capabilities BLOCK_SUSPEND NET_ADMIN SYS_NICE
|
||||
user bluetooth
|
3
bluetooth/apex_file_contexts
Normal file
3
bluetooth/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/hw/android\.hardware\.bluetooth-service\.rpi u:object_r:hal_bluetooth_default_exec:s0
|
4
bluetooth/apex_manifest.json
Normal file
4
bluetooth/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.bluetooth.rpi5",
|
||||
"version": 1
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 KonstaKANG
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _BDROID_BUILDCFG_H
|
||||
#define _BDROID_BUILDCFG_H
|
||||
|
||||
#define BTM_DEF_LOCAL_NAME "Raspberry Pi 5"
|
||||
|
||||
#endif
|
36
bluetooth/main.cpp
Normal file
36
bluetooth/main.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2024 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "BluetoothHci.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
|
||||
using ::aidl::android::hardware::bluetooth::impl::BluetoothHci;
|
||||
|
||||
int main() {
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
||||
std::shared_ptr<BluetoothHci> bluetooth = ndk::SharedRefBase::make<BluetoothHci>();
|
||||
|
||||
const std::string instance = std::string() + BluetoothHci::descriptor + "/default";
|
||||
binder_status_t status = AServiceManager_addService(bluetooth->asBinder().get(), instance.c_str());
|
||||
CHECK(status == STATUS_OK);
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2024 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "aidl.android.hardware.bluetooth.service.rpi"
|
||||
|
||||
#include <aidl/android/hardware/bluetooth/IBluetoothHci.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
|
||||
#include "BluetoothHci.h"
|
||||
|
||||
using ::aidl::android::hardware::bluetooth::impl::BluetoothHci;
|
||||
using ::android::hardware::configureRpcThreadpool;
|
||||
using ::android::hardware::joinRpcThreadpool;
|
||||
|
||||
int main(int /* argc */, char** /* argv */) {
|
||||
ALOGI("Bluetooth HAL starting");
|
||||
if (!ABinderProcess_setThreadPoolMaxThreadCount(0)) {
|
||||
ALOGI("failed to set thread pool max thread count");
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::shared_ptr<BluetoothHci> service =
|
||||
ndk::SharedRefBase::make<BluetoothHci>();
|
||||
std::string instance = std::string() + BluetoothHci::descriptor + "/default";
|
||||
auto result =
|
||||
AServiceManager_addService(service->asBinder().get(), instance.c_str());
|
||||
if (result == STATUS_OK) {
|
||||
ABinderProcess_joinThreadPool();
|
||||
} else {
|
||||
ALOGE("Could not register as a service!");
|
||||
}
|
||||
return 0;
|
||||
}
|
@@ -6,7 +6,6 @@ initramfs ramdisk.img followkernel
|
||||
|
||||
# Camera
|
||||
camera_auto_detect=1
|
||||
start_x=1
|
||||
|
||||
# Display
|
||||
disable_overscan=1
|
||||
|
@@ -1,10 +0,0 @@
|
||||
service vendor.camera-provider-2-5 /vendor/bin/hw/android.hardware.camera.provider@2.5-service_64
|
||||
class hal
|
||||
user cameraserver
|
||||
group audio camera input drmrpc
|
||||
ioprio rt 4
|
||||
capabilities SYS_NICE
|
||||
task_profiles CameraServiceCapacity MaxPerformance
|
||||
override
|
||||
setenv LIBCAMERA_LOG_LEVELS *:WARN
|
||||
setenv LIBCAMERA_LOG_FILE syslog
|
@@ -1,25 +1,25 @@
|
||||
cameras:
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/imx219@10":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/imx219@10":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/imx296@1a":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/imx296@1a":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/imx477@1a":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/imx477@1a":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/imx500@1a":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/imx500@1a":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/imx519@1a":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/imx519@1a":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/imx708@1a":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/imx708@1a":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/ov5647@36":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/ov5647@36":
|
||||
location: back
|
||||
rotation: 0
|
||||
"/base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36":
|
||||
"/base/axi/pcie@1000120000/rp1/i2c@88000/ov64a40@36":
|
||||
location: back
|
||||
rotation: 0
|
||||
|
@@ -19,11 +19,7 @@
|
||||
<ExternalCamera>
|
||||
<Provider>
|
||||
<ignore> <!-- Internal video devices to be ignored by external camera HAL -->
|
||||
<id>13</id> <!-- No leading/trailing spaces -->
|
||||
<id>14</id>
|
||||
<id>15</id>
|
||||
<id>16</id>
|
||||
<id>19</id>
|
||||
<id>19</id> <!-- No leading/trailing spaces -->
|
||||
<id>20</id>
|
||||
<id>21</id>
|
||||
<id>22</id>
|
||||
@@ -40,8 +36,6 @@
|
||||
<id>33</id>
|
||||
<id>34</id>
|
||||
<id>35</id>
|
||||
<id>36</id>
|
||||
<id>37</id>
|
||||
</ignore>
|
||||
</Provider>
|
||||
<!-- See ExternalCameraUtils.cpp for default values of Device configurations below -->
|
||||
|
@@ -1,26 +0,0 @@
|
||||
// Copyright (C) 2021 The Android Open Source Project
|
||||
// Copyright (C) 2025 KonstaKANG
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.tv.cec@1.0-service.rpi",
|
||||
relative_install_path: "hw",
|
||||
init_rc: ["android.hardware.tv.cec@1.0-service.rpi.rc"],
|
||||
vintf_fragments: ["android.hardware.tv.cec@1.0-service.rpi.xml"],
|
||||
vendor: true,
|
||||
srcs: [
|
||||
"HdmiCec.cpp",
|
||||
"HdmiCecPort.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.tv.cec@1.0",
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libhardware",
|
||||
"libhidlbase",
|
||||
"liblog",
|
||||
"libutils",
|
||||
],
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
service vendor.cec-hal-1-0-rpi /vendor/bin/hw/android.hardware.tv.cec@1.0-service.rpi
|
||||
interface android.hardware.tv.cec@1.0::IHdmiCec default
|
||||
class hal
|
||||
user system
|
||||
group system
|
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
* Copyright (C) 2025 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.tv.cec@1.0-service-rpi"
|
||||
|
||||
#include <android/hardware/tv/cec/1.0/IHdmiCec.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include "HdmiCec.h"
|
||||
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
using android::hardware::tv::cec::V1_0::IHdmiCec;
|
||||
using android::hardware::tv::cec::V1_0::implementation::HdmiCec;
|
||||
|
||||
using android::OK;
|
||||
using android::status_t;
|
||||
|
||||
int main() {
|
||||
configureRpcThreadpool(1, true /* callerWillJoin */);
|
||||
|
||||
android::sp<IHdmiCec> service = new HdmiCec();
|
||||
|
||||
status_t status = service->registerAsService();
|
||||
if (status != OK) {
|
||||
ALOGE("Cannot register HDMI-CEC HAL service.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ALOGI("HDMI-CEC HAL ready.");
|
||||
joinRpcThreadpool();
|
||||
|
||||
// Under normal cases, execution will not reach this line.
|
||||
ALOGE("HDMI-CEC HAL failed to join thread pool.");
|
||||
return 1;
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
<compatibility-matrix version="1.0" type="device">
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.sensorservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensorManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.manager</name>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>IServiceManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>android.hidl.memory</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.token</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ITokenManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
130
device.mk
130
device.mk
@@ -5,9 +5,8 @@
|
||||
#
|
||||
|
||||
DEVICE_PATH := device/brcm/rpi5
|
||||
PRODUCT_SOONG_NAMESPACES += $(DEVICE_PATH)
|
||||
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
|
||||
$(call inherit-product, frameworks/native/build/tablet-7in-xhdpi-2048-dalvik-heap.mk)
|
||||
$(call inherit-product, vendor/brcm/rpi5/rpi5-vendor.mk)
|
||||
|
||||
@@ -15,7 +14,7 @@ $(call inherit-product, vendor/brcm/rpi5/rpi5-vendor.mk)
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
|
||||
|
||||
# API level
|
||||
PRODUCT_SHIPPING_API_LEVEL := 34
|
||||
PRODUCT_SHIPPING_API_LEVEL := 36
|
||||
|
||||
# Audio
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -27,13 +26,6 @@ PRODUCT_PACKAGES += \
|
||||
audio.r_submix.default \
|
||||
audio.usb.default
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
tinycap \
|
||||
tinyhostless \
|
||||
tinymix \
|
||||
tinypcminfo \
|
||||
tinyplay
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
|
||||
frameworks/av/media/libeffects/data/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
|
||||
@@ -42,39 +34,9 @@ PRODUCT_COPY_FILES += \
|
||||
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
|
||||
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
alsa_amixer \
|
||||
alsa_aplay \
|
||||
alsa_arecord \
|
||||
alsa_loop
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
external/alsa-lib/src/conf/alsa.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/alsa.conf \
|
||||
external/alsa-lib/src/conf/cards/aliases.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/cards/aliases.conf \
|
||||
external/alsa-lib/src/conf/cards/vc4-hdmi.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/cards/vc4-hdmi.conf \
|
||||
external/alsa-lib/src/conf/ctl/default.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/ctl/default.conf \
|
||||
external/alsa-lib/src/conf/pcm/center_lfe.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/center_lfe.conf \
|
||||
external/alsa-lib/src/conf/pcm/default.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/default.conf \
|
||||
external/alsa-lib/src/conf/pcm/dmix.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/dmix.conf \
|
||||
external/alsa-lib/src/conf/pcm/dpl.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/dpl.conf \
|
||||
external/alsa-lib/src/conf/pcm/dsnoop.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/dsnoop.conf \
|
||||
external/alsa-lib/src/conf/pcm/front.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/front.conf \
|
||||
external/alsa-lib/src/conf/pcm/hdmi.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/hdmi.conf \
|
||||
external/alsa-lib/src/conf/pcm/iec958.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/iec958.conf \
|
||||
external/alsa-lib/src/conf/pcm/modem.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/modem.conf \
|
||||
external/alsa-lib/src/conf/pcm/rear.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/rear.conf \
|
||||
external/alsa-lib/src/conf/pcm/side.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/side.conf \
|
||||
external/alsa-lib/src/conf/pcm/surround21.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/surround21.conf \
|
||||
external/alsa-lib/src/conf/pcm/surround40.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/surround40.conf \
|
||||
external/alsa-lib/src/conf/pcm/surround41.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/surround41.conf \
|
||||
external/alsa-lib/src/conf/pcm/surround50.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/surround50.conf \
|
||||
external/alsa-lib/src/conf/pcm/surround51.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/surround51.conf \
|
||||
external/alsa-lib/src/conf/pcm/surround71.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/pcm/surround71.conf \
|
||||
external/alsa-lib/src/conf/smixer.conf:$(TARGET_COPY_OUT_VENDOR)/etc/alsa/smixer.conf
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.bluetooth-service.rpi
|
||||
com.android.hardware.bluetooth.rpi5
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
|
||||
@@ -99,31 +61,12 @@ PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.camera.external.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.external.xml
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.camera.provider@2.5-service_64 \
|
||||
android.hardware.camera.provider-V1-libcamera-service \
|
||||
camera.libcamera \
|
||||
ipa_rpi_pisp
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/camera/android.hardware.camera.provider@2.5-service_64.rpi.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.camera.provider@2.5-service_64.rpi.rc
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/camera/camera_hal.yaml:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/camera_hal.yaml \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx219.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx219.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx219_noir.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx219_noir.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx296.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx296.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx296_mono.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx296_mono.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx477.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx477.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx477_noir.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx477_noir.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx477_scientific.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx477_scientific.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx500.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx500.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx519.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx519.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx708.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx708.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx708_noir.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx708_noir.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx708_wide.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx708_wide.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/imx708_wide_noir.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/imx708_wide_noir.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/ov5647.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/ov5647.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/ov5647_noir.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/ov5647_noir.json \
|
||||
external/libcamera/src/ipa/rpi/pisp/data/ov64a40.json:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/ipa/rpi/pisp/ov64a40.json
|
||||
$(DEVICE_PATH)/camera/camera_hal.yaml:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/camera_hal.yaml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \
|
||||
@@ -138,7 +81,8 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# CEC
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.tv.cec@1.0-service.rpi
|
||||
com.android.hardware.tv.hdmi.cec.rpi5 \
|
||||
com.android.hardware.tv.hdmi.connection.rpi5
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.hdmi.cec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.hdmi.cec.xml
|
||||
@@ -148,7 +92,7 @@ PRODUCT_SET_DEBUGFS_RESTRICTIONS := false
|
||||
|
||||
# DRM
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm-service.clearkey
|
||||
com.android.hardware.drm.clearkey
|
||||
|
||||
# Emergency info
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -160,20 +104,23 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# FFmpeg
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.media.c2@1.2-service-ffmpeg
|
||||
com.android.hardware.media.c2.ffmpeg
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/media/media_codecs_ffmpeg_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_ffmpeg_c2.xml \
|
||||
$(DEVICE_PATH)/seccomp_policy/android.hardware.media.c2-ffmpeg.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/android.hardware.media.c2-ffmpeg.policy
|
||||
|
||||
# Gatekeeper
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gatekeeper@1.0-service.software
|
||||
com.android.hardware.gatekeeper.nonsecure
|
||||
|
||||
# Graphics
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.graphics.allocator-service.minigbm_gbm_mesa \
|
||||
mapper.minigbm_gbm_mesa \
|
||||
libgbm_mesa_wrapper
|
||||
mapper.minigbm_gbm_mesa
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.composer.hwc3-service.drm
|
||||
com.android.hardware.graphics.composer.drm_hwcomposer
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libEGL_mesa \
|
||||
@@ -198,23 +145,27 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# Health
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.health-service.rpi
|
||||
com.android.hardware.health.rpi5
|
||||
|
||||
# HIDL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hidl.allocator@1.0-service \
|
||||
hwservicemanager
|
||||
|
||||
# Kernel
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)-kernel/Image:$(PRODUCT_OUT)/kernel
|
||||
|
||||
# Keylayout
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/keylayout/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
|
||||
|
||||
# Keymaster
|
||||
# Keymint
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.keymaster@4.1-service
|
||||
com.android.hardware.keymint.rust_nonsecure
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.keystore.app_attest_key.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.keystore.app_attest_key.xml
|
||||
|
||||
# Lights
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.light-service.rpi
|
||||
com.android.hardware.light.rpi5
|
||||
|
||||
# Media
|
||||
PRODUCT_COPY_FILES += \
|
||||
@@ -225,7 +176,7 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# Power
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.power-service.example
|
||||
com.android.hardware.power
|
||||
|
||||
# Ramdisk
|
||||
PRODUCT_COPY_FILES += \
|
||||
@@ -240,12 +191,15 @@ PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
|
||||
$(DEVICE_PATH)/seccomp_policy/mediaswcodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaswcodec.policy
|
||||
|
||||
# Soong
|
||||
PRODUCT_SOONG_NAMESPACES += $(DEVICE_PATH)
|
||||
|
||||
# Storage
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
|
||||
|
||||
# Suspend
|
||||
PRODUCT_PACKAGES += \
|
||||
suspend_blocker_rpi
|
||||
com.android.hardware.suspend_blocker.rpi5
|
||||
|
||||
# Thermal
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -257,8 +211,8 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# USB
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.usb-service.example \
|
||||
android.hardware.usb.gadget-service.rpi
|
||||
com.android.hardware.usb \
|
||||
com.android.hardware.usb.gadget.rpi5
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
|
||||
@@ -270,17 +224,11 @@ $(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk
|
||||
|
||||
# Wifi
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi-service \
|
||||
hostapd \
|
||||
hostapd_cli \
|
||||
com.android.hardware.wifi \
|
||||
com.android.hardware.wifi.hostapd.rpi5 \
|
||||
com.android.hardware.wifi.supplicant.rpi5 \
|
||||
libwpa_client \
|
||||
wificond \
|
||||
wpa_cli \
|
||||
wpa_supplicant \
|
||||
wpa_supplicant.conf
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
hardware/broadcom/wlan/bcmdhd/config/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
|
||||
wificond
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml
|
||||
|
@@ -1,8 +1,7 @@
|
||||
<compatibility-matrix version="1.0" type="framework">
|
||||
<hal format="hidl" optional="true">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.media.c2</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IComponentStore</name>
|
||||
<instance>ffmpeg</instance>
|
||||
|
53
hdmi/cec/Android.bp
Normal file
53
hdmi/cec/Android.bp
Normal file
@@ -0,0 +1,53 @@
|
||||
// Copyright (C) 2021 The Android Open Source Project
|
||||
// Copyright (C) 2025 KonstaKANG
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.tv.hdmi.cec-service.rpi",
|
||||
relative_install_path: "hw",
|
||||
vendor: true,
|
||||
srcs: [
|
||||
"HdmiCec.cpp",
|
||||
"HdmiCecPort.cpp",
|
||||
"main.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.tv.hdmi.cec-V1-ndk",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"libcutils",
|
||||
"libhardware",
|
||||
"liblog",
|
||||
],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.tv.hdmi.cec-service.rpi.rc",
|
||||
src: "android.hardware.tv.hdmi.cec-service.rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.tv.hdmi.cec-service.rpi.xml",
|
||||
src: "android.hardware.tv.hdmi.cec-service.rpi.xml",
|
||||
sub_dir: "vintf",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.tv.hdmi.cec.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["android.hardware.tv.hdmi.cec-service.rpi"],
|
||||
prebuilts: [
|
||||
"android.hardware.tv.hdmi.cec-service.rpi.rc",
|
||||
"android.hardware.tv.hdmi.cec-service.rpi.xml",
|
||||
],
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.tv.cec@1.0-service.rpi"
|
||||
#define LOG_TAG "android.hardware.tv.hdmi.cec-service.rpi"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/properties.h>
|
||||
@@ -29,20 +29,19 @@
|
||||
|
||||
#include "HdmiCec.h"
|
||||
|
||||
#define PROPERTY_CEC_DEVICE "persist.hdmi.cec_device"
|
||||
#define PROPERTY_CEC_VERSION "ro.hdmi.cec_version"
|
||||
#define PROPERTY_VENDOR_ID "ro.hdmi.vendor_id"
|
||||
#define PROPERTY_CEC_DEVICE "persist.vendor.hdmi.cec_device"
|
||||
|
||||
using android::base::GetProperty;
|
||||
using ndk::ScopedAStatus;
|
||||
using std::string;
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tv {
|
||||
namespace hdmi {
|
||||
namespace cec {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using android::base::GetProperty;
|
||||
using std::string;
|
||||
|
||||
HdmiCec::HdmiCec() {
|
||||
mCecEnabled = false;
|
||||
mWakeupEnabled = false;
|
||||
@@ -59,22 +58,23 @@ HdmiCec::~HdmiCec() {
|
||||
release();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::tv::cec::V1_0::IHdmiCec follow.
|
||||
Return<Result> HdmiCec::addLogicalAddress(CecLogicalAddress addr) {
|
||||
ScopedAStatus HdmiCec::addLogicalAddress(CecLogicalAddress addr, Result* _aidl_return) {
|
||||
if (addr < CecLogicalAddress::TV || addr >= CecLogicalAddress::BROADCAST) {
|
||||
LOG(ERROR) << "Add logical address failed, Invalid address";
|
||||
return Result::FAILURE_INVALID_ARGS;
|
||||
*_aidl_return = Result::FAILURE_INVALID_ARGS;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
cec_log_addrs cecLogAddrs;
|
||||
int ret = ioctl(mHdmiCecPorts[0]->mCecFd, CEC_ADAP_G_LOG_ADDRS, &cecLogAddrs);
|
||||
if (ret) {
|
||||
LOG(ERROR) << "Add logical address failed, Error = " << strerror(errno);
|
||||
return Result::FAILURE_BUSY;
|
||||
*_aidl_return = Result::FAILURE_BUSY;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
cecLogAddrs.cec_version = getCecVersion();
|
||||
cecLogAddrs.vendor_id = getVendorId();
|
||||
cecLogAddrs.cec_version = CEC_OP_CEC_VERSION_1_4;
|
||||
cecLogAddrs.vendor_id = 0x000c03; // HDMI LLC vendor ID
|
||||
|
||||
unsigned int logAddrType = CEC_LOG_ADDR_TYPE_UNREGISTERED;
|
||||
unsigned int allDevTypes = 0;
|
||||
@@ -121,6 +121,9 @@ Return<Result> HdmiCec::addLogicalAddress(CecLogicalAddress addr) {
|
||||
case CecLogicalAddress::UNREGISTERED:
|
||||
cecLogAddrs.flags |= CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK;
|
||||
break;
|
||||
case CecLogicalAddress::BACKUP_1:
|
||||
case CecLogicalAddress::BACKUP_2:
|
||||
break;
|
||||
}
|
||||
|
||||
int logAddrIndex = cecLogAddrs.num_log_addrs;
|
||||
@@ -136,13 +139,15 @@ Return<Result> HdmiCec::addLogicalAddress(CecLogicalAddress addr) {
|
||||
if (ret) {
|
||||
LOG(ERROR) << "Add logical address failed for port " << mHdmiCecPorts[0]->mPortId
|
||||
<< ", Error = " << strerror(errno);
|
||||
return Result::FAILURE_BUSY;
|
||||
*_aidl_return = Result::FAILURE_BUSY;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
return Result::SUCCESS;
|
||||
*_aidl_return = Result::SUCCESS;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::clearLogicalAddress() {
|
||||
ScopedAStatus HdmiCec::clearLogicalAddress() {
|
||||
cec_log_addrs cecLogAddrs;
|
||||
memset(&cecLogAddrs, 0, sizeof(cecLogAddrs));
|
||||
|
||||
@@ -152,27 +157,41 @@ Return<void> HdmiCec::clearLogicalAddress() {
|
||||
<< ", Error = " << strerror(errno);
|
||||
}
|
||||
|
||||
return Void();
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::getPhysicalAddress(getPhysicalAddress_cb callback) {
|
||||
ScopedAStatus HdmiCec::enableAudioReturnChannel(int32_t portId __unused, bool enable __unused) {
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiCec::getCecVersion(int32_t* _aidl_return) {
|
||||
*_aidl_return = CEC_OP_CEC_VERSION_1_4;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiCec::getPhysicalAddress(int32_t* _aidl_return) {
|
||||
uint16_t addr;
|
||||
|
||||
int ret = ioctl(mHdmiCecPorts[0]->mCecFd, CEC_ADAP_G_PHYS_ADDR, &addr);
|
||||
if (ret) {
|
||||
LOG(ERROR) << "Get physical address failed, Error = " << strerror(errno);
|
||||
callback(Result::FAILURE_INVALID_STATE, addr);
|
||||
return Void();
|
||||
return ScopedAStatus::fromServiceSpecificError(
|
||||
static_cast<int32_t>(Result::FAILURE_INVALID_STATE));
|
||||
}
|
||||
|
||||
callback(Result::SUCCESS, addr);
|
||||
|
||||
return Void();
|
||||
*_aidl_return = addr;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<SendMessageResult> HdmiCec::sendMessage(const CecMessage& message) {
|
||||
ScopedAStatus HdmiCec::getVendorId(int32_t* _aidl_return) {
|
||||
*_aidl_return = 0x000c03; // HDMI LLC vendor ID
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiCec::sendMessage(const CecMessage& message, SendMessageResult* _aidl_return) {
|
||||
if (!mCecEnabled) {
|
||||
return SendMessageResult::FAIL;
|
||||
*_aidl_return = SendMessageResult::FAIL;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
cec_msg cecMsg;
|
||||
@@ -190,104 +209,51 @@ Return<SendMessageResult> HdmiCec::sendMessage(const CecMessage& message) {
|
||||
int ret = ioctl(mHdmiCecPorts[0]->mCecFd, CEC_TRANSMIT, &cecMsg);
|
||||
if (ret) {
|
||||
LOG(ERROR) << "Send message failed, Error = " << strerror(errno);
|
||||
return SendMessageResult::FAIL;
|
||||
*_aidl_return = SendMessageResult::FAIL;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
if (cecMsg.tx_status != CEC_TX_STATUS_OK) {
|
||||
LOG(ERROR) << "Send message tx_status = " << cecMsg.tx_status;
|
||||
}
|
||||
|
||||
return getSendMessageResult(cecMsg.tx_status);
|
||||
*_aidl_return = getSendMessageResult(cecMsg.tx_status);
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::setCallback(const sp<IHdmiCecCallback>& callback) {
|
||||
ScopedAStatus HdmiCec::setCallback(const std::shared_ptr<IHdmiCecCallback>& callback) {
|
||||
if (mCallback != nullptr) {
|
||||
mCallback->unlinkToDeath(this);
|
||||
mCallback = nullptr;
|
||||
}
|
||||
|
||||
if (callback != nullptr) {
|
||||
mCallback = callback;
|
||||
mCallback->linkToDeath(this, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return Void();
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<int32_t> HdmiCec::getCecVersion() {
|
||||
return property_get_int32(PROPERTY_CEC_VERSION, CEC_OP_CEC_VERSION_1_4);
|
||||
ScopedAStatus HdmiCec::setLanguage(const std::string& language __unused) {
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<uint32_t> HdmiCec::getVendorId() {
|
||||
return property_get_int32(PROPERTY_VENDOR_ID, 0x000c03 /* HDMI LLC vendor ID */);
|
||||
ScopedAStatus HdmiCec::enableWakeupByOtp(bool value) {
|
||||
mWakeupEnabled = value;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::getPortInfo(getPortInfo_cb callback) {
|
||||
uint16_t addr = CEC_PHYS_ADDR_INVALID;
|
||||
|
||||
int ret = ioctl(mHdmiCecPorts[0]->mCecFd, CEC_ADAP_G_PHYS_ADDR, &addr);
|
||||
if (ret) {
|
||||
LOG(ERROR) << "Get port info failed for port : " << mHdmiCecPorts[0]->mPortId
|
||||
<< ", Error = " << strerror(errno);
|
||||
}
|
||||
|
||||
hidl_vec<HdmiPortInfo> portInfos {
|
||||
{.type = HdmiPortType::OUTPUT,
|
||||
.portId = mHdmiCecPorts[0]->mPortId,
|
||||
.cecSupported = true,
|
||||
.arcSupported = false,
|
||||
.physicalAddress = addr}
|
||||
};
|
||||
callback(portInfos);
|
||||
|
||||
return Void();
|
||||
ScopedAStatus HdmiCec::enableCec(bool value) {
|
||||
mCecEnabled = value;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::setOption(OptionKey key, bool value) {
|
||||
switch (key) {
|
||||
case OptionKey::ENABLE_CEC:
|
||||
LOG(DEBUG) << "setOption: Enable CEC: " << value;
|
||||
mCecEnabled = value;
|
||||
break;
|
||||
case OptionKey::WAKEUP:
|
||||
LOG(DEBUG) << "setOption: WAKEUP: " << value;
|
||||
mWakeupEnabled = value;
|
||||
break;
|
||||
case OptionKey::SYSTEM_CEC_CONTROL:
|
||||
LOG(DEBUG) << "setOption: SYSTEM_CEC_CONTROL: " << value;
|
||||
mCecControlEnabled = value;
|
||||
break;
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::setLanguage(const hidl_string& language __unused) {
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::enableAudioReturnChannel(int32_t portId __unused, bool enable __unused) {
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> HdmiCec::isConnected(int32_t portId __unused) {
|
||||
uint16_t addr = CEC_PHYS_ADDR_INVALID;
|
||||
|
||||
int ret = ioctl(mHdmiCecPorts[0]->mCecFd, CEC_ADAP_G_PHYS_ADDR, &addr);
|
||||
if (ret) {
|
||||
LOG(ERROR) << "Is connected failed, Error = " << strerror(errno);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (addr == CEC_PHYS_ADDR_INVALID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
ScopedAStatus HdmiCec::enableSystemCecControl(bool value) {
|
||||
mCecControlEnabled = value;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
// Initialise the cec file descriptor
|
||||
Return<Result> HdmiCec::init() {
|
||||
Result HdmiCec::init() {
|
||||
string cecDevice = GetProperty(PROPERTY_CEC_DEVICE, "cec0");
|
||||
if (cecDevice != "cec0" && cecDevice != "cec1") {
|
||||
LOG(ERROR) << "Invalid CEC device " << cecDevice;
|
||||
@@ -315,7 +281,7 @@ Return<Result> HdmiCec::init() {
|
||||
return Result::SUCCESS;
|
||||
}
|
||||
|
||||
Return<void> HdmiCec::release() {
|
||||
void HdmiCec::release() {
|
||||
mCecEnabled = false;
|
||||
mWakeupEnabled = false;
|
||||
mCecControlEnabled = false;
|
||||
@@ -328,8 +294,6 @@ Return<void> HdmiCec::release() {
|
||||
setCallback(nullptr);
|
||||
mHdmiCecPorts.clear();
|
||||
mEventThreads.clear();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
void HdmiCec::event_thread(HdmiCecPort* hdmiCecPort) {
|
||||
@@ -366,17 +330,6 @@ void HdmiCec::event_thread(HdmiCecPort* hdmiCecPort) {
|
||||
if (!mCecEnabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ev.event == CEC_EVENT_STATE_CHANGE) {
|
||||
if (mCallback != nullptr) {
|
||||
HotplugEvent hotplugEvent{
|
||||
.connected = (ev.state_change.phys_addr != CEC_PHYS_ADDR_INVALID),
|
||||
.portId = hdmiCecPort->mPortId};
|
||||
mCallback->onHotplugEvent(hotplugEvent);
|
||||
} else {
|
||||
LOG(ERROR) << "No event callback for hotplug";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ufds[0].revents == POLLIN) { /* CEC Driver */
|
||||
@@ -408,7 +361,7 @@ void HdmiCec::event_thread(HdmiCecPort* hdmiCecPort) {
|
||||
}
|
||||
|
||||
if (mCallback != nullptr) {
|
||||
size_t length = std::min(msg.len - 1, (uint32_t)MaxLength::MESSAGE_BODY);
|
||||
size_t length = std::min(msg.len - 1, (uint32_t)(CEC_MESSAGE_BODY_MAX_LENGTH - 1));
|
||||
CecMessage cecMessage{
|
||||
.initiator = static_cast<CecLogicalAddress>(msg.msg[0] >> 4),
|
||||
.destination = static_cast<CecLogicalAddress>(msg.msg[0] & 0xf),
|
||||
@@ -483,7 +436,7 @@ bool HdmiCec::isPowerUICommand(cec_msg message) {
|
||||
}
|
||||
}
|
||||
|
||||
Return<SendMessageResult> HdmiCec::getSendMessageResult(int tx_status) {
|
||||
SendMessageResult HdmiCec::getSendMessageResult(int tx_status) {
|
||||
switch (tx_status) {
|
||||
case CEC_TX_STATUS_OK:
|
||||
return SendMessageResult::SUCCESS;
|
||||
@@ -497,8 +450,8 @@ Return<SendMessageResult> HdmiCec::getSendMessageResult(int tx_status) {
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace cec
|
||||
} // namespace hdmi
|
||||
} // namespace tv
|
||||
} // namespace hardware
|
||||
} // namespace android
|
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <aidl/android/hardware/tv/hdmi/cec/BnHdmiCec.h>
|
||||
#include <hardware/hdmi_cec.h>
|
||||
#include <linux/cec.h>
|
||||
#include <thread>
|
||||
@@ -24,38 +25,42 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tv {
|
||||
namespace hdmi {
|
||||
namespace cec {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using std::shared_ptr;
|
||||
using std::thread;
|
||||
using std::vector;
|
||||
|
||||
class HdmiCec : public IHdmiCec, public hidl_death_recipient {
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::BnHdmiCec;
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::CecLogicalAddress;
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::CecMessage;
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::IHdmiCec;
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::IHdmiCecCallback;
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::Result;
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::SendMessageResult;
|
||||
|
||||
struct HdmiCec : public BnHdmiCec {
|
||||
public:
|
||||
HdmiCec();
|
||||
~HdmiCec();
|
||||
// Methods from ::android::hardware::tv::cec::V1_0::IHdmiCec follow.
|
||||
Return<Result> addLogicalAddress(CecLogicalAddress addr) override;
|
||||
Return<void> clearLogicalAddress() override;
|
||||
Return<void> getPhysicalAddress(getPhysicalAddress_cb _hidl_cb) override;
|
||||
Return<SendMessageResult> sendMessage(const CecMessage& message) override;
|
||||
Return<void> setCallback(const sp<IHdmiCecCallback>& callback) override;
|
||||
Return<int32_t> getCecVersion() override;
|
||||
Return<uint32_t> getVendorId() override;
|
||||
Return<void> getPortInfo(getPortInfo_cb _hidl_cb) override;
|
||||
Return<void> setOption(OptionKey key, bool value) override;
|
||||
Return<void> setLanguage(const hidl_string& language) override;
|
||||
Return<void> enableAudioReturnChannel(int32_t portId, bool enable) override;
|
||||
Return<bool> isConnected(int32_t portId) override;
|
||||
::ndk::ScopedAStatus addLogicalAddress(CecLogicalAddress addr, Result* _aidl_return) override;
|
||||
::ndk::ScopedAStatus clearLogicalAddress() override;
|
||||
::ndk::ScopedAStatus enableAudioReturnChannel(int32_t portId, bool enable) override;
|
||||
::ndk::ScopedAStatus getCecVersion(int32_t* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getPhysicalAddress(int32_t* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getVendorId(int32_t* _aidl_return) override;
|
||||
::ndk::ScopedAStatus sendMessage(const CecMessage& message,
|
||||
SendMessageResult* _aidl_return) override;
|
||||
::ndk::ScopedAStatus setCallback(const std::shared_ptr<IHdmiCecCallback>& callback) override;
|
||||
::ndk::ScopedAStatus setLanguage(const std::string& language) override;
|
||||
::ndk::ScopedAStatus enableWakeupByOtp(bool value) override;
|
||||
::ndk::ScopedAStatus enableCec(bool value) override;
|
||||
::ndk::ScopedAStatus enableSystemCecControl(bool value) override;
|
||||
|
||||
virtual void serviceDied(uint64_t, const wp<::android::hidl::base::V1_0::IBase>&) {
|
||||
setCallback(nullptr);
|
||||
}
|
||||
|
||||
Return<Result> init();
|
||||
Return<void> release();
|
||||
Result init();
|
||||
void release();
|
||||
|
||||
private:
|
||||
void event_thread(HdmiCecPort* hdmiCecPort);
|
||||
@@ -64,7 +69,7 @@ class HdmiCec : public IHdmiCec, public hidl_death_recipient {
|
||||
static bool isWakeupMessage(cec_msg message);
|
||||
static bool isTransferableInSleep(cec_msg message);
|
||||
static bool isPowerUICommand(cec_msg message);
|
||||
static Return<SendMessageResult> getSendMessageResult(int tx_status);
|
||||
static SendMessageResult getSendMessageResult(int tx_status);
|
||||
|
||||
vector<thread> mEventThreads;
|
||||
vector<shared_ptr<HdmiCecPort>> mHdmiCecPorts;
|
||||
@@ -84,12 +89,12 @@ class HdmiCec : public IHdmiCec, public hidl_death_recipient {
|
||||
*/
|
||||
bool mCecControlEnabled;
|
||||
|
||||
sp<IHdmiCecCallback> mCallback;
|
||||
std::shared_ptr<IHdmiCecCallback> mCallback;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace cec
|
||||
} // namespace hdmi
|
||||
} // namespace tv
|
||||
} // namespace hardware
|
||||
} // namespace android
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.tv.cec@1.0-service.rpi"
|
||||
#define LOG_TAG "android.hardware.tv.hdmi.cec-service.rpi"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <errno.h>
|
||||
@@ -29,8 +29,8 @@
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tv {
|
||||
namespace hdmi {
|
||||
namespace cec {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
HdmiCecPort::HdmiCecPort(unsigned int portId) {
|
||||
@@ -44,7 +44,7 @@ HdmiCecPort::~HdmiCecPort() {
|
||||
}
|
||||
|
||||
// Initialise the cec file descriptor
|
||||
Return<Result> HdmiCecPort::init(const char* path) {
|
||||
Result HdmiCecPort::init(const char* path) {
|
||||
mCecFd = open(path, O_RDWR);
|
||||
if (mCecFd < 0) {
|
||||
LOG(ERROR) << "Failed to open " << path << ", Error = " << strerror(errno);
|
||||
@@ -82,7 +82,7 @@ Return<Result> HdmiCecPort::init(const char* path) {
|
||||
return Result::SUCCESS;
|
||||
}
|
||||
|
||||
Return<void> HdmiCecPort::release() {
|
||||
void HdmiCecPort::release() {
|
||||
if (mExitFd > 0) {
|
||||
uint64_t tmp = 1;
|
||||
write(mExitFd, &tmp, sizeof(tmp));
|
||||
@@ -93,12 +93,11 @@ Return<void> HdmiCecPort::release() {
|
||||
if (mCecFd > 0) {
|
||||
close(mCecFd);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace cec
|
||||
} // namespace hdmi
|
||||
} // namespace tv
|
||||
} // namespace hardware
|
||||
} // namespace android
|
@@ -15,21 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <android/hardware/tv/cec/1.0/IHdmiCec.h>
|
||||
#include <aidl/android/hardware/tv/hdmi/cec/BnHdmiCec.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tv {
|
||||
namespace hdmi {
|
||||
namespace cec {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::aidl::android::hardware::tv::hdmi::cec::Result;
|
||||
|
||||
class HdmiCecPort {
|
||||
public:
|
||||
HdmiCecPort(unsigned int portId);
|
||||
~HdmiCecPort();
|
||||
Return<Result> init(const char* path);
|
||||
Return<void> release();
|
||||
Result init(const char* path);
|
||||
void release();
|
||||
|
||||
unsigned int mPortId;
|
||||
int mCecFd;
|
||||
@@ -37,8 +39,8 @@ class HdmiCecPort {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace cec
|
||||
} // namespace hdmi
|
||||
} // namespace tv
|
||||
} // namespace hardware
|
||||
} // namespace android
|
5
hdmi/cec/android.hardware.tv.hdmi.cec-service.rpi.rc
Normal file
5
hdmi/cec/android.hardware.tv.hdmi.cec-service.rpi.rc
Normal file
@@ -0,0 +1,5 @@
|
||||
service vendor.cec-rpi /apex/com.android.hardware.tv.hdmi.cec.rpi5/bin/hw/android.hardware.tv.hdmi.cec-service.rpi
|
||||
interface aidl android.hardware.tv.hdmi.cec.IHdmiCec/default
|
||||
class hal
|
||||
user system
|
||||
group system
|
@@ -1,8 +1,7 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tv.cec</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.tv.hdmi.cec</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IHdmiCec</name>
|
||||
<instance>default</instance>
|
3
hdmi/cec/apex_file_contexts
Normal file
3
hdmi/cec/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/hw/android\.hardware\.tv\.hdmi\.cec-service\.rpi u:object_r:hal_tv_hdmi_cec_default_exec:s0
|
4
hdmi/cec/apex_manifest.json
Normal file
4
hdmi/cec/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.tv.hdmi.cec.rpi5",
|
||||
"version": 1
|
||||
}
|
37
hdmi/cec/main.cpp
Normal file
37
hdmi/cec/main.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2025 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "HdmiCec.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
|
||||
using android::hardware::tv::hdmi::cec::implementation::HdmiCec;
|
||||
|
||||
int main() {
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(1);
|
||||
ABinderProcess_startThreadPool();
|
||||
|
||||
std::shared_ptr<HdmiCec> hdmiCecAidl = ndk::SharedRefBase::make<HdmiCec>();
|
||||
const std::string instance = std::string() + HdmiCec::descriptor + "/default";
|
||||
binder_status_t status = AServiceManager_addService(hdmiCecAidl->asBinder().get(), instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK);
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
50
hdmi/connection/Android.bp
Normal file
50
hdmi/connection/Android.bp
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2022 The Android Open Source Project
|
||||
// Copyright (C) 2025 KonstaKANG
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.tv.hdmi.connection-service.rpi",
|
||||
relative_install_path: "hw",
|
||||
vendor: true,
|
||||
srcs: [
|
||||
"HdmiConnection.cpp",
|
||||
"main.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.tv.hdmi.connection-V1-ndk",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"liblog",
|
||||
],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.tv.hdmi.connection-service.rpi.rc",
|
||||
src: "android.hardware.tv.hdmi.connection-service.rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.tv.hdmi.connection-service.rpi.xml",
|
||||
src: "android.hardware.tv.hdmi.connection-service.rpi.xml",
|
||||
sub_dir: "vintf",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.tv.hdmi.connection.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["android.hardware.tv.hdmi.connection-service.rpi"],
|
||||
prebuilts: [
|
||||
"android.hardware.tv.hdmi.connection-service.rpi.rc",
|
||||
"android.hardware.tv.hdmi.connection-service.rpi.xml",
|
||||
],
|
||||
}
|
119
hdmi/connection/HdmiConnection.cpp
Normal file
119
hdmi/connection/HdmiConnection.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2025 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.tv.hdmi.connection-service.rpi"
|
||||
|
||||
#include "HdmiConnection.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
|
||||
using android::base::ReadFileToString;
|
||||
using ndk::ScopedAStatus;
|
||||
using std::string;
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tv {
|
||||
namespace hdmi {
|
||||
namespace connection {
|
||||
namespace implementation {
|
||||
|
||||
static const string drmCard = "card1";
|
||||
|
||||
HdmiConnection::HdmiConnection() {
|
||||
mCallback = nullptr;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mPortInfos.push_back(
|
||||
{.type = HdmiPortType::OUTPUT,
|
||||
.portId = i,
|
||||
.cecSupported = true,
|
||||
.arcSupported = false,
|
||||
.eArcSupported = false,
|
||||
.physicalAddress = 0xFFFF});
|
||||
mHpdSignal.push_back(HpdSignal::HDMI_HPD_PHYSICAL);
|
||||
}
|
||||
}
|
||||
|
||||
HdmiConnection::~HdmiConnection() {
|
||||
if (mCallback != nullptr) {
|
||||
mCallback = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiConnection::getPortInfo(std::vector<HdmiPortInfo>* _aidl_return) {
|
||||
*_aidl_return = mPortInfos;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiConnection::isConnected(int32_t portId, bool* _aidl_return) {
|
||||
if (portId != 0 && portId != 1) {
|
||||
*_aidl_return = false;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
bool connected = false;
|
||||
string hdmiStatusPath = "/sys/class/drm/" + drmCard + "-HDMI-A-" + to_string(portId + 1) + "/status";
|
||||
if (!access(hdmiStatusPath.c_str(), R_OK)) {
|
||||
string connectedValue;
|
||||
if (ReadFileToString(hdmiStatusPath, &connectedValue)) {
|
||||
connected = !connectedValue.compare("connected\n");
|
||||
}
|
||||
}
|
||||
LOG(INFO) << "portId: " << portId << ", connected: " << connected;
|
||||
|
||||
*_aidl_return = connected;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiConnection::setCallback(const std::shared_ptr<IHdmiConnectionCallback>& callback) {
|
||||
if (mCallback != nullptr) {
|
||||
mCallback = nullptr;
|
||||
}
|
||||
|
||||
if (callback != nullptr) {
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiConnection::setHpdSignal(HpdSignal signal, int32_t portId) {
|
||||
if (portId != 0 && portId != 1) {
|
||||
return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
|
||||
mHpdSignal.at(portId) = signal;
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ScopedAStatus HdmiConnection::getHpdSignal(int32_t portId, HpdSignal* _aidl_return) {
|
||||
if (portId != 0 && portId != 1) {
|
||||
return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
|
||||
*_aidl_return = mHpdSignal.at(portId);
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace connection
|
||||
} // namespace hdmi
|
||||
} // namespace tv
|
||||
} // namespace hardware
|
||||
} // namespace android
|
62
hdmi/connection/HdmiConnection.h
Normal file
62
hdmi/connection/HdmiConnection.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2025 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <aidl/android/hardware/tv/hdmi/connection/BnHdmiConnection.h>
|
||||
#include <aidl/android/hardware/tv/hdmi/connection/Result.h>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tv {
|
||||
namespace hdmi {
|
||||
namespace connection {
|
||||
namespace implementation {
|
||||
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::BnHdmiConnection;
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortInfo;
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortType;
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::HpdSignal;
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::IHdmiConnection;
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::IHdmiConnectionCallback;
|
||||
using ::aidl::android::hardware::tv::hdmi::connection::Result;
|
||||
|
||||
struct HdmiConnection : public BnHdmiConnection {
|
||||
HdmiConnection();
|
||||
~HdmiConnection();
|
||||
::ndk::ScopedAStatus getPortInfo(std::vector<HdmiPortInfo>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus isConnected(int32_t portId, bool* _aidl_return) override;
|
||||
::ndk::ScopedAStatus setCallback(
|
||||
const std::shared_ptr<IHdmiConnectionCallback>& callback) override;
|
||||
::ndk::ScopedAStatus setHpdSignal(HpdSignal signal, int32_t portId) override;
|
||||
::ndk::ScopedAStatus getHpdSignal(int32_t portId, HpdSignal* _aidl_return) override;
|
||||
|
||||
private:
|
||||
std::vector<HdmiPortInfo> mPortInfos;
|
||||
std::vector<HpdSignal> mHpdSignal;
|
||||
|
||||
std::shared_ptr<IHdmiConnectionCallback> mCallback;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace connection
|
||||
} // namespace hdmi
|
||||
} // Namespace tv
|
||||
} // namespace hardware
|
||||
} // namespace android
|
@@ -0,0 +1,5 @@
|
||||
service vendor.hdmi-rpi /apex/com.android.hardware.tv.hdmi.connection.rpi5/bin/hw/android.hardware.tv.hdmi.connection-service.rpi
|
||||
interface aidl android.hardware.tv.hdmi.connection.IHdmiConnection/default
|
||||
class hal
|
||||
user system
|
||||
group system
|
@@ -0,0 +1,10 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.tv.hdmi.connection</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IHdmiConnection</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
3
hdmi/connection/apex_file_contexts
Normal file
3
hdmi/connection/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/hw/android\.hardware\.tv\.hdmi\.connection-service\.rpi u:object_r:hal_tv_hdmi_connection_default_exec:s0
|
4
hdmi/connection/apex_manifest.json
Normal file
4
hdmi/connection/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.tv.hdmi.connection.rpi5",
|
||||
"version": 1
|
||||
}
|
37
hdmi/connection/main.cpp
Normal file
37
hdmi/connection/main.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2025 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "HdmiConnection.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
|
||||
using android::hardware::tv::hdmi::connection::implementation::HdmiConnection;
|
||||
|
||||
int main() {
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(1);
|
||||
ABinderProcess_startThreadPool();
|
||||
|
||||
std::shared_ptr<HdmiConnection> hdmiAidl = ndk::SharedRefBase::make<HdmiConnection>();
|
||||
const std::string instance = std::string() + HdmiConnection::descriptor + "/default";
|
||||
binder_status_t status = AServiceManager_addService(hdmiAidl->asBinder().get(), instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK);
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
@@ -7,26 +7,52 @@ cc_binary {
|
||||
name: "android.hardware.health-service.rpi",
|
||||
relative_install_path: "hw",
|
||||
vendor: true,
|
||||
init_rc: ["android.hardware.health-service.rpi.rc"],
|
||||
vintf_fragments: ["android.hardware.health-service.rpi.xml"],
|
||||
srcs: [
|
||||
"HealthImpl.cpp",
|
||||
"main.cpp",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.health-translate-ndk",
|
||||
"libbatterymonitor",
|
||||
"libhealthloop",
|
||||
"libhealth_aidl_impl",
|
||||
"libhealthloop",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.health-V4-ndk",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"libcutils",
|
||||
"libhidlbase",
|
||||
"liblog",
|
||||
"libutils",
|
||||
"android.hardware.health-V3-ndk",
|
||||
],
|
||||
overrides: ["charger"],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.health-service.rpi.rc",
|
||||
src: "android.hardware.health-service.rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.health-service.rpi.xml",
|
||||
src: "android.hardware.health-service.rpi.xml",
|
||||
sub_dir: "vintf",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.health.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["android.hardware.health-service.rpi"],
|
||||
prebuilts: [
|
||||
"android.hardware.health-service.rpi.rc",
|
||||
"android.hardware.health-service.rpi.xml",
|
||||
],
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
service vendor.health-default /vendor/bin/hw/android.hardware.health-service.rpi
|
||||
service vendor.health-rpi /apex/com.android.hardware.health.rpi5/bin/hw/android.hardware.health-service.rpi
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.health</name>
|
||||
<version>3</version>
|
||||
<version>4</version>
|
||||
<fqname>IHealth/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
3
health/apex_file_contexts
Normal file
3
health/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/hw/android\.hardware\.health-service\.rpi u:object_r:hal_health_default_exec:s0
|
4
health/apex_manifest.json
Normal file
4
health/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.health.rpi5",
|
||||
"version": 1
|
||||
}
|
459
keylayout/Generic-tv.kl
Normal file
459
keylayout/Generic-tv.kl
Normal file
@@ -0,0 +1,459 @@
|
||||
# Copyright (C) 2010 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#
|
||||
# Generic key layout file for full alphabetic US English PC style external keyboards.
|
||||
#
|
||||
# This file is intentionally very generic and is intended to support a broad range of keyboards.
|
||||
# Do not edit the generic key layout to support a specific keyboard; instead, create
|
||||
# a new key layout file with the required keyboard configuration.
|
||||
#
|
||||
|
||||
key 1 ESCAPE
|
||||
key 2 1
|
||||
key 3 2
|
||||
key 4 3
|
||||
key 5 4
|
||||
key 6 5
|
||||
key 7 6
|
||||
key 8 7
|
||||
key 9 8
|
||||
key 10 9
|
||||
key 11 0
|
||||
key 12 MINUS
|
||||
key 13 EQUALS
|
||||
key 14 DEL
|
||||
key 15 TAB
|
||||
key 16 Q
|
||||
key 17 W
|
||||
key 18 E
|
||||
key 19 R
|
||||
key 20 T
|
||||
key 21 Y
|
||||
key 22 U
|
||||
key 23 I
|
||||
key 24 O
|
||||
key 25 P
|
||||
key 26 LEFT_BRACKET
|
||||
key 27 RIGHT_BRACKET
|
||||
key 28 DPAD_CENTER
|
||||
key 29 CTRL_LEFT
|
||||
key 30 A
|
||||
key 31 S
|
||||
key 32 D
|
||||
key 33 F
|
||||
key 34 G
|
||||
key 35 H
|
||||
key 36 J
|
||||
key 37 K
|
||||
key 38 L
|
||||
key 39 SEMICOLON
|
||||
key 40 APOSTROPHE
|
||||
key 41 GRAVE
|
||||
key 42 SHIFT_LEFT
|
||||
key 43 BACKSLASH
|
||||
key 44 Z
|
||||
key 45 X
|
||||
key 46 C
|
||||
key 47 V
|
||||
key 48 B
|
||||
key 49 N
|
||||
key 50 M
|
||||
key 51 COMMA
|
||||
key 52 PERIOD
|
||||
key 53 SLASH
|
||||
key 54 SHIFT_RIGHT
|
||||
key 55 NUMPAD_MULTIPLY
|
||||
key 56 ALT_LEFT
|
||||
key 57 SPACE
|
||||
key 58 CAPS_LOCK
|
||||
key 59 F1
|
||||
key 60 F2
|
||||
key 61 F3
|
||||
key 62 F4
|
||||
key 63 F5
|
||||
key 64 F6
|
||||
key 65 F7
|
||||
key 66 F8
|
||||
key 67 F9
|
||||
key 68 F10
|
||||
key 69 NUM_LOCK
|
||||
key 70 SCROLL_LOCK
|
||||
key 71 NUMPAD_7
|
||||
key 72 NUMPAD_8
|
||||
key 73 NUMPAD_9
|
||||
key 74 NUMPAD_SUBTRACT
|
||||
key 75 NUMPAD_4
|
||||
key 76 NUMPAD_5
|
||||
key 77 NUMPAD_6
|
||||
key 78 NUMPAD_ADD
|
||||
key 79 NUMPAD_1
|
||||
key 80 NUMPAD_2
|
||||
key 81 NUMPAD_3
|
||||
key 82 NUMPAD_0
|
||||
key 83 NUMPAD_DOT
|
||||
# key 84 (undefined)
|
||||
key 85 ZENKAKU_HANKAKU
|
||||
key 86 BACKSLASH
|
||||
key 87 F11
|
||||
key 88 F12
|
||||
key 89 RO
|
||||
# key 90 "KEY_KATAKANA"
|
||||
# key 91 "KEY_HIRAGANA"
|
||||
key 92 HENKAN
|
||||
key 93 KATAKANA_HIRAGANA
|
||||
key 94 MUHENKAN
|
||||
key 95 NUMPAD_COMMA
|
||||
key 96 NUMPAD_ENTER
|
||||
key 97 CTRL_RIGHT
|
||||
key 98 NUMPAD_DIVIDE
|
||||
key 99 SYSRQ
|
||||
key 100 ALT_RIGHT
|
||||
# key 101 "KEY_LINEFEED"
|
||||
key 102 MOVE_HOME
|
||||
key 103 DPAD_UP
|
||||
key 104 PAGE_UP
|
||||
key 105 DPAD_LEFT
|
||||
key 106 DPAD_RIGHT
|
||||
key 107 MOVE_END
|
||||
key 108 DPAD_DOWN
|
||||
key 109 PAGE_DOWN
|
||||
key 110 INSERT
|
||||
key 111 FORWARD_DEL
|
||||
# key 112 "KEY_MACRO"
|
||||
key 113 VOLUME_MUTE
|
||||
key 114 VOLUME_DOWN
|
||||
key 115 VOLUME_UP
|
||||
key 116 POWER
|
||||
key 117 NUMPAD_EQUALS
|
||||
# key 118 "KEY_KPPLUSMINUS"
|
||||
key 119 BREAK
|
||||
# key 120 (undefined)
|
||||
key 121 NUMPAD_COMMA
|
||||
key 122 KANA
|
||||
key 123 EISU
|
||||
key 124 YEN
|
||||
key 125 META_LEFT
|
||||
key 126 META_RIGHT
|
||||
key 127 MENU
|
||||
key 128 MEDIA_STOP
|
||||
# key 129 "KEY_AGAIN"
|
||||
# key 130 "KEY_PROPS"
|
||||
# key 131 "KEY_UNDO"
|
||||
# key 132 "KEY_FRONT"
|
||||
key 133 COPY
|
||||
# key 134 "KEY_OPEN"
|
||||
key 135 PASTE
|
||||
# key 136 "KEY_FIND"
|
||||
key 137 CUT
|
||||
# key 138 "KEY_HELP"
|
||||
key 139 MENU
|
||||
key 140 CALCULATOR
|
||||
# key 141 "KEY_SETUP"
|
||||
key 142 SLEEP
|
||||
key 143 WAKEUP
|
||||
# key 144 "KEY_FILE"
|
||||
# key 145 "KEY_SENDFILE"
|
||||
# key 146 "KEY_DELETEFILE"
|
||||
# key 147 "KEY_XFER"
|
||||
# key 148 "KEY_PROG1"
|
||||
# key 149 "KEY_PROG2"
|
||||
key 150 EXPLORER
|
||||
# key 151 "KEY_MSDOS"
|
||||
key 152 POWER
|
||||
# key 153 "KEY_DIRECTION"
|
||||
# key 154 "KEY_CYCLEWINDOWS"
|
||||
key 155 ENVELOPE
|
||||
key 156 BOOKMARK
|
||||
# key 157 "KEY_COMPUTER"
|
||||
key 158 BACK
|
||||
key 159 FORWARD
|
||||
key 160 MEDIA_CLOSE
|
||||
key 161 MEDIA_EJECT
|
||||
key 162 MEDIA_EJECT
|
||||
key 163 MEDIA_NEXT
|
||||
key 164 MEDIA_PLAY_PAUSE
|
||||
key 165 MEDIA_PREVIOUS
|
||||
key 166 MEDIA_STOP
|
||||
key 167 MEDIA_RECORD
|
||||
key 168 MEDIA_REWIND
|
||||
key 169 CALL
|
||||
# key 170 "KEY_ISO"
|
||||
key 171 MUSIC
|
||||
key 172 HOME
|
||||
key 173 REFRESH
|
||||
# key 174 "KEY_EXIT"
|
||||
# key 175 "KEY_MOVE"
|
||||
# key 176 "KEY_EDIT"
|
||||
key 177 PAGE_UP
|
||||
key 178 PAGE_DOWN
|
||||
key 179 NUMPAD_LEFT_PAREN
|
||||
key 180 NUMPAD_RIGHT_PAREN
|
||||
# key 181 "KEY_NEW"
|
||||
# key 182 "KEY_REDO"
|
||||
# key 183 F13
|
||||
# key 184 F14
|
||||
# key 185 F15
|
||||
# key 186 F16
|
||||
# key 187 F17
|
||||
# key 188 F18
|
||||
# key 189 F19
|
||||
# key 190 F20
|
||||
# key 191 F21
|
||||
# key 192 F22
|
||||
# key 193 F23
|
||||
# key 194 F24
|
||||
# key 195 (undefined)
|
||||
# key 196 (undefined)
|
||||
# key 197 (undefined)
|
||||
# key 198 (undefined)
|
||||
# key 199 (undefined)
|
||||
key 200 MEDIA_PLAY
|
||||
key 201 MEDIA_PAUSE
|
||||
# key 202 "KEY_PROG3"
|
||||
# key 203 "KEY_PROG4"
|
||||
key 204 NOTIFICATION
|
||||
# key 205 "KEY_SUSPEND"
|
||||
# key 206 "KEY_CLOSE"
|
||||
key 207 MEDIA_PLAY
|
||||
key 208 MEDIA_FAST_FORWARD
|
||||
# key 209 "KEY_BASSBOOST"
|
||||
# key 210 "KEY_PRINT"
|
||||
# key 211 "KEY_HP"
|
||||
key 212 CAMERA
|
||||
key 213 MUSIC
|
||||
# key 214 "KEY_QUESTION"
|
||||
key 215 ENVELOPE
|
||||
# key 216 "KEY_CHAT"
|
||||
key 217 ASSIST
|
||||
# key 218 "KEY_CONNECT"
|
||||
# key 219 "KEY_FINANCE"
|
||||
# key 220 "KEY_SPORT"
|
||||
# key 221 "KEY_SHOP"
|
||||
# key 222 "KEY_ALTERASE"
|
||||
# key 223 "KEY_CANCEL"
|
||||
key 224 BRIGHTNESS_DOWN
|
||||
key 225 BRIGHTNESS_UP
|
||||
key 226 HEADSETHOOK
|
||||
|
||||
key 256 BUTTON_1
|
||||
key 257 BUTTON_2
|
||||
key 258 BUTTON_3
|
||||
key 259 BUTTON_4
|
||||
key 260 BUTTON_5
|
||||
key 261 BUTTON_6
|
||||
key 262 BUTTON_7
|
||||
key 263 BUTTON_8
|
||||
key 264 BUTTON_9
|
||||
key 265 BUTTON_10
|
||||
key 266 BUTTON_11
|
||||
key 267 BUTTON_12
|
||||
key 268 BUTTON_13
|
||||
key 269 BUTTON_14
|
||||
key 270 BUTTON_15
|
||||
key 271 BUTTON_16
|
||||
|
||||
key 288 BUTTON_1
|
||||
key 289 BUTTON_2
|
||||
key 290 BUTTON_3
|
||||
key 291 BUTTON_4
|
||||
key 292 BUTTON_5
|
||||
key 293 BUTTON_6
|
||||
key 294 BUTTON_7
|
||||
key 295 BUTTON_8
|
||||
key 296 BUTTON_9
|
||||
key 297 BUTTON_10
|
||||
key 298 BUTTON_11
|
||||
key 299 BUTTON_12
|
||||
key 300 BUTTON_13
|
||||
key 301 BUTTON_14
|
||||
key 302 BUTTON_15
|
||||
key 303 BUTTON_16
|
||||
|
||||
|
||||
key 304 BUTTON_A
|
||||
key 305 BUTTON_B
|
||||
key 306 BUTTON_C
|
||||
key 307 BUTTON_X
|
||||
key 308 BUTTON_Y
|
||||
key 309 BUTTON_Z
|
||||
key 310 BUTTON_L1
|
||||
key 311 BUTTON_R1
|
||||
key 312 BUTTON_L2
|
||||
key 313 BUTTON_R2
|
||||
key 314 BUTTON_SELECT
|
||||
key 315 BUTTON_START
|
||||
key 316 BUTTON_MODE
|
||||
key 317 BUTTON_THUMBL
|
||||
key 318 BUTTON_THUMBR
|
||||
|
||||
|
||||
# key 352 "KEY_OK"
|
||||
key 353 DPAD_CENTER
|
||||
# key 354 "KEY_GOTO"
|
||||
# key 355 "KEY_CLEAR"
|
||||
# key 356 "KEY_POWER2"
|
||||
# key 357 "KEY_OPTION"
|
||||
# key 358 "KEY_INFO"
|
||||
# key 359 "KEY_TIME"
|
||||
# key 360 "KEY_VENDOR"
|
||||
# key 361 "KEY_ARCHIVE"
|
||||
key 362 GUIDE
|
||||
# key 363 "KEY_CHANNEL"
|
||||
# key 364 "KEY_FAVORITES"
|
||||
# key 365 "KEY_EPG"
|
||||
key 366 DVR
|
||||
# key 367 "KEY_MHP"
|
||||
# key 368 "KEY_LANGUAGE"
|
||||
# key 369 "KEY_TITLE"
|
||||
key 370 CAPTIONS
|
||||
# key 371 "KEY_ANGLE"
|
||||
# key 372 "KEY_ZOOM"
|
||||
# key 373 "KEY_MODE"
|
||||
# key 374 "KEY_KEYBOARD"
|
||||
# key 375 "KEY_SCREEN"
|
||||
# key 376 "KEY_PC"
|
||||
key 377 TV
|
||||
# key 378 "KEY_TV2"
|
||||
# key 379 "KEY_VCR"
|
||||
# key 380 "KEY_VCR2"
|
||||
# key 381 "KEY_SAT"
|
||||
# key 382 "KEY_SAT2"
|
||||
# key 383 "KEY_CD"
|
||||
# key 384 "KEY_TAPE"
|
||||
# key 385 "KEY_RADIO"
|
||||
# key 386 "KEY_TUNER"
|
||||
# key 387 "KEY_PLAYER"
|
||||
# key 388 "KEY_TEXT"
|
||||
# key 389 "KEY_DVD"
|
||||
# key 390 "KEY_AUX"
|
||||
# key 391 "KEY_MP3"
|
||||
# key 392 "KEY_AUDIO"
|
||||
# key 393 "KEY_VIDEO"
|
||||
# key 394 "KEY_DIRECTORY"
|
||||
# key 395 "KEY_LIST"
|
||||
# key 396 "KEY_MEMO"
|
||||
key 397 CALENDAR
|
||||
key 398 PROG_RED
|
||||
key 399 PROG_GREEN
|
||||
key 400 PROG_YELLOW
|
||||
key 401 PROG_BLUE
|
||||
key 402 CHANNEL_UP
|
||||
key 403 CHANNEL_DOWN
|
||||
# key 404 "KEY_FIRST"
|
||||
key 405 LAST_CHANNEL
|
||||
# key 406 "KEY_AB"
|
||||
# key 407 "KEY_NEXT"
|
||||
# key 408 "KEY_RESTART"
|
||||
# key 409 "KEY_SLOW"
|
||||
# key 410 "KEY_SHUFFLE"
|
||||
# key 411 "KEY_BREAK"
|
||||
# key 412 "KEY_PREVIOUS"
|
||||
# key 413 "KEY_DIGITS"
|
||||
# key 414 "KEY_TEEN"
|
||||
# key 415 "KEY_TWEN"
|
||||
|
||||
key 429 CONTACTS
|
||||
|
||||
# key 448 "KEY_DEL_EOL"
|
||||
# key 449 "KEY_DEL_EOS"
|
||||
# key 450 "KEY_INS_LINE"
|
||||
# key 451 "KEY_DEL_LINE"
|
||||
|
||||
|
||||
key 464 FUNCTION
|
||||
key 465 ESCAPE FUNCTION
|
||||
key 466 F1 FUNCTION
|
||||
key 467 F2 FUNCTION
|
||||
key 468 F3 FUNCTION
|
||||
key 469 F4 FUNCTION
|
||||
key 470 F5 FUNCTION
|
||||
key 471 F6 FUNCTION
|
||||
key 472 F7 FUNCTION
|
||||
key 473 F8 FUNCTION
|
||||
key 474 F9 FUNCTION
|
||||
key 475 F10 FUNCTION
|
||||
key 476 F11 FUNCTION
|
||||
key 477 F12 FUNCTION
|
||||
key 478 1 FUNCTION
|
||||
key 479 2 FUNCTION
|
||||
key 480 D FUNCTION
|
||||
key 481 E FUNCTION
|
||||
key 482 F FUNCTION
|
||||
key 483 S FUNCTION
|
||||
key 484 B FUNCTION
|
||||
|
||||
|
||||
# key 497 KEY_BRL_DOT1
|
||||
# key 498 KEY_BRL_DOT2
|
||||
# key 499 KEY_BRL_DOT3
|
||||
# key 500 KEY_BRL_DOT4
|
||||
# key 501 KEY_BRL_DOT5
|
||||
# key 502 KEY_BRL_DOT6
|
||||
# key 503 KEY_BRL_DOT7
|
||||
# key 504 KEY_BRL_DOT8
|
||||
|
||||
key 522 STAR
|
||||
key 523 POUND
|
||||
key 580 APP_SWITCH
|
||||
key 582 VOICE_ASSIST
|
||||
|
||||
# CEC
|
||||
key 352 ENTER
|
||||
key 618 HOME
|
||||
key 141 POWER
|
||||
key 174 BACK
|
||||
|
||||
# Keys defined by HID usages
|
||||
key usage 0x0c0067 WINDOW
|
||||
key usage 0x0c006F BRIGHTNESS_UP
|
||||
key usage 0x0c0070 BRIGHTNESS_DOWN
|
||||
key usage 0x0c0173 MEDIA_AUDIO_TRACK
|
||||
|
||||
# Joystick and game controller axes.
|
||||
# Axes that are not mapped will be assigned generic axis numbers by the input subsystem.
|
||||
axis 0x00 X
|
||||
axis 0x01 Y
|
||||
axis 0x02 Z
|
||||
axis 0x03 RX
|
||||
axis 0x04 RY
|
||||
axis 0x05 RZ
|
||||
axis 0x06 THROTTLE
|
||||
axis 0x07 RUDDER
|
||||
axis 0x08 WHEEL
|
||||
axis 0x09 GAS
|
||||
axis 0x0a BRAKE
|
||||
axis 0x10 HAT_X
|
||||
axis 0x11 HAT_Y
|
||||
|
||||
# LEDs
|
||||
led 0x00 NUM_LOCK
|
||||
led 0x01 CAPS_LOCK
|
||||
led 0x02 SCROLL_LOCK
|
||||
led 0x03 COMPOSE
|
||||
led 0x04 KANA
|
||||
led 0x05 SLEEP
|
||||
led 0x06 SUSPEND
|
||||
led 0x07 MUTE
|
||||
led 0x08 MISC
|
||||
led 0x09 MAIL
|
||||
led 0x0a CHARGING
|
||||
|
||||
# SENSORs
|
||||
sensor 0x00 ACCELEROMETER X
|
||||
sensor 0x01 ACCELEROMETER Y
|
||||
sensor 0x02 ACCELEROMETER Z
|
||||
sensor 0x03 GYROSCOPE X
|
||||
sensor 0x04 GYROSCOPE Y
|
||||
sensor 0x05 GYROSCOPE Z
|
@@ -171,7 +171,7 @@ key 143 WAKEUP
|
||||
# key 149 "KEY_PROG2"
|
||||
key 150 EXPLORER
|
||||
# key 151 "KEY_MSDOS"
|
||||
key 152 POWER
|
||||
key 152 LOCK
|
||||
# key 153 "KEY_DIRECTION"
|
||||
# key 154 "KEY_CYCLEWINDOWS"
|
||||
key 155 ENVELOPE
|
||||
@@ -200,20 +200,20 @@ key 177 PAGE_UP
|
||||
key 178 PAGE_DOWN
|
||||
key 179 NUMPAD_LEFT_PAREN
|
||||
key 180 NUMPAD_RIGHT_PAREN
|
||||
# key 181 "KEY_NEW"
|
||||
key 181 NEW
|
||||
# key 182 "KEY_REDO"
|
||||
# key 183 F13
|
||||
# key 184 F14
|
||||
# key 185 F15
|
||||
# key 186 F16
|
||||
# key 187 F17
|
||||
# key 188 F18
|
||||
# key 189 F19
|
||||
# key 190 F20
|
||||
# key 191 F21
|
||||
# key 192 F22
|
||||
# key 193 F23
|
||||
# key 194 F24
|
||||
key 183 F13
|
||||
key 184 F14
|
||||
key 185 F15
|
||||
key 186 F16
|
||||
key 187 F17
|
||||
key 188 F18
|
||||
key 189 F19
|
||||
key 190 F20
|
||||
key 191 F21
|
||||
key 192 F22
|
||||
key 193 F23
|
||||
key 194 F24
|
||||
# key 195 (undefined)
|
||||
# key 196 (undefined)
|
||||
# key 197 (undefined)
|
||||
@@ -225,11 +225,11 @@ key 201 MEDIA_PAUSE
|
||||
# key 203 "KEY_PROG4"
|
||||
key 204 NOTIFICATION
|
||||
# key 205 "KEY_SUSPEND"
|
||||
# key 206 "KEY_CLOSE"
|
||||
key 206 CLOSE
|
||||
key 207 MEDIA_PLAY
|
||||
key 208 MEDIA_FAST_FORWARD
|
||||
# key 209 "KEY_BASSBOOST"
|
||||
# key 210 "KEY_PRINT"
|
||||
key 210 PRINT
|
||||
# key 211 "KEY_HP"
|
||||
key 212 CAMERA
|
||||
key 213 MUSIC
|
||||
@@ -328,7 +328,7 @@ key 368 LANGUAGE_SWITCH
|
||||
# key 369 "KEY_TITLE"
|
||||
key 370 CAPTIONS
|
||||
# key 371 "KEY_ANGLE"
|
||||
# key 372 "KEY_ZOOM"
|
||||
key 372 FULLSCREEN
|
||||
# key 373 "KEY_MODE"
|
||||
# key 374 "KEY_KEYBOARD"
|
||||
# key 375 "KEY_SCREEN"
|
||||
@@ -425,6 +425,7 @@ key 582 VOICE_ASSIST
|
||||
# Linux KEY_ASSISTANT
|
||||
key 583 ASSIST
|
||||
key 585 EMOJI_PICKER
|
||||
key 586 DICTATE
|
||||
key 656 MACRO_1
|
||||
key 657 MACRO_2
|
||||
key 658 MACRO_3
|
||||
@@ -437,6 +438,8 @@ key 141 POWER
|
||||
key 174 BACK
|
||||
|
||||
# Keys defined by HID usages
|
||||
key usage 0x010082 LOCK FALLBACK_USAGE_MAPPING
|
||||
key usage 0x01009B DO_NOT_DISTURB FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0065 SCREENSHOT FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0067 WINDOW FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c006F BRIGHTNESS_UP FALLBACK_USAGE_MAPPING
|
||||
@@ -444,12 +447,17 @@ key usage 0x0c0070 BRIGHTNESS_DOWN FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0079 KEYBOARD_BACKLIGHT_UP FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c007A KEYBOARD_BACKLIGHT_DOWN FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c007C KEYBOARD_BACKLIGHT_TOGGLE FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c00D8 DICTATE FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c00D9 EMOJI_PICKER FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0173 MEDIA_AUDIO_TRACK FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c019C PROFILE_SWITCH FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c019F SETTINGS FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c01A2 ALL_APPS FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0201 NEW FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0203 CLOSE FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0208 PRINT FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0227 REFRESH FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c0232 FULLSCREEN FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c029D LANGUAGE_SWITCH FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c029F RECENT_APPS FALLBACK_USAGE_MAPPING
|
||||
key usage 0x0c02A2 ALL_APPS FALLBACK_USAGE_MAPPING
|
||||
|
@@ -7,15 +7,43 @@ cc_binary {
|
||||
name: "android.hardware.light-service.rpi",
|
||||
relative_install_path: "hw",
|
||||
vendor: true,
|
||||
init_rc: ["android.hardware.light-service.rpi.rc"],
|
||||
vintf_fragments: ["android.hardware.light-service.rpi.xml"],
|
||||
srcs: [
|
||||
"Lights.cpp",
|
||||
"main.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.light-V2-ndk",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"android.hardware.light-V2-ndk",
|
||||
],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.light-service.rpi.rc",
|
||||
src: "android.hardware.light-service.rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.light-service.rpi.xml",
|
||||
src: "android.hardware.light-service.rpi.xml",
|
||||
sub_dir: "vintf",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.light.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["android.hardware.light-service.rpi"],
|
||||
prebuilts: [
|
||||
"android.hardware.light-service.rpi.rc",
|
||||
"android.hardware.light-service.rpi.xml",
|
||||
],
|
||||
}
|
||||
|
@@ -15,9 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.light-service.rpi"
|
||||
|
||||
#include "Lights.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/logging.h>
|
||||
|
||||
using ::android::base::ReadFileToString;
|
||||
using ::android::base::WriteStringToFile;
|
||||
@@ -26,8 +29,13 @@ namespace aidl::android::hardware::light {
|
||||
|
||||
static const uint32_t defaultMaxBrightness = 255;
|
||||
|
||||
static const std::string backlightBrightnessPath = "/sys/class/backlight/11-0045/brightness";
|
||||
static const std::string backlightMaxBrightnessPath = "/sys/class/backlight/11-0045/max_brightness";
|
||||
static const std::string backlightBasePath = "/sys/class/backlight/";
|
||||
|
||||
static const std::string backlightPaths[] = {
|
||||
"10-0045",
|
||||
"11-0045",
|
||||
"rpi_backlight",
|
||||
};
|
||||
|
||||
static const std::vector<HwLight> availableLights = {
|
||||
{.id = (int)LightType::BACKLIGHT, .type = LightType::BACKLIGHT, .ordinal = 0}
|
||||
@@ -36,10 +44,15 @@ static const std::vector<HwLight> availableLights = {
|
||||
Lights::Lights() {
|
||||
maxBrightness = defaultMaxBrightness;
|
||||
|
||||
if (!access(backlightMaxBrightnessPath.c_str(), R_OK)) {
|
||||
std::string maxBrightnessValue;
|
||||
if (ReadFileToString(backlightMaxBrightnessPath, &maxBrightnessValue)) {
|
||||
maxBrightness = std::stoi(maxBrightnessValue);
|
||||
for (auto &path : backlightPaths) {
|
||||
std::string backlightMaxBrightnessPath = backlightBasePath + path + "/max_brightness";
|
||||
if (!access(backlightMaxBrightnessPath.c_str(), R_OK)) {
|
||||
std::string maxBrightnessValue;
|
||||
if (ReadFileToString(backlightMaxBrightnessPath, &maxBrightnessValue)) {
|
||||
maxBrightness = std::stoi(maxBrightnessValue);
|
||||
LOG(INFO) << backlightMaxBrightnessPath << " = " << maxBrightnessValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,8 +63,12 @@ ndk::ScopedAStatus Lights::setLightState(int id, const HwLightState& state) {
|
||||
|
||||
switch (light.type) {
|
||||
case LightType::BACKLIGHT:
|
||||
if (!access(backlightBrightnessPath.c_str(), W_OK)) {
|
||||
WriteStringToFile(brightness, backlightBrightnessPath);
|
||||
for (auto &path : backlightPaths) {
|
||||
std::string backlightBrightnessPath = backlightBasePath + path + "/brightness";
|
||||
if (!access(backlightBrightnessPath.c_str(), W_OK)) {
|
||||
WriteStringToFile(brightness, backlightBrightnessPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@@ -1,10 +1,18 @@
|
||||
on early-boot
|
||||
chown system system /sys/class/backlight/10-0045/brightness
|
||||
chown system system /sys/class/backlight/10-0045/max_brightness
|
||||
chown system system /sys/class/backlight/11-0045/brightness
|
||||
chown system system /sys/class/backlight/11-0045/max_brightness
|
||||
chown system system /sys/class/backlight/rpi_backlight/brightness
|
||||
chown system system /sys/class/backlight/rpi_backlight/max_brightness
|
||||
chmod 660 /sys/class/backlight/10-0045/brightness
|
||||
chmod 440 /sys/class/backlight/10-0045/max_brightness
|
||||
chmod 660 /sys/class/backlight/11-0045/brightness
|
||||
chmod 440 /sys/class/backlight/11-0045/max_brightness
|
||||
chmod 660 /sys/class/backlight/rpi_backlight/brightness
|
||||
chmod 440 /sys/class/backlight/rpi_backlight/max_brightness
|
||||
|
||||
service vendor.light-default /vendor/bin/hw/android.hardware.light-service.rpi
|
||||
service vendor.light-rpi /apex/com.android.hardware.light.rpi5/bin/hw/android.hardware.light-service.rpi
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
|
3
light/apex_file_contexts
Normal file
3
light/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/hw/android\.hardware\.light-service\.rpi u:object_r:hal_light_default_exec:s0
|
4
light/apex_manifest.json
Normal file
4
light/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.light.rpi5",
|
||||
"version": 1
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2025 KonstaKANG
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,5 +32,5 @@ int main() {
|
||||
CHECK(status == STATUS_OK);
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return EXIT_FAILURE; // should not reached
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
||||
|
10
manifest.xml
10
manifest.xml
@@ -23,15 +23,7 @@
|
||||
<interface>
|
||||
<name>ICameraProvider</name>
|
||||
<instance>external/0</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.camera.provider</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.5</version>
|
||||
<interface>
|
||||
<name>ICameraProvider</name>
|
||||
<instance>legacy/0</instance>
|
||||
<instance>libcamera/0</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
108
media/media_codecs_ffmpeg_c2.xml
Normal file
108
media/media_codecs_ffmpeg_c2.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2022 Michael Goffioul <michael.goffioul@gmail.com>
|
||||
Copyright (C) 2025 KonstaKANG
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<MediaCodecs>
|
||||
<Decoders>
|
||||
<!-- Audio codecs -->
|
||||
<MediaCodec name="c2.ffmpeg.aac.decoder" type="audio/mp4a-latm">
|
||||
<Alias name="OMX.ffmpeg.aac.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.ac3.decoder" type="audio/ac3">
|
||||
<Alias name="OMX.ffmpeg.ac3.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.alac.decoder" type="audio/alac">
|
||||
<Alias name="OMX.ffmpeg.alac.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.flac.decoder" type="audio/flac">
|
||||
<Alias name="OMX.ffmpeg.flac.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.mp2.decoder" type="audio/mpeg-L2">
|
||||
<Alias name="OMX.ffmpeg.mp2.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.mp3.decoder" type="audio/mpeg">
|
||||
<Alias name="OMX.ffmpeg.mp3.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.vorbis.decoder" type="audio/vorbis">
|
||||
<Alias name="OMX.ffmpeg.vorbisac3.decoder" />
|
||||
<Limit name="channel-count" max="8" />
|
||||
<Limit name="sample-rate" ranges="8000-192000" />
|
||||
</MediaCodec>
|
||||
|
||||
<!-- Video codecs -->
|
||||
<MediaCodec name="c2.ffmpeg.av1.decoder" type="video/av01">
|
||||
<Alias name="OMX.ffmpeg.av1.decoder" />
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.h263.decoder" type="video/3gpp">
|
||||
<Alias name="OMX.ffmpeg.h263.decoder" />
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.h264.decoder" type="video/avc">
|
||||
<Alias name="OMX.ffmpeg.h264.decoder" />
|
||||
<Limit name="size" min="2x2" max="4080x4080" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.hevc.decoder" type="video/hevc">
|
||||
<Alias name="OMX.ffmpeg.hevc.decoder" />
|
||||
<Limit name="size" min="2x2" max="4096x4096" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.mpeg2.decoder" type="video/mpeg2">
|
||||
<Alias name="OMX.ffmpeg.mpeg2.decoder" />
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.mpeg4.decoder" type="video/mp4v-es">
|
||||
<Alias name="OMX.ffmpeg.mpeg4.decoder" />
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.vp8.decoder" type="video/x-vnd.on2.vp8">
|
||||
<Alias name="OMX.ffmpeg.vp8.decoder" />
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.ffmpeg.vp9.decoder" type="video/x-vnd.on2.vp9">
|
||||
<Alias name="OMX.ffmpeg.vp9.decoder" />
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
</Decoders>
|
||||
</MediaCodecs>
|
9
mkimg.sh
9
mkimg.sh
@@ -21,15 +21,15 @@ fi
|
||||
|
||||
for PARTITION in "boot" "system" "vendor"; do
|
||||
if [ ! -f ${ANDROID_PRODUCT_OUT}/${PARTITION}.img ]; then
|
||||
exit_with_error "Partition image not found. Run make first."
|
||||
exit_with_error "Partition image not found. Run 'make ${PARTITION}image' first."
|
||||
fi
|
||||
done
|
||||
|
||||
VERSION=RaspberryVanillaAOSP15
|
||||
VERSION=RaspberryVanillaAOSP16
|
||||
DATE=$(date +%Y%m%d)
|
||||
TARGET=$(echo ${TARGET_PRODUCT} | sed 's/^aosp_//')
|
||||
IMGNAME=${VERSION}-${DATE}-${TARGET}.img
|
||||
IMGSIZE=14848MiB
|
||||
IMGSIZE=15360000000
|
||||
|
||||
if [ -f ${ANDROID_PRODUCT_OUT}/${IMGNAME} ]; then
|
||||
exit_with_error "${ANDROID_PRODUCT_OUT}/${IMGNAME} already exists!"
|
||||
@@ -51,7 +51,7 @@ echo n
|
||||
echo p
|
||||
echo 2
|
||||
echo
|
||||
echo +2048M
|
||||
echo +2560M
|
||||
echo n
|
||||
echo p
|
||||
echo 3
|
||||
@@ -88,6 +88,7 @@ sudo mkfs.ext4 /dev/mapper/${LOOPDEV}p4 -I 512 -L userdata
|
||||
sync
|
||||
|
||||
sudo kpartx -d "/dev/${LOOPDEV}"
|
||||
sudo losetup -d "/dev/${LOOPDEV}"
|
||||
sudo chown ${USER}:${USER} ${ANDROID_PRODUCT_OUT}/${IMGNAME}
|
||||
|
||||
echo "Done, created ${ANDROID_PRODUCT_OUT}/${IMGNAME}!"
|
||||
|
@@ -18,8 +18,8 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Disable screen dimming by default -->
|
||||
<bool name="def_dim_screen">false</bool>
|
||||
<!-- Default for Settings.Global.DEVICE_NAME $1=MODEL -->
|
||||
<string name="def_device_name_simple">Raspberry Pi 5</string>
|
||||
|
||||
<!-- Default screen brightness -->
|
||||
<integer name="def_screen_brightness">128</integer>
|
||||
|
@@ -18,8 +18,8 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Disable screen dimming by default -->
|
||||
<bool name="def_dim_screen">false</bool>
|
||||
<!-- Default for Settings.Global.DEVICE_NAME $1=MODEL -->
|
||||
<string name="def_device_name_simple">Raspberry Pi 5</string>
|
||||
|
||||
<!-- Default screen brightness -->
|
||||
<integer name="def_screen_brightness">128</integer>
|
||||
|
@@ -24,4 +24,16 @@
|
||||
is no longer indicative, and a separate config now exists for each band -->
|
||||
<bool translatable="false" name ="config_wifi5ghzSupport">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether the wifi chipset supports background scanning mechanism.
|
||||
This mechanism allows the host to remain in suspend state and the dongle to actively
|
||||
scan and wake the host when a configured SSID is detected by the dongle. This chipset
|
||||
capability can provide power savings when wifi needs to be always kept on. -->
|
||||
<bool translatable="false" name="config_wifi_background_scan_support">true</bool>
|
||||
|
||||
<!-- Wifi driver supports IEEE80211AC for softap -->
|
||||
<bool translatable="false" name="config_wifi_softap_ieee80211ac_supported">true</bool>
|
||||
|
||||
<!-- Do not translate. Default access point SSID used for tethering -->
|
||||
<string name="wifi_tether_configure_ssid_default" translatable="false">Raspberry Pi 5</string>
|
||||
|
||||
</resources>
|
||||
|
1
product_manifest.xml
Normal file
1
product_manifest.xml
Normal file
@@ -0,0 +1 @@
|
||||
<manifest version="1.0" type="framework" />
|
@@ -5,18 +5,3 @@ on init
|
||||
|
||||
on fs
|
||||
mount_all /vendor/etc/fstab.rpi5
|
||||
|
||||
on post-fs-data
|
||||
# Create the directories used by the Wireless subsystem
|
||||
mkdir /data/vendor/wifi 0770 wifi wifi
|
||||
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
|
||||
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
|
||||
|
||||
on property:sys.boot_completed=1
|
||||
# Reinit lmkd to reconfigure lmkd properties
|
||||
setprop lmkd.reinit 1
|
||||
|
||||
service suspend_blocker_rpi /vendor/bin/suspend_blocker_rpi
|
||||
class early_hal # Start together with system_suspend HAL
|
||||
group system
|
||||
user root
|
||||
|
@@ -14,11 +14,8 @@
|
||||
/dev/dma_heap/linux,cma 0666 system graphics
|
||||
|
||||
# FFmpeg
|
||||
/dev/media2 0660 media media
|
||||
/dev/media0 0660 media media
|
||||
/dev/video19 0660 media media
|
||||
|
||||
# ION
|
||||
/dev/ion 0664 system system
|
||||
|
||||
# USB
|
||||
/sys/class/udc/1000480000.usb current_speed 0664 system system
|
||||
|
57
seccomp_policy/android.hardware.media.c2-ffmpeg.policy
Normal file
57
seccomp_policy/android.hardware.media.c2-ffmpeg.policy
Normal file
@@ -0,0 +1,57 @@
|
||||
# device specific syscalls
|
||||
clock_gettime: 1
|
||||
clone: 1
|
||||
close: 1
|
||||
dup: 1
|
||||
eventfd2: 1
|
||||
exit_group: 1
|
||||
exit: 1
|
||||
faccessat: 1
|
||||
fstat: 1
|
||||
fstatfs: 1
|
||||
ftruncate: 1
|
||||
futex: 1
|
||||
getdents64: 1
|
||||
getegid: 1
|
||||
geteuid: 1
|
||||
getgid: 1
|
||||
getgroups: 1
|
||||
getpid: 1
|
||||
getrandom: 1
|
||||
getrlimit: 1
|
||||
gettid: 1
|
||||
gettimeofday: 1
|
||||
getuid: 1
|
||||
ioctl: 1
|
||||
lseek: 1
|
||||
madvise: 1
|
||||
memfd_create: 1
|
||||
mmap: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
|
||||
mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
|
||||
mremap: arg3 == 3 || arg3 == MREMAP_MAYMOVE
|
||||
munmap: 1
|
||||
nanosleep: 1
|
||||
newfstatat: 1
|
||||
openat: 1
|
||||
pipe2: 1
|
||||
ppoll: 1
|
||||
prctl: 1
|
||||
pread64: 1
|
||||
process_vm_readv: 1
|
||||
read: 1
|
||||
readlinkat: 1
|
||||
recvmsg: 1
|
||||
restart_syscall: 1
|
||||
rt_sigaction: 1
|
||||
rt_sigprocmask: 1
|
||||
rt_sigreturn: 1
|
||||
rt_tgsigqueueinfo: 1
|
||||
sched_getaffinity: 1
|
||||
sched_yield: 1
|
||||
set_tid_address: 1
|
||||
setpriority: 1
|
||||
sigaltstack: 1
|
||||
sysinfo: 1
|
||||
tgkill: 1
|
||||
write: 1
|
||||
writev: 1
|
2
sepolicy/file.te
Normal file
2
sepolicy/file.te
Normal file
@@ -0,0 +1,2 @@
|
||||
type mediadrm_vendor_data_file, file_type, data_file_type;
|
||||
type sysfs_hdmi, fs_type, sysfs_type;
|
@@ -1,56 +1,29 @@
|
||||
# Bluetooth
|
||||
/sys/class/rfkill/rfkill[0-9]/state u:object_r:sysfs_bluetooth_writable:s0
|
||||
/vendor/bin/hw/android\.hardware\.bluetooth-service\.rpi u:object_r:hal_bluetooth_default_exec:s0
|
||||
# Camera
|
||||
/vendor/bin/hw/android\.hardware\.camera\.provider-V1-libcamera-service u:object_r:hal_camera_default_exec:s0
|
||||
|
||||
# CEC
|
||||
/dev/cec0 u:object_r:cec_device:s0
|
||||
/dev/cec1 u:object_r:cec_device:s0
|
||||
/vendor/bin/hw/android\.hardware\.tv\.cec@1\.0-service\.rpi u:object_r:hal_tv_cec_default_exec:s0
|
||||
/dev/cec0 u:object_r:cec_device:s0
|
||||
/dev/cec1 u:object_r:cec_device:s0
|
||||
|
||||
# DRM
|
||||
/vendor/bin/hw/android\.hardware\.drm-service\.clearkey u:object_r:hal_drm_clearkey_exec:s0
|
||||
/vendor/bin/hw/android\.hardware\.drm-service\.widevine(.*)? u:object_r:hal_drm_widevine_exec:s0
|
||||
|
||||
# FFmpeg
|
||||
/vendor/bin/hw/android\.hardware\.media\.c2@1\.2-service-ffmpeg u:object_r:mediacodec_exec:s0
|
||||
|
||||
# Gatekeeper
|
||||
/vendor/bin/hw/android\.hardware\.gatekeeper@1\.0-service\.software u:object_r:hal_gatekeeper_default_exec:s0
|
||||
/data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0
|
||||
|
||||
# Graphics
|
||||
/dev/dri u:object_r:gpu_device:s0
|
||||
/dev/dri/card0 u:object_r:gpu_device:s0
|
||||
/dev/dri/card1 u:object_r:gpu_device:s0
|
||||
/dev/dri/renderD128 u:object_r:gpu_device:s0
|
||||
/vendor/bin/hw/android\.hardware\.composer\.hwc3-service\.drm u:object_r:hal_graphics_composer_default_exec:s0
|
||||
/vendor/bin/hw/android\.hardware\.graphics\.allocator-service\.minigbm_gbm_mesa u:object_r:hal_graphics_allocator_default_exec:s0
|
||||
/vendor/lib(64)?/hw/mapper\.minigbm_gbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/hw/vulkan\.broadcom\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/dri_gbm\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/libdrm\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/libgallium_dri\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/libgbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib{64}?/libgbm_mesa_wrapper\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/libglapi\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/libminigbm_gralloc_gbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib(64)?/libminigbm_gralloc4_utils_gbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
|
||||
# Health
|
||||
/vendor/bin/hw/android\.hardware\.health-service\.rpi u:object_r:hal_health_default_exec:s0
|
||||
|
||||
# Lights
|
||||
/sys/class/backlight/11-0045/brightness u:object_r:sysfs_leds:s0
|
||||
/sys/class/backlight/11-0045/max_brightness u:object_r:sysfs_leds:s0
|
||||
/vendor/bin/hw/android\.hardware\.light-service\.rpi u:object_r:hal_light_default_exec:s0
|
||||
/dev/dri(/.*)? u:object_r:gpu_device:s0
|
||||
/vendor/bin/hw/android\.hardware\.graphics\.allocator-service\.minigbm_gbm_mesa u:object_r:hal_graphics_allocator_default_exec:s0
|
||||
/vendor/lib64/hw/mapper\.minigbm_gbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/hw/vulkan\.broadcom\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/dri_gbm\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libdrm\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libgallium_dri\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libgbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libgbm_mesa_wrapper\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libminigbm_gralloc_gbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libminigbm_gralloc4_utils_gbm_mesa\.so u:object_r:same_process_hal_file:s0
|
||||
/vendor/lib64/libui\.so u:object_r:same_process_hal_file:s0
|
||||
|
||||
# Partitions
|
||||
/dev/block/mmcblk0p1 u:object_r:boot_block_device:s0
|
||||
/dev/block/mmcblk0p2 u:object_r:system_block_device:s0
|
||||
/dev/block/mmcblk0p3 u:object_r:system_block_device:s0
|
||||
/dev/block/mmcblk0p4 u:object_r:userdata_block_device:s0
|
||||
|
||||
# Suspend
|
||||
/vendor/bin/suspend_blocker_rpi u:object_r:suspend_blocker_exec:s0
|
||||
|
||||
# USB
|
||||
/vendor/bin/hw/android\.hardware\.usb\.gadget-service\.rpi u:object_r:hal_usb_gadget_default_exec:s0
|
||||
/dev/block/mmcblk0p1 u:object_r:boot_block_device:s0
|
||||
/dev/block/mmcblk0p2 u:object_r:system_block_device:s0
|
||||
/dev/block/mmcblk0p3 u:object_r:system_block_device:s0
|
||||
/dev/block/mmcblk0p4 u:object_r:userdata_block_device:s0
|
||||
|
@@ -1,3 +1,22 @@
|
||||
genfscon sysfs /devices/platform/v3dbus/fec00000.v3d/uevent u:object_r:sysfs_gpu:s0
|
||||
genfscon sysfs /devices/platform/gpu/uevent u:object_r:sysfs_gpu:s0
|
||||
genfscon sysfs /firmware/devicetree/base/serial-number u:object_r:sysfs_dt_firmware_android:s0
|
||||
# CEC
|
||||
genfscon sysfs /devices/platform/axi/axi:gpu/drm/card1/card1-HDMI-A-1/status u:object_r:sysfs_hdmi:s0
|
||||
genfscon sysfs /devices/platform/axi/axi:gpu/drm/card1/card1-HDMI-A-2/status u:object_r:sysfs_hdmi:s0
|
||||
|
||||
# Graphics
|
||||
genfscon sysfs /devices/platform/axi/1002000000.v3d u:object_r:sysfs_gpu:s0
|
||||
genfscon sysfs /devices/platform/axi/axi:gpu u:object_r:sysfs_gpu:s0
|
||||
|
||||
# Lights
|
||||
genfscon sysfs /class/backlight/10-0045/brightness u:object_r:sysfs_leds:s0
|
||||
genfscon sysfs /class/backlight/10-0045/max_brightness u:object_r:sysfs_leds:s0
|
||||
genfscon sysfs /class/backlight/11-0045/brightness u:object_r:sysfs_leds:s0
|
||||
genfscon sysfs /class/backlight/11-0045/max_brightness u:object_r:sysfs_leds:s0
|
||||
genfscon sysfs /class/backlight/rpi_backlight/brightness u:object_r:sysfs_leds:s0
|
||||
genfscon sysfs /class/backlight/rpi_backlight/max_brightness u:object_r:sysfs_leds:s0
|
||||
|
||||
# Serial number
|
||||
genfscon sysfs /firmware/devicetree/base/serial-number u:object_r:sysfs_dt_firmware_android:s0
|
||||
|
||||
# Suspend
|
||||
genfscon sysfs /devices/platform/soc/soc:rpi_rtc/rtc/rtc0/alarmtimer.0.auto/wakeup/wakeup1 u:object_r:sysfs_wakeup:s0
|
||||
genfscon sysfs /devices/platform/soc/soc:rpi_rtc/wakeup/wakeup0 u:object_r:sysfs_wakeup:s0
|
||||
|
1
sepolicy/hal_audio_default.te
Normal file
1
sepolicy/hal_audio_default.te
Normal file
@@ -0,0 +1 @@
|
||||
get_prop(hal_audio_default, vendor_audio_config_prop)
|
@@ -8,7 +8,5 @@ allow cameraserver device:dir r_dir_perms;
|
||||
allow cameraserver video_device:dir r_dir_perms;
|
||||
allow cameraserver video_device:chr_file rw_file_perms;
|
||||
|
||||
allow hal_camera_default gpu_device:dir { open read search };
|
||||
allow hal_camera_default gpu_device:chr_file { open read write ioctl map getattr };
|
||||
allow cameraserver gpu_device:dir { open read write search getattr };
|
||||
allow cameraserver gpu_device:chr_file { open read write ioctl map getattr };
|
||||
gpu_access(hal_camera_default)
|
||||
gpu_access(cameraserver)
|
||||
|
@@ -1,10 +1,5 @@
|
||||
type hal_drm_clearkey, domain;
|
||||
type hal_drm_clearkey_exec, exec_type, vendor_file_type, file_type;
|
||||
|
||||
type hal_drm_clearkey_exec, vendor_file_type, exec_type, file_type;
|
||||
init_daemon_domain(hal_drm_clearkey)
|
||||
|
||||
hal_server_domain(hal_drm_clearkey, hal_drm)
|
||||
|
||||
vndbinder_use(hal_drm_clearkey);
|
||||
|
||||
allow hal_drm_clearkey hal_allocator_server:fd use;
|
||||
|
@@ -1,13 +1,8 @@
|
||||
type hal_drm_widevine, domain;
|
||||
type hal_drm_widevine_exec, exec_type, vendor_file_type, file_type;
|
||||
|
||||
type hal_drm_widevine_exec, vendor_file_type, exec_type, file_type;
|
||||
init_daemon_domain(hal_drm_widevine)
|
||||
|
||||
hal_server_domain(hal_drm_widevine, hal_drm)
|
||||
|
||||
vndbinder_use(hal_drm_widevine);
|
||||
|
||||
allow hal_drm_widevine hal_allocator_server:fd use;
|
||||
allow hal_drm mediacodec:fd use;
|
||||
|
||||
hal_client_domain(hal_drm_widevine, hal_graphics_composer);
|
||||
allow hal_drm_widevine mediadrm_vendor_data_file:file create_file_perms;
|
||||
allow hal_drm_widevine mediadrm_vendor_data_file:dir create_dir_perms;
|
||||
|
1
sepolicy/hal_keymint_default.te
Normal file
1
sepolicy/hal_keymint_default.te
Normal file
@@ -0,0 +1 @@
|
||||
get_prop(hal_keymint_default, serialno_prop)
|
@@ -1 +0,0 @@
|
||||
allow hal_tv_cec_default cec_device:chr_file rw_file_perms;
|
2
sepolicy/hal_tv_hdmi_cec_default.te
Normal file
2
sepolicy/hal_tv_hdmi_cec_default.te
Normal file
@@ -0,0 +1,2 @@
|
||||
allow hal_tv_hdmi_cec_default cec_device:chr_file rw_file_perms;
|
||||
get_prop(hal_tv_hdmi_cec_default, vendor_hdmi_config_prop)
|
1
sepolicy/hal_tv_hdmi_connection_default.te
Normal file
1
sepolicy/hal_tv_hdmi_connection_default.te
Normal file
@@ -0,0 +1 @@
|
||||
allow hal_tv_hdmi_connection_default sysfs_hdmi:file r_file_perms;
|
1
sepolicy/keystore.te
Normal file
1
sepolicy/keystore.te
Normal file
@@ -0,0 +1 @@
|
||||
hal_client_domain(keystore, hal_gatekeeper)
|
@@ -1 +1,2 @@
|
||||
gpu_access(mediacodec)
|
||||
get_prop(mediacodec, vendor_ffmpeg_config_prop)
|
||||
|
@@ -1 +0,0 @@
|
||||
gpu_access(surfaceflinger)
|
@@ -1,2 +1 @@
|
||||
gpu_access(mediaswcodec)
|
||||
allow mediaswcodec gpu_device:chr_file { getattr ioctl map open read write };
|
||||
|
3
sepolicy/property.te
Normal file
3
sepolicy/property.te
Normal file
@@ -0,0 +1,3 @@
|
||||
vendor_internal_prop(vendor_audio_config_prop)
|
||||
vendor_internal_prop(vendor_ffmpeg_config_prop)
|
||||
vendor_internal_prop(vendor_hdmi_config_prop)
|
14
sepolicy/property_contexts
Normal file
14
sepolicy/property_contexts
Normal file
@@ -0,0 +1,14 @@
|
||||
# Audio
|
||||
persist.vendor.audio.device u:object_r:vendor_audio_config_prop:s0
|
||||
persist.vendor.audio.hdmi.device u:object_r:vendor_audio_config_prop:s0
|
||||
persist.vendor.audio.pcm.card.auto u:object_r:vendor_audio_config_prop:s0
|
||||
persist.vendor.audio.pcm.card u:object_r:vendor_audio_config_prop:s0
|
||||
persist.vendor.audio.pcm.device u:object_r:vendor_audio_config_prop:s0
|
||||
|
||||
# CEC
|
||||
persist.vendor.hdmi.cec_device u:object_r:vendor_hdmi_config_prop:s0
|
||||
|
||||
# FFmpeg
|
||||
persist.vendor.ffmpeg_codec2.rank.audio u:object_r:vendor_ffmpeg_config_prop:s0
|
||||
persist.vendor.ffmpeg_codec2.rank.video u:object_r:vendor_ffmpeg_config_prop:s0
|
||||
persist.vendor.ffmpeg_codec2.v4l2.h265 u:object_r:vendor_ffmpeg_config_prop:s0
|
@@ -1,2 +1,12 @@
|
||||
android.hardware.drm.IDrmFactory/widevine u:object_r:hal_drm_service:s0
|
||||
mapper/minigbm_gbm_mesa u:object_r:hal_graphics_mapper_service:s0
|
||||
# Camera
|
||||
android.hardware.camera.provider.ICameraProvider/external/0 u:object_r:hal_camera_service:s0
|
||||
android.hardware.camera.provider.ICameraProvider/libcamera/0 u:object_r:hal_camera_service:s0
|
||||
|
||||
# DRM
|
||||
android.hardware.drm.IDrmFactory/widevine u:object_r:hal_drm_service:s0
|
||||
|
||||
# Gatekeeper
|
||||
android.hardware.security.sharedsecret.ISharedSecret/gatekeeper u:object_r:hal_gatekeeper_service:s0
|
||||
|
||||
# Graphics
|
||||
mapper/minigbm_gbm_mesa u:object_r:hal_graphics_mapper_service:s0
|
||||
|
@@ -2,7 +2,8 @@
|
||||
# gpu_access(client_domain)
|
||||
# Allow client_domain to communicate with the GPU
|
||||
define(`gpu_access', `
|
||||
allow $1 gpu_device:dir { open read search getattr };
|
||||
allow $1 gpu_device:chr_file { open read getattr ioctl map write };
|
||||
allow $1 sysfs_gpu:file { getattr open read };
|
||||
allow $1 gpu_device:dir r_dir_perms;
|
||||
allow $1 gpu_device:chr_file rw_file_perms;
|
||||
allow $1 sysfs_gpu:dir r_dir_perms;
|
||||
allow $1 sysfs_gpu:file r_file_perms;
|
||||
')
|
||||
|
3
sepolicy/vendor_init.te
Normal file
3
sepolicy/vendor_init.te
Normal file
@@ -0,0 +1,3 @@
|
||||
set_prop(vendor_init, vendor_audio_config_prop)
|
||||
set_prop(vendor_init, vendor_ffmpeg_config_prop)
|
||||
set_prop(vendor_init, vendor_hdmi_config_prop)
|
@@ -5,7 +5,29 @@
|
||||
|
||||
cc_binary {
|
||||
name: "suspend_blocker_rpi",
|
||||
srcs: ["suspend_blocker_rpi.cpp"],
|
||||
vendor: true,
|
||||
srcs: ["suspend_blocker_rpi.cpp"],
|
||||
shared_libs: ["libpower"],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "suspend_blocker_rpi.rc",
|
||||
src: "suspend_blocker_rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.suspend_blocker.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["suspend_blocker_rpi"],
|
||||
prebuilts: [
|
||||
"suspend_blocker_rpi.rc",
|
||||
],
|
||||
}
|
||||
|
3
suspend_blocker/apex_file_contexts
Normal file
3
suspend_blocker/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/suspend_blocker_rpi u:object_r:suspend_blocker_exec:s0
|
4
suspend_blocker/apex_manifest.json
Normal file
4
suspend_blocker/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.suspend_blocker.rpi5",
|
||||
"version": 1
|
||||
}
|
4
suspend_blocker/suspend_blocker_rpi.rc
Normal file
4
suspend_blocker/suspend_blocker_rpi.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
service suspend_blocker_rpi /apex/com.android.hardware.suspend_blocker.rpi5/bin/suspend_blocker_rpi
|
||||
class hal
|
||||
group system
|
||||
user root
|
@@ -5,24 +5,49 @@
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.usb.gadget-service.rpi",
|
||||
defaults: ["hidl_defaults"],
|
||||
relative_install_path: "hw",
|
||||
init_rc: ["android.hardware.usb.gadget-service.rpi.rc"],
|
||||
vintf_fragments: ["android.hardware.usb.gadget-service.rpi.xml"],
|
||||
vendor: true,
|
||||
srcs: [
|
||||
"service.cpp",
|
||||
"MonitorFfs.cpp",
|
||||
"UsbGadget.cpp",
|
||||
"UsbGadgetUtils.cpp",
|
||||
"main.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.usb.gadget-V1-ndk",
|
||||
"libbinder_ndk",
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libhardware",
|
||||
"libhidlbase",
|
||||
"libbinder_ndk",
|
||||
"liblog",
|
||||
"libutils",
|
||||
],
|
||||
static_libs: ["libusbconfigfs-rpi"],
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.usb.gadget-service.rpi.rc",
|
||||
src: "android.hardware.usb.gadget-service.rpi.rc",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "android.hardware.usb.gadget-service.rpi.xml",
|
||||
src: "android.hardware.usb.gadget-service.rpi.xml",
|
||||
sub_dir: "vintf",
|
||||
installable: false,
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.hardware.usb.gadget.rpi5",
|
||||
manifest: "apex_manifest.json",
|
||||
file_contexts: "apex_file_contexts",
|
||||
key: "com.android.hardware.key",
|
||||
certificate: ":com.android.hardware.certificate",
|
||||
updatable: false,
|
||||
vendor: true,
|
||||
|
||||
binaries: ["android.hardware.usb.gadget-service.rpi"],
|
||||
prebuilts: [
|
||||
"android.hardware.usb.gadget-service.rpi.rc",
|
||||
"android.hardware.usb.gadget-service.rpi.xml",
|
||||
],
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#define LOG_TAG "libusbconfigfs"
|
||||
|
||||
#include "include/UsbGadgetCommon.h"
|
||||
#include "UsbGadgetCommon.h"
|
||||
|
||||
namespace aidl {
|
||||
namespace android {
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#define LOG_TAG "libusbconfigfs"
|
||||
|
||||
#include "include/UsbGadgetCommon.h"
|
||||
#include "UsbGadgetCommon.h"
|
||||
|
||||
namespace aidl {
|
||||
namespace android {
|
@@ -1,4 +1,4 @@
|
||||
service vendor.usb_gadget-default /vendor/bin/hw/android.hardware.usb.gadget-service.rpi
|
||||
service vendor.usb_gadget-rpi /apex/com.android.hardware.usb.gadget.rpi5/bin/hw/android.hardware.usb.gadget-service.rpi
|
||||
class hal
|
||||
user system
|
||||
group system shell mtp
|
||||
|
3
usb/apex_file_contexts
Normal file
3
usb/apex_file_contexts
Normal file
@@ -0,0 +1,3 @@
|
||||
(/.*)? u:object_r:vendor_file:s0
|
||||
/etc(/.*)? u:object_r:vendor_configs_file:s0
|
||||
/bin/hw/android\.hardware\.usb\.gadget-service\.rpi u:object_r:hal_usb_gadget_default_exec:s0
|
4
usb/apex_manifest.json
Normal file
4
usb/apex_manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "com.android.hardware.usb.gadget.rpi5",
|
||||
"version": 1
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
// Copyright (C) 2020 The Android Open Source Project
|
||||
// Copyright (C) 2024 KonstaKANG
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cc_library_static {
|
||||
name: "libusbconfigfs-rpi",
|
||||
vendor_available: true,
|
||||
export_include_dirs: ["include"],
|
||||
|
||||
srcs: [
|
||||
"UsbGadgetUtils.cpp",
|
||||
"MonitorFfs.cpp",
|
||||
],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"android.hardware.usb.gadget-V1-ndk",
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libhidlbase",
|
||||
"libutils",
|
||||
],
|
||||
}
|
@@ -15,19 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "UsbGadget.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
#include "UsbGadget.h"
|
||||
|
||||
using ::aidl::android::hardware::usb::gadget::UsbGadget;
|
||||
|
||||
int main() {
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
||||
std::shared_ptr<UsbGadget> usbgadget = ndk::SharedRefBase::make<UsbGadget>();
|
||||
|
||||
const std::string instance = std::string() + UsbGadget::descriptor + "/default";
|
||||
binder_status_t status = AServiceManager_addService(usbgadget->asBinder().get(), instance.c_str());
|
||||
CHECK(status == STATUS_OK);
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
return -1;
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
40
vendor.prop
40
vendor.prop
@@ -1,14 +1,14 @@
|
||||
|
||||
# Audio
|
||||
persist.audio.hdmi.device=vc4hdmi0
|
||||
persist.audio.pcm.card=0
|
||||
persist.audio.pcm.device=0
|
||||
persist.vendor.audio.device=dac
|
||||
persist.vendor.audio.hdmi.device=vc4hdmi0
|
||||
persist.vendor.audio.pcm.card.auto=true
|
||||
ro.config.media_vol_default=20
|
||||
ro.config.media_vol_steps=25
|
||||
ro.hardware.audio.primary=rpi_hdmi
|
||||
|
||||
# Bluetooth
|
||||
bluetooth.device.class_of_device?=90,2,12
|
||||
bluetooth.device.default_name=Raspberry Pi 5
|
||||
bluetooth.profile.a2dp.sink.enabled?=true
|
||||
bluetooth.profile.a2dp.source.enabled?=true
|
||||
bluetooth.profile.asha.central.enabled?=true
|
||||
@@ -35,20 +35,24 @@ bluetooth.profile.vcp.controller.enabled?=true
|
||||
persist.bluetooth.a2dp_aac.vbr_supported=true
|
||||
|
||||
# Camera
|
||||
media.settings.xml=/vendor/etc/media_profiles_V1_0.xml
|
||||
ro.hardware.camera=libcamera
|
||||
|
||||
# CEC
|
||||
persist.hdmi.cec_device=cec0
|
||||
persist.vendor.hdmi.cec_device=cec0
|
||||
ro.hdmi.cec_device_types=playback_device
|
||||
ro.hdmi.device_type=4
|
||||
|
||||
# Chipset
|
||||
ro.soc.manufacturer=Broadcom
|
||||
ro.soc.model=BCM2712
|
||||
|
||||
# Display
|
||||
debug.drm.mode.force=1920x1080
|
||||
|
||||
# FFmpeg
|
||||
persist.ffmpeg_codec2.rank.audio=16
|
||||
persist.ffmpeg_codec2.rank.video=256
|
||||
persist.ffmpeg_codec2.v4l2.h265=true
|
||||
persist.vendor.ffmpeg_codec2.rank.audio=16
|
||||
persist.vendor.ffmpeg_codec2.rank.video=256
|
||||
persist.vendor.ffmpeg_codec2.v4l2.h265=true
|
||||
|
||||
# Graphics
|
||||
ro.hardware.egl=mesa
|
||||
@@ -56,34 +60,20 @@ ro.hardware.vulkan=broadcom
|
||||
ro.opengles.version=196609
|
||||
vendor.hwc.backend_override=rpi5
|
||||
vendor.hwc.drm.ctm=DRM_OR_IGNORE
|
||||
|
||||
# LMKD
|
||||
ro.lmk.critical=0
|
||||
ro.lmk.critical_upgrade=false
|
||||
ro.lmk.downgrade_pressure=100
|
||||
ro.lmk.kill_heaviest_task=true
|
||||
ro.lmk.kill_timeout_ms=100
|
||||
ro.lmk.log_stats=true
|
||||
ro.lmk.low=1001
|
||||
ro.lmk.medium=800
|
||||
ro.lmk.upgrade_pressure=100
|
||||
ro.lmk.use_minfree_levels=true
|
||||
vendor.hwc.drm.disable_hdr=1
|
||||
|
||||
# Lockscreen
|
||||
ro.lockscreen.disable.default=true
|
||||
|
||||
# Media
|
||||
debug.stagefright.c2inputsurface=-1
|
||||
media.c2.hal.selection=aidl
|
||||
|
||||
# MGLRU
|
||||
persist.device_config.mglru_native.lru_gen_config=core
|
||||
|
||||
# Storage
|
||||
persist.sys.fuse.backup.external_volume_backup=false
|
||||
|
||||
# Wifi
|
||||
wifi.interface=wlan0
|
||||
|
||||
# Window extensions
|
||||
persist.settings.large_screen_opt.enabled=true
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user