modem_svc: add modem_svc_sit to solve sepolicy conflicts arising from different device versions

Add modem_svc_sit to gs-common. modem_svc_sit will support devices from gs101 to zuma_pro. The shared_modem_platform will be updated to support devices after zumapro (not include).

Bug: 372400955

Flag: NONE local testing only
Change-Id: I0bcc9baf69045327e6fcca92ab8003e303db2649
This commit is contained in:
Eileen Lai 2024-12-06 12:49:05 +00:00
parent 2833eecc49
commit 8112ee64cc
11 changed files with 46 additions and 2 deletions

View file

@ -0,0 +1,11 @@
<compatibility-matrix version="1.0" type="framework">
<!-- Optional since older devices will not register any services. -->
<hal format="aidl" optional="true">
<name>com.google.pixel.shared_modem_platform</name>
<version>3</version>
<interface>
<name>ISharedModemPlatform</name>
<instance>default</instance>
</interface>
</hal>
</compatibility-matrix>

View file

@ -0,0 +1 @@
hal_attribute(shared_modem_platform)

View file

@ -0,0 +1,2 @@
# modem_svc_sit
/vendor/bin/shared_modem_platform u:object_r:modem_svc_sit_exec:s0

View file

@ -0,0 +1,8 @@
# Allow binder connection from client to server
binder_call(hal_shared_modem_platform_client, hal_shared_modem_platform_server)
# Allow client to find the service, server to register the service
hal_attribute_service(hal_shared_modem_platform, hal_shared_modem_platform_service)
# Allow binder communication from server to service_manager
binder_use(hal_shared_modem_platform_server)

View file

@ -0,0 +1,2 @@
# define hal_shared_modem_platform_service
type hal_shared_modem_platform_service, hal_service_type, service_manager_type;

View file

@ -0,0 +1,2 @@
# Bind Shared Modem Platform AIDL service name to the SELinux type.
com.google.pixel.shared_modem_platform.ISharedModemPlatform/default u:object_r:hal_shared_modem_platform_service:s0

View file

@ -0,0 +1,14 @@
# This file is not included in `modem.mk` since this is included at the
# beginning of each `device.mk` file, and so will be called before
# `SHARED_MODEM_PLATFORM_VENDOR` is defined later in the file.
# This file supoorts Whitechapel(gs101), Whitechapel Pro(gs201), Zuma, Zuma Pro.
# This file doesn't support devices which AP is after Zuma Pro.
# For device after Zuma Pro please use gs-common/modem/shared_modem_platform/shared_modem_platform.mk
SOONG_CONFIG_NAMESPACES += shared_modem_platform
SOONG_CONFIG_shared_modem_platform += \
vendor
SOONG_CONFIG_shared_modem_platform_vendor := $(SHARED_MODEM_PLATFORM_VENDOR)
PRODUCT_PACKAGES += shared_modem_platform
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/modem/modem_svc_sit/compatibility_matrix.xml
BOARD_SEPOLICY_DIRS += device/google/gs-common/modem/modem_svc_sit/sepolicy

View file

@ -1,2 +1,2 @@
# modem_svc_sit
/vendor/bin/shared_modem_platform u:object_r:modem_svc_sit_exec:s0
# shared_modem_platform
/vendor/bin/shared_modem_platform u:object_r:shared_modem_platform_exec:s0

View file

@ -0,0 +1,2 @@
# Shared modem platform will register the default instance of the AIDL ISharedModemPlatform hal.
hal_server_domain(shared_modem_platform, hal_shared_modem_platform)

View file

@ -1,6 +1,8 @@
# This file is not included in `modem.mk` since this is included at the
# beginning of each `device.mk` file, and so will be called before
# `SHARED_MODEM_PLATFORM_VENDOR` is defined later in the file.
# This file supports support devices which AP is after zumapro(not include).
# For device before zumapro(include) please use gs-common/modem/modem_svc_sit/shared_modem_platform.mk
SOONG_CONFIG_NAMESPACES += shared_modem_platform
SOONG_CONFIG_shared_modem_platform += \
vendor