diff --git a/audio/sepolicy/aidl/radio.te b/audio/sepolicy/aidl/radio.te new file mode 100644 index 0000000..dcd8458 --- /dev/null +++ b/audio/sepolicy/aidl/radio.te @@ -0,0 +1,2 @@ +allow radio hal_audio_ext_service:service_manager find; +binder_call(radio, hal_audio_default) diff --git a/audio/sepolicy/common/genfs_contexts b/audio/sepolicy/common/genfs_contexts index 4b1c3a9..013b913 100644 --- a/audio/sepolicy/common/genfs_contexts +++ b/audio/sepolicy/common/genfs_contexts @@ -10,9 +10,11 @@ genfscon sysfs /devices/platform/audiometrics/codec_crashed_counter u:ob genfscon sysfs /devices/platform/audiometrics/hwinfo_part_number u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/ams_rate_read_once u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/cca_rate_read_once u:object_r:sysfs_pixelstats:s0 +genfscon sysfs /devices/platform/audiometrics/cca_count_read_once u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/pdm_state u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/waves u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/adapted_info_active_count u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/adapted_info_active_duration u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/pcm_count u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/pcm_latency u:object_r:sysfs_pixelstats:s0 +genfscon sysfs /devices/platform/audiometrics/call_count u:object_r:sysfs_pixelstats:s0 diff --git a/audio/sepolicy/hidl/radio.te b/audio/sepolicy/hidl/radio.te new file mode 100644 index 0000000..43585cd --- /dev/null +++ b/audio/sepolicy/hidl/radio.te @@ -0,0 +1,2 @@ +allow radio hal_audio_ext_hwservice:hwservice_manager find; +binder_call(radio, hal_audio_default) diff --git a/battery_mitigation/bcl.mk b/battery_mitigation/bcl.mk index 9fd81f8..13e5788 100644 --- a/battery_mitigation/bcl.mk +++ b/battery_mitigation/bcl.mk @@ -7,5 +7,7 @@ PRODUCT_PACKAGES += BrownoutDetection endif endif -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/vendor +SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/system_ext/private +SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/system_ext/public PRODUCT_SOONG_NAMESPACES += device/google/gs-common/battery_mitigation diff --git a/battery_mitigation/sepolicy/brownout_detection_app.te b/battery_mitigation/sepolicy/system_ext/private/brownout_detection_app.te similarity index 67% rename from battery_mitigation/sepolicy/brownout_detection_app.te rename to battery_mitigation/sepolicy/system_ext/private/brownout_detection_app.te index 6146a74..c342cbf 100644 --- a/battery_mitigation/sepolicy/brownout_detection_app.te +++ b/battery_mitigation/sepolicy/system_ext/private/brownout_detection_app.te @@ -1,9 +1,8 @@ -type brownout_detection_app, domain, coredomain; +typeattribute brownout_detection_app coredomain; userdebug_or_eng(` app_domain(brownout_detection_app) net_domain(brownout_detection_app) allow brownout_detection_app app_api_service:service_manager find; allow brownout_detection_app system_api_service:service_manager find; - get_prop(brownout_detection_app, vendor_brownout_reason_prop) ') diff --git a/battery_mitigation/sepolicy/seapp_contexts b/battery_mitigation/sepolicy/system_ext/private/seapp_contexts similarity index 100% rename from battery_mitigation/sepolicy/seapp_contexts rename to battery_mitigation/sepolicy/system_ext/private/seapp_contexts diff --git a/battery_mitigation/sepolicy/system_ext/public/brownout_detection_app.te b/battery_mitigation/sepolicy/system_ext/public/brownout_detection_app.te new file mode 100644 index 0000000..7eec57a --- /dev/null +++ b/battery_mitigation/sepolicy/system_ext/public/brownout_detection_app.te @@ -0,0 +1 @@ +type brownout_detection_app, domain; diff --git a/battery_mitigation/sepolicy/battery_mitigation.te b/battery_mitigation/sepolicy/vendor/battery_mitigation.te similarity index 100% rename from battery_mitigation/sepolicy/battery_mitigation.te rename to battery_mitigation/sepolicy/vendor/battery_mitigation.te diff --git a/battery_mitigation/sepolicy/vendor/brownout_detection_app.te b/battery_mitigation/sepolicy/vendor/brownout_detection_app.te new file mode 100644 index 0000000..e2c602f --- /dev/null +++ b/battery_mitigation/sepolicy/vendor/brownout_detection_app.te @@ -0,0 +1,3 @@ +userdebug_or_eng(` + get_prop(brownout_detection_app, vendor_brownout_reason_prop) +') diff --git a/battery_mitigation/sepolicy/file.te b/battery_mitigation/sepolicy/vendor/file.te similarity index 100% rename from battery_mitigation/sepolicy/file.te rename to battery_mitigation/sepolicy/vendor/file.te diff --git a/battery_mitigation/sepolicy/file_contexts b/battery_mitigation/sepolicy/vendor/file_contexts similarity index 100% rename from battery_mitigation/sepolicy/file_contexts rename to battery_mitigation/sepolicy/vendor/file_contexts diff --git a/battery_mitigation/sepolicy/genfs_contexts b/battery_mitigation/sepolicy/vendor/genfs_contexts similarity index 100% rename from battery_mitigation/sepolicy/genfs_contexts rename to battery_mitigation/sepolicy/vendor/genfs_contexts diff --git a/battery_mitigation/sepolicy/property.te b/battery_mitigation/sepolicy/vendor/property.te similarity index 100% rename from battery_mitigation/sepolicy/property.te rename to battery_mitigation/sepolicy/vendor/property.te diff --git a/battery_mitigation/sepolicy/property_contexts b/battery_mitigation/sepolicy/vendor/property_contexts similarity index 100% rename from battery_mitigation/sepolicy/property_contexts rename to battery_mitigation/sepolicy/vendor/property_contexts diff --git a/battery_mitigation/sepolicy/vendor_init.te b/battery_mitigation/sepolicy/vendor/vendor_init.te similarity index 100% rename from battery_mitigation/sepolicy/vendor_init.te rename to battery_mitigation/sepolicy/vendor/vendor_init.te diff --git a/camera/dump.mk b/camera/dump.mk index a3a5c7a..8569610 100644 --- a/camera/dump.mk +++ b/camera/dump.mk @@ -1,4 +1,6 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/ +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/vendor +PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/product/public +PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/product/private PRODUCT_PACKAGES_DEBUG += dump_camera diff --git a/camera/sepolicy/seapp_contexts b/camera/sepolicy/product/private/seapp_contexts similarity index 100% rename from camera/sepolicy/seapp_contexts rename to camera/sepolicy/product/private/seapp_contexts diff --git a/camera/sepolicy/product/private/vendor_pbcs_app.te b/camera/sepolicy/product/private/vendor_pbcs_app.te new file mode 100644 index 0000000..d77162e --- /dev/null +++ b/camera/sepolicy/product/private/vendor_pbcs_app.te @@ -0,0 +1,9 @@ +typeattribute vendor_pbcs_app coredomain; + +app_domain(vendor_pbcs_app); + +dontaudit vendor_pbcs_app system_app_data_file:dir *; + +allow vendor_pbcs_app app_api_service:service_manager find; +# Allow PBCS to find Camera Service. +allow vendor_pbcs_app cameraserver_service:service_manager find; diff --git a/camera/sepolicy/product/private/vendor_pcs_app.te b/camera/sepolicy/product/private/vendor_pcs_app.te new file mode 100644 index 0000000..6bf0451 --- /dev/null +++ b/camera/sepolicy/product/private/vendor_pcs_app.te @@ -0,0 +1,12 @@ +typeattribute vendor_pcs_app coredomain; + +app_domain(vendor_pcs_app); + +allow vendor_pcs_app { + app_api_service + audioserver_service + cameraserver_service + mediametrics_service + mediaserver_service + radio_service +}:service_manager find; diff --git a/camera/sepolicy/product/public/vendor_pbcs_app.te b/camera/sepolicy/product/public/vendor_pbcs_app.te new file mode 100644 index 0000000..7180719 --- /dev/null +++ b/camera/sepolicy/product/public/vendor_pbcs_app.te @@ -0,0 +1 @@ +type vendor_pbcs_app, domain; diff --git a/camera/sepolicy/product/public/vendor_pcs_app.te b/camera/sepolicy/product/public/vendor_pcs_app.te new file mode 100644 index 0000000..fb8b0a1 --- /dev/null +++ b/camera/sepolicy/product/public/vendor_pcs_app.te @@ -0,0 +1 @@ +type vendor_pcs_app, domain; diff --git a/camera/sepolicy/dump_camera.te b/camera/sepolicy/vendor/dump_camera.te similarity index 100% rename from camera/sepolicy/dump_camera.te rename to camera/sepolicy/vendor/dump_camera.te diff --git a/camera/sepolicy/file.te b/camera/sepolicy/vendor/file.te similarity index 100% rename from camera/sepolicy/file.te rename to camera/sepolicy/vendor/file.te diff --git a/camera/sepolicy/file_contexts b/camera/sepolicy/vendor/file_contexts similarity index 100% rename from camera/sepolicy/file_contexts rename to camera/sepolicy/vendor/file_contexts diff --git a/camera/sepolicy/hal_camera_default.te b/camera/sepolicy/vendor/hal_camera_default.te similarity index 100% rename from camera/sepolicy/hal_camera_default.te rename to camera/sepolicy/vendor/hal_camera_default.te diff --git a/camera/sepolicy/init.camera.set-interrupts-ownership.te b/camera/sepolicy/vendor/init.camera.set-interrupts-ownership.te similarity index 100% rename from camera/sepolicy/init.camera.set-interrupts-ownership.te rename to camera/sepolicy/vendor/init.camera.set-interrupts-ownership.te diff --git a/camera/sepolicy/property.te b/camera/sepolicy/vendor/property.te similarity index 100% rename from camera/sepolicy/property.te rename to camera/sepolicy/vendor/property.te diff --git a/camera/sepolicy/property_contexts b/camera/sepolicy/vendor/property_contexts similarity index 100% rename from camera/sepolicy/property_contexts rename to camera/sepolicy/vendor/property_contexts diff --git a/camera/sepolicy/service.te b/camera/sepolicy/vendor/service.te similarity index 100% rename from camera/sepolicy/service.te rename to camera/sepolicy/vendor/service.te diff --git a/camera/sepolicy/service_contexts b/camera/sepolicy/vendor/service_contexts similarity index 100% rename from camera/sepolicy/service_contexts rename to camera/sepolicy/vendor/service_contexts diff --git a/camera/sepolicy/vendor_pbcs_app.te b/camera/sepolicy/vendor/vendor_pbcs_app.te similarity index 68% rename from camera/sepolicy/vendor_pbcs_app.te rename to camera/sepolicy/vendor/vendor_pbcs_app.te index 2a56b2d..7b9c5e2 100644 --- a/camera/sepolicy/vendor_pbcs_app.te +++ b/camera/sepolicy/vendor/vendor_pbcs_app.te @@ -1,13 +1,3 @@ -type vendor_pbcs_app, domain, coredomain; - -app_domain(vendor_pbcs_app); - -dontaudit vendor_pbcs_app system_app_data_file:dir *; - -allow vendor_pbcs_app app_api_service:service_manager find; -# Allow PBCS to find Camera Service. -allow vendor_pbcs_app cameraserver_service:service_manager find; - # Allow PBCS to add the ServiceBinder service to ServiceManager. add_service(vendor_pbcs_app, vendor_camera_binder_service); # Allow PBCS to add the LyricConfigProvider service to ServiceManager. @@ -15,8 +5,8 @@ add_service(vendor_pbcs_app, vendor_camera_lyricconfigprovider_service); # Allow PBCS to add the CameraIdRemapper service to ServiceManager. add_service(vendor_pbcs_app, vendor_camera_cameraidremapper_service); -binder_call(vendor_pbcs_app, hal_camera_default); - # Allow PBCS to read debug system properties of the form vendor.camera.pbcs.debug.* # and persist.vendor.camera.pbcs.debug.* get_prop(vendor_pbcs_app, vendor_camera_pbcs_debug_prop); + +binder_call(vendor_pbcs_app, hal_camera_default); diff --git a/camera/sepolicy/vendor/vendor_pcs_app.te b/camera/sepolicy/vendor/vendor_pcs_app.te new file mode 100644 index 0000000..e269a2f --- /dev/null +++ b/camera/sepolicy/vendor/vendor_pcs_app.te @@ -0,0 +1,21 @@ +# Allow PCS to find the LyricConfigProvider service through ServiceManager. +allow vendor_pcs_app vendor_camera_lyricconfigprovider_service:service_manager find; +# Allow PCS to find the CameraIdRemapper service through ServiceManager. +allow vendor_pcs_app vendor_camera_cameraidremapper_service:service_manager find; + +allow vendor_pcs_app hal_pixel_remote_camera_service:service_manager add; + +binder_call(vendor_pcs_app, hal_pixel_remote_camera_service); + +binder_call(vendor_pcs_app, hal_camera_default); + +# Allow PCS to open socket connections for HTTP streaming support. +allow vendor_pcs_app vendor_pcs_app:unpriv_socket_class_set create_socket_perms_no_ioctl; +allow vendor_pcs_app fwmarkd_socket:sock_file write; +allow vendor_pcs_app port:tcp_socket name_connect; +allow vendor_pcs_app port:udp_socket name_bind; +allow vendor_pcs_app netd:unix_stream_socket connectto; +allow vendor_pcs_app node:udp_socket node_bind; + +allow netd vendor_pcs_app:unpriv_socket_class_set create_socket_perms_no_ioctl; +allow netd vendor_pcs_app:fd use; diff --git a/camera/sepolicy/vendor_pcs_app.te b/camera/sepolicy/vendor_pcs_app.te deleted file mode 100644 index c179255..0000000 --- a/camera/sepolicy/vendor_pcs_app.te +++ /dev/null @@ -1,23 +0,0 @@ -type vendor_pcs_app, domain, coredomain; - -app_domain(vendor_pcs_app); - -allow vendor_pcs_app { - app_api_service - audioserver_service - cameraserver_service - mediametrics_service - mediaserver_service - radio_service -}:service_manager find; - -# Allow PCS to find the LyricConfigProvider service through ServiceManager. -allow vendor_pcs_app vendor_camera_lyricconfigprovider_service:service_manager find; -# Allow PCS to find the CameraIdRemapper service through ServiceManager. -allow vendor_pcs_app vendor_camera_cameraidremapper_service:service_manager find; - -allow vendor_pcs_app hal_pixel_remote_camera_service:service_manager add; - -binder_call(vendor_pcs_app, hal_camera_default); - -binder_call(vendor_pcs_app, hal_pixel_remote_camera_service); diff --git a/dauntless/sepolicy/hal_weaver_citadel.te b/dauntless/sepolicy/hal_weaver_citadel.te index c47287b..3c5ca8e 100644 --- a/dauntless/sepolicy/hal_weaver_citadel.te +++ b/dauntless/sepolicy/hal_weaver_citadel.te @@ -9,3 +9,6 @@ vndbinder_use(hal_weaver_citadel) binder_call(hal_weaver_citadel, citadeld) allow hal_weaver_citadel citadeld_service:service_manager find; + +# Allow callbacks +allow citadeld hal_weaver_citadel:binder call; diff --git a/edgetpu/edgetpu.mk b/edgetpu/edgetpu.mk index 5ad2711..feb728f 100644 --- a/edgetpu/edgetpu.mk +++ b/edgetpu/edgetpu.mk @@ -23,6 +23,10 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += com.google.edgetpu.dba-service # TPU DBA C API library PRODUCT_PACKAGES += libedgetpu_dba.google +# TPU Tachyon HAL service +PRODUCT_PACKAGES += com.google.edgetpu.tachyon-service +# TPU Tachyon C API library +PRODUCT_PACKAGES += libedgetpu_tachyon.google BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/edgetpu/sepolicy diff --git a/edgetpu/sepolicy/edgetpu_tachyon_service.te b/edgetpu/sepolicy/edgetpu_tachyon_service.te new file mode 100644 index 0000000..fbe3edf --- /dev/null +++ b/edgetpu/sepolicy/edgetpu_tachyon_service.te @@ -0,0 +1,46 @@ +# Tachyon service. +type edgetpu_tachyon_server, domain; +type edgetpu_tachyon_server_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(edgetpu_tachyon_server) + +# The vendor service will use binder calls. +binder_use(edgetpu_tachyon_server); + +# The vendor service will serve a binder service. +binder_service(edgetpu_tachyon_server); + +# Tachyon service to register the service to service_manager. +add_service(edgetpu_tachyon_server, edgetpu_tachyon_service); + +# Allow Tachyon service to access the edgetpu_app_service. +allow edgetpu_tachyon_server edgetpu_app_service:service_manager find; +binder_call(edgetpu_tachyon_server, edgetpu_app_server); + +# Allow Tachyon service to look for TPU instance in /dev/edgetpu or /dev/edgetpu-soc. +allow edgetpu_tachyon_server edgetpu_device:chr_file rw_file_perms; + +# Allow Tachyon service to access hardware buffers and ION memory. +allow edgetpu_tachyon_server hal_allocator:fd use; +allow edgetpu_tachyon_server hal_graphics_mapper_hwservice:hwservice_manager find; +allow edgetpu_tachyon_server hal_graphics_allocator:fd use; +allow edgetpu_tachyon_server gpu_device:chr_file rw_file_perms; +allow edgetpu_tachyon_server gpu_device:dir r_dir_perms; +allow edgetpu_tachyon_server ion_device:chr_file r_file_perms; + +# Allow Tachyon service to read the overcommit_memory info. +allow edgetpu_tachyon_server proc_overcommit_memory:file r_file_perms; + +# Allow Tachyon service to read the kernel version. +# This is done inside the InitGoogle. +allow edgetpu_tachyon_server proc_version:file r_file_perms; + +# Allow Tachyon service to send trace packets to Perfetto with SELinux enabled +# under userdebug builds. +userdebug_or_eng(`perfetto_producer(edgetpu_tachyon_server)') + +# Allow Tachyon service to read tflite Darwinn delegate properties +get_prop(edgetpu_tachyon_server, vendor_tflite_delegate_prop) +# Allow Tachyon service to read hetero runtime properties +get_prop(edgetpu_tachyon_server, vendor_hetero_runtime_prop) +# Allow Tachyon service to read EdgeTPU CPU scheduler properties +get_prop(edgetpu_tachyon_server, vendor_edgetpu_cpu_scheduler_prop) diff --git a/edgetpu/sepolicy/file_contexts b/edgetpu/sepolicy/file_contexts index 8f6481c..df0a63e 100644 --- a/edgetpu/sepolicy/file_contexts +++ b/edgetpu/sepolicy/file_contexts @@ -24,3 +24,6 @@ # EdgeTPU DBA service /vendor/bin/hw/com\.google\.edgetpu.dba-service u:object_r:edgetpu_dba_server_exec:s0 + +# Tachyon service +/vendor/bin/hw/com\.google\.edgetpu.tachyon-service u:object_r:edgetpu_tachyon_server_exec:s0 diff --git a/edgetpu/sepolicy/service.te b/edgetpu/sepolicy/service.te index a61c8f8..b1a5409 100644 --- a/edgetpu/sepolicy/service.te +++ b/edgetpu/sepolicy/service.te @@ -1,6 +1,7 @@ type edgetpu_nnapi_service, app_api_service, service_manager_type, isolated_compute_allowed_service; type edgetpu_vendor_service, service_manager_type, hal_service_type; type edgetpu_dba_service, app_api_service, service_manager_type, isolated_compute_allowed_service; +type edgetpu_tachyon_service, app_api_service, service_manager_type, isolated_compute_allowed_service; # EdgeTPU binder service type declaration. type edgetpu_app_service, service_manager_type; diff --git a/edgetpu/sepolicy/service_contexts b/edgetpu/sepolicy/service_contexts index 83967f7..31684eb 100644 --- a/edgetpu/sepolicy/service_contexts +++ b/edgetpu/sepolicy/service_contexts @@ -8,3 +8,6 @@ com.google.edgetpu.IEdgeTpuAppService/default u:object_r:edgetpu_ap # EdgeTPU DBA Service com.google.edgetpu.dba.IDevice/default u:object_r:edgetpu_dba_service:s0 + +# Tachyon Service +com.google.edgetpu.tachyon.IComputeService/default u:object_r:edgetpu_tachyon_service:s0 diff --git a/gps/brcm/device.mk b/gps/brcm/device.mk index 73d0492..dd64dd3 100644 --- a/gps/brcm/device.mk +++ b/gps/brcm/device.mk @@ -1,13 +1,14 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/brcm/sepolicy -PRODUCT_SOONG_NAMESPACES += device/google/gs-common/gps/brcm/prebuilt +PRODUCT_SOONG_NAMESPACES += vendor/broadcom/gps/bcm47765 -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - $(call soong_config_set, SensorHub_debug, assertion, true) -endif +$(call soong_config_set, gpssdk, sdkv1, False) + +$(call soong_config_set, gpssdk, gpsmcuversion, gpsv2_$(TARGET_BUILD_VARIANT)) PRODUCT_PACKAGES += \ bcm47765_gps_package \ + sitril-gps \ android.hardware.location.gps.prebuilt.xml PRODUCT_PACKAGES_DEBUG += \ diff --git a/gps/brcm/device_v2.mk b/gps/brcm/device_v2.mk deleted file mode 100644 index 5de9b61..0000000 --- a/gps/brcm/device_v2.mk +++ /dev/null @@ -1,14 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/brcm/sepolicy - -PRODUCT_SOONG_NAMESPACES += vendor/broadcom/gps/bcm47765 - -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - $(call soong_config_set, gpsv2, assertion, true) -endif - -PRODUCT_PACKAGES += \ - bcm47765_gps_package_v2 \ - android.hardware.location.gps.prebuilt.xml - -PRODUCT_PACKAGES_DEBUG += \ - init.gps_log.rc diff --git a/gps/brcm/prebuilt/Android.bp b/gps/brcm/prebuilt/Android.bp deleted file mode 100644 index d12f897..0000000 --- a/gps/brcm/prebuilt/Android.bp +++ /dev/null @@ -1,240 +0,0 @@ -soong_namespace { - imports: [ - "hardware/google/pixel", - ], -} - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_prebuilt_library_shared { - name: "android.hardware.gnss@2.1-impl-google", - arch: { - arm64: { - srcs: ["android.hardware.gnss@2.1-impl-google.so"], - shared_libs: [ - "liblog", - "libutils", - "libbinder_ndk", - "android.hardware.gnss-V3-ndk", - "libhardware", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because libhidltransport is deprecated - check_elf_files: false, -} - -cc_prebuilt_binary { - name: "android.hardware.gnss@2.1-service-brcm", - init_rc: ["init.gps.rc"], - arch: { - arm64: { - srcs: ["android.hardware.gnss@2.1-service-brcm"], - shared_libs: [ - "liblog", - "libutils", - "libhardware", - "libbinder_ndk", - "android.hardware.gnss-V3-ndk", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because libhidltransport is deprecated - // Bypass because libhwbinder is deprecated - check_elf_files: false, - vintf_fragments: ["android.hardware.gnss@2.1-service-brcm.xml"] -} - -cc_prebuilt_library_shared { - name: "flp.default", - arch: { - arm64: { - srcs: ["flp.default.so"], - shared_libs: [ - "liblog", - "libcutils", - "libutils", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because soname mismatch - check_elf_files: false, -} - -cc_prebuilt_binary { - name: "gpsd", - arch: { - arm64: { - srcs: ["gpsd"], - shared_libs: [ - "liblog", - "libutils", - "libhardware_legacy", - "libcutils", - "libssl", - "libcrypto", - // "libsitril-gps", - "android.frameworks.sensorservice@1.0", - "libhidlbase", - "libandroid_net", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because libsitril-gps is Android.mk module - check_elf_files: false, -} - -cc_prebuilt_library_shared { - name: "gps.default", - arch: { - arm64: { - srcs: ["gps.default.so"], - shared_libs: [ - "liblog", - "libcutils", - "libutils", - "libc++", - "libc", - "libm", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, - // Bypass because soname mismatch - check_elf_files: false, -} - -cc_prebuilt_binary { - name: "lhd", - arch: { - arm64: { - srcs: ["lhd"], - shared_libs: [ - "liblog", - "libutils", - "libhardware_legacy", - "libc++", - "libc", - "libm", - "libz", - "libdl", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, -} - -cc_prebuilt_binary { - name: "scd", - arch: { - arm64: { - srcs: ["scd"], - shared_libs: [ - "liblog", - "libutils", - "libssl", - "libcrypto", - "libandroid_net", - ], - }, - }, - compile_multilib: "64", - vendor: true, - relative_install_path: "hw", - strip: { - none: true, - }, -} - -soong_config_module_type { - name: "gps_prebuilt_firmware", - module_type: "prebuilt_firmware", - config_namespace: "SensorHub_debug", - bool_variables: [ - "assertion", - ], - properties: [ - "src" - ], -} - -gps_prebuilt_firmware { - name: "SensorHub.patch", - soong_config_variables: { - assertion: { - src: "SensorHub_DebugBuild_A0.patch", - conditions_default: { - src: "SensorHub_A0.patch" - }, - }, - }, - vendor: true, - filename: "SensorHub.patch" -} - -phony { - name: "bcm47765_gps_package", - required: [ - "android.hardware.gnss@2.1-impl-google", - "android.hardware.gnss@2.1-service-brcm", - "flp.default", - "gpsd", - "lhd", - "gps.default", - "scd", - "SensorHub.patch" - ], -} diff --git a/gps/brcm/prebuilt/SensorHub_A0.patch b/gps/brcm/prebuilt/SensorHub_A0.patch deleted file mode 100644 index 6dff717..0000000 --- a/gps/brcm/prebuilt/SensorHub_A0.patch +++ /dev/null @@ -1,7027 +0,0 @@ - - - - - - - - - - - - - - diff --git a/gps/brcm/prebuilt/SensorHub_DebugBuild_A0.patch b/gps/brcm/prebuilt/SensorHub_DebugBuild_A0.patch deleted file mode 100644 index 23b9999..0000000 --- a/gps/brcm/prebuilt/SensorHub_DebugBuild_A0.patch +++ /dev/null @@ -1,7050 +0,0 @@ - - - - - - - - - - - - - - diff --git a/gps/brcm/prebuilt/android.hardware.gnss@2.1-impl-google.so b/gps/brcm/prebuilt/android.hardware.gnss@2.1-impl-google.so deleted file mode 100755 index e42bf07..0000000 Binary files a/gps/brcm/prebuilt/android.hardware.gnss@2.1-impl-google.so and /dev/null differ diff --git a/gps/brcm/prebuilt/android.hardware.gnss@2.1-service-brcm b/gps/brcm/prebuilt/android.hardware.gnss@2.1-service-brcm deleted file mode 100755 index 06d6a25..0000000 Binary files a/gps/brcm/prebuilt/android.hardware.gnss@2.1-service-brcm and /dev/null differ diff --git a/gps/brcm/prebuilt/android.hardware.gnss@2.1-service-brcm.xml b/gps/brcm/prebuilt/android.hardware.gnss@2.1-service-brcm.xml deleted file mode 100644 index 8d06407..0000000 --- a/gps/brcm/prebuilt/android.hardware.gnss@2.1-service-brcm.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - android.hardware.gnss - 3 - IGnss/default - - diff --git a/gps/brcm/prebuilt/flp.default.so b/gps/brcm/prebuilt/flp.default.so deleted file mode 100755 index d8ae3e5..0000000 Binary files a/gps/brcm/prebuilt/flp.default.so and /dev/null differ diff --git a/gps/brcm/prebuilt/gps.default.so b/gps/brcm/prebuilt/gps.default.so deleted file mode 100755 index 785a603..0000000 Binary files a/gps/brcm/prebuilt/gps.default.so and /dev/null differ diff --git a/gps/brcm/prebuilt/gpsd b/gps/brcm/prebuilt/gpsd deleted file mode 100755 index bfe3a6c..0000000 Binary files a/gps/brcm/prebuilt/gpsd and /dev/null differ diff --git a/gps/brcm/prebuilt/init.gps.rc b/gps/brcm/prebuilt/init.gps.rc deleted file mode 100644 index a9823ef..0000000 --- a/gps/brcm/prebuilt/init.gps.rc +++ /dev/null @@ -1,26 +0,0 @@ -service lhd /vendor/bin/hw/lhd /vendor/etc/gnss/lhd.conf - class main - user gps - group system inet net_raw sdcard_rw - ioprio be 0 - -service gpsd /vendor/bin/hw/gpsd -c /vendor/etc/gnss/gps.xml - class main - user gps - group system gps radio inet wakelock sdcard_rw net_raw - ioprio be 0 - -service scd /vendor/bin/hw/scd /vendor/etc/gnss/scd.conf - class main - user gps - group system inet net_raw wakelock - ioprio be 0 - priority -1 - -service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-brcm - class hal - user gps - group system gps radio - ioprio be 0 - priority -1 - diff --git a/gps/brcm/prebuilt/lhd b/gps/brcm/prebuilt/lhd deleted file mode 100755 index 786f914..0000000 Binary files a/gps/brcm/prebuilt/lhd and /dev/null differ diff --git a/gps/brcm/prebuilt/scd b/gps/brcm/prebuilt/scd deleted file mode 100755 index a96c13b..0000000 Binary files a/gps/brcm/prebuilt/scd and /dev/null differ diff --git a/gyotaku_app/gyotaku.mk b/gyotaku_app/gyotaku.mk new file mode 100644 index 0000000..fa58556 --- /dev/null +++ b/gyotaku_app/gyotaku.mk @@ -0,0 +1,8 @@ +ifneq ($(TARGET_BUILD_VARIANT), user) + ifeq (,$(filter aosp_%, $(TARGET_PRODUCT))) # Skip aosp target product + PRODUCT_PACKAGES_DEBUG += \ + Gyotaku + + BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/sepolicy/ + endif +endif diff --git a/gyotaku_app/sepolicy/gyotaku_app.te b/gyotaku_app/sepolicy/gyotaku_app.te new file mode 100644 index 0000000..28fa93b --- /dev/null +++ b/gyotaku_app/sepolicy/gyotaku_app.te @@ -0,0 +1,34 @@ +type gyotaku_app, domain; + +app_domain(gyotaku_app) + +userdebug_or_eng(` + # For Gyotaku app common use + allow gyotaku_app app_api_service:service_manager find; + allow gyotaku_app privapp_data_file:lnk_file read; + allow gyotaku_app gyotaku_app:udp_socket create; + allow gyotaku_app system_app_data_file:dir create_dir_perms; + allow gyotaku_app system_app_data_file:file create_file_perms; + + # For cloud and network related use + allow gyotaku_app dnsproxyd_socket:sock_file write; + allow gyotaku_app gyotaku_app:udp_socket connect; + allow gyotaku_app netd:unix_stream_socket connectto; + allow gyotaku_app gyotaku_app:tcp_socket create; + allow gyotaku_app privapp_data_file:file execute; + allow netd gyotaku_app:fd use; + allow netd gyotaku_app:tcp_socket {read write}; + + # For access /proc/fs/f2fs/* storage use + allow gyotaku_app proc_f2fs:dir search; + allow gyotaku_app proc_f2fs:file {open read}; + + # For access /proc/stat use + allow gyotaku_app proc_stat:file {read open getattr}; + + # For getproperty isDebuggable use + get_prop(gyotaku_app, userdebug_or_eng_prop) + + # For persiste property use + allow gyotaku_app logpersistd_logging_prop:file {read open getattr map}; +') diff --git a/gyotaku_app/sepolicy/seapp_contexts b/gyotaku_app/sepolicy/seapp_contexts new file mode 100644 index 0000000..b1c6248 --- /dev/null +++ b/gyotaku_app/sepolicy/seapp_contexts @@ -0,0 +1,2 @@ +# Gyotaku app +user=system seinfo=platform name=com.google.android.apps.internal.gyotaku domain=gyotaku_app type=system_app_data_file levelFrom=all diff --git a/pixelsystemservice/pixelsystemservice.mk b/pixelsystemservice/pixelsystemservice.mk deleted file mode 100644 index 4a27110..0000000 --- a/pixelsystemservice/pixelsystemservice.mk +++ /dev/null @@ -1,5 +0,0 @@ -PRODUCT_SOONG_NAMESPACES += vendor/google/apps/PersistentBackgroundServices -PRODUCT_PACKAGES += \ - PersistentBackgroundServices - -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/pixelsystemservice/sepolicy diff --git a/pixelsystemservice/sepolicy/pixelsystemservice_app.te b/pixelsystemservice/sepolicy/pixelsystemservice_app.te deleted file mode 100644 index f120058..0000000 --- a/pixelsystemservice/sepolicy/pixelsystemservice_app.te +++ /dev/null @@ -1,6 +0,0 @@ -type pixelsystemservice_app, domain, coredomain; - -app_domain(pixelsystemservice_app); - -# Standard system services -allow pixelsystemservice_app app_api_service:service_manager find; diff --git a/pixelsystemservice/sepolicy/seapp_contexts b/pixelsystemservice/sepolicy/seapp_contexts deleted file mode 100644 index f1c1262..0000000 --- a/pixelsystemservice/sepolicy/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Pixel System Service -user=_app seinfo=platform name=com.google.android.pixelsystemservice domain=pixelsystemservice_app type=app_data_file levelFrom=all diff --git a/thermal/thermal.mk b/thermal/thermal.mk deleted file mode 100644 index 03b1dfa..0000000 --- a/thermal/thermal.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy/dump - -PRODUCT_PACKAGES += dump/dump_thermal.sh diff --git a/touch/syna/Android.bp b/touch/syna/Android.bp index faefb9b..769c76b 100644 --- a/touch/syna/Android.bp +++ b/touch/syna/Android.bp @@ -5,6 +5,7 @@ package { sh_binary { name: "dump_syna.sh", src: "dump_syna.sh", + init_rc: ["init.touch.syna20.rc"], vendor: true, sub_dir: "dump", } diff --git a/touch/syna/init.touch.syna20.rc b/touch/syna/init.touch.syna20.rc new file mode 100644 index 0000000..7c83a6c --- /dev/null +++ b/touch/syna/init.touch.syna20.rc @@ -0,0 +1,3 @@ +on property:vendor.device.modules.ready=1 + chown system system /sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs/get_raw_data + chown system system /sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs/force_active diff --git a/touch/syna/sepolicy/genfs_contexts b/touch/syna/sepolicy/genfs_contexts index 2a8f9e3..c34d93c 100644 --- a/touch/syna/sepolicy/genfs_contexts +++ b/touch/syna/sepolicy/genfs_contexts @@ -1,3 +1,3 @@ -genfscon sysfs /devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0 +genfscon sysfs /devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0 genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0 - +genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/wakeup u:object_r:sysfs_wakeup:s0