Skip to content

Commit

Permalink
sunfish: Build LiveDisplay 2.0 HAL
Browse files Browse the repository at this point in the history
* Lets use the common solution, and change our supported
  interfaces while we're at it:
 * Our panel (by default) uses AOSP color profiles.
 * Our panel does get along with Color Calibration &
   Reading Mode, which are done SDK side, and require
   no HIDL manifest entries.
 * Our panel does get along with Picture Adjustment
   features, so leave IPictureAdjustment in place.
 * Our panel does get along with Adaptive Backlight
   features, so leave IAdaptiveBacklight in place.
 * AOSP declares `ro.vendor.display.foss` but we don't
   have support for IAdaptiveBacklight, so don't declare.

Change-Id: Ia96134e0a4bb06269b48671a87991d5e7a53d9ed
  • Loading branch information
invisiblek authored and mikeNG committed Sep 6, 2022
1 parent 1515f3e commit e5f633e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
8 changes: 8 additions & 0 deletions BoardConfigLineage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ TARGET_KERNEL_CONFIG := sunfish_defconfig
TARGET_KERNEL_SOURCE := kernel/google/msm-4.14
TARGET_NEEDS_DTBOIMAGE := true

# Manifests
DEVICE_MANIFEST_FILE += device/google/sunfish/lineage_manifest.xml
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += vendor/lineage/config/device_framework_matrix.xml

# Partitions
AB_OTA_PARTITIONS += \
vendor
Expand All @@ -28,6 +32,10 @@ BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 92160000
endif

# SELinux
BOARD_SEPOLICY_DIRS += device/google/sunfish/sepolicy-lineage/dynamic
BOARD_SEPOLICY_DIRS += device/google/sunfish/sepolicy-lineage/vendor

# Verified Boot
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3

Expand Down
4 changes: 4 additions & 0 deletions device-lineage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ PRODUCT_SOONG_NAMESPACES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.telephony.euicc.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.telephony.euicc.xml

# LiveDisplay
PRODUCT_PACKAGES += \
[email protected]

# RCS
PRODUCT_PACKAGES += \
PresencePolling \
Expand Down
11 changes: 11 additions & 0 deletions lineage_manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<manifest version="1.0" type="device" target-level="4">
<hal format="hidl">
<name>vendor.lineage.livedisplay</name>
<transport>hwbinder</transport>
<version>2.0</version>
<interface>
<name>IPictureAdjustment</name>
<instance>default</instance>
</interface>
</hal>
</manifest>
10 changes: 10 additions & 0 deletions sepolicy-lineage/dynamic/hal_lineage_livedisplay_qti.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Do not use add_service() as hal_graphics_composer_default may be the provider as well
allow hal_lineage_livedisplay_qti qdisplay_service:service_manager find;

binder_call(hal_lineage_livedisplay_qti, hal_graphics_composer_default)

# Allow LiveDisplay to access vendor display property
get_prop(hal_lineage_livedisplay_qti, vendor_display_prop)

allow hal_lineage_livedisplay_qti pps_socket:sock_file rw_file_perms;
allow hal_lineage_livedisplay_qti hal_graphics_composer_default:unix_stream_socket { connectto };
2 changes: 2 additions & 0 deletions sepolicy-lineage/vendor/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# LiveDisplay HAL
/(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service-sdm u:object_r:hal_lineage_livedisplay_qti_exec:s0
12 changes: 12 additions & 0 deletions sepolicy-lineage/vendor/hal_lineage_livedisplay.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type hal_lineage_livedisplay_qti, domain;
hal_server_domain(hal_lineage_livedisplay_qti, hal_lineage_livedisplay)

type hal_lineage_livedisplay_qti_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_lineage_livedisplay_qti)

# Allow LiveDisplay HAL's default implementation to use vendor-binder service
vndbinder_use(hal_lineage_livedisplay_qti)

# Allow LiveDisplay to store files under /data/vendor/display and access them
allow hal_lineage_livedisplay_qti display_vendor_data_file:dir rw_dir_perms;
allow hal_lineage_livedisplay_qti display_vendor_data_file:file create_file_perms;

0 comments on commit e5f633e

Please sign in to comment.