From 3087d9a54b68b9394bb565ddbb04881fa25645e6 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Fri, 27 Oct 2023 22:23:11 +0800 Subject: [PATCH] gps: refine gps build system - remove override directive - separate gps configuration files for each device Bug: 291186485 Test: build pass and configuration files are correct Change-Id: I907d5e04c267753ce25e5de5f5080536df7e7041 --- device-comet.mk | 23 ++--- factory_comet.mk | 9 +- location/Android.bp | 99 ++++++++++++++++++++ location/{ => factory}/gps.xml | 0 location/{ => factory}/lhd.conf | 0 location/{ => factory}/scd.conf | 0 location/{gps_user.xml => user/gps.xml} | 3 + location/{lhd_user.conf => user/lhd.conf} | 0 location/{scd_user.conf => user/scd.conf} | 0 location/userdebug/gps.xml | 104 ++++++++++++++++++++++ location/userdebug/lhd.conf | 33 +++++++ location/userdebug/scd.conf | 6 ++ 12 files changed, 261 insertions(+), 16 deletions(-) create mode 100644 location/Android.bp rename location/{ => factory}/gps.xml (100%) rename location/{ => factory}/lhd.conf (100%) rename location/{ => factory}/scd.conf (100%) rename location/{gps_user.xml => user/gps.xml} (97%) rename location/{lhd_user.conf => user/lhd.conf} (100%) rename location/{scd_user.conf => user/scd.conf} (100%) create mode 100644 location/userdebug/gps.xml create mode 100644 location/userdebug/lhd.conf create mode 100644 location/userdebug/scd.conf diff --git a/device-comet.mk b/device-comet.mk index b273e3a..39dab83 100644 --- a/device-comet.mk +++ b/device-comet.mk @@ -173,20 +173,15 @@ PRODUCT_SOONG_NAMESPACES += vendor/google_devices/comet/prebuilts $(call soong_config_set, include_libsitril-gps-wifi, board_without_radio, $(BOARD_WITHOUT_RADIO)) include device/google/gs-common/gps/brcm/device.mk -PRODUCT_COPY_FILES += \ - device/google/comet/location/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer - -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) - PRODUCT_COPY_FILES += \ - device/google/comet/location/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ - device/google/comet/location/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf \ - device/google/comet/location/gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml -else - PRODUCT_COPY_FILES += \ - device/google/comet/location/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ - device/google/comet/location/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf \ - device/google/comet/location/gps_user.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml -endif +PRODUCT_SOONG_NAMESPACES += device/google/comet/location +SOONG_CONFIG_NAMESPACES += gpssdk +SOONG_CONFIG_gpssdk += gpsconf +SOONG_CONFIG_gpssdk_gpsconf ?= $(TARGET_BUILD_VARIANT) +PRODUCT_PACKAGES += \ + gps.cer \ + gps.xml \ + scd.conf \ + lhd.conf # Install product specific framework compatibility matrix DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/comet/device_framework_matrix_product.xml diff --git a/factory_comet.mk b/factory_comet.mk index aa26da3..33dc2d8 100644 --- a/factory_comet.mk +++ b/factory_comet.mk @@ -33,10 +33,15 @@ PRODUCT_PROPERTY_OVERRIDES += \ # Override to factory SDK SOONG_CONFIG_NAMESPACES += gpssdk SOONG_CONFIG_gpssdk += sdkv1 -override SOONG_CONFIG_gpssdk_sdkv1 := true +SOONG_CONFIG_gpssdk_sdkv1 := true + SOONG_CONFIG_NAMESPACES += gpssdk SOONG_CONFIG_gpssdk += gpsmcuversion -override SOONG_CONFIG_gpssdk_gpsmcuversion := gpsv1_$(TARGET_BUILD_VARIANT) +SOONG_CONFIG_gpssdk_gpsmcuversion := gpsv1_$(TARGET_BUILD_VARIANT) + +SOONG_CONFIG_NAMESPACES += gpssdk +SOONG_CONFIG_gpssdk += gpsconf +SOONG_CONFIG_gpssdk_gpsconf := factory # Factory binary of camera PRODUCT_PACKAGES += fatp_ct3_wide_hat_tool fatp_ct3_tele_hat_tool fatp_ct3_ultrawide_hat_tool diff --git a/location/Android.bp b/location/Android.bp new file mode 100644 index 0000000..55b066e --- /dev/null +++ b/location/Android.bp @@ -0,0 +1,99 @@ +soong_namespace {} + +package { + default_applicable_licenses: ["device_google_comet_license"], +} + +soong_config_module_type { + name: "gps_prebuilt_etc", + module_type: "prebuilt_etc", + config_namespace: "gpssdk", + variables: [ + "gpsconf", + ], + properties: [ + "src", + ], +} + +soong_config_string_variable { + name: "gpsconf", + values: [ + "userdebug", + "user", + "factory", + ], +} + +prebuilt_etc { + name: "gps.cer", + src: "gps.cer", + relative_install_path: "gnss", + vendor: true, +} + +gps_prebuilt_etc { + name: "gps.xml", + soong_config_variables: { + gpsconf: { + user: { + src: "user/gps.xml", + }, + userdebug: { + src: "userdebug/gps.xml", + }, + factory: { + src: "factory/gps.xml", + }, + conditions_default: { + src: "user/gps.xml", + } + }, + }, + relative_install_path: "gnss", + vendor: true, +} + +gps_prebuilt_etc { + name: "lhd.conf", + soong_config_variables: { + gpsconf: { + user: { + src: "user/lhd.conf", + }, + userdebug: { + src: "userdebug/lhd.conf", + }, + factory: { + src: "factory/lhd.conf", + }, + conditions_default: { + src: "user/lhd.conf", + } + }, + }, + relative_install_path: "gnss", + vendor: true, +} + +gps_prebuilt_etc { + name: "scd.conf", + soong_config_variables: { + gpsconf: { + user: { + src: "user/scd.conf", + }, + userdebug: { + src: "userdebug/scd.conf", + }, + factory: { + src: "factory/scd.conf", + }, + conditions_default: { + src: "user/scd.conf", + } + }, + }, + relative_install_path: "gnss", + vendor: true, +} diff --git a/location/gps.xml b/location/factory/gps.xml similarity index 100% rename from location/gps.xml rename to location/factory/gps.xml diff --git a/location/lhd.conf b/location/factory/lhd.conf similarity index 100% rename from location/lhd.conf rename to location/factory/lhd.conf diff --git a/location/scd.conf b/location/factory/scd.conf similarity index 100% rename from location/scd.conf rename to location/factory/scd.conf diff --git a/location/gps_user.xml b/location/user/gps.xml similarity index 97% rename from location/gps_user.xml rename to location/user/gps.xml index 015ea13..fae192c 100644 --- a/location/gps_user.xml +++ b/location/user/gps.xml @@ -57,9 +57,12 @@ AssertEnabled="false" CpLppeCancelDbhOnAgnssProvideLoc="true" CpLppeUseAgnssLocForEmptyDbh="true" + CpLppHighAccuracyShapeMode="2" ReAidingOnHotStart="false" ReAidingIntervalSec="1200" RuntimeSwLteFilterEnable="true" + MaxThreadNum="13" + SensorsMask="0x244" /> + + + + + + + + + diff --git a/location/userdebug/lhd.conf b/location/userdebug/lhd.conf new file mode 100644 index 0000000..c430b93 --- /dev/null +++ b/location/userdebug/lhd.conf @@ -0,0 +1,33 @@ +LheName=bbd + +LheRsmResetTimeoutMS=10000 +GpioNStdbyPath=/sys/devices/platform/111e0000.spi/spi_master/spi21/spi21.0/nstandby + +LhePatch=/vendor/firmware/SensorHub.patch +Lhe477xDebugFlags=RPC:FACILITY=65535-dKP+CUST+LHE:STDOUT_PUTS:STDOUT_LOG +LheConsole=/data/vendor/gps/LheConsole + +LogEnabled=true +Log=JAVA +LogDirectory=/sdcard/gps/broadcom/storage + +LheBbdPacket=/dev/ttyBCM + +LheBbdControl=/dev/bbd_control + +# LheBbdSensor=/dev/bbd_sensor + +LheFailSafe=/data/vendor/gps/logs/esw-crash-dump.txt +LogLevel=*:I + +NvStorageDir=/data/vendor/gps/ + +# Enable BBD debugging at these stages: +# LheDriverDebugFlags=PATCH_BBD:LHE_BBD:FSC_BBD + +LheAutoBaudDelayMS=10 +TrafficLogEnabled=false +SecondaryConfigPath=/data/vendor/gps/overlay/lhd_overlay.conf + +SkipSensorWakeLock=true +LoggerWakeLockEnable=false diff --git a/location/userdebug/scd.conf b/location/userdebug/scd.conf new file mode 100644 index 0000000..43f9cd2 --- /dev/null +++ b/location/userdebug/scd.conf @@ -0,0 +1,6 @@ +LogEnabled=true +Log=JAVA +LogDirectory=/sdcard/gps/broadcom/storage +NvStorageDir=/data/vendor/gps/ +TcpConnectionTimeout=20 +SecondaryConfigPath=/data/vendor/gps/overlay/scd_overlay.conf