├── odm.prop ├── .clang-format ├── system_ext.prop ├── setup-makefiles.py ├── sepolicy ├── private │ └── system_app.te ├── vendor │ ├── tee.te │ ├── sensors.te │ ├── hal_wifi_default.te │ ├── hal_bootctl_default.te │ ├── app.te │ ├── hal_power_default.te │ ├── hal_bluetooth_default.te │ ├── hal_lineage_powershare_default.te │ ├── hal_audio_default.te │ ├── hal_cameraperf.te │ ├── hal_perf_default.te │ ├── hal_camerapostproc_xiaomi.te │ ├── attributes │ ├── batterysecret.te │ ├── property_contexts │ ├── hal_sensors_default.te │ ├── hal_camera_default.te │ ├── hal_mlipay.te │ ├── mi_thermald.te │ ├── vendor_hal_citsensorservice_xiaomi.te │ ├── hwservice_contexts │ ├── hal_fingerprint_default.te │ └── genfs_contexts └── public │ └── attributes ├── gps ├── Android.bp ├── pla │ └── Android.bp ├── android │ ├── 2.1 │ │ ├── android.hardware.gnss@2.1-service-qti.rc │ │ ├── android.hardware.gnss@2.1-service-qti.xml │ │ ├── GnssDebug.h │ │ ├── GnssNi.h │ │ ├── AGnss.h │ │ ├── service.cpp │ │ ├── GnssNi.cpp │ │ ├── Android.bp │ │ ├── GnssBatching.h │ │ ├── AGnssRil.h │ │ ├── GnssConfiguration.h │ │ ├── location_api │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── LocationUtil.h │ │ │ └── BatchingAPIClient.h │ │ ├── GnssGeofencing.h │ │ └── GnssMeasurement.h │ └── utils │ │ ├── Android.bp │ │ └── battery_listener.h ├── Makefile.am ├── gps_vendor_board.mk ├── core │ ├── loc-core.pc.in │ ├── Android.bp │ ├── data-items │ │ ├── DataItemsFactoryProxy.h │ │ ├── IDataItemCore.h │ │ ├── DataItemId.h │ │ └── DataItemsFactoryProxy.cpp │ ├── Makefile.am │ ├── LocContext.h │ ├── loc_core_log.h │ ├── LBSProxyBase.h │ ├── observer │ │ └── IDataItemObserver.h │ ├── LocAdapterProxyBase.h │ ├── configure.ac │ └── LocContext.cpp ├── utils │ ├── gps-utils.pc.in │ ├── Android.bp │ ├── LocLoggerBase.h │ ├── Makefile.am │ ├── MsgTask.h │ ├── configure.ac │ ├── loc_timer.h │ ├── LocTimer.h │ ├── LogBuffer.h │ └── loc_target.h ├── location │ ├── location-api.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── batching │ ├── location-batching.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── geofence │ ├── location-geofence.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── loc-hal.pc.in ├── gnss │ ├── Android.bp │ ├── Makefile.am │ └── NativeAgpsHandler.h ├── etc │ ├── lowi.conf │ ├── Android.bp │ ├── seccomp_policy │ │ ├── gnss@2.0-xtra-daemon.policy │ │ └── gnss@2.0-base.policy │ └── flp.conf ├── gps_vendor_product.mk └── configure.ac ├── README.md ├── wifi ├── p2p_supplicant_overlay.conf └── wpa_supplicant_overlay.conf ├── configs ├── public.libraries.txt ├── privapp-permissions-hotword.xml ├── camera_cnf.txt ├── telephony_system-ext_privapp-permissions-qti.xml └── qti_whitelist.xml ├── rro_overlays ├── WifiOverlaySM8350 │ ├── Android.bp │ └── AndroidManifest.xml ├── SettingsOverlaySM8350 │ ├── Android.bp │ ├── res │ │ └── values │ │ │ ├── lineage_config.xml │ │ │ └── config.xml │ └── AndroidManifest.xml ├── SystemUIOverlaySM8350 │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── FrameworkOverlaySM8350 │ ├── Android.bp │ └── AndroidManifest.xml ├── FrameworkOverlayUDFPS │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── LineageSDKOverlaySM8350 │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── TelephonyOverlaySM8350 │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── LineageSDKOverlayPowerShare │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── config.xml │ └── AndroidManifest.xml └── CarrierConfigOverlaySM8350 │ ├── Android.bp │ └── AndroidManifest.xml ├── lineage.dependencies ├── power ├── Android.bp └── power-mode.cpp ├── qcril-database ├── config │ ├── Android.bp │ └── 10.1_config.sql └── Android.bp ├── rootdir ├── etc │ ├── init.mi_thermald.rc │ ├── init.recovery.qcom.rc │ ├── charger_fstab.qcom │ └── init.batterysecret.rc └── bin │ ├── vendor_modprobe.sh │ ├── init.kernel.post_boot.sh │ └── init.qcom.sh ├── hidl ├── manifest_udfps.xml └── manifest_xiaomi.xml ├── Android.bp ├── udfps └── Android.bp ├── system.prop ├── config.fs ├── extract-files.py └── media ├── init.qti.media.rc └── init.qti.media.sh /odm.prop: -------------------------------------------------------------------------------- 1 | # Qcom 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | ../../../build/soong/scripts/system-clang-format -------------------------------------------------------------------------------- /system_ext.prop: -------------------------------------------------------------------------------- 1 | # DPM 2 | persist.vendor.dpm.feature=11 3 | -------------------------------------------------------------------------------- /setup-makefiles.py: -------------------------------------------------------------------------------- 1 | #!./extract-files.py --regenerate_makefiles 2 | -------------------------------------------------------------------------------- /sepolicy/private/system_app.te: -------------------------------------------------------------------------------- 1 | hal_client_domain(system_app, hal_mlipay) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | allow tee vendor_bsg_device:chr_file { setattr }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/sensors.te: -------------------------------------------------------------------------------- 1 | r_dir_file(vendor_sensors, vendor_sysfs_graphics) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_default self:capability sys_module; 2 | -------------------------------------------------------------------------------- /gps/Android.bp: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS = [ 2 | "-Werror", 3 | "-Wno-undefined-bool-conversion", 4 | ] 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bootctl_default.te: -------------------------------------------------------------------------------- 1 | allow hal_bootctl_default vendor_uefi_block_device:blk_file getattr; 2 | -------------------------------------------------------------------------------- /sepolicy/public/attributes: -------------------------------------------------------------------------------- 1 | attribute hal_mlipay; 2 | attribute hal_mlipay_client; 3 | attribute hal_mlipay_server; 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2020 - The LineageOS Project 2 | 3 | Common device tree for Xiaomi SM8350 based devices 4 | ============== 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | get_prop({ appdomain -isolated_app_all }, vendor_fp_prop) 2 | get_prop({ appdomain -isolated_app_all }, vendor_mlipay_prop) 3 | -------------------------------------------------------------------------------- /gps/pla/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_headers { 3 | 4 | name: "libloc_pla_headers", 5 | export_include_dirs: ["android"], 6 | vendor: true, 7 | } 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | type vendor_touchfeature_device, dev_type; 2 | 3 | allow hal_power_default vendor_touchfeature_device:chr_file rw_file_perms; 4 | -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | bss_max_count=400 5 | p2p_go_he=1 6 | p2p_6ghz_disable=1 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | allow hal_bluetooth_default vendor_wifi_vendor_data_file:dir { search }; 2 | allow hal_bluetooth_default vendor_wifi_vendor_data_file:file { read open }; 3 | -------------------------------------------------------------------------------- /gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_powershare_default.te: -------------------------------------------------------------------------------- 1 | allow hal_lineage_powershare_default vendor_sysfs_battery_supply:dir search; 2 | allow hal_lineage_powershare_default vendor_sysfs_battery_supply:file rw_file_perms; 3 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libqti-perfd-client.so 2 | libadsprpc.so 3 | libcdsprpc.so 4 | libsdsprpc.so 5 | libfastcvopt.so 6 | liblistensoundmodel2.so 7 | libOpenCL.so 8 | libSNPE.so 9 | libmialgo_ai_vision.so 10 | -------------------------------------------------------------------------------- /gps/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am - Automake script for gps loc_api 2 | # 3 | 4 | ACLOCAL_AMFLAGS = -I m4 5 | 6 | SUBDIRS = gnss 7 | 8 | pkgconfigdir = $(libdir)/pkgconfig 9 | pkgconfig_DATA = loc-hal.pc 10 | EXTRA_DIST = $(pkgconfig_DATA) 11 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "WifiOverlaySM8350", 8 | vendor: true, 9 | } 10 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_kernel_xiaomi_sm8350", 4 | "target_path": "kernel/xiaomi/sm8350" 5 | }, 6 | { 7 | "repository": "android_hardware_xiaomi", 8 | "target_path": "hardware/xiaomi" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /rro_overlays/SettingsOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "SettingsOverlaySM8350", 8 | vendor: true, 9 | } 10 | -------------------------------------------------------------------------------- /rro_overlays/SystemUIOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "SystemUIOverlaySM8350", 8 | vendor: true, 9 | } 10 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | wowlan_triggers=magic_pkt 5 | bss_max_count=400 6 | interworking=1 7 | config_methods=virtual_display virtual_push_button keypad 8 | driver_param="no_rrm=1" 9 | -------------------------------------------------------------------------------- /rro_overlays/FrameworkOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "FrameworkOverlaySM8350", 8 | vendor: true, 9 | } 10 | -------------------------------------------------------------------------------- /gps/gps_vendor_board.mk: -------------------------------------------------------------------------------- 1 | # Flags from BoardConfigVendor.mk 2 | ifneq ($(TARGET_USES_QMAA),true) 3 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 4 | else ifneq ($(TARGET_USES_QMAA_OVERRIDE_GPS),false) 5 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 6 | endif 7 | 8 | -------------------------------------------------------------------------------- /rro_overlays/FrameworkOverlayUDFPS/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "FrameworkOverlayUDFPS", 8 | device_specific: true, 9 | } 10 | -------------------------------------------------------------------------------- /gps/core/loc-core.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-core 7 | Description: QTI GPS Loc Core 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lloc_core 10 | Cflags: -I${includedir}/loc-core 11 | -------------------------------------------------------------------------------- /rro_overlays/LineageSDKOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "LineageSDKOverlaySM8350", 8 | product_specific: true, 9 | } 10 | -------------------------------------------------------------------------------- /rro_overlays/TelephonyOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "TelephonyOverlaySM8350", 8 | product_specific: true, 9 | } 10 | -------------------------------------------------------------------------------- /gps/utils/gps-utils.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: gps-utils 7 | Description: QTI GPS Location utils 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgps_utils 10 | Cflags: -I${includedir}/gps-utils 11 | -------------------------------------------------------------------------------- /power/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_static { 2 | name: "libpowermode-ext-xiaomi", 3 | defaults: ["android.hardware.power-ndk_shared"], 4 | vendor: true, 5 | srcs: [ 6 | "power-mode.cpp", 7 | ], 8 | shared_libs: [ 9 | "libbase", 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /rro_overlays/LineageSDKOverlayPowerShare/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "LineageSDKOverlayPowerShare", 8 | product_specific: true, 9 | } 10 | -------------------------------------------------------------------------------- /gps/location/location-api.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-api 7 | Description: Location API 8 | Version: @VERSION 9 | Libs: -L${libdir} -llocation_api 10 | Cflags: -I${includedir}/location-api 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | type audio_socket, file_type; 2 | type sound_device, dev_type; 3 | 4 | set_prop(hal_audio_default, vendor_audio_prop) 5 | 6 | allow hal_audio_default audio_socket:sock_file rw_file_perms; 7 | allow hal_audio_default sound_device:chr_file rw_file_perms; 8 | -------------------------------------------------------------------------------- /gps/batching/location-batching.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-batching 7 | Description: QTI GPS Batching 8 | Version: @VERSION 9 | Libs: -L${libdir} -lbatching 10 | Cflags: -I${includedir}/location-batching 11 | -------------------------------------------------------------------------------- /gps/geofence/location-geofence.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-geofence 7 | Description: QTI GPS Geofence 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgeofencing 10 | Cflags: -I${includedir}/location-geofence 11 | -------------------------------------------------------------------------------- /gps/loc-hal.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-hal 7 | Description: QTI GPS Loc HAL 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgnss 10 | Cflags: -I${includedir} -I${includedir}/utils -I${includedir}/core -I${includedir}/loc-hal 11 | -------------------------------------------------------------------------------- /rro_overlays/CarrierConfigOverlaySM8350/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "CarrierConfigOverlaySM8350", 8 | aaptflags: ["--keep-raw-values"], 9 | product_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /qcril-database/config/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | prebuilt_etc { 7 | name: "10.1_config.sql", 8 | src: "10.1_config.sql", 9 | relative_install_path: "qcril_database/upgrade/config", 10 | vendor: true, 11 | } 12 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_cameraperf.te: -------------------------------------------------------------------------------- 1 | add_hwservice(vendor_hal_cameraperf_server, vendor_hal_cameraperf_hwservice) 2 | allow vendor_hal_cameraperf_client vendor_hal_cameraperf_hwservice:hwservice_manager find; 3 | binder_call(vendor_hal_cameraperf_client, vendor_hal_cameraperf_server) 4 | binder_call(vendor_hal_cameraperf_server, vendor_hal_cameraperf_client) 5 | -------------------------------------------------------------------------------- /rootdir/etc/init.mi_thermald.rc: -------------------------------------------------------------------------------- 1 | on charger 2 | wait /sys/class/power_supply/usb/type 3 | start mi_thermald 4 | on boot 5 | wait /sys/class/power_supply/usb/type 6 | start mi_thermald 7 | 8 | service mi_thermald /system/vendor/bin/mi_thermald 9 | class main 10 | user root 11 | group system 12 | seclabel u:r:mi_thermald:s0 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_perf_default hal_audio_default:dir r_dir_perms; 2 | allow vendor_hal_perf_default hal_audio_default:file r_file_perms; 3 | allow vendor_hal_perf_default hal_fingerprint_default:dir r_dir_perms; 4 | allow vendor_hal_perf_default hal_fingerprint_default:file r_file_perms; 5 | allow vendor_hal_perf_default hal_camera_default:dir r_dir_perms; 6 | -------------------------------------------------------------------------------- /hidl/manifest_udfps.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.xiaomi.hardware.fx.tunnel 4 | hwbinder 5 | 1.0 6 | 7 | IMiFxTunnel 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /hidl/manifest_xiaomi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.xiaomi.hardware.campostproc 4 | hwbinder 5 | 1.0 6 | 7 | IMiPostProcService 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rro_overlays/SettingsOverlaySM8350/res/values/lineage_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | -------------------------------------------------------------------------------- /rro_overlays/LineageSDKOverlayPowerShare/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camerapostproc_xiaomi.te: -------------------------------------------------------------------------------- 1 | add_hwservice(vendor_hal_camerapostproc_xiaomi_server, vendor_hal_camerapostproc_xiaomi_hwservice) 2 | allow vendor_hal_camerapostproc_xiaomi_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; 3 | binder_call(vendor_hal_camerapostproc_xiaomi_client, vendor_hal_camerapostproc_xiaomi_server) 4 | binder_call(vendor_hal_camerapostproc_xiaomi_server, vendor_hal_camerapostproc_xiaomi_client) 5 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | soong_namespace { 7 | imports: [ 8 | "hardware/xiaomi", 9 | ], 10 | } 11 | 12 | install_symlink { 13 | name: "firmware_WCNSS_qcom_cfg.ini_symlink", 14 | vendor: true, 15 | installed_location: "firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini", 16 | symlink_target: "/vendor/etc/wifi/WCNSS_qcom_cfg.ini", 17 | } 18 | -------------------------------------------------------------------------------- /qcril-database/config/10.1_config.sql: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: The LineageOS Project 3 | SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | CREATE TABLE IF NOT EXISTS qcril_properties_table (property TEXT PRIMARY KEY NOT NULL, def_val TEXT, value TEXT); 7 | INSERT OR REPLACE INTO qcril_properties_table(property, def_val) VALUES('qcrildb_version',10.1); 8 | UPDATE qcril_properties_table SET def_val="false" WHERE property="persist.vendor.radio.redir_party_num"; 9 | -------------------------------------------------------------------------------- /rro_overlays/FrameworkOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /rro_overlays/FrameworkOverlayUDFPS/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /udfps/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | cc_library { 7 | name: "libudfpshandler", 8 | vendor: true, 9 | srcs: ["UdfpsHandler.cpp"], 10 | shared_libs: [ 11 | "libbase", 12 | ], 13 | static_libs: [ 14 | "android.hardware.biometrics.fingerprint-V4-ndk", 15 | ], 16 | header_libs: [ 17 | "//hardware/xiaomi:xiaomifingerprint_headers", 18 | ], 19 | } 20 | -------------------------------------------------------------------------------- /rro_overlays/LineageSDKOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/attributes: -------------------------------------------------------------------------------- 1 | # Camera 2 | attribute vendor_hal_cameraperf; 3 | attribute vendor_hal_cameraperf_client; 4 | attribute vendor_hal_cameraperf_server; 5 | attribute vendor_hal_camerapostproc_xiaomi; 6 | attribute vendor_hal_camerapostproc_xiaomi_client; 7 | attribute vendor_hal_camerapostproc_xiaomi_server; 8 | 9 | # Citsensor 10 | attribute vendor_hal_citsensorservice_xiaomi; 11 | attribute vendor_hal_citsensorservice_xiaomi_client; 12 | attribute vendor_hal_citsensorservice_xiaomi_server; 13 | -------------------------------------------------------------------------------- /rro_overlays/TelephonyOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /rro_overlays/LineageSDKOverlayPowerShare/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /rro_overlays/SettingsOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /rro_overlays/SystemUIOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /rro_overlays/CarrierConfigOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlaySM8350/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /gps/geofence/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgeofencing", 6 | vendor: true, 7 | 8 | 9 | 10 | srcs: [ 11 | "GeofenceAdapter.cpp", 12 | "location_geofence.cpp", 13 | ], 14 | 15 | shared_libs: [ 16 | "libutils", 17 | "libcutils", 18 | "libgps.utils", 19 | "liblog", 20 | "libloc_core", 21 | ], 22 | 23 | header_libs: [ 24 | "libgps.utils_headers", 25 | "libloc_core_headers", 26 | "libloc_pla_headers", 27 | "liblocation_api_headers", 28 | ], 29 | 30 | cflags: GNSS_CFLAGS, 31 | } 32 | -------------------------------------------------------------------------------- /gps/batching/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libbatching", 5 | vendor: true, 6 | 7 | 8 | 9 | shared_libs: [ 10 | "libutils", 11 | "libcutils", 12 | "liblog", 13 | "libloc_core", 14 | "libgps.utils", 15 | "libdl", 16 | ], 17 | 18 | srcs: [ 19 | "location_batching.cpp", 20 | "BatchingAdapter.cpp", 21 | ], 22 | 23 | header_libs: [ 24 | "libgps.utils_headers", 25 | "libloc_core_headers", 26 | "libloc_pla_headers", 27 | "liblocation_api_headers", 28 | ], 29 | 30 | cflags: GNSS_CFLAGS, 31 | } 32 | -------------------------------------------------------------------------------- /configs/privapp-permissions-hotword.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/batterysecret.te: -------------------------------------------------------------------------------- 1 | define(`batterysecret_sysfs', `{ 2 | vendor_sysfs_battery_supply 3 | vendor_sysfs_usb_c 4 | vendor_sysfs_usb_supply 5 | vendor_sysfs_usbpd_device 6 | }') 7 | 8 | type batterysecret, domain; 9 | type batterysecret_exec, exec_type, vendor_file_type, file_type; 10 | 11 | init_daemon_domain(batterysecret) 12 | 13 | allow batterysecret batterysecret_sysfs:dir search; 14 | allow batterysecret batterysecret_sysfs:file rw_file_perms; 15 | allow batterysecret kmsg_device:chr_file { getattr w_file_perms }; 16 | allow batterysecret self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 17 | 18 | wakelock_use(batterysecret) 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | vendor.camera.sensor. u:object_r:vendor_camera_sensor_prop:s0 3 | ro.boot.camera.config u:object_r:vendor_camera_sensor_prop:s0 4 | 5 | # Fingerprint 6 | persist.vendor.sys.fp. u:object_r:vendor_fp_prop:s0 7 | persist.vendor.sys.fp.info u:object_r:vendor_fp_info_prop:s0 8 | persist.vendor.sys.fp.uid u:object_r:vendor_fp_info_prop:s0 9 | ro.hardware.fp.udfps u:object_r:vendor_fp_prop:s0 10 | 11 | # Mlipay 12 | persist.vendor.sys.pay. u:object_r:vendor_mlipay_prop:s0 13 | persist.vendor.sys.provision.status u:object_r:vendor_mlipay_prop:s0 14 | -------------------------------------------------------------------------------- /rro_overlays/TelephonyOverlaySM8350/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | org.codeaurora.ims 9 | 10 | 11 | org.codeaurora.ims 12 | 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | type vendor_sysfs_iio, fs_type, sysfs_type; 2 | 3 | allow hal_sensors_default audio_socket:sock_file rw_file_perms; 4 | allow hal_sensors_default sound_device:chr_file rw_file_perms; 5 | allow hal_sensors_default hal_audio_default:unix_stream_socket connectto; 6 | 7 | allow hal_sensors_default iio_device:chr_file r_file_perms; 8 | allow hal_sensors_default vendor_sysfs_iio:dir r_dir_perms; 9 | allow hal_sensors_default vendor_sysfs_iio:file rw_file_perms; 10 | allow hal_sensors_default vendor_sysfs_udfps:file rw_file_perms; 11 | 12 | hal_client_domain(hal_sensors_default, hal_audio) 13 | allow hal_sensors_default hal_audio_hwservice:hwservice_manager find; 14 | -------------------------------------------------------------------------------- /gps/location/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "liblocation_api", 5 | vendor: true, 6 | 7 | 8 | 9 | shared_libs: [ 10 | "libutils", 11 | "libcutils", 12 | "libgps.utils", 13 | "libdl", 14 | "liblog", 15 | ], 16 | 17 | srcs: [ 18 | "LocationAPI.cpp", 19 | "LocationAPIClientBase.cpp", 20 | ], 21 | 22 | cflags: ["-fno-short-enums"] + GNSS_CFLAGS, 23 | 24 | header_libs: [ 25 | "libloc_pla_headers", 26 | "libgps.utils_headers", 27 | ], 28 | 29 | } 30 | 31 | cc_library_headers { 32 | 33 | name: "liblocation_api_headers", 34 | export_include_dirs: ["."], 35 | vendor: true, 36 | } 37 | -------------------------------------------------------------------------------- /rro_overlays/LineageSDKOverlaySM8350/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | 11 | 12 | restart 13 | restart_recovery 14 | restart_bootloader 15 | restart_fastboot 16 | 17 | 18 | -------------------------------------------------------------------------------- /gps/gnss/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgnss", 6 | vendor: true, 7 | 8 | 9 | 10 | shared_libs: [ 11 | "libutils", 12 | "libcutils", 13 | "libdl", 14 | "liblog", 15 | "libloc_core", 16 | "libgps.utils", 17 | ], 18 | 19 | srcs: [ 20 | "location_gnss.cpp", 21 | "GnssAdapter.cpp", 22 | "Agps.cpp", 23 | "XtraSystemStatusObserver.cpp", 24 | "NativeAgpsHandler.cpp", 25 | ], 26 | 27 | cflags: ["-fno-short-enums"] + GNSS_CFLAGS, 28 | header_libs: [ 29 | "libgps.utils_headers", 30 | "libloc_core_headers", 31 | "libloc_pla_headers", 32 | "liblocation_api_headers", 33 | ], 34 | 35 | } 36 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 1 | on fs 2 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 3 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 4 | # Load ADSP firmware for PMIC 5 | mkdir /firmware 6 | mount vfat /dev/block/bootdevice/by-name/modem${ro.boot.slot_suffix} /firmware ro context=u:object_r:firmware_file:s0 7 | 8 | on init 9 | setprop sys.usb.configfs 1 10 | 11 | on property:ro.boot.usbcontroller=* 12 | setprop sys.usb.controller ${ro.boot.usbcontroller} 13 | write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral 14 | 15 | on property:dev.mnt.blk.firmware=* 16 | write /sys/kernel/boot_adsp/boot 1 17 | 18 | on property:init.svc.fastbootd=running 19 | umount /firmware 20 | -------------------------------------------------------------------------------- /rro_overlays/FrameworkOverlayUDFPS/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | org.lineageos.sensor.udfps 9 | 10 | 11 | true 12 | 13 | 15 | false 16 | 17 | -------------------------------------------------------------------------------- /rootdir/etc/charger_fstab.qcom: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Qualcomm Technologies, Inc. 3 | # All Rights Reserved. 4 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 5 | # 6 | # Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 7 | # 8 | 9 | # Android fstab file. 10 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 11 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 12 | 13 | # 14 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait 15 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 16 | -------------------------------------------------------------------------------- /gps/android/utils/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_static { 2 | 3 | name: "liblocbatterylistener", 4 | vendor: true, 5 | 6 | 7 | 8 | cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"], 9 | local_include_dirs: ["."], 10 | 11 | srcs: ["battery_listener.cpp"], 12 | 13 | shared_libs: [ 14 | "liblog", 15 | "libhidlbase", 16 | "libcutils", 17 | "libutils", 18 | "android.hardware.health@1.0", 19 | "android.hardware.health@2.0", 20 | "android.hardware.health@2.1", 21 | "android.hardware.power@1.2", 22 | "libbase", 23 | ], 24 | 25 | static_libs: ["libhealthhalutils"], 26 | 27 | header_libs: [ 28 | "libgps.utils_headers", 29 | "libloc_pla_headers", 30 | ], 31 | } 32 | 33 | cc_library_headers { 34 | 35 | name: "liblocbatterylistener_headers", 36 | vendor: true, 37 | export_include_dirs: ["."], 38 | } 39 | -------------------------------------------------------------------------------- /rootdir/bin/vendor_modprobe.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | #============================================================================= 3 | # Copyright (c) 2019-2020 Qualcomm Technologies, Inc. 4 | # All Rights Reserved. 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 6 | #============================================================================= 7 | 8 | MODULES_PATH="/vendor/lib/modules/" 9 | 10 | MODPROBE="/vendor/bin/modprobe" 11 | MODULES=`${MODPROBE} -d ${MODULES_PATH} -l` 12 | 13 | # Iterate over module list and modprobe them in background. 14 | for MODULE in ${MODULES}; do 15 | if [ ${MODULE} == "qca_cld3_wlan" ]; then 16 | echo "Xiaomi Wifi:" ${MODULE} 17 | elif [ ${MODULE} == "cnss2" ]; then 18 | echo "Xiaomi Wifi:" ${MODULE} 19 | else 20 | ${MODPROBE} -a -b -d ${MODULES_PATH} ${MODULE} & 21 | fi 22 | done 23 | 24 | # Wait until all the modprobes are finished 25 | wait 26 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | type camera_persist_file, vendor_persist_type, file_type; 2 | type vendor_hal_cameraperf_hwservice, hwservice_manager_type, protected_hwservice; 3 | type vendor_hal_camerapostproc_xiaomi_hwservice, hwservice_manager_type; 4 | vendor_internal_prop(vendor_camera_sensor_prop) 5 | 6 | set_prop(hal_camera_default, vendor_camera_sensor_prop) 7 | r_dir_file(hal_camera_default, camera_persist_file) 8 | allow hal_camera_default mnt_vendor_file:dir search; 9 | 10 | hal_server_domain(hal_camera_default, vendor_hal_cameraperf) 11 | hal_server_domain(hal_camera_default, vendor_hal_camerapostproc_xiaomi) 12 | add_hwservice(hal_camera_server, vendor_hal_cameraperf_hwservice) 13 | add_hwservice(hal_camera_server, vendor_hal_camerapostproc_xiaomi_hwservice) 14 | allow hal_camera_client vendor_hal_cameraperf_hwservice:hwservice_manager find; 15 | allow hal_camera_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_mlipay.te: -------------------------------------------------------------------------------- 1 | type hal_mlipay_hwservice, hwservice_manager_type; 2 | 3 | type hal_mlipay_default, domain; 4 | hal_server_domain(hal_mlipay_default, hal_mlipay) 5 | 6 | type hal_mlipay_default_exec, exec_type, vendor_file_type, file_type; 7 | init_daemon_domain(hal_mlipay_default) 8 | 9 | vendor_public_prop(vendor_mlipay_prop) 10 | 11 | # Allow hwbinder call from hal client to server 12 | binder_call(hal_mlipay_client, hal_mlipay_server) 13 | 14 | # Add hwservice related rules 15 | add_hwservice(hal_mlipay_server, hal_mlipay_hwservice) 16 | allow hal_mlipay_client hal_mlipay_hwservice:hwservice_manager find; 17 | 18 | allow hal_mlipay_default tee_device:chr_file rw_file_perms; 19 | allow hal_mlipay_default ion_device:chr_file r_file_perms; 20 | 21 | r_dir_file(hal_mlipay_default, firmware_file) 22 | set_prop(hal_mlipay_default, vendor_mlipay_prop); 23 | 24 | get_prop(hal_mlipay_default, vendor_fp_prop) 25 | get_prop(hal_mlipay_default, vendor_fp_info_prop) 26 | -------------------------------------------------------------------------------- /qcril-database/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | filegroup { 7 | name: "rildb_config_sql_files", 8 | srcs: [ 9 | "config/10.1_config.sql", 10 | ], 11 | } 12 | 13 | genrule { 14 | name: "qcril_config_database", 15 | enabled: true, 16 | srcs: [ 17 | "//vendor/xiaomi/sm8350-common:proprietary_rildb_config_sql_files", 18 | "//vendor/xiaomi/sm8350-common:proprietary_rildb_other_sql_files", 19 | ":rildb_config_sql_files", 20 | ], 21 | tools: [ 22 | "generate_qcril_db", 23 | ], 24 | cmd: "$(location generate_qcril_db) $(out) $(in)", 25 | out: ["qcrilNr.db"], 26 | } 27 | 28 | prebuilt_etc { 29 | name: "qcrilNrDb_vendor", 30 | filename: "qcrilNr.db", 31 | src: ":qcril_config_database", 32 | relative_install_path: "qcril_database", 33 | vendor: true, 34 | required: [ 35 | "10.1_config.sql", 36 | ], 37 | } 38 | -------------------------------------------------------------------------------- /gps/gnss/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(LOCPLA_CFLAGS) \ 3 | $(LOCHAL_CFLAGS) \ 4 | $(GPSUTILS_CFLAGS) \ 5 | $(LOCCORE_CFLAGS) \ 6 | -I./ \ 7 | -I../utils \ 8 | -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ 9 | -I../location \ 10 | -std=c++1y 11 | 12 | libgnss_la_SOURCES = \ 13 | location_gnss.cpp \ 14 | GnssAdapter.cpp \ 15 | XtraSystemStatusObserver.cpp \ 16 | Agps.cpp \ 17 | NativeAgpsHandler.cpp 18 | 19 | if USE_GLIB 20 | libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 21 | libgnss_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -avoid-version 22 | libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 23 | else 24 | libgnss_la_CFLAGS = $(AM_CFLAGS) 25 | libgnss_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 26 | libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 27 | endif 28 | 29 | libgnss_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) $(LOCCORE_LIBS) 30 | 31 | #Create and Install libraries 32 | lib_LTLIBRARIES = libgnss.la 33 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # Bluetooth 2 | vendor.bluetooth.soc=hastings 3 | 4 | # CNE 5 | persist.vendor.cne.feature=1 6 | 7 | # Graphics 8 | debug.sf.disable_backpressure=1 9 | debug.sf.enable_hwc_vds=1 10 | 11 | # IMS 12 | persist.dbg.volte_avail_ovr=1 13 | persist.dbg.vt_avail_ovr=1 14 | persist.dbg.wfc_avail_ovr=1 15 | 16 | # Media 17 | media.aac_51_output_enabled=true 18 | media.stagefright.enable-aac=true 19 | media.stagefright.enable-fma2dp=true 20 | media.stagefright.enable-http=true 21 | media.stagefright.enable-player=true 22 | media.stagefright.enable-qcp=true 23 | media.stagefright.enable-scan=true 24 | persist.mm.enable.prefetch=true 25 | ro.media.recorder-max-base-layer-fps=60 26 | vendor.mm.enable.qcom_parser=16777215 27 | 28 | # NFC 29 | ro.nfc.port=I2C 30 | 31 | # QC framework value-adds 32 | ro.vendor.qti.va_aosp.support=1 33 | 34 | # Qcom 35 | ro.vendor.qti.sys.fw.bservice_enable=true 36 | 37 | # Radio 38 | DEVICE_PROVISIONED=1 39 | ril.subscription.types=NV,RUIM 40 | 41 | # Sensors 42 | persist.vendor.sensors.enable.mag_filter=true 43 | 44 | # WFD 45 | persist.debug.wfd.enable=1 46 | -------------------------------------------------------------------------------- /gps/etc/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file - lahaina 4 | # 5 | # GENERAL DESCRIPTION 6 | # This file contains the config params for LOWI 7 | # 8 | # Copyright (c) 2019 Qualcomm Technologies, Inc. 9 | # All Rights Reserved. 10 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 11 | # 12 | # 2012-2013 Qualcomm Atheros, Inc. 13 | # All Rights Reserved. 14 | # Qualcomm Atheros Confidential and Proprietary. 15 | # 16 | # Export of this technology or software is regulated by the U.S. Government. 17 | # Diversion contrary to U.S. law prohibited. 18 | #=============================================================================*/ 19 | 20 | # X86 ONLY - UBUNTU: 21 | # Copy this file in the same directory where the executable is 22 | 23 | # Log level 24 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 25 | LOWI_LOG_LEVEL = 3 26 | LOWI_USE_LOWI_LP = 0 27 | LOWI_HE_RTT_SUPPORT = 1 28 | LOWI_USE_NLMSG_FOR_CAPS = 1 29 | LOWI_RTT_WEIGHTED_MEAN = 1 30 | LOWI_USE_6G_CHANNELS = 1 31 | -------------------------------------------------------------------------------- /gps/etc/Android.bp: -------------------------------------------------------------------------------- 1 | prebuilt_etc { 2 | name: "apdr.conf", 3 | vendor: true, 4 | src: "apdr.conf", 5 | } 6 | 7 | prebuilt_etc { 8 | name: "flp.conf", 9 | vendor: true, 10 | src: "flp.conf", 11 | } 12 | 13 | prebuilt_etc { 14 | name: "gnss_antenna_info.conf", 15 | vendor: true, 16 | src: "gnss_antenna_info.conf", 17 | } 18 | 19 | prebuilt_etc { 20 | name: "gps.conf", 21 | vendor: true, 22 | src: "gps.conf", 23 | } 24 | 25 | prebuilt_etc { 26 | name: "izat.conf", 27 | vendor: true, 28 | src: "izat.conf", 29 | } 30 | 31 | prebuilt_etc { 32 | name: "lowi.conf", 33 | vendor: true, 34 | src: "lowi.conf", 35 | } 36 | 37 | prebuilt_etc { 38 | name: "sap.conf", 39 | vendor: true, 40 | src: "sap.conf", 41 | } 42 | 43 | prebuilt_etc { 44 | name: "gnss@2.0-base.policy", 45 | vendor: true, 46 | sub_dir: "seccomp_policy", 47 | src: "seccomp_policy/gnss@2.0-base.policy", 48 | } 49 | 50 | prebuilt_etc { 51 | name: "gnss@2.0-xtra-daemon.policy", 52 | vendor: true, 53 | sub_dir: "seccomp_policy", 54 | src: "seccomp_policy/gnss@2.0-xtra-daemon.policy", 55 | } 56 | -------------------------------------------------------------------------------- /gps/utils/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libgps.utils", 5 | vendor: true, 6 | 7 | 8 | 9 | //# Libs 10 | shared_libs: [ 11 | "libdl", 12 | "libutils", 13 | "libcutils", 14 | "liblog", 15 | "libprocessgroup", 16 | ], 17 | 18 | srcs: [ 19 | "loc_log.cpp", 20 | "loc_cfg.cpp", 21 | "msg_q.c", 22 | "linked_list.c", 23 | "loc_target.cpp", 24 | "LocHeap.cpp", 25 | "LocTimer.cpp", 26 | "LocThread.cpp", 27 | "MsgTask.cpp", 28 | "loc_misc_utils.cpp", 29 | "loc_nmea.cpp", 30 | "LocIpc.cpp", 31 | "LogBuffer.cpp", 32 | ], 33 | 34 | cflags: [ 35 | "-fno-short-enums", 36 | "-D_ANDROID_", 37 | ] + GNSS_CFLAGS, 38 | 39 | //# Includes 40 | ldflags: ["-Wl,--export-dynamic"], 41 | 42 | header_libs: [ 43 | "libutils_headers", 44 | "libloc_pla_headers", 45 | "liblocation_api_headers", 46 | ], 47 | } 48 | 49 | cc_library_headers { 50 | 51 | name: "libgps.utils_headers", 52 | export_include_dirs: ["."], 53 | vendor: true, 54 | } 55 | -------------------------------------------------------------------------------- /rootdir/etc/init.batterysecret.rc: -------------------------------------------------------------------------------- 1 | on property:sys.boot_completed=1 2 | chmod 0664 /sys/class/qcom-battery/pd_verifed 3 | chmod 0664 /sys/class/qcom-battery/request_vdm_cmd 4 | chmod 0664 /sys/class/qcom-battery/verify_process 5 | chmod 0664 /sys/class/qcom-battery/authentic 6 | chmod 0664 /sys/class/qcom-battery/verify_slave_flag 7 | chmod 0664 /sys/class/qcom-battery/slave_authentic 8 | chmod 0664 /sys/class/qcom-battery/is_old_hw 9 | 10 | service batterysecret /vendor/bin/batterysecret 11 | class last_start 12 | user root 13 | group system system wakelock 14 | disabled 15 | seclabel u:r:batterysecret:s0 16 | 17 | on property:sys.boot_completed=1 18 | start batterysecret 19 | 20 | #run batterysecret in off-charge mode 21 | on charger 22 | start batterysecret 23 | chmod 0664 /sys/class/qcom-battery/pd_verifed 24 | chmod 0664 /sys/class/qcom-battery/request_vdm_cmd 25 | chmod 0664 /sys/class/qcom-battery/verify_process 26 | chmod 0664 /sys/class/qcom-battery/authentic 27 | chmod 0664 /sys/class/qcom-battery/verify_slave_flag 28 | chmod 0664 /sys/class/qcom-battery/slave_authentic 29 | chmod 0664 /sys/class/qcom-battery/is_old_hw -------------------------------------------------------------------------------- /gps/core/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libloc_core", 5 | vendor: true, 6 | 7 | 8 | 9 | shared_libs: [ 10 | "liblog", 11 | "libutils", 12 | "libcutils", 13 | "libgps.utils", 14 | "libdl", 15 | "liblog", 16 | ], 17 | 18 | srcs: [ 19 | "LocApiBase.cpp", 20 | "LocAdapterBase.cpp", 21 | "ContextBase.cpp", 22 | "LocContext.cpp", 23 | "loc_core_log.cpp", 24 | "data-items/DataItemsFactoryProxy.cpp", 25 | "SystemStatusOsObserver.cpp", 26 | "SystemStatus.cpp", 27 | ], 28 | 29 | cflags: [ 30 | "-fno-short-enums", 31 | "-D_ANDROID_", 32 | ] + GNSS_CFLAGS, 33 | 34 | local_include_dirs: [ 35 | "data-items", 36 | "observer", 37 | ], 38 | 39 | header_libs: [ 40 | "libutils_headers", 41 | "libgps.utils_headers", 42 | "libloc_pla_headers", 43 | "liblocation_api_headers", 44 | ], 45 | 46 | } 47 | 48 | cc_library_headers { 49 | 50 | name: "libloc_core_headers", 51 | vendor: true, 52 | export_include_dirs: ["."] + [ 53 | "data-items", 54 | "observer", 55 | ], 56 | } 57 | -------------------------------------------------------------------------------- /sepolicy/vendor/mi_thermald.te: -------------------------------------------------------------------------------- 1 | type mi_thermald, domain; 2 | type mi_thermald_exec, exec_type, vendor_file_type, file_type; 3 | type thermal_data_file, data_file_type, file_type; 4 | 5 | init_daemon_domain(mi_thermald) 6 | 7 | r_dir_file(mi_thermald, sysfs) 8 | r_dir_file(mi_thermald, sysfs_leds) 9 | r_dir_file(mi_thermald, sysfs_thermal) 10 | r_dir_file(mi_thermald, vendor_sysfs_kgsl) 11 | r_dir_file(mi_thermald, vendor_sysfs_battery_supply) 12 | r_dir_file(mi_thermald, vendor_sysfs_graphics) 13 | r_dir_file(mi_thermald, thermal_data_file) 14 | r_dir_file(mi_thermald, vendor_data_file) 15 | 16 | allow mi_thermald sysfs:file w_file_perms; 17 | allow mi_thermald sysfs_thermal:file w_file_perms; 18 | allow mi_thermald vendor_sysfs_kgsl:file w_file_perms; 19 | allow mi_thermald vendor_sysfs_battery_supply:file w_file_perms; 20 | allow mi_thermald vendor_sysfs_graphics:file w_file_perms; 21 | allow mi_thermald thermal_data_file:dir w_dir_perms; 22 | allow mi_thermald thermal_data_file:file create_file_perms; 23 | allow mi_thermald vendor_data_file:file rw_file_perms; 24 | allow mi_thermald vendor_data_file:dir w_dir_perms; 25 | allow mi_thermald sysfs_devices_system_cpu:file rw_file_perms; 26 | 27 | allow mi_thermald self:capability { fsetid sys_boot chown fowner }; 28 | allow mi_thermald self:capability2 { wake_alarm block_suspend }; 29 | -------------------------------------------------------------------------------- /gps/batching/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(GPSUTILS_CFLAGS) \ 3 | $(LOCCORE_CFLAGS) \ 4 | -I./ \ 5 | -std=c++1y \ 6 | -D__func__=__PRETTY_FUNCTION__ \ 7 | -fno-short-enums 8 | 9 | ACLOCAL_AMFLAGS = -I m4 10 | 11 | requiredlibs = \ 12 | $(GPSUTILS_LIBS) \ 13 | $(LOCCORE_LIBS) \ 14 | -llog 15 | 16 | h_sources = \ 17 | BatchingAdapter.h 18 | 19 | libbatching_la_SOURCES = \ 20 | location_batching.cpp \ 21 | BatchingAdapter.cpp 22 | 23 | if USE_GLIB 24 | libbatching_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 25 | libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -shared -version-info 1:0:0 26 | libbatching_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 27 | else 28 | libbatching_la_CFLAGS = $(AM_CFLAGS) 29 | libbatching_la_LDFLAGS = -Wl,-z,defs -lpthread $(requiredlibs) -shared -version-info 1:0:0 30 | libbatching_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 31 | endif 32 | 33 | library_include_HEADERS = $(h_sources) 34 | 35 | library_includedir = $(pkgincludedir) 36 | 37 | #Create and Install libraries 38 | lib_LTLIBRARIES = libbatching.la 39 | 40 | pkgconfigdir = $(libdir)/pkgconfig 41 | pkgconfig_DATA = location-batching.pc 42 | sysconf_DATA = $(WORKSPACE)/hardware/qcom/gps/etc/flp.conf 43 | EXTRA_DIST = $(pkgconfig_DATA) 44 | 45 | -------------------------------------------------------------------------------- /gps/location/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = \ 4 | -I./ \ 5 | -I../utils \ 6 | $(LOCPLA_CFLAGS) \ 7 | $(GPSUTILS_CFLAGS) \ 8 | -std=c++11 9 | 10 | liblocation_api_la_SOURCES = \ 11 | LocationAPI.cpp \ 12 | LocationAPIClientBase.cpp 13 | 14 | if USE_EXTERNAL_AP 15 | AM_CFLAGS += -DFEATURE_EXTERNAL_AP 16 | endif 17 | 18 | if USE_GLIB 19 | liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 20 | liblocation_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 21 | liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 22 | else 23 | liblocation_api_la_CFLAGS = $(AM_CFLAGS) 24 | liblocation_api_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 25 | liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 26 | endif 27 | 28 | liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) 29 | 30 | library_include_HEADERS = \ 31 | LocationAPI.h \ 32 | LocationAPIClientBase.h \ 33 | location_interface.h \ 34 | LocationDataTypes.h \ 35 | ILocationAPI.h 36 | 37 | #Create and Install libraries 38 | lib_LTLIBRARIES = liblocation_api.la 39 | 40 | library_includedir = $(pkgincludedir) 41 | 42 | pkgconfigdir = $(libdir)/pkgconfig 43 | pkgconfig_DATA = location-api.pc 44 | EXTRA_DIST = $(pkgconfig_DATA) 45 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_hal_citsensorservice_xiaomi.te: -------------------------------------------------------------------------------- 1 | type vendor_hal_citsensorservice_xiaomi_hwservice, hwservice_manager_type, protected_hwservice; 2 | 3 | type vendor_hal_citsensorservice_xiaomi_default, domain; 4 | hal_server_domain(vendor_hal_citsensorservice_xiaomi_default, vendor_hal_citsensorservice_xiaomi) 5 | 6 | type vendor_hal_citsensorservice_xiaomi_default_exec, exec_type, vendor_file_type, file_type; 7 | init_daemon_domain(vendor_hal_citsensorservice_xiaomi_default) 8 | 9 | hal_attribute_hwservice(vendor_hal_citsensorservice_xiaomi, vendor_hal_citsensorservice_xiaomi_hwservice) 10 | 11 | binder_call(vendor_hal_citsensorservice_xiaomi_client, vendor_hal_citsensorservice_xiaomi_server) 12 | binder_call(vendor_hal_citsensorservice_xiaomi_server, vendor_hal_citsensorservice_xiaomi_client) 13 | 14 | allow vendor_hal_citsensorservice_xiaomi self:{ socket qipcrtr_socket } create_socket_perms; 15 | allowxperm vendor_hal_citsensorservice_xiaomi self:{ socket qipcrtr_socket } ioctl msm_sock_ipc_ioctls; 16 | 17 | allow vendor_hal_citsensorservice_xiaomi_default fwk_sensor_hwservice:hwservice_manager find; 18 | allow vendor_hal_citsensorservice_xiaomi_default system_server:binder call; 19 | 20 | r_dir_file(vendor_hal_citsensorservice_xiaomi_default, vendor_sysfs_graphics) 21 | 22 | allow vendor_hal_citsensorservice_xiaomi_default input_device:dir r_dir_perms; 23 | allow vendor_hal_citsensorservice_xiaomi_default input_device:chr_file rw_file_perms; 24 | -------------------------------------------------------------------------------- /gps/geofence/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wundef \ 2 | -Wno-trigraphs \ 3 | -g -O0 \ 4 | -fno-inline \ 5 | -fno-short-enums \ 6 | -fpic \ 7 | ${GPSUTILS_CFLAGS} \ 8 | ${LOCCORE_CFLAGS} \ 9 | $(LOCPLA_CFLAGS) \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -std=c++1y 12 | 13 | AM_CPPFLAGS = $(AM_CFLAGS) 14 | 15 | ACLOCAL_AMFLAGS = -I m4 16 | 17 | requiredlibs = \ 18 | ${LOCCORE_LIBS} \ 19 | $(GPSUTILS_LIBS) \ 20 | -llog 21 | 22 | h_sources = \ 23 | GeofenceAdapter.h 24 | 25 | c_sources = \ 26 | GeofenceAdapter.cpp \ 27 | location_geofence.cpp 28 | 29 | libgeofencing_la_SOURCES = $(c_sources) 30 | if USE_GLIB 31 | libgeofencing_la_CFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) 32 | libgeofencing_la_CPPFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) $(AM_CPPFLAGS) 33 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs @GLIB_LIBS@ $(requiredlibs) -shared -version-info 1:0:0 34 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ @GLIB_LIBS@ 35 | else 36 | libgeofencing_la_CFLAGS = $(AM_CFLAGS) 37 | libgeofencing_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 38 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs $(requiredlibs) -shared -version-info 1:0:0 39 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ 40 | endif 41 | 42 | library_include_HEADERS = $(h_sources) 43 | 44 | library_includedir = $(pkgincludedir) 45 | 46 | lib_LTLIBRARIES = libgeofencing.la 47 | 48 | pkgconfigdir = $(libdir)/pkgconfig 49 | pkgconfig_DATA = location-geofence.pc 50 | EXTRA_DIST = $(pkgconfig_DATA) 51 | -------------------------------------------------------------------------------- /power/power-mode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: The LineageOS Project 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | // defines from drivers/input/touchscreen/xiaomi/xiaomi_touch.h 12 | #define SET_CUR_VALUE 0 13 | #define Touch_Doubletap_Mode 14 14 | 15 | #define TOUCH_DEV_PATH "/dev/xiaomi-touch" 16 | #define TOUCH_ID 0 17 | #define TOUCH_MAGIC 0x5400 18 | #define TOUCH_IOC_SETMODE TOUCH_MAGIC + SET_CUR_VALUE 19 | 20 | namespace aidl { 21 | namespace android { 22 | namespace hardware { 23 | namespace power { 24 | namespace impl { 25 | 26 | using ::aidl::android::hardware::power::Mode; 27 | 28 | bool isDeviceSpecificModeSupported(Mode type, bool* _aidl_return) { 29 | switch (type) { 30 | case Mode::DOUBLE_TAP_TO_WAKE: 31 | *_aidl_return = true; 32 | return true; 33 | default: 34 | return false; 35 | } 36 | } 37 | 38 | bool setDeviceSpecificMode(Mode type, bool enabled) { 39 | switch (type) { 40 | case Mode::DOUBLE_TAP_TO_WAKE: { 41 | int fd = open(TOUCH_DEV_PATH, O_RDWR); 42 | int arg[3] = {TOUCH_ID, Touch_Doubletap_Mode, enabled ? 1 : 0}; 43 | ioctl(fd, TOUCH_IOC_SETMODE, &arg); 44 | close(fd); 45 | return true; 46 | } 47 | default: 48 | return false; 49 | } 50 | } 51 | 52 | } // namespace impl 53 | } // namespace power 54 | } // namespace hardware 55 | } // namespace android 56 | } // namespace aidl 57 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | vendor.xiaomi.hardware.cameraperf::IMiCameraPerfService u:object_r:vendor_hal_cameraperf_hwservice:s0 3 | vendor.xiaomi.hardware.campostproc::IMiPostProcService u:object_r:vendor_hal_camerapostproc_xiaomi_hwservice:s0 4 | 5 | # Fingerprint 6 | vendor.xiaomi.hardware.fx.tunnel::IMiFxTunnel u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 7 | vendor.xiaomi.hardware.fingerprintextension::IXiaomiFingerprint u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 8 | com.fingerprints.extension::IFingerprintEngineering u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 9 | com.fingerprints.extension::IFingerprintAuthenticator u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 10 | com.fingerprints.extension::IFingerprintNavigation u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 11 | com.fingerprints.extension::IFingerprintSensorTest u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 12 | com.fingerprints.extension::IFingerprintCalibration u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 13 | com.fingerprints.extension::IFingerprintOptical u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 14 | 15 | # Mlipay 16 | vendor.xiaomi.hardware.mlipay::IMlipayService u:object_r:hal_mlipay_hwservice:s0 17 | 18 | # Sensors 19 | vendor.xiaomi.hardware.citsensorservice::ICitSensorService u:object_r:vendor_hal_citsensorservice_xiaomi_hwservice:s0 20 | -------------------------------------------------------------------------------- /config.fs: -------------------------------------------------------------------------------- 1 | [AID_VENDOR_QTI_DIAG] 2 | value:2901 3 | 4 | [AID_VENDOR_QDSS] 5 | value:2902 6 | 7 | [AID_VENDOR_RFS] 8 | value:2903 9 | 10 | [AID_VENDOR_RFS_SHARED] 11 | value:2904 12 | 13 | [AID_VENDOR_ADPL_ODL] 14 | value:2905 15 | 16 | [AID_VENDOR_QRTR] 17 | value:2906 18 | 19 | [AID_VENDOR_THERMAL] 20 | value:2907 21 | 22 | [AID_VENDOR_FASTRPC] 23 | value:2908 24 | 25 | [AID_VENDOR_QTR] 26 | value:2909 27 | 28 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 29 | mode: 0755 30 | user: AID_BLUETOOTH 31 | group: AID_BLUETOOTH 32 | caps: BLOCK_SUSPEND NET_ADMIN 33 | 34 | [vendor/bin/pm-service] 35 | mode: 0755 36 | user: AID_SYSTEM 37 | group: AID_SYSTEM 38 | caps: NET_BIND_SERVICE SYS_BOOT 39 | 40 | [vendor/bin/pd-mapper] 41 | mode: 0755 42 | user: AID_SYSTEM 43 | group: AID_SYSTEM 44 | caps: NET_BIND_SERVICE 45 | 46 | [vendor/bin/imsdatadaemon] 47 | mode: 0755 48 | user: AID_RADIO 49 | group: AID_RADIO 50 | caps: NET_BIND_SERVICE 51 | 52 | [vendor/bin/ims_rtp_daemon] 53 | mode: 0755 54 | user: AID_RADIO 55 | group: AID_RADIO 56 | caps: NET_BIND_SERVICE 57 | 58 | [vendor/bin/imsrcsd] 59 | mode: 0755 60 | user: AID_RADIO 61 | group: AID_RADIO 62 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 63 | 64 | [vendor/bin/imsdaemon] 65 | mode: 0755 66 | user: AID_RADIO 67 | group: AID_RADIO 68 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 69 | 70 | [vendor/bin/cnd] 71 | mode: 0755 72 | user: AID_SYSTEM 73 | group: AID_SYSTEM 74 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 75 | 76 | [vendor/bin/loc_launcher] 77 | mode: 0755 78 | user: AID_GPS 79 | group: AID_GPS 80 | caps: SETUID SETGID 81 | 82 | [vendor/bin/sensors.qti] 83 | mode: 0755 84 | user: AID_SYSTEM 85 | group: AID_SYSTEM 86 | caps: NET_BIND_SERVICE 87 | 88 | [vendor/firmware_mnt/image/*] 89 | mode: 0771 90 | user: AID_SYSTEM 91 | group: AID_SYSTEM 92 | caps: 0 93 | -------------------------------------------------------------------------------- /gps/gps_vendor_product.mk: -------------------------------------------------------------------------------- 1 | # HAL packages 2 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 3 | 4 | # GPS-HIDL 5 | LOC_BOARD_PLATFORM_LIST += msm8937 6 | LOC_BOARD_PLATFORM_LIST += msm8953 7 | LOC_BOARD_PLATFORM_LIST += msm8998 8 | LOC_BOARD_PLATFORM_LIST += apq8098_latv 9 | LOC_BOARD_PLATFORM_LIST += sdm710 10 | LOC_BOARD_PLATFORM_LIST += qcs605 11 | LOC_BOARD_PLATFORM_LIST += sdm845 12 | LOC_BOARD_PLATFORM_LIST += sdm660 13 | LOC_BOARD_PLATFORM_LIST += msmnile 14 | LOC_BOARD_PLATFORM_LIST += sdmshrike 15 | LOC_BOARD_PLATFORM_LIST += $(MSMSTEPPE) 16 | LOC_BOARD_PLATFORM_LIST += $(TRINKET) 17 | LOC_BOARD_PLATFORM_LIST += kona 18 | LOC_BOARD_PLATFORM_LIST += atoll 19 | LOC_BOARD_PLATFORM_LIST += lito 20 | LOC_BOARD_PLATFORM_LIST += bengal 21 | LOC_BOARD_PLATFORM_LIST += lahaina 22 | LOC_BOARD_PLATFORM_LIST += holi 23 | 24 | # Add product packages 25 | ifneq (,$(filter $(LOC_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM))) 26 | 27 | PRODUCT_PACKAGES += gps.conf 28 | PRODUCT_PACKAGES += flp.conf 29 | PRODUCT_PACKAGES += gnss_antenna_info.conf 30 | PRODUCT_PACKAGES += gnss@2.0-base.policy 31 | PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy 32 | PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy 33 | PRODUCT_PACKAGES += gnss@2.0-xtwifi-inet-agent.policy 34 | PRODUCT_PACKAGES += libloc_pla_headers 35 | PRODUCT_PACKAGES += liblocation_api_headers 36 | PRODUCT_PACKAGES += libgps.utils_headers 37 | PRODUCT_PACKAGES += liblocation_api 38 | PRODUCT_PACKAGES += libgps.utils 39 | PRODUCT_PACKAGES += libbatching 40 | PRODUCT_PACKAGES += libgeofencing 41 | PRODUCT_PACKAGES += libloc_core 42 | PRODUCT_PACKAGES += libgnss 43 | 44 | PRODUCT_PACKAGES += android.hardware.gnss@2.1-impl-qti 45 | PRODUCT_PACKAGES += android.hardware.gnss@2.1-service-qti 46 | 47 | endif # ifneq (,$(filter $(LOC_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM))) 48 | endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 49 | -------------------------------------------------------------------------------- /gps/utils/LocLoggerBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_LOGGER_BASE_H 30 | #define LOC_LOGGER_BASE_H 31 | 32 | namespace loc_util { 33 | class LocLoggerBase { 34 | public: 35 | virtual void log() {} 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | type vendor_fingerprint_device, dev_type; 2 | type vendor_hal_fingerprint_hwservice_xiaomi, hwservice_manager_type; 3 | type vendor_sysfs_udfps, sysfs_type, fs_type; 4 | vendor_restricted_prop(vendor_fp_prop) 5 | vendor_internal_prop(vendor_fp_info_prop) 6 | 7 | # Binder 8 | add_hwservice(hal_fingerprint_default, vendor_hal_fingerprint_hwservice_xiaomi) 9 | allow hal_fingerprint_default vendor_hal_perf_default:binder call; 10 | allow hal_fingerprint_default vendor_hal_perf_hwservice:hwservice_manager find; 11 | 12 | # Netlink_socket 13 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 14 | 15 | # Capability 16 | allow hal_fingerprint_default self:capability { sys_nice }; 17 | 18 | # Props 19 | set_prop(hal_fingerprint_default, vendor_fp_prop) 20 | set_prop(hal_fingerprint_default, vendor_fp_info_prop) 21 | 22 | # Sysfs 23 | allow hal_fingerprint_default sysfs_rtc:dir r_dir_perms; 24 | allow hal_fingerprint_default sysfs_rtc:file rw_file_perms; 25 | allow hal_fingerprint_default vendor_sysfs_spss:dir r_dir_perms; 26 | allow hal_fingerprint_default vendor_sysfs_spss:file rw_file_perms; 27 | allow hal_fingerprint_default vendor_sysfs_fingerprint:dir r_dir_perms; 28 | allow hal_fingerprint_default vendor_sysfs_fingerprint:file rw_file_perms; 29 | allow hal_fingerprint_default vendor_sysfs_udfps:file rw_file_perms; 30 | allow hal_fingerprint_default vendor_sysfs_graphics:dir r_dir_perms; 31 | allow hal_fingerprint_default vendor_sysfs_graphics:file rw_file_perms; 32 | 33 | # Dev nodes 34 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms; 35 | allow hal_fingerprint_default uhid_device:chr_file rw_file_perms; 36 | allow hal_fingerprint_default vendor_fingerprint_device:chr_file rw_file_perms; 37 | allow hal_fingerprint_default input_device:dir r_dir_perms; 38 | allow hal_fingerprint_default input_device:chr_file rw_file_perms; 39 | -------------------------------------------------------------------------------- /gps/android/utils/battery_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | typedef void (* battery_status_change_fn_t)(bool); 30 | void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn); 31 | void loc_extn_battery_properties_listener_deinit(); 32 | bool loc_extn_battery_properties_is_charging(); 33 | -------------------------------------------------------------------------------- /gps/android/2.1/android.hardware.gnss@2.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.1::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /configs/camera_cnf.txt: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | TPmnQaPPrA5eO2LOLggh1VwFuUBAQi6vEmWKy+JON6Act6n6MGo43ZInplaA 3 | PkAWvl1vAK99VbPSAmKaGj3r0ApwMSyO7ARlfli0Rza5rajanjJtMe321Rdi 4 | mCxJUAslvAx8lI51rwJYoblkTVzCMdqbaZ6la/BSCUfYzpPsCdg4Q67gMoKA 5 | m0GdTo2ZG/NkAIInCAxYHFEX3+YA2sM+OXania4E+R23CmRyBcXTB8AseVf7 6 | FwAOVLGy078DgBUpgWdRCP1WDOJJrvTsJ62f4SUwAkJULwdTbXH/7bHAUdiU 7 | FDDYgzs/B89uQVNsnqC7lv1hgHmKGBej2SkYQuidn+m4HdY4I1D4BmqSurJp 8 | NbA9gAkZAb3YwNDyUO3F6eCBhAGQrJjWvebF9Xx0UlAeQ9GdKAEhjCyFrwLA 9 | l32n2JCtKXA7v+iL2R8BBtAQ4fTho588RAB6fo26LpJsic6BrWmAt8dhnecq 10 | 0ryTnaENemXf23KWdj7OLZFQz1J77bXfXjk0z4HMGyJefS1+FGXv7bjSAoct 11 | xbqU87cg5oMCD2GIW0jzp6nBuF8x1MYc5Wlgo3cfQiKWUQWAKRqd56UIuVcP 12 | yA8mAWjAdr4sAP2VY19QwrYUyrPAAD/bhFII/DZAIVCI7mUasbwaVzZoyjAq 13 | DSPyPR2UNhLiTMgfL7YQ1fxUC2YxQJoA5KTZ2sm6a7rG/K+fq0oYO/spitHO 14 | zEuzaAv6ANu9mo2cuMHn4swebZH+X9T86R+OQbhttMuAnSXecs1FhF9eePiV 15 | qbU/bl5ueAlTYGgO2d67IYzYdIdqxo7nam8qy7is 16 | ------------------------------------------------------------ 17 | F/gynyvlxXePc8KOceHbsSKnVGf8bWafLB5WtvUQGEqM63eOqEXWS6PlgOAQ 18 | YCiZ/J4AEXUXH45fYQaeYTd3W/ldAYUOC5Z/eRbmJzp26A/iVpGQSunH8IXx 19 | 8OLZhhh/ttxz4YN/MxvChmz1aDT+AF/Vl+kgw/5lHhAAQlMBH7ywAkYZgACo 20 | j7sPljJG6AiJOxA1GwfovOM6V+2RqYwDHmcO9BOLS6zO+wgf8JqGAIjLPkOG 21 | PZSWOG79yPkEVfGDS/28TLAyYj3dTPAPtrp1rTsAC3omAzvM1iaAle2E5run 22 | I0QtwKzEIoaFgYyOP91M/1oTlCllXCCDwUlQkVecGfiat3FqAam5GQAPDEvK 23 | uAJNKoOcD37XvJjLCRwPmA5AajShfBVxBBmbY+tJO+qRHlBia123MzZQQ4AN 24 | c5VLwME+fzg57VxTgNFl2QPMR7sQn1kD3aEwSAdlqSWZDAnGzpOEBAk29O9V 25 | 230eCArDRZpL1G48vPZ037fyt2X9AnDbbwAeQ8jNaOIpy4odHEHc+6xgKZ/e 26 | dk7AJSmA9vL0EQcOeYC4dwy7A2rqTAMv6lka7ROPXo38IEgOEvw0nZD+t4DA 27 | 730G7OTrt84fgc8JALvS9ql5vhTIAkQ2aJTMMZo0rnYNN3AyoojhSI6jr6EG 28 | DFvxjgXtV8SOCE+OYE8y9Z9sTiAw+IOYegLcN/6QiBYrBs1P0dS83PhmWTWM 29 | AROfMlZrzG5Jg+42i3B8AuWCsWASk/Nx9BAN6K8SUVeAe4wMAW1/pO2zOmWp 30 | n5cADc72lDd0orMTAVHaObIXgQ+ufHh6Mvr6paPQYSuGA4RN191QZlx7g7gu 31 | lR5EAClbgpUbB/OdjONVmcb/aluYmcM9ShpMBwAY9uD/ 32 | ############################################################ 33 | -------------------------------------------------------------------------------- /configs/telephony_system-ext_privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_1 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/geofence/configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.61) 2 | AC_INIT([location-geofence], 1.0.0) 3 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 4 | AC_CONFIG_SRCDIR([Makefile.am]) 5 | AC_CONFIG_HEADERS([config.h]) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | 8 | # Check for programs 9 | AC_PROG_LIBTOOL 10 | AC_PROG_CXX 11 | AC_PROG_CC 12 | AM_PROG_CC_C_O 13 | AC_PROG_AWK 14 | AC_PROG_CPP 15 | AC_PROG_INSTALL 16 | AC_PROG_LN_S 17 | AC_PROG_MAKE_SET 18 | PKG_PROG_PKG_CONFIG 19 | 20 | # Check for libraries 21 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 22 | AC_SUBST([GPSUTILS_CFLAGS]) 23 | AC_SUBST([GPSUTILS_LIBS]) 24 | 25 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 26 | AC_SUBST([LOCCORE_CFLAGS]) 27 | AC_SUBST([LOCCORE_LIBS]) 28 | 29 | AS_CASE([$host], 30 | [arm*], [ARM=yes], 31 | [ARM=no] 32 | ) 33 | 34 | AC_ARG_WITH([locpla_includes], 35 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 36 | [specify the path to locpla-includes in loc-pla_git.bb]), 37 | [locpla_incdir=$withval], 38 | with_locpla_includes=no) 39 | 40 | if test "x$with_locpla_includes" != "xno"; then 41 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 42 | fi 43 | 44 | AC_ARG_WITH([glib], 45 | AC_HELP_STRING([--with-glib], 46 | [enable glib, building HLOS systems which use glib])) 47 | 48 | if (test "x${with_glib}" = "xyes"); then 49 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 50 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 51 | AC_MSG_ERROR(GThread >= 2.16 is required)) 52 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 53 | AC_MSG_ERROR(GLib >= 2.16 is required)) 54 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 55 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 56 | 57 | AC_SUBST(GLIB_CFLAGS) 58 | AC_SUBST(GLIB_LIBS) 59 | fi 60 | 61 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 62 | 63 | AC_SUBST([CFLAGS]) 64 | AC_SUBST([CPPFLAGS]) 65 | AC_SUBST([LIBS]) 66 | 67 | AC_CONFIG_FILES([ \ 68 | Makefile \ 69 | location-geofence.pc 70 | ]) 71 | 72 | AC_OUTPUT 73 | -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-xtra-daemon.policy: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2020 The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are 6 | # met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above 10 | # copyright notice, this list of conditions and the following 11 | # disclaimer in the documentation and/or other materials provided 12 | # with the distribution. 13 | # * Neither the name of The Linux Foundation, nor the names of its 14 | # contributors may be used to endorse or promote products derived 15 | # from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | #****************************************************************************** 30 | bind: 1 31 | getrlimit: 1 32 | 33 | pipe2: 1 34 | 35 | sched_getaffinity: 1 36 | timerfd_create: 1 37 | unlinkat: 1 38 | setpriority: 1 39 | 40 | epoll_create1: 1 41 | epoll_ctl: 1 42 | epoll_pwait: 1 43 | timerfd_settime: 1 44 | 45 | fdatasync: 1 46 | madvise: 1 47 | ftruncate: 1 48 | 49 | -------------------------------------------------------------------------------- /gps/etc/flp.conf: -------------------------------------------------------------------------------- 1 | ################################### 2 | ##### FLP settings ##### 3 | ################################### 4 | 5 | ################################### 6 | # FLP BATCH SIZE 7 | ################################### 8 | # The number of batched locations 9 | # requested to modem. The desired number 10 | # defined below may not be satisfied, as 11 | # the modem can only return the number 12 | # of batched locations that can be allocated, 13 | # which is limited by memory. The default 14 | # batch size defined as 20 as below. 15 | BATCH_SIZE=20 16 | 17 | ################################### 18 | # FLP OUTDOOR TRIP BATCH SIZE 19 | ################################### 20 | # The number of batched locations 21 | # requested to modem for outdoor 22 | # trip batching. The desired number 23 | # defined below may not be satisfied, as 24 | # the modem can only return the number 25 | # of batched locations that can be allocated, 26 | # which is limited by memory. The default 27 | # trip batch size defined as 600 as below. 28 | OUTDOOR_TRIP_BATCH_SIZE=600 29 | 30 | ################################### 31 | # FLP BATCHING SESSION TIMEOUT 32 | ################################### 33 | # Duration with which batch session timeout 34 | # happens in milliseconds. If not specified 35 | # or set to zero, batching session timeout 36 | # defaults to 20 seconds by the modem. 37 | # BATCH_SESSION_TIMEOUT=20000 38 | 39 | ################################### 40 | # FLP BATCHING ACCURACY 41 | ################################### 42 | # Set to one of the defined values below 43 | # to define the accuracy of batching. 44 | # If not specified, accuracy defaults 45 | # to LOW. 46 | # FLP BATCHING ACCURACY values: 47 | # Low accuracy = 0 48 | # Medium accuracy = 1 49 | # High accuracy = 2 50 | ACCURACY=1 51 | 52 | #################################### 53 | # By default if network fixes are not sensor assisted 54 | # these fixes must be dropped. This parameter adds an exception 55 | # for targets where there is no PDR and we still want to 56 | # report out network fixes 57 | # 0: MUST NOT ALLOW NETWORK FIXES 58 | # 1: ALLOW NETWORK FIXES 59 | #################################### 60 | ALLOW_NETWORK_FIXES = 0 61 | -------------------------------------------------------------------------------- /gps/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -Wundef \ 4 | -MD \ 5 | -Wno-trigraphs \ 6 | -g -O0 \ 7 | -fno-inline \ 8 | -fno-short-enums \ 9 | -fpic \ 10 | -I./ \ 11 | -std=c++14 \ 12 | $(LOCPLA_CFLAGS) 13 | 14 | libgps_utils_la_h_sources = \ 15 | msg_q.h \ 16 | linked_list.h \ 17 | loc_cfg.h \ 18 | loc_log.h \ 19 | loc_target.h \ 20 | loc_timer.h \ 21 | MsgTask.h \ 22 | LocHeap.h \ 23 | LocThread.h \ 24 | LocTimer.h \ 25 | LocIpc.h \ 26 | SkipList.h\ 27 | loc_misc_utils.h \ 28 | loc_nmea.h \ 29 | gps_extended_c.h \ 30 | gps_extended.h \ 31 | loc_gps.h \ 32 | log_util.h \ 33 | LocSharedLock.h \ 34 | LocUnorderedSetMap.h\ 35 | LocLoggerBase.h 36 | 37 | libgps_utils_la_c_sources = \ 38 | linked_list.c \ 39 | msg_q.c \ 40 | loc_cfg.cpp \ 41 | loc_log.cpp \ 42 | loc_target.cpp \ 43 | LocHeap.cpp \ 44 | LocTimer.cpp \ 45 | LocThread.cpp \ 46 | LocIpc.cpp \ 47 | LogBuffer.cpp \ 48 | MsgTask.cpp \ 49 | loc_misc_utils.cpp \ 50 | loc_nmea.cpp 51 | 52 | library_includedir = $(pkgincludedir) 53 | 54 | library_include_HEADERS = $(libgps_utils_la_h_sources) 55 | 56 | libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) 57 | 58 | if USE_GLIB 59 | libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 60 | libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 61 | libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 62 | else 63 | libgps_utils_la_CFLAGS = $(AM_CFLAGS) 64 | libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 65 | libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 66 | endif 67 | 68 | libgps_utils_la_LIBADD = $(CUTILS_LIBS) -ldl 69 | 70 | #Create and Install libraries 71 | lib_LTLIBRARIES = libgps_utils.la 72 | 73 | pkgconfigdir = $(libdir)/pkgconfig 74 | pkgconfig_DATA = gps-utils.pc 75 | EXTRA_DIST = $(pkgconfig_DATA) 76 | -------------------------------------------------------------------------------- /rro_overlays/SystemUIOverlaySM8350/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | 11 | false 12 | 13 | 16 | xiaomi.sensor.aod 17 | 18 | 20 | 21 | -1 22 | -1 23 | -1 24 | -1 25 | 24 26 | 4 27 | 28 | 29 | 33 | 34 | -1 35 | 0 36 | 0 37 | 0 38 | 0 39 | 0 40 | 41 | 42 | 43 | 60 44 | 45 | -------------------------------------------------------------------------------- /gps/utils/MsgTask.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, 2015, 2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __MSG_TASK__ 30 | #define __MSG_TASK__ 31 | 32 | #include 33 | #include 34 | 35 | namespace loc_util { 36 | 37 | struct LocMsg { 38 | inline LocMsg() {} 39 | inline virtual ~LocMsg() {} 40 | virtual void proc() const = 0; 41 | inline virtual void log() const {} 42 | }; 43 | 44 | class MsgTask { 45 | const void* mQ; 46 | LocThread mThread; 47 | public: 48 | ~MsgTask() = default; 49 | MsgTask(const char* threadName = NULL); 50 | void sendMsg(const LocMsg* msg) const; 51 | void sendMsg(const std::function runnable) const; 52 | }; 53 | 54 | } // 55 | 56 | #endif //__MSG_TASK__ 57 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemsFactoryProxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __DATAITEMFACTORYBASE__ 31 | #define __DATAITEMFACTORYBASE__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core 37 | { 38 | 39 | #define DATA_ITEMS_LIB_NAME "libdataitems.so" 40 | #define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem" 41 | 42 | typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId); 43 | 44 | class DataItemsFactoryProxy { 45 | public: 46 | static IDataItemCore* createNewDataItem(DataItemId id); 47 | static void closeDataItemLibraryHandle(); 48 | static void *dataItemLibHandle; 49 | static get_concrete_data_item_fn *getConcreteDIFunc; 50 | }; 51 | 52 | } // namespace loc_core 53 | 54 | #endif //__DATAITEMFACTORYBASE__ 55 | 56 | -------------------------------------------------------------------------------- /gps/batching/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-batching 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-batching package version 1.0.0 8 | AC_INIT([location-batching],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | AC_ARG_WITH([locpla_includes], 41 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 42 | [specify the path to locpla-includes in loc-pla_git.bb]), 43 | [locpla_incdir=$withval], 44 | with_locpla_includes=no) 45 | 46 | if test "x$with_locpla_includes" != "xno"; then 47 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 48 | fi 49 | 50 | AC_ARG_WITH([glib], 51 | AC_HELP_STRING([--with-glib], 52 | [enable glib, building HLOS systems which use glib])) 53 | 54 | if (test "x${with_glib}" = "xyes"); then 55 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 56 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 57 | AC_MSG_ERROR(GThread >= 2.16 is required)) 58 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 59 | AC_MSG_ERROR(GLib >= 2.16 is required)) 60 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 61 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 62 | 63 | AC_SUBST(GLIB_CFLAGS) 64 | AC_SUBST(GLIB_LIBS) 65 | fi 66 | 67 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 68 | 69 | AC_CONFIG_FILES([ \ 70 | Makefile \ 71 | location-batching.pc 72 | ]) 73 | 74 | AC_OUTPUT 75 | -------------------------------------------------------------------------------- /gps/core/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -I./ \ 4 | $(LOCPLA_CFLAGS) \ 5 | $(GPSUTILS_CFLAGS) \ 6 | -I./data-items/ \ 7 | -I./data-items/common \ 8 | -I./observer \ 9 | -I$(WORKSPACE)/gps-noship/flp \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -fno-short-enums \ 12 | -std=c++11 13 | 14 | libloc_core_la_h_sources = \ 15 | LocApiBase.h \ 16 | LocAdapterBase.h \ 17 | ContextBase.h \ 18 | LocContext.h \ 19 | LBSProxyBase.h \ 20 | loc_core_log.h \ 21 | LocAdapterProxyBase.h \ 22 | EngineHubProxyBase.h \ 23 | data-items/DataItemId.h \ 24 | data-items/IDataItemCore.h \ 25 | data-items/DataItemConcreteTypesBase.h \ 26 | observer/IDataItemObserver.h \ 27 | observer/IDataItemSubscription.h \ 28 | observer/IFrameworkActionReq.h \ 29 | observer/IOsObserver.h \ 30 | SystemStatusOsObserver.h \ 31 | SystemStatus.h 32 | 33 | libloc_core_la_c_sources = \ 34 | LocApiBase.cpp \ 35 | LocAdapterBase.cpp \ 36 | ContextBase.cpp \ 37 | LocContext.cpp \ 38 | loc_core_log.cpp \ 39 | data-items/DataItemsFactoryProxy.cpp \ 40 | SystemStatusOsObserver.cpp \ 41 | SystemStatus.cpp 42 | 43 | if USE_EXTERNAL_AP 44 | AM_CFLAGS += -DFEATURE_EXTERNAL_AP 45 | endif 46 | 47 | library_includedir = $(pkgincludedir) 48 | 49 | library_include_HEADERS = $(libloc_core_la_h_sources) 50 | 51 | libloc_core_la_SOURCES = $(libloc_core_la_c_sources) 52 | 53 | if USE_GLIB 54 | libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 55 | libloc_core_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 56 | libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 57 | else 58 | libloc_core_la_CFLAGS = $(AM_CFLAGS) 59 | libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 60 | libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 61 | endif 62 | 63 | if USE_FEATURE_AUTOMOTIVE 64 | AM_CFLAGS += -DFEATURE_AUTOMOTIVE 65 | endif 66 | 67 | libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) 68 | 69 | #Create and Install libraries 70 | lib_LTLIBRARIES = libloc_core.la 71 | 72 | pkgconfigdir = $(libdir)/pkgconfig 73 | pkgconfig_DATA = loc-core.pc 74 | EXTRA_DIST = $(pkgconfig_DATA) 75 | -------------------------------------------------------------------------------- /configs/qti_whitelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /gps/core/LocContext.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2014, 2017-2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __LOC_CONTEXT__ 30 | #define __LOC_CONTEXT__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace loc_core { 38 | 39 | class LocContext : public ContextBase { 40 | static const MsgTask* mMsgTask; 41 | static ContextBase* mContext; 42 | static const MsgTask* getMsgTask(const char* name); 43 | static pthread_mutex_t mGetLocContextMutex; 44 | 45 | protected: 46 | LocContext(const MsgTask* msgTask); 47 | inline virtual ~LocContext() {} 48 | 49 | public: 50 | static const char* mLBSLibName; 51 | static const char* mLocationHalName; 52 | 53 | static ContextBase* getLocContext(const char* name); 54 | 55 | static void injectFeatureConfig(ContextBase *context); 56 | }; 57 | 58 | } 59 | 60 | #endif //__LOC_CONTEXT__ 61 | -------------------------------------------------------------------------------- /extract-files.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3 2 | # 3 | # SPDX-FileCopyrightText: 2024 The LineageOS Project 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | from extract_utils.fixups_blob import ( 8 | blob_fixup, 9 | blob_fixups_user_type, 10 | ) 11 | from extract_utils.fixups_lib import ( 12 | lib_fixups, 13 | lib_fixups_user_type, 14 | ) 15 | from extract_utils.main import ( 16 | ExtractUtils, 17 | ExtractUtilsModule, 18 | ) 19 | 20 | namespace_imports = [ 21 | 'device/xiaomi/sm8350-common', 22 | 'hardware/qcom-caf/sm8350', 23 | 'hardware/qcom-caf/wlan', 24 | 'hardware/xiaomi', 25 | 'vendor/qcom/opensource/commonsys/display', 26 | 'vendor/qcom/opensource/commonsys-intf/display', 27 | 'vendor/qcom/opensource/dataservices', 28 | 'vendor/qcom/opensource/display', 29 | ] 30 | 31 | 32 | def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs): 33 | return f'{lib}_{partition}' if partition == 'vendor' else None 34 | 35 | 36 | lib_fixups: lib_fixups_user_type = { 37 | **lib_fixups, 38 | ( 39 | 'com.qualcomm.qti.dpm.api@1.0', 40 | 'libmmosal', 41 | 'vendor.qti.hardware.wifidisplaysession@1.0', 42 | 'vendor.qti.imsrtpservice@3.0', 43 | ): lib_fixup_vendor_suffix, 44 | } 45 | 46 | blob_fixups: blob_fixups_user_type = { 47 | 'vendor/etc/init/vendor.xiaomi.hardware.citsensorservice@1.1-service.rc': blob_fixup() 48 | .add_line_if_missing(' task_profiles ServiceCapacityLow'), 49 | ('vendor/etc/media_lahaina/video_system_specs.json', 'vendor/etc/media_shima_v1/video_system_specs.json', 'vendor/etc/media_yupik_v1/video_system_specs.json'): blob_fixup() 50 | .regex_replace('"max_retry_alloc_output_timeout": 10000,', '"max_retry_alloc_output_timeout": 0,'), 51 | 'vendor/etc/vintf/manifest/c2_manifest_vendor.xml': blob_fixup() 52 | .regex_replace('.*ozoaudio.*\n?', '') 53 | .regex_replace('.*dolby.*\n?', ''), 54 | ('vendor/lib64/mediadrm/libwvdrmengine.so', 'vendor/lib64/libwvhidl.so'): blob_fixup() 55 | .add_needed('libcrypto_shim.so'), 56 | 'vendor/lib64/android.hardware.secure_element@1.0-impl.so': blob_fixup() 57 | .remove_needed('android.hidl.base@1.0.so'), 58 | } # fmt: skip 59 | 60 | module = ExtractUtilsModule( 61 | 'sm8350-common', 62 | 'xiaomi', 63 | blob_fixups=blob_fixups, 64 | lib_fixups=lib_fixups, 65 | namespace_imports=namespace_imports, 66 | ) 67 | 68 | if __name__ == '__main__': 69 | utils = ExtractUtils.device(module) 70 | utils.run() 71 | -------------------------------------------------------------------------------- /rootdir/bin/init.kernel.post_boot.sh: -------------------------------------------------------------------------------- 1 | #============================================================================= 2 | # Copyright (c) 2019-2021 Qualcomm Technologies, Inc. 3 | # All Rights Reserved. 4 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 5 | # 6 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # * Neither the name of The Linux Foundation nor 16 | # the names of its contributors may be used to endorse or promote 17 | # products derived from this software without specific prior written 18 | # permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | #============================================================================= 32 | 33 | if [ -f /sys/devices/soc0/soc_id ]; then 34 | platformid=`cat /sys/devices/soc0/soc_id` 35 | fi 36 | 37 | case "$platformid" in 38 | "415"|"439"|"456"|"501"|"502") 39 | /vendor/bin/sh /vendor/bin/init.kernel.post_boot-lahaina.sh 40 | ;; 41 | 42 | "450") 43 | /vendor/bin/sh /vendor/bin/init.kernel.post_boot-shima.sh 44 | ;; 45 | "475"|"499"|"487"|"488"|"498"|"497"|"515") 46 | /vendor/bin/sh /vendor/bin/init.kernel.post_boot-yupik.sh 47 | ;; 48 | *) 49 | echo "***WARNING***: Invalid SoC ID\n\t No postboot settings applied!!\n" 50 | ;; 51 | esac 52 | 53 | -------------------------------------------------------------------------------- /rro_overlays/SettingsOverlaySM8350/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 21 | 2 22 | 23 | 26 | 27 | Vivid 28 | Saturated 29 | Original 30 | P3 31 | sRGB 32 | 33 | 34 | 37 | 38 | 258 39 | 256 40 | 257 41 | 268 42 | 267 43 | 44 | 45 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_1 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V2_1 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.1/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::sp; 39 | using ::android::hardware::gnss::V2_0::IAGnssCallback; 40 | 41 | struct Gnss; 42 | struct AGnss : public V2_0::IAGnss { 43 | 44 | AGnss(Gnss* gnss); 45 | ~AGnss(); 46 | /* 47 | * Methods from ::android::hardware::gnss::V2_0::IAGnss interface follow. 48 | * These declarations were generated from IAGnss.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | 52 | Return dataConnClosed() override; 53 | 54 | Return dataConnFailed() override; 55 | 56 | Return dataConnOpen(uint64_t networkHandle, const hidl_string& apn, 57 | V2_0::IAGnss::ApnIpType apnIpType) override; 58 | 59 | Return setServer(V2_0::IAGnssCallback::AGnssType type, 60 | const hidl_string& hostname, int32_t port) override; 61 | 62 | void statusCb(AGpsExtType type, LocAGpsStatusValue status); 63 | 64 | /* Data call setup callback passed down to GNSS HAL implementation */ 65 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 66 | 67 | private: 68 | Gnss* mGnss = nullptr; 69 | sp mAGnssCbIface = nullptr; 70 | 71 | AGpsExtType mType; 72 | }; 73 | 74 | } // namespace implementation 75 | } // namespace V2_1 76 | } // namespace gnss 77 | } // namespace hardware 78 | } // namespace android 79 | 80 | #endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 81 | -------------------------------------------------------------------------------- /gps/android/2.1/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2_0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2_0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@2.1-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V2_1::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | #ifdef LOC_HIDL_VERSION 64 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 65 | 66 | void* libHandle = NULL; 67 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 68 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 69 | if (NULL != vendorEnhancedMainMethod) { 70 | (*vendorEnhancedMainMethod)(0, NULL); 71 | } 72 | #else 73 | ALOGI("LOC_HIDL_VERSION not defined."); 74 | #endif 75 | joinRpcThreadpool(); 76 | } else { 77 | ALOGE("Error while registering IGnss 2.1 service: %d", status); 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /media/init.qti.media.rc: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # init.qti.media.rc 3 | # 4 | # Copyright (c) 2020 Qualcomm Technologies, Inc. 5 | # All Rights Reserved. 6 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 7 | # 8 | # Copyright (c) 2020, The Linux Foundation. All rights reserved. 9 | # 10 | # Redistribution and use in source and binary forms, with or without 11 | # modification, are permitted provided that the following conditions are 12 | # met: 13 | # * Redistributions of source code must retain the above copyright 14 | # notice, this list of conditions and the following disclaimer. 15 | # * Redistributions in binary form must reproduce the above 16 | # copyright notice, this list of conditions and the following 17 | # disclaimer in the documentation and/or other materials provided 18 | # with the distribution. 19 | # * Neither the name of The Linux Foundation nor the names of its 20 | # contributors may be used to endorse or promote products derived 21 | # from this software without specific prior written permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 24 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 26 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 27 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 30 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 31 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 32 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 33 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | #=============================================================================== 35 | service qti-media /vendor/bin/init.qti.media.sh 36 | class main 37 | user media 38 | group media 39 | disabled 40 | oneshot 41 | seclabel u:r:vendor_qti_media:s0 42 | 43 | on early-init 44 | setprop vendor.media.target.qssi ${vendor.sys.media.target.qssi} 45 | setprop vendor.media.system.build_codename ${ro.build.version.release_or_codename} 46 | start qti-media 47 | 48 | on post-fs-data 49 | setprop ro.media.xml_variant.codecs ${vendor.media.target_variant} 50 | setprop ro.media.xml_variant.codecs_performance ${vendor.media.target_variant} 51 | setprop ro.media.xml_variant.profiles ${vendor.media.target_variant} 52 | 53 | on property:vendor.netflix.bsp_rev=* 54 | setprop ro.netflix.bsp_rev ${vendor.netflix.bsp_rev} 55 | -------------------------------------------------------------------------------- /gps/core/loc_core_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, 2016-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_CORE_LOG_H 31 | #define LOC_CORE_LOG_H 32 | 33 | #include 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" 38 | { 39 | #endif 40 | 41 | const char* loc_get_gps_status_name(LocGpsStatusValue gps_status); 42 | const char* loc_get_position_mode_name(LocGpsPositionMode mode); 43 | const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur); 44 | const char* loc_get_aiding_data_mask_names(LocGpsAidingData data); 45 | const char* loc_get_agps_type_name(LocAGpsType type); 46 | const char* loc_get_ni_type_name(LocGpsNiType type); 47 | const char* loc_get_ni_response_name(LocGpsUserResponseType response); 48 | const char* loc_get_ni_encoding_name(LocGpsNiEncodingType encoding); 49 | const char* loc_get_agps_bear_name(AGpsBearerType bear); 50 | const char* loc_get_server_type_name(LocServerType type); 51 | const char* loc_get_position_sess_status_name(enum loc_sess_status status); 52 | const char* loc_get_agps_status_name(LocAGpsStatusValue status); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* LOC_CORE_LOG_H */ 59 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_1 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V2_1 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps loc_hal 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps loc-hal package version 1.0.0 8 | AC_INIT([loc-hal],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | AC_ARG_WITH([core_includes], 41 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 42 | [Specify the location of the core headers]), 43 | [core_incdir=$withval], 44 | with_core_includes=no) 45 | 46 | if test "x$with_core_includes" != "xno"; then 47 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 48 | fi 49 | 50 | AC_ARG_WITH([locpla_includes], 51 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 52 | [specify the path to locpla-includes in loc-pla_git.bb]), 53 | [locpla_incdir=$withval], 54 | with_locpla_includes=no) 55 | 56 | if test "x$with_locpla_includes" != "xno"; then 57 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 58 | fi 59 | 60 | AC_SUBST([CPPFLAGS]) 61 | 62 | AC_ARG_WITH([glib], 63 | AC_HELP_STRING([--with-glib], 64 | [enable glib, building HLOS systems which use glib])) 65 | 66 | if (test "x${with_glib}" = "xyes"); then 67 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 68 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 69 | AC_MSG_ERROR(GThread >= 2.16 is required)) 70 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 71 | AC_MSG_ERROR(GLib >= 2.16 is required)) 72 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 73 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 74 | 75 | AC_SUBST(GLIB_CFLAGS) 76 | AC_SUBST(GLIB_LIBS) 77 | fi 78 | 79 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 80 | 81 | AC_CONFIG_FILES([ \ 82 | Makefile \ 83 | gnss/Makefile \ 84 | loc-hal.pc \ 85 | ]) 86 | 87 | AC_OUTPUT 88 | -------------------------------------------------------------------------------- /gps/gnss/NativeAgpsHandler.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2020, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef NATIVEAGPSHANDLER_H 30 | #define NATIVEAGPSHANDLER_H 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | using namespace std; 40 | using loc_core::IOsObserver; 41 | using loc_core::IDataItemObserver; 42 | using loc_core::IDataItemCore; 43 | 44 | class GnssAdapter; 45 | 46 | class NativeAgpsHandler : public IDataItemObserver { 47 | public: 48 | NativeAgpsHandler(IOsObserver* sysStatObs, GnssAdapter& adapter); 49 | ~NativeAgpsHandler(); 50 | AgpsCbInfo getAgpsCbInfo(); 51 | // IDataItemObserver overrides 52 | virtual void notify(const list& dlist); 53 | inline virtual void getName(string& name); 54 | private: 55 | static NativeAgpsHandler* sLocalHandle; 56 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 statusInfo); 57 | void processATLRequestRelease(AGnssExtStatusIpV4 statusInfo); 58 | IOsObserver* mSystemStatusObsrvr; 59 | bool mConnected; 60 | string mApn; 61 | GnssAdapter& mAdapter; 62 | }; 63 | 64 | #endif // NATIVEAGPSHANDLER_H 65 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Display 2 | genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary u:object_r:vendor_sysfs_graphics:s0 3 | 4 | # Fingerprint 5 | genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc u:object_r:vendor_sysfs_fingerprint:s0 6 | 7 | # USB 8 | genfscon sysfs /devices/platform/soc/soc:qcom,pmic_glink/soc:qcom,pmic_glink:qcom,ucsi/typec u:object_r:vendor_sysfs_usb_c:s0 9 | 10 | # Wakeup nodes 11 | genfscon sysfs /devices/platform/goodix_ts.0/wakeup u:object_r:sysfs_wakeup:s0 12 | genfscon sysfs /devices/platform/soc/884000.i2c/i2c-3/3-0028/wakeup u:object_r:sysfs_wakeup:s0 13 | genfscon sysfs /devices/platform/soc/984000.i2c/i2c-0/0-0028/wakeup u:object_r:sysfs_wakeup:s0 14 | genfscon sysfs /devices/platform/soc/988000.spi/spi_master/spi0/spi0.0/wakeup u:object_r:sysfs_wakeup:s0 15 | genfscon sysfs /devices/platform/soc/990000.i2c/i2c-2/2-0028/wakeup u:object_r:sysfs_wakeup:s0 16 | genfscon sysfs /devices/platform/soc/990000.i2c/i2c-2/2-005a/wakeup u:object_r:sysfs_wakeup:s0 17 | genfscon sysfs /devices/platform/soc/998000.i2c/i2c-0/0-005a/wakeup u:object_r:sysfs_wakeup:s0 18 | genfscon sysfs /devices/platform/soc/a300000.qcom,turing/subsys7/wakeup u:object_r:sysfs_wakeup:s0 19 | genfscon sysfs /devices/platform/soc/a84000.i2c/i2c-3/3-0028/wakeup u:object_r:sysfs_wakeup:s0 20 | genfscon sysfs /devices/platform/soc/a84000.i2c/i2c-3/3-005a/wakeup u:object_r:sysfs_wakeup:s0 21 | genfscon sysfs /devices/platform/soc/a8c000.spi/spi_master/spi1/spi1.0/wakeup u:object_r:sysfs_wakeup:s0 22 | genfscon sysfs /devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/wakeup u:object_r:sysfs_wakeup:s0 23 | genfscon sysfs /devices/platform/soc/aab0000.qcom,venus/subsys0/wakeup u:object_r:sysfs_wakeup:s0 24 | genfscon sysfs /devices/platform/soc/aab0000.qcom,venus/subsys9/wakeup u:object_r:sysfs_wakeup:s0 25 | genfscon sysfs /devices/platform/soc/abb0000.qcom,evass/subsys2/wakeup u:object_r:sysfs_wakeup:s0 26 | genfscon sysfs /devices/platform/soc/b0000000.qcom,cnss-qca6490/subsys10/wakeup u:object_r:sysfs_wakeup:s0 27 | # note: Labelling /devices/platform/soc/soc:fingerprint_fpc/wakeup relabels the wakeup_enable node 28 | genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc/wakeup/wakeup u:object_r:sysfs_wakeup:s0 29 | genfscon sysfs /devices/platform/soc/soc:fingerprint_goodix/wakeup/wakeup u:object_r:sysfs_wakeup:s0 30 | genfscon sysfs /devices/platform/soc/soc:goodix_fp/wakeup u:object_r:sysfs_wakeup:s0 31 | genfscon sysfs /devices/platform/soc/soc:md_testing_mode/wakeup u:object_r:sysfs_wakeup:s0 32 | genfscon sysfs /devices/platform/soc/soc:qcom,ipa_fws/subsys3/wakeup u:object_r:sysfs_wakeup:s0 33 | genfscon sysfs /devices/platform/soc/soc:qcom,kgsl-hyp/subsys4/wakeup u:object_r:sysfs_wakeup:s0 34 | genfscon sysfs /devices/platform/soc/soc:qcom,trustedvm@d0800000/subsys1/wakeup u:object_r:sysfs_wakeup:s0 35 | -------------------------------------------------------------------------------- /gps/core/LBSProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef IZAT_PROXY_BASE_H 30 | #define IZAT_PROXY_BASE_H 31 | #include 32 | 33 | namespace loc_core { 34 | 35 | class LocApiBase; 36 | class LocAdapterBase; 37 | class ContextBase; 38 | 39 | class LBSProxyBase { 40 | friend class ContextBase; 41 | inline virtual LocApiBase* 42 | getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask, 43 | ContextBase* context) const { 44 | 45 | (void)exMask; 46 | (void)context; 47 | return NULL; 48 | } 49 | protected: 50 | inline LBSProxyBase() {} 51 | public: 52 | inline virtual ~LBSProxyBase() {} 53 | inline virtual bool hasAgpsExtendedCapabilities() const { return false; } 54 | inline virtual void modemPowerVote(bool power) const { 55 | 56 | (void)power; 57 | } 58 | virtual void injectFeatureConfig(ContextBase* context) const { 59 | 60 | (void)context; 61 | } 62 | inline virtual bool hasNativeXtraClient() const { return false; } 63 | inline virtual IzatDevId_t getIzatDevId() const { return 0; } 64 | }; 65 | 66 | typedef LBSProxyBase* (getLBSProxy_t)(); 67 | 68 | } // namespace loc_core 69 | 70 | #endif // IZAT_PROXY_BASE_H 71 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2009-2016, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # 31 | # Make modem config folder and copy firmware config to that folder for RIL 32 | # 33 | if [ -f /data/vendor/modem_config/ver_info.txt ]; then 34 | prev_version_info=`cat /data/vendor/modem_config/ver_info.txt` 35 | else 36 | prev_version_info="" 37 | fi 38 | 39 | cur_version_info=`cat /vendor/firmware_mnt/verinfo/ver_info.txt` 40 | if [ ! -f /vendor/firmware_mnt/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then 41 | # add W for group recursively before delete 42 | chmod g+w -R /data/vendor/modem_config/* 43 | rm -rf /data/vendor/modem_config/* 44 | # preserve the read only mode for all subdir and files 45 | cp --preserve=m -dr /vendor/firmware_mnt/image/modem_pr/mcfg/configs/* /data/vendor/modem_config 46 | cp --preserve=m -d /vendor/firmware_mnt/verinfo/ver_info.txt /data/vendor/modem_config/ 47 | cp --preserve=m -d /vendor/firmware_mnt/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/ 48 | # the group must be root, otherwise this script could not add "W" for group recursively 49 | chown -hR radio.root /data/vendor/modem_config/* 50 | fi 51 | chmod g-w /data/vendor/modem_config 52 | setprop ro.vendor.ril.mbn_copy_completed 1 53 | -------------------------------------------------------------------------------- /gps/core/observer/IDataItemObserver.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __IDATAITEMOBSERVER_H__ 31 | #define __IDATAITEMOBSERVER_H__ 32 | 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | namespace loc_core 39 | { 40 | class IDataItemCore; 41 | 42 | /** 43 | * @brief IDataItemObserver interface 44 | * @details IDataItemObserver interface; 45 | * In OS dependent code this type serves as a handle to an OS independent instance of this interface. 46 | */ 47 | class IDataItemObserver { 48 | 49 | public: 50 | 51 | /** 52 | * @brief Gets name of Data Item Observer 53 | * @details Gets name of Data Item Observer 54 | * 55 | * @param name reference to name of Data Item Observer 56 | */ 57 | virtual void getName (string & name) = 0; 58 | 59 | /** 60 | * @brief Notify updated values of Data Items 61 | * @details Notifys updated values of Data items 62 | * 63 | * @param dlist List of updated data items 64 | */ 65 | virtual void notify (const std :: list & dlist) = 0; 66 | 67 | /** 68 | * @brief Destructor 69 | * @details Destructor 70 | */ 71 | virtual ~IDataItemObserver () {} 72 | }; 73 | 74 | } // namespace loc_core 75 | 76 | #endif // #ifndef __IDATAITEMOBSERVER_H__ 77 | -------------------------------------------------------------------------------- /gps/android/2.1/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_shared { 2 | name: "android.hardware.gnss@2.1-impl-qti", 3 | vendor: true, 4 | relative_install_path: "hw", 5 | srcs: [ 6 | "AGnss.cpp", 7 | "Gnss.cpp", 8 | "AGnssRil.cpp", 9 | "GnssMeasurement.cpp", 10 | "GnssConfiguration.cpp", 11 | "GnssBatching.cpp", 12 | "GnssGeofencing.cpp", 13 | "GnssNi.cpp", 14 | "GnssDebug.cpp", 15 | "GnssAntennaInfo.cpp", 16 | "MeasurementCorrections.cpp", 17 | "GnssVisibilityControl.cpp", 18 | ] + [ 19 | "location_api/GnssAPIClient.cpp", 20 | "location_api/MeasurementAPIClient.cpp", 21 | "location_api/GeofenceAPIClient.cpp", 22 | "location_api/BatchingAPIClient.cpp", 23 | "location_api/LocationUtil.cpp", 24 | ], 25 | 26 | local_include_dirs: ["location_api"], 27 | 28 | header_libs: [ 29 | "libgps.utils_headers", 30 | "libloc_core_headers", 31 | "libloc_pla_headers", 32 | "liblocation_api_headers", 33 | "liblocbatterylistener_headers", 34 | ], 35 | 36 | shared_libs: [ 37 | "liblog", 38 | "libhidlbase", 39 | "libcutils", 40 | "libutils", 41 | "android.hardware.gnss@1.0", 42 | "android.hardware.gnss@1.1", 43 | "android.hardware.gnss@2.0", 44 | "android.hardware.gnss@2.1", 45 | "android.hardware.gnss.measurement_corrections@1.0", 46 | "android.hardware.gnss.measurement_corrections@1.1", 47 | "android.hardware.gnss.visibility_control@1.0", 48 | "android.hardware.health@1.0", 49 | "android.hardware.health@2.0", 50 | "android.hardware.health@2.1", 51 | "android.hardware.power@1.2", 52 | "libbase", 53 | ] + [ 54 | "libloc_core", 55 | "libgps.utils", 56 | "libdl", 57 | "liblocation_api", 58 | ], 59 | 60 | cflags: GNSS_CFLAGS, 61 | static_libs: ["liblocbatterylistener"] + ["libhealthhalutils"], 62 | } 63 | 64 | cc_binary { 65 | name: "android.hardware.gnss@2.1-service-qti", 66 | vintf_fragments: ["android.hardware.gnss@2.1-service-qti.xml"], 67 | vendor: true, 68 | relative_install_path: "hw", 69 | init_rc: ["android.hardware.gnss@2.1-service-qti.rc"], 70 | srcs: ["service.cpp"], 71 | 72 | header_libs: [ 73 | "libgps.utils_headers", 74 | "libloc_core_headers", 75 | "libloc_pla_headers", 76 | "liblocation_api_headers", 77 | ], 78 | 79 | shared_libs: [ 80 | "liblog", 81 | "libcutils", 82 | "libdl", 83 | "libbase", 84 | "libutils", 85 | "libgps.utils", 86 | "libqti_vndfwk_detect", 87 | ] + [ 88 | "libhidlbase", 89 | "android.hardware.gnss@1.0", 90 | "android.hardware.gnss@1.1", 91 | "android.hardware.gnss@2.0", 92 | "android.hardware.gnss@2.1", 93 | ], 94 | 95 | cflags: GNSS_CFLAGS + ["-DLOC_HIDL_VERSION=\"4.0\""], 96 | } 97 | -------------------------------------------------------------------------------- /gps/core/data-items/IDataItemCore.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __IDATAITEMCORE_H__ 31 | #define __IDATAITEMCORE_H__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core { 37 | 38 | using namespace std; 39 | 40 | /** 41 | * @brief IDataItemCore interface. 42 | * @details IDataItemCore interface. 43 | * 44 | */ 45 | class IDataItemCore { 46 | public: 47 | /** 48 | * @brief Gets Data item id. 49 | * @details Gets Data item id. 50 | * @return Data item id. 51 | */ 52 | virtual DataItemId getId () = 0; 53 | 54 | /** 55 | * @brief Stringify. 56 | * @details Stringify. 57 | * 58 | * @param valueStr Reference to string. 59 | */ 60 | virtual void stringify (string & valueStr) = 0; 61 | 62 | /** 63 | * @brief copy. 64 | * @details copy. 65 | * 66 | * @param src Where to copy from. 67 | * @param dataItemCopied Boolean flag indicated whether or not copied. 68 | * 69 | * @return Zero for success or non zero for failure. 70 | */ 71 | virtual int32_t copy (IDataItemCore * src, bool *dataItemCopied = nullptr) = 0; 72 | 73 | /** 74 | * @brief Destructor. 75 | * @details Destructor. 76 | */ 77 | virtual ~IDataItemCore () {} 78 | }; 79 | 80 | } // namespace loc_core 81 | 82 | #endif // __IDATAITEMCORE_H__ 83 | -------------------------------------------------------------------------------- /gps/utils/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps gps-utils 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps gps-utils package version 1.0.0 8 | AC_INIT([gps-utils],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | AC_ARG_WITH([external_ap], 32 | AC_HELP_STRING([--with-external_ap=@<:@dir@:>@], 33 | [Using External Application Processor]), 34 | [], 35 | with_external_ap=no) 36 | 37 | if test "x$with_external_ap" != "xno"; then 38 | CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP" 39 | else 40 | # Checks for libraries. 41 | PKG_CHECK_MODULES([CUTILS], [libcutils]) 42 | AC_SUBST([CUTILS_CFLAGS]) 43 | AC_SUBST([CUTILS_LIBS]) 44 | fi 45 | 46 | AC_ARG_WITH([core_includes], 47 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 48 | [Specify the location of the core headers]), 49 | [core_incdir=$withval], 50 | with_core_includes=no) 51 | 52 | if test "x$with_core_includes" != "xno"; then 53 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 54 | fi 55 | 56 | AC_ARG_WITH([locpla_includes], 57 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 58 | [specify the path to locpla-includes in loc-pla_git.bb]), 59 | [locpla_incdir=$withval], 60 | with_locpla_includes=no) 61 | 62 | if test "x$with_locpla_includes" != "xno"; then 63 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 64 | fi 65 | 66 | AC_SUBST([CPPFLAGS]) 67 | 68 | AC_ARG_WITH([glib], 69 | AC_HELP_STRING([--with-glib], 70 | [enable glib, building HLOS systems which use glib])) 71 | 72 | if (test "x${with_glib}" = "xyes"); then 73 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 74 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 75 | AC_MSG_ERROR(GThread >= 2.16 is required)) 76 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 77 | AC_MSG_ERROR(GLib >= 2.16 is required)) 78 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 79 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 80 | 81 | AC_SUBST(GLIB_CFLAGS) 82 | AC_SUBST(GLIB_LIBS) 83 | fi 84 | 85 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 86 | 87 | AC_CONFIG_FILES([ \ 88 | Makefile \ 89 | gps-utils.pc 90 | ]) 91 | 92 | AC_OUTPUT 93 | -------------------------------------------------------------------------------- /gps/location/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-api-iface 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-api-iface package version 1.0.0 8 | AC_INIT([location-api-iface],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([location-api.pc.in]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | AC_ARG_WITH([core_includes], 37 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 38 | [Specify the location of the core headers]), 39 | [core_incdir=$withval], 40 | with_core_includes=no) 41 | 42 | if test "x$with_core_includes" != "xno"; then 43 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 44 | fi 45 | 46 | AC_ARG_WITH([locpla_includes], 47 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 48 | [Specify the path to locpla-includes in loc-pla_git.bb]), 49 | [locpla_incdir=$withval], 50 | with_locpla_includes=no) 51 | 52 | if test "x${with_locpla_includes}" != "xno"; then 53 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 54 | fi 55 | 56 | AC_SUBST([CPPFLAGS]) 57 | 58 | AC_ARG_WITH([glib], 59 | AC_HELP_STRING([--with-glib], 60 | [enable glib, building HLOS systems which use glib])) 61 | 62 | if (test "x${with_glib}" = "xyes"); then 63 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 | AC_MSG_ERROR(GThread >= 2.16 is required)) 66 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 | AC_MSG_ERROR(GLib >= 2.16 is required)) 68 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 | 71 | AC_SUBST(GLIB_CFLAGS) 72 | AC_SUBST(GLIB_LIBS) 73 | fi 74 | 75 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 | 77 | # External AP 78 | AC_ARG_WITH([external_ap], 79 | AC_HELP_STRING([--with-external_ap=@<:@dir@:>@], 80 | [Using External Application Processor]), 81 | [], 82 | with_external_ap=no) 83 | 84 | if test "x$with_external_ap" != "xno"; then 85 | CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP" 86 | fi 87 | 88 | AM_CONDITIONAL(USE_EXTERNAL_AP, test "x${with_external_ap}" = "xyes") 89 | 90 | AC_CONFIG_FILES([ \ 91 | Makefile \ 92 | location-api.pc \ 93 | ]) 94 | 95 | AC_OUTPUT 96 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemId.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __DATAITEMID_H__ 31 | #define __DATAITEMID_H__ 32 | 33 | /** 34 | * Enumeration of Data Item types 35 | * When add/remove/update changes are made to Data Items, this file needs to be updated 36 | * accordingly 37 | */ 38 | typedef enum e_DataItemId { 39 | INVALID_DATA_ITEM_ID = -1, 40 | // 0 - 4 41 | AIRPLANEMODE_DATA_ITEM_ID, 42 | ENH_DATA_ITEM_ID, 43 | GPSSTATE_DATA_ITEM_ID, 44 | NLPSTATUS_DATA_ITEM_ID, 45 | WIFIHARDWARESTATE_DATA_ITEM_ID, 46 | // 5 - 9 47 | NETWORKINFO_DATA_ITEM_ID, 48 | RILVERSION_DATA_ITEM_ID, 49 | RILSERVICEINFO_DATA_ITEM_ID, 50 | RILCELLINFO_DATA_ITEM_ID, 51 | SERVICESTATUS_DATA_ITEM_ID, 52 | // 10 - 14 53 | MODEL_DATA_ITEM_ID, 54 | MANUFACTURER_DATA_ITEM_ID, 55 | VOICECALL_DATA_ITEM, 56 | ASSISTED_GPS_DATA_ITEM_ID, 57 | SCREEN_STATE_DATA_ITEM_ID, 58 | // 15 - 19 59 | POWER_CONNECTED_STATE_DATA_ITEM_ID, 60 | TIMEZONE_CHANGE_DATA_ITEM_ID, 61 | TIME_CHANGE_DATA_ITEM_ID, 62 | WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID, 63 | SHUTDOWN_STATE_DATA_ITEM_ID, 64 | // 20 - 24 65 | TAC_DATA_ITEM_ID, 66 | MCCMNC_DATA_ITEM_ID, 67 | BTLE_SCAN_DATA_ITEM_ID, 68 | BT_SCAN_DATA_ITEM_ID, 69 | OEM_GTP_UPLOAD_TRIGGER_READY_ITEM_ID, 70 | 71 | MAX_DATA_ITEM_ID, 72 | 73 | // 26 - 74 | BATTERY_LEVEL_DATA_ITEM_ID, 75 | 76 | MAX_DATA_ITEM_ID_1_1, 77 | } DataItemId; 78 | 79 | #endif // #ifndef __DATAITEMID_H__ 80 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssBatching.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H 23 | 24 | #include 25 | #include 26 | 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssBatching; 35 | using ::android::hardware::gnss::V2_0::IGnssBatchingCallback; 36 | using ::android::hidl::base::V1_0::IBase; 37 | using ::android::hardware::hidl_array; 38 | using ::android::hardware::hidl_memory; 39 | using ::android::hardware::hidl_string; 40 | using ::android::hardware::hidl_vec; 41 | using ::android::hardware::Return; 42 | using ::android::hardware::Void; 43 | using ::android::sp; 44 | 45 | class BatchingAPIClient; 46 | struct GnssBatching : public IGnssBatching { 47 | GnssBatching(); 48 | ~GnssBatching(); 49 | 50 | // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. 51 | Return init(const sp& callback) override; 52 | Return getBatchSize() override; 53 | Return start(const IGnssBatching::Options& options ) override; 54 | Return flush() override; 55 | Return stop() override; 56 | Return cleanup() override; 57 | 58 | // Methods from ::android::hardware::gnss::V2_0::IGnssBatching follow. 59 | Return init_2_0(const sp& callback) override; 60 | 61 | private: 62 | struct GnssBatchingDeathRecipient : hidl_death_recipient { 63 | GnssBatchingDeathRecipient(sp gnssBatching) : 64 | mGnssBatching(gnssBatching) { 65 | } 66 | ~GnssBatchingDeathRecipient() = default; 67 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 68 | sp mGnssBatching; 69 | }; 70 | 71 | private: 72 | sp mGnssBatchingDeathRecipient = nullptr; 73 | sp mGnssBatchingCbIface = nullptr; 74 | BatchingAPIClient* mApi = nullptr; 75 | sp mGnssBatchingCbIface_2_0 = nullptr; 76 | }; 77 | 78 | } // namespace implementation 79 | } // namespace V2_1 80 | } // namespace gnss 81 | } // namespace hardware 82 | } // namespace android 83 | 84 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H 85 | -------------------------------------------------------------------------------- /gps/android/2.1/AGnssRil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_ 22 | #define ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::sp; 39 | 40 | struct Gnss; 41 | /* 42 | * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface 43 | * allows the GNSS chipset to request radio interface layer information from Android platform. 44 | * Examples of such information are reference location, unique subscriber ID, phone number string 45 | * and network availability changes. Also contains wrapper methods to allow methods from 46 | * IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL. 47 | */ 48 | struct AGnssRil : public V2_0::IAGnssRil { 49 | AGnssRil(Gnss* gnss); 50 | ~AGnssRil(); 51 | 52 | /* 53 | * Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow. 54 | * These declarations were generated from IAGnssRil.hal. 55 | */ 56 | Return setCallback(const sp& /*callback*/) override { 57 | return Void(); 58 | } 59 | Return setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override { 60 | return Void(); 61 | } 62 | Return setSetId(V1_0::IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override { 63 | return false; 64 | } 65 | Return updateNetworkAvailability(bool /*available*/, 66 | const hidl_string& /*apn*/) override { 67 | return false; 68 | } 69 | Return updateNetworkState(bool connected, V1_0::IAGnssRil::NetworkType type, bool roaming) override; 70 | 71 | // Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow 72 | Return updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttributes& attributes) override; 73 | 74 | private: 75 | Gnss* mGnss = nullptr; 76 | }; 77 | 78 | } // namespace implementation 79 | } // namespace V2_1 80 | } // namespace gnss 81 | } // namespace hardware 82 | } // namespace android 83 | 84 | #endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_ 85 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemsFactoryProxy.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #define LOG_TAG "DataItemsFactoryProxy" 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "loc_misc_utils.h" 38 | 39 | namespace loc_core 40 | { 41 | void* DataItemsFactoryProxy::dataItemLibHandle = NULL; 42 | get_concrete_data_item_fn* DataItemsFactoryProxy::getConcreteDIFunc = NULL; 43 | 44 | IDataItemCore* DataItemsFactoryProxy::createNewDataItem(DataItemId id) 45 | { 46 | IDataItemCore *mydi = nullptr; 47 | 48 | if (NULL != getConcreteDIFunc) { 49 | mydi = (*getConcreteDIFunc)(id); 50 | } 51 | else { 52 | getConcreteDIFunc = (get_concrete_data_item_fn * ) 53 | dlGetSymFromLib(dataItemLibHandle, DATA_ITEMS_LIB_NAME, DATA_ITEMS_GET_CONCRETE_DI); 54 | 55 | if (NULL != getConcreteDIFunc) { 56 | LOC_LOGd("Loaded function %s : %p", DATA_ITEMS_GET_CONCRETE_DI, getConcreteDIFunc); 57 | mydi = (*getConcreteDIFunc)(id); 58 | } 59 | else { 60 | // dlysm failed. 61 | const char * err = dlerror(); 62 | if (NULL == err) 63 | { 64 | err = "Unknown"; 65 | } 66 | LOC_LOGe("failed to find symbol %s; error=%s", DATA_ITEMS_GET_CONCRETE_DI, err); 67 | } 68 | } 69 | return mydi; 70 | } 71 | 72 | void DataItemsFactoryProxy::closeDataItemLibraryHandle() 73 | { 74 | if (NULL != dataItemLibHandle) { 75 | dlclose(dataItemLibHandle); 76 | dataItemLibHandle = NULL; 77 | } 78 | } 79 | 80 | } // namespace loc_core 81 | 82 | 83 | -------------------------------------------------------------------------------- /gps/utils/loc_timer.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013,2015 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __LOC_DELAY_H__ 31 | #define __LOC_DELAY_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif /* __cplusplus */ 36 | #include 37 | #include 38 | #include 39 | /* 40 | user_data: client context pointer, passthrough. Originally received 41 | from calling client when loc_timer_start() is called. 42 | result: 0 if timer successfully timed out; else timer failed. 43 | */ 44 | typedef void (*loc_timer_callback)(void *user_data, int32_t result); 45 | 46 | 47 | /* 48 | delay_msec: timeout value for the timer. 49 | cb_func: callback function pointer, implemented by client. 50 | Can not be NULL. 51 | user_data: client context pointer, passthrough. Will be 52 | returned when loc_timer_callback() is called. 53 | wakeOnExpire: true if to wake up CPU (if sleeping) upon timer 54 | expiration and notify the client. 55 | false if to wait until next time CPU wakes up (if 56 | sleeping) and then notify the client. 57 | Returns the handle, which can be used to stop the timer 58 | NULL, if timer start fails (e.g. if cb_func is NULL). 59 | */ 60 | void* loc_timer_start(uint64_t delay_msec, 61 | loc_timer_callback cb_func, 62 | void *user_data, 63 | bool wake_on_expire=false); 64 | 65 | /* 66 | handle becomes invalid upon the return of the callback 67 | */ 68 | void loc_timer_stop(void*& handle); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif /* __cplusplus */ 73 | 74 | #endif //__LOC_DELAY_H__ 75 | -------------------------------------------------------------------------------- /gps/core/LocAdapterProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, 2016-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ADAPTER_PROXY_BASE_H 31 | #define LOC_ADAPTER_PROXY_BASE_H 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core { 37 | 38 | class LocAdapterProxyBase { 39 | private: 40 | LocAdapterBase *mLocAdapterBase; 41 | protected: 42 | inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, 43 | ContextBase* context, bool isMaster = false): 44 | mLocAdapterBase(new LocAdapterBase(mask, context, isMaster, this)) { 45 | } 46 | inline virtual ~LocAdapterProxyBase() { 47 | delete mLocAdapterBase; 48 | } 49 | inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, 50 | loc_registration_mask_status isEnabled) { 51 | mLocAdapterBase->updateEvtMask(event,isEnabled); 52 | } 53 | 54 | inline uint32_t generateSessionId() { 55 | return mLocAdapterBase->generateSessionId(); 56 | } 57 | public: 58 | inline ContextBase* getContext() const { 59 | return mLocAdapterBase->getContext(); 60 | } 61 | 62 | inline virtual void handleEngineUpEvent() {}; 63 | inline virtual void handleEngineDownEvent() {}; 64 | inline virtual void reportPositionEvent(UlpLocation &location, 65 | GpsLocationExtended &locationExtended, 66 | enum loc_sess_status status, 67 | LocPosTechMask loc_technology_mask) { 68 | (void)location; 69 | (void)locationExtended; 70 | (void)status; 71 | (void)loc_technology_mask; 72 | } 73 | }; 74 | 75 | } // namespace loc_core 76 | 77 | #endif //LOC_ADAPTER_PROXY_BASE_H 78 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2_0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2_0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::hardware::gnss::V2_0::GnssConstellationType; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public V2_1::IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | 50 | /* 51 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 52 | * These declarations were generated from IGnssConfiguration.hal. 53 | */ 54 | Return setSuplVersion(uint32_t version) override; 55 | Return setSuplMode(uint8_t mode) override; 56 | Return setSuplEs(bool enabled) override; 57 | Return setLppProfile(uint8_t lppProfileMask) override; 58 | Return setGlonassPositioningProtocol(uint8_t protocol) override; 59 | Return setEmergencySuplPdn(bool enable) override; 60 | Return setGpsLock(uint8_t lock) override; 61 | 62 | // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. 63 | Return setBlacklist( 64 | const hidl_vec& blacklist) override; 65 | 66 | // Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow. 67 | Return setEsExtensionSec(uint32_t emergencyExtensionSeconds) override; 68 | // Methods from ::android::hardware::gnss::V2_1::IGnssConfiguration follow. 69 | Return setBlacklist_2_1( 70 | const hidl_vec& blacklist) override; 71 | 72 | private: 73 | Gnss* mGnss = nullptr; 74 | bool setBlacklistedSource( 75 | GnssSvIdSource& copyToSource, 76 | const GnssConfiguration::BlacklistedSource& copyFromSource); 77 | bool setBlacklistedSource( 78 | GnssSvIdSource& copyToSource, const GnssConstellationType& constellation, 79 | const int16_t svid); 80 | }; 81 | 82 | } // namespace implementation 83 | } // namespace V2_1 84 | } // namespace gnss 85 | } // namespace hardware 86 | } // namespace android 87 | 88 | #endif // ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H 89 | -------------------------------------------------------------------------------- /gps/utils/LocTimer.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __LOC_TIMER_CPP_H__ 31 | #define __LOC_TIMER_CPP_H__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_util { 37 | 38 | // opaque class to provide service implementation. 39 | class LocTimerDelegate; 40 | class LocSharedLock; 41 | 42 | // LocTimer client must extend this class and implementthe callback. 43 | // start() / stop() methods are to arm / disarm timer. 44 | class LocTimer 45 | { 46 | LocTimerDelegate* mTimer; 47 | LocSharedLock* mLock; 48 | // don't really want mLock to be manipulated by clients, yet LocTimer 49 | // has to have a reference to the lock so that the delete of LocTimer 50 | // and LocTimerDelegate can work together on their share resources. 51 | friend class LocTimerDelegate; 52 | 53 | public: 54 | LocTimer(); 55 | virtual ~LocTimer(); 56 | 57 | // timeOutInMs: timeout delay in ms 58 | // wakeOnExpire: true if to wake up CPU (if sleeping) upon timer 59 | // expiration and notify the client. 60 | // false if to wait until next time CPU wakes up (if 61 | // sleeping) and then notify the client. 62 | // return: true on success; 63 | // false on failure, e.g. timer is already running. 64 | bool start(uint32_t timeOutInMs, bool wakeOnExpire); 65 | 66 | // return: true on success; 67 | // false on failure, e.g. timer is not running. 68 | bool stop(); 69 | 70 | // LocTimer client Should implement this method. 71 | // This method is used for timeout calling back to client. This method 72 | // should be short enough (eg: send a message to your own thread). 73 | virtual void timeOutCallback() = 0; 74 | }; 75 | 76 | } // namespace loc_util 77 | 78 | #endif //__LOC_DELAY_H__ 79 | -------------------------------------------------------------------------------- /gps/utils/LogBuffer.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOG_BUFFER_H 31 | #define LOG_BUFFER_H 32 | 33 | #include "SkipList.h" 34 | #include "log_util.h" 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | //default error level time depth threshold, 48 | #define TIME_DEPTH_THRESHOLD_MINIMAL_IN_SEC 60 49 | //default maximum log buffer size 50 | #define MAXIMUM_NUM_IN_LIST 50 51 | //file path of dumped log buffer 52 | #define LOG_BUFFER_FILE_PATH "/data/vendor/location/" 53 | 54 | namespace loc_util { 55 | 56 | class ConfigsInLevel{ 57 | public: 58 | uint32_t mTimeDepthThres; 59 | uint32_t mMaxNumThres; 60 | int mCurrentSize; 61 | 62 | ConfigsInLevel(uint32_t time, int num, int size): 63 | mTimeDepthThres(time), mMaxNumThres(num), mCurrentSize(size) {} 64 | }; 65 | 66 | class LogBuffer { 67 | private: 68 | static LogBuffer* mInstance; 69 | static struct sigaction mOriSigAction[NSIG]; 70 | static struct sigaction mNewSigAction; 71 | static mutex sLock; 72 | 73 | SkipList> mLogList; 74 | vector mConfigVec; 75 | mutex mLock; 76 | 77 | const vector mLevelMap {"E", "W", "I", "D", "V"}; 78 | 79 | public: 80 | static LogBuffer* getInstance(); 81 | void append(string& data, int level, uint64_t timestamp); 82 | void dump(std::function log, int level = -1); 83 | void dumpToAdbLogcat(); 84 | void dumpToLogFile(string filePath); 85 | void flush(); 86 | private: 87 | LogBuffer(); 88 | void registerSignalHandler(); 89 | static void signalHandler(const int code, siginfo_t *const si, void *const sc); 90 | 91 | }; 92 | 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /gps/utils/loc_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_TARGET_H 30 | #define LOC_TARGET_H 31 | #define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc ) 32 | #define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC) 33 | #define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC) 34 | #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) 35 | #define TARGET_NO_GNSS TARGET_SET(GNSS_NONE, NO_SSC) 36 | #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) 37 | #define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC) 38 | #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) 39 | #define getTargetGnssType(target) (target>>1) 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | unsigned int loc_get_target(void); 47 | 48 | /*The character array passed to this function should have length 49 | of atleast PROPERTY_VALUE_MAX*/ 50 | void loc_get_target_baseband(char *baseband, int array_length); 51 | /*The character array passed to this function should have length 52 | of atleast PROPERTY_VALUE_MAX*/ 53 | void loc_get_platform_name(char *platform_name, int array_length); 54 | /*The character array passed to this function should have length 55 | of atleast PROPERTY_VALUE_MAX*/ 56 | void loc_get_auto_platform_name(char *platform_name, int array_length); 57 | int loc_identify_low_ram_target(); 58 | /*The character array passed to this function should have length 59 | of atleast PROPERTY_VALUE_MAX*/ 60 | void loc_get_device_soc_id(char *soc_id_value, int array_length); 61 | 62 | /* Please remember to update 'target_name' in loc_log.cpp, 63 | if do any changes to this enum. */ 64 | typedef enum { 65 | GNSS_NONE = 0, 66 | GNSS_MSM, 67 | GNSS_GSS, 68 | GNSS_MDM, 69 | GNSS_AUTO, 70 | GNSS_UNKNOWN 71 | }GNSS_TARGET; 72 | 73 | typedef enum { 74 | NO_SSC = 0, 75 | HAS_SSC 76 | }SSC_TYPE; 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /*LOC_TARGET_H*/ 83 | -------------------------------------------------------------------------------- /gps/core/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps loc-core 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps loc-hal package version 1.0.0 8 | AC_INIT([loc-core],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([loc-core.pc.in]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | AC_ARG_WITH([core_includes], 37 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 38 | [Specify the location of the core headers]), 39 | [core_incdir=$withval], 40 | with_core_includes=no) 41 | 42 | if test "x$with_core_includes" != "xno"; then 43 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 44 | fi 45 | 46 | AC_ARG_WITH([locpla_includes], 47 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 48 | [specify the path to locpla-includes in loc-pla_git.bb]), 49 | [locpla_incdir=$withval], 50 | with_locpla_includes=no) 51 | 52 | if test "x$with_locpla_includes" != "xno"; then 53 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 54 | fi 55 | 56 | AC_SUBST([CPPFLAGS]) 57 | 58 | AC_ARG_WITH([glib], 59 | AC_HELP_STRING([--with-glib], 60 | [enable glib, building HLOS systems which use glib])) 61 | 62 | if (test "x${with_glib}" = "xyes"); then 63 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 | AC_MSG_ERROR(GThread >= 2.16 is required)) 66 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 | AC_MSG_ERROR(GLib >= 2.16 is required)) 68 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 | 71 | AC_SUBST(GLIB_CFLAGS) 72 | AC_SUBST(GLIB_LIBS) 73 | fi 74 | 75 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 | 77 | AC_ARG_WITH([auto_feature], 78 | AC_HELP_STRING([--with-auto_feature=@<:@dir@:>@], 79 | [Using Automotive feature]), 80 | [], 81 | with_auto_feature=no) 82 | 83 | if test "x$with_auto_feature" != "xno"; then 84 | CPPFLAGS="${CPPFLAGS} -DFEATURE_AUTOMOTIVE" 85 | fi 86 | 87 | AM_CONDITIONAL(USE_FEATURE_AUTOMOTIVE, test "x${with_auto_feature}" = "xyes") 88 | 89 | # External AP 90 | AC_ARG_WITH([external_ap], 91 | AC_HELP_STRING([--with-external_ap=@<:@dir@:>@], 92 | [Using External Application Processor]), 93 | [], 94 | with_external_ap=no) 95 | 96 | if test "x$with_external_ap" != "xno"; then 97 | CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP" 98 | fi 99 | 100 | AM_CONDITIONAL(USE_EXTERNAL_AP, test "x${with_external_ap}" = "xyes") 101 | 102 | AC_CONFIG_FILES([ \ 103 | Makefile \ 104 | loc-core.pc \ 105 | ]) 106 | 107 | AC_OUTPUT 108 | -------------------------------------------------------------------------------- /media/init.qti.media.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | #============================================================================== 3 | # init.qti.media.sh 4 | # 5 | # Copyright (c) 2020-2021, Qualcomm Technologies, Inc. 6 | # All Rights Reserved. 7 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 8 | # 9 | # Copyright (c) 2020, The Linux Foundation. All rights reserved. 10 | # 11 | # Redistribution and use in source and binary forms, with or without 12 | # modification, are permitted provided that the following conditions are 13 | # met: 14 | # * Redistributions of source code must retain the above copyright 15 | # notice, this list of conditions and the following disclaimer. 16 | # * Redistributions in binary form must reproduce the above 17 | # copyright notice, this list of conditions and the following 18 | # disclaimer in the documentation and/or other materials provided 19 | # with the distribution. 20 | # * Neither the name of The Linux Foundation nor the names of its 21 | # contributors may be used to endorse or promote products derived 22 | # from this software without specific prior written permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 25 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 26 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 27 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 28 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | #=============================================================================== 36 | 37 | if [ -f /sys/devices/soc0/soc_id ]; then 38 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null 39 | else 40 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null 41 | fi 42 | 43 | target=`getprop ro.board.platform` 44 | case "$target" in 45 | "lahaina") 46 | case "$soc_hwid" in 47 | 475|515) 48 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null 49 | if [ $sku_ver -eq 1 ]; then 50 | setprop vendor.media.target_variant "_yupik_v1" 51 | else 52 | setprop vendor.media.target_variant "_yupik_v0" 53 | fi 54 | setprop vendor.netflix.bsp_rev "Q7325-SPY-33758-1" 55 | ;; 56 | 450) 57 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null 58 | if [ $sku_ver -eq 1 ]; then 59 | setprop vendor.media.target_variant "_shima_v1" 60 | elif [ $sku_ver -eq 2 ]; then 61 | setprop vendor.media.target_variant "_shima_v2" 62 | else 63 | setprop vendor.media.target_variant "_shima_v3" 64 | fi 65 | setprop vendor.netflix.bsp_rev "Q875-32774-1" 66 | ;; 67 | *) 68 | setprop vendor.media.target_variant "_lahaina" 69 | setprop vendor.netflix.bsp_rev "Q875-32408-1" 70 | ;; 71 | esac 72 | ;; 73 | esac 74 | -------------------------------------------------------------------------------- /gps/android/2.1/location_api/GeofenceAPIClient.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef GEOFENCE_API_CLINET_H 31 | #define GEOFENCE_API_CLINET_H 32 | 33 | 34 | #include 35 | #include 36 | 37 | namespace android { 38 | namespace hardware { 39 | namespace gnss { 40 | namespace V2_1 { 41 | namespace implementation { 42 | 43 | using ::android::sp; 44 | 45 | class GeofenceAPIClient : public LocationAPIClientBase 46 | { 47 | public: 48 | GeofenceAPIClient(const sp& callback); 49 | 50 | void geofenceAdd(uint32_t geofence_id, double latitude, double longitude, 51 | double radius_meters, int32_t last_transition, int32_t monitor_transitions, 52 | uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms); 53 | void geofencePause(uint32_t geofence_id); 54 | void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions); 55 | void geofenceRemove(uint32_t geofence_id); 56 | void geofenceRemoveAll(); 57 | 58 | // callbacks 59 | void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final; 60 | void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final; 61 | void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; 62 | void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; 63 | void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; 64 | void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; 65 | 66 | private: 67 | virtual ~GeofenceAPIClient() = default; 68 | 69 | sp mGnssGeofencingCbIface; 70 | }; 71 | 72 | } // namespace implementation 73 | } // namespace V2_1 74 | } // namespace gnss 75 | } // namespace hardware 76 | } // namespace android 77 | #endif // GEOFENCE_API_CLINET_H 78 | -------------------------------------------------------------------------------- /gps/core/LocContext.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2014, 2016-2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #define LOG_NDEBUG 0 30 | #define LOG_TAG "LocSvc_Ctx" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | namespace loc_core { 40 | 41 | const MsgTask* LocContext::mMsgTask = NULL; 42 | ContextBase* LocContext::mContext = NULL; 43 | // the name must be shorter than 15 chars 44 | const char* LocContext::mLocationHalName = "Loc_hal_worker"; 45 | #ifndef USE_GLIB 46 | const char* LocContext::mLBSLibName = "liblbs_core.so"; 47 | #else 48 | const char* LocContext::mLBSLibName = "liblbs_core.so.1"; 49 | #endif 50 | 51 | pthread_mutex_t LocContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; 52 | 53 | const MsgTask* LocContext::getMsgTask(const char* name) 54 | { 55 | if (NULL == mMsgTask) { 56 | mMsgTask = new MsgTask(name); 57 | } 58 | return mMsgTask; 59 | } 60 | 61 | ContextBase* LocContext::getLocContext(const char* name) 62 | { 63 | pthread_mutex_lock(&LocContext::mGetLocContextMutex); 64 | LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__); 65 | if (NULL == mContext) { 66 | LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__); 67 | const MsgTask* msgTask = getMsgTask(name); 68 | mContext = new LocContext(msgTask); 69 | } 70 | pthread_mutex_unlock(&LocContext::mGetLocContextMutex); 71 | 72 | return mContext; 73 | } 74 | 75 | void LocContext :: injectFeatureConfig(ContextBase *curContext) 76 | { 77 | LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", 78 | __func__, __LINE__, ((LocContext *)curContext)->mLBSProxy); 79 | ((LocContext *)curContext)->mLBSProxy->injectFeatureConfig(curContext); 80 | } 81 | 82 | LocContext::LocContext(const MsgTask* msgTask) : 83 | ContextBase(msgTask, 0, mLBSLibName) 84 | { 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /gps/android/2.1/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOCATION_UTIL_H 31 | #define LOCATION_UTIL_H 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | namespace android { 39 | namespace hardware { 40 | namespace gnss { 41 | namespace V2_1 { 42 | namespace implementation { 43 | 44 | using MeasurementCorrectionsV1_0 = 45 | ::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections; 46 | using ::android::hardware::gnss::measurement_corrections::V1_0::SingleSatCorrection; 47 | 48 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 49 | void convertGnssLocation(Location& in, V2_0::GnssLocation& out); 50 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 51 | void convertGnssLocation(const V2_0::GnssLocation& in, Location& out); 52 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 53 | void convertGnssConstellationType(GnssSvType& in, V2_0::GnssConstellationType& out); 54 | void convertGnssSvid(GnssSv& in, int16_t& out); 55 | void convertGnssSvid(GnssMeasurementsData& in, int16_t& out); 56 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 57 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 58 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 59 | void convertSingleSatCorrections(const SingleSatCorrection& in, GnssSingleSatCorrection& out); 60 | void convertMeasurementCorrections(const MeasurementCorrectionsV1_0& in, 61 | GnssMeasurementCorrections& out); 62 | 63 | } // namespace implementation 64 | } // namespace V2_1 65 | } // namespace gnss 66 | } // namespace hardware 67 | } // namespace android 68 | #endif // LOCATION_UTIL_H 69 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssGeofencing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_1 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; 34 | using ::android::hardware::gnss::V1_0::IGnssGeofencing; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | class GeofenceAPIClient; 42 | struct GnssGeofencing : public IGnssGeofencing { 43 | GnssGeofencing(); 44 | ~GnssGeofencing(); 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. 48 | * These declarations were generated from IGnssGeofencing.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return addGeofence(int32_t geofenceId, 52 | double latitudeDegrees, 53 | double longitudeDegrees, 54 | double radiusMeters, 55 | IGnssGeofenceCallback::GeofenceTransition lastTransition, 56 | int32_t monitorTransitions, 57 | uint32_t notificationResponsivenessMs, 58 | uint32_t unknownTimerMs) override; 59 | 60 | Return pauseGeofence(int32_t geofenceId) override; 61 | Return resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override; 62 | Return removeGeofence(int32_t geofenceId) override; 63 | 64 | private: 65 | // This method is not part of the IGnss base class. 66 | // It is called by GnssGeofencingDeathRecipient to remove all geofences added so far. 67 | Return removeAllGeofences(); 68 | 69 | private: 70 | struct GnssGeofencingDeathRecipient : hidl_death_recipient { 71 | GnssGeofencingDeathRecipient(sp gnssGeofencing) : 72 | mGnssGeofencing(gnssGeofencing) { 73 | } 74 | ~GnssGeofencingDeathRecipient() = default; 75 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 76 | sp mGnssGeofencing; 77 | }; 78 | 79 | private: 80 | sp mGnssGeofencingDeathRecipient = nullptr; 81 | sp mGnssGeofencingCbIface = nullptr; 82 | GeofenceAPIClient* mApi = nullptr; 83 | }; 84 | 85 | } // namespace implementation 86 | } // namespace V2_1 87 | } // namespace gnss 88 | } // namespace hardware 89 | } // namespace android 90 | 91 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H 92 | -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-base.policy: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2020 The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are 6 | # met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above 10 | # copyright notice, this list of conditions and the following 11 | # disclaimer in the documentation and/or other materials provided 12 | # with the distribution. 13 | # * Neither the name of The Linux Foundation, nor the names of its 14 | # contributors may be used to endorse or promote products derived 15 | # from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | #****************************************************************************** 30 | 31 | clone: 1 32 | close: 1 33 | connect: 1 34 | execve: 1 35 | exit_group: 1 36 | exit: 1 37 | faccessat: 1 38 | fcntl: 1 39 | fstat: 1 40 | fstatfs: 1 41 | futex: 1 42 | getpid: 1 43 | getuid: 1 44 | getgid: 1 45 | getegid: 1 46 | getgroups: 1 47 | geteuid: 1 48 | umask: 1 49 | getrandom: 1 50 | mmap: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE 51 | mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE 52 | mremap: 1 53 | munmap: 1 54 | newfstatat: 1 55 | openat: 1 56 | #prctl: arg0 == PR_SET_VMA || arg0 == PR_SET_NO_NEW_PRIVS || arg0 == PR_GET_DUMPABLE || arg0 == PR_SET_SECCOMP || arg0 == 0x37 /* PR_??? */ 57 | prctl: 1 58 | pread64: 1 59 | read: 1 60 | pwrite64: 1 61 | write: 1 62 | writev: 1 63 | readlinkat: 1 64 | restart_syscall: 1 65 | rt_sigaction: 1 66 | rt_sigprocmask: 1 67 | rt_sigreturn: 1 68 | sched_getscheduler: 1 69 | set_tid_address: 1 70 | sigaltstack: 1 71 | unlinkat: 1 72 | lseek: 1 73 | ##ioctl: arg1 == _IOC(_IOC_NONE || arg1 == _IOC(_IOC_READ || arg1 == VSOC_MAYBE_SEND_INTERRUPT_TO_HOST 74 | ioctl: 1 75 | clock_gettime: 1 76 | 77 | 78 | socket: arg0 == AF_INET6 || arg0 == AF_UNIX || arg0 == AF_QIPCRTR 79 | connect: 1 80 | setsockopt: 1 81 | getsockname: 1 82 | socketpair: 1 83 | ppoll: 1 84 | pselect6: 1 85 | accept4: 1 86 | listen: 1 87 | bind: 1 88 | pipe2: 1 89 | 90 | recvmsg: 1 91 | sendmsg: 1 92 | 93 | sendto: 1 94 | recvfrom: 1 95 | 96 | getsockname: 1 97 | nanosleep: 1 98 | clone: 1 99 | setsockopt: 1 100 | getsockopt: 1 101 | madvise: 1 102 | 103 | getitimer: 1 104 | setitimer: 1 105 | getpid: 1 106 | bind: 1 107 | listen: 1 108 | getpeername: 1 109 | socketpair: 1 110 | wait4: 1 111 | chown: 1 112 | fchown: 1 113 | lchown: 1 114 | umask: 1 115 | mmap2: 1 116 | fstat64: 1 117 | fstatat64: 1 118 | _llseek: 1 119 | geteuid: 1 120 | -------------------------------------------------------------------------------- /gps/android/2.1/location_api/BatchingAPIClient.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef BATCHING_API_CLINET_H 31 | #define BATCHING_API_CLINET_H 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | namespace android { 41 | namespace hardware { 42 | namespace gnss { 43 | namespace V2_1 { 44 | namespace implementation { 45 | 46 | 47 | enum BATCHING_STATE { STARTED, STOPPING, STOPPED }; 48 | 49 | class BatchingAPIClient : public LocationAPIClientBase 50 | { 51 | public: 52 | BatchingAPIClient(const sp& callback); 53 | BatchingAPIClient(const sp& callback); 54 | void gnssUpdateCallbacks(const sp& callback); 55 | void gnssUpdateCallbacks_2_0(const sp& callback); 56 | int getBatchSize(); 57 | int startSession(const V1_0::IGnssBatching::Options& options); 58 | int updateSessionOptions(const V1_0::IGnssBatching::Options& options); 59 | int stopSession(); 60 | void getBatchedLocation(int last_n_locations); 61 | void flushBatchedLocations(); 62 | 63 | inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; } 64 | 65 | // callbacks 66 | void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; 67 | void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; 68 | 69 | private: 70 | ~BatchingAPIClient(); 71 | 72 | void setCallbacks(); 73 | std::mutex mMutex; 74 | sp mGnssBatchingCbIface; 75 | uint32_t mDefaultId; 76 | LocationCapabilitiesMask mLocationCapabilitiesMask; 77 | sp mGnssBatchingCbIface_2_0; 78 | volatile BATCHING_STATE mState = STOPPED; 79 | 80 | std::vector mBatchedLocationInCache; 81 | }; 82 | 83 | } // namespace implementation 84 | } // namespace V2_1 85 | } // namespace gnss 86 | } // namespace hardware 87 | } // namespace android 88 | #endif // BATCHING_API_CLINET_H 89 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssMeasurement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2_0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2_0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H 22 | #define ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::sp; 39 | 40 | class MeasurementAPIClient; 41 | struct GnssMeasurement : public V2_1::IGnssMeasurement { 42 | GnssMeasurement(); 43 | ~GnssMeasurement(); 44 | 45 | /* 46 | * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. 47 | * These declarations were generated from IGnssMeasurement.hal. 48 | */ 49 | Return setCallback( 50 | const sp& callback) override; 51 | Return close() override; 52 | 53 | // Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. 54 | Return setCallback_1_1( 55 | const sp& callback, 56 | bool enableFullTracking) override; 57 | 58 | // Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow. 59 | Return setCallback_2_0( 60 | const sp& callback, 61 | bool enableFullTracking) override; 62 | // Methods from ::android::hardware::gnss::V2_1::IGnssMeasurement follow. 63 | Return setCallback_2_1( 64 | const sp<::android::hardware::gnss::V2_1::IGnssMeasurementCallback>& callback, 65 | bool enableFullTracking) override; 66 | 67 | private: 68 | struct GnssMeasurementDeathRecipient : hidl_death_recipient { 69 | GnssMeasurementDeathRecipient(sp gnssMeasurement) : 70 | mGnssMeasurement(gnssMeasurement) { 71 | } 72 | ~GnssMeasurementDeathRecipient() = default; 73 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 74 | sp mGnssMeasurement; 75 | }; 76 | 77 | private: 78 | sp mGnssMeasurementDeathRecipient = nullptr; 79 | sp mGnssMeasurementCbIface = nullptr; 80 | sp mGnssMeasurementCbIface_1_1 = nullptr; 81 | sp mGnssMeasurementCbIface_2_0 = nullptr; 82 | sp mGnssMeasurementCbIface_2_1 = nullptr; 83 | MeasurementAPIClient* mApi; 84 | void clearInterfaces(); 85 | }; 86 | 87 | } // namespace implementation 88 | } // namespace V2_1 89 | } // namespace gnss 90 | } // namespace hardware 91 | } // namespace android 92 | 93 | #endif // ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H 94 | --------------------------------------------------------------------------------