Compare commits
297 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07e91d9a2d | ||
|
|
0ff066cde1 | ||
|
|
c1439235fa | ||
|
|
7e384575d1 | ||
|
|
1c2bd643a3 | ||
|
|
f87ec6d3a6 | ||
|
|
43ed5d3234 | ||
|
|
51df960087 | ||
|
|
6bacc51458 | ||
|
|
ec8d92780c | ||
|
|
a51290d98f | ||
|
|
3f263e4f7d | ||
|
|
3fe43a93fc | ||
|
|
57bc73c1cf | ||
|
|
756181465d | ||
|
|
5472876469 | ||
|
|
e68c4a551e | ||
|
|
942ffdd23e | ||
|
|
b8a08dd097 | ||
|
|
4926cbee62 | ||
|
|
e1b6bfde41 | ||
|
|
6fce1687dc | ||
|
|
354c506dc7 | ||
|
|
ce1b080e84 | ||
|
|
9441e42181 | ||
|
|
a914ec42fb | ||
|
|
4f57c180e2 | ||
|
|
a445720422 | ||
|
|
638379aa1f | ||
|
|
547935e754 | ||
|
|
bb5f228ff6 | ||
|
|
cd500c5c03 | ||
|
|
c2d71733aa | ||
|
|
d2c79049a9 | ||
|
|
b0d2b3664b | ||
|
|
8276a0636d | ||
|
|
ba6659ca08 | ||
|
|
00aca9fe4a | ||
|
|
0a902acc71 | ||
|
|
bfce8d058d | ||
|
|
3ba3e8a24d | ||
|
|
f4728af82d | ||
|
|
f20b04c32d | ||
|
|
cb64a3c4a8 | ||
|
|
4ae2ec8fe4 | ||
|
|
c9b42d7175 | ||
|
|
c4e24961c7 | ||
|
|
2723d8770e | ||
|
|
de6b682299 | ||
|
|
60ecc2e861 | ||
|
|
c8a10ba5ea | ||
|
|
fc41ea5088 | ||
|
|
8315029ab6 | ||
|
|
f441f3f70d | ||
|
|
6431f3183c | ||
|
|
169ee391d4 | ||
|
|
5a17d256f3 | ||
|
|
840b6d8bb6 | ||
|
|
68d22d4672 | ||
|
|
0b1b2dfcdf | ||
|
|
30271e5892 | ||
|
|
3f6532152f | ||
|
|
cce595dc56 | ||
|
|
457b1203c4 | ||
|
|
ffb32f359c | ||
|
|
d541838f74 | ||
|
|
0fdef2b297 | ||
|
|
13ba6bf749 | ||
|
|
f427f80d45 | ||
|
|
a80ffb78c5 | ||
|
|
20fe51e090 | ||
|
|
b954f402f0 | ||
|
|
b0f0d5cff4 | ||
|
|
dcf36183da | ||
|
|
1c8dceebe0 | ||
|
|
5740fab0ef | ||
|
|
7a60b2fe1c | ||
|
|
45c75452de | ||
|
|
d9eba2218c | ||
|
|
8237d5d1e1 | ||
|
|
8f8c9cc276 | ||
|
|
e38e759233 | ||
|
|
af5e08b1be | ||
|
|
156ac22c2f | ||
|
|
915d003ffb | ||
|
|
b2a40afb65 | ||
|
|
1f07cba6f5 | ||
|
|
1334cb45d3 | ||
|
|
687a07d724 | ||
|
|
cc4dafaaa3 | ||
|
|
9ee56bbf70 | ||
|
|
542038d2a7 | ||
|
|
5c3dc2f642 | ||
|
|
0c6c99cf72 | ||
|
|
65750b254b | ||
|
|
24ec1b9033 | ||
|
|
f7d964dfc4 | ||
|
|
cb81fc8fb3 | ||
|
|
4c389f0767 | ||
|
|
12d4e72771 | ||
|
|
53a7c00117 | ||
|
|
4534f45197 | ||
|
|
ce45f218f0 | ||
|
|
212e4d4cab | ||
|
|
c99dee513f | ||
|
|
0746a20448 | ||
|
|
7465676587 | ||
|
|
7adb2136b5 | ||
|
|
54612a55c7 | ||
|
|
a4a1e64fb1 | ||
|
|
7a625e552c | ||
|
|
f3a3fef704 | ||
|
|
8171e511cd | ||
|
|
cf5c3a6817 | ||
|
|
66b2f112ba | ||
|
|
28ded2cc6a | ||
|
|
855d128707 | ||
|
|
748d7566d0 | ||
|
|
ada081fb8c | ||
|
|
483545ad29 | ||
|
|
0f64646086 | ||
|
|
8c605c6a61 | ||
|
|
e7b3dc8ea1 | ||
|
|
cb10f89d2b | ||
|
|
e562fbb332 | ||
|
|
6c5da520d2 | ||
|
|
59f669b7e8 | ||
|
|
49e04f0c9d | ||
|
|
117d2a1a88 | ||
|
|
aeca3ef547 | ||
|
|
e0f2667cee | ||
|
|
07535b2b2b | ||
|
|
d40f7552aa | ||
|
|
bdaf6c277a | ||
|
|
d7bb5e405c | ||
|
|
ec859600fb | ||
|
|
9cb0f9dc05 | ||
|
|
d33c89e0a1 | ||
|
|
1f7ce357b7 | ||
|
|
2671f45a25 | ||
|
|
014899509c | ||
|
|
a7637bcf08 | ||
|
|
646f6bf434 | ||
|
|
43e7bd48ae | ||
|
|
15ead2a75b | ||
|
|
d2e18f6ec8 | ||
|
|
3848a96a9b | ||
|
|
684f7f16f4 | ||
|
|
71ffa62745 | ||
|
|
32d2ceb4f5 | ||
|
|
3fa6b3d5b1 | ||
|
|
bbbfcc0879 | ||
|
|
0ac429711d | ||
|
|
0ccd673ee0 | ||
|
|
603dc427a7 | ||
|
|
1e5585e74d | ||
|
|
9b14af8088 | ||
|
|
548b79371b | ||
|
|
7076970687 | ||
|
|
5f86373e76 | ||
|
|
4224592289 | ||
|
|
b89a13b160 | ||
|
|
24e3b2e7c2 | ||
|
|
0a1a50ef92 | ||
|
|
f756e28207 | ||
|
|
abc47dff7e | ||
|
|
023ad9b197 | ||
|
|
6f5b751bbb | ||
|
|
e5077ec6a1 | ||
|
|
5d5bb4c727 | ||
|
|
b63e008932 | ||
|
|
28e261ebbb | ||
|
|
0c31bb8c35 | ||
|
|
9434266bc4 | ||
|
|
23a52823e6 | ||
|
|
a9c631f5a5 | ||
|
|
c24e55b07b | ||
|
|
81a2eaae75 | ||
|
|
250cd77169 | ||
|
|
d1888a5946 | ||
|
|
e39943f131 | ||
|
|
e15f49a7e6 | ||
|
|
8870049517 | ||
|
|
412898744e | ||
|
|
6bbb428f6a | ||
|
|
c0cd12fcd6 | ||
|
|
d2a5fb711d | ||
|
|
b7e4144e3f | ||
|
|
f3a77d7f8c | ||
|
|
ddcec47b22 | ||
|
|
e694a35d72 | ||
|
|
1a6e702c95 | ||
|
|
a84509b613 | ||
|
|
082dd73465 | ||
|
|
140b67a79a | ||
|
|
58760423d7 | ||
|
|
5c5797aef8 | ||
|
|
aa9cafe2b5 | ||
|
|
2b8437b86c | ||
|
|
2352510ba3 | ||
|
|
0c7d8495dc | ||
|
|
57bff751dd | ||
|
|
d2534a001b | ||
|
|
6a046463b6 | ||
|
|
7e919f286d | ||
|
|
49689fccc8 | ||
|
|
eb5bc860fa | ||
|
|
3717c0e17c | ||
|
|
1e96081225 | ||
|
|
63f852818a | ||
|
|
1016259505 | ||
|
|
633d86a404 | ||
|
|
25296a0b90 | ||
|
|
9a796adc5a | ||
|
|
51c234e824 | ||
|
|
2ddda972d4 | ||
|
|
5367ddd96f | ||
|
|
8db7026908 | ||
|
|
aed19f8c57 | ||
|
|
fe1ac133d3 | ||
|
|
5655963927 | ||
|
|
58169ee9ab | ||
|
|
e59499bccc | ||
|
|
ce352b981f | ||
| bdf75b6640 | |||
|
|
45b536bb3d | ||
| 37e688e014 | |||
|
|
418b5c602b | ||
|
|
6a2718d11a | ||
|
|
3465722797 | ||
|
|
2bafe3126d | ||
|
|
370e16822b | ||
|
|
79c612d0c1 | ||
|
|
3dddebaf29 | ||
|
|
0a40198284 | ||
|
|
6d8d07375e | ||
|
|
3ccf176988 | ||
|
|
d65b9af20a | ||
|
|
7ad364dc2c | ||
|
|
23e105b16b | ||
|
|
4cdba7073d | ||
|
|
fc3546a15a | ||
|
|
e8c0bf3623 | ||
|
|
6753df51fd | ||
|
|
dcfd6861b7 | ||
|
|
b41a070d4b | ||
|
|
9b2a74fac3 | ||
|
|
9d403a5556 | ||
|
|
964480d597 | ||
|
|
e161bf833a | ||
|
|
16668d7c1f | ||
|
|
ba27485fc1 | ||
|
|
b0ecfeaf05 | ||
|
|
e6c5e3799f | ||
|
|
73246ffcca | ||
|
|
6f124e324d | ||
|
|
b7eda6412e | ||
|
|
6936cde9ed | ||
|
|
4052e8be99 | ||
|
|
6725fbaa1b | ||
|
|
100c878a40 | ||
|
|
41bdb63bf8 | ||
|
|
1a597acd94 | ||
|
|
2f01740142 | ||
|
|
a3686f1c31 | ||
|
|
233d51f1bd | ||
|
|
0365787e2e | ||
|
|
961d92258b | ||
|
|
fac6ee8b51 | ||
|
|
4f764de734 | ||
|
|
280785d305 | ||
|
|
8b8ff48c96 | ||
|
|
35532bae61 | ||
|
|
6fffc65871 | ||
|
|
0aed111b80 | ||
|
|
857b39c969 | ||
|
|
7e7fda0748 | ||
|
|
d0439ca05c | ||
|
|
945ec407b5 | ||
|
|
a302e24a6b | ||
|
|
c32712fd24 | ||
|
|
638651e113 | ||
|
|
d9b5f5f25f | ||
|
|
c725f81fcd | ||
|
|
235c4cbe0d | ||
|
|
a0cad4858d | ||
|
|
85d2c40504 | ||
|
|
20ad7c46c4 | ||
|
|
3d1b7ab190 | ||
|
|
2585b28c9f | ||
|
|
19de47cca9 | ||
|
|
dbce6d51a7 | ||
|
|
564653bbd8 | ||
|
|
1a4427e208 | ||
|
|
ecf8173678 | ||
|
|
d5c9f8d1a1 | ||
|
|
cb97c35af1 |
15
Android.bp
15
Android.bp
@@ -7,5 +7,20 @@
|
||||
soong_namespace {
|
||||
imports: [
|
||||
"hardware/qcom-caf/bootctrl",
|
||||
"vendor/qcom/opensource/commonsys-intf/display",
|
||||
"hardware/xiaomi",
|
||||
],
|
||||
}
|
||||
|
||||
install_symlink {
|
||||
name: "symlink_wlan_fw_adrastea",
|
||||
installed_location: "firmware/wlan/qca_cld/adrastea/wlan_mac.bin",
|
||||
symlink_target: "/mnt/vendor/persist/adrastea/wlan_mac.bin",
|
||||
vendor: true,
|
||||
}
|
||||
install_symlink {
|
||||
name: "symlink_wlan_cfg_adrastea",
|
||||
installed_location: "firmware/wlan/qca_cld/adrastea/WCNSS_qcom_cfg.ini",
|
||||
symlink_target: "/vendor/etc/wifi/adrastea/WCNSS_qcom_cfg.ini",
|
||||
vendor: true,
|
||||
}
|
||||
33
Android.mk
33
Android.mk
@@ -10,14 +10,31 @@ ifeq ($(TARGET_DEVICE),sky)
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so
|
||||
IMS_SYMLINKS := $(addprefix $(TARGET_OUT_SYSTEM_EXT_APPS_PRIVILEGED)/Ims/lib/arm64/,$(notdir $(IMS_LIBS)))
|
||||
$(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "IMS lib link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /system_ext/lib64/$(notdir $@) $@
|
||||
# A/B builds require us to create the mount points at compile time.
|
||||
FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt
|
||||
$(FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating $(FIRMWARE_MOUNT_POINT)"
|
||||
@mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
|
||||
BT_FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/bt_firmware
|
||||
$(BT_FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating $(BT_FIRMWARE_MOUNT_POINT)"
|
||||
@mkdir -p $(TARGET_OUT_VENDOR)/bt_firmware
|
||||
|
||||
DSP_MOUNT_POINT := $(TARGET_OUT_VENDOR)/dsp
|
||||
$(DSP_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating $(DSP_MOUNT_POINT)"
|
||||
@mkdir -p $(TARGET_OUT_VENDOR)/dsp
|
||||
|
||||
VM_SYSTEM_MOUNT_POINT := $(TARGET_OUT_VENDOR)/vm-system
|
||||
$(VM_SYSTEM_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating $(VM_SYSTEM_MOUNT_POINT)"
|
||||
@mkdir -p $(TARGET_OUT_VENDOR)/vm-system
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += \
|
||||
$(FIRMWARE_MOUNT_POINT) \
|
||||
$(BT_FIRMWARE_MOUNT_POINT) \
|
||||
$(DSP_MOUNT_POINT) \
|
||||
$(VM_SYSTEM_MOUNT_POINT)
|
||||
|
||||
endif
|
||||
|
||||
@@ -8,6 +8,6 @@ PRODUCT_MAKEFILES := \
|
||||
$(LOCAL_DIR)/lineage_sky.mk
|
||||
|
||||
COMMON_LUNCH_CHOICES := \
|
||||
lineage_sky-eng \
|
||||
lineage_sky-userdebug \
|
||||
lineage_sky-user
|
||||
lineage_sky-ap3a-eng \
|
||||
lineage_sky-ap3a-userdebug \
|
||||
lineage_sky-ap3a-user
|
||||
|
||||
244
BoardConfig.mk
244
BoardConfig.mk
@@ -8,6 +8,7 @@
|
||||
-include vendor/xiaomi/sky/BoardConfigVendor.mk
|
||||
|
||||
DEVICE_PATH := device/xiaomi/sky
|
||||
KERNEL_PATH := $(DEVICE_PATH)-kernel
|
||||
|
||||
# A/B
|
||||
AB_OTA_UPDATER := true
|
||||
@@ -16,6 +17,7 @@ AB_OTA_PARTITIONS += \
|
||||
boot \
|
||||
dtbo \
|
||||
odm \
|
||||
recovery \
|
||||
product \
|
||||
system \
|
||||
system_ext \
|
||||
@@ -31,12 +33,28 @@ TARGET_ARCH_VARIANT := armv8-a
|
||||
TARGET_CPU_ABI := arm64-v8a
|
||||
TARGET_CPU_ABI2 :=
|
||||
TARGET_CPU_VARIANT := generic
|
||||
TARGET_CPU_VARIANT_RUNTIME := kryo300
|
||||
|
||||
TARGET_2ND_ARCH := arm
|
||||
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
|
||||
TARGET_2ND_ARCH_VARIANT := armv8-2a
|
||||
TARGET_2ND_CPU_ABI := armeabi-v7a
|
||||
TARGET_2ND_CPU_ABI2 := armeabi
|
||||
TARGET_2ND_CPU_VARIANT := generic
|
||||
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a75
|
||||
|
||||
# Audio
|
||||
AUDIO_FEATURE_ENABLED_DLKM := true
|
||||
AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
|
||||
AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
|
||||
AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
|
||||
AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
|
||||
AUDIO_FEATURE_ENABLED_PAL_HIDL := true
|
||||
AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
|
||||
|
||||
BOARD_SUPPORTS_OPENSOURCE_STHAL := true
|
||||
|
||||
TARGET_PROVIDES_AUDIO_HAL ?= true
|
||||
TARGET_USES_QCOM_MM_AUDIO := true
|
||||
|
||||
# Boot control
|
||||
SOONG_CONFIG_NAMESPACES += ufsbsg
|
||||
@@ -44,54 +62,110 @@ SOONG_CONFIG_ufsbsg += ufsframework
|
||||
SOONG_CONFIG_ufsbsg_ufsframework := bsg
|
||||
|
||||
# Bootloader
|
||||
PRODUCT_PLATFORM := parrot
|
||||
TARGET_BOOTLOADER_BOARD_NAME := sky
|
||||
TARGET_NO_BOOTLOADER := false
|
||||
TARGET_USES_REMOTEPROC := true
|
||||
TARGET_NO_KERNEL := false
|
||||
TARGET_USES_UEFI := true
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
TARGET_BOARD_INFO_FILE := $(DEVICE_PATH)/board-info.txt
|
||||
|
||||
# Build
|
||||
BUILD_BROKEN_DUP_RULES := true
|
||||
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
||||
BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE := true
|
||||
|
||||
# Camera
|
||||
MALLOC_SVELTE := true
|
||||
|
||||
# Display
|
||||
TARGET_SCREEN_DENSITY := 396
|
||||
TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
|
||||
TARGET_GRALLOC_HANDLE_HAS_CUSTOM_CONTENT_MD_RESERVED_SIZE := false
|
||||
TARGET_USES_DISPLAY_RENDER_INTENTS := true
|
||||
TARGET_USES_GRALLOC4 := true
|
||||
TARGET_USES_HWC2 := true
|
||||
MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
|
||||
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
|
||||
|
||||
# Fstab
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/rootdir/etc/fstab.default:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.default
|
||||
# DRM
|
||||
TARGET_ENABLE_MEDIADRM_64 := true
|
||||
|
||||
# DTB
|
||||
BOARD_USES_DT := true
|
||||
BOARD_PREBUILT_DTBIMAGE_DIR := $(KERNEL_PATH)/dtbs
|
||||
BOARD_PREBUILT_DTBOIMAGE := $(KERNEL_PATH)/dtbs/dtbo.img
|
||||
|
||||
# Filesystem
|
||||
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/configs/config.fs
|
||||
|
||||
# FM
|
||||
BOARD_HAVE_QCOM_FM := true
|
||||
|
||||
# GPS
|
||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
|
||||
$(call soong_config_set, qtilocation, feature_nhz, false)
|
||||
|
||||
# Init
|
||||
TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):init_xiaomi_sky
|
||||
|
||||
# Kernel
|
||||
TARGET_KERNEL_ARCH := arm64
|
||||
TARGET_KERNEL_HEADER_ARCH := arm64
|
||||
BOARD_KERNEL_PAGESIZE := 4096
|
||||
BOARD_KERNEL_BASE := 0x00000000
|
||||
|
||||
BOARD_KERNEL_CMDLINE := \
|
||||
video=vfb:640x400,bpp=32,memsize=3072000 \
|
||||
disable_dma32=on \
|
||||
swinfo.fingerprint=$(LINEAGE_VERSION) \
|
||||
mtdoops.fingerprint=$(LINEAGE_VERSION)
|
||||
|
||||
BOARD_BOOTCONFIG := \
|
||||
androidboot.hardware=qcom \
|
||||
androidboot.memcg=1 \
|
||||
androidboot.usbcontroller=a600000.dwc3 \
|
||||
androidboot.init_fatal_reboot_target=recovery
|
||||
|
||||
BOARD_BOOT_HEADER_VERSION := 4
|
||||
BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
|
||||
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
|
||||
|
||||
TARGET_COMPILE_WITH_MSM_KERNEL := false
|
||||
TARGET_FORCE_PREBUILT_KERNEL := true
|
||||
BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true
|
||||
BOARD_KERNEL_IMAGE_NAME := Image
|
||||
BOARD_KERNEL_BASE := 0x00000000
|
||||
BOARD_KERNEL_PAGESIZE := 4096
|
||||
BOARD_KERNEL_TAGS_OFFSET := 0x01E00000
|
||||
BOARD_RAMDISK_OFFSET := 0x02000000
|
||||
|
||||
BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
|
||||
BOARD_KERNEL_CMDLINE := video=vfb:640x400,bpp=32,memsize=3072000 bootinfo.fingerprint=$(LINEAGE_VERSION) mtdoops.fingerprint=$(LINEAGE_VERSION)
|
||||
BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware
|
||||
BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8 earlycon msm_geni_serial.con_enabled=1 androidboot.selinux=permissive audit=0
|
||||
BOARD_BOOTCONFIG := androidboot.hardware=qcom androidboot.memcg=1 androidboot.usbcontroller=a600000.dwc3
|
||||
BOARD_BOOTCONFIG += androidboot.console=ttyMSM0
|
||||
BOARD_RAMDISK_USE_LZ4 := true
|
||||
BOARD_INCLUDE_DTB_IN_BOOTIMG := true
|
||||
BOARD_USES_GENERIC_KERNEL_IMAGE := true
|
||||
|
||||
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilts/kernel
|
||||
BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilts/dtbo.img
|
||||
# Kill lineage kernel build task while preserving kernel
|
||||
TARGET_NO_KERNEL_OVERRIDE := true
|
||||
|
||||
# Workaround to make lineage's soong generator work
|
||||
TARGET_KERNEL_SOURCE := $(KERNEL_PATH)/kernel-headers
|
||||
|
||||
# Kernel Binary
|
||||
TARGET_KERNEL_VERSION := 5.10
|
||||
LOCAL_KERNEL := $(KERNEL_PATH)/Image
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_KERNEL):kernel
|
||||
|
||||
# Kernel modules
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_ramdisk/modules.load))
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_PATH)/vendor_ramdisk/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD))
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_PATH)/vendor_ramdisk/modules.blocklist
|
||||
|
||||
# Also add recovery modules to vendor ramdisk
|
||||
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_ramdisk/modules.load.recovery))
|
||||
RECOVERY_MODULES := $(addprefix $(KERNEL_PATH)/vendor_ramdisk/, $(BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD))
|
||||
|
||||
# Prevent duplicated entries (to solve duplicated build rules problem)
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(sort $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES) $(RECOVERY_MODULES))
|
||||
|
||||
# Vendor modules (installed to vendor_dlkm)
|
||||
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_dlkm/modules.load))
|
||||
BOARD_VENDOR_KERNEL_MODULES := $(addprefix $(KERNEL_PATH)/vendor_dlkm/, $(BOARD_VENDOR_KERNEL_MODULES_LOAD))
|
||||
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_PATH)/vendor_dlkm/modules.blocklist
|
||||
|
||||
# Lineage Health
|
||||
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
|
||||
|
||||
# Metadata
|
||||
BOARD_USES_METADATA_PARTITION := true
|
||||
|
||||
# OTA assert
|
||||
TARGET_OTA_ASSERT_DEVICE := sky, skyin
|
||||
|
||||
# Partitions
|
||||
BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
|
||||
|
||||
@@ -100,17 +174,17 @@ BOARD_BOOTIMAGE_PARTITION_SIZE := 100663296
|
||||
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 104857600
|
||||
BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296
|
||||
|
||||
BOARD_SUPER_PARTITION_SIZE := 9126805504
|
||||
BOARD_SUPER_PARTITION_SIZE := 6979321856
|
||||
BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
|
||||
BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor vendor_dlkm
|
||||
BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 9122611200
|
||||
BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 6975127552
|
||||
|
||||
BOARD_PARTITION_LIST := $(call to-upper, $(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST))
|
||||
$(foreach p, $(BOARD_PARTITION_LIST), $(eval BOARD_$(p)IMAGE_FILE_SYSTEM_TYPE := ext4))
|
||||
$(foreach p, $(BOARD_PARTITION_LIST), $(eval TARGET_COPY_OUT_$(p) := $(call to-lower, $(p))))
|
||||
|
||||
BOARD_PREBUILT_ODMIMAGE := $(DEVICE_PATH)/prebuilts/odm.img
|
||||
BOARD_PREBUILT_VENDORIMAGE := $(DEVICE_PATH)/prebuilts/vendor.img
|
||||
BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
|
||||
TARGET_COPY_OUT_ODM := odm
|
||||
TARGET_COPY_OUT_PRODUCT := product
|
||||
@@ -118,69 +192,107 @@ TARGET_COPY_OUT_SYSTEM_EXT := system_ext
|
||||
TARGET_COPY_OUT_VENDOR := vendor
|
||||
TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
|
||||
|
||||
TARGET_USERIMAGES_USE_F2FS := true
|
||||
BOARD_USES_VENDOR_DLKMIMAGE := true
|
||||
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
|
||||
|
||||
# Platform
|
||||
TARGET_BOARD_PLATFORM := parrot
|
||||
TARGET_BOARD_PLATFORM_GPU := qcom-adreno613
|
||||
QCOM_BOARD_PLATFORMS += parrot
|
||||
BOARD_USES_QCOM_HARDWARE := true
|
||||
|
||||
# Disable sparse on all filesystem images
|
||||
TARGET_USERIMAGES_SPARSE_EROFS_DISABLED := true
|
||||
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
|
||||
TARGET_USERIMAGES_SPARSE_F2FS_DISABLED := true
|
||||
|
||||
# Power
|
||||
TARGET_POWER_LIBPERFMGR_MODE_EXTENSION_LIB := //$(DEVICE_PATH):libperfmgr-ext-sky
|
||||
|
||||
# Properties
|
||||
TARGET_ODM_PROP += $(DEVICE_PATH)/configs/properties/odm.prop
|
||||
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/configs/properties/product.prop
|
||||
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/configs/properties/system.prop
|
||||
TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/configs/properties/system_ext.prop
|
||||
TARGET_VENDOR_PROP += $(DEVICE_PATH)/configs/properties/vendor.prop
|
||||
|
||||
# Recovery
|
||||
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
|
||||
TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
|
||||
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.default
|
||||
BOARD_HAS_LARGE_FILESYSTEM := true
|
||||
TARGET_USERIMAGES_USE_F2FS := true
|
||||
BOARD_USES_RECOVERY_AS_BOOT := false
|
||||
BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true
|
||||
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := false
|
||||
|
||||
# RIL
|
||||
ENABLE_VENDOR_RIL_SERVICE := true
|
||||
|
||||
# Vendor boot
|
||||
BOARD_VENDOR_RAMDISK_FRAGMENTS := dlkm
|
||||
BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm.KERNEL_MODULE_DIRS := top
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(wildcard $(DEVICE_PATH)/prebuilts/modules/ramdisk/*.ko)
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/prebuilts/modules/ramdisk/modules.load))
|
||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE := $(DEVICE_PATH)/prebuilts/modules/ramdisk/modules.blocklist
|
||||
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/prebuilts/modules/ramdisk/modules.load.recovery))
|
||||
# Screen density
|
||||
TARGET_SCREEN_DENSITY := 440
|
||||
|
||||
# Vendor_dlkm
|
||||
BOARD_VENDOR_KERNEL_MODULES := $(wildcard $(DEVICE_PATH)/prebuilts/modules/vendor/*.ko)
|
||||
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/prebuilts/modules/vendor/modules.load))
|
||||
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(DEVICE_PATH)/prebuilts/modules/vendor/modules.blocklist
|
||||
# Security patch level
|
||||
VENDOR_SECURITY_PATCH := 2024-10-01
|
||||
|
||||
# Sepolicy
|
||||
include device/qcom/sepolicy/SEPolicy.mk
|
||||
include device/qcom/sepolicy_vndr/SEPolicy.mk
|
||||
|
||||
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
|
||||
SELINUX_IGNORE_NEVERALLOWS := true
|
||||
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public
|
||||
BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
|
||||
|
||||
# Sepolicy - XiaomiParts
|
||||
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \
|
||||
$(DEVICE_PATH)/sepolicy/private/xiaomi/devicesettings
|
||||
|
||||
#SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += \
|
||||
# $(DEVICE_PATH)/sepolicy/public/xiaomi/devicesettings
|
||||
|
||||
# Vendor Boot
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/rootdir/etc/fstab.default:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.default
|
||||
|
||||
# Verified Boot
|
||||
BOARD_AVB_ENABLE := true
|
||||
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
|
||||
BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
|
||||
|
||||
BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
|
||||
BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA2048
|
||||
BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
|
||||
BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096
|
||||
BOARD_AVB_RECOVERY_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
|
||||
BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1
|
||||
|
||||
BOARD_AVB_VBMETA_SYSTEM := system system_ext product
|
||||
BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
|
||||
BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
|
||||
BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
|
||||
BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096
|
||||
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
|
||||
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
|
||||
|
||||
# VINTF
|
||||
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(DEVICE_PATH)/configs/vintf/compatibility_matrix.device.xml
|
||||
DEVICE_MANIFEST_SKUS := ravelin
|
||||
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/vintf/compatibility_matrix.xml
|
||||
DEVICE_MANIFEST_RAVELIN_FILES := \
|
||||
$(DEVICE_PATH)/configs/vintf/manifest_ravelin.xml \
|
||||
hardware/qcom-caf/sm8450/audio/primary-hal/configs/common/manifest_non_qmaa_extn.xml
|
||||
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
|
||||
$(DEVICE_PATH)/configs/vintf/vendor_framework_compatibility_matrix.xml \
|
||||
$(DEVICE_PATH)/configs/vintf/xiaomi_framework_compatibility_matrix.xml \
|
||||
vendor/lineage/config/device_framework_matrix.xml
|
||||
|
||||
# VNDK
|
||||
BOARD_VNDK_VERSION := current
|
||||
DEVICE_FRAMEWORK_MANIFEST_FILE += $(DEVICE_PATH)/configs/vintf/framework_manifest.xml
|
||||
ODM_MANIFEST_SKUS += hceese hcesim hcesim1 hcesim1ese hcesimese
|
||||
ODM_MANIFEST_HCEESE_FILES := $(DEVICE_PATH)/configs/vintf/manifest_hceese.xml
|
||||
ODM_MANIFEST_HCESIM_FILES := $(DEVICE_PATH)/configs/vintf/manifest_hcesim.xml
|
||||
ODM_MANIFEST_HCESIM1_FILES := $(DEVICE_PATH)/configs/vintf/manifest_hcesim1.xml
|
||||
ODM_MANIFEST_HCESIM1ESE_FILES := $(DEVICE_PATH)/configs/vintf/manifest_hcesim1ese.xml
|
||||
ODM_MANIFEST_HCESIMESE_FILES := $(DEVICE_PATH)/configs/vintf/manifest_hcesimese.xml
|
||||
|
||||
# WiFi
|
||||
BOARD_WLAN_DEVICE := qcwcn
|
||||
BOARD_HOSTAPD_DRIVER := NL80211
|
||||
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
|
||||
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
CONFIG_ACS := true
|
||||
QC_WIFI_HIDL_FEATURE_DUAL_AP := true
|
||||
QC_WIFI_HIDL_FEATURE_DUAL_STA := true
|
||||
WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"
|
||||
WIFI_DRIVER_STATE_OFF := "OFF"
|
||||
WIFI_DRIVER_STATE_ON := "ON"
|
||||
WIFI_HIDL_FEATURE_AWARE := true
|
||||
WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
|
||||
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
|
||||
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
||||
|
||||
23
README.md
23
README.md
@@ -1 +1,22 @@
|
||||
# device_xiaomi_sky
|
||||
# Device Tree for Xiaomi Redmi Note 12R/Redmi 12 5G/POCO M6 Pro 5G (Sky/River)
|
||||
|
||||
## Spec Sheet
|
||||
|
||||
| Feature | Specification |
|
||||
| :--- | :--- |
|
||||
| CPU | Octa-core<br>2X Cortex A78@ 2.2GHz<br>6X Cortex A55@ 2.0GHz |
|
||||
| Chipset | Qualcomm® Snapdragon™ 4 Gen 2 Mobile Platform<br>(*Samsung* Foundry's *FinFET* *4nm*) |
|
||||
| GPU | Qualcomm® Adreno™ 619 |
|
||||
| Memory | 4GB \| 6GB \| 8GB \| (LPDDR4x) |
|
||||
| Shipped Android Version | 13.0 |
|
||||
| Storage | 128GB \| 256GB UFS 2.2 |
|
||||
| Battery | 5000mAh (typ) Li Polymer |
|
||||
| Dimensions | 168.60mm x 76.28mmx 8.17mm (Weight: 199g) |
|
||||
| Display | 1080P IPS LCD (6.79" FHD+ Display \| Refresh rate: 90Hz Touch sampling Rate: 240Hz Peak Brightness: 550 nits) |
|
||||
| Rear Camera | 50 MP, f/1.8, (wide), PDAF<br>2 MP, f/2.4, (depth) |
|
||||
| Front Camera | 8 MP, f/2.0, (wide), 1.12µm |
|
||||
| Release Date | 2023, August 01 (Global) |
|
||||
|
||||
## Device Picture (Redmi 12 5G)
|
||||
|
||||

|
||||
|
||||
12
RemovePackages/Android.mk
Normal file
12
RemovePackages/Android.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := RemovePackages
|
||||
LOCAL_MODULE_CLASS := APPS
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_OVERRIDES_PACKAGES := \
|
||||
MusicFX
|
||||
LOCAL_UNINSTALLABLE_MODULE := true
|
||||
LOCAL_CERTIFICATE := PRESIGNED
|
||||
LOCAL_SRC_FILES := /dev/null
|
||||
include $(BUILD_PREBUILT)
|
||||
11
biometrics/Android.bp
Normal file
11
biometrics/Android.bp
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Copyright (C) 2023 The LineageOS Project
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
cc_library_shared {
|
||||
name: "libvendor.goodix.hardware.biometrics.fingerprint@2.1",
|
||||
shared_libs: ["vendor.goodix.hardware.biometrics.fingerprint@2.1"],
|
||||
vendor_available: true,
|
||||
}
|
||||
549
configs/WCNSS_qcom_cfg.ini
Normal file
549
configs/WCNSS_qcom_cfg.ini
Normal file
@@ -0,0 +1,549 @@
|
||||
# This file allows user to override the factory
|
||||
# defaults for the WLAN Driver
|
||||
|
||||
# Enable IMPS or not
|
||||
gEnableImps=1
|
||||
|
||||
# Enable BMPS or not
|
||||
gEnableBmps=1
|
||||
|
||||
# Phy Mode (auto, b, g, n, etc)
|
||||
# Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac
|
||||
# 1 = 11abg, 2 = 11b, 3 = 11g, 5 = 11g only, 6 = 11n only
|
||||
# 7 = 11b only 8 = 11ac only.
|
||||
gDot11Mode=0
|
||||
|
||||
# Assigned MAC Addresses - This will be used until NV items are in place
|
||||
# Each byte of MAC address is represented in Hex format as XX
|
||||
Intf0MacAddress=000AF58989FF
|
||||
Intf1MacAddress=000AF58989FE
|
||||
Intf2MacAddress=000AF58989FD
|
||||
Intf3MacAddress=000AF58989FC
|
||||
|
||||
# UAPSD service interval for VO,VI, BE, BK traffic
|
||||
InfraUapsdVoSrvIntv=0
|
||||
InfraUapsdViSrvIntv=0
|
||||
InfraUapsdBeSrvIntv=0
|
||||
InfraUapsdBkSrvIntv=0
|
||||
|
||||
# Flag to allow STA send AddTspec even when ACM is Off
|
||||
gAddTSWhenACMIsOff=1
|
||||
|
||||
# Flags to filter Mcast and Bcast RX packets.
|
||||
# Value 0: No filtering, 1: Filter all Multicast.
|
||||
# 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast
|
||||
McastBcastFilter=3
|
||||
|
||||
#Flag to enable HostARPOffload feature or not
|
||||
hostArpOffload=1
|
||||
|
||||
#Flag to enable HostNSOffload feature or not
|
||||
hostNSOffload=1
|
||||
|
||||
# 802.11n Protection flag
|
||||
gEnableApProt=1
|
||||
|
||||
#Enable OBSS protection
|
||||
gEnableApOBSSProt=0
|
||||
|
||||
#Enable/Disable UAPSD for SoftAP
|
||||
gEnableApUapsd=1
|
||||
|
||||
# Fixed Rate
|
||||
gFixedRate=0
|
||||
|
||||
# Maximum Tx power
|
||||
# gTxPowerCap=30
|
||||
|
||||
# Fragmentation Threshold
|
||||
# gFragmentationThreshold=2346
|
||||
|
||||
# RTS threshold
|
||||
RTSThreshold=1048576
|
||||
|
||||
# Intra-BSS forward
|
||||
gDisableIntraBssFwd=0
|
||||
|
||||
# WMM Enable/Disable
|
||||
WmmIsEnabled=0
|
||||
|
||||
# 802.11d support
|
||||
g11dSupportEnabled=0
|
||||
|
||||
# 802.11h support
|
||||
g11hSupportEnabled=1
|
||||
|
||||
# DFS Master Capability
|
||||
gEnableDFSMasterCap=1
|
||||
|
||||
# ESE Support and fast transition
|
||||
EseEnabled=0
|
||||
|
||||
ImplicitQosIsEnabled=0
|
||||
|
||||
gNeighborScanTimerPeriod=200
|
||||
gNeighborLookupThreshold=76
|
||||
gNeighborScanChannelMinTime=20
|
||||
gNeighborScanChannelMaxTime=30
|
||||
gMaxNeighborReqTries=3
|
||||
|
||||
# Legacy (non-ESE, non-802.11r) Fast Roaming Support
|
||||
# To enable, set FastRoamEnabled=1
|
||||
# To disable, set FastRoamEnabled=0
|
||||
FastRoamEnabled=1
|
||||
|
||||
# Check if the AP to which we are roaming is better than current AP in
|
||||
# terms of RSSI. Checking is disabled if set to Zero.Otherwise it will
|
||||
# use this value as to how better the RSSI of the new/roamable AP should
|
||||
# be for roaming
|
||||
RoamRssiDiff=5
|
||||
|
||||
# To enable, set gRoamIntraBand=1 (Roaming within band)
|
||||
# To disable, set gRoamIntraBand=0 (Roaming across band)
|
||||
gRoamIntraBand=0
|
||||
|
||||
#Short Guard Interval Enable/disable
|
||||
gShortGI20Mhz=1
|
||||
gShortGI40Mhz=1
|
||||
|
||||
#Auto Shutdown Value in seconds. A value of 0 means Auto shutoff is disabled
|
||||
gAPAutoShutOff=0
|
||||
|
||||
#Auto Shutdown wlan : Value in Seconds. 0 means disabled. Max 1 day = 86400 sec
|
||||
gWlanAutoShutdown = 0
|
||||
|
||||
# Not used.
|
||||
gApAutoChannelSelection=0
|
||||
|
||||
#Preferred band (both or 2.4 only or 5 only)
|
||||
BandCapability=0
|
||||
|
||||
#Channel Bonding
|
||||
gChannelBondingMode5GHz=1
|
||||
|
||||
#Say gGoKeepAlivePeriod(5 seconds) and gGoLinkMonitorPeriod(10 seconds).
|
||||
#For every 10 seconds DUT send Qos Null frame(i.e., Keep Alive frame if link
|
||||
#is idle for last 10 seconds.) For both active and power save clients.
|
||||
|
||||
#Power save clients: DUT set TIM bit from 10th second onwards and till client
|
||||
#honors TIM bit. If doesn't honor for 5 seconds then DUT remove client.
|
||||
|
||||
#Active clients: DUT send Qos Null frame for 10th seconds onwards if it is not
|
||||
#success still we try on 11th second if not tries on 12th and so on till 15th
|
||||
#second. Hence before disconnection DUT will send 5 NULL frames. Hence in any
|
||||
#case DUT will detect client got removed in (10+5) seconds.
|
||||
#i.e., (gGoKeepAlivePeriod + gGoLinkMonitorPeriod)..
|
||||
|
||||
#gGoLinkMonitorPeriod/ gApLinkMonitorPeriod is period where link is idle and
|
||||
#it is period where we send NULL frame.
|
||||
#gApLinkMonitorPeriod = 10
|
||||
#gGoLinkMonitorPeriod = 10
|
||||
|
||||
#gGoKeepAlivePeriod/gApKeepAlivePeriod is time to spend to check whether frame
|
||||
#are succeed to send or not. Hence total effective detection time is
|
||||
# (gGoLinkMonitorPeriod + gGoKeepAlivePeriod) /
|
||||
# (gApLinkMonitorPeriod + gApKeepAlivePeriod)
|
||||
gGoKeepAlivePeriod = 20
|
||||
gApKeepAlivePeriod = 20
|
||||
|
||||
#If set will start with active scan after driver load, otherwise will start with
|
||||
#passive scan to find out the domain
|
||||
gEnableBypass11d=1
|
||||
|
||||
#If set to 0, will not scan DFS channels
|
||||
gEnableDFSChnlScan=1
|
||||
|
||||
# Enable DFS channel roam
|
||||
# 0: DISABLE, 1: ENABLED_NORMAL, 2: ENABLED_ACTIVE
|
||||
gAllowDFSChannelRoam=1
|
||||
|
||||
gVhtChannelWidth=2
|
||||
|
||||
#Data Inactivity Timeout when in powersave (in ms)
|
||||
gDataInactivityTimeout=200
|
||||
|
||||
# Set txchainmask and rxchainmask
|
||||
# These parameters are used only if gEnable2x2 is 0
|
||||
# Valid values are 1,2
|
||||
# Set gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
|
||||
# Set gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
|
||||
gSetTxChainmask1x1=1
|
||||
gSetRxChainmask1x1=1
|
||||
|
||||
# Scan Timing Parameters
|
||||
# gPassiveMaxChannelTime=110
|
||||
# gPassiveMinChannelTime=60
|
||||
gActiveMaxChannelTime=40
|
||||
gActiveMinChannelTime=20
|
||||
|
||||
#If set to 0, MCC is not allowed.
|
||||
gEnableMCCMode=1
|
||||
|
||||
# MCC to SCC Switch mode:
|
||||
# 0-Disable
|
||||
# 1-Enable
|
||||
# 2-Force SCC if same band, with SAP restart
|
||||
# 3-Force SCC if same band, without SAP restart by sending (E)CSA
|
||||
# 4-Force SCC if same band (or) use SAP mandatory channel for DBS,
|
||||
# without SAP restart by sending (E)CSA
|
||||
gWlanMccToSccSwitchMode = 3
|
||||
|
||||
# 1=enable STBC; 0=disable STBC
|
||||
gEnableRXSTBC=1
|
||||
|
||||
# 1=enable tx STBC; 0=disable
|
||||
gEnableTXSTBC=1
|
||||
|
||||
# 1=enable rx LDPC; 0=disable
|
||||
gEnableRXLDPC=1
|
||||
|
||||
#Enable/Disable Tx beamforming
|
||||
gTxBFEnable=1
|
||||
|
||||
#Enable/Disable Tx beamformee in SAP mode
|
||||
gEnableTxBFeeSAP=1
|
||||
|
||||
# Enable Tx beamforming in VHT20MHz
|
||||
# Valid values are 0,1. If commented out, the default value is 0.
|
||||
# 0=disable, 1=enable
|
||||
gEnableTxBFin20MHz=1
|
||||
|
||||
#Enable/Disable SU Tx beamformer support.
|
||||
gEnableTxSUBeamformer=1
|
||||
|
||||
gEnableFastRoamInConcurrency=1
|
||||
|
||||
#Maxium Channel time in msec
|
||||
gMaxMediumTime = 6000
|
||||
|
||||
# 802.11K support
|
||||
gRrmEnable=1
|
||||
|
||||
#Enable Power Save offload
|
||||
gEnablePowerSaveOffload=2
|
||||
|
||||
#Enable firmware uart print
|
||||
gEnablefwprint=0
|
||||
|
||||
# Firmware log mode
|
||||
# Valid values are 0,1,2
|
||||
# 0=Disable, 1=WMI, 2=DIAG
|
||||
gEnablefwlog=1
|
||||
|
||||
# Maximum Receive AMPDU size (VHT only. Valid values:
|
||||
# 0->8k 1->16k 2->32k 3->64k 4->128k)
|
||||
gVhtAmpduLenExponent=7
|
||||
|
||||
# Maximum MPDU length (VHT only. Valid values:
|
||||
# 0->3895 octets, 1->7991 octets, 2->11454 octets)
|
||||
gVhtMpduLen=2
|
||||
|
||||
# Maximum number of wow filters required
|
||||
#gMaxWoWFilters=22
|
||||
|
||||
# WOW Enable/Disable.
|
||||
# 0 - Disable both magic pattern match and pattern byte match.
|
||||
# 1 - Enable magic pattern match on all interfaces.
|
||||
# 2 - Enable pattern byte match on all interfaces.
|
||||
# 3 - Enable both magic pattern and pattern byte match on all interfaces.
|
||||
# Default value of gEnableWoW is 3.
|
||||
# gEnableWoW=0
|
||||
|
||||
# Enable or Disable MCC Adaptive Scheduler at the FW
|
||||
# 1=Enable (default), 0=Disable
|
||||
gEnableMCCAdaptiveScheduler=1
|
||||
|
||||
#Enable or Disable p2p device address administered
|
||||
isP2pDeviceAddrAdministrated=0
|
||||
|
||||
# Remove Overlap channel restriction
|
||||
gEnableOverLapCh=0
|
||||
|
||||
#Enable VHT on 2.4Ghz
|
||||
gEnableVhtFor24GHzBand=1
|
||||
|
||||
#Disable 40M on 2.4g
|
||||
gChannelBondingMode24GHz=0
|
||||
|
||||
#Maximum number of offload peers supported
|
||||
# gMaxOffloadPeers=2
|
||||
|
||||
# controlling the following offload patterns
|
||||
# through ini parameter. Default value is 1
|
||||
# to disable set it to zero. ssdp = 0
|
||||
# Setup multicast pattern for mDNS 224.0.0.251,
|
||||
# SSDP 239.255.255.250 and LLMNR 224.0.0.252
|
||||
ssdp=0
|
||||
|
||||
#Enable Memory Deep Sleep
|
||||
gEnableMemDeepSleep=1
|
||||
|
||||
# Regulatory Setting; 0=STRICT; 1=CUSTOM
|
||||
gRegulatoryChangeCountry=1
|
||||
|
||||
# RA filtering rate limit param, the current value would not
|
||||
# help if the lifetime in RA is less than 3*60=3min. Then
|
||||
# we need to change it, though it is uncommon.
|
||||
# gRAFilterEnable=0
|
||||
gRArateLimitInterval=600
|
||||
|
||||
# Maximum number of concurrent connections
|
||||
gMaxConcurrentActiveSessions=3
|
||||
|
||||
# Disable/Enable GreenAP
|
||||
# 0 to disable, 1 to enable, default: 1
|
||||
gEnableGreenAp=0
|
||||
|
||||
# Radar PRI multiplier
|
||||
gDFSradarMappingPriMultiplier=4
|
||||
|
||||
gPNOScanSupport=1
|
||||
|
||||
#Enable/Disable LPASS support
|
||||
# 0 to disable, 1 to enable
|
||||
gEnableLpassSupport=1
|
||||
|
||||
# Whether userspace country code setting shld have priority
|
||||
gCountryCodePriority=1
|
||||
|
||||
# Enable(1)/Disable(0) SIFS burst
|
||||
gEnableSifsBurst=3
|
||||
|
||||
# Enable or Disable Multi-user MIMO
|
||||
# 1=Enable (default), 0=Disable
|
||||
gEnableMuBformee=1
|
||||
|
||||
# Enable/Disable channel avoidance for SAP in SCC scenario
|
||||
# 0 - disable
|
||||
# 1 - enable
|
||||
gSapSccChanAvoidance=0
|
||||
|
||||
# Inactivity time (in ms) to end TX Service Period while in IBSS power save mode
|
||||
gIbssTxSpEndInactivityTime=10
|
||||
|
||||
# Enable TDLS External Control. That is, user space application has to
|
||||
# first configure a peer MAC in wlan driver towards which TDLS is desired.
|
||||
# Device will establish TDLS only towards those configured peers whenever
|
||||
# TDLS criteria (throughput and RSSI threshold) is met and teardown TDLS
|
||||
# when teardown criteria (idle packet count and RSSI) is met. However,
|
||||
# device will accept TDLS connection if it is initiated from any other peer,
|
||||
# even if that peer is not configured.
|
||||
# 0 - disable
|
||||
# 1 - enable
|
||||
# For TDLS External Control, Implicit Trigger must also be enabled.
|
||||
gTDLSExternalControl=1
|
||||
|
||||
# Enable support for TDLS off-channel operation
|
||||
# 0 - disable
|
||||
# 1 - enable
|
||||
# TDLS off-channel operation will be invoked when there is only one
|
||||
# TDLS connection.
|
||||
gEnableTDLSOffChannel=1
|
||||
|
||||
# Enable or Disable Random MAC (Spoofing)
|
||||
# 1=Enable (default), 0=Disable
|
||||
gEnableMacAddrSpoof=1
|
||||
|
||||
################ Datapath feature set Begin ################
|
||||
# Bus bandwidth threshold values in terms of number of packets
|
||||
gBusBandwidthHighThreshold=2000
|
||||
gBusBandwidthMediumThreshold=500
|
||||
gBusBandwidthLowThreshold=150
|
||||
|
||||
# Bus bandwidth compute timeout value in ms
|
||||
gBusBandwidthComputeInterval=100
|
||||
|
||||
# VHT Tx/Rx MCS values
|
||||
# Valid values are 0,1,2. If commented out, the default value is 0.
|
||||
# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
|
||||
gVhtRxMCS=2
|
||||
gVhtTxMCS=2
|
||||
|
||||
# VHT Tx/Rx MCS values for 2x2
|
||||
# Valid values are 0,1,2. If commented out, the default value is 0.
|
||||
# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
|
||||
gEnable2x2=1
|
||||
gVhtRxMCS2x2=2
|
||||
gVhtTxMCS2x2=2
|
||||
|
||||
#IPA config is a bit mask and following are the configurations.
|
||||
#bit0 IPA Enable
|
||||
#bit1 IPA PRE Filter enable
|
||||
#bit2 IPv6 enable
|
||||
#bit3 IPA Resource Manager (RM) enable
|
||||
#bit4 IPA Clock scaling enable
|
||||
#bit5 IPA uC ENABLE
|
||||
#bit6 IPA uC STA ENABLE
|
||||
#bit8 IPA Real Time Debugging
|
||||
gIPAConfig=0x7d
|
||||
gIPADescSize=800
|
||||
|
||||
# Enable/Disable RX full reorder offload
|
||||
gReorderOffloadSupported=1
|
||||
|
||||
# Enable CE classification
|
||||
# 1 - enable(default) 0 - disable
|
||||
gCEClassifyEnable=1
|
||||
|
||||
# Enable Rx handling options
|
||||
# Rx_thread=1 RPS=2(default for ROME) NAPI=4(default for ihelium)
|
||||
rx_mode=5
|
||||
|
||||
# Enable(Tx) fastpath for data traffic.
|
||||
# 1 - enable(default) 0 - disable
|
||||
gEnableFastPath=1
|
||||
|
||||
# This flag enables IP, TCP and UDP checksum offload
|
||||
# 1 - enable(default) 0 - disable
|
||||
gEnableIpTcpUdpChecksumOffload=1
|
||||
|
||||
# Enable TCP Segmentation Offload
|
||||
# 1 - enable 0 - disable
|
||||
TSOEnable=1
|
||||
|
||||
# Enable Generic Receive Offload
|
||||
# 1 - enable(default) 0 - disable
|
||||
GROEnable=1
|
||||
|
||||
# Enable HT MPDU Density
|
||||
# 4 for 2 micro sec
|
||||
ght_mpdu_density=4
|
||||
|
||||
# Enable flow steering to enable multiple CEs for Rx flows.
|
||||
# Multiple Rx CEs<==>Multiple Rx IRQs<==>probably different CPUs.
|
||||
# Parallel Rx paths.
|
||||
# 1 - enable 0 - disable(default)
|
||||
gEnableFlowSteering=1
|
||||
|
||||
# Time in microseconds after which a NAPI poll must yield
|
||||
ce_service_max_yield_time=500
|
||||
|
||||
#Maximum number of HTT messages to be processed per NAPI poll
|
||||
ce_service_max_rx_ind_flush=1
|
||||
|
||||
# Maximum number of MSDUs the firmware will pack in one HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
|
||||
maxMSDUsPerRxInd=8
|
||||
|
||||
# Enable NUD tracking feature
|
||||
# 1 - enable 0 - disable(default)
|
||||
gEnableNUDTracking=1
|
||||
|
||||
# Enable PEER UNMAP CONF SUPPORT
|
||||
# 1 - enable 0 - disable(default)
|
||||
gEnablePeerUnmapConfSupport=1
|
||||
|
||||
rpsRxQueueCpuMapList=f3
|
||||
################ Datapath feature set End ################
|
||||
|
||||
################ NAN feature set start ###################
|
||||
|
||||
# Enable NAN discovery (NAN 1.0)
|
||||
# 1 - enable 0 - disable(default)
|
||||
gEnableNanSupport=1
|
||||
# Enable NAN Datapath
|
||||
genable_nan_datapath=1
|
||||
|
||||
################ NAN feature set end #####################
|
||||
|
||||
adaptive_dwell_mode_enabled=1
|
||||
|
||||
hostscan_adaptive_dwell_mode=1
|
||||
|
||||
adapt_dwell_lpf_weight=80
|
||||
|
||||
adapt_dwell_wifi_act_threshold=10
|
||||
|
||||
MAWCEnabled=0
|
||||
|
||||
# Enable/Disable rtt sta mac randomization
|
||||
enable_rtt_mac_randomization=1
|
||||
|
||||
#Enable/Disable SNR monitoring
|
||||
gEnableSNRMonitoring=1
|
||||
|
||||
# Allow STA+SAP SCC on DFS channel with master mode support disabled
|
||||
g_sta_sap_scc_on_dfs_chan=1
|
||||
|
||||
# Enable ETSI SRD channels by Xiaomi. Qualcom default value is disable
|
||||
etsi13_srd_chan_in_master_mode=3
|
||||
|
||||
# Rx thread affinity mask in UL case
|
||||
RX_THREAD_UL_CPU_AFFINITY_MASK=0xc0
|
||||
|
||||
#Sets RSSI preference for 5GHz over 2.4GHz AP
|
||||
gSelect5GHzMargin=5
|
||||
|
||||
#RSSI threshold offset for 2G to 5G roam
|
||||
roam_bad_rssi_thresh_offset_2g=0
|
||||
|
||||
#Set station burst duration
|
||||
sta_scan_burst_duration=120
|
||||
|
||||
#RSSI threshold for background roam
|
||||
roam_bg_scan_bad_rssi_thresh=-76
|
||||
|
||||
gEnablePacketLog=1
|
||||
|
||||
read_mac_addr_from_mac_file=1
|
||||
|
||||
#enable indoor channel in SAP mode
|
||||
gindoor_channel_support=1
|
||||
|
||||
#Enable/Disable Modulated DTIM feature
|
||||
gEnableModulatedDTIM=3
|
||||
|
||||
#Set MaxLIModulate Dtim
|
||||
gMaxLIModulatedDTIM=3
|
||||
|
||||
#Sets dense roam RSSI Threshold diff
|
||||
groam_dense_rssi_thresh_offset=5
|
||||
|
||||
#traffic Threshold required for dense roam scan
|
||||
gtraffic_threshold=50
|
||||
|
||||
gRoamBmissFirstBcnt=10
|
||||
|
||||
gRoamBmissFinalBcnt=20
|
||||
|
||||
#To Enable/Disable PER based Roaming in FW
|
||||
gper_roam_enabled=3
|
||||
|
||||
#ARP access category
|
||||
arp_ac_category=0
|
||||
|
||||
#Enable/Disable LPRx
|
||||
gEnableLPRx=0
|
||||
|
||||
gEnableSelfRecovery=1
|
||||
|
||||
#Enable/Disable FT open feature
|
||||
enable_ftopen=0
|
||||
|
||||
# Packet Log buffer size
|
||||
PktlogBufSize=1
|
||||
|
||||
# Enable Keep alive with non-zero period value
|
||||
gStaKeepAlivePeriod = 30
|
||||
|
||||
gEnableSARV1toSARV2=1
|
||||
|
||||
#Enable max link speed
|
||||
gReportMaxLinkSpeed=2
|
||||
|
||||
#set Max peers connnected for SAP
|
||||
gSoftApMaxPeers=64
|
||||
|
||||
#APF: Android Packet Filter
|
||||
gActiveMcBcBpfMode=1
|
||||
|
||||
#Allow STA+SAP SCC on DFS channel
|
||||
#set ini np_chan_weight value to 1,
|
||||
#then DFS channel will be most likely put at last in available chanlist and
|
||||
#DFS channel will be the last choice when no other normal channel can be used.
|
||||
#If config chanlist with DFS channels only, SAP still can be started on DFS channel successfully.
|
||||
np_chan_weight=1
|
||||
|
||||
END
|
||||
|
||||
# Note: Configuration parser would not read anything past the END marker
|
||||
|
||||
148
configs/audio/audio_effects.xml
Normal file
148
configs/audio/audio_effects.xml
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--- Copyright (c) 2018-2019, 2021 The Linux Foundation. All rights reserved. -->
|
||||
<!--- -->
|
||||
<!--- Redistribution and use in source and binary forms, with or without -->
|
||||
<!--- modification, are permitted provided that the following conditions are -->
|
||||
<!--- met: -->
|
||||
<!--- * Redistributions of source code must retain the above copyright -->
|
||||
<!--- notice, this list of conditions and the following disclaimer. -->
|
||||
<!--- * Redistributions in binary form must reproduce the above -->
|
||||
<!--- copyright notice, this list of conditions and the following -->
|
||||
<!--- disclaimer in the documentation and/or other materials provided -->
|
||||
<!--- with the distribution. -->
|
||||
<!--- * Neither the name of The Linux Foundation nor the names of its -->
|
||||
<!--- contributors may be used to endorse or promote products derived -->
|
||||
<!--- from this software without specific prior written permission. -->
|
||||
<!--- -->
|
||||
<!--- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -->
|
||||
<!--- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -->
|
||||
<!--- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -->
|
||||
<!--- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -->
|
||||
<!--- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
|
||||
<!--- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
|
||||
<!--- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -->
|
||||
<!--- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -->
|
||||
<!--- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -->
|
||||
<!--- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
|
||||
<!--- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
||||
|
||||
<!-- Changes from Qualcomm Innovation Center are provided under the following license: -->
|
||||
<!--- -->
|
||||
<!-- Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. -->
|
||||
<!-- -->
|
||||
<!-- Redistribution and use in source and binary forms, with or without -->
|
||||
<!-- modification, are permitted (subject to the limitations in the -->
|
||||
<!-- disclaimer below) provided that the following conditions are met: -->
|
||||
<!-- -->
|
||||
<!-- * Redistributions of source code must retain the above copyright -->
|
||||
<!-- notice, this list of conditions and the following disclaimer. -->
|
||||
<!-- -->
|
||||
<!-- * Redistributions in binary form must reproduce the above -->
|
||||
<!-- copyright notice, this list of conditions and the following -->
|
||||
<!-- disclaimer in the documentation and/or other materials provided -->
|
||||
<!-- with the distribution. -->
|
||||
<!-- -->
|
||||
<!-- * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its -->
|
||||
<!-- contributors may be used to endorse or promote products derived -->
|
||||
<!-- from this software without specific prior written permission. -->
|
||||
<!-- -->
|
||||
<!-- NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE -->
|
||||
<!-- GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT -->
|
||||
<!-- HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED -->
|
||||
<!-- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -->
|
||||
<!-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -->
|
||||
<!-- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -->
|
||||
<!-- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -->
|
||||
<!-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -->
|
||||
<!-- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
|
||||
<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -->
|
||||
<!-- IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -->
|
||||
<!-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
|
||||
<!-- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
||||
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
|
||||
<libraries>
|
||||
<library name="bundle" path="libbundlewrapper.so"/>
|
||||
<library name="reverb" path="libreverbwrapper.so"/>
|
||||
<library name="visualizer_sw" path="libvisualizer.so"/>
|
||||
<library name="visualizer_hw" path="libqcomvisualizer.so"/>
|
||||
<library name="downmix" path="libdownmix.so"/>
|
||||
<library name="loudness_enhancer" path="libldnhncr.so"/>
|
||||
<library name="dynamics_processing" path="libdynproc.so"/>
|
||||
<library name="proxy" path="libeffectproxy.so"/>
|
||||
<library name="offload_bundle" path="libqcompostprocbundle.so"/>
|
||||
<library name="audio_pre_processing" path="libqcomvoiceprocessing.so"/>
|
||||
<library name="volume_listener" path="libvolumelistener.so"/>
|
||||
<library name="audiosphere" path="libasphere.so"/>
|
||||
<library name="misoundfx" path="libmisoundfx.so"/>
|
||||
</libraries>
|
||||
<effects>
|
||||
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
|
||||
<libsw library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="2c4a8c24-1581-487f-94f6-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="virtualizer" library="proxy" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b">
|
||||
<libsw library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="509a4498-561a-4bea-b3b1-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="equalizer" library="proxy" uuid="c8e70ecd-48ca-456e-8a4f-0002a5d5c51b">
|
||||
<libsw library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="a0dac280-401c-11e3-9379-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
|
||||
<effectProxy name="reverb_env_aux" library="proxy" uuid="48404ac9-d202-4ccc-bf84-0002a5d5c51b">
|
||||
<libsw library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="79a18026-18fd-4185-8233-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="reverb_env_ins" library="proxy" uuid="b707403a-a1c1-4291-9573-0002a5d5c51b">
|
||||
<libsw library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="eb64ea04-973b-43d2-8f5e-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="reverb_pre_aux" library="proxy" uuid="1b78f587-6d1c-422e-8b84-0002a5d5c51b">
|
||||
<libsw library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="6987be09-b142-4b41-9056-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="reverb_pre_ins" library="proxy" uuid="f3e178d2-ebcb-408e-8357-0002a5d5c51b">
|
||||
<libsw library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
|
||||
<libhw library="offload_bundle" uuid="aa2bebf6-47cf-4613-9bca-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="visualizer" library="proxy" uuid="1d0a1a53-7d5d-48f2-8e71-27fbd10d842c">
|
||||
<libsw library="visualizer_sw" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
|
||||
<libhw library="visualizer_hw" uuid="7a8044a0-1a71-11e3-a184-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
|
||||
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
|
||||
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
|
||||
<effect name="aec" library="audio_pre_processing" uuid="0f8d0d2a-59e5-45fe-b6e4-248c8a799109"/>
|
||||
<effect name="ns" library="audio_pre_processing" uuid="1d97bb0b-9e2f-4403-9ae3-58c2554306f8"/>
|
||||
<effect name="music_helper" library="volume_listener" uuid="08b8b058-0590-11e5-ac71-0025b32654a0"/>
|
||||
<effect name="ring_helper" library="volume_listener" uuid="0956df94-0590-11e5-bdbe-0025b32654a0"/>
|
||||
<effect name="alarm_helper" library="volume_listener" uuid="09f303e2-0590-11e5-8fdb-0025b32654a0"/>
|
||||
<effect name="voice_helper" library="volume_listener" uuid="0ace5c08-0590-11e5-ae9e-0025b32654a0"/>
|
||||
<effect name="notification_helper" library="volume_listener" uuid="0b776dde-0590-11e5-81ba-0025b32654a0"/>
|
||||
<effect name="audiosphere" library="audiosphere" uuid="184e62ab-2d19-4364-9d1b-c0a40733866c"/>
|
||||
<effect name="misoundfx" library="misoundfx" uuid="5b8e36a5-144a-4c38-b1d7-0002a5d5c51b"/>
|
||||
</effects>
|
||||
<postprocess>
|
||||
<stream type="music">
|
||||
<apply effect="music_helper"/>
|
||||
</stream>
|
||||
<stream type="ring">
|
||||
<apply effect="ring_helper"/>
|
||||
</stream>
|
||||
<stream type="alarm">
|
||||
<apply effect="alarm_helper"/>
|
||||
</stream>
|
||||
<stream type="voice_call">
|
||||
<apply effect="voice_helper"/>
|
||||
</stream>
|
||||
<stream type="notification">
|
||||
<apply effect="notification_helper"/>
|
||||
</stream>
|
||||
</postprocess>
|
||||
<preprocess>
|
||||
<stream type="voice_communication">
|
||||
<apply effect="aec"/>
|
||||
<apply effect="ns"/>
|
||||
</stream>
|
||||
</preprocess>
|
||||
</audio_effects_conf>
|
||||
453
configs/audio/audio_policy_configuration.xml
Normal file
453
configs/audio/audio_policy_configuration.xml
Normal file
@@ -0,0 +1,453 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- Copyright (c) 2016-2021, The Linux Foundation. All rights reserved
|
||||
Not a Contribution.
|
||||
-->
|
||||
<!-- Copyright (C) 2015 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<audioPolicyConfiguration version="7.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” -->
|
||||
|
||||
<!-- Global configuration Decalaration -->
|
||||
<globalConfiguration speaker_drc_enabled="true" call_screen_mode_supported="true"/>
|
||||
|
||||
|
||||
<!-- Modules section:
|
||||
There is one section per audio HW module present on the platform.
|
||||
Each module section will contains two mandatory tags for audio HAL “halVersion” and “name”.
|
||||
The module names are the same as in current .conf file:
|
||||
“primary”, “A2DP”, “remote_submix”, “USB”
|
||||
Each module will contain the following sections:
|
||||
“devicePorts”: a list of device descriptors for all input and output devices accessible via this
|
||||
module.
|
||||
This contains both permanently attached devices and removable devices.
|
||||
“mixPorts”: listing all output and input streams exposed by the audio HAL
|
||||
“routes”: list of possible connections between input and output devices or between stream and
|
||||
devices.
|
||||
"route": is defined by an attribute:
|
||||
-"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix)
|
||||
-"sink": the sink involved in this route
|
||||
-"sources": all the sources than can be connected to the sink via vis route
|
||||
“attachedDevices”: permanently attached devices.
|
||||
The attachedDevices section is a list of devices names. The names correspond to device names
|
||||
defined in <devicePorts> section.
|
||||
“defaultOutputDevice”: device to be used by default when no policy rule applies
|
||||
-->
|
||||
<modules>
|
||||
<!-- Primary Audio HAL -->
|
||||
<module name="primary" halVersion="2.0">
|
||||
<attachedDevices>
|
||||
<item>Earpiece</item>
|
||||
<item>Speaker</item>
|
||||
<item>Telephony Tx</item>
|
||||
<item>Built-In Mic</item>
|
||||
<item>Built-In Back Mic</item>
|
||||
<item>FM Tuner</item>
|
||||
<item>Telephony Rx</item>
|
||||
</attachedDevices>
|
||||
<defaultOutputDevice>Speaker</defaultOutputDevice>
|
||||
<mixPorts>
|
||||
<mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_FAST AUDIO_OUTPUT_FLAG_PRIMARY">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="raw" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_FAST AUDIO_OUTPUT_FLAG_RAW">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="deep_buffer" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="hifi_playback" role="source" />
|
||||
<mixPort name="direct_pcm" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000 352800 384000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000 352800 384000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000 352800 384000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
</mixPort>
|
||||
<mixPort name="compressed_offload" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD AUDIO_OUTPUT_FLAG_NON_BLOCKING AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD">
|
||||
<profile name="" format="AUDIO_FORMAT_MP3"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_FLAC"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_ALAC"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_APE"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_LC"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_DTS"
|
||||
samplingRates="32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_DTS_HD"
|
||||
samplingRates="32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_WMA"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_WMA_PRO"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_VORBIS"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_LC"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</mixPort>
|
||||
<mixPort name="voice_tx" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="voip_rx" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_VOIP_RX">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="incall_music_uplink" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000 48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
|
||||
<mixPort name="primary input" role="sink" maxOpenCount="2" maxActiveCount="2">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||
</mixPort>
|
||||
<mixPort name="fast input" role="sink"
|
||||
flags="AUDIO_INPUT_FLAG_FAST">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||
</mixPort>
|
||||
<mixPort name="quad mic" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000"
|
||||
channelMasks="AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||
</mixPort>
|
||||
<mixPort name="voip_tx" role="sink"
|
||||
flags="AUDIO_INPUT_FLAG_VOIP_TX">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||
</mixPort>
|
||||
<mixPort name="usb_surround_sound" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4 AUDIO_CHANNEL_IN_5POINT1 AUDIO_CHANNEL_INDEX_MASK_6 AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_5POINT1 AUDIO_CHANNEL_INDEX_MASK_6 AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_5POINT1 AUDIO_CHANNEL_INDEX_MASK_6 AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||
</mixPort>
|
||||
<mixPort name="record_24" role="sink" maxOpenCount="2" maxActiveCount="2">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 96000 192000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 96000 192000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 96000 192000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||
</mixPort>
|
||||
<mixPort name="voice_rx" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||
</mixPort>
|
||||
<mixPort name="hifi_input" role="sink" />
|
||||
</mixPorts>
|
||||
|
||||
<devicePorts>
|
||||
<!-- Output devices declaration, i.e. Sink DEVICE PORT -->
|
||||
<devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Speaker" role="sink" type="AUDIO_DEVICE_OUT_SPEAKER" address="">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Line" type="AUDIO_DEVICE_OUT_LINE" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="HDMI" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Proxy" type="AUDIO_DEVICE_OUT_PROXY" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="FM" type="AUDIO_DEVICE_OUT_FM" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||
</devicePort>
|
||||
|
||||
<!-- Input devices declaration, i.e. Source DEVICE PORT -->
|
||||
<devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="Telephony Rx" type="AUDIO_DEVICE_IN_TELEPHONY_RX" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source">
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source">
|
||||
</devicePort>
|
||||
</devicePorts>
|
||||
<!-- route declaration, i.e. list all available sources for a given sink -->
|
||||
<routes>
|
||||
<route type="mix" sink="Earpiece"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="Speaker"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="Wired Headset"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="Wired Headphones"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="Line"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="HDMI"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
<route type="mix" sink="Proxy"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload"/>
|
||||
<route type="mix" sink="FM"
|
||||
sources="primary output"/>
|
||||
<route type="mix" sink="BT SCO"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
<route type="mix" sink="BT SCO Headset"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
<route type="mix" sink="BT SCO Car Kit"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
<route type="mix" sink="USB Device Out"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
|
||||
<route type="mix" sink="USB Headset Out"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
|
||||
<route type="mix" sink="Telephony Tx"
|
||||
sources="voice_tx,incall_music_uplink"/>
|
||||
<route type="mix" sink="voice_rx"
|
||||
sources="Telephony Rx"/>
|
||||
<route type="mix" sink="primary input"
|
||||
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
|
||||
<route type="mix" sink="usb_surround_sound"
|
||||
sources="USB Device In,USB Headset In"/>
|
||||
<route type="mix" sink="fast input"
|
||||
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||
<route type="mix" sink="quad mic"
|
||||
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||
<route type="mix" sink="voip_tx"
|
||||
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||
<route type="mix" sink="record_24"
|
||||
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic"/>
|
||||
<route type="mix" sink="mmap_no_irq_in"
|
||||
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,USB Device In,USB Headset In"/>
|
||||
<route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" />
|
||||
</routes>
|
||||
|
||||
</module>
|
||||
|
||||
<!-- A2DP Audio HAL -->
|
||||
<!-- <module name="a2dp" halVersion="2.0">
|
||||
<mixPorts>
|
||||
<mixPort name="a2dp input" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||
</mixPort>
|
||||
</mixPorts>
|
||||
|
||||
<devicePorts>
|
||||
<devicePort tagName="BT A2DP In" type="AUDIO_DEVICE_IN_BLUETOOTH_A2DP" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||
</devicePort>
|
||||
</devicePorts>
|
||||
|
||||
<routes>
|
||||
<route type="mix" sink="a2dp input"
|
||||
sources="BT A2DP In"/>
|
||||
</routes>
|
||||
</module> -->
|
||||
|
||||
<!-- Usb Audio HAL -->
|
||||
<module name="usb" halVersion="2.0">
|
||||
<mixPorts>
|
||||
<mixPort name="usb_accessory output" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
</mixPorts>
|
||||
<devicePorts>
|
||||
<devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
</devicePorts>
|
||||
<routes>
|
||||
<route type="mix" sink="USB Host Out"
|
||||
sources="usb_accessory output"/>
|
||||
</routes>
|
||||
</module>
|
||||
|
||||
<!-- Remote Submix Audio HAL -->
|
||||
<xi:include href="/vendor/etc/r_submix_audio_policy_configuration.xml"/>
|
||||
|
||||
<!-- Bluetooth Audio HAL -->
|
||||
<xi:include href="/vendor/etc/bluetooth_audio_policy_configuration_7_0.xml"/>
|
||||
|
||||
</modules>
|
||||
<!-- End of Modules section -->
|
||||
|
||||
<!-- Volume section -->
|
||||
|
||||
<xi:include href="/vendor/etc/audio_policy_volumes.xml"/>
|
||||
<xi:include href="/vendor/etc/default_volume_tables.xml"/>
|
||||
|
||||
<!-- End of Volume section -->
|
||||
|
||||
</audioPolicyConfiguration>
|
||||
230
configs/config.fs
Normal file
230
configs/config.fs
Normal file
@@ -0,0 +1,230 @@
|
||||
[AID_VENDOR_QTI_DIAG]
|
||||
value:2901
|
||||
|
||||
[AID_VENDOR_QDSS]
|
||||
value:2902
|
||||
|
||||
[AID_VENDOR_RFS]
|
||||
value:2903
|
||||
|
||||
[AID_VENDOR_RFS_SHARED]
|
||||
value:2904
|
||||
|
||||
[AID_VENDOR_ADPL_ODL]
|
||||
value:2905
|
||||
|
||||
[AID_VENDOR_QRTR]
|
||||
value:2906
|
||||
|
||||
[AID_VENDOR_THERMAL]
|
||||
value:2907
|
||||
|
||||
[AID_VENDOR_FASTRPC]
|
||||
value:2908
|
||||
|
||||
[AID_VENDOR_QTR]
|
||||
value:2909
|
||||
|
||||
[vendor/bin/wcnss_filter]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND
|
||||
|
||||
[system/vendor/bin/wcnss_filter]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND
|
||||
|
||||
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/bin/cnss-daemon]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/pm-service]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/pm-service]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/bin/pm-service]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/pd-mapper]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/pd-mapper]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/bin/pd-mapper]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/imsdatadaemon]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/imsdatadaemon]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/ims_rtp_daemon]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/ims_rtp_daemon]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/imsrcsd]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
|
||||
|
||||
[system/vendor/bin/imsrcsd]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
|
||||
|
||||
[vendor/bin/imsdaemon]
|
||||
mode: 0755
|
||||
user: AID_RADIO
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
|
||||
|
||||
[vendor/bin/cnd]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/vendor/bin/cnd]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[vendor/bin/slim_daemon]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/slim_daemon]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/loc_launcher]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: SETUID SETGID
|
||||
|
||||
[system/vendor/bin/loc_launcher]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: SETUID SETGID
|
||||
|
||||
[vendor/bin/xtwifi-client]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
|
||||
|
||||
[vendor/bin/sensors.qti]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[firmware/]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[firmware/image/*]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[vendor/firmware_mnt/image/*]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[bt_firmware/]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[persist/]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[dsp/]
|
||||
mode: 0771
|
||||
user: AID_MEDIA
|
||||
group: AID_MEDIA
|
||||
caps: 0
|
||||
33
configs/excluded-input-devices.xml
Normal file
33
configs/excluded-input-devices.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2018, 2020 The Linux Foundation. All rights reserved. -->
|
||||
<!-- -->
|
||||
<!-- Redistribution and use in source and binary forms, with or without -->
|
||||
<!-- modification, are permitted provided that the following conditions are -->
|
||||
<!-- met: -->
|
||||
<!-- * Redistributions of source code must retain the above copyright -->
|
||||
<!-- notice, this list of conditions and the following disclaimer. -->
|
||||
<!-- * Redistributions in binary form must reproduce the above -->
|
||||
<!-- copyright notice, this list of conditions and the following -->
|
||||
<!-- disclaimer in the documentation and/or other materials provided -->
|
||||
<!-- with the distribution. -->
|
||||
<!-- * Neither the name of The Linux Foundation nor the names of its -->
|
||||
<!-- contributors may be used to endorse or promote products derived -->
|
||||
<!-- from this software without specific prior written permission. -->
|
||||
<!-- -->
|
||||
<!-- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -->
|
||||
<!-- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -->
|
||||
<!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -->
|
||||
<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -->
|
||||
<!-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
|
||||
<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
|
||||
<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -->
|
||||
<!-- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -->
|
||||
<!-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -->
|
||||
<!-- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
|
||||
<!-- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
||||
<devices>
|
||||
<device name="qti-haptics"/>
|
||||
<device name="qcom-hv-haptics"/>
|
||||
<device name="drv2624:haptics"/>
|
||||
<device name="aw8624_haptic"/>
|
||||
</devices>
|
||||
446
configs/powerhint.json
Normal file
446
configs/powerhint.json
Normal file
@@ -0,0 +1,446 @@
|
||||
{
|
||||
"Nodes": [
|
||||
{
|
||||
"Name": "CPULittleClusterMaxFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"1958400",
|
||||
"1804800"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPULittleClusterMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"1632000",
|
||||
"1478400",
|
||||
"1286400",
|
||||
"1094400",
|
||||
"921600",
|
||||
"806400",
|
||||
"672000",
|
||||
"499200"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBigClusterMaxFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"2208000",
|
||||
"2131200"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBigClusterMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"2054400",
|
||||
"1900800",
|
||||
"1651200",
|
||||
"1497600",
|
||||
"1344000",
|
||||
"1190400",
|
||||
"960000",
|
||||
"691200"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUMaxFreq",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/max_pwrlevel",
|
||||
"Values": [
|
||||
"0",
|
||||
"1",
|
||||
"3"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUMinFreq",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/min_pwrlevel",
|
||||
"Values": [
|
||||
"0",
|
||||
"3",
|
||||
"6"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUBusMinFreq",
|
||||
"Path": "/sys/class/devfreq/3d00000.qcom,kgsl-3d0/min_freq",
|
||||
"Values": [
|
||||
"955000000",
|
||||
"850000000",
|
||||
"765000000",
|
||||
"605000000",
|
||||
"500000000",
|
||||
"340000000",
|
||||
"0"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUForceRailOn",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/force_rail_on",
|
||||
"Values": [
|
||||
"1",
|
||||
"0"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUForceClkOn",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/force_clk_on",
|
||||
"Values": [
|
||||
"1",
|
||||
"0"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUIdleTimer",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/idle_timer",
|
||||
"Values": [
|
||||
"10000",
|
||||
"50"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "UclampTAMin",
|
||||
"Path": "/dev/cpuctl/top-app/cpu.uclamp.min",
|
||||
"Values": [
|
||||
"26",
|
||||
"0",
|
||||
"30",
|
||||
"35",
|
||||
"45"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "UclampTALatency",
|
||||
"Path": "/dev/cpuctl/top-app/cpu.uclamp.latency_sensitive",
|
||||
"Values": [
|
||||
"1",
|
||||
"0"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWHystTriggerCount",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/hyst_trigger_count",
|
||||
"Values": [
|
||||
"0",
|
||||
"3"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWHistMemory",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/hist_memory",
|
||||
"Values": [
|
||||
"0",
|
||||
"20"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWHystLength",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/hyst_length",
|
||||
"Values": [
|
||||
"0",
|
||||
"10"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWSampleMs",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/sample_ms",
|
||||
"Values": [
|
||||
"10",
|
||||
"4"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWIOPercent",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/io_percent",
|
||||
"Values": [
|
||||
"80",
|
||||
"34"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/min_freq",
|
||||
"Values": [
|
||||
"547000",
|
||||
"768000",
|
||||
"1017000",
|
||||
"1353600",
|
||||
"1555000",
|
||||
"1708000",
|
||||
"2092000"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "L3LittleClusterMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/L3/soc:qcom,memlat:l3:silver/min_freq",
|
||||
"Values": [
|
||||
"1440000",
|
||||
"1305600",
|
||||
"307200"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "L3BigClusterMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/bus_dcvs/L3/soc:qcom,memlat:l3:gold/min_freq",
|
||||
"Values": [
|
||||
"1440000",
|
||||
"1401600",
|
||||
"307200"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "PMQoSCpuDmaLatency",
|
||||
"Path": "/dev/cpu_dma_latency",
|
||||
"Values": [
|
||||
"44",
|
||||
"100"
|
||||
],
|
||||
"HoldFd": true
|
||||
},
|
||||
{
|
||||
"Name": "PowerHALMainState",
|
||||
"Path": "vendor.powerhal.state",
|
||||
"Values": [
|
||||
"SUSTAINED_PERFORMANCE",
|
||||
""
|
||||
],
|
||||
"Type": "Property"
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "PowerHALAudioState",
|
||||
"Path": "vendor.powerhal.audio",
|
||||
"Values": [
|
||||
"AUDIO_STREAMING_LOW_LATENCY",
|
||||
""
|
||||
],
|
||||
"Type": "Property"
|
||||
},
|
||||
{
|
||||
"Name": "PowerHALRenderingState",
|
||||
"Path": "vendor.powerhal.rendering",
|
||||
"Values": [
|
||||
"EXPENSIVE_RENDERING",
|
||||
""
|
||||
],
|
||||
"Type": "Property"
|
||||
}
|
||||
],
|
||||
"Actions": [
|
||||
{
|
||||
"PowerHint": "SUSTAINED_PERFORMANCE",
|
||||
"Node": "PowerHALMainState",
|
||||
"Duration": 0,
|
||||
"Value": "SUSTAINED_PERFORMANCE"
|
||||
},
|
||||
{
|
||||
"PowerHint": "SUSTAINED_PERFORMANCE",
|
||||
"Node": "CPUBigClusterMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "2208000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "SUSTAINED_PERFORMANCE",
|
||||
"Node": "CPULittleClusterMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "1958400"
|
||||
},
|
||||
{
|
||||
"PowerHint": "SUSTAINED_PERFORMANCE",
|
||||
"Node": "GPUMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "3"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPULittleClusterMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "806400"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "UclampTALatency",
|
||||
"Duration": 0,
|
||||
"Value": "1"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "UclampTAMin",
|
||||
"Duration": 3000,
|
||||
"Value": "45"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPUBWHystTriggerCount",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPUBWHystLength",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPUBWHistMemory",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPUBWMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "1555000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBigClusterMaxFreq",
|
||||
"Duration": 5000,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBigClusterMinFreq",
|
||||
"Duration": 5000,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPULittleClusterMinFreq",
|
||||
"Duration": 5000,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "PMQoSCpuDmaLatency",
|
||||
"Duration": 5000,
|
||||
"Value": "44"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWHystTriggerCount",
|
||||
"Duration": 5000,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWHystLength",
|
||||
"Duration": 5000,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWHistMemory",
|
||||
"Duration": 5000,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWMinFreq",
|
||||
"Duration": 5000,
|
||||
"Value": "2092000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "GPUForceClkOn",
|
||||
"Duration": 5000,
|
||||
"Value": "1"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "GPUForceRailOn",
|
||||
"Duration": 5000,
|
||||
"Value": "1"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "GPUIdleTimer",
|
||||
"Duration": 5000,
|
||||
"Value": "10000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "L3LittleClusterMinFreq",
|
||||
"Duration": 5000,
|
||||
"Value": "1440000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "L3BigClusterMinFreq",
|
||||
"Duration": 5000,
|
||||
"Value": "1440000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "AUDIO_LAUNCH",
|
||||
"Node": "PMQoSCpuDmaLatency",
|
||||
"Duration": 2000,
|
||||
"Value": "44"
|
||||
},
|
||||
{
|
||||
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
|
||||
"Node": "PowerHALAudioState",
|
||||
"Duration": 0,
|
||||
"Value": "AUDIO_STREAMING_LOW_LATENCY"
|
||||
},
|
||||
{
|
||||
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
|
||||
"Node": "PMQoSCpuDmaLatency",
|
||||
"Duration": 0,
|
||||
"Value": "44"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "PowerHALRenderingState",
|
||||
"Duration": 0,
|
||||
"Value": "EXPENSIVE_RENDERING"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "GPUMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "GPUBusMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "765000000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "GPUMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
14
configs/privapp-permissions-hotword.xml
Normal file
14
configs/privapp-permissions-hotword.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<permissions>
|
||||
<privapp-permissions package="com.android.hotwordenrollment.okgoogle">
|
||||
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
|
||||
<permission name="android.permission.KEYPHRASE_ENROLLMENT_APPLICATION"/>
|
||||
<permission name="android.permission.MANAGE_VOICE_KEYPHRASES"/>
|
||||
</privapp-permissions>
|
||||
|
||||
<privapp-permissions package="com.android.hotwordenrollment.xgoogle">
|
||||
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
|
||||
<permission name="android.permission.KEYPHRASE_ENROLLMENT_APPLICATION"/>
|
||||
<permission name="android.permission.MANAGE_VOICE_KEYPHRASES"/>
|
||||
</privapp-permissions>
|
||||
</permissions>
|
||||
@@ -1,8 +0,0 @@
|
||||
# Adb
|
||||
ifeq ($(TARGET_BUILD_VARIANT),eng)
|
||||
# /vendor/default.prop is force-setting ro.adb.secure=1
|
||||
# Get rid of that by overriding it in /product on eng builds
|
||||
PRODUCT_PRODUCT_PROPERTIES += \
|
||||
ro.secure=0 \
|
||||
ro.adb.secure=0
|
||||
endif
|
||||
2
configs/properties/odm.prop
Normal file
2
configs/properties/odm.prop
Normal file
@@ -0,0 +1,2 @@
|
||||
# Qti
|
||||
ro.vendor.qti.va_odm.support=1
|
||||
@@ -1,29 +1,35 @@
|
||||
# Audio
|
||||
ro.config.vc_call_vol_steps=11
|
||||
ro.config.media_vol_steps=25
|
||||
|
||||
# Bluetooth
|
||||
bluetooth.profile.a2dp.source.enabled=true
|
||||
bluetooth.profile.avrcp.target.enabled=true
|
||||
bluetooth.profile.avrcp.controller.enabled=false
|
||||
bluetooth.profile.hfp.ag.enabled=true
|
||||
bluetooth.profile.asha.central.enabled=true
|
||||
bluetooth.profile.gatt.enabled=true
|
||||
bluetooth.profile.hid.host.enabled=true
|
||||
bluetooth.profile.hid.device.enabled=true
|
||||
bluetooth.profile.map.server.enabled=true
|
||||
bluetooth.profile.opp.enabled=true
|
||||
bluetooth.profile.pan.nap.enabled=true
|
||||
bluetooth.profile.pan.panu.enabled=true
|
||||
bluetooth.profile.pbap.server.enabled=true
|
||||
bluetooth.profile.sap.server.enabled=false
|
||||
vendor.audio_hal.period_size=192
|
||||
vendor.audio.tunnel.encode=false
|
||||
vendor.audio.offload.buffer.size.kb=32
|
||||
vendor.voice.path.for.pcm.voip=true
|
||||
vendor.audio.offload.multiaac.enable=true
|
||||
vendor.audio.parser.ip.buffer.size=262144
|
||||
vendor.audio.flac.sw.decoder.24bit=true
|
||||
vendor.audio.use.sw.alac.decoder=true
|
||||
vendor.audio.use.sw.ape.decoder=true
|
||||
vendor.audio.hw.aac.encoder=true
|
||||
af.fast_track_multiplier=1
|
||||
audio.offload.video=true
|
||||
audio.deep_buffer.media=true
|
||||
audio.sys.noisy.broadcast.delay=500
|
||||
audio.sys.mute.latency.factor=2
|
||||
audio.sys.routing.latency=0
|
||||
audio.offload.min.duration.secs=30
|
||||
audio.sys.offload.pstimeout.secs=3
|
||||
ro.af.client_heap_size_kbyte=7168
|
||||
media.stagefright.audio.deep=false
|
||||
aaudio.mmap_exclusive_policy=2
|
||||
aaudio.hw_burst_min_usec=2000
|
||||
|
||||
# Blur
|
||||
ro.sf.blurs_are_expensive=1
|
||||
ro.surface_flinger.supports_background_blur=1
|
||||
ro.sf.blurs_are_expensive=0
|
||||
ro.surface_flinger.supports_background_blur=0
|
||||
|
||||
# Fuse
|
||||
persist.sys.fuse.passthrough.enable=true
|
||||
|
||||
# Radio
|
||||
persist.vendor.radio.hidl_dev_service=true
|
||||
|
||||
# Sensors
|
||||
persist.vendor.sensors.enable.mag_filter=true
|
||||
ro.vendor.radio.5g=3
|
||||
ro.vendor.radio.features_common=3
|
||||
|
||||
@@ -1,17 +1,53 @@
|
||||
# Bluetooth
|
||||
persist.vendor.btstack.enable.twsplus=true
|
||||
persist.vendor.btstack.enable.twsplussho=true
|
||||
persist.vendor.bt.a2dp.hal.implementation=true
|
||||
persist.vendor.bt.a2dp.aac_whitelist=false
|
||||
persist.vendor.btstack.enable.lpa=true
|
||||
|
||||
# Charger
|
||||
ro.charger.enable_suspend=1
|
||||
|
||||
# CNE
|
||||
persist.vendor.cne.feature=1
|
||||
|
||||
# Enable system-side generic bluetooth audio HAL
|
||||
persist.bluetooth.system_audio_hal.enabled=1
|
||||
# hwui properties
|
||||
ro.hwui.texture_cache_size=72
|
||||
ro.hwui.layer_cache_size=48
|
||||
ro.hwui.r_buffer_cache_size=8
|
||||
ro.hwui.path_cache_size=32
|
||||
ro.hwui.gradient_cache_size=1
|
||||
ro.hwui.drop_shadow_cache_size=6
|
||||
ro.hwui.max_texture_allocation_size=209715200
|
||||
ro.hwui.texture_cache_flushrate=0.4
|
||||
ro.hwui.text_small_cache_width=1024
|
||||
ro.hwui.text_small_cache_height=1024
|
||||
ro.hwui.text_large_cache_width=2048
|
||||
ro.hwui.text_large_cache_height=1024
|
||||
|
||||
# IMS
|
||||
persist.dbg.volte_avail_ovr=1
|
||||
persist.dbg.vt_avail_ovr=1
|
||||
persist.dbg.wfc_avail_ovr=1
|
||||
|
||||
#system props for the MM modules
|
||||
media.stagefright.enable-player=true
|
||||
media.stagefright.enable-http=true
|
||||
media.stagefright.enable-aac=true
|
||||
media.stagefright.enable-qcp=true
|
||||
media.stagefright.enable-fma2dp=true
|
||||
media.stagefright.enable-scan=true
|
||||
media.stagefright.thumbnail.prefer_hw_codecs=true
|
||||
mmp.enable.3g2=true
|
||||
media.aac_51_output_enabled=true
|
||||
#16777215 is decimal sum of supported codecs in AAL
|
||||
#codecs:(PARSER_)AAC AC3 AMR_NB AMR_WB ASF AVI DTS FLV 3GP 3G2 MKV MP2PS MP2TS MP3 OGG QCP WAV FLAC AIFF APE DSD MOV MHAS
|
||||
vendor.mm.enable.qcom_parser=16777215
|
||||
persist.mm.enable.prefetch=true
|
||||
|
||||
# QTI
|
||||
ro.vendor.qti.va_aosp.support=1
|
||||
|
||||
# RIL
|
||||
DEVICE_PROVISIONED=1
|
||||
persist.vendor.data.mode=concurrent
|
||||
@@ -26,12 +62,9 @@ persist.radio.is_vonr_enabled_1=true
|
||||
# Sensors
|
||||
persist.vendor.sensors.enable.mag_filter=true
|
||||
|
||||
# Set the Bluetooth Class of Device
|
||||
# Service Field: 0x5A -> 90
|
||||
# Bit 17: Networking
|
||||
# Bit 19: Capturing
|
||||
# Bit 20: Object Transfer
|
||||
# Bit 22: Telephony
|
||||
# MAJOR_CLASS: 0x02 -> 2 (Phone)
|
||||
# MINOR_CLASS: 0x0C -> 12 (Smart Phone)
|
||||
bluetooth.device.class_of_device=90,2,12
|
||||
# SSR
|
||||
persist.vendor.ssr.enable_ramdumps=1
|
||||
|
||||
# WiFi display
|
||||
persist.debug.wfd.enable=1
|
||||
persist.sys.wfd.virtual=0
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
# Bluetooth
|
||||
persist.bluetooth.bluetooth_audio_hal.disabled=false
|
||||
persist.bluetooth.a2dp_offload.disabled=true
|
||||
ro.bluetooth.a2dp_offload.supported=false
|
||||
|
||||
# DPM
|
||||
persist.vendor.dpm.feature=1
|
||||
persist.vendor.dpm.feature=11
|
||||
|
||||
# RIL
|
||||
ro.telephony.sim_slots.count=2
|
||||
telephony.active_modems.max_count=2
|
||||
|
||||
327
configs/properties/vendor.prop
Normal file
327
configs/properties/vendor.prop
Normal file
@@ -0,0 +1,327 @@
|
||||
# Audio
|
||||
aaudio.hw_burst_min_usec=2000
|
||||
aaudio.mmap_exclusive_policy=2
|
||||
aaudio.mmap_policy=1
|
||||
af.fast_track_multiplier=1
|
||||
audio.deep_buffer.media=true
|
||||
audio.offload.video=true
|
||||
audio.sys.noisy.broadcast.delay=600
|
||||
audio.sys.offload.pstimeout.secs=3
|
||||
persist.audio.button_jack.profile=volume
|
||||
persist.audio.button_jack.switch=0
|
||||
persist.audio.fluence.speaker=true
|
||||
persist.audio.fluence.voicecall=true
|
||||
persist.audio.fluence.voicecomm=true
|
||||
persist.audio.fluence.voicerec=false
|
||||
persist.vendor.audio.ambisonic.auto.profile=false
|
||||
persist.vendor.audio.ambisonic.capture=false
|
||||
persist.vendor.audio.apptype.multirec.enabled=false
|
||||
persist.vendor.audio.avs.afe_api_version=2
|
||||
persist.vendor.audio.fluence.speaker=true
|
||||
persist.vendor.audio.fluence.tmic.enabled=false
|
||||
persist.vendor.audio.fluence.voicecall=true
|
||||
persist.vendor.audio.fluence.voicerec=false
|
||||
persist.vendor.audio.ha_proxy.enabled=true
|
||||
persist.vendor.audio.ras.enabled=false
|
||||
persist.vendor.audio.ring.filter.mask=0
|
||||
persist.vendor.audio.spv3.enable=true
|
||||
ro.vendor.audio.game.mode=true
|
||||
ro.vendor.audio.playbackcapture.screen=true
|
||||
ro.vendor.audio.policy.engine.odm=true
|
||||
ro.vendor.audio.ring.filter=false
|
||||
ro.vendor.audio.scenario.support=true
|
||||
ro.vendor.audio.sdk.fluencetype=none
|
||||
ro.vendor.audio.sdk.ssr=false
|
||||
ro.vendor.audio.sfx.earadj=true
|
||||
ro.vendor.audio.sfx.scenario=true
|
||||
ro.vendor.audio.sos=true
|
||||
ro.vendor.audio.soundfx.type=mi
|
||||
ro.vendor.audio.soundfx.usb=true
|
||||
ro.vendor.audio.soundtrigger=sva
|
||||
ro.vendor.audio.soundtrigger.appdefine.cnn.level=45
|
||||
ro.vendor.audio.soundtrigger.appdefine.gmm.level=55
|
||||
ro.vendor.audio.soundtrigger.appdefine.gmm.user.level=65
|
||||
ro.vendor.audio.soundtrigger.appdefine.vop.level=10
|
||||
ro.vendor.audio.soundtrigger.lowpower=true
|
||||
ro.vendor.audio.soundtrigger.pangaea=1
|
||||
ro.vendor.audio.soundtrigger.snr=16
|
||||
ro.vendor.audio.soundtrigger.sva-5.0=1
|
||||
ro.vendor.audio.soundtrigger.training.level=50
|
||||
ro.vendor.audio.soundtrigger.wakeupword=1
|
||||
ro.vendor.audio.soundtrigger.xanzn.cnn.level=58
|
||||
ro.vendor.audio.soundtrigger.xanzn.gmm.level=80
|
||||
ro.vendor.audio.soundtrigger.xanzn.gmm.user.level=80
|
||||
ro.vendor.audio.soundtrigger.xanzn.vop.level=10
|
||||
ro.vendor.audio.soundtrigger.xatx.cnn.level=95
|
||||
ro.vendor.audio.soundtrigger.xatx.gmm.level=40
|
||||
ro.vendor.audio.soundtrigger.xatx.gmm.user.level=40
|
||||
ro.vendor.audio.soundtrigger.xatx.vop.level=0
|
||||
ro.vendor.audio.soundtrigger.xiaomievent=1
|
||||
ro.vendor.audio.surround.support=true
|
||||
ro.vendor.audio.us.proximity=true
|
||||
ro.vendor.audio.us.proximity_waitfornegative_feature=true
|
||||
ro.vendor.audio.vocal.support=true
|
||||
ro.vendor.audio.voice.change.support=true
|
||||
ro.vendor.audio.voice.change.version=2
|
||||
ro.vendor.audio.voice.change.youme.support=true
|
||||
ro.vendor.audio.voice.volume.boost=manual
|
||||
|
||||
# Audio feature
|
||||
vendor.audio.adm.buffering.ms=2
|
||||
vendor.audio.c2.preferred=true
|
||||
vendor.audio.dolby.ds2.enabled=false
|
||||
vendor.audio.dolby.ds2.hardbypass=false
|
||||
vendor.audio.enable.mirrorlink=false
|
||||
vendor.audio.feature.a2dp_offload.enable=true
|
||||
vendor.audio.feature.afe_proxy.enable=true
|
||||
vendor.audio.feature.anc_headset.enable=false
|
||||
vendor.audio.feature.audiozoom.enable=false
|
||||
vendor.audio.feature.battery_listener.enable=true
|
||||
vendor.audio.feature.compr_cap.enable=false
|
||||
vendor.audio.feature.compr_voip.enable=false
|
||||
vendor.audio.feature.compress_in.enable=true
|
||||
vendor.audio.feature.compress_meta_data.enable=true
|
||||
vendor.audio.feature.concurrent_capture.enable=true
|
||||
vendor.audio.feature.custom_stereo.enable=true
|
||||
vendor.audio.feature.deepbuffer_as_primary.enable=false
|
||||
vendor.audio.feature.display_port.enable=true
|
||||
vendor.audio.feature.dmabuf.cma.memory.enable=true
|
||||
vendor.audio.feature.dsm_feedback.enable=false
|
||||
vendor.audio.feature.dynamic_ecns.enable=true
|
||||
vendor.audio.feature.ext_hw_plugin.enable=false
|
||||
vendor.audio.feature.external_dsp.enable=false
|
||||
vendor.audio.feature.external_speaker.enable=false
|
||||
vendor.audio.feature.external_speaker_tfa.enable=false
|
||||
vendor.audio.feature.fluence.enable=true
|
||||
vendor.audio.feature.fm.enable=true
|
||||
vendor.audio.feature.hdmi_edid.enable=true
|
||||
vendor.audio.feature.hdmi_passthrough.enable=true
|
||||
vendor.audio.feature.hfp.enable=false
|
||||
vendor.audio.feature.hifi_audio.enable=false
|
||||
vendor.audio.feature.hwdep_cal.enable=false
|
||||
vendor.audio.feature.incall_music.enable=true
|
||||
vendor.audio.feature.keep_alive.enable=true
|
||||
vendor.audio.feature.kpi_optimize.enable=true
|
||||
vendor.audio.feature.maxx_audio.enable=false
|
||||
vendor.audio.feature.multi_voice_session.enable=true
|
||||
vendor.audio.feature.ras.enable=true
|
||||
vendor.audio.feature.record_play_concurency.enable=false
|
||||
vendor.audio.feature.snd_mon.enable=true
|
||||
vendor.audio.feature.spkr_prot.enable=true
|
||||
vendor.audio.feature.src_trkn.enable=true
|
||||
vendor.audio.feature.ssrec.enable=true
|
||||
vendor.audio.feature.usb_offload.enable=true
|
||||
vendor.audio.feature.usb_offload_burst_mode.enable=true
|
||||
vendor.audio.feature.usb_offload_sidetone_volume.enable=false
|
||||
vendor.audio.feature.vbat.enable=true
|
||||
vendor.audio.feature.wsa.enable=false
|
||||
vendor.audio.flac.sw.decoder.24bit=true
|
||||
vendor.audio.hal.boot.timeout.ms=20000
|
||||
vendor.audio.hal.output.suspend.supported=true
|
||||
vendor.audio.hdr.record.enable=false
|
||||
vendor.audio.hw.aac.encoder=false
|
||||
vendor.audio.offload.buffer.size.kb=32
|
||||
vendor.audio.offload.gapless.enabled=true
|
||||
vendor.audio.offload.multiaac.enable=true
|
||||
vendor.audio.offload.multiple.enabled=false
|
||||
vendor.audio.offload.passthrough=false
|
||||
vendor.audio.offload.track.enable=true
|
||||
vendor.audio.parser.ip.buffer.size=262144
|
||||
vendor.audio.safx.pbe.enabled=false
|
||||
vendor.audio.tunnel.encode=false
|
||||
vendor.audio.ull_record_period_multiplier=2
|
||||
vendor.audio.use.sw.alac.decoder=true
|
||||
vendor.audio.use.sw.ape.decoder=true
|
||||
vendor.audio.use.sw.mpegh.decoder=true
|
||||
vendor.audio.voice.receiver.status=false
|
||||
vendor.audio.volume.headset.gain.depcal=true
|
||||
vendor.audio_hal.in_period_size=144
|
||||
vendor.audio_hal.period_multiplier=3
|
||||
vendor.audio_hal.period_size=192
|
||||
|
||||
# Bluetooth
|
||||
bluetooth.hardware.power.idle_cur_ma=6
|
||||
bluetooth.hardware.power.operating_voltage_mv=3700
|
||||
bluetooth.hardware.power.rx_cur_ma=28
|
||||
bluetooth.hardware.power.tx_cur_ma=36
|
||||
bluetooth.profile.a2dp.source.enabled=true
|
||||
bluetooth.profile.avrcp.target.enabled=true
|
||||
bluetooth.profile.avrcp.controller.enabled=false
|
||||
bluetooth.profile.hfp.ag.enabled=true
|
||||
bluetooth.profile.asha.central.enabled=true
|
||||
bluetooth.profile.gatt.enabled=true
|
||||
bluetooth.profile.hid.host.enabled=true
|
||||
bluetooth.profile.hid.device.enabled=true
|
||||
bluetooth.profile.map.server.enabled=true
|
||||
bluetooth.profile.opp.enabled=true
|
||||
bluetooth.profile.pan.nap.enabled=true
|
||||
bluetooth.profile.pan.panu.enabled=true
|
||||
bluetooth.profile.pbap.server.enabled=true
|
||||
bluetooth.profile.sap.server.enabled=false
|
||||
persist.vendor.bt.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac-lhdc
|
||||
ro.bluetooth.a2dp_offload.supported=true
|
||||
persist.bluetooth.a2dp_offload.disabled=false
|
||||
persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac-lhdc
|
||||
persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac-aptxadaptiver2
|
||||
persist.vendor.qcom.bluetooth.aac_frm_ctl.enabled=true
|
||||
persist.vendor.qcom.bluetooth.twsp_state.enabled=false
|
||||
persist.vendor.qcom.bluetooth.a2dp_mcast_test.enabled=false
|
||||
persist.vendor.qcom.bluetooth.scram.enabled=false
|
||||
persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=true
|
||||
persist.vendor.qcom.bluetooth.aptxadaptiver2_1_support=true
|
||||
persist.sys.fflag.override.settings_bluetooth_hearing_aid=true
|
||||
ro.vendor.bluetooth.csip_qti=true
|
||||
|
||||
# Camera
|
||||
camera.disable_zsl_mode=true
|
||||
ro.camera.enableCamera1MaxZsl=1
|
||||
persist.sys.miui.camera.boost.killAdj_threshold=500:251:200:50
|
||||
persist.sys.miui.camera.protect_prev_ext=true
|
||||
|
||||
# Display
|
||||
vendor.display.comp_mask=0
|
||||
vendor.display.disable_3d_adaptive_tm=1
|
||||
vendor.display.disable_excl_rect=0
|
||||
vendor.display.disable_excl_rect_partial_fb=1
|
||||
vendor.display.disable_hw_recovery_dump=1
|
||||
vendor.display.disable_offline_rotator=1
|
||||
vendor.display.disable_scaler=0
|
||||
vendor.display.disable_sdr_dimming=1
|
||||
vendor.display.disable_sdr_histogram=1
|
||||
vendor.display.disable_stc_dimming=1
|
||||
vendor.display.enable_async_powermode=0
|
||||
vendor.display.enable_async_vds_creation=1
|
||||
vendor.display.enable_dpps_dynamic_fps=1
|
||||
vendor.display.enable_early_wakeup=1
|
||||
vendor.display.enable_hdr10_gpu_target=1
|
||||
vendor.display.enable_optimize_refresh=0
|
||||
vendor.display.enable_rc_support=1
|
||||
vendor.display.enable_rounded_corner=1
|
||||
vendor.display.idle_time=0
|
||||
vendor.display.use_smooth_motion=1
|
||||
vendor.display.vds_allow_hwc=true
|
||||
|
||||
# DPM
|
||||
persist.vendor.dpm.vndr.idletimer.mode=default
|
||||
persist.vendor.dpm.vndr.halservice.enable=1
|
||||
persist.vendor.dpm.vndr.feature=1
|
||||
|
||||
# DRM
|
||||
drm.service.enabled=true
|
||||
|
||||
# Dex2oat
|
||||
pm.dexopt.boot=verify
|
||||
pm.dexopt.first-boot=verify
|
||||
pm.dexopt.install=speed-profile
|
||||
dalvik.vm.image-dex2oat-filter=speed
|
||||
dalvik.vm.image-dex2oat-threads=8
|
||||
dalvik.vm.dex2oat-filter=speed
|
||||
dalvik.vm.dex2oat-threads=8
|
||||
dalvik.vm.dex2oat64.enabled=true
|
||||
|
||||
# Fingerprint
|
||||
ro.hardware.fp.sideCap=true
|
||||
|
||||
# FM
|
||||
vendor.qcom.bluetooth.soc=cherokee
|
||||
|
||||
# RFP
|
||||
ro.frp.pst=/dev/block/bootdevice/by-name/frp
|
||||
|
||||
# Gatekeeper
|
||||
vendor.gatekeeper.disable_spu=true
|
||||
|
||||
# Graphics
|
||||
persist.sys.sf.color_saturation=1.0
|
||||
persist.sys.sf.color_mode=7
|
||||
persist.sys.sf.native_mode=256
|
||||
debug.sf.hw=0
|
||||
debug.sf.enable_hwc_vds=false
|
||||
debug.egl.hw=0
|
||||
debug.sf.auto_latch_unsignaled=1
|
||||
debug.sf.high_fps_late_app_phase_offset_ns=1000000
|
||||
debug.sf.high_fps_late_sf_phase_offset_ns=-2000000
|
||||
debug.sf.high_fps_early_phase_offset_ns=-4000000
|
||||
debug.sf.high_fps_early_gl_phase_offset_ns=-2000000
|
||||
debug.sf.disable_client_composition_cache=1
|
||||
debug.sf.enable_gl_backpressure=1
|
||||
debug.sf.enable_advanced_sf_phase_offset=1
|
||||
debug.sf.predict_hwc_composition_strategy=0
|
||||
debug.sf.treat_170m_as_sRGB=1
|
||||
ro.hardware.vulkan=adreno
|
||||
ro.hardware.egl=adreno
|
||||
ro.opengles.version=196610
|
||||
ro.surface_flinger.has_wide_color_display=false
|
||||
ro.surface_flinger.has_HDR_display=true
|
||||
ro.surface_flinger.use_color_management=true
|
||||
ro.surface_flinger.wcg_composition_dataspace=143261696
|
||||
ro.surface_flinger.protected_contents=true
|
||||
ro.surface_flinger.use_content_detection_for_refresh_rate=true
|
||||
ro.surface_flinger.set_display_power_timer_ms=1000
|
||||
ro.surface_flinger.set_idle_timer_ms=1100
|
||||
ro.surface_flinger.set_touch_timer_ms=200
|
||||
ro.surface_flinger.force_hwc_copy_for_virtual_displays=true
|
||||
ro.surface_flinger.max_frame_buffer_acquired_buffers=3
|
||||
ro.surface_flinger.max_virtual_display_dimension=4096
|
||||
ro.vendor.all_modes.colorpick_adjust=true
|
||||
vendor.gralloc.disable_ubwc=0
|
||||
|
||||
# Media
|
||||
debug.c2.use_dmabufheaps=1
|
||||
debug.mdpcomp.logs=0
|
||||
debug.stagefright.c2inputsurface=-1
|
||||
vendor.mm.enable.qcom_parser=16777215
|
||||
vendor.media.omx=0
|
||||
|
||||
# Misc
|
||||
sys.vendor.shutdown.waittime=500
|
||||
|
||||
# Perf
|
||||
ro.vendor.extension_library=libqti-perfd-client.so
|
||||
ro.vendor.perf-hal.ver=2.3
|
||||
ro.vendor.perf.scroll_opt=1
|
||||
ro.vendor.perf.scroll_opt.heavy_app=2
|
||||
vendor.power.pasr.enabled=false
|
||||
vendor.pasr.activemode.enabled=false
|
||||
|
||||
# QFP
|
||||
persist.vendor.qfp=true
|
||||
|
||||
# QSPM
|
||||
ro.vendor.qspm.enable=true
|
||||
|
||||
# Radio
|
||||
persist.radio.multisim.config=dsds
|
||||
persist.vendor.radio.dynamic_sar=1
|
||||
persist.vendor.radio.apm_sim_not_pwdn=1
|
||||
persist.vendor.radio.sib16_support=1
|
||||
persist.vendor.radio.custom_ecc=1
|
||||
persist.vendor.radio.procedure_bytes=SKIP
|
||||
persist.vendor.radio.enableadvancedscan=true
|
||||
|
||||
# RCS
|
||||
persist.vendor.rcs.singlereg.feature=1
|
||||
|
||||
# Sensors
|
||||
persist.vendor.sensors.support_direct_channel=false
|
||||
|
||||
# SOC
|
||||
ro.soc.manufacturer=QTI
|
||||
|
||||
# SSR
|
||||
persist.vendor.ssr.restart_level=ALL_ENABLE
|
||||
|
||||
# USB
|
||||
persist.sys.usb.config=none
|
||||
vendor.usb.diag.func.name=ffs
|
||||
vendor.usb.dpl.inst.name=dpl
|
||||
vendor.usb.qdss.inst.name=qdss_sw
|
||||
vendor.usb.rmnet.func.name=gsi
|
||||
vendor.usb.rmnet.inst.name=rmnet
|
||||
vendor.usb.rndis.func.name=gsi
|
||||
vendor.usb.use_ffs_mtp=1
|
||||
vendor.usb.use_gadget_hal=1
|
||||
sys.usb.mtp.batchcancel=1
|
||||
|
||||
# WiFi
|
||||
wifi.aware.interface=wifi-aware0
|
||||
File diff suppressed because it is too large
Load Diff
96
configs/vintf/compatibility_matrix.xml
Normal file
96
configs/vintf/compatibility_matrix.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<!-- Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<compatibility-matrix version="1.0" type="device">
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.sensorservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensorManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.allocator</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.manager</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IServiceManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.memory</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.token</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ITokenManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.system.wifi.keystore</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IKeystore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.qti.hardware.sigma_miracast</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>Isigma_miracast</name>
|
||||
<instance>sigmahal</instance>
|
||||
<instance>sigmahal64</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.qti.hardware.qccsyshal</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0-1</version>
|
||||
<interface>
|
||||
<name>IQccsyshal</name>
|
||||
<instance>qccsyshal</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
||||
37
configs/vintf/framework_manifest.xml
Normal file
37
configs/vintf/framework_manifest.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<!-- Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="framework">
|
||||
<!--QDMA hal-->
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.qccsyshal</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>IQccsyshal</name>
|
||||
<instance>qccsyshal</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
69
configs/vintf/manifest_hceese.xml
Normal file
69
configs/vintf/manifest_hceese.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<!--copyright (c) 2017, 2018 The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
|
||||
<!-- NFC HAL service -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>INfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.nxp.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>INqNfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- secure element -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.secure_element</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>ISecureElement</name>
|
||||
<instance>eSE1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- eSEPowerManager -->
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.esepowermanager</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IEsePowerManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
60
configs/vintf/manifest_hcesim.xml
Normal file
60
configs/vintf/manifest_hcesim.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<!--copyright (c) 2017, 2018 The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
|
||||
<!-- NFC HAL service -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>INfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.nxp.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>INqNfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- secure element -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.secure_element</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>ISecureElement</name>
|
||||
<instance>SIM1</instance>
|
||||
<instance>SIM2</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
59
configs/vintf/manifest_hcesim1.xml
Normal file
59
configs/vintf/manifest_hcesim1.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<!--copyright (c) 2017, 2018 The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
|
||||
<!-- NFC HAL service -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>INfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.nxp.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>INqNfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- secure element -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.secure_element</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>ISecureElement</name>
|
||||
<instance>SIM1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
69
configs/vintf/manifest_hcesim1ese.xml
Normal file
69
configs/vintf/manifest_hcesim1ese.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<!--copyright (c) 2017, 2018 The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
<!-- NFC HAL service -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>INfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.nxp.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>INqNfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- secure element -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.secure_element</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>ISecureElement</name>
|
||||
<instance>eSE1</instance>
|
||||
<instance>SIM1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- eSEPowerManager -->
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.esepowermanager</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IEsePowerManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
70
configs/vintf/manifest_hcesimese.xml
Normal file
70
configs/vintf/manifest_hcesimese.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<!--copyright (c) 2017, 2018 The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
<!-- NFC HAL service -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>INfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.nxp.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>INqNfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- secure element -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.secure_element</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>ISecureElement</name>
|
||||
<instance>eSE1</instance>
|
||||
<instance>SIM1</instance>
|
||||
<instance>SIM2</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- eSEPowerManager -->
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.esepowermanager</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IEsePowerManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
636
configs/vintf/manifest_ravelin.xml
Normal file
636
configs/vintf/manifest_ravelin.xml
Normal file
@@ -0,0 +1,636 @@
|
||||
<!--
|
||||
Input:
|
||||
manifest_ravelin.xml
|
||||
manifest.xml
|
||||
-->
|
||||
<manifest version="4.0" type="device" target-level="6">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>7.0</version>
|
||||
<interface>
|
||||
<name>IDevicesFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@7.0::IDevicesFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio.effect</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>7.0</version>
|
||||
<interface>
|
||||
<name>IEffectsFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@7.0::IEffectsFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.bluetooth</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IBluetoothHci</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IBluetoothHci/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.camera.provider</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.7</version>
|
||||
<interface>
|
||||
<name>ICameraProvider</name>
|
||||
<instance>legacy/1</instance>
|
||||
</interface>
|
||||
<fqname>@2.7::ICameraProvider/legacy/1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.drm</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.3::ICryptoFactory/wfdhdcp</fqname>
|
||||
<fqname>@1.3::IDrmFactory/wfdhdcp</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gatekeeper</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IGatekeeper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IGatekeeper/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.ir</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IConsumerIr</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IConsumerIr/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.keymaster</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@4.1::IKeymasterDevice/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.2::ISap/slot1</fqname>
|
||||
<fqname>@1.2::ISap/slot2</fqname>
|
||||
<fqname>@1.6::IRadio/slot1</fqname>
|
||||
<fqname>@1.6::IRadio/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio.config</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.3</version>
|
||||
<interface>
|
||||
<name>IRadioConfig</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.3::IRadioConfig/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.config</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOffloadConfig</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IOffloadConfig/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.control</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IOffloadControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IOffloadControl/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.dsi.ant</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAnt</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IAnt/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.dpm.api</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IdpmQmi</name>
|
||||
<instance>dpmQmiService</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IdpmQmi/dpmQmiService</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.imscmservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.2</version>
|
||||
<interface>
|
||||
<name>IImsCmService</name>
|
||||
<instance>qti.ims.connectionmanagerservice</instance>
|
||||
</interface>
|
||||
<fqname>@2.2::IImsCmService/qti.ims.connectionmanagerservice</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.uceservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.3</version>
|
||||
<interface>
|
||||
<name>IUceService</name>
|
||||
<instance>com.qualcomm.qti.uceservice</instance>
|
||||
</interface>
|
||||
<fqname>@2.3::IUceService/com.qualcomm.qti.uceservice</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.goodix.hardware.biometrics.fingerprint</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemon</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemonExt</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.1::IGoodixFingerprintDaemon/default</fqname>
|
||||
<fqname>@2.1::IGoodixFingerprintDaemonExt/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.data.factory</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.5</version>
|
||||
<interface>
|
||||
<name>IFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.5::IFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.AGMIPC</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAGM</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IAGM/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.alarm</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAlarm</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IAlarm/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.bluetooth_audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IBluetoothAudioProvidersFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.1::IBluetoothAudioProvidersFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.bluetooth_sar</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IBluetoothSar</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IBluetoothSar/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.btconfigstore</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IBTConfigStore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.0::IBTConfigStore/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.cacert</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IService/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.camera.postproc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IPostProcService</name>
|
||||
<instance>camerapostprocservice</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IPostProcService/camerapostprocservice</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.capabilityconfigstore</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ICapabilityConfigStore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::ICapabilityConfigStore/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.data.connection</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IDataConnection</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IDataConnection/slot1</fqname>
|
||||
<fqname>@1.1::IDataConnection/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.data.iwlan</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IIWlan</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IIWlan/slot1</fqname>
|
||||
<fqname>@1.1::IIWlan/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.data.latency</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ILinkLatency</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::ILinkLatency/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.dpmservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IDpmService</name>
|
||||
<instance>DpmService</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IDpmService/DpmService</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.dsp</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDspService</name>
|
||||
<instance>dspservice</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IDspService/dspservice</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.embmssl</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IEmbms</name>
|
||||
<instance>embmsslServer0</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IEmbms/embmsslServer0</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.factory</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.fm</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IFmHci</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IFmHci/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.iop</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IIop</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.0::IIop/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.mwqemadapter</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMwqemAdapter</name>
|
||||
<instance>MwqemAdapter</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IMwqemAdapter/MwqemAdapter</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.pal</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IPAL</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IPAL/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.qccvndhal</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQccvndhal</name>
|
||||
<instance>qccvndhal</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IQccvndhal/qccvndhal</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.qseecom</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQSEECom</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IQSEECom/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.qteeconnector</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAppConnector</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IGPAppConnector</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IAppConnector/default</fqname>
|
||||
<fqname>@1.0::IGPAppConnector/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.am</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQcRilAudio</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IQcRilAudio/slot1</fqname>
|
||||
<fqname>@1.0::IQcRilAudio/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.internal.deviceinfo</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDeviceInfo</name>
|
||||
<instance>deviceinfo</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IDeviceInfo/deviceinfo</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.lpa</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>IUimLpa</name>
|
||||
<instance>UimLpa0</instance>
|
||||
<instance>UimLpa1</instance>
|
||||
</interface>
|
||||
<fqname>@1.2::IUimLpa/UimLpa0</fqname>
|
||||
<fqname>@1.2::IUimLpa/UimLpa1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.qcriNvOpt</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IqcriNvOpt</name>
|
||||
<instance>qcrinvopt0</instance>
|
||||
<instance>qcrinvopt1</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IqcriNvOpt/qcrinvopt0</fqname>
|
||||
<fqname>@1.0::IqcriNvOpt/qcrinvopt1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.qcrilhook</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQtiOemHook</name>
|
||||
<instance>oemhook0</instance>
|
||||
<instance>oemhook1</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IQtiOemHook/oemhook0</fqname>
|
||||
<fqname>@1.0::IQtiOemHook/oemhook1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.qtiradio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQtiRadio</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IQtiRadio/slot1</fqname>
|
||||
<fqname>@1.0::IQtiRadio/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.qtiradio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.6</version>
|
||||
<interface>
|
||||
<name>IQtiRadio</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
<fqname>@2.6::IQtiRadio/slot1</fqname>
|
||||
<fqname>@2.6::IQtiRadio/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.uim</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>IUim</name>
|
||||
<instance>Uim0</instance>
|
||||
<instance>Uim1</instance>
|
||||
</interface>
|
||||
<fqname>@1.2::IUim/Uim0</fqname>
|
||||
<fqname>@1.2::IUim/Uim1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.uim_remote_client</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUimRemoteServiceClient</name>
|
||||
<instance>uimRemoteClient0</instance>
|
||||
<instance>uimRemoteClient1</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IUimRemoteServiceClient/uimRemoteClient0</fqname>
|
||||
<fqname>@1.0::IUimRemoteServiceClient/uimRemoteClient1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.uim_remote_server</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUimRemoteServiceServer</name>
|
||||
<instance>uimRemoteServer0</instance>
|
||||
<instance>uimRemoteServer1</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IUimRemoteServiceServer/uimRemoteServer0</fqname>
|
||||
<fqname>@1.0::IUimRemoteServiceServer/uimRemoteServer1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.secureprocessor.device</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISecureProcessor</name>
|
||||
<instance>qti-tee</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::ISecureProcessor/qti-tee</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.sensorscalibrate</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensorsCalibrate</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::ISensorsCalibrate/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.soter</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISoter</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::ISoter/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.wifi.wifilearner</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IWifiStats</name>
|
||||
<instance>wifiStats</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IWifiStats/wifiStats</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.wifidisplaysession</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IWifiDisplaySession</name>
|
||||
<instance>wifidisplaysession</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IWifiDisplaySessionAudioTrack</name>
|
||||
<instance>wifidisplaysessionaudiotrack</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IWifiDisplaySessionImageTrack</name>
|
||||
<instance>wifidisplaysessionimagetrack</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IWifiDisplaySessionVideoTrack</name>
|
||||
<instance>wifidisplaysessionvideotrack</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IWifiDisplaySession/wifidisplaysession</fqname>
|
||||
<fqname>@1.0::IWifiDisplaySessionAudioTrack/wifidisplaysessionaudiotrack</fqname>
|
||||
<fqname>@1.0::IWifiDisplaySessionImageTrack/wifidisplaysessionimagetrack</fqname>
|
||||
<fqname>@1.0::IWifiDisplaySessionVideoTrack/wifidisplaysessionvideotrack</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.ims.callinfo</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IService/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.ims.factory</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IImsFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.1::IImsFactory/default</fqname>
|
||||
<fqname>@2.1::IImsFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.imsrtpservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>3.0</version>
|
||||
<interface>
|
||||
<name>IRTPService</name>
|
||||
<instance>imsrtpservice</instance>
|
||||
</interface>
|
||||
<fqname>@3.0::IRTPService/imsrtpservice</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.qspmhal</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQspmhal</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IQspmhal/default</fqname>
|
||||
</hal>
|
||||
<kernel target-level="6"/>
|
||||
</manifest>
|
||||
1194
configs/vintf/vendor_framework_compatibility_matrix.xml
Normal file
1194
configs/vintf/vendor_framework_compatibility_matrix.xml
Normal file
File diff suppressed because it is too large
Load Diff
38
configs/vintf/xiaomi_framework_compatibility_matrix.xml
Normal file
38
configs/vintf/xiaomi_framework_compatibility_matrix.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<!--
|
||||
Copyright (C) 2023 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<compatibility-matrix version="1.0" type="framework">
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.mfidoca</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IFidoService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.mlipay</name>
|
||||
<version>1.0-1</version>
|
||||
<interface>
|
||||
<name>IMlipayService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.mtdservice</name>
|
||||
<version>1.0-3</version>
|
||||
<interface>
|
||||
<name>IMTService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.tidaservice</name>
|
||||
<version>1.0-2</version>
|
||||
<interface>
|
||||
<name>ITidaService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
||||
441
device.mk
441
device.mk
@@ -6,33 +6,113 @@
|
||||
|
||||
DEVICE_PATH := device/xiaomi/sky
|
||||
|
||||
# SHIPPING API
|
||||
PRODUCT_SHIPPING_API_LEVEL := 31
|
||||
# Inherit virtual_ab_ota_product.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
|
||||
|
||||
# VNDK API
|
||||
PRODUCT_TARGET_VNDK_VERSION := 32
|
||||
PRODUCT_EXTRA_VNDK_VERSIONS := 32
|
||||
# Installs gsi keys into ramdisk, to boot a developer GSI with verified boot.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
|
||||
|
||||
# Call the proprietary setup.
|
||||
$(call inherit-product, vendor/xiaomi/sky/sky-vendor.mk)
|
||||
|
||||
# Add common definitions for Qualcomm
|
||||
$(call inherit-product, hardware/qcom-caf/common/common.mk)
|
||||
|
||||
# Enable updating of APEXes.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
|
||||
|
||||
# Project ID Quota.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
|
||||
|
||||
QCV_FAMILY_SKUS := parrot ravelin
|
||||
|
||||
# AAPT
|
||||
PRODUCT_AAPT_CONFIG := normal
|
||||
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
|
||||
|
||||
# A/B
|
||||
AB_OTA_POSTINSTALL_CONFIG += \
|
||||
RUN_POSTINSTALL_system=true \
|
||||
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
|
||||
FILESYSTEM_TYPE_system=erofs \
|
||||
FILESYSTEM_TYPE_system=ext4 \
|
||||
POSTINSTALL_OPTIONAL_system=true
|
||||
|
||||
AB_OTA_POSTINSTALL_CONFIG += \
|
||||
RUN_POSTINSTALL_vendor=true \
|
||||
POSTINSTALL_PATH_vendor=bin/checkpoint_gc \
|
||||
FILESYSTEM_TYPE_vendor=erofs \
|
||||
FILESYSTEM_TYPE_vendor=ext4 \
|
||||
POSTINSTALL_OPTIONAL_vendor=true
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
checkpoint_gc \
|
||||
otapreopt_script
|
||||
|
||||
# Audio
|
||||
SOONG_CONFIG_NAMESPACES += android_hardware_audio
|
||||
SOONG_CONFIG_android_hardware_audio += run_64bit
|
||||
SOONG_CONFIG_android_hardware_audio_run_64bit := true
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.audio@7.0-impl:64 \
|
||||
android.hardware.audio.effect@7.0-impl:64 \
|
||||
android.hardware.audio.service \
|
||||
android.hardware.soundtrigger@2.3-impl:64 \
|
||||
vendor.qti.hardware.AGMIPC@1.0-service \
|
||||
vendor.qti.hardware.pal@1.0-impl:64
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
audio.bluetooth.default:64 \
|
||||
audio.r_submix.default:64 \
|
||||
audio.usb.default:64 \
|
||||
sound_trigger.primary.parrot:64
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
audioadsprpcd
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libagm_compress_plugin:64 \
|
||||
libagm_mixer_plugin:64 \
|
||||
libagm_pcm_plugin:64 \
|
||||
libagmclient:64 \
|
||||
libagmmixer:64 \
|
||||
libbatterylistener:64 \
|
||||
libfmpal:64 \
|
||||
libpalclient:64 \
|
||||
libqcompostprocbundle:64 \
|
||||
libqcomvisualizer:64 \
|
||||
libqcomvoiceprocessing:64 \
|
||||
libsndcardparser:64 \
|
||||
libvolumelistener:64
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
|
||||
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
|
||||
frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
|
||||
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
|
||||
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \
|
||||
frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
|
||||
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_ravelin/audio_effects.xml \
|
||||
$(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_ravelin/audio_policy_configuration.xml \
|
||||
$(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_ravelin_qssi/audio_policy_configuration.xml
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.bluetooth.audio-impl:64
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
|
||||
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml
|
||||
|
||||
# Boot animation
|
||||
TARGET_BOOT_ANIMATION_RES := 1080
|
||||
|
||||
# Boot control
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.boot@1.2-impl-qti \
|
||||
android.hardware.boot@1.2-impl-qti.recovery \
|
||||
android.hardware.boot@1.2-impl-qti:64 \
|
||||
android.hardware.boot@1.2-impl-qti.recovery:64 \
|
||||
android.hardware.boot@1.2-service \
|
||||
bootctrl.parrot \
|
||||
bootctrl.parrot.recovery
|
||||
@@ -40,21 +120,119 @@ PRODUCT_PACKAGES += \
|
||||
PRODUCT_PACKAGES_DEBUG += \
|
||||
bootctl
|
||||
|
||||
# Dtb
|
||||
# Camera
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/prebuilts/dtb:dtb.img
|
||||
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml
|
||||
|
||||
# Dalvik heap
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
dalvik.vm.heapstartsize=8m \
|
||||
dalvik.vm.heapsize=256m \
|
||||
dalvik.vm.heapgrowthlimit=128m \
|
||||
dalvik.vm.heaptargetutilization=0.75 \
|
||||
dalvik.vm.heapminfree=512k \
|
||||
dalvik.vm.heapmaxfree=8m
|
||||
|
||||
# Device Settings
|
||||
PRODUCT_PACKAGES += \
|
||||
XiaomiParts
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/parts/init.xiaomiparts.rc:$(TARGET_COPY_OUT_PRODUCT)/etc/init/init.xiaomiparts.rc
|
||||
|
||||
PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||
persist.lcd.cabc_mode=1
|
||||
|
||||
# Dex
|
||||
PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := verify
|
||||
|
||||
# Display
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.graphics.mapper@4.0-impl-qti-display \
|
||||
vendor.qti.hardware.display.allocator-service \
|
||||
vendor.qti.hardware.display.composer-service
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
init.qti.display_boot.rc \
|
||||
init.qti.display_boot.sh
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
hardware/qcom-caf/sm8450/display/config/snapdragon_color_libs_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/snapdragon_color_libs_config.xml
|
||||
|
||||
# DRM
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm-service.clearkey
|
||||
|
||||
# Fastbootd
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.fastboot@1.1-impl-mock \
|
||||
fastbootd
|
||||
|
||||
# Fingerprint
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.biometrics.fingerprint@2.3-service.xiaomi
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
|
||||
|
||||
# FM
|
||||
PRODUCT_PACKAGES += \
|
||||
FM2 \
|
||||
qcom.fmradio
|
||||
|
||||
# F2FS utilities
|
||||
PRODUCT_PACKAGES += \
|
||||
sg_write_buffer \
|
||||
f2fs_io \
|
||||
check_f2fs
|
||||
|
||||
# GPS
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gnss@2.1-impl-qti:64 \
|
||||
android.hardware.gnss-aidl-impl-qti:64 \
|
||||
android.hardware.gnss-aidl-service-qti
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libbatching:64 \
|
||||
libgeofencing:64 \
|
||||
libgnss:64
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
apdr.conf \
|
||||
batching.conf \
|
||||
gnss_antenna_info.conf \
|
||||
gps.conf \
|
||||
izat.conf \
|
||||
lowi.conf \
|
||||
sap.conf
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
gnss@2.0-base.policy \
|
||||
gnss@2.0-xtra-daemon.policy
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute-0.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level-1.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version-1_1.xml \
|
||||
frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \
|
||||
frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml
|
||||
|
||||
# Health
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.health-service.qti \
|
||||
android.hardware.health-service.qti_recovery
|
||||
|
||||
# Hotword Enrollement
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/configs/privapp-permissions-hotword.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-hotword.xml
|
||||
|
||||
# Input
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/configs/idc/uinput-fpc.idc:$(TARGET_COPY_OUT_SYSTEM)/usr/idc/uinput-fpc.idc \
|
||||
@@ -62,6 +240,76 @@ PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/configs/keylayout/uinput-fpc.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/uinput-fpc.kl \
|
||||
$(DEVICE_PATH)/configs/keylayout/uinput-goodix.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/uinput-goodix.kl
|
||||
|
||||
# IPACM
|
||||
PRODUCT_PACKAGES += \
|
||||
ipacm \
|
||||
IPACM_cfg.xml \
|
||||
IPACM_Filter_cfg.xml
|
||||
|
||||
# IR
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.ir@1.0-impl:64 \
|
||||
android.hardware.ir@1.0-service
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.software.device_id_attestation.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_id_attestation.xml
|
||||
|
||||
# Lineage Health
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.health-service.default
|
||||
|
||||
# NFC
|
||||
PRODUCT_PACKAGES += \
|
||||
NfcNci
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/android.hardware.nfc.uicc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/com.android.nfc_extras.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/com.nxp.mifare.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/android.hardware.nfc.uicc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/com.android.nfc_extras.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/com.nxp.mifare.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.nfc.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.nfc.uicc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/com.android.nfc_extras.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/com.nxp.mifare.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.nfc.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.nfc.uicc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/com.android.nfc_extras.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/com.nxp.mifare.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/android.hardware.nfc.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/com.android.nfc_extras.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/com.nxp.mifare.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml
|
||||
|
||||
# Overlays
|
||||
DEVICE_PACKAGE_OVERLAYS += \
|
||||
$(DEVICE_PATH)/overlay-lineage
|
||||
@@ -69,22 +317,30 @@ DEVICE_PACKAGE_OVERLAYS += \
|
||||
# Partitions
|
||||
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||
|
||||
# Properties
|
||||
include $(DEVICE_PATH)/configs/properties/default.mk
|
||||
|
||||
# RIL
|
||||
# Power
|
||||
PRODUCT_PACKAGES += \
|
||||
Ims \
|
||||
QtiTelephony
|
||||
android.hardware.power-service.lineage-libperfmgr \
|
||||
libqti-perfd-client
|
||||
|
||||
# Perf
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.perf@2.3
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
|
||||
|
||||
# Rootdir
|
||||
PRODUCT_PACKAGES += \
|
||||
init.recovery.qcom.rc \
|
||||
init.recovery.usb.rc
|
||||
charger_fw_fstab.qti \
|
||||
fstab.default \
|
||||
init.class_main.sh \
|
||||
init.kernel.post_boot.sh \
|
||||
init.sky.rc \
|
||||
init.qcom.class_core.sh \
|
||||
init.qcom.early_boot.sh \
|
||||
init.qcom.post_boot.sh \
|
||||
init.qcom.rc \
|
||||
init.qcom.sh \
|
||||
init.target.rc \
|
||||
ueventd.qcom.rc \
|
||||
ueventd-odm.rc \
|
||||
init.recovery.qcom.rc
|
||||
|
||||
# RRO Overlays
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -97,13 +353,56 @@ PRODUCT_PACKAGES += \
|
||||
WifiResCommon \
|
||||
WifiResTarget
|
||||
|
||||
# Power
|
||||
# Remove unwanted packages
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.power-service-qti
|
||||
RemovePackages
|
||||
|
||||
# Secure element
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/android.hardware.se.omapi.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hceese/android.hardware.se.omapi.uicc.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim/android.hardware.se.omapi.uicc.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1/android.hardware.se.omapi.uicc.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.se.omapi.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesim1ese/android.hardware.se.omapi.uicc.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.se.omapi.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_hcesimese/android.hardware.se.omapi.uicc.xml
|
||||
|
||||
# Sensors
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.sensors-service.xiaomi-multihal
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.accelerometer.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.compass.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.gyroscope.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.light.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.proximity.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.stepcounter.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_ravelin/android.hardware.sensor.stepdetector.xml
|
||||
|
||||
# SHIPPING API
|
||||
PRODUCT_SHIPPING_API_LEVEL := 31
|
||||
|
||||
# Soong namespaces
|
||||
PRODUCT_SOONG_NAMESPACES += \
|
||||
$(DEVICE_PATH)
|
||||
$(DEVICE_PATH) \
|
||||
hardware/lineage/interfaces/power-libperfmgr \
|
||||
hardware/google \
|
||||
hardware/google/interfaces \
|
||||
hardware/google/pixel \
|
||||
hardware/google/pixel/power-libperfmgr/libperfmgr \
|
||||
hardware/qcom-caf/common/libqti-perfd-client \
|
||||
hardware/qcom-caf/sm8450/audio/agm/ipc/HwBinders/legacy \
|
||||
hardware/xiaomi
|
||||
|
||||
# Telephony
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -121,10 +420,27 @@ PRODUCT_PACKAGES += \
|
||||
qti-telephony-utils-prd \
|
||||
qti_telephony_utils.xml \
|
||||
qti_telephony_utils_prd.xml \
|
||||
telephony-ext
|
||||
telephony-ext \
|
||||
xiaomi-telephony-stub
|
||||
|
||||
PRODUCT_BOOT_JARS += \
|
||||
telephony-ext
|
||||
telephony-ext \
|
||||
xiaomi-telephony-stub
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml \
|
||||
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml
|
||||
|
||||
|
||||
# Thermal
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.thermal-service.qti
|
||||
|
||||
# Touchscreen
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
|
||||
|
||||
# Update engine
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -136,3 +452,74 @@ PRODUCT_PACKAGES += \
|
||||
|
||||
PRODUCT_PACKAGES_DEBUG += \
|
||||
update_engine_client
|
||||
|
||||
# USB
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.usb-service.qti \
|
||||
android.hardware.usb.gadget-service.qti
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
init.qcom.usb.rc \
|
||||
init.qcom.usb.sh \
|
||||
usb_compositions.conf
|
||||
|
||||
PRODUCT_SOONG_NAMESPACES += vendor/qcom/opensource/usb/etc
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
|
||||
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml
|
||||
|
||||
# VENDOR API
|
||||
BOARD_SHIPPING_API_LEVEL := 31
|
||||
|
||||
# Vendor service manager
|
||||
PRODUCT_PACKAGES += \
|
||||
vndservicemanager
|
||||
|
||||
# Verified boot
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml
|
||||
|
||||
# Vibrator
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.vibrator.service
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
|
||||
|
||||
# VNDK
|
||||
PRODUCT_PACKAGES += \
|
||||
libstdc++_vendor
|
||||
|
||||
# Wi-Fi
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi-service \
|
||||
android.hardware.wifi.hostapd@1.0.vendor \
|
||||
wpa_cli \
|
||||
libwpa_client:64 \
|
||||
hostapd \
|
||||
libwifi-hal-qcom:64 \
|
||||
wpa_supplicant \
|
||||
wpa_supplicant.conf
|
||||
|
||||
# WiFi firmware symlinks
|
||||
PRODUCT_PACKAGES += \
|
||||
symlink_wlan_cfg_adrastea \
|
||||
symlink_wlan_fw_adrastea
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(DEVICE_PATH)/configs/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/adrastea/WCNSS_qcom_cfg.ini
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.rtt.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.rtt.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml
|
||||
|
||||
# WiFi Display
|
||||
PRODUCT_PACKAGES += \
|
||||
libnl \
|
||||
libwfdaac_vendor
|
||||
|
||||
|
||||
|
||||
142
extract-files.py
Normal file
142
extract-files.py
Normal file
@@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
import extract_utils.tools
|
||||
extract_utils.tools.DEFAULT_PATCHELF_VERSION = '0_17_2'
|
||||
|
||||
from extract_utils.fixups_blob import (
|
||||
blob_fixup,
|
||||
blob_fixups_user_type,
|
||||
)
|
||||
from extract_utils.fixups_lib import (
|
||||
lib_fixup_remove,
|
||||
lib_fixups,
|
||||
lib_fixups_user_type,
|
||||
)
|
||||
from extract_utils.main import (
|
||||
ExtractUtils,
|
||||
ExtractUtilsModule,
|
||||
)
|
||||
|
||||
namespace_imports = [
|
||||
'device/xiaomi/sky',
|
||||
'hardware/qcom-caf/sm8450',
|
||||
'hardware/qcom-caf/sm8450/audio/agm/ipc/HwBinders/legacy',
|
||||
'hardware/qcom-caf/wlan',
|
||||
'hardware/xiaomi',
|
||||
'vendor/qcom/opensource/commonsys/display',
|
||||
'vendor/qcom/opensource/commonsys-intf/display',
|
||||
'vendor/qcom/opensource/dataservices',
|
||||
]
|
||||
|
||||
|
||||
def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
|
||||
return f'{lib}_{partition}' if partition == 'vendor' else None
|
||||
|
||||
|
||||
lib_fixups: lib_fixups_user_type = {
|
||||
**lib_fixups,
|
||||
(
|
||||
'vendor.qti.hardware.dpmservice@1.0',
|
||||
'vendor.qti.hardware.dpmservice@1.1',
|
||||
'vendor.qti.hardware.fm@1.0',
|
||||
'vendor.qti.hardware.qccsyshal@1.0',
|
||||
'vendor.qti.hardware.qccsyshal@1.1',
|
||||
'vendor.qti.hardware.qccvndhal@1.0',
|
||||
'vendor.qti.imsrtpservice@3.0',
|
||||
'vendor.qti.diaghal@1.0',
|
||||
'vendor.qti.hardware.wifidisplaysession@1.0',
|
||||
'com.qualcomm.qti.dpm.api@1.0',
|
||||
): lib_fixup_vendor_suffix,
|
||||
(
|
||||
'libagm',
|
||||
'libagmclient',
|
||||
'libagmmixer',
|
||||
'libar-pal',
|
||||
'libpalclient',
|
||||
'libsndcardparser',
|
||||
'libwpa_client',
|
||||
'vendor.qti.hardware.pal@1.0-impl',
|
||||
): lib_fixup_remove,
|
||||
}
|
||||
|
||||
blob_fixups: blob_fixups_user_type = {
|
||||
'system_ext/lib64/libwfdmmsrc_system.so': blob_fixup()
|
||||
.add_needed('libgui_shim.so'),
|
||||
'system_ext/lib64/libwfdnative.so': blob_fixup()
|
||||
.add_needed('libinput_shim.so'),
|
||||
'system_ext/lib64/libwfdservice.so': blob_fixup()
|
||||
.replace_needed(
|
||||
'android.media.audio.common.types-V2-cpp.so',
|
||||
'android.media.audio.common.types-V3-cpp.so',
|
||||
),
|
||||
(
|
||||
'vendor/bin/hw/android.hardware.security.keymint-service-qti',
|
||||
'vendor/lib64/libqtikeymint.so',
|
||||
): blob_fixup()
|
||||
.replace_needed(
|
||||
'android.hardware.security.keymint-V1-ndk_platform.so',
|
||||
'android.hardware.security.keymint-V1-ndk.so',
|
||||
)
|
||||
.replace_needed(
|
||||
'android.hardware.security.secureclock-V1-ndk_platform.so',
|
||||
'android.hardware.security.secureclock-V1-ndk.so',
|
||||
)
|
||||
.replace_needed(
|
||||
'android.hardware.security.sharedsecret-V1-ndk_platform.so',
|
||||
'android.hardware.security.sharedsecret-V1-ndk.so',
|
||||
)
|
||||
.add_needed('android.hardware.security.rkp-V1-ndk.so'),
|
||||
'vendor/bin/qcc-trd': blob_fixup()
|
||||
.replace_needed(
|
||||
'libgrpc++_unsecure.so', 'libgrpc++_unsecure_prebuilt.so'
|
||||
),
|
||||
'vendor/lib64/hw/fingerprint.fpc.default.so': blob_fixup()
|
||||
.replace_needed(
|
||||
'com.fingerprints.extension@1.0.so', 'com.fingerprints.extension@1.0_vendor.so'
|
||||
),
|
||||
'vendor/lib64/hw/fingerprint.goodix.default.so': blob_fixup()
|
||||
.fix_soname(),
|
||||
'vendor/lib64/libcamximageformatutils.so': blob_fixup()
|
||||
.replace_needed(
|
||||
'vendor.qti.hardware.display.config-V2-ndk_platform.so', 'vendor.qti.hardware.display.config-V2-ndk.so'
|
||||
),
|
||||
'vendor/lib64/libhme.so': blob_fixup()
|
||||
.replace_needed(
|
||||
'libstdc++.so', 'libstdc++_vendor.so'
|
||||
),
|
||||
'vendor/lib64/libimp.so': blob_fixup()
|
||||
.replace_needed(
|
||||
'libjnigraphics.so', 'libjnigraphics_prebuilt.so'
|
||||
),
|
||||
'vendor/lib64/libopencv_java4.so': blob_fixup()
|
||||
.replace_needed(
|
||||
'libjnigraphics.so', 'libjnigraphics_prebuilt.so'
|
||||
),
|
||||
'vendor/etc/media_codecs_ravelin.xml': blob_fixup()
|
||||
.regex_replace('.+media_codecs_(google_audio|google_c2|google_telephony|vendor_audio).+\n', ''),
|
||||
'vendor/etc/seccomp_policy/atfwd@2.0.policy': blob_fixup()
|
||||
.add_line_if_missing('gettid: 1'),
|
||||
'vendor/etc/seccomp_policy/c2audio.vendor.ext-arm64.policy': blob_fixup()
|
||||
.add_line_if_missing('setsockopt: 1'),
|
||||
'vendor/etc/seccomp_policy/wfdhdcphalservice.policy': blob_fixup()
|
||||
.add_line_if_missing('gettid: 1'),
|
||||
'vendor/lib64/vendor.libdpmframework.so': blob_fixup()
|
||||
.add_needed('libhidlbase_shim.so'),
|
||||
} # fmt: skip
|
||||
|
||||
module = ExtractUtilsModule(
|
||||
'sky',
|
||||
'xiaomi',
|
||||
blob_fixups=blob_fixups,
|
||||
lib_fixups=lib_fixups,
|
||||
namespace_imports=namespace_imports,
|
||||
check_elf=True,
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
utils = ExtractUtils.device(module)
|
||||
utils.run()
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017-2020 The LineageOS Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
DEVICE=sky
|
||||
VENDOR=xiaomi
|
||||
|
||||
# Load extract_utils and do some sanity checks
|
||||
MY_DIR="${BASH_SOURCE%/*}"
|
||||
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
|
||||
|
||||
ANDROID_ROOT="${MY_DIR}/../../.."
|
||||
|
||||
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
|
||||
if [ ! -f "${HELPER}" ]; then
|
||||
echo "Unable to find helper script at ${HELPER}"
|
||||
exit 1
|
||||
fi
|
||||
source "${HELPER}"
|
||||
|
||||
# Default to sanitizing the vendor folder before extraction
|
||||
CLEAN_VENDOR=true
|
||||
|
||||
KANG=
|
||||
SECTION=
|
||||
|
||||
while [ "${#}" -gt 0 ]; do
|
||||
case "${1}" in
|
||||
-n | --no-cleanup)
|
||||
CLEAN_VENDOR=false
|
||||
;;
|
||||
-k | --kang)
|
||||
KANG="--kang"
|
||||
;;
|
||||
-s | --section)
|
||||
SECTION="${2}"
|
||||
shift
|
||||
CLEAN_VENDOR=false
|
||||
;;
|
||||
*)
|
||||
SRC="${1}"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "${SRC}" ]; then
|
||||
SRC="adb"
|
||||
fi
|
||||
|
||||
# Initialize the helper
|
||||
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
|
||||
|
||||
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
|
||||
|
||||
"${MY_DIR}/setup-makefiles.sh"
|
||||
50
gps/Android.bp
Normal file
50
gps/Android.bp
Normal file
@@ -0,0 +1,50 @@
|
||||
GNSS_CFLAGS = [
|
||||
"-Werror",
|
||||
"-Wformat",
|
||||
"-Wformat-extra-args",
|
||||
"-Wunused-label",
|
||||
"-Wunused-variable",
|
||||
"-Wunused-function",
|
||||
"-Wimplicit-fallthrough",
|
||||
"-Wno-unused-parameter",
|
||||
"-Wno-undefined-bool-conversion",
|
||||
]
|
||||
|
||||
soong_config_module_type {
|
||||
name: "qtilocation_cc_defaults",
|
||||
module_type: "cc_defaults",
|
||||
config_namespace: "qtilocation",
|
||||
bool_variables: [
|
||||
"feature_nhz",
|
||||
],
|
||||
properties: [
|
||||
"cflags",
|
||||
],
|
||||
}
|
||||
|
||||
qtilocation_cc_defaults {
|
||||
name: "qtilocation_common_defaults",
|
||||
cflags: GNSS_CFLAGS,
|
||||
soong_config_variables: {
|
||||
feature_nhz: {
|
||||
cflags: ["-DFEATURE_NHZ_ENABLED"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
/* Activate the following for debug purposes only,
|
||||
comment out for production */
|
||||
GNSS_SANITIZE_DIAG = {
|
||||
/*
|
||||
diag: {
|
||||
cfi: true,
|
||||
misc_undefined: [
|
||||
"bounds",
|
||||
"null",
|
||||
"unreachable",
|
||||
"integer",
|
||||
],
|
||||
},
|
||||
*/
|
||||
}
|
||||
40
gps/Android.mk
Normal file
40
gps/Android.mk
Normal file
@@ -0,0 +1,40 @@
|
||||
ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
|
||||
# Set required flags
|
||||
GNSS_CFLAGS := \
|
||||
-Werror \
|
||||
-Wformat \
|
||||
-Wformat-extra-args \
|
||||
-Wunused-label \
|
||||
-Wunused-variable \
|
||||
-Wunused-function \
|
||||
-Wimplicit-fallthrough \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-undefined-bool-conversion
|
||||
|
||||
GNSS_HIDL_VERSION := 2.1
|
||||
GNSS_AIDL_VERSION := 1
|
||||
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8937
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660
|
||||
|
||||
ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM)))
|
||||
GNSS_HIDL_LEGACY_MEASURMENTS := true
|
||||
endif
|
||||
|
||||
# Enable NHz location feature. Default is false.
|
||||
# Set this flag to true to enable the NHz location feature.
|
||||
FEATURE_NHZ_ENABLED := false
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
||||
GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address
|
||||
|
||||
endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
50
gps/CleanSpec.mk
Normal file
50
gps/CleanSpec.mk
Normal file
@@ -0,0 +1,50 @@
|
||||
# Copyright (C) 2007 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# If you don't need to do a full clean build but would like to touch
|
||||
# a file or delete some intermediate files, add a clean step to the end
|
||||
# of the list. These steps will only be run once, if they haven't been
|
||||
# run before.
|
||||
#
|
||||
# E.g.:
|
||||
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
|
||||
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
|
||||
#
|
||||
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
|
||||
# files that are missing or have been moved.
|
||||
#
|
||||
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
|
||||
# Use $(OUT_DIR) to refer to the "out" directory.
|
||||
#
|
||||
# If you need to re-do something that's already mentioned, just copy
|
||||
# the command and add it to the bottom of the list. E.g., if a change
|
||||
# that you made last week required touching a file and a change you
|
||||
# made today requires touching the same file, just copy the old
|
||||
# touch step and add it to the end of the list.
|
||||
#
|
||||
# ************************************************
|
||||
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||
# ************************************************
|
||||
|
||||
# For example:
|
||||
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
|
||||
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
|
||||
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
|
||||
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
|
||||
|
||||
# ************************************************
|
||||
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||
# ************************************************
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*)
|
||||
10
gps/Makefile.am
Normal file
10
gps/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
||||
# Makefile.am - Automake script for gps loc_api
|
||||
#
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = gnss
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-hal.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
||||
208
gps/android/1.0/AGnss.cpp
Normal file
208
gps/android/1.0/AGnss.cpp
Normal file
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_AGnssInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "AGnss.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static AGnss* spAGnss = nullptr;
|
||||
|
||||
AGnss::AGnss(Gnss* gnss) : mGnss(gnss) {
|
||||
spAGnss = this;
|
||||
}
|
||||
|
||||
AGnss::~AGnss() {
|
||||
spAGnss = nullptr;
|
||||
}
|
||||
|
||||
void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){
|
||||
if (nullptr != spAGnss) {
|
||||
spAGnss->statusIpV4Cb(status);
|
||||
}
|
||||
}
|
||||
|
||||
void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
|
||||
IAGnssCallback::AGnssStatusIpV4 st = {};
|
||||
|
||||
switch (status.type) {
|
||||
case LOC_AGPS_TYPE_SUPL:
|
||||
st.type = IAGnssCallback::AGnssType::TYPE_SUPL;
|
||||
break;
|
||||
case LOC_AGPS_TYPE_C2K:
|
||||
st.type = IAGnssCallback::AGnssType::TYPE_C2K;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid type: %d", status.type);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (status.status) {
|
||||
case LOC_GPS_REQUEST_AGPS_DATA_CONN:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_RELEASE_AGPS_DATA_CONN:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONNECTED:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_DONE:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_FAILED:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid status: %d", status.status);
|
||||
return;
|
||||
}
|
||||
st.ipV4Addr = status.ipV4Addr;
|
||||
|
||||
mMutex.lock();
|
||||
auto aGnssCbIface = mAGnssCbIface;
|
||||
mMutex.unlock();
|
||||
if (aGnssCbIface != nullptr) {
|
||||
auto r = aGnssCbIface->agnssStatusIpV4Cb(st);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Save the interface
|
||||
mMutex.lock();
|
||||
mAGnssCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
AgpsCbInfo cbInfo = {};
|
||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||
cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES;
|
||||
|
||||
mGnss->getGnssInterface()->agpsInit(cbInfo);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnClosed() {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnFailed() {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnOpen(const hidl_string& apn,
|
||||
IAGnss::ApnIpType apnIpType) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Validate */
|
||||
if(apn.empty()){
|
||||
LOC_LOGE("Invalid APN");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str());
|
||||
|
||||
AGpsBearerType bearerType;
|
||||
switch (apnIpType) {
|
||||
case IAGnss::ApnIpType::IPV4:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
case IAGnss::ApnIpType::IPV6:
|
||||
bearerType = AGPS_APN_BEARER_IPV6;
|
||||
break;
|
||||
case IAGnss::ApnIpType::IPV4V6:
|
||||
bearerType = AGPS_APN_BEARER_IPV4V6;
|
||||
break;
|
||||
default:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnOpen(
|
||||
LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname,
|
||||
int32_t port) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
|
||||
config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
|
||||
if (type == IAGnssCallback::AGnssType::TYPE_SUPL) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL;
|
||||
} else if (type == IAGnssCallback::AGnssType::TYPE_C2K) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K;
|
||||
} else {
|
||||
LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast<int>(type));
|
||||
return false;
|
||||
}
|
||||
config.assistanceServer.hostName = strdup(hostname.c_str());
|
||||
config.assistanceServer.port = port;
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
81
gps/android/1.0/AGnss.h
Normal file
81
gps/android/1.0/AGnss.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IAGnss.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnss;
|
||||
using ::android::hardware::gnss::V1_0::IAGnssCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct AGnss : public IAGnss {
|
||||
|
||||
AGnss(Gnss* gnss);
|
||||
~AGnss();
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow.
|
||||
* These declarations were generated from IAGnss.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IAGnssCallback>& callback) override;
|
||||
|
||||
Return<bool> dataConnClosed() override;
|
||||
|
||||
Return<bool> dataConnFailed() override;
|
||||
|
||||
Return<bool> dataConnOpen(const hidl_string& apn,
|
||||
IAGnss::ApnIpType apnIpType) override;
|
||||
|
||||
Return<bool> setServer(IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname, int32_t port) override;
|
||||
|
||||
void statusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
/* Data call setup callback passed down to GNSS HAL implementation */
|
||||
static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
std::mutex mMutex;
|
||||
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||
115
gps/android/1.0/AGnssRil.cpp
Normal file
115
gps/android/1.0/AGnssRil.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc__AGnssRilInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "Gnss.h"
|
||||
#include "AGnssRil.h"
|
||||
#include <DataItemConcreteTypes.h>
|
||||
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
}
|
||||
|
||||
AGnssRil::~AGnssRil() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
}
|
||||
|
||||
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
// Extra NetworkTypes not available in IAgnssRil enums
|
||||
const int NetworkType_BLUETOOTH = 7;
|
||||
const int NetworkType_ETHERNET = 9;
|
||||
const int NetworkType_PROXY = 16;
|
||||
std::string apn("");
|
||||
|
||||
// for XTRA
|
||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||
switch(type)
|
||||
{
|
||||
case IAGnssRil::NetworkType::MOBILE:
|
||||
typeout = loc_core::TYPE_MOBILE;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIFI:
|
||||
typeout = loc_core::TYPE_WIFI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::MMS:
|
||||
typeout = loc_core::TYPE_MMS;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::SUPL:
|
||||
typeout = loc_core::TYPE_SUPL;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::DUN:
|
||||
typeout = loc_core::TYPE_DUN;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::HIPRI:
|
||||
typeout = loc_core::TYPE_HIPRI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIMAX:
|
||||
typeout = loc_core::TYPE_WIMAX;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
int networkType = (int) type;
|
||||
// Handling network types not available in IAgnssRil
|
||||
switch(networkType)
|
||||
{
|
||||
case NetworkType_BLUETOOTH:
|
||||
typeout = loc_core::TYPE_BLUETOOTH;
|
||||
break;
|
||||
case NetworkType_ETHERNET:
|
||||
typeout = loc_core::TYPE_ETHERNET;
|
||||
break;
|
||||
case NetworkType_PROXY:
|
||||
typeout = loc_core::TYPE_PROXY;
|
||||
break;
|
||||
default:
|
||||
typeout = loc_core::TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout, false, 0, apn);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
83
gps/android/1.0/AGnssRil.h
Normal file
83
gps/android/1.0/AGnssRil.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
|
||||
#include <android/hardware/gnss/1.0/IAGnssRil.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRil;
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRilCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
/*
|
||||
* Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface
|
||||
* allows the GNSS chipset to request radio interface layer information from Android platform.
|
||||
* Examples of such information are reference location, unique subscriber ID, phone number string
|
||||
* and network availability changes. Also contains wrapper methods to allow methods from
|
||||
* IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL.
|
||||
*/
|
||||
struct AGnssRil : public IAGnssRil {
|
||||
AGnssRil(Gnss* gnss);
|
||||
~AGnssRil();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
|
||||
* These declarations were generated from IAGnssRil.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IAGnssRilCallback>& /*callback*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<void> setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<bool> setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override {
|
||||
return false;
|
||||
}
|
||||
Return<bool> updateNetworkAvailability(bool /*available*/,
|
||||
const hidl_string& /*apn*/) override {
|
||||
return false;
|
||||
}
|
||||
Return<bool> updateNetworkState(bool connected, NetworkType type, bool roaming) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
96
gps/android/1.0/Android.mk
Normal file
96
gps/android/1.0/Android.mk
Normal file
@@ -0,0 +1,96 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
|
||||
|
||||
# activate the following line for debug purposes only, comment out for production
|
||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_SRC_FILES := \
|
||||
AGnss.cpp \
|
||||
Gnss.cpp \
|
||||
GnssBatching.cpp \
|
||||
GnssGeofencing.cpp \
|
||||
GnssMeasurement.cpp \
|
||||
GnssNi.cpp \
|
||||
GnssConfiguration.cpp \
|
||||
GnssDebug.cpp \
|
||||
AGnssRil.cpp
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
location_api/LocationUtil.cpp \
|
||||
location_api/GnssAPIClient.cpp \
|
||||
location_api/GeofenceAPIClient.cpp \
|
||||
location_api/BatchingAPIClient.cpp \
|
||||
location_api/MeasurementAPIClient.cpp \
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers \
|
||||
liblocbatterylistener_headers
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libhidlbase \
|
||||
libcutils \
|
||||
libutils \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.health@1.0 \
|
||||
android.hardware.health@2.0 \
|
||||
android.hardware.health@2.1 \
|
||||
android.hardware.power@1.2 \
|
||||
libbase
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libloc_core \
|
||||
libgps.utils \
|
||||
libdl \
|
||||
liblocation_api \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
LOCAL_STATIC_LIBRARIES := liblocbatterylistener
|
||||
LOCAL_STATIC_LIBRARIES += libhealthhalutils
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
|
||||
|
||||
# activate the following line for debug purposes only, comment out for production
|
||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
||||
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc
|
||||
LOCAL_SRC_FILES := \
|
||||
service.cpp \
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libcutils \
|
||||
libdl \
|
||||
libbase \
|
||||
libutils \
|
||||
libgps.utils \
|
||||
libqti_vndfwk_detect_vendor \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libhidlbase \
|
||||
android.hardware.gnss@1.0 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
355
gps/android/1.0/Gnss.cpp
Normal file
355
gps/android/1.0/Gnss.cpp
Normal file
@@ -0,0 +1,355 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssInterface"
|
||||
#define LOG_NDEBUG 0
|
||||
|
||||
#include <fstream>
|
||||
#include <log_util.h>
|
||||
#include <dlfcn.h>
|
||||
#include <cutils/properties.h>
|
||||
#include "Gnss.h"
|
||||
#include <LocationUtil.h>
|
||||
#include "battery_listener.h"
|
||||
#include "loc_misc_utils.h"
|
||||
|
||||
typedef const GnssInterface* (getLocationInterface)();
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static sp<Gnss> sGnss;
|
||||
void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gnss = mGnss.promote();
|
||||
if (gnss != nullptr) {
|
||||
gnss->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
void location_on_battery_status_changed(bool charging) {
|
||||
LOC_LOGd("battery status changed to %s charging", charging ? "" : "not ");
|
||||
if (sGnss != nullptr) {
|
||||
sGnss->getGnssInterface()->updateBatteryStatus(charging);
|
||||
}
|
||||
}
|
||||
Gnss::Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
sGnss = this;
|
||||
// initilize gnss interface at first in case needing notify battery status
|
||||
sGnss->getGnssInterface()->initialize();
|
||||
// register health client to listen on battery change
|
||||
loc_extn_battery_properties_listener_init(location_on_battery_status_changed);
|
||||
// clear pending GnssConfig
|
||||
memset(&mPendingConfig, 0, sizeof(GnssConfig));
|
||||
|
||||
mGnssDeathRecipient = new GnssDeathRecipient(sGnss);
|
||||
}
|
||||
|
||||
Gnss::~Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
sGnss = nullptr;
|
||||
}
|
||||
|
||||
void Gnss::handleClientDeath() {
|
||||
getGnssInterface()->resetNetworkInfo();
|
||||
cleanup();
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(nullptr, nullptr);
|
||||
}
|
||||
mGnssCbIface = nullptr;
|
||||
mGnssNiCbIface = nullptr;
|
||||
}
|
||||
|
||||
GnssAPIClient* Gnss::getApi() {
|
||||
if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__);
|
||||
return mApi;
|
||||
}
|
||||
|
||||
if (mPendingConfig.size == sizeof(GnssConfig)) {
|
||||
// we have pending GnssConfig
|
||||
mApi->gnssConfigurationUpdate(mPendingConfig);
|
||||
// clear size to invalid mPendingConfig
|
||||
mPendingConfig.size = 0;
|
||||
if (mPendingConfig.assistanceServer.hostName != nullptr) {
|
||||
free((void*)mPendingConfig.assistanceServer.hostName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__);
|
||||
}
|
||||
return mApi;
|
||||
}
|
||||
|
||||
const GnssInterface* Gnss::getGnssInterface() {
|
||||
static bool getGnssInterfaceFailed = false;
|
||||
if (nullptr == mGnssInterface && !getGnssInterfaceFailed) {
|
||||
void * libHandle = nullptr;
|
||||
getLocationInterface* getter = (getLocationInterface*)
|
||||
dlGetSymFromLib(libHandle, "libgnss.so", "getGnssInterface");
|
||||
|
||||
if (nullptr == getter) {
|
||||
getGnssInterfaceFailed = true;
|
||||
} else {
|
||||
mGnssInterface = (const GnssInterface*)(*getter)();
|
||||
}
|
||||
}
|
||||
return mGnssInterface;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
|
||||
}
|
||||
mGnssCbIface = callback;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
|
||||
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
|
||||
api->requestCapabilities();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setGnssNiCb(const sp<IGnssNiCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssNiCbIface = callback;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::updateConfiguration(GnssConfig& gnssConfig) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
api->gnssConfigurationUpdate(gnssConfig);
|
||||
} else if (gnssConfig.flags != 0) {
|
||||
// api is not ready yet, update mPendingConfig with gnssConfig
|
||||
mPendingConfig.size = sizeof(GnssConfig);
|
||||
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
|
||||
mPendingConfig.gpsLock = gnssConfig.gpsLock;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
|
||||
mPendingConfig.suplVersion = gnssConfig.suplVersion;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
|
||||
mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
|
||||
mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type;
|
||||
if (mPendingConfig.assistanceServer.hostName != nullptr) {
|
||||
free((void*)mPendingConfig.assistanceServer.hostName);
|
||||
mPendingConfig.assistanceServer.hostName =
|
||||
strdup(gnssConfig.assistanceServer.hostName);
|
||||
}
|
||||
mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
mPendingConfig.lppProfileMask = gnssConfig.lppProfileMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT;
|
||||
mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT;
|
||||
mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||
mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
|
||||
mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
|
||||
mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
|
||||
mPendingConfig.suplModeMask = gnssConfig.suplModeMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
|
||||
mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::start() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssStart();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::stop() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssStop();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<void> Gnss::cleanup() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssDisable();
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
api->gnssDeleteAidingData(aidingDataFlags);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
|
||||
preferredAccuracyMeters, preferredTimeMs);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mAGnssIface = new AGnss(this);
|
||||
return mAGnssIface;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssNi = new GnssNi(this);
|
||||
return mGnssNi;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasurement == nullptr)
|
||||
mGnssMeasurement = new GnssMeasurement(mGnssMeasurement);
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssGeofencingIface = new GnssGeofencing(mGnssGeofencingIface);
|
||||
return mGnssGeofencingIface;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() {
|
||||
mGnssBatching = new GnssBatching(mGnssBatching);
|
||||
return mGnssBatching;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssDebug = new GnssDebug(this);
|
||||
return mGnssDebug;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
|
||||
mGnssRil = new AGnssRil(this);
|
||||
return mGnssRil;
|
||||
}
|
||||
|
||||
IGnss* HIDL_FETCH_IGnss(const char* hal) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
IGnss* iface = nullptr;
|
||||
iface = new Gnss();
|
||||
if (iface == nullptr) {
|
||||
LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal);
|
||||
}
|
||||
return iface;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
145
gps/android/1.0/Gnss.h
Normal file
145
gps/android/1.0/Gnss.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
|
||||
#include <AGnss.h>
|
||||
#include <AGnssRil.h>
|
||||
#include <GnssBatching.h>
|
||||
#include <GnssConfiguration.h>
|
||||
#include <GnssGeofencing.h>
|
||||
#include <GnssMeasurement.h>
|
||||
#include <GnssNi.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <GnssAPIClient.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_memory;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
struct Gnss : public IGnss {
|
||||
Gnss();
|
||||
~Gnss();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
|
||||
* These declarations were generated from Gnss.hal.
|
||||
*/
|
||||
Return<bool> setCallback(const sp<V1_0::IGnssCallback>& callback) override;
|
||||
Return<bool> start() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
Return<bool> injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) override;
|
||||
Return<bool> injectTime(int64_t timeMs,
|
||||
int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) override;
|
||||
Return<void> deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
|
||||
Return<bool> setPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) override;
|
||||
Return<sp<V1_0::IAGnss>> getExtensionAGnss() override;
|
||||
Return<sp<V1_0::IGnssNi>> getExtensionGnssNi() override;
|
||||
Return<sp<V1_0::IGnssMeasurement>> getExtensionGnssMeasurement() override;
|
||||
Return<sp<V1_0::IGnssConfiguration>> getExtensionGnssConfiguration() override;
|
||||
Return<sp<V1_0::IGnssGeofencing>> getExtensionGnssGeofencing() override;
|
||||
Return<sp<V1_0::IGnssBatching>> getExtensionGnssBatching() override;
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> getExtensionAGnssRil() override;
|
||||
|
||||
inline Return<sp<V1_0::IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline Return<sp<V1_0::IGnssXtra>> getExtensionXtra() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
|
||||
|
||||
// These methods are not part of the IGnss base class.
|
||||
GnssAPIClient* getApi();
|
||||
Return<bool> setGnssNiCb(const sp<IGnssNiCallback>& niCb);
|
||||
Return<bool> updateConfiguration(GnssConfig& gnssConfig);
|
||||
const GnssInterface* getGnssInterface();
|
||||
|
||||
// Callback for ODCPI request
|
||||
void odcpiRequestCb(const OdcpiRequestInfo& request);
|
||||
|
||||
private:
|
||||
struct GnssDeathRecipient : hidl_death_recipient {
|
||||
GnssDeathRecipient(const sp<Gnss>& gnss) : mGnss(gnss) {
|
||||
}
|
||||
~GnssDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<Gnss> mGnss;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
sp<GnssDeathRecipient> mGnssDeathRecipient = nullptr;
|
||||
|
||||
sp<AGnss> mAGnssIface = nullptr;
|
||||
sp<GnssNi> mGnssNi = nullptr;
|
||||
sp<GnssMeasurement> mGnssMeasurement = nullptr;
|
||||
sp<GnssConfiguration> mGnssConfig = nullptr;
|
||||
sp<GnssGeofencing> mGnssGeofencingIface = nullptr;
|
||||
sp<GnssBatching> mGnssBatching = nullptr;
|
||||
sp<IGnssDebug> mGnssDebug = nullptr;
|
||||
sp<AGnssRil> mGnssRil = nullptr;
|
||||
|
||||
GnssAPIClient* mApi = nullptr;
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface = nullptr;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
GnssConfig mPendingConfig;
|
||||
const GnssInterface* mGnssInterface = nullptr;
|
||||
};
|
||||
|
||||
extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
|
||||
132
gps/android/1.0/GnssBatching.cpp
Normal file
132
gps/android/1.0/GnssBatching.cpp
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssBatchingInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <BatchingAPIClient.h>
|
||||
#include "GnssBatching.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gnssBatching = mGnssBatching.promote();
|
||||
if (gnssBatching != nullptr) {
|
||||
gnssBatching->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
GnssBatching::~GnssBatching() {
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
GnssBatching::handleClientDeath() {
|
||||
stop();
|
||||
cleanup();
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(nullptr);
|
||||
}
|
||||
mGnssBatchingCbIface = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
|
||||
if (mGnssBatchingDeathRecipient == nullptr) {
|
||||
mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(mSelf);
|
||||
}
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(callback);
|
||||
} else {
|
||||
mApi = new BatchingAPIClient(callback);
|
||||
}
|
||||
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
mGnssBatchingCbIface = callback;
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<uint16_t> GnssBatching::getBatchSize() {
|
||||
uint16_t ret = 0;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->getBatchSize();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
|
||||
bool ret = false;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->startSession(options);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<void> GnssBatching::flush() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->flushBatchedLocations();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> GnssBatching::stop() {
|
||||
bool ret = false;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->stopSession();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<void> GnssBatching::cleanup() {
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
85
gps/android/1.0/GnssBatching.h
Normal file
85
gps/android/1.0/GnssBatching.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
|
||||
using ::android::hidl::base::V1_0::IBase;
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_memory;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
|
||||
class BatchingAPIClient;
|
||||
struct GnssBatching : public IGnssBatching {
|
||||
inline GnssBatching(const sp<GnssBatching>& self) : mSelf(self), mApi(nullptr) {}
|
||||
~GnssBatching();
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
|
||||
Return<uint16_t> getBatchSize() override;
|
||||
Return<bool> start(const IGnssBatching::Options& options ) override;
|
||||
Return<void> flush() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
|
||||
private:
|
||||
struct GnssBatchingDeathRecipient : hidl_death_recipient {
|
||||
GnssBatchingDeathRecipient(const sp<GnssBatching>& gnssBatching) :
|
||||
mGnssBatching(gnssBatching) {
|
||||
}
|
||||
~GnssBatchingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<GnssBatching> mGnssBatching;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
// this has to be a reference, not a copy
|
||||
// because the pointer is not set when mSelf is assigned
|
||||
const sp<GnssBatching>& mSelf;
|
||||
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
|
||||
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
|
||||
BatchingAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
|
||||
225
gps/android/1.0/GnssConfiguration.cpp
Normal file
225
gps/android/1.0/GnssConfiguration.cpp
Normal file
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, 2021, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssConfigurationInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssConfiguration.h"
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::GnssConstellationType;
|
||||
|
||||
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setSuplEs(bool enabled) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
|
||||
config.suplEmergencyServices = (enabled ?
|
||||
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES :
|
||||
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO);
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setSuplVersion(uint32_t version) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
|
||||
switch (version) {
|
||||
case 0x00020004:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4;
|
||||
break;
|
||||
case 0x00020002:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2;
|
||||
break;
|
||||
case 0x00020000:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0;
|
||||
break;
|
||||
case 0x00010000:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setSuplMode(uint8_t mode) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
|
||||
switch (mode) {
|
||||
case 0:
|
||||
config.suplModeMask = 0; // STANDALONE ONLY
|
||||
break;
|
||||
case 1:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT;
|
||||
break;
|
||||
case 2:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT;
|
||||
break;
|
||||
case 3:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setLppProfile(uint8_t lppProfileMask) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config = {};
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
config.lppProfileMask = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; //default
|
||||
|
||||
if (lppProfileMask & (1<<0)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_BIT;
|
||||
}
|
||||
if (lppProfileMask & (1<<1)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_BIT;
|
||||
}
|
||||
if (lppProfileMask & (1<<2)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_OVER_NR5G_SA_BIT;
|
||||
}
|
||||
if (lppProfileMask & (1<<3)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_OVER_NR5G_SA_BIT;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
|
||||
config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||
if (protocol & (1<<0)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<1)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<2)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<3)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setGpsLock(uint8_t lock) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
|
||||
switch (lock) {
|
||||
case 0:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
|
||||
break;
|
||||
case 1:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO;
|
||||
break;
|
||||
case 2:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NFW_ALL;
|
||||
break;
|
||||
case 3:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
|
||||
config.emergencyPdnForEmergencySupl = (enabled ?
|
||||
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES :
|
||||
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO);
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
71
gps/android/1.0/GnssConfiguration.h
Normal file
71
gps/android/1.0/GnssConfiguration.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
|
||||
/* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssConfiguration.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssConfiguration;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
/*
|
||||
* Interface for passing GNSS configuration info from platform to HAL.
|
||||
*/
|
||||
struct Gnss;
|
||||
struct GnssConfiguration : public IGnssConfiguration {
|
||||
GnssConfiguration(Gnss* gnss);
|
||||
~GnssConfiguration() = default;
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow.
|
||||
* These declarations were generated from IGnssConfiguration.hal.
|
||||
*/
|
||||
Return<bool> setSuplVersion(uint32_t version) override;
|
||||
Return<bool> setSuplMode(uint8_t mode) override;
|
||||
Return<bool> setSuplEs(bool enabled) override;
|
||||
Return<bool> setLppProfile(uint8_t lppProfileMask) override;
|
||||
Return<bool> setGlonassPositioningProtocol(uint8_t protocol) override;
|
||||
Return<bool> setEmergencySuplPdn(bool enable) override;
|
||||
Return<bool> setGpsLock(uint8_t lock) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
|
||||
173
gps/android/1.0/GnssDebug.cpp
Normal file
173
gps/android/1.0/GnssDebug.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssDebugInterface"
|
||||
|
||||
#include <log/log.h>
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssDebug.h"
|
||||
#include "LocationUtil.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_vec;
|
||||
|
||||
#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000)
|
||||
#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000)
|
||||
#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500)
|
||||
#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180)
|
||||
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns
|
||||
#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm
|
||||
|
||||
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* This methods requests position, time and satellite ephemeris debug information
|
||||
* from the HAL.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
|
||||
{
|
||||
LOC_LOGD("%s]: ", __func__);
|
||||
|
||||
DebugData data = { };
|
||||
|
||||
if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){
|
||||
LOC_LOGE("GnssDebug - Null GNSS interface");
|
||||
_hidl_cb(data);
|
||||
return Void();
|
||||
}
|
||||
|
||||
// get debug report snapshot via hal interface
|
||||
GnssDebugReport reports = { };
|
||||
mGnss->getGnssInterface()->getDebugReport(reports);
|
||||
|
||||
// location block
|
||||
if (reports.mLocation.mValid) {
|
||||
data.position.valid = true;
|
||||
data.position.latitudeDegrees = reports.mLocation.mLocation.latitude;
|
||||
data.position.longitudeDegrees = reports.mLocation.mLocation.longitude;
|
||||
data.position.altitudeMeters = reports.mLocation.mLocation.altitude;
|
||||
|
||||
data.position.speedMetersPerSec =
|
||||
(double)(reports.mLocation.mLocation.speed);
|
||||
data.position.bearingDegrees =
|
||||
(double)(reports.mLocation.mLocation.bearing);
|
||||
data.position.horizontalAccuracyMeters =
|
||||
(double)(reports.mLocation.mLocation.accuracy);
|
||||
data.position.verticalAccuracyMeters =
|
||||
reports.mLocation.verticalAccuracyMeters;
|
||||
data.position.speedAccuracyMetersPerSecond =
|
||||
reports.mLocation.speedAccuracyMetersPerSecond;
|
||||
data.position.bearingAccuracyDegrees =
|
||||
reports.mLocation.bearingAccuracyDegrees;
|
||||
|
||||
timeval tv_now, tv_report;
|
||||
tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec;
|
||||
tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL;
|
||||
gettimeofday(&tv_now, NULL);
|
||||
data.position.ageSeconds =
|
||||
(tv_now.tv_sec - tv_report.tv_sec) +
|
||||
(float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000;
|
||||
}
|
||||
else {
|
||||
data.position.valid = false;
|
||||
}
|
||||
|
||||
if (data.position.horizontalAccuracyMeters <= 0 ||
|
||||
data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) {
|
||||
data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS;
|
||||
}
|
||||
if (data.position.verticalAccuracyMeters <= 0 ||
|
||||
data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) {
|
||||
data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS;
|
||||
}
|
||||
if (data.position.speedAccuracyMetersPerSecond <= 0 ||
|
||||
data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) {
|
||||
data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC;
|
||||
}
|
||||
if (data.position.bearingAccuracyDegrees <= 0 ||
|
||||
data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) {
|
||||
data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG;
|
||||
}
|
||||
|
||||
// time block
|
||||
if (reports.mTime.mValid) {
|
||||
data.time.timeEstimate = reports.mTime.timeEstimate;
|
||||
data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs;
|
||||
data.time.frequencyUncertaintyNsPerSec =
|
||||
reports.mTime.frequencyUncertaintyNsPerSec;
|
||||
}
|
||||
|
||||
if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
|
||||
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
|
||||
}
|
||||
if (data.time.timeUncertaintyNs <= 0 ||
|
||||
data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) {
|
||||
data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC;
|
||||
}
|
||||
if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
|
||||
data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {
|
||||
data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC;
|
||||
}
|
||||
|
||||
// satellite data block
|
||||
SatelliteData s = { };
|
||||
std::vector<SatelliteData> s_array = { };
|
||||
|
||||
for (uint32_t i=0; i<reports.mSatelliteInfo.size(); i++) {
|
||||
memset(&s, 0, sizeof(s));
|
||||
s.svid = reports.mSatelliteInfo[i].svid;
|
||||
convertGnssConstellationType(
|
||||
reports.mSatelliteInfo[i].constellation, s.constellation);
|
||||
convertGnssEphemerisType(
|
||||
reports.mSatelliteInfo[i].mEphemerisType, s.ephemerisType);
|
||||
convertGnssEphemerisSource(
|
||||
reports.mSatelliteInfo[i].mEphemerisSource, s.ephemerisSource);
|
||||
convertGnssEphemerisHealth(
|
||||
reports.mSatelliteInfo[i].mEphemerisHealth, s.ephemerisHealth);
|
||||
|
||||
s.ephemerisAgeSeconds =
|
||||
reports.mSatelliteInfo[i].ephemerisAgeSeconds;
|
||||
s.serverPredictionIsAvailable =
|
||||
reports.mSatelliteInfo[i].serverPredictionIsAvailable;
|
||||
s.serverPredictionAgeSeconds =
|
||||
reports.mSatelliteInfo[i].serverPredictionAgeSeconds;
|
||||
|
||||
s_array.push_back(s);
|
||||
}
|
||||
data.satelliteDataArray = s_array;
|
||||
|
||||
// callback HIDL with collected debug data
|
||||
_hidl_cb(data);
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
59
gps/android/1.0/GnssDebug.h
Normal file
59
gps/android/1.0/GnssDebug.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssDebug.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssDebug;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
/* Interface for GNSS Debug support. */
|
||||
struct Gnss;
|
||||
struct GnssDebug : public IGnssDebug {
|
||||
GnssDebug(Gnss* gnss);
|
||||
~GnssDebug() {};
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
|
||||
* These declarations were generated from IGnssDebug.hal.
|
||||
*/
|
||||
Return<void> getDebugData(getDebugData_cb _hidl_cb) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
|
||||
150
gps/android/1.0/GnssGeofencing.cpp
Normal file
150
gps/android/1.0/GnssGeofencing.cpp
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "GnssHal_GnssGeofencing"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <GeofenceAPIClient.h>
|
||||
#include "GnssGeofencing.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gnssGeofencing = mGnssGeofencing.promote();
|
||||
if (gnssGeofencing != nullptr) {
|
||||
gnssGeofencing->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
GnssGeofencing::~GnssGeofencing() {
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GnssGeofencing::handleClientDeath() {
|
||||
|
||||
removeAllGeofences();
|
||||
if (mApi != nullptr) {
|
||||
mApi->upcateCallback(nullptr);
|
||||
}
|
||||
mGnssGeofencingCbIface = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
|
||||
if (mGnssGeofencingDeathRecipient == nullptr) {
|
||||
mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(mSelf);
|
||||
}
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->upcateCallback(callback);
|
||||
} else {
|
||||
mApi = new GeofenceAPIClient(callback);
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient);
|
||||
}
|
||||
mGnssGeofencingCbIface = callback;
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::addGeofence(
|
||||
int32_t geofenceId,
|
||||
double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
double radiusMeters,
|
||||
IGnssGeofenceCallback::GeofenceTransition lastTransition,
|
||||
int32_t monitorTransitions,
|
||||
uint32_t notificationResponsivenessMs,
|
||||
uint32_t unknownTimerMs) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceAdd(
|
||||
geofenceId,
|
||||
latitudeDegrees,
|
||||
longitudeDegrees,
|
||||
radiusMeters,
|
||||
static_cast<int32_t>(lastTransition),
|
||||
monitorTransitions,
|
||||
notificationResponsivenessMs,
|
||||
unknownTimerMs);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::pauseGeofence(int32_t geofenceId) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofencePause(geofenceId);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceResume(geofenceId, monitorTransitions);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::removeGeofence(int32_t geofenceId) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceRemove(geofenceId);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::removeAllGeofences() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceRemoveAll();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
96
gps/android/1.0/GnssGeofencing.h
Normal file
96
gps/android/1.0/GnssGeofencing.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofencing;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient;
|
||||
struct GnssGeofencing : public IGnssGeofencing {
|
||||
inline GnssGeofencing(const sp<GnssGeofencing>& self) : mSelf(self), mApi(nullptr) {}
|
||||
~GnssGeofencing();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
* These declarations were generated from IGnssGeofencing.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IGnssGeofenceCallback>& callback) override;
|
||||
Return<void> addGeofence(int32_t geofenceId,
|
||||
double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
double radiusMeters,
|
||||
IGnssGeofenceCallback::GeofenceTransition lastTransition,
|
||||
int32_t monitorTransitions,
|
||||
uint32_t notificationResponsivenessMs,
|
||||
uint32_t unknownTimerMs) override;
|
||||
|
||||
Return<void> pauseGeofence(int32_t geofenceId) override;
|
||||
Return<void> resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override;
|
||||
Return<void> removeGeofence(int32_t geofenceId) override;
|
||||
|
||||
private:
|
||||
// This method is not part of the IGnss base class.
|
||||
// It is called by GnssGeofencingDeathRecipient to remove all geofences added so far.
|
||||
Return<void> removeAllGeofences();
|
||||
|
||||
private:
|
||||
struct GnssGeofencingDeathRecipient : hidl_death_recipient {
|
||||
GnssGeofencingDeathRecipient(const sp<GnssGeofencing>& gnssGeofencing) :
|
||||
mGnssGeofencing(gnssGeofencing) {
|
||||
}
|
||||
~GnssGeofencingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<GnssGeofencing> mGnssGeofencing;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
// this has to be a reference, not a copy
|
||||
// because the pointer is not set when mSelf is assigned
|
||||
const sp<GnssGeofencing>& mSelf;
|
||||
sp<GnssGeofencingDeathRecipient> mGnssGeofencingDeathRecipient = nullptr;
|
||||
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface = nullptr;
|
||||
GeofenceAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
|
||||
113
gps/android/1.0/GnssMeasurement.cpp
Normal file
113
gps/android/1.0/GnssMeasurement.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <MeasurementAPIClient.h>
|
||||
#include "GnssMeasurement.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gssMeasurement = mGnssMeasurement.promote();
|
||||
if (gssMeasurement != nullptr) {
|
||||
gssMeasurement->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
GnssMeasurement::GnssMeasurement(const sp<GnssMeasurement>& self) :
|
||||
mSelf(self), mApi(new MeasurementAPIClient()) {
|
||||
}
|
||||
|
||||
GnssMeasurement::~GnssMeasurement() {
|
||||
if (mApi) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GnssMeasurement::handleClientDeath() {
|
||||
|
||||
close();
|
||||
if (mApi != nullptr) {
|
||||
mApi->measurementSetCallback(nullptr);
|
||||
}
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
||||
}
|
||||
|
||||
if (callback == nullptr) {
|
||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mGnssMeasurementCbIface = callback;
|
||||
if (mGnssMeasurementDeathRecipient == nullptr) {
|
||||
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(mSelf);
|
||||
}
|
||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
return mApi->measurementSetCallback(callback);
|
||||
|
||||
}
|
||||
|
||||
Return<void> GnssMeasurement::close() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
}
|
||||
mApi->measurementClose();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
82
gps/android/1.0/GnssMeasurement.h
Normal file
82
gps/android/1.0/GnssMeasurement.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
class MeasurementAPIClient;
|
||||
struct GnssMeasurement : public IGnssMeasurement {
|
||||
GnssMeasurement(const sp<GnssMeasurement>& self);
|
||||
~GnssMeasurement();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
* These declarations were generated from IGnssMeasurement.hal.
|
||||
*/
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) override;
|
||||
Return<void> close() override;
|
||||
|
||||
private:
|
||||
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
|
||||
GnssMeasurementDeathRecipient(const sp<GnssMeasurement>& gnssMeasurement) :
|
||||
mGnssMeasurement(gnssMeasurement) {
|
||||
}
|
||||
~GnssMeasurementDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<GnssMeasurement> mGnssMeasurement;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
// this has to be a reference, not a copy
|
||||
// because the pointer is not set when mSelf is assigned
|
||||
const sp<GnssMeasurement>& mSelf;
|
||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||
MeasurementAPIClient* mApi;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||
70
gps/android/1.0/GnssNi.cpp
Normal file
70
gps/android/1.0/GnssNi.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssNiInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssNi.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) {
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
|
||||
Return<void> GnssNi::setCallback(const sp<IGnssNiCallback>& callback) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
mGnss->setGnssNiCb(callback);
|
||||
mGnssNiCbIface = callback;
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
GnssAPIClient* api = mGnss->getApi();
|
||||
if (api == nullptr) {
|
||||
LOC_LOGE("%s]: api is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
api->gnssNiRespond(notifId, userResponse);
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
65
gps/android/1.0/GnssNi.h
Normal file
65
gps/android/1.0/GnssNi.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssNi.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssNi;
|
||||
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct GnssNi : public IGnssNi {
|
||||
GnssNi(Gnss* gnss);
|
||||
~GnssNi() = default;
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
|
||||
* These declarations were generated from IGnssNi.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IGnssNiCallback>& callback) override;
|
||||
Return<void> respond(int32_t notifId,
|
||||
IGnssNiCallback::GnssUserResponseType userResponse) override;
|
||||
|
||||
private:
|
||||
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
|
||||
4
gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc
Normal file
4
gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti
|
||||
class hal
|
||||
user gps
|
||||
group system gps radio vendor_qti_diag
|
||||
35
gps/android/1.0/android.hardware.gnss@1.0-service-qti.xml
Normal file
35
gps/android/1.0/android.hardware.gnss@1.0-service-qti.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<!-- Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gnss</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::IGnss/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
||||
205
gps/android/1.0/location_api/BatchingAPIClient.cpp
Normal file
205
gps/android/1.0/location_api/BatchingAPIClient.cpp
Normal file
@@ -0,0 +1,205 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_BatchingAPIClient"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "BatchingAPIClient.h"
|
||||
|
||||
#include "limits.h"
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask);
|
||||
|
||||
BatchingAPIClient::BatchingAPIClient(const sp<IGnssBatchingCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssBatchingCbIface(callback),
|
||||
mDefaultId(UINT_MAX),
|
||||
mLocationCapabilitiesMask(0)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.batchingCb = [this](size_t count, Location* location,
|
||||
BatchingOptions batchOptions) {
|
||||
onBatchingCb(count, location, batchOptions);
|
||||
};
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
BatchingAPIClient::~BatchingAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::gnssUpdateCallbacks(const sp<IGnssBatchingCallback>& callback)
|
||||
{
|
||||
mMutex.lock();
|
||||
mGnssBatchingCbIface = callback;
|
||||
mMutex.unlock();
|
||||
}
|
||||
|
||||
int BatchingAPIClient::getBatchSize()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
return locAPIGetBatchSize();
|
||||
}
|
||||
|
||||
int BatchingAPIClient::startSession(const IGnssBatching::Options& opts)
|
||||
{
|
||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||
int retVal = -1;
|
||||
LocationOptions options;
|
||||
convertBatchOption(opts, options, mLocationCapabilitiesMask);
|
||||
uint32_t mode = 0;
|
||||
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
|
||||
mode = SESSION_MODE_ON_FULL;
|
||||
}
|
||||
if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts)
|
||||
{
|
||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||
int retVal = -1;
|
||||
LocationOptions options;
|
||||
convertBatchOption(opts, options, mLocationCapabilitiesMask);
|
||||
|
||||
uint32_t mode = 0;
|
||||
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
|
||||
mode = SESSION_MODE_ON_FULL;
|
||||
}
|
||||
if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int BatchingAPIClient::stopSession()
|
||||
{
|
||||
LOC_LOGD("%s]: ", __FUNCTION__);
|
||||
int retVal = -1;
|
||||
if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::getBatchedLocation(int last_n_locations)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations);
|
||||
locAPIGetBatchedLocations(mDefaultId, last_n_locations);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::flushBatchedLocations()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
locAPIGetBatchedLocations(mDefaultId, SIZE_MAX);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onBatchingCb(size_t count, Location* location,
|
||||
BatchingOptions /*batchOptions*/)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbiface = mGnssBatchingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbiface != nullptr && count > 0) {
|
||||
hidl_vec<GnssLocation> locationVec;
|
||||
locationVec.resize(count);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
convertGnssLocation(location[i], locationVec[i]);
|
||||
}
|
||||
auto r = cbiface->gnssLocationBatchCb(locationVec);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask)
|
||||
{
|
||||
memset(&out, 0, sizeof(LocationOptions));
|
||||
out.size = sizeof(LocationOptions);
|
||||
out.minInterval = (uint32_t)(in.periodNanos / 1000000L);
|
||||
out.minDistance = 0;
|
||||
out.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
|
||||
out.mode = GNSS_SUPL_MODE_MSA;
|
||||
if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
|
||||
out.mode = GNSS_SUPL_MODE_MSB;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
77
gps/android/1.0/location_api/BatchingAPIClient.h
Normal file
77
gps/android/1.0/location_api/BatchingAPIClient.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BATCHING_API_CLINET_H
|
||||
#define BATCHING_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
class BatchingAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
BatchingAPIClient(const sp<V1_0::IGnssBatchingCallback>& callback);
|
||||
void gnssUpdateCallbacks(const sp<V1_0::IGnssBatchingCallback>& callback);
|
||||
int getBatchSize();
|
||||
int startSession(const V1_0::IGnssBatching::Options& options);
|
||||
int updateSessionOptions(const V1_0::IGnssBatching::Options& options);
|
||||
int stopSession();
|
||||
void getBatchedLocation(int last_n_locations);
|
||||
void flushBatchedLocations();
|
||||
|
||||
inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; }
|
||||
|
||||
// callbacks
|
||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||
void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final;
|
||||
|
||||
private:
|
||||
~BatchingAPIClient();
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssBatchingCallback> mGnssBatchingCbIface;
|
||||
uint32_t mDefaultId;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // BATCHING_API_CLINET_H
|
||||
297
gps/android/1.0/location_api/GeofenceAPIClient.cpp
Normal file
297
gps/android/1.0/location_api/GeofenceAPIClient.cpp
Normal file
@@ -0,0 +1,297 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_GeofenceApiClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GeofenceAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
GeofenceAPIClient::GeofenceAPIClient(const sp<IGnssGeofenceCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssGeofencingCbIface(callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb =
|
||||
[this](GeofenceBreachNotification geofenceBreachNotification) {
|
||||
onGeofenceBreachCb(geofenceBreachNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.geofenceStatusCb =
|
||||
[this](GeofenceStatusNotification geofenceStatusNotification) {
|
||||
onGeofenceStatusCb(geofenceStatusNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::upcateCallback(const sp<IGnssGeofenceCallback>& callback) {
|
||||
mMutex.lock();
|
||||
mGnssGeofencingCbIface = callback;
|
||||
mMutex.unlock();
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
|
||||
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
|
||||
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__,
|
||||
geofence_id, latitude, longitude, radius_meters,
|
||||
last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms);
|
||||
|
||||
GeofenceOption options;
|
||||
memset(&options, 0, sizeof(GeofenceOption));
|
||||
options.size = sizeof(GeofenceOption);
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
|
||||
options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
|
||||
options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT;
|
||||
options.responsiveness = notification_responsiveness_ms;
|
||||
|
||||
GeofenceInfo data;
|
||||
data.size = sizeof(GeofenceInfo);
|
||||
data.latitude = latitude;
|
||||
data.longitude = longitude;
|
||||
data.radius = radius_meters;
|
||||
|
||||
LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data);
|
||||
if (LOCATION_ERROR_SUCCESS != err) {
|
||||
onAddGeofencesCb(1, &err, &geofence_id);
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofencePause(uint32_t geofence_id)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
|
||||
locAPIPauseGeofences(1, &geofence_id);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions);
|
||||
GeofenceBreachTypeMask mask = 0;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
|
||||
mask |= GEOFENCE_BREACH_ENTER_BIT;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
|
||||
mask |= GEOFENCE_BREACH_EXIT_BIT;
|
||||
locAPIResumeGeofences(1, &geofence_id, &mask);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
|
||||
locAPIRemoveGeofences(1, &geofence_id);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceRemoveAll()
|
||||
{
|
||||
LOC_LOGD("%s]", __FUNCTION__);
|
||||
locAPIRemoveAllGeofences();
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
|
||||
GnssLocation gnssLocation;
|
||||
convertGnssLocation(geofenceBreachNotification.location, gnssLocation);
|
||||
|
||||
IGnssGeofenceCallback::GeofenceTransition transition;
|
||||
if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER)
|
||||
transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED;
|
||||
else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT)
|
||||
transition = IGnssGeofenceCallback::GeofenceTransition::EXITED;
|
||||
else {
|
||||
// continue with other breach if transition is
|
||||
// nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED
|
||||
continue;
|
||||
}
|
||||
|
||||
auto r = cbIface->gnssGeofenceTransitionCb(
|
||||
geofenceBreachNotification.ids[i], gnssLocation, transition,
|
||||
static_cast<V1_0::GnssUtcTime>(geofenceBreachNotification.timestamp));
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
IGnssGeofenceCallback::GeofenceAvailability status =
|
||||
IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE;
|
||||
if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) {
|
||||
status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE;
|
||||
}
|
||||
GnssLocation gnssLocation;
|
||||
memset(&gnssLocation, 0, sizeof(GnssLocation));
|
||||
auto r = cbIface->gnssGeofenceStatusCb(status, gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_EXISTS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS;
|
||||
auto r = cbIface->gnssGeofenceAddCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = cbIface->gnssGeofenceRemoveCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = cbIface->gnssGeofencePauseCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = cbIface->gnssGeofenceResumeCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
77
gps/android/1.0/location_api/GeofenceAPIClient.h
Normal file
77
gps/android/1.0/location_api/GeofenceAPIClient.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GEOFENCE_API_CLINET_H
|
||||
#define GEOFENCE_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofenceCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GeofenceAPIClient(const sp<V1_0::IGnssGeofenceCallback>& callback);
|
||||
void upcateCallback(const sp<V1_0::IGnssGeofenceCallback>& callback);
|
||||
void geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
|
||||
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
|
||||
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms);
|
||||
void geofencePause(uint32_t geofence_id);
|
||||
void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions);
|
||||
void geofenceRemove(uint32_t geofence_id);
|
||||
void geofenceRemoveAll();
|
||||
|
||||
// callbacks
|
||||
void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final;
|
||||
void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final;
|
||||
void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
|
||||
private:
|
||||
virtual ~GeofenceAPIClient() = default;
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssGeofenceCallback> mGnssGeofencingCbIface;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GEOFENCE_API_CLINET_H
|
||||
565
gps/android/1.0/location_api/GnssAPIClient.cpp
Normal file
565
gps/android/1.0/location_api/GnssAPIClient.cpp
Normal file
@@ -0,0 +1,565 @@
|
||||
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_GnssAPIClient"
|
||||
#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GnssAPIClient.h"
|
||||
#include <LocContext.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnss;
|
||||
using ::android::hardware::gnss::V1_0::IGnssCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out);
|
||||
|
||||
GnssAPIClient::GnssAPIClient(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssCbIface(nullptr),
|
||||
mGnssNiCbIface(nullptr),
|
||||
mControlClient(new LocationAPIControlClient()),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mLocationCapabilitiesCached(false)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
// set default LocationOptions.
|
||||
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
||||
mTrackingOptions.size = sizeof(TrackingOptions);
|
||||
mTrackingOptions.minInterval = 1000;
|
||||
mTrackingOptions.minDistance = 0;
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
|
||||
gnssUpdateCallbacks(gpsCb, niCb);
|
||||
}
|
||||
|
||||
GnssAPIClient::~GnssAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient) {
|
||||
delete mControlClient;
|
||||
mControlClient = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
void GnssAPIClient::gnssUpdateCallbacks(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssCbIface = gpsCb;
|
||||
mGnssNiCbIface = niCb;
|
||||
mMutex.unlock();
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.trackingCb = [this](Location location) {
|
||||
onTrackingCb(location);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
loc_core::ContextBase* context =
|
||||
loc_core::LocContext::getLocContext(loc_core::LocContext::mLocationHalName);
|
||||
if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) {
|
||||
LOC_LOGD("Registering NI CB");
|
||||
locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) {
|
||||
onGnssNiCb(id, gnssNiNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) {
|
||||
onGnssSvCb(gnssSvNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) {
|
||||
onGnssNmeaCb(gnssNmeaNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStart()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
bool retVal = true;
|
||||
locAPIStartTracking(mTrackingOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStop()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
bool retVal = true;
|
||||
locAPIStopTracking();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
|
||||
IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs,
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d %d %d %d %d %d)", __FUNCTION__,
|
||||
(int)mode, recurrence, minIntervalMs, preferredAccuracyMeters,
|
||||
preferredTimeMs, (int)powerMode, timeBetweenMeasurement);
|
||||
bool retVal = true;
|
||||
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
||||
mTrackingOptions.size = sizeof(TrackingOptions);
|
||||
mTrackingOptions.minInterval = minIntervalMs;
|
||||
if (IGnss::GnssPositionMode::MS_ASSISTED == mode ||
|
||||
IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) {
|
||||
// We set a very large interval to simulate SINGLE mode. Once we report a fix,
|
||||
// the caller should take the responsibility to stop the session.
|
||||
// For MSA, we always treat it as SINGLE mode.
|
||||
mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC;
|
||||
}
|
||||
if (mode == IGnss::GnssPositionMode::STANDALONE)
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
else if (mode == IGnss::GnssPositionMode::MS_BASED)
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_MSB;
|
||||
else if (mode == IGnss::GnssPositionMode::MS_ASSISTED)
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_MSA;
|
||||
else {
|
||||
LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode);
|
||||
retVal = false;
|
||||
}
|
||||
if (GNSS_POWER_MODE_INVALID != powerMode) {
|
||||
mTrackingOptions.powerMode = powerMode;
|
||||
mTrackingOptions.tbm = timeBetweenMeasurement;
|
||||
}
|
||||
locAPIUpdateTrackingOptions(mTrackingOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// for GpsNiInterface
|
||||
void GnssAPIClient::gnssNiRespond(int32_t notifId,
|
||||
IGnssNiCallback::GnssUserResponseType userResponse)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast<int>(userResponse));
|
||||
GnssNiResponse data;
|
||||
switch (userResponse) {
|
||||
case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT:
|
||||
data = GNSS_NI_RESPONSE_ACCEPT;
|
||||
break;
|
||||
case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY:
|
||||
data = GNSS_NI_RESPONSE_DENY;
|
||||
break;
|
||||
case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP:
|
||||
data = GNSS_NI_RESPONSE_NO_RESPONSE;
|
||||
break;
|
||||
default:
|
||||
data = GNSS_NI_RESPONSE_IGNORE;
|
||||
break;
|
||||
}
|
||||
|
||||
locAPIGnssNiResponse(notifId, data);
|
||||
}
|
||||
|
||||
// these apis using LocationAPIControlClient
|
||||
void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
GnssAidingData data;
|
||||
memset(&data, 0, sizeof (GnssAidingData));
|
||||
data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT;
|
||||
data.posEngineMask = STANDARD_POSITIONING_ENGINE;
|
||||
|
||||
if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL)
|
||||
data.deleteAll = true;
|
||||
else {
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT;
|
||||
}
|
||||
mControlClient->locAPIGnssDeleteAidingData(data);
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssEnable(LocationTechnologyType techType)
|
||||
{
|
||||
LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIEnable(techType);
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssDisable()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIDisable();
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIGnssUpdateConfig(gnssConfig);
|
||||
}
|
||||
|
||||
void GnssAPIClient::requestCapabilities() {
|
||||
// only send capablities if it's already cached, otherwise the first time LocationAPI
|
||||
// is initialized, capabilities will be sent by LocationAPI
|
||||
if (mLocationCapabilitiesCached) {
|
||||
onCapabilitiesCb(mLocationCapabilitiesMask);
|
||||
}
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
mLocationCapabilitiesCached = true;
|
||||
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
uint32_t data = 0;
|
||||
if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT))
|
||||
data |= IGnssCallback::Capabilities::SCHEDULING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT)
|
||||
data |= IGnssCallback::Capabilities::GEOFENCING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT)
|
||||
data |= IGnssCallback::Capabilities::MEASUREMENTS;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
|
||||
data |= IGnssCallback::Capabilities::MSB;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
|
||||
data |= IGnssCallback::Capabilities::MSA;
|
||||
auto r = gnssCbIface->gnssSetCapabilitesCb(data);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
if (gnssCbIface != nullptr) {
|
||||
IGnssCallback::GnssSystemInfo gnssInfo = { .yearOfHw = 2015 };
|
||||
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2016
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2017
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT ||
|
||||
capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2018
|
||||
}
|
||||
}
|
||||
}
|
||||
LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw);
|
||||
auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onTrackingCb(Location location)
|
||||
{
|
||||
LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
GnssLocation gnssLocation;
|
||||
convertGnssLocation(location, gnssLocation);
|
||||
auto r = gnssCbIface->gnssLocationCb(gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id);
|
||||
mMutex.lock();
|
||||
auto gnssNiCbIface(mGnssNiCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssNiCbIface == nullptr) {
|
||||
LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
IGnssNiCallback::GnssNiNotification notificationGnss = {};
|
||||
|
||||
notificationGnss.notificationId = id;
|
||||
|
||||
if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL;
|
||||
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY;
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY;
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE;
|
||||
|
||||
notificationGnss.timeoutSec = gnssNiNotification.timeout;
|
||||
|
||||
if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT;
|
||||
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY;
|
||||
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE ||
|
||||
gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP;
|
||||
|
||||
notificationGnss.requestorId = gnssNiNotification.requestor;
|
||||
|
||||
notificationGnss.notificationMessage = gnssNiNotification.message;
|
||||
|
||||
if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
|
||||
|
||||
if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
|
||||
|
||||
gnssNiCbIface->niNotifyCb(notificationGnss);
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
IGnssCallback::GnssSvStatus svStatus;
|
||||
convertGnssSvStatus(gnssSvNotification, svStatus);
|
||||
auto r = gnssCbIface->gnssSvStatusCb(svStatus);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSvStatusCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
|
||||
{
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
const std::string s(gnssNmeaNotification.nmea);
|
||||
std::stringstream ss(s);
|
||||
std::string each;
|
||||
while(std::getline(ss, each, '\n')) {
|
||||
each += '\n';
|
||||
android::hardware::hidl_string nmeaString;
|
||||
nmeaString.setToExternal(each.c_str(), each.length());
|
||||
auto r = gnssCbIface->gnssNmeaCb(
|
||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__,
|
||||
gnssNmeaNotification.nmea, gnssNmeaNotification.length,
|
||||
r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onStartTrackingCb(LocationError error)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onStopTrackingCb(LocationError error)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus));
|
||||
out.numSvs = in.count;
|
||||
if (out.numSvs > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) {
|
||||
LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.",
|
||||
__FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT);
|
||||
out.numSvs = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT);
|
||||
}
|
||||
for (size_t i = 0; i < out.numSvs; i++) {
|
||||
IGnssCallback::GnssSvInfo& info = out.gnssSvList[i];
|
||||
convertGnssSvid(in.gnssSvs[i], info.svid);
|
||||
convertGnssConstellationType(in.gnssSvs[i].type, info.constellation);
|
||||
info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
|
||||
info.elevationDegrees = in.gnssSvs[i].elevation;
|
||||
info.azimuthDegrees = in.gnssSvs[i].azimuth;
|
||||
info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz;
|
||||
info.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
110
gps/android/1.0/location_api/GnssAPIClient.h
Normal file
110
gps/android/1.0/location_api/GnssAPIClient.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GNSS_API_CLINET_H
|
||||
#define GNSS_API_CLINET_H
|
||||
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssNiCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GnssAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GnssAPIClient(const sp<V1_0::IGnssCallback>& gpsCb,
|
||||
const sp<V1_0::IGnssNiCallback>& niCb);
|
||||
GnssAPIClient(const GnssAPIClient&) = delete;
|
||||
GnssAPIClient& operator=(const GnssAPIClient&) = delete;
|
||||
|
||||
// for GpsInterface
|
||||
void gnssUpdateCallbacks(const sp<V1_0::IGnssCallback>& gpsCb,
|
||||
const sp<V1_0::IGnssNiCallback>& niCb);
|
||||
bool gnssStart();
|
||||
bool gnssStop();
|
||||
bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs,
|
||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||
uint32_t timeBetweenMeasurement = 0);
|
||||
|
||||
// for GpsNiInterface
|
||||
void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse);
|
||||
|
||||
// these apis using LocationAPIControlClient
|
||||
void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags);
|
||||
void gnssEnable(LocationTechnologyType techType);
|
||||
void gnssDisable();
|
||||
void gnssConfigurationUpdate(const GnssConfig& gnssConfig);
|
||||
|
||||
inline LocationCapabilitiesMask gnssGetCapabilities() const {
|
||||
return mLocationCapabilitiesMask;
|
||||
}
|
||||
void requestCapabilities();
|
||||
|
||||
// callbacks we are interested in
|
||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||
void onTrackingCb(Location location) final;
|
||||
void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final;
|
||||
void onGnssSvCb(GnssSvNotification gnssSvNotification) final;
|
||||
void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final;
|
||||
|
||||
void onStartTrackingCb(LocationError error) final;
|
||||
void onStopTrackingCb(LocationError error) final;
|
||||
|
||||
private:
|
||||
virtual ~GnssAPIClient();
|
||||
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface;
|
||||
std::mutex mMutex;
|
||||
LocationAPIControlClient* mControlClient;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
bool mLocationCapabilitiesCached;
|
||||
TrackingOptions mTrackingOptions;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GNSS_API_CLINET_H
|
||||
275
gps/android/1.0/location_api/LocationUtil.cpp
Normal file
275
gps/android/1.0/location_api/LocationUtil.cpp
Normal file
@@ -0,0 +1,275 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gps_extended_c.h>
|
||||
#include <LocationUtil.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
using ::android::hardware::gnss::V1_0::GnssConstellationType;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocationFlags;
|
||||
|
||||
void convertGnssLocation(Location& in, GnssLocation& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(GnssLocation));
|
||||
if (in.flags & LOCATION_HAS_LAT_LONG_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG;
|
||||
out.latitudeDegrees = in.latitude;
|
||||
out.longitudeDegrees = in.longitude;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_ALTITUDE_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE;
|
||||
out.altitudeMeters = in.altitude;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_SPEED_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED;
|
||||
out.speedMetersPerSec = in.speed;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_BEARING_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING;
|
||||
out.bearingDegrees = in.bearing;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY;
|
||||
out.horizontalAccuracyMeters = in.accuracy;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY;
|
||||
out.verticalAccuracyMeters = in.verticalAccuracy;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY;
|
||||
out.speedAccuracyMetersPerSecond = in.speedAccuracy;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY;
|
||||
out.bearingAccuracyDegrees = in.bearingAccuracy;
|
||||
}
|
||||
|
||||
out.timestamp = static_cast<V1_0::GnssUtcTime>(in.timestamp);
|
||||
}
|
||||
|
||||
void convertGnssLocation(const GnssLocation& in, Location& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) {
|
||||
out.flags |= LOCATION_HAS_LAT_LONG_BIT;
|
||||
out.latitude = in.latitudeDegrees;
|
||||
out.longitude = in.longitudeDegrees;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) {
|
||||
out.flags |= LOCATION_HAS_ALTITUDE_BIT;
|
||||
out.altitude = in.altitudeMeters;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) {
|
||||
out.flags |= LOCATION_HAS_SPEED_BIT;
|
||||
out.speed = in.speedMetersPerSec;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
|
||||
out.flags |= LOCATION_HAS_BEARING_BIT;
|
||||
out.bearing = in.bearingDegrees;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_ACCURACY_BIT;
|
||||
out.accuracy = in.horizontalAccuracyMeters;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT;
|
||||
out.verticalAccuracy = in.verticalAccuracyMeters;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT;
|
||||
out.speedAccuracy = in.speedAccuracyMetersPerSecond;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT;
|
||||
out.bearingAccuracy = in.bearingAccuracyDegrees;
|
||||
}
|
||||
|
||||
out.timestamp = static_cast<uint64_t>(in.timestamp);
|
||||
}
|
||||
|
||||
void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = GnssConstellationType::GPS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = GnssConstellationType::SBAS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
out = GnssConstellationType::GLONASS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = GnssConstellationType::QZSS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = GnssConstellationType::BEIDOU;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = GnssConstellationType::GALILEO;
|
||||
break;
|
||||
case GNSS_SV_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = GnssConstellationType::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssSvid(GnssSv& in, int16_t& out)
|
||||
{
|
||||
switch(in.type){
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
if (!isGloSlotUnknown(in.svId)) { // OSN is known
|
||||
out = in.svId - GLO_SV_PRN_MIN + 1;
|
||||
} else { // OSN is not known, report FCN
|
||||
out = in.gloFrequency + 92;
|
||||
}
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = in.svId - BDS_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = in.svId - GAL_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_NAVIC:
|
||||
out = in.svId - NAVIC_SV_PRN_MIN + 1;
|
||||
break;
|
||||
default:
|
||||
out = in.svId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssSvid(GnssMeasurementsData& in, int16_t& out)
|
||||
{
|
||||
switch (in.svType) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
if (!isGloSlotUnknown(in.svId)) { // OSN is known
|
||||
out = in.svId - GLO_SV_PRN_MIN + 1;
|
||||
} else { // OSN is not known, report FCN
|
||||
out = in.gloFrequency + 92;
|
||||
}
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = in.svId - BDS_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = in.svId - GAL_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_NAVIC:
|
||||
out = in.svId - NAVIC_SV_PRN_MIN + 1;
|
||||
break;
|
||||
default:
|
||||
out = in.svId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_TYPE_EPHEMERIS:
|
||||
out = GnssDebug::SatelliteEphemerisType::EPHEMERIS;
|
||||
break;
|
||||
case GNSS_EPH_TYPE_ALMANAC:
|
||||
out = GnssDebug::SatelliteEphemerisType::ALMANAC_ONLY;
|
||||
break;
|
||||
case GNSS_EPH_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisType::NOT_AVAILABLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_SOURCE_DEMODULATED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::DEMODULATED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_SUPL_PROVIDED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::SUPL_PROVIDED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::OTHER_SERVER_PROVIDED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_LOCAL:
|
||||
case GNSS_EPH_SOURCE_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisSource::OTHER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_HEALTH_GOOD:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::GOOD;
|
||||
break;
|
||||
case GNSS_EPH_HEALTH_BAD:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::BAD;
|
||||
break;
|
||||
case GNSS_EPH_HEALTH_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
57
gps/android/1.0/location_api/LocationUtil.h
Normal file
57
gps/android/1.0/location_api/LocationUtil.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOCATION_UTIL_H
|
||||
#define LOCATION_UTIL_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void convertGnssLocation(Location& in, V1_0::GnssLocation& out);
|
||||
void convertGnssLocation(const V1_0::GnssLocation& in, Location& out);
|
||||
void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out);
|
||||
void convertGnssSvid(GnssSv& in, int16_t& out);
|
||||
void convertGnssSvid(GnssMeasurementsData& in, int16_t& out);
|
||||
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out);
|
||||
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out);
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // LOCATION_UTIL_H
|
||||
317
gps/android/1.0/location_api/MeasurementAPIClient.cpp
Normal file
317
gps/android/1.0/location_api/MeasurementAPIClient.cpp
Normal file
@@ -0,0 +1,317 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_MeasurementAPIClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "MeasurementAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssMeasurement& out);
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
||||
|
||||
MeasurementAPIClient::MeasurementAPIClient() :
|
||||
mGnssMeasurementCbIface(nullptr),
|
||||
mTracking(false)
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
MeasurementAPIClient::~MeasurementAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssMeasurementCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking();
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::startTracking()
|
||||
{
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
locationCallbacks.gnssMeasurementsCb =
|
||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||
onGnssMeasurementsCb(gnssMeasurementsNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
|
||||
TrackingOptions options = {};
|
||||
memset(&options, 0, sizeof(TrackingOptions));
|
||||
options.size = sizeof(TrackingOptions);
|
||||
options.minInterval = 1000;
|
||||
options.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
|
||||
mTracking = true;
|
||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
||||
locAPIStartTracking(options);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||
}
|
||||
|
||||
// for GpsMeasurementInterface
|
||||
void MeasurementAPIClient::measurementClose() {
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
mTracking = false;
|
||||
locAPIStopTracking();
|
||||
|
||||
// Clear measurement callback
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||
GnssMeasurementsNotification gnssMeasurementsNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu active: %d)",
|
||||
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
|
||||
if (mTracking) {
|
||||
mMutex.lock();
|
||||
sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
gnssMeasurementCbIface = mGnssMeasurementCbIface;
|
||||
}
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssMeasurementCbIface != nullptr) {
|
||||
V1_0::IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from GnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssMeasurement& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement));
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL;
|
||||
convertGnssSvid(in, out.svid);
|
||||
convertGnssConstellationType(in.svType, out.constellation);
|
||||
out.timeOffsetNs = in.timeOffsetNs;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC;
|
||||
out.receivedSvTimeInNs = in.receivedSvTimeNs;
|
||||
out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs;
|
||||
out.cN0DbHz = in.carrierToNoiseDbHz;
|
||||
out.pseudorangeRateMps = in.pseudorangeRateMps;
|
||||
out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP;
|
||||
out.accumulatedDeltaRangeM = in.adrMeters;
|
||||
out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters;
|
||||
out.carrierFrequencyHz = in.carrierFrequencyHz;
|
||||
out.carrierCycles = in.carrierCycles;
|
||||
out.carrierPhase = in.carrierPhase;
|
||||
out.carrierPhaseUncertainty = in.carrierPhaseUncertainty;
|
||||
uint8_t indicator =
|
||||
static_cast<uint8_t>(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN);
|
||||
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT)
|
||||
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT;
|
||||
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT)
|
||||
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT;
|
||||
out.multipathIndicator =
|
||||
static_cast<IGnssMeasurementCallback::GnssMultipathIndicator>(indicator);
|
||||
out.snrDb = in.signalToNoiseRatioDb;
|
||||
out.agcLevelDb = in.agcLevelDb;
|
||||
}
|
||||
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock));
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY;
|
||||
out.leapSecond = in.leapSecond;
|
||||
out.timeNs = in.timeNs;
|
||||
out.timeUncertaintyNs = in.timeUncertaintyNs;
|
||||
out.fullBiasNs = in.fullBiasNs;
|
||||
out.biasNs = in.biasNs;
|
||||
out.biasUncertaintyNs = in.biasUncertaintyNs;
|
||||
out.driftNsps = in.driftNsps;
|
||||
out.driftUncertaintyNsps = in.driftUncertaintyNsps;
|
||||
out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount;
|
||||
}
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
out.measurementCount = in.count;
|
||||
if (out.measurementCount > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) {
|
||||
LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.",
|
||||
__FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT);
|
||||
out.measurementCount = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT);
|
||||
}
|
||||
for (size_t i = 0; i < out.measurementCount; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i]);
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
78
gps/android/1.0/location_api/MeasurementAPIClient.h
Normal file
78
gps/android/1.0/location_api/MeasurementAPIClient.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEASUREMENT_API_CLINET_H
|
||||
#define MEASUREMENT_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurementCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class MeasurementAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
MeasurementAPIClient();
|
||||
MeasurementAPIClient(const MeasurementAPIClient&) = delete;
|
||||
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||
|
||||
// for GpsMeasurementInterface
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback);
|
||||
void measurementClose();
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking();
|
||||
|
||||
// callbacks we are interested in
|
||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||
|
||||
private:
|
||||
virtual ~MeasurementAPIClient();
|
||||
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface;
|
||||
|
||||
bool mTracking;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // MEASUREMENT_API_CLINET_H
|
||||
69
gps/android/1.0/service.cpp
Normal file
69
gps/android/1.0/service.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.gnss@1.0-service-qti"
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include "loc_cfg.h"
|
||||
#include "loc_misc_utils.h"
|
||||
|
||||
extern "C" {
|
||||
#include "vndfwk-detect.h"
|
||||
}
|
||||
|
||||
#ifdef ARCH_ARM_32
|
||||
#define DEFAULT_HW_BINDER_MEM_SIZE 65536
|
||||
#endif
|
||||
|
||||
using android::hardware::gnss::V1_0::IGnss;
|
||||
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::registerPassthroughServiceImplementation;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
|
||||
using android::status_t;
|
||||
using android::OK;
|
||||
|
||||
typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []);
|
||||
|
||||
int main() {
|
||||
|
||||
ALOGI("%s", __FUNCTION__);
|
||||
|
||||
int vendorInfo = getVendorEnhancedInfo();
|
||||
bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo );
|
||||
setVendorEnhanced(vendorEnhanced);
|
||||
|
||||
#ifdef ARCH_ARM_32
|
||||
android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE));
|
||||
#endif
|
||||
configureRpcThreadpool(1, true);
|
||||
status_t status;
|
||||
|
||||
status = registerPassthroughServiceImplementation<IGnss>();
|
||||
if (status == OK) {
|
||||
joinRpcThreadpool();
|
||||
} else {
|
||||
ALOGE("Error while registering IGnss 1.0 service: %d", status);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
208
gps/android/1.1/AGnss.cpp
Normal file
208
gps/android/1.1/AGnss.cpp
Normal file
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_AGnssInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "AGnss.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
static AGnss* spAGnss = nullptr;
|
||||
|
||||
AGnss::AGnss(Gnss* gnss) : mGnss(gnss) {
|
||||
spAGnss = this;
|
||||
}
|
||||
|
||||
AGnss::~AGnss() {
|
||||
spAGnss = nullptr;
|
||||
}
|
||||
|
||||
void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){
|
||||
if (nullptr != spAGnss) {
|
||||
spAGnss->statusIpV4Cb(status);
|
||||
}
|
||||
}
|
||||
|
||||
void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
|
||||
IAGnssCallback::AGnssStatusIpV4 st = {};
|
||||
|
||||
switch (status.type) {
|
||||
case LOC_AGPS_TYPE_SUPL:
|
||||
st.type = IAGnssCallback::AGnssType::TYPE_SUPL;
|
||||
break;
|
||||
case LOC_AGPS_TYPE_C2K:
|
||||
st.type = IAGnssCallback::AGnssType::TYPE_C2K;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid type: %d", status.type);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (status.status) {
|
||||
case LOC_GPS_REQUEST_AGPS_DATA_CONN:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_RELEASE_AGPS_DATA_CONN:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONNECTED:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_DONE:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_FAILED:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid status: %d", status.status);
|
||||
return;
|
||||
}
|
||||
st.ipV4Addr = status.ipV4Addr;
|
||||
|
||||
mMutex.lock();
|
||||
auto aGnssCbIface = mAGnssCbIface;
|
||||
mMutex.unlock();
|
||||
if (aGnssCbIface != nullptr) {
|
||||
auto r = aGnssCbIface->agnssStatusIpV4Cb(st);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Save the interface
|
||||
mMutex.lock();
|
||||
mAGnssCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
AgpsCbInfo cbInfo = {};
|
||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||
cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES;
|
||||
|
||||
mGnss->getGnssInterface()->agpsInit(cbInfo);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnClosed() {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnFailed() {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnOpen(const hidl_string& apn,
|
||||
IAGnss::ApnIpType apnIpType) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Validate */
|
||||
if(apn.empty()){
|
||||
LOC_LOGE("Invalid APN");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str());
|
||||
|
||||
AGpsBearerType bearerType;
|
||||
switch (apnIpType) {
|
||||
case IAGnss::ApnIpType::IPV4:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
case IAGnss::ApnIpType::IPV6:
|
||||
bearerType = AGPS_APN_BEARER_IPV6;
|
||||
break;
|
||||
case IAGnss::ApnIpType::IPV4V6:
|
||||
bearerType = AGPS_APN_BEARER_IPV4V6;
|
||||
break;
|
||||
default:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnOpen(
|
||||
LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname,
|
||||
int32_t port) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
|
||||
config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
|
||||
if (type == IAGnssCallback::AGnssType::TYPE_SUPL) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL;
|
||||
} else if (type == IAGnssCallback::AGnssType::TYPE_C2K) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K;
|
||||
} else {
|
||||
LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast<int>(type));
|
||||
return false;
|
||||
}
|
||||
config.assistanceServer.hostName = strdup(hostname.c_str());
|
||||
config.assistanceServer.port = port;
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
81
gps/android/1.1/AGnss.h
Normal file
81
gps/android/1.1/AGnss.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IAGnss.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnss;
|
||||
using ::android::hardware::gnss::V1_0::IAGnssCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct AGnss : public IAGnss {
|
||||
|
||||
AGnss(Gnss* gnss);
|
||||
~AGnss();
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow.
|
||||
* These declarations were generated from IAGnss.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IAGnssCallback>& callback) override;
|
||||
|
||||
Return<bool> dataConnClosed() override;
|
||||
|
||||
Return<bool> dataConnFailed() override;
|
||||
|
||||
Return<bool> dataConnOpen(const hidl_string& apn,
|
||||
IAGnss::ApnIpType apnIpType) override;
|
||||
|
||||
Return<bool> setServer(IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname, int32_t port) override;
|
||||
|
||||
void statusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
/* Data call setup callback passed down to GNSS HAL implementation */
|
||||
static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
std::mutex mMutex;
|
||||
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
115
gps/android/1.1/AGnssRil.cpp
Normal file
115
gps/android/1.1/AGnssRil.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc__AGnssRilInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "Gnss.h"
|
||||
#include "AGnssRil.h"
|
||||
#include <DataItemConcreteTypes.h>
|
||||
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
}
|
||||
|
||||
AGnssRil::~AGnssRil() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
}
|
||||
|
||||
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
// Extra NetworkTypes not available in IAgnssRil enums
|
||||
const int NetworkType_BLUETOOTH = 7;
|
||||
const int NetworkType_ETHERNET = 9;
|
||||
const int NetworkType_PROXY = 16;
|
||||
std::string apn("");
|
||||
|
||||
// for XTRA
|
||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||
switch(type)
|
||||
{
|
||||
case IAGnssRil::NetworkType::MOBILE:
|
||||
typeout = loc_core::TYPE_MOBILE;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIFI:
|
||||
typeout = loc_core::TYPE_WIFI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::MMS:
|
||||
typeout = loc_core::TYPE_MMS;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::SUPL:
|
||||
typeout = loc_core::TYPE_SUPL;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::DUN:
|
||||
typeout = loc_core::TYPE_DUN;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::HIPRI:
|
||||
typeout = loc_core::TYPE_HIPRI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIMAX:
|
||||
typeout = loc_core::TYPE_WIMAX;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
int networkType = (int) type;
|
||||
// Handling network types not available in IAgnssRil
|
||||
switch(networkType)
|
||||
{
|
||||
case NetworkType_BLUETOOTH:
|
||||
typeout = loc_core::TYPE_BLUETOOTH;
|
||||
break;
|
||||
case NetworkType_ETHERNET:
|
||||
typeout = loc_core::TYPE_ETHERNET;
|
||||
break;
|
||||
case NetworkType_PROXY:
|
||||
typeout = loc_core::TYPE_PROXY;
|
||||
break;
|
||||
default:
|
||||
typeout = loc_core::TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout, false, 0, apn);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
83
gps/android/1.1/AGnssRil.h
Normal file
83
gps/android/1.1/AGnssRil.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
|
||||
#include <android/hardware/gnss/1.0/IAGnssRil.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRil;
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRilCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
/*
|
||||
* Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface
|
||||
* allows the GNSS chipset to request radio interface layer information from Android platform.
|
||||
* Examples of such information are reference location, unique subscriber ID, phone number string
|
||||
* and network availability changes. Also contains wrapper methods to allow methods from
|
||||
* IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL.
|
||||
*/
|
||||
struct AGnssRil : public IAGnssRil {
|
||||
AGnssRil(Gnss* gnss);
|
||||
~AGnssRil();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
|
||||
* These declarations were generated from IAGnssRil.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IAGnssRilCallback>& /*callback*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<void> setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<bool> setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override {
|
||||
return false;
|
||||
}
|
||||
Return<bool> updateNetworkAvailability(bool /*available*/,
|
||||
const hidl_string& /*apn*/) override {
|
||||
return false;
|
||||
}
|
||||
Return<bool> updateNetworkState(bool connected, NetworkType type, bool roaming) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
98
gps/android/1.1/Android.mk
Normal file
98
gps/android/1.1/Android.mk
Normal file
@@ -0,0 +1,98 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti
|
||||
|
||||
# activate the following line for debug purposes only, comment out for production
|
||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_SRC_FILES := \
|
||||
AGnss.cpp \
|
||||
Gnss.cpp \
|
||||
GnssBatching.cpp \
|
||||
GnssGeofencing.cpp \
|
||||
GnssMeasurement.cpp \
|
||||
GnssNi.cpp \
|
||||
GnssConfiguration.cpp \
|
||||
GnssDebug.cpp \
|
||||
AGnssRil.cpp
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
location_api/LocationUtil.cpp \
|
||||
location_api/GnssAPIClient.cpp \
|
||||
location_api/GeofenceAPIClient.cpp \
|
||||
location_api/BatchingAPIClient.cpp \
|
||||
location_api/MeasurementAPIClient.cpp \
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers \
|
||||
liblocbatterylistener_headers
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libhidlbase \
|
||||
libcutils \
|
||||
libutils \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.gnss@1.1 \
|
||||
android.hardware.health@1.0 \
|
||||
android.hardware.health@2.0 \
|
||||
android.hardware.health@2.1 \
|
||||
android.hardware.power@1.2 \
|
||||
libbase
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libloc_core \
|
||||
libgps.utils \
|
||||
libdl \
|
||||
liblocation_api \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
LOCAL_STATIC_LIBRARIES := liblocbatterylistener
|
||||
LOCAL_STATIC_LIBRARIES += libhealthhalutils
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti
|
||||
|
||||
# activate the following line for debug purposes only, comment out for production
|
||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
||||
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc
|
||||
LOCAL_SRC_FILES := \
|
||||
service.cpp \
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libcutils \
|
||||
libdl \
|
||||
libbase \
|
||||
libutils \
|
||||
libgps.utils \
|
||||
libqti_vndfwk_detect_vendor \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libhidlbase \
|
||||
android.hardware.gnss@1.0 \
|
||||
android.hardware.gnss@1.1 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
478
gps/android/1.1/Gnss.cpp
Normal file
478
gps/android/1.1/Gnss.cpp
Normal file
@@ -0,0 +1,478 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssInterface"
|
||||
#define LOG_NDEBUG 0
|
||||
|
||||
#include <fstream>
|
||||
#include <log_util.h>
|
||||
#include <dlfcn.h>
|
||||
#include <cutils/properties.h>
|
||||
#include "Gnss.h"
|
||||
#include <LocationUtil.h>
|
||||
|
||||
#include "battery_listener.h"
|
||||
#include "loc_misc_utils.h"
|
||||
|
||||
typedef const GnssInterface* (getLocationInterface)();
|
||||
|
||||
#define IMAGES_INFO_FILE "/sys/devices/soc0/images"
|
||||
#define DELIMITER ";"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
static sp<Gnss> sGnss;
|
||||
static std::string getVersionString() {
|
||||
static std::string version;
|
||||
if (!version.empty())
|
||||
return version;
|
||||
|
||||
char value[PROPERTY_VALUE_MAX] = {0};
|
||||
property_get("ro.hardware", value, "unknown");
|
||||
version.append(value).append(DELIMITER);
|
||||
|
||||
std::ifstream in(IMAGES_INFO_FILE);
|
||||
std::string s;
|
||||
while(getline(in, s)) {
|
||||
std::size_t found = s.find("CRM:");
|
||||
if (std::string::npos == found) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip over space characters after "CRM:"
|
||||
const char* substr = s.c_str();
|
||||
found += 4;
|
||||
while (0 != substr[found] && isspace(substr[found])) {
|
||||
found++;
|
||||
}
|
||||
if (s.find("11:") != found) {
|
||||
continue;
|
||||
}
|
||||
s.erase(0, found + 3);
|
||||
|
||||
found = s.find_first_of("\r\n");
|
||||
if (std::string::npos != found) {
|
||||
s.erase(s.begin() + found, s.end());
|
||||
}
|
||||
version.append(s).append(DELIMITER);
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gnss = mGnss.promote();
|
||||
if (gnss != nullptr) {
|
||||
gnss->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
void location_on_battery_status_changed(bool charging) {
|
||||
LOC_LOGd("battery status changed to %s charging", charging ? "" : "not");
|
||||
if (sGnss != nullptr) {
|
||||
sGnss->getGnssInterface()->updateBatteryStatus(charging);
|
||||
}
|
||||
}
|
||||
Gnss::Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
sGnss = this;
|
||||
// initilize gnss interface at first in case needing notify battery status
|
||||
sGnss->getGnssInterface()->initialize();
|
||||
// register health client to listen on battery change
|
||||
loc_extn_battery_properties_listener_init(location_on_battery_status_changed);
|
||||
// clear pending GnssConfig
|
||||
memset(&mPendingConfig, 0, sizeof(GnssConfig));
|
||||
|
||||
mGnssDeathRecipient = new GnssDeathRecipient(sGnss);
|
||||
}
|
||||
|
||||
Gnss::~Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
sGnss = nullptr;
|
||||
}
|
||||
|
||||
void Gnss::handleClientDeath() {
|
||||
getGnssInterface()->resetNetworkInfo();
|
||||
cleanup();
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(nullptr, nullptr);
|
||||
}
|
||||
mGnssCbIface = nullptr;
|
||||
mGnssNiCbIface = nullptr;
|
||||
mGnssCbIface_1_1 = nullptr;
|
||||
}
|
||||
|
||||
GnssAPIClient* Gnss::getApi() {
|
||||
if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__);
|
||||
return mApi;
|
||||
}
|
||||
|
||||
if (mPendingConfig.size == sizeof(GnssConfig)) {
|
||||
// we have pending GnssConfig
|
||||
mApi->gnssConfigurationUpdate(mPendingConfig);
|
||||
// clear size to invalid mPendingConfig
|
||||
mPendingConfig.size = 0;
|
||||
if (mPendingConfig.assistanceServer.hostName != nullptr) {
|
||||
free((void*)mPendingConfig.assistanceServer.hostName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__);
|
||||
}
|
||||
return mApi;
|
||||
}
|
||||
|
||||
const GnssInterface* Gnss::getGnssInterface() {
|
||||
static bool getGnssInterfaceFailed = false;
|
||||
if (nullptr == mGnssInterface && !getGnssInterfaceFailed) {
|
||||
void * libHandle = nullptr;
|
||||
getLocationInterface* getter = (getLocationInterface*)
|
||||
dlGetSymFromLib(libHandle, "libgnss.so", "getGnssInterface");
|
||||
|
||||
if (nullptr == getter) {
|
||||
getGnssInterfaceFailed = true;
|
||||
} else {
|
||||
mGnssInterface = (const GnssInterface*)(*getter)();
|
||||
}
|
||||
}
|
||||
return mGnssInterface;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
|
||||
}
|
||||
mGnssCbIface = callback;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
|
||||
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
|
||||
api->requestCapabilities();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setGnssNiCb(const sp<IGnssNiCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssNiCbIface = callback;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::updateConfiguration(GnssConfig& gnssConfig) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
api->gnssConfigurationUpdate(gnssConfig);
|
||||
} else if (gnssConfig.flags != 0) {
|
||||
// api is not ready yet, update mPendingConfig with gnssConfig
|
||||
mPendingConfig.size = sizeof(GnssConfig);
|
||||
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
|
||||
mPendingConfig.gpsLock = gnssConfig.gpsLock;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
|
||||
mPendingConfig.suplVersion = gnssConfig.suplVersion;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
|
||||
mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
|
||||
mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type;
|
||||
if (mPendingConfig.assistanceServer.hostName != nullptr) {
|
||||
free((void*)mPendingConfig.assistanceServer.hostName);
|
||||
mPendingConfig.assistanceServer.hostName =
|
||||
strdup(gnssConfig.assistanceServer.hostName);
|
||||
}
|
||||
mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
mPendingConfig.lppProfileMask = gnssConfig.lppProfileMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT;
|
||||
mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT;
|
||||
mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||
mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
|
||||
mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
|
||||
mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
|
||||
mPendingConfig.suplModeMask = gnssConfig.suplModeMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
|
||||
mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::start() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssStart();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::stop() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssStop();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<void> Gnss::cleanup() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssDisable();
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
api->gnssDeleteAidingData(aidingDataFlags);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
|
||||
preferredAccuracyMeters, preferredTimeMs);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mAGnssIface = new AGnss(this);
|
||||
return mAGnssIface;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssNi = new GnssNi(this);
|
||||
return mGnssNi;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasurement == nullptr)
|
||||
mGnssMeasurement = new GnssMeasurement(mGnssMeasurement);
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssGeofencingIface = new GnssGeofencing(mGnssGeofencingIface);
|
||||
return mGnssGeofencingIface;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() {
|
||||
mGnssBatching = new GnssBatching(mGnssBatching);
|
||||
return mGnssBatching;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssDebug = new GnssDebug(this);
|
||||
return mGnssDebug;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
|
||||
mGnssRil = new AGnssRil(this);
|
||||
return mGnssRil;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnss follow.
|
||||
Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
callback->gnssNameCb(getVersionString());
|
||||
mGnssCbIface_1_1 = callback;
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||
odcpiRequestCb(odcpiRequest);
|
||||
};
|
||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||
}
|
||||
return setCallback(callback);
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs,
|
||||
bool lowPowerMode) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
GnssPowerMode powerMode = lowPowerMode?
|
||||
GNSS_POWER_MODE_M4 : GNSS_POWER_MODE_M2;
|
||||
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
|
||||
preferredAccuracyMeters, preferredTimeMs, powerMode, minIntervalMs);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<sp<V1_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_1_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasurement == nullptr)
|
||||
mGnssMeasurement = new GnssMeasurement(mGnssMeasurement);
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
|
||||
Return<sp<V1_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_1_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssConfig == nullptr)
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectBestLocation(const GnssLocation& gnssLocation) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
Location location = {};
|
||||
convertGnssLocation(gnssLocation, location);
|
||||
location.techMask |= LOCATION_TECHNOLOGY_HYBRID_BIT;
|
||||
gnssInterface->odcpiInject(location);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (ODCPI_REQUEST_TYPE_STOP == request.type) {
|
||||
return;
|
||||
}
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
// For emergency mode, request DBH (Device based hybrid) location
|
||||
// Mark Independent from GNSS flag to false.
|
||||
if (ODCPI_REQUEST_TYPE_START == request.type) {
|
||||
auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGv("Unsupported ODCPI request type: %d", request.type);
|
||||
}
|
||||
} else {
|
||||
LOC_LOGe("ODCPI request not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
V1_0::IGnss* HIDL_FETCH_IGnss(const char* hal) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
V1_0::IGnss* iface = nullptr;
|
||||
iface = new Gnss();
|
||||
if (iface == nullptr) {
|
||||
LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal);
|
||||
}
|
||||
return iface;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
156
gps/android/1.1/Gnss.h
Normal file
156
gps/android/1.1/Gnss.h
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018-2018-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
|
||||
#include <AGnss.h>
|
||||
#include <AGnssRil.h>
|
||||
#include <GnssBatching.h>
|
||||
#include <GnssConfiguration.h>
|
||||
#include <GnssGeofencing.h>
|
||||
#include <GnssMeasurement.h>
|
||||
#include <GnssNi.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <GnssAPIClient.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_memory;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
struct Gnss : public IGnss {
|
||||
Gnss();
|
||||
~Gnss();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
|
||||
* These declarations were generated from Gnss.hal.
|
||||
*/
|
||||
Return<bool> setCallback(const sp<V1_0::IGnssCallback>& callback) override;
|
||||
Return<bool> start() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
Return<bool> injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) override;
|
||||
Return<bool> injectTime(int64_t timeMs,
|
||||
int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) override;
|
||||
Return<void> deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
|
||||
Return<bool> setPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) override;
|
||||
Return<sp<V1_0::IAGnss>> getExtensionAGnss() override;
|
||||
Return<sp<V1_0::IGnssNi>> getExtensionGnssNi() override;
|
||||
Return<sp<V1_0::IGnssMeasurement>> getExtensionGnssMeasurement() override;
|
||||
Return<sp<V1_0::IGnssConfiguration>> getExtensionGnssConfiguration() override;
|
||||
Return<sp<V1_0::IGnssGeofencing>> getExtensionGnssGeofencing() override;
|
||||
Return<sp<V1_0::IGnssBatching>> getExtensionGnssBatching() override;
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> getExtensionAGnssRil() override;
|
||||
|
||||
inline Return<sp<V1_0::IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline Return<sp<V1_0::IGnssXtra>> getExtensionXtra() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnss follow.
|
||||
Return<bool> setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) override;
|
||||
Return<bool> setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs, bool lowPowerMode) override;
|
||||
Return<sp<V1_1::IGnssMeasurement>> getExtensionGnssMeasurement_1_1() override;
|
||||
Return<sp<V1_1::IGnssConfiguration>> getExtensionGnssConfiguration_1_1() override;
|
||||
Return<bool> injectBestLocation(const GnssLocation& location) override;
|
||||
|
||||
// These methods are not part of the IGnss base class.
|
||||
GnssAPIClient* getApi();
|
||||
Return<bool> setGnssNiCb(const sp<IGnssNiCallback>& niCb);
|
||||
Return<bool> updateConfiguration(GnssConfig& gnssConfig);
|
||||
const GnssInterface* getGnssInterface();
|
||||
|
||||
// Callback for ODCPI request
|
||||
void odcpiRequestCb(const OdcpiRequestInfo& request);
|
||||
|
||||
private:
|
||||
struct GnssDeathRecipient : hidl_death_recipient {
|
||||
GnssDeathRecipient(const sp<Gnss>& gnss) : mGnss(gnss) {
|
||||
}
|
||||
~GnssDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<Gnss> mGnss;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
sp<GnssDeathRecipient> mGnssDeathRecipient = nullptr;
|
||||
|
||||
sp<AGnss> mAGnssIface = nullptr;
|
||||
sp<GnssNi> mGnssNi = nullptr;
|
||||
sp<GnssMeasurement> mGnssMeasurement = nullptr;
|
||||
sp<GnssConfiguration> mGnssConfig = nullptr;
|
||||
sp<GnssGeofencing> mGnssGeofencingIface = nullptr;
|
||||
sp<GnssBatching> mGnssBatching = nullptr;
|
||||
sp<IGnssDebug> mGnssDebug = nullptr;
|
||||
sp<AGnssRil> mGnssRil = nullptr;
|
||||
|
||||
GnssAPIClient* mApi = nullptr;
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface = nullptr;
|
||||
sp<V1_1::IGnssCallback> mGnssCbIface_1_1 = nullptr;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
GnssConfig mPendingConfig;
|
||||
const GnssInterface* mGnssInterface = nullptr;
|
||||
};
|
||||
|
||||
extern "C" V1_0::IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
132
gps/android/1.1/GnssBatching.cpp
Normal file
132
gps/android/1.1/GnssBatching.cpp
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssBatchingInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <BatchingAPIClient.h>
|
||||
#include "GnssBatching.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gnssBatching = mGnssBatching.promote();
|
||||
if (gnssBatching != nullptr) {
|
||||
gnssBatching->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
GnssBatching::~GnssBatching() {
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
GnssBatching::handleClientDeath() {
|
||||
stop();
|
||||
cleanup();
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(nullptr);
|
||||
}
|
||||
mGnssBatchingCbIface = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
|
||||
if (mGnssBatchingDeathRecipient == nullptr) {
|
||||
mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(mSelf);
|
||||
}
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(callback);
|
||||
} else {
|
||||
mApi = new BatchingAPIClient(callback);
|
||||
}
|
||||
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
mGnssBatchingCbIface = callback;
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<uint16_t> GnssBatching::getBatchSize() {
|
||||
uint16_t ret = 0;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->getBatchSize();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
|
||||
bool ret = false;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->startSession(options);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<void> GnssBatching::flush() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->flushBatchedLocations();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> GnssBatching::stop() {
|
||||
bool ret = false;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->stopSession();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<void> GnssBatching::cleanup() {
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
85
gps/android/1.1/GnssBatching.h
Normal file
85
gps/android/1.1/GnssBatching.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
|
||||
using ::android::hidl::base::V1_0::IBase;
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_memory;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
|
||||
class BatchingAPIClient;
|
||||
struct GnssBatching : public IGnssBatching {
|
||||
inline GnssBatching(const sp<GnssBatching>& self) : mSelf(self), mApi(nullptr) {}
|
||||
~GnssBatching();
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
|
||||
Return<uint16_t> getBatchSize() override;
|
||||
Return<bool> start(const IGnssBatching::Options& options ) override;
|
||||
Return<void> flush() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
|
||||
private:
|
||||
struct GnssBatchingDeathRecipient : hidl_death_recipient {
|
||||
GnssBatchingDeathRecipient(const sp<GnssBatching>& gnssBatching) :
|
||||
mGnssBatching(gnssBatching) {
|
||||
}
|
||||
~GnssBatchingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<GnssBatching> mGnssBatching;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
// this has to be a reference, not a copy
|
||||
// because the pointer is not set when mSelf is assigned
|
||||
const sp<GnssBatching>& mSelf;
|
||||
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
|
||||
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
|
||||
BatchingAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
308
gps/android/1.1/GnssConfiguration.cpp
Normal file
308
gps/android/1.1/GnssConfiguration.cpp
Normal file
@@ -0,0 +1,308 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, 2021, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssConfigurationInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssConfiguration.h"
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::GnssConstellationType;
|
||||
|
||||
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setSuplEs(bool enabled) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
|
||||
config.suplEmergencyServices = (enabled ?
|
||||
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES :
|
||||
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO);
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setSuplVersion(uint32_t version) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
|
||||
switch (version) {
|
||||
case 0x00020004:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4;
|
||||
break;
|
||||
case 0x00020002:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2;
|
||||
break;
|
||||
case 0x00020000:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0;
|
||||
break;
|
||||
case 0x00010000:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setSuplMode(uint8_t mode) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
|
||||
switch (mode) {
|
||||
case 0:
|
||||
config.suplModeMask = 0; // STANDALONE ONLY
|
||||
break;
|
||||
case 1:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT;
|
||||
break;
|
||||
case 2:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT;
|
||||
break;
|
||||
case 3:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setLppProfile(uint8_t lppProfileMask) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config = {};
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
config.lppProfileMask = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; //default
|
||||
|
||||
if (lppProfileMask & (1<<0)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_BIT;
|
||||
}
|
||||
if (lppProfileMask & (1<<1)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_BIT;
|
||||
}
|
||||
if (lppProfileMask & (1<<2)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_OVER_NR5G_SA_BIT;
|
||||
}
|
||||
if (lppProfileMask & (1<<3)) {
|
||||
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_OVER_NR5G_SA_BIT;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
|
||||
config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||
if (protocol & (1<<0)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<1)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<2)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<3)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setGpsLock(uint8_t lock) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
|
||||
switch (lock) {
|
||||
case 0:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
|
||||
break;
|
||||
case 1:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO;
|
||||
break;
|
||||
case 2:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NFW_ALL;
|
||||
break;
|
||||
case 3:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
|
||||
config.emergencyPdnForEmergencySupl = (enabled ?
|
||||
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES :
|
||||
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO);
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setBlacklist(
|
||||
const hidl_vec<GnssConfiguration::BlacklistedSource>& blacklist) {
|
||||
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (nullptr == mGnss) {
|
||||
LOC_LOGe("mGnss is null");
|
||||
return false;
|
||||
}
|
||||
|
||||
// blValid is true if blacklist is empty, i.e. clearing the BL;
|
||||
// if blacklist is not empty, blValid is initialied to false, and later
|
||||
// updated in the for loop to become true only if there is at least
|
||||
// one {constellation, svid} in the list that is valid.
|
||||
bool blValid = (0 == blacklist.size());
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
|
||||
config.blacklistedSvIds.clear();
|
||||
|
||||
GnssSvIdSource source = {};
|
||||
for (int idx = 0; idx < (int)blacklist.size(); idx++) {
|
||||
// Set blValid true if any one source is valid
|
||||
blValid = setBlacklistedSource(source, blacklist[idx]) || blValid;
|
||||
config.blacklistedSvIds.push_back(source);
|
||||
}
|
||||
|
||||
// Update configuration only if blValid is true
|
||||
// i.e. only if atleast one source is valid for blacklisting
|
||||
return (blValid && mGnss->updateConfiguration(config));
|
||||
}
|
||||
|
||||
bool GnssConfiguration::setBlacklistedSource(
|
||||
GnssSvIdSource& copyToSource,
|
||||
const GnssConfiguration::BlacklistedSource& copyFromSource) {
|
||||
|
||||
bool retVal = true;
|
||||
uint16_t svIdOffset = 0;
|
||||
copyToSource.size = sizeof(GnssSvIdSource);
|
||||
copyToSource.svId = copyFromSource.svid;
|
||||
|
||||
switch(copyFromSource.constellation) {
|
||||
case GnssConstellationType::GPS:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_GPS;
|
||||
LOC_LOGe("GPS SVs can't be blacklisted.");
|
||||
retVal = false;
|
||||
break;
|
||||
case GnssConstellationType::SBAS:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_SBAS;
|
||||
LOC_LOGe("SBAS SVs can't be blacklisted.");
|
||||
retVal = false;
|
||||
break;
|
||||
case GnssConstellationType::GLONASS:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_GLONASS;
|
||||
svIdOffset = GNSS_SV_CONFIG_GLO_INITIAL_SV_ID - 1;
|
||||
break;
|
||||
case GnssConstellationType::QZSS:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_QZSS;
|
||||
svIdOffset = 0;
|
||||
break;
|
||||
case GnssConstellationType::BEIDOU:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_BEIDOU;
|
||||
svIdOffset = GNSS_SV_CONFIG_BDS_INITIAL_SV_ID - 1;
|
||||
break;
|
||||
case GnssConstellationType::GALILEO:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_GALILEO;
|
||||
svIdOffset = GNSS_SV_CONFIG_GAL_INITIAL_SV_ID - 1;
|
||||
break;
|
||||
default:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
|
||||
LOC_LOGe("Invalid constellation %d", copyFromSource.constellation);
|
||||
retVal = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (copyToSource.svId > 0 && svIdOffset > 0) {
|
||||
copyToSource.svId += svIdOffset;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
78
gps/android/1.1/GnssConfiguration.h
Normal file
78
gps/android/1.1/GnssConfiguration.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
|
||||
/* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
|
||||
#include <android/hardware/gnss/1.1/IGnssConfiguration.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_1::IGnssConfiguration;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
/*
|
||||
* Interface for passing GNSS configuration info from platform to HAL.
|
||||
*/
|
||||
struct Gnss;
|
||||
struct GnssConfiguration : public IGnssConfiguration {
|
||||
GnssConfiguration(Gnss* gnss);
|
||||
~GnssConfiguration() = default;
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow.
|
||||
* These declarations were generated from IGnssConfiguration.hal.
|
||||
*/
|
||||
Return<bool> setSuplVersion(uint32_t version) override;
|
||||
Return<bool> setSuplMode(uint8_t mode) override;
|
||||
Return<bool> setSuplEs(bool enabled) override;
|
||||
Return<bool> setLppProfile(uint8_t lppProfileMask) override;
|
||||
Return<bool> setGlonassPositioningProtocol(uint8_t protocol) override;
|
||||
Return<bool> setEmergencySuplPdn(bool enable) override;
|
||||
Return<bool> setGpsLock(uint8_t lock) override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
|
||||
Return<bool> setBlacklist(
|
||||
const hidl_vec<GnssConfiguration::BlacklistedSource>& blacklist) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
bool setBlacklistedSource(
|
||||
GnssSvIdSource& copyToSource,
|
||||
const GnssConfiguration::BlacklistedSource& copyFromSource);
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
175
gps/android/1.1/GnssDebug.cpp
Normal file
175
gps/android/1.1/GnssDebug.cpp
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssDebugInterface"
|
||||
|
||||
#include <log/log.h>
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssDebug.h"
|
||||
#include "LocationUtil.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_vec;
|
||||
|
||||
#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000)
|
||||
#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000)
|
||||
#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500)
|
||||
#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180)
|
||||
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN (999) // 999 ns
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX (1.57783680E17) // 5 years in ns
|
||||
#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm
|
||||
|
||||
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* This methods requests position, time and satellite ephemeris debug information
|
||||
* from the HAL.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
|
||||
{
|
||||
LOC_LOGD("%s]: ", __func__);
|
||||
|
||||
DebugData data = { };
|
||||
|
||||
if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){
|
||||
LOC_LOGE("GnssDebug - Null GNSS interface");
|
||||
_hidl_cb(data);
|
||||
return Void();
|
||||
}
|
||||
|
||||
// get debug report snapshot via hal interface
|
||||
GnssDebugReport reports = { };
|
||||
mGnss->getGnssInterface()->getDebugReport(reports);
|
||||
|
||||
// location block
|
||||
if (reports.mLocation.mValid) {
|
||||
data.position.valid = true;
|
||||
data.position.latitudeDegrees = reports.mLocation.mLocation.latitude;
|
||||
data.position.longitudeDegrees = reports.mLocation.mLocation.longitude;
|
||||
data.position.altitudeMeters = reports.mLocation.mLocation.altitude;
|
||||
|
||||
data.position.speedMetersPerSec =
|
||||
(double)(reports.mLocation.mLocation.speed);
|
||||
data.position.bearingDegrees =
|
||||
(double)(reports.mLocation.mLocation.bearing);
|
||||
data.position.horizontalAccuracyMeters =
|
||||
(double)(reports.mLocation.mLocation.accuracy);
|
||||
data.position.verticalAccuracyMeters =
|
||||
reports.mLocation.verticalAccuracyMeters;
|
||||
data.position.speedAccuracyMetersPerSecond =
|
||||
reports.mLocation.speedAccuracyMetersPerSecond;
|
||||
data.position.bearingAccuracyDegrees =
|
||||
reports.mLocation.bearingAccuracyDegrees;
|
||||
|
||||
timeval tv_now, tv_report;
|
||||
tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec;
|
||||
tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL;
|
||||
gettimeofday(&tv_now, NULL);
|
||||
data.position.ageSeconds =
|
||||
(tv_now.tv_sec - tv_report.tv_sec) +
|
||||
(float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000;
|
||||
}
|
||||
else {
|
||||
data.position.valid = false;
|
||||
}
|
||||
|
||||
if (data.position.horizontalAccuracyMeters <= 0 ||
|
||||
data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) {
|
||||
data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS;
|
||||
}
|
||||
if (data.position.verticalAccuracyMeters <= 0 ||
|
||||
data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) {
|
||||
data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS;
|
||||
}
|
||||
if (data.position.speedAccuracyMetersPerSecond <= 0 ||
|
||||
data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) {
|
||||
data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC;
|
||||
}
|
||||
if (data.position.bearingAccuracyDegrees <= 0 ||
|
||||
data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) {
|
||||
data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG;
|
||||
}
|
||||
|
||||
// time block
|
||||
if (reports.mTime.mValid) {
|
||||
data.time.timeEstimate = reports.mTime.timeEstimate;
|
||||
data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs;
|
||||
data.time.frequencyUncertaintyNsPerSec =
|
||||
reports.mTime.frequencyUncertaintyNsPerSec;
|
||||
}
|
||||
|
||||
if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
|
||||
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
|
||||
}
|
||||
if (data.time.timeUncertaintyNs <= 0) {
|
||||
data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN;
|
||||
} else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) {
|
||||
data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX;
|
||||
}
|
||||
if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
|
||||
data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {
|
||||
data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC;
|
||||
}
|
||||
|
||||
// satellite data block
|
||||
SatelliteData s = { };
|
||||
std::vector<SatelliteData> s_array = { };
|
||||
|
||||
for (uint32_t i=0; i<reports.mSatelliteInfo.size(); i++) {
|
||||
memset(&s, 0, sizeof(s));
|
||||
s.svid = reports.mSatelliteInfo[i].svid;
|
||||
convertGnssConstellationType(
|
||||
reports.mSatelliteInfo[i].constellation, s.constellation);
|
||||
convertGnssEphemerisType(
|
||||
reports.mSatelliteInfo[i].mEphemerisType, s.ephemerisType);
|
||||
convertGnssEphemerisSource(
|
||||
reports.mSatelliteInfo[i].mEphemerisSource, s.ephemerisSource);
|
||||
convertGnssEphemerisHealth(
|
||||
reports.mSatelliteInfo[i].mEphemerisHealth, s.ephemerisHealth);
|
||||
|
||||
s.ephemerisAgeSeconds =
|
||||
reports.mSatelliteInfo[i].ephemerisAgeSeconds;
|
||||
s.serverPredictionIsAvailable =
|
||||
reports.mSatelliteInfo[i].serverPredictionIsAvailable;
|
||||
s.serverPredictionAgeSeconds =
|
||||
reports.mSatelliteInfo[i].serverPredictionAgeSeconds;
|
||||
|
||||
s_array.push_back(s);
|
||||
}
|
||||
data.satelliteDataArray = s_array;
|
||||
|
||||
// callback HIDL with collected debug data
|
||||
_hidl_cb(data);
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
59
gps/android/1.1/GnssDebug.h
Normal file
59
gps/android/1.1/GnssDebug.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssDebug.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssDebug;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
/* Interface for GNSS Debug support. */
|
||||
struct Gnss;
|
||||
struct GnssDebug : public IGnssDebug {
|
||||
GnssDebug(Gnss* gnss);
|
||||
~GnssDebug() {};
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
|
||||
* These declarations were generated from IGnssDebug.hal.
|
||||
*/
|
||||
Return<void> getDebugData(getDebugData_cb _hidl_cb) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
150
gps/android/1.1/GnssGeofencing.cpp
Normal file
150
gps/android/1.1/GnssGeofencing.cpp
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "GnssHal_GnssGeofencing"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <GeofenceAPIClient.h>
|
||||
#include "GnssGeofencing.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gnssGeofencing = mGnssGeofencing.promote();
|
||||
if (gnssGeofencing != nullptr) {
|
||||
gnssGeofencing->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
GnssGeofencing::~GnssGeofencing() {
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GnssGeofencing::handleClientDeath() {
|
||||
|
||||
removeAllGeofences();
|
||||
if (mApi != nullptr) {
|
||||
mApi->upcateCallback(nullptr);
|
||||
}
|
||||
mGnssGeofencingCbIface = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
|
||||
if (mGnssGeofencingDeathRecipient == nullptr) {
|
||||
mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(mSelf);
|
||||
}
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->upcateCallback(callback);
|
||||
} else {
|
||||
mApi = new GeofenceAPIClient(callback);
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient);
|
||||
}
|
||||
mGnssGeofencingCbIface = callback;
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::addGeofence(
|
||||
int32_t geofenceId,
|
||||
double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
double radiusMeters,
|
||||
IGnssGeofenceCallback::GeofenceTransition lastTransition,
|
||||
int32_t monitorTransitions,
|
||||
uint32_t notificationResponsivenessMs,
|
||||
uint32_t unknownTimerMs) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceAdd(
|
||||
geofenceId,
|
||||
latitudeDegrees,
|
||||
longitudeDegrees,
|
||||
radiusMeters,
|
||||
static_cast<int32_t>(lastTransition),
|
||||
monitorTransitions,
|
||||
notificationResponsivenessMs,
|
||||
unknownTimerMs);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::pauseGeofence(int32_t geofenceId) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofencePause(geofenceId);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceResume(geofenceId, monitorTransitions);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::removeGeofence(int32_t geofenceId) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceRemove(geofenceId);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::removeAllGeofences() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceRemoveAll();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
96
gps/android/1.1/GnssGeofencing.h
Normal file
96
gps/android/1.1/GnssGeofencing.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofencing;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient;
|
||||
struct GnssGeofencing : public IGnssGeofencing {
|
||||
inline GnssGeofencing(const sp<GnssGeofencing>& self) : mSelf(self), mApi(nullptr) {}
|
||||
~GnssGeofencing();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
* These declarations were generated from IGnssGeofencing.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IGnssGeofenceCallback>& callback) override;
|
||||
Return<void> addGeofence(int32_t geofenceId,
|
||||
double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
double radiusMeters,
|
||||
IGnssGeofenceCallback::GeofenceTransition lastTransition,
|
||||
int32_t monitorTransitions,
|
||||
uint32_t notificationResponsivenessMs,
|
||||
uint32_t unknownTimerMs) override;
|
||||
|
||||
Return<void> pauseGeofence(int32_t geofenceId) override;
|
||||
Return<void> resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override;
|
||||
Return<void> removeGeofence(int32_t geofenceId) override;
|
||||
|
||||
private:
|
||||
// This method is not part of the IGnss base class.
|
||||
// It is called by GnssGeofencingDeathRecipient to remove all geofences added so far.
|
||||
Return<void> removeAllGeofences();
|
||||
|
||||
private:
|
||||
struct GnssGeofencingDeathRecipient : hidl_death_recipient {
|
||||
GnssGeofencingDeathRecipient(const sp<GnssGeofencing>& gnssGeofencing) :
|
||||
mGnssGeofencing(gnssGeofencing) {
|
||||
}
|
||||
~GnssGeofencingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<GnssGeofencing> mGnssGeofencing;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
// this has to be a reference, not a copy
|
||||
// because the pointer is not set when mSelf is assigned
|
||||
const sp<GnssGeofencing>& mSelf;
|
||||
sp<GnssGeofencingDeathRecipient> mGnssGeofencingDeathRecipient = nullptr;
|
||||
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface = nullptr;
|
||||
GeofenceAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
151
gps/android/1.1/GnssMeasurement.cpp
Normal file
151
gps/android/1.1/GnssMeasurement.cpp
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <MeasurementAPIClient.h>
|
||||
#include "GnssMeasurement.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
auto gssMeasurement = mGnssMeasurement.promote();
|
||||
if (gssMeasurement != nullptr) {
|
||||
gssMeasurement->handleClientDeath();
|
||||
}
|
||||
}
|
||||
|
||||
GnssMeasurement::GnssMeasurement(const sp<GnssMeasurement>& self) :
|
||||
mSelf(self), mApi(new MeasurementAPIClient()) {
|
||||
}
|
||||
|
||||
GnssMeasurement::~GnssMeasurement() {
|
||||
if (mApi) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GnssMeasurement::handleClientDeath() {
|
||||
|
||||
close();
|
||||
if (mApi != nullptr) {
|
||||
mApi->measurementSetCallback(nullptr);
|
||||
mApi->measurementSetCallback_1_1(nullptr);
|
||||
}
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
||||
}
|
||||
|
||||
if (callback == nullptr) {
|
||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mGnssMeasurementCbIface = callback;
|
||||
if (mGnssMeasurementDeathRecipient == nullptr) {
|
||||
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(mSelf);
|
||||
}
|
||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
return mApi->measurementSetCallback(callback);
|
||||
|
||||
}
|
||||
|
||||
Return<void> GnssMeasurement::close() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
}
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
}
|
||||
mApi->measurementClose();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
||||
const sp<IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
||||
}
|
||||
|
||||
if (callback == nullptr) {
|
||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
if (nullptr == mApi) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mGnssMeasurementCbIface_1_1 = callback;
|
||||
if (mGnssMeasurementDeathRecipient == nullptr) {
|
||||
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(mSelf);
|
||||
}
|
||||
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
GnssPowerMode powerMode = enableFullTracking?
|
||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
||||
|
||||
return mApi->measurementSetCallback_1_1(callback, powerMode);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
88
gps/android/1.1/GnssMeasurement.h
Normal file
88
gps/android/1.1/GnssMeasurement.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
|
||||
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
class MeasurementAPIClient;
|
||||
struct GnssMeasurement : public IGnssMeasurement {
|
||||
GnssMeasurement(const sp<GnssMeasurement>& self);
|
||||
~GnssMeasurement();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
* These declarations were generated from IGnssMeasurement.hal.
|
||||
*/
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) override;
|
||||
Return<void> close() override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> setCallback_1_1(
|
||||
const sp<IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) override;
|
||||
|
||||
private:
|
||||
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
|
||||
GnssMeasurementDeathRecipient(const sp<GnssMeasurement>& gnssMeasurement) :
|
||||
mGnssMeasurement(gnssMeasurement) {
|
||||
}
|
||||
~GnssMeasurementDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
const wp<GnssMeasurement> mGnssMeasurement;
|
||||
};
|
||||
|
||||
void handleClientDeath();
|
||||
|
||||
private:
|
||||
// this has to be a reference, not a copy
|
||||
// because the pointer is not set when mSelf is assigned
|
||||
const sp<GnssMeasurement>& mSelf;
|
||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
MeasurementAPIClient* mApi;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
70
gps/android/1.1/GnssNi.cpp
Normal file
70
gps/android/1.1/GnssNi.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssNiInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssNi.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) {
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
|
||||
Return<void> GnssNi::setCallback(const sp<IGnssNiCallback>& callback) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
mGnss->setGnssNiCb(callback);
|
||||
mGnssNiCbIface = callback;
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
GnssAPIClient* api = mGnss->getApi();
|
||||
if (api == nullptr) {
|
||||
LOC_LOGE("%s]: api is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
api->gnssNiRespond(notifId, userResponse);
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
65
gps/android/1.1/GnssNi.h
Normal file
65
gps/android/1.1/GnssNi.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssNi.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssNi;
|
||||
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct GnssNi : public IGnssNi {
|
||||
GnssNi(Gnss* gnss);
|
||||
~GnssNi() = default;
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
|
||||
* These declarations were generated from IGnssNi.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IGnssNiCallback>& callback) override;
|
||||
Return<void> respond(int32_t notifId,
|
||||
IGnssNiCallback::GnssUserResponseType userResponse) override;
|
||||
|
||||
private:
|
||||
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
4
gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc
Normal file
4
gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti
|
||||
class hal
|
||||
user gps
|
||||
group system gps radio vendor_qti_diag
|
||||
35
gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml
Normal file
35
gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<!-- Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gnss</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.1::IGnss/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
||||
205
gps/android/1.1/location_api/BatchingAPIClient.cpp
Normal file
205
gps/android/1.1/location_api/BatchingAPIClient.cpp
Normal file
@@ -0,0 +1,205 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_BatchingAPIClient"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "BatchingAPIClient.h"
|
||||
|
||||
#include "limits.h"
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask);
|
||||
|
||||
BatchingAPIClient::BatchingAPIClient(const sp<IGnssBatchingCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssBatchingCbIface(callback),
|
||||
mDefaultId(UINT_MAX),
|
||||
mLocationCapabilitiesMask(0)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.batchingCb = [this](size_t count, Location* location,
|
||||
BatchingOptions batchOptions) {
|
||||
onBatchingCb(count, location, batchOptions);
|
||||
};
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
BatchingAPIClient::~BatchingAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::gnssUpdateCallbacks(const sp<IGnssBatchingCallback>& callback)
|
||||
{
|
||||
mMutex.lock();
|
||||
mGnssBatchingCbIface = callback;
|
||||
mMutex.unlock();
|
||||
}
|
||||
|
||||
int BatchingAPIClient::getBatchSize()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
return locAPIGetBatchSize();
|
||||
}
|
||||
|
||||
int BatchingAPIClient::startSession(const IGnssBatching::Options& opts)
|
||||
{
|
||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||
int retVal = -1;
|
||||
LocationOptions options;
|
||||
convertBatchOption(opts, options, mLocationCapabilitiesMask);
|
||||
uint32_t mode = 0;
|
||||
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
|
||||
mode = SESSION_MODE_ON_FULL;
|
||||
}
|
||||
if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts)
|
||||
{
|
||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||
int retVal = -1;
|
||||
LocationOptions options;
|
||||
convertBatchOption(opts, options, mLocationCapabilitiesMask);
|
||||
|
||||
uint32_t mode = 0;
|
||||
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
|
||||
mode = SESSION_MODE_ON_FULL;
|
||||
}
|
||||
if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int BatchingAPIClient::stopSession()
|
||||
{
|
||||
LOC_LOGD("%s]: ", __FUNCTION__);
|
||||
int retVal = -1;
|
||||
if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::getBatchedLocation(int last_n_locations)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations);
|
||||
locAPIGetBatchedLocations(mDefaultId, last_n_locations);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::flushBatchedLocations()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
locAPIGetBatchedLocations(mDefaultId, SIZE_MAX);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onBatchingCb(size_t count, Location* location,
|
||||
BatchingOptions /*batchOptions*/)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbiface = mGnssBatchingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbiface != nullptr && count > 0) {
|
||||
hidl_vec<GnssLocation> locationVec;
|
||||
locationVec.resize(count);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
convertGnssLocation(location[i], locationVec[i]);
|
||||
}
|
||||
auto r = cbiface->gnssLocationBatchCb(locationVec);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask)
|
||||
{
|
||||
memset(&out, 0, sizeof(LocationOptions));
|
||||
out.size = sizeof(LocationOptions);
|
||||
out.minInterval = (uint32_t)(in.periodNanos / 1000000L);
|
||||
out.minDistance = 0;
|
||||
out.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
|
||||
out.mode = GNSS_SUPL_MODE_MSA;
|
||||
if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
|
||||
out.mode = GNSS_SUPL_MODE_MSB;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
77
gps/android/1.1/location_api/BatchingAPIClient.h
Normal file
77
gps/android/1.1/location_api/BatchingAPIClient.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BATCHING_API_CLINET_H
|
||||
#define BATCHING_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
class BatchingAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
BatchingAPIClient(const sp<V1_0::IGnssBatchingCallback>& callback);
|
||||
void gnssUpdateCallbacks(const sp<V1_0::IGnssBatchingCallback>& callback);
|
||||
int getBatchSize();
|
||||
int startSession(const V1_0::IGnssBatching::Options& options);
|
||||
int updateSessionOptions(const V1_0::IGnssBatching::Options& options);
|
||||
int stopSession();
|
||||
void getBatchedLocation(int last_n_locations);
|
||||
void flushBatchedLocations();
|
||||
|
||||
inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; }
|
||||
|
||||
// callbacks
|
||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||
void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final;
|
||||
|
||||
private:
|
||||
~BatchingAPIClient();
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssBatchingCallback> mGnssBatchingCbIface;
|
||||
uint32_t mDefaultId;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // BATCHING_API_CLINET_H
|
||||
297
gps/android/1.1/location_api/GeofenceAPIClient.cpp
Normal file
297
gps/android/1.1/location_api/GeofenceAPIClient.cpp
Normal file
@@ -0,0 +1,297 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_GeofenceApiClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GeofenceAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
GeofenceAPIClient::GeofenceAPIClient(const sp<IGnssGeofenceCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssGeofencingCbIface(callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb =
|
||||
[this](GeofenceBreachNotification geofenceBreachNotification) {
|
||||
onGeofenceBreachCb(geofenceBreachNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.geofenceStatusCb =
|
||||
[this](GeofenceStatusNotification geofenceStatusNotification) {
|
||||
onGeofenceStatusCb(geofenceStatusNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::upcateCallback(const sp<IGnssGeofenceCallback>& callback) {
|
||||
mMutex.lock();
|
||||
mGnssGeofencingCbIface = callback;
|
||||
mMutex.unlock();
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
|
||||
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
|
||||
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__,
|
||||
geofence_id, latitude, longitude, radius_meters,
|
||||
last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms);
|
||||
|
||||
GeofenceOption options;
|
||||
memset(&options, 0, sizeof(GeofenceOption));
|
||||
options.size = sizeof(GeofenceOption);
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
|
||||
options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
|
||||
options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT;
|
||||
options.responsiveness = notification_responsiveness_ms;
|
||||
|
||||
GeofenceInfo data;
|
||||
data.size = sizeof(GeofenceInfo);
|
||||
data.latitude = latitude;
|
||||
data.longitude = longitude;
|
||||
data.radius = radius_meters;
|
||||
|
||||
LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data);
|
||||
if (LOCATION_ERROR_SUCCESS != err) {
|
||||
onAddGeofencesCb(1, &err, &geofence_id);
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofencePause(uint32_t geofence_id)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
|
||||
locAPIPauseGeofences(1, &geofence_id);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions);
|
||||
GeofenceBreachTypeMask mask = 0;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
|
||||
mask |= GEOFENCE_BREACH_ENTER_BIT;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
|
||||
mask |= GEOFENCE_BREACH_EXIT_BIT;
|
||||
locAPIResumeGeofences(1, &geofence_id, &mask);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
|
||||
locAPIRemoveGeofences(1, &geofence_id);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceRemoveAll()
|
||||
{
|
||||
LOC_LOGD("%s]", __FUNCTION__);
|
||||
locAPIRemoveAllGeofences();
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
|
||||
GnssLocation gnssLocation;
|
||||
convertGnssLocation(geofenceBreachNotification.location, gnssLocation);
|
||||
|
||||
IGnssGeofenceCallback::GeofenceTransition transition;
|
||||
if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER)
|
||||
transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED;
|
||||
else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT)
|
||||
transition = IGnssGeofenceCallback::GeofenceTransition::EXITED;
|
||||
else {
|
||||
// continue with other breach if transition is
|
||||
// nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED
|
||||
continue;
|
||||
}
|
||||
|
||||
auto r = cbIface->gnssGeofenceTransitionCb(
|
||||
geofenceBreachNotification.ids[i], gnssLocation, transition,
|
||||
static_cast<V1_0::GnssUtcTime>(geofenceBreachNotification.timestamp));
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
IGnssGeofenceCallback::GeofenceAvailability status =
|
||||
IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE;
|
||||
if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) {
|
||||
status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE;
|
||||
}
|
||||
GnssLocation gnssLocation;
|
||||
memset(&gnssLocation, 0, sizeof(GnssLocation));
|
||||
auto r = cbIface->gnssGeofenceStatusCb(status, gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_EXISTS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS;
|
||||
auto r = cbIface->gnssGeofenceAddCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = cbIface->gnssGeofenceRemoveCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = cbIface->gnssGeofencePauseCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
mMutex.lock();
|
||||
auto cbIface = mGnssGeofencingCbIface;
|
||||
mMutex.unlock();
|
||||
if (cbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = cbIface->gnssGeofenceResumeCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
77
gps/android/1.1/location_api/GeofenceAPIClient.h
Normal file
77
gps/android/1.1/location_api/GeofenceAPIClient.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GEOFENCE_API_CLINET_H
|
||||
#define GEOFENCE_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofenceCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GeofenceAPIClient(const sp<V1_0::IGnssGeofenceCallback>& callback);
|
||||
void upcateCallback(const sp<V1_0::IGnssGeofenceCallback>& callback);
|
||||
void geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
|
||||
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
|
||||
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms);
|
||||
void geofencePause(uint32_t geofence_id);
|
||||
void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions);
|
||||
void geofenceRemove(uint32_t geofence_id);
|
||||
void geofenceRemoveAll();
|
||||
|
||||
// callbacks
|
||||
void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final;
|
||||
void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final;
|
||||
void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
|
||||
private:
|
||||
virtual ~GeofenceAPIClient() = default;
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssGeofenceCallback> mGnssGeofencingCbIface;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GEOFENCE_API_CLINET_H
|
||||
565
gps/android/1.1/location_api/GnssAPIClient.cpp
Normal file
565
gps/android/1.1/location_api/GnssAPIClient.cpp
Normal file
@@ -0,0 +1,565 @@
|
||||
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_GnssAPIClient"
|
||||
#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GnssAPIClient.h"
|
||||
#include <LocContext.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnss;
|
||||
using ::android::hardware::gnss::V1_0::IGnssCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out);
|
||||
|
||||
GnssAPIClient::GnssAPIClient(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssCbIface(nullptr),
|
||||
mGnssNiCbIface(nullptr),
|
||||
mControlClient(new LocationAPIControlClient()),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mLocationCapabilitiesCached(false)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
// set default LocationOptions.
|
||||
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
||||
mTrackingOptions.size = sizeof(TrackingOptions);
|
||||
mTrackingOptions.minInterval = 1000;
|
||||
mTrackingOptions.minDistance = 0;
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
|
||||
gnssUpdateCallbacks(gpsCb, niCb);
|
||||
}
|
||||
|
||||
GnssAPIClient::~GnssAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient) {
|
||||
delete mControlClient;
|
||||
mControlClient = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
void GnssAPIClient::gnssUpdateCallbacks(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssCbIface = gpsCb;
|
||||
mGnssNiCbIface = niCb;
|
||||
mMutex.unlock();
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.trackingCb = [this](Location location) {
|
||||
onTrackingCb(location);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
loc_core::ContextBase* context =
|
||||
loc_core::LocContext::getLocContext(loc_core::LocContext::mLocationHalName);
|
||||
if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) {
|
||||
LOC_LOGD("Registering NI CB");
|
||||
locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) {
|
||||
onGnssNiCb(id, gnssNiNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) {
|
||||
onGnssSvCb(gnssSvNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) {
|
||||
onGnssNmeaCb(gnssNmeaNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStart()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
bool retVal = true;
|
||||
locAPIStartTracking(mTrackingOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStop()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
bool retVal = true;
|
||||
locAPIStopTracking();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
|
||||
IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs,
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d %d %d %d %d %d)", __FUNCTION__,
|
||||
(int)mode, recurrence, minIntervalMs, preferredAccuracyMeters,
|
||||
preferredTimeMs, (int)powerMode, timeBetweenMeasurement);
|
||||
bool retVal = true;
|
||||
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
||||
mTrackingOptions.size = sizeof(TrackingOptions);
|
||||
mTrackingOptions.minInterval = minIntervalMs;
|
||||
if (IGnss::GnssPositionMode::MS_ASSISTED == mode ||
|
||||
IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) {
|
||||
// We set a very large interval to simulate SINGLE mode. Once we report a fix,
|
||||
// the caller should take the responsibility to stop the session.
|
||||
// For MSA, we always treat it as SINGLE mode.
|
||||
mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC;
|
||||
}
|
||||
if (mode == IGnss::GnssPositionMode::STANDALONE)
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
else if (mode == IGnss::GnssPositionMode::MS_BASED)
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_MSB;
|
||||
else if (mode == IGnss::GnssPositionMode::MS_ASSISTED)
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_MSA;
|
||||
else {
|
||||
LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode);
|
||||
retVal = false;
|
||||
}
|
||||
if (GNSS_POWER_MODE_INVALID != powerMode) {
|
||||
mTrackingOptions.powerMode = powerMode;
|
||||
mTrackingOptions.tbm = timeBetweenMeasurement;
|
||||
}
|
||||
locAPIUpdateTrackingOptions(mTrackingOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// for GpsNiInterface
|
||||
void GnssAPIClient::gnssNiRespond(int32_t notifId,
|
||||
IGnssNiCallback::GnssUserResponseType userResponse)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast<int>(userResponse));
|
||||
GnssNiResponse data;
|
||||
switch (userResponse) {
|
||||
case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT:
|
||||
data = GNSS_NI_RESPONSE_ACCEPT;
|
||||
break;
|
||||
case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY:
|
||||
data = GNSS_NI_RESPONSE_DENY;
|
||||
break;
|
||||
case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP:
|
||||
data = GNSS_NI_RESPONSE_NO_RESPONSE;
|
||||
break;
|
||||
default:
|
||||
data = GNSS_NI_RESPONSE_IGNORE;
|
||||
break;
|
||||
}
|
||||
|
||||
locAPIGnssNiResponse(notifId, data);
|
||||
}
|
||||
|
||||
// these apis using LocationAPIControlClient
|
||||
void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
GnssAidingData data;
|
||||
memset(&data, 0, sizeof (GnssAidingData));
|
||||
data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT;
|
||||
data.posEngineMask = STANDARD_POSITIONING_ENGINE;
|
||||
|
||||
if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL)
|
||||
data.deleteAll = true;
|
||||
else {
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT;
|
||||
}
|
||||
mControlClient->locAPIGnssDeleteAidingData(data);
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssEnable(LocationTechnologyType techType)
|
||||
{
|
||||
LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIEnable(techType);
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssDisable()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIDisable();
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIGnssUpdateConfig(gnssConfig);
|
||||
}
|
||||
|
||||
void GnssAPIClient::requestCapabilities() {
|
||||
// only send capablities if it's already cached, otherwise the first time LocationAPI
|
||||
// is initialized, capabilities will be sent by LocationAPI
|
||||
if (mLocationCapabilitiesCached) {
|
||||
onCapabilitiesCb(mLocationCapabilitiesMask);
|
||||
}
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
mLocationCapabilitiesCached = true;
|
||||
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
uint32_t data = 0;
|
||||
if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT))
|
||||
data |= IGnssCallback::Capabilities::SCHEDULING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT)
|
||||
data |= IGnssCallback::Capabilities::GEOFENCING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT)
|
||||
data |= IGnssCallback::Capabilities::MEASUREMENTS;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
|
||||
data |= IGnssCallback::Capabilities::MSB;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
|
||||
data |= IGnssCallback::Capabilities::MSA;
|
||||
auto r = gnssCbIface->gnssSetCapabilitesCb(data);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
if (gnssCbIface != nullptr) {
|
||||
IGnssCallback::GnssSystemInfo gnssInfo = { .yearOfHw = 2015 };
|
||||
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2016
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2017
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT ||
|
||||
capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2018
|
||||
}
|
||||
}
|
||||
}
|
||||
LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw);
|
||||
auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onTrackingCb(Location location)
|
||||
{
|
||||
LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
GnssLocation gnssLocation;
|
||||
convertGnssLocation(location, gnssLocation);
|
||||
auto r = gnssCbIface->gnssLocationCb(gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id);
|
||||
mMutex.lock();
|
||||
auto gnssNiCbIface(mGnssNiCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssNiCbIface == nullptr) {
|
||||
LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
IGnssNiCallback::GnssNiNotification notificationGnss = {};
|
||||
|
||||
notificationGnss.notificationId = id;
|
||||
|
||||
if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL;
|
||||
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY;
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY;
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE;
|
||||
|
||||
notificationGnss.timeoutSec = gnssNiNotification.timeout;
|
||||
|
||||
if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT;
|
||||
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY;
|
||||
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE ||
|
||||
gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP;
|
||||
|
||||
notificationGnss.requestorId = gnssNiNotification.requestor;
|
||||
|
||||
notificationGnss.notificationMessage = gnssNiNotification.message;
|
||||
|
||||
if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
|
||||
|
||||
if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
|
||||
|
||||
gnssNiCbIface->niNotifyCb(notificationGnss);
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
IGnssCallback::GnssSvStatus svStatus;
|
||||
convertGnssSvStatus(gnssSvNotification, svStatus);
|
||||
auto r = gnssCbIface->gnssSvStatusCb(svStatus);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSvStatusCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
|
||||
{
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
const std::string s(gnssNmeaNotification.nmea);
|
||||
std::stringstream ss(s);
|
||||
std::string each;
|
||||
while(std::getline(ss, each, '\n')) {
|
||||
each += '\n';
|
||||
android::hardware::hidl_string nmeaString;
|
||||
nmeaString.setToExternal(each.c_str(), each.length());
|
||||
auto r = gnssCbIface->gnssNmeaCb(
|
||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__,
|
||||
gnssNmeaNotification.nmea, gnssNmeaNotification.length,
|
||||
r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onStartTrackingCb(LocationError error)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onStopTrackingCb(LocationError error)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus));
|
||||
out.numSvs = in.count;
|
||||
if (out.numSvs > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) {
|
||||
LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.",
|
||||
__FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT);
|
||||
out.numSvs = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT);
|
||||
}
|
||||
for (size_t i = 0; i < out.numSvs; i++) {
|
||||
IGnssCallback::GnssSvInfo& info = out.gnssSvList[i];
|
||||
convertGnssSvid(in.gnssSvs[i], info.svid);
|
||||
convertGnssConstellationType(in.gnssSvs[i].type, info.constellation);
|
||||
info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
|
||||
info.elevationDegrees = in.gnssSvs[i].elevation;
|
||||
info.azimuthDegrees = in.gnssSvs[i].azimuth;
|
||||
info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz;
|
||||
info.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
110
gps/android/1.1/location_api/GnssAPIClient.h
Normal file
110
gps/android/1.1/location_api/GnssAPIClient.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GNSS_API_CLINET_H
|
||||
#define GNSS_API_CLINET_H
|
||||
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||
#include <android/hardware/gnss/1.1/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssNiCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GnssAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GnssAPIClient(const sp<V1_0::IGnssCallback>& gpsCb,
|
||||
const sp<V1_0::IGnssNiCallback>& niCb);
|
||||
GnssAPIClient(const GnssAPIClient&) = delete;
|
||||
GnssAPIClient& operator=(const GnssAPIClient&) = delete;
|
||||
|
||||
// for GpsInterface
|
||||
void gnssUpdateCallbacks(const sp<V1_0::IGnssCallback>& gpsCb,
|
||||
const sp<V1_0::IGnssNiCallback>& niCb);
|
||||
bool gnssStart();
|
||||
bool gnssStop();
|
||||
bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs,
|
||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||
uint32_t timeBetweenMeasurement = 0);
|
||||
|
||||
// for GpsNiInterface
|
||||
void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse);
|
||||
|
||||
// these apis using LocationAPIControlClient
|
||||
void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags);
|
||||
void gnssEnable(LocationTechnologyType techType);
|
||||
void gnssDisable();
|
||||
void gnssConfigurationUpdate(const GnssConfig& gnssConfig);
|
||||
|
||||
inline LocationCapabilitiesMask gnssGetCapabilities() const {
|
||||
return mLocationCapabilitiesMask;
|
||||
}
|
||||
void requestCapabilities();
|
||||
|
||||
// callbacks we are interested in
|
||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||
void onTrackingCb(Location location) final;
|
||||
void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final;
|
||||
void onGnssSvCb(GnssSvNotification gnssSvNotification) final;
|
||||
void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final;
|
||||
|
||||
void onStartTrackingCb(LocationError error) final;
|
||||
void onStopTrackingCb(LocationError error) final;
|
||||
|
||||
private:
|
||||
virtual ~GnssAPIClient();
|
||||
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface;
|
||||
std::mutex mMutex;
|
||||
LocationAPIControlClient* mControlClient;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
bool mLocationCapabilitiesCached;
|
||||
TrackingOptions mTrackingOptions;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GNSS_API_CLINET_H
|
||||
275
gps/android/1.1/location_api/LocationUtil.cpp
Normal file
275
gps/android/1.1/location_api/LocationUtil.cpp
Normal file
@@ -0,0 +1,275 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gps_extended_c.h>
|
||||
#include <LocationUtil.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
using ::android::hardware::gnss::V1_0::GnssConstellationType;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocationFlags;
|
||||
|
||||
void convertGnssLocation(Location& in, GnssLocation& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(GnssLocation));
|
||||
if (in.flags & LOCATION_HAS_LAT_LONG_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG;
|
||||
out.latitudeDegrees = in.latitude;
|
||||
out.longitudeDegrees = in.longitude;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_ALTITUDE_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE;
|
||||
out.altitudeMeters = in.altitude;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_SPEED_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED;
|
||||
out.speedMetersPerSec = in.speed;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_BEARING_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING;
|
||||
out.bearingDegrees = in.bearing;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY;
|
||||
out.horizontalAccuracyMeters = in.accuracy;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY;
|
||||
out.verticalAccuracyMeters = in.verticalAccuracy;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY;
|
||||
out.speedAccuracyMetersPerSecond = in.speedAccuracy;
|
||||
}
|
||||
if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) {
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY;
|
||||
out.bearingAccuracyDegrees = in.bearingAccuracy;
|
||||
}
|
||||
|
||||
out.timestamp = static_cast<V1_0::GnssUtcTime>(in.timestamp);
|
||||
}
|
||||
|
||||
void convertGnssLocation(const GnssLocation& in, Location& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) {
|
||||
out.flags |= LOCATION_HAS_LAT_LONG_BIT;
|
||||
out.latitude = in.latitudeDegrees;
|
||||
out.longitude = in.longitudeDegrees;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) {
|
||||
out.flags |= LOCATION_HAS_ALTITUDE_BIT;
|
||||
out.altitude = in.altitudeMeters;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) {
|
||||
out.flags |= LOCATION_HAS_SPEED_BIT;
|
||||
out.speed = in.speedMetersPerSec;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
|
||||
out.flags |= LOCATION_HAS_BEARING_BIT;
|
||||
out.bearing = in.bearingDegrees;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_ACCURACY_BIT;
|
||||
out.accuracy = in.horizontalAccuracyMeters;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT;
|
||||
out.verticalAccuracy = in.verticalAccuracyMeters;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT;
|
||||
out.speedAccuracy = in.speedAccuracyMetersPerSecond;
|
||||
}
|
||||
if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
|
||||
out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT;
|
||||
out.bearingAccuracy = in.bearingAccuracyDegrees;
|
||||
}
|
||||
|
||||
out.timestamp = static_cast<uint64_t>(in.timestamp);
|
||||
}
|
||||
|
||||
void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = GnssConstellationType::GPS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = GnssConstellationType::SBAS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
out = GnssConstellationType::GLONASS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = GnssConstellationType::QZSS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = GnssConstellationType::BEIDOU;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = GnssConstellationType::GALILEO;
|
||||
break;
|
||||
case GNSS_SV_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = GnssConstellationType::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssSvid(GnssSv& in, int16_t& out)
|
||||
{
|
||||
switch(in.type){
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
if (!isGloSlotUnknown(in.svId)) { // OSN is known
|
||||
out = in.svId - GLO_SV_PRN_MIN + 1;
|
||||
} else { //OSN is not known, report FCN
|
||||
out = in.gloFrequency + 92;
|
||||
}
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = in.svId - BDS_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = in.svId - GAL_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_NAVIC:
|
||||
out = in.svId - NAVIC_SV_PRN_MIN + 1;
|
||||
break;
|
||||
default:
|
||||
out = in.svId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssSvid(GnssMeasurementsData& in, int16_t& out)
|
||||
{
|
||||
switch (in.svType) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
if (!isGloSlotUnknown(in.svId)) { // OSN is known
|
||||
out = in.svId - GLO_SV_PRN_MIN + 1;
|
||||
} else { // OSN is not known, report FCN
|
||||
out = in.gloFrequency + 92;
|
||||
}
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = in.svId;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = in.svId - BDS_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = in.svId - GAL_SV_PRN_MIN + 1;
|
||||
break;
|
||||
case GNSS_SV_TYPE_NAVIC:
|
||||
out = in.svId - NAVIC_SV_PRN_MIN + 1;
|
||||
break;
|
||||
default:
|
||||
out = in.svId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_TYPE_EPHEMERIS:
|
||||
out = GnssDebug::SatelliteEphemerisType::EPHEMERIS;
|
||||
break;
|
||||
case GNSS_EPH_TYPE_ALMANAC:
|
||||
out = GnssDebug::SatelliteEphemerisType::ALMANAC_ONLY;
|
||||
break;
|
||||
case GNSS_EPH_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisType::NOT_AVAILABLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_SOURCE_DEMODULATED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::DEMODULATED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_SUPL_PROVIDED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::SUPL_PROVIDED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::OTHER_SERVER_PROVIDED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_LOCAL:
|
||||
case GNSS_EPH_SOURCE_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisSource::OTHER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_HEALTH_GOOD:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::GOOD;
|
||||
break;
|
||||
case GNSS_EPH_HEALTH_BAD:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::BAD;
|
||||
break;
|
||||
case GNSS_EPH_HEALTH_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
57
gps/android/1.1/location_api/LocationUtil.h
Normal file
57
gps/android/1.1/location_api/LocationUtil.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOCATION_UTIL_H
|
||||
#define LOCATION_UTIL_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
void convertGnssLocation(Location& in, V1_0::GnssLocation& out);
|
||||
void convertGnssLocation(const V1_0::GnssLocation& in, Location& out);
|
||||
void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out);
|
||||
void convertGnssSvid(GnssSv& in, int16_t& out);
|
||||
void convertGnssSvid(GnssMeasurementsData& in, int16_t& out);
|
||||
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out);
|
||||
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out);
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // LOCATION_UTIL_H
|
||||
373
gps/android/1.1/location_api/MeasurementAPIClient.cpp
Normal file
373
gps/android/1.1/location_api/MeasurementAPIClient.cpp
Normal file
@@ -0,0 +1,373 @@
|
||||
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_MeasurementAPIClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "MeasurementAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssData_1_1(GnssMeasurementsNotification& in,
|
||||
IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssMeasurement& out);
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
||||
|
||||
MeasurementAPIClient::MeasurementAPIClient() :
|
||||
mGnssMeasurementCbIface(nullptr),
|
||||
mGnssMeasurementCbIface_1_1(nullptr),
|
||||
mTracking(false)
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
MeasurementAPIClient::~MeasurementAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssMeasurementCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking();
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback_1_1(
|
||||
const sp<IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssMeasurementCbIface_1_1 = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking(powerMode, timeBetweenMeasurement);
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::startTracking(
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||
{
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) {
|
||||
locationCallbacks.gnssMeasurementsCb =
|
||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||
onGnssMeasurementsCb(gnssMeasurementsNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
|
||||
TrackingOptions options = {};
|
||||
memset(&options, 0, sizeof(TrackingOptions));
|
||||
options.size = sizeof(TrackingOptions);
|
||||
options.minInterval = 1000;
|
||||
options.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
if (GNSS_POWER_MODE_INVALID != powerMode) {
|
||||
options.powerMode = powerMode;
|
||||
options.tbm = timeBetweenMeasurement;
|
||||
}
|
||||
|
||||
mTracking = true;
|
||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
||||
locAPIStartTracking(options);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||
}
|
||||
|
||||
// for GpsMeasurementInterface
|
||||
void MeasurementAPIClient::measurementClose() {
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
mTracking = false;
|
||||
locAPIStopTracking();
|
||||
|
||||
// Clear measurement callback
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||
GnssMeasurementsNotification gnssMeasurementsNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu active: %d)",
|
||||
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
|
||||
if (mTracking) {
|
||||
mMutex.lock();
|
||||
sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr;
|
||||
sp<IGnssMeasurementCallback> gnssMeasurementCbIface_1_1 = nullptr;
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1;
|
||||
} else if (mGnssMeasurementCbIface != nullptr) {
|
||||
gnssMeasurementCbIface = mGnssMeasurementCbIface;
|
||||
}
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssMeasurementCbIface_1_1 != nullptr) {
|
||||
IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData_1_1(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface_1_1->gnssMeasurementCb(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssMeasurementCbIface != nullptr) {
|
||||
V1_0::IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from GnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssMeasurement& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement));
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL;
|
||||
convertGnssSvid(in, out.svid);
|
||||
convertGnssConstellationType(in.svType, out.constellation);
|
||||
out.timeOffsetNs = in.timeOffsetNs;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC;
|
||||
out.receivedSvTimeInNs = in.receivedSvTimeNs;
|
||||
out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs;
|
||||
out.cN0DbHz = in.carrierToNoiseDbHz;
|
||||
out.pseudorangeRateMps = in.pseudorangeRateMps;
|
||||
out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP;
|
||||
out.accumulatedDeltaRangeM = in.adrMeters;
|
||||
out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters;
|
||||
out.carrierFrequencyHz = in.carrierFrequencyHz;
|
||||
out.carrierCycles = in.carrierCycles;
|
||||
out.carrierPhase = in.carrierPhase;
|
||||
out.carrierPhaseUncertainty = in.carrierPhaseUncertainty;
|
||||
uint8_t indicator =
|
||||
static_cast<uint8_t>(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN);
|
||||
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT)
|
||||
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT;
|
||||
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT)
|
||||
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT;
|
||||
out.multipathIndicator =
|
||||
static_cast<IGnssMeasurementCallback::GnssMultipathIndicator>(indicator);
|
||||
out.snrDb = in.signalToNoiseRatioDb;
|
||||
out.agcLevelDb = in.agcLevelDb;
|
||||
}
|
||||
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock));
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY;
|
||||
out.leapSecond = in.leapSecond;
|
||||
out.timeNs = in.timeNs;
|
||||
out.timeUncertaintyNs = in.timeUncertaintyNs;
|
||||
out.fullBiasNs = in.fullBiasNs;
|
||||
out.biasNs = in.biasNs;
|
||||
out.biasUncertaintyNs = in.biasUncertaintyNs;
|
||||
out.driftNsps = in.driftNsps;
|
||||
out.driftUncertaintyNsps = in.driftUncertaintyNsps;
|
||||
out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount;
|
||||
}
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
out.measurementCount = in.count;
|
||||
if (out.measurementCount > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) {
|
||||
LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.",
|
||||
__FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT);
|
||||
out.measurementCount = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT);
|
||||
}
|
||||
for (size_t i = 0; i < out.measurementCount; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i]);
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
static void convertGnssData_1_1(GnssMeasurementsNotification& in,
|
||||
IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
out.measurements.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0);
|
||||
if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT)
|
||||
out.measurements[i].accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID;
|
||||
if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT)
|
||||
out.measurements[i].accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET;
|
||||
if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT)
|
||||
out.measurements[i].accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP;
|
||||
if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT)
|
||||
out.measurements[i].accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED;
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user