Compare commits
481 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7a25d2828 | ||
|
|
c62e935962 | ||
|
|
37728b0c77 | ||
|
|
0a994d9a07 | ||
|
|
b6eaaffa9c | ||
|
|
acecf1199a | ||
|
|
8f4f2b1539 | ||
|
|
d7c04bd8bb | ||
|
|
dc871ad9cc | ||
|
|
59b402643a | ||
|
|
33fd4ccc3f | ||
|
|
f390bd492a | ||
|
|
207ecf732b | ||
|
|
5564b6e66a | ||
|
|
ecf8b92307 | ||
|
|
f174c6666e | ||
| 930cf34d6e | |||
| dfffba1703 | |||
| 38fa4e3942 | |||
|
|
8e00cb924d | ||
|
|
7aefe1b80e | ||
|
|
3712b81799 | ||
|
|
1538157a16 | ||
|
|
d34309000e | ||
| 8bae52b351 | |||
|
|
b09998d9a9 | ||
|
|
6785c1012d | ||
|
|
d4bc838cc8 | ||
|
|
da28cb061b | ||
| 1018776b3c | |||
| c4a299168b | |||
|
|
0bf5c4849e | ||
| 66181999e2 | |||
| 49523ef5e7 | |||
|
|
fd480e995d | ||
|
|
5b8a8bf765 | ||
|
|
6110a1c6e4 | ||
|
|
24a1854cfa | ||
|
|
f3025a6b08 | ||
| 904cb3bfd6 | |||
|
|
3f1a816d6d | ||
| 718aeef877 | |||
|
|
5e0c46bc2a | ||
| 94afd90696 | |||
|
|
51c564cf30 | ||
|
|
d187bc363a | ||
|
|
81b7421044 | ||
|
|
62d71f1263 | ||
|
|
280fa8dc46 | ||
|
|
48684c0c51 | ||
|
|
b230059a38 | ||
|
|
597b231878 | ||
|
|
9a5ca49814 | ||
|
|
7676ec5b17 | ||
| ea75958b8d | |||
| ecbba940be | |||
| 299809d799 | |||
|
|
34dccf9d0b | ||
|
|
9cda51c400 | ||
| de4728b620 | |||
|
|
4945c19269 | ||
| 54c034e4b9 | |||
|
|
28b93c027f | ||
| e72a3f96ef | |||
|
|
50b510a168 | ||
| de24f4fd69 | |||
| 96c5230463 | |||
| c6ba6a8bc3 | |||
| 00b646a2a9 | |||
| f345190394 | |||
|
|
f3883bcae5 | ||
|
|
62df004919 | ||
|
|
334f47c211 | ||
|
|
bc80099b38 | ||
|
|
2a00eb27c6 | ||
|
|
bbda6af0c1 | ||
| 75b583403a | |||
|
|
33f0b5256f | ||
|
|
c677fb3f24 | ||
|
|
c9089c6b53 | ||
|
|
27f0e9f7ec | ||
|
|
e65b567a5d | ||
|
|
0d0d46cf52 | ||
|
|
0ef8e47c82 | ||
|
|
c297e102e5 | ||
|
|
0b2398af3a | ||
|
|
59ea79efd1 | ||
|
|
2dd1002605 | ||
|
|
24679e1d20 | ||
|
|
e929adcb1e | ||
|
|
53caa15651 | ||
|
|
bdf5376c78 | ||
|
|
38d5345adb | ||
|
|
bf5b6ad49a | ||
|
|
40ff04ef3d | ||
|
|
f90051b059 | ||
|
|
184e08869b | ||
|
|
a6dc8901e2 | ||
|
|
4dd83eb509 | ||
|
|
e11a86a08f | ||
|
|
d2de54df0f | ||
|
|
0b75582946 | ||
|
|
de78490898 | ||
|
|
f4ca83ac18 | ||
|
|
8eaec09854 | ||
|
|
0f5358b933 | ||
|
|
3fdee36431 | ||
|
|
7f1fcd26c4 | ||
|
|
1174d183fb | ||
|
|
59b0effba3 | ||
|
|
29afc7cd11 | ||
|
|
9ef0427150 | ||
|
|
b6630479f7 | ||
|
|
f511c519bb | ||
|
|
b9a0ced29f | ||
|
|
14c1b9e0c6 | ||
|
|
ef7d9e35cb | ||
|
|
46843ba2d2 | ||
|
|
af94a179b7 | ||
|
|
255a4eb734 | ||
|
|
e2a617f817 | ||
|
|
4e9b076c2b | ||
|
|
def1b433ca | ||
|
|
63ae132332 | ||
|
|
435506d9c7 | ||
|
|
854000133a | ||
|
|
a8e25dbe19 | ||
|
|
6f40641601 | ||
|
|
5b154b2a2c | ||
|
|
fc63ae5b03 | ||
|
|
45891ef52e | ||
|
|
e319b1f0a1 | ||
|
|
2310ebbefd | ||
|
|
5eff57199a | ||
|
|
9683c15870 | ||
|
|
8c545ab44b | ||
|
|
2e7be67627 | ||
|
|
03443e47ce | ||
|
|
5d0ccc4ef0 | ||
|
|
b75187a5ad | ||
|
|
a65cd25410 | ||
|
|
ebf297041e | ||
|
|
e3fe67bbca | ||
|
|
5c8b45bec3 | ||
|
|
3507e2b593 | ||
|
|
5dd8c5dac8 | ||
|
|
0890e3807f | ||
|
|
8fcf83d3ae | ||
|
|
8435215da8 | ||
|
|
8beffa8775 | ||
|
|
8d0523f869 | ||
|
|
63e1a0d505 | ||
|
|
6cd27537e2 | ||
|
|
21b1479af2 | ||
|
|
72d836c5ec | ||
|
|
aa3e20d972 | ||
|
|
dd9dd1471f | ||
|
|
8a9bf28549 | ||
|
|
7ae7a2ddac | ||
|
|
204eb3cbd5 | ||
|
|
308c953ee1 | ||
|
|
3793d2cdbe | ||
|
|
fbfc6f8d4e | ||
|
|
164fedb1fa | ||
|
|
3d4f372bd6 | ||
|
|
7b0ae38051 | ||
|
|
25343d8c21 | ||
|
|
c9b19dd302 | ||
|
|
0b30a3e446 | ||
|
|
70578033f2 | ||
|
|
6fb5e25804 | ||
|
|
0da9d6ab26 | ||
|
|
938d8ed333 | ||
|
|
dbe740ed76 | ||
|
|
6969d9c242 | ||
|
|
ab7776e4b3 | ||
|
|
01d039f99a | ||
|
|
40b376ec06 | ||
|
|
663772ffd1 | ||
|
|
26cbd09e3a | ||
|
|
97762a0b2d | ||
|
|
75f7828206 | ||
|
|
b502f42b23 | ||
|
|
ff2f1999d6 | ||
|
|
f277455b7b | ||
|
|
58a43b88e0 | ||
|
|
34f984aa0b | ||
|
|
7fc62ea31a | ||
|
|
9c20f9e830 | ||
|
|
8ec10281cc | ||
|
|
7028d50e4b | ||
|
|
f5450f93b2 | ||
|
|
2c5526e7cd | ||
|
|
a5198b702c | ||
|
|
f332bae97f | ||
|
|
c6dddd053f | ||
|
|
5e0437bda3 | ||
|
|
e2f4291797 | ||
|
|
43ffbd8284 | ||
|
|
9a70b8bfe7 | ||
|
|
639d3aaabe | ||
|
|
927ca695ba | ||
|
|
8816e7a454 | ||
|
|
30f7717136 | ||
|
|
b502e17124 | ||
|
|
539b809f84 | ||
|
|
ad5c46d5f7 | ||
|
|
82bd6f1f29 | ||
|
|
9119452353 | ||
|
|
8f0e38d802 | ||
|
|
ff16eba6c1 | ||
|
|
4528b4aaa8 | ||
|
|
9d91ded6c5 | ||
|
|
81581b436a | ||
|
|
7872ed359c | ||
|
|
fcff21282a | ||
|
|
2c36c1aaa5 | ||
|
|
e8354787f0 | ||
|
|
5eff01a540 | ||
|
|
61832e4f6c | ||
|
|
1cac48164a | ||
|
|
dfecebad48 | ||
|
|
2a64862a3d | ||
|
|
fb9564251c | ||
|
|
83f9b863c5 | ||
|
|
5a4d080af0 | ||
|
|
ca38ce9667 | ||
|
|
4caa5c965d | ||
|
|
e3171b8e6b | ||
|
|
3f5af6f742 | ||
|
|
a6a8cccf3c | ||
|
|
ed5eb9816d | ||
|
|
095396c63a | ||
|
|
65b1544d5d | ||
|
|
fe57bebf65 | ||
|
|
a4a8e47e3e | ||
|
|
0b2985e4e1 | ||
|
|
6055f17895 | ||
|
|
c88530e0ab | ||
|
|
13da909ceb | ||
|
|
d7012fa37a | ||
|
|
c5768cd748 | ||
|
|
ecffd99448 | ||
|
|
77e141465d | ||
|
|
f37edfd759 | ||
|
|
a028c2785e | ||
|
|
0d60a3e73e | ||
|
|
e87392b4e9 | ||
|
|
c6ae175ee4 | ||
|
|
b75902fc43 | ||
|
|
43219b8a23 | ||
|
|
4d296b4b9f | ||
|
|
cd867154b1 | ||
|
|
174b561531 | ||
|
|
d73e2021c0 | ||
|
|
af9a02aa78 | ||
|
|
ee978acf81 | ||
|
|
6eb4e8a228 | ||
|
|
99c2ab37ae | ||
|
|
6d44031797 | ||
|
|
2807faa5df | ||
|
|
df8559d489 | ||
|
|
207f96257e | ||
|
|
8dee7088aa | ||
|
|
5b390698b4 | ||
|
|
4aa60d0af9 | ||
|
|
5d29cdaaac | ||
|
|
445bd558b7 | ||
|
|
2d6175edd0 | ||
|
|
0d6daeb2bb | ||
|
|
fc9390f9d0 | ||
|
|
12412399a9 | ||
|
|
ee8f6209e0 | ||
|
|
fb3311544d | ||
|
|
158d15aa81 | ||
|
|
e8861fe9bd | ||
|
|
b9a6a4c017 | ||
|
|
76451d8187 | ||
|
|
772b7f66b7 | ||
|
|
d2e4e9a53a | ||
|
|
8f678d4e92 | ||
|
|
99b43abec3 | ||
|
|
e1cb5380db | ||
|
|
1bf6750934 | ||
|
|
6e42a3ed22 | ||
|
|
7eef457d05 | ||
|
|
8002d028e4 | ||
|
|
8bb68ccc74 | ||
|
|
4c1ef0e0f6 | ||
|
|
780fa845f1 | ||
|
|
170e956869 | ||
|
|
201caa6ff3 | ||
|
|
621dabf80e | ||
|
|
22c326690b | ||
|
|
c37f3d30c9 | ||
|
|
567d0c0937 | ||
|
|
b6aa28ec9d | ||
|
|
445f9dfe5c | ||
|
|
78da980dc1 | ||
|
|
90b1063b5d | ||
|
|
3a8d750aa2 | ||
|
|
c5f8a19eb4 | ||
|
|
5aabdca6e3 | ||
|
|
08b97d7606 | ||
|
|
0998d9a071 | ||
|
|
27b550a79d | ||
|
|
a7e416ef83 | ||
|
|
b5effbd1ba | ||
|
|
f73f315c15 | ||
|
|
658ad1d45c | ||
|
|
5046f7567b | ||
|
|
1df37897d5 | ||
|
|
6e2a7d1fc1 | ||
|
|
ed3f020865 | ||
|
|
67f4859f9c | ||
|
|
cce760c2ec | ||
|
|
41eeb16dd5 | ||
|
|
e6890ee9f2 | ||
|
|
e1d19e1a8e | ||
|
|
0def20655a | ||
|
|
4cd437b6a4 | ||
|
|
be9ba9e153 | ||
|
|
cd2996acd2 | ||
|
|
796556f43a | ||
|
|
7369895f64 | ||
|
|
720a397d25 | ||
|
|
1b233d6ff9 | ||
|
|
5f1995a47d | ||
|
|
b27c98b473 | ||
|
|
e8aeac976a | ||
|
|
3d84251568 | ||
|
|
c68331cec0 | ||
|
|
f5bbf337ab | ||
|
|
6c038b4503 | ||
|
|
8d1c1f2a6f | ||
|
|
3e7463c029 | ||
|
|
a836057489 | ||
|
|
e721889223 | ||
|
|
66cf74c7d5 | ||
|
|
d1f9e40007 | ||
|
|
296ab55e4f | ||
|
|
b4f5197dae | ||
|
|
928f894425 | ||
|
|
b376f93318 | ||
|
|
f59be6ee8e | ||
|
|
bbb438416c | ||
|
|
701db1a72f | ||
|
|
13b009e886 | ||
|
|
fb9f762af4 | ||
|
|
d529a19b51 | ||
|
|
ae276fbaf2 | ||
|
|
745b875236 | ||
|
|
72fba1966a | ||
|
|
4a6f5475a3 | ||
|
|
e2daa24031 | ||
|
|
fb16daa101 | ||
|
|
d763266ac0 | ||
|
|
3d6d47ebf6 | ||
|
|
1bfb6d0577 | ||
|
|
f20f036e97 | ||
|
|
75e1613d7f | ||
|
|
13abb0f9f9 | ||
|
|
43fcf8e65b | ||
|
|
cb960bf7d1 | ||
|
|
95c1688d5e | ||
|
|
14c3c85be6 | ||
|
|
fa4d3ed867 | ||
|
|
444111da5a | ||
|
|
1a8e2981c0 | ||
|
|
622f7ccf5d | ||
|
|
2c66b0ebd0 | ||
|
|
10744a6c52 | ||
|
|
be7b4b2109 | ||
|
|
d17a3b6a53 | ||
|
|
5e1ebb998d | ||
|
|
bdbc377cc2 | ||
|
|
11c03d0848 | ||
|
|
f0aab1f074 | ||
|
|
149f023bfa | ||
|
|
e03320c624 | ||
|
|
efadedd2db | ||
|
|
82aca7d218 | ||
|
|
a64c76be49 | ||
|
|
1a8181f2ea | ||
|
|
84ef27863b | ||
|
|
96eebadd98 | ||
|
|
c70ec864fd | ||
|
|
e2b73731d4 | ||
|
|
2ebd063a0d | ||
|
|
e106a1b33c | ||
|
|
43470f2669 | ||
|
|
2ab8e5e563 | ||
|
|
f1e73bc7c0 | ||
|
|
ce90bcd3bc | ||
|
|
a8a6f4da35 | ||
|
|
692e19ab59 | ||
|
|
4b49ec56c3 | ||
|
|
fae3c5717f | ||
|
|
0e8a214f4b | ||
|
|
093c94ed50 | ||
|
|
da7c777c09 | ||
|
|
9c0ebaeb3b | ||
|
|
c380469132 | ||
|
|
3dd20b99bb | ||
|
|
2f536d6bea | ||
|
|
db0177336d | ||
|
|
8706a67f36 | ||
|
|
41531425a8 | ||
|
|
ef9d7f291a | ||
|
|
1e448dc0a3 | ||
|
|
1d4331384b | ||
|
|
cc7a0c9be7 | ||
|
|
3bae00c883 | ||
|
|
f8595591e4 | ||
|
|
64045a6978 | ||
|
|
efa4aa39d7 | ||
|
|
6145694f25 | ||
|
|
1b2a7fca21 | ||
|
|
695d09afab | ||
|
|
2f06b04a3a | ||
|
|
c6d248a70b | ||
|
|
6cde167e4f | ||
|
|
c34764393e | ||
|
|
c8891b4148 | ||
|
|
8ee12b870f | ||
|
|
a5c50603d1 | ||
|
|
5a2f6e86ee | ||
|
|
407b72ff58 | ||
|
|
ce7154e948 | ||
|
|
314cea81c6 | ||
|
|
16d5e96af3 | ||
|
|
1f3385aed5 | ||
|
|
f5dba3bdda | ||
|
|
661438a1f1 | ||
|
|
2c38b8513b | ||
|
|
ad39ee3e10 | ||
|
|
25f6c3871b | ||
|
|
5b55d96bcb | ||
|
|
c5ce3457e5 | ||
|
|
61b6b38b43 | ||
|
|
19b261165f | ||
|
|
7b40e4d542 | ||
|
|
31d066e9e9 | ||
|
|
726c510b5a | ||
|
|
12e84bcd8b | ||
|
|
0a7affa856 | ||
|
|
a963b1d6d8 | ||
|
|
95d386713c | ||
|
|
6f845f8679 | ||
|
|
16551d87c6 | ||
|
|
e845f1eb5a | ||
|
|
877fbd9ae0 | ||
|
|
10e0896b95 | ||
|
|
4d6d8f8d6c | ||
|
|
17d996d9d7 | ||
|
|
7e2ddfe589 | ||
|
|
43ceefd049 | ||
|
|
b8d34ed042 | ||
|
|
7d5a015377 | ||
|
|
6092ee0191 | ||
|
|
03b1c9595a | ||
|
|
cef599f2f9 | ||
|
|
b6bc43cc2d | ||
|
|
4b97c9ed81 | ||
|
|
0223de540d | ||
|
|
df3d99bf9b | ||
|
|
91908c435f | ||
|
|
3f36ab14f8 | ||
|
|
a2c136cae5 | ||
|
|
078bc0e173 | ||
|
|
bc23a4eb9c | ||
|
|
f4b9e9d55b | ||
|
|
eb7e328055 | ||
|
|
79a30a9c2d | ||
|
|
c2f31ba636 | ||
|
|
9f565e7096 | ||
|
|
b295f44004 | ||
|
|
8abf5a094a | ||
|
|
8b561ab03b | ||
|
|
b765fd805d | ||
|
|
5db4263997 |
12
Android.bp
12
Android.bp
@@ -5,4 +5,16 @@
|
||||
//
|
||||
|
||||
soong_namespace {
|
||||
imports: [
|
||||
"hardware/lineage/interfaces/power-libperfmgr",
|
||||
"hardware/qcom-caf/common/libqti-perfd-client",
|
||||
"hardware/xiaomi",
|
||||
],
|
||||
}
|
||||
|
||||
install_symlink {
|
||||
name: "firmware_WCNSS_qcom_cfg.ini_symlink",
|
||||
vendor: true,
|
||||
installed_location: "firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini",
|
||||
symlink_target: "/vendor/etc/wifi/WCNSS_qcom_cfg.ini",
|
||||
}
|
||||
|
||||
93
Android.mk
93
Android.mk
@@ -1,93 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2023-2024 The LineageOS Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
ifneq ($(filter veux,$(TARGET_DEVICE)),)
|
||||
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# A/B builds require us to create the mount points at compile time.
|
||||
# Just creating it for all cases since it does not hurt.
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT) $(BT_FIRMWARE_MOUNT_POINT) $(DSP_MOUNT_POINT)
|
||||
|
||||
RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/adsp/
|
||||
$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM ADSP folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/adsp $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_CDSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/cdsp/
|
||||
$(RFS_MSM_CDSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM CDSP folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/cdsp $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/cdsp $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/mpss/
|
||||
$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM MPSS folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/mpss $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/slpi/
|
||||
$(RFS_MSM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM SLPI folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/slpi $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/slpi $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(RFS_MSM_ADSP_SYMLINKS) $(RFS_MSM_CDSP_SYMLINKS) $(RFS_MSM_MPSS_SYMLINKS) $(RFS_MSM_SLPI_SYMLINKS)
|
||||
|
||||
WIFI_FIRMWARE_SYMLINKS := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/
|
||||
$(WIFI_FIRMWARE_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating WiFi firmware symlinks: $@"
|
||||
@rm -rf $@/*
|
||||
mkdir -p $(dir $@)
|
||||
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_cfg.ini $@/WCNSS_qcom_cfg.ini
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(WIFI_FIRMWARE_SYMLINKS)
|
||||
|
||||
endif
|
||||
@@ -7,7 +7,3 @@
|
||||
PRODUCT_MAKEFILES := \
|
||||
$(LOCAL_DIR)/lineage_veux.mk
|
||||
|
||||
COMMON_LUNCH_CHOICES := \
|
||||
lineage_veux-user \
|
||||
lineage_veux-userdebug \
|
||||
lineage_veux-eng
|
||||
|
||||
198
BoardConfig.mk
198
BoardConfig.mk
@@ -9,38 +9,220 @@ DEVICE_PATH := device/xiaomi/veux
|
||||
BUILD_BROKEN_DUP_RULES := true
|
||||
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
||||
|
||||
# A/B
|
||||
AB_OTA_PARTITIONS := \
|
||||
boot \
|
||||
dtbo \
|
||||
odm \
|
||||
product \
|
||||
system \
|
||||
system_ext \
|
||||
vbmeta \
|
||||
vbmeta_system \
|
||||
vendor \
|
||||
vendor_boot
|
||||
|
||||
# Architecture
|
||||
TARGET_ARCH := arm64
|
||||
TARGET_ARCH_VARIANT := armv8-2a-dotprod
|
||||
TARGET_CPU_ABI := arm64-v8a
|
||||
TARGET_CPU_VARIANT := cortex-a55
|
||||
TARGET_CPU_VARIANT := cortex-a76
|
||||
TARGET_CPU_VARIANT_RUNTIME := cortex-a76
|
||||
|
||||
TARGET_2ND_ARCH := arm
|
||||
TARGET_2ND_ARCH_VARIANT := armv8-2a
|
||||
TARGET_2ND_CPU_ABI := armeabi-v7a
|
||||
TARGET_2ND_CPU_ABI2 := armeabi
|
||||
TARGET_2ND_CPU_VARIANT := cortex-a55
|
||||
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a55
|
||||
|
||||
# ART
|
||||
WITH_DEXPREOPT := true
|
||||
DEX_PREOPT_DEFAULT := generate-vdex-and-image
|
||||
WITH_DEXPREOPT_DEBUG_INFO := false
|
||||
|
||||
# Audio
|
||||
AUDIO_FEATURE_ENABLED_DLKM := true
|
||||
AUDIO_FEATURE_ENABLED_EXTENDED_COMPRESS_FORMAT := true
|
||||
AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
|
||||
AUDIO_FEATURE_ENABLED_GKI := true
|
||||
AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
|
||||
AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
|
||||
AUDIO_FEATURE_ENABLED_SVA_MULTI_STAGE := true
|
||||
BOARD_SUPPORTS_OPENSOURCE_STHAL := true
|
||||
BOARD_SUPPORTS_SOUND_TRIGGER := true
|
||||
BOARD_USES_ALSA_AUDIO := true
|
||||
AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
|
||||
|
||||
# Bootloader
|
||||
TARGET_BOOTLOADER_BOARD_NAME := veux
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
|
||||
# Camera
|
||||
TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED := true
|
||||
|
||||
# Display
|
||||
TARGET_SCREEN_DENSITY := 440
|
||||
|
||||
# Filesystem
|
||||
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
|
||||
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/configs/config.fs
|
||||
|
||||
# GNSS
|
||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
|
||||
|
||||
# HIDL
|
||||
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
|
||||
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
|
||||
$(DEVICE_PATH)/device_framework_matrix.xml
|
||||
hardware/xiaomi/vintf/xiaomi_framework_compatibility_matrix.xml \
|
||||
$(DEVICE_PATH)/configs/vintf/device_framework_matrix.xml
|
||||
|
||||
DEVICE_MANIFEST_FILE := \
|
||||
$(DEVICE_PATH)/manifest.xml
|
||||
$(DEVICE_PATH)/configs/vintf/manifest.xml
|
||||
|
||||
DEVICE_MATRIX_FILE := \
|
||||
$(DEVICE_PATH)/compatibility_matrix.xml
|
||||
$(DEVICE_PATH)/configs/vintf/compatibility_matrix.xml
|
||||
|
||||
ODM_MANIFEST_SKUS += \
|
||||
sn100
|
||||
|
||||
ODM_MANIFEST_SN100_FILES := \
|
||||
$(DEVICE_PATH)/configs/vintf/manifest_ese.xml
|
||||
|
||||
# HWUI
|
||||
HWUI_COMPILE_FOR_PERF := true
|
||||
|
||||
# Kernel
|
||||
BOARD_KERNEL_BASE := 0x00000000
|
||||
BOARD_KERNEL_IMAGE_NAME := Image
|
||||
BOARD_KERNEL_PAGESIZE := 4096
|
||||
BOARD_KERNEL_SEPARATED_DTBO := true
|
||||
|
||||
BOARD_BOOT_HEADER_VERSION := 3
|
||||
BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
|
||||
BOARD_INCLUDE_DTB_IN_BOOTIMG := true
|
||||
BOARD_RAMDISK_USE_LZ4 := true
|
||||
BOARD_USES_GENERIC_KERNEL_IMAGE := true
|
||||
|
||||
BOARD_KERNEL_CMDLINE := \
|
||||
console=ttyMSM0,115200n8 \
|
||||
earlycon=msm_geni_serial,0x04C8C000 \
|
||||
androidboot.hardware=qcom \
|
||||
androidboot.console=ttyMSM0 \
|
||||
androidboot.memcg=1 \
|
||||
lpm_levels.sleep_disabled=1 \
|
||||
video=vfb:640x400,bpp=32,memsize=3072000 \
|
||||
msm_rtb.filter=0x237 \
|
||||
service_locator.enable=1 \
|
||||
androidboot.usbcontroller=4e00000.dwc3 \
|
||||
swiotlb=0 \
|
||||
kpti=off \
|
||||
loop.max_part=7 \
|
||||
cgroup.memory=nokmem,nosocket \
|
||||
iptable_raw.raw_before_defrag=1 \
|
||||
ip6table_raw.raw_before_defrag=1 \
|
||||
firmware_class.path=/vendor/firmware
|
||||
|
||||
TARGET_KERNEL_CONFIG := veux_defconfig
|
||||
TARGET_KERNEL_SOURCE := kernel/xiaomi/veux
|
||||
TARGET_KERNEL_NO_GCC := true
|
||||
|
||||
# Global LTO
|
||||
TARGET_GLOBAL_LTO := thin
|
||||
TARGET_GLOBAL_OPTIMIZATION := O3
|
||||
TARGET_GLOBAL_THINLTO := true
|
||||
|
||||
# OTA assert
|
||||
TARGET_OTA_ASSERT_DEVICE := peux|veux
|
||||
|
||||
# Partitions
|
||||
BOARD_BOOTIMAGE_PARTITION_SIZE := 134217728
|
||||
BOARD_DTBOIMG_PARTITION_SIZE := 8388608
|
||||
BOARD_SUPER_PARTITION_SIZE := 9126805504
|
||||
BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296
|
||||
BOARD_FLASH_BLOCK_SIZE := 131072
|
||||
BOARD_USES_METADATA_PARTITION := true
|
||||
|
||||
BOARD_VEUX_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor
|
||||
BOARD_VEUX_DYNAMIC_PARTITIONS_SIZE := 9122611200 # BOARD_SUPER_PARTITION_SIZE - 4MB
|
||||
BOARD_SUPER_PARTITION_GROUPS := veux_dynamic_partitions
|
||||
|
||||
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
|
||||
|
||||
ifneq ($(WITH_GMS),true)
|
||||
BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := -1
|
||||
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 1073741824
|
||||
BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := -1
|
||||
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 1073741824
|
||||
BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1
|
||||
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 1073741824
|
||||
else
|
||||
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 25165824
|
||||
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 25165824
|
||||
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 25165824
|
||||
endif
|
||||
BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE := 25165824
|
||||
BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 25165824
|
||||
|
||||
TARGET_COPY_OUT_ODM := odm
|
||||
TARGET_COPY_OUT_PRODUCT := product
|
||||
TARGET_COPY_OUT_SYSTEM_EXT := system_ext
|
||||
TARGET_COPY_OUT_VENDOR := vendor
|
||||
|
||||
# Platform
|
||||
BOARD_USES_QCOM_HARDWARE := true
|
||||
BOARD_VENDOR := xiaomi
|
||||
TARGET_BOARD_PLATFORM := holi
|
||||
|
||||
# Properties
|
||||
TARGET_ODM_PROP += $(DEVICE_PATH)/configs/properties/odm.prop
|
||||
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/configs/properties/product.prop
|
||||
TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/configs/properties/system_ext.prop
|
||||
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/configs/properties/system.prop
|
||||
TARGET_VENDOR_PROP += $(DEVICE_PATH)/configs/properties/vendor.prop
|
||||
|
||||
# Recovery
|
||||
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
|
||||
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.default
|
||||
TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
|
||||
TARGET_USERIMAGES_USE_F2FS := true
|
||||
|
||||
# RIL
|
||||
ENABLE_VENDOR_RIL_SERVICE := true
|
||||
|
||||
# Security patch
|
||||
BOOT_SECURITY_PATCH := 2024-10-01
|
||||
VENDOR_SECURITY_PATCH := $(BOOT_SECURITY_PATCH)
|
||||
|
||||
# SELinux
|
||||
include device/qcom/sepolicy_vndr/SEPolicy.mk
|
||||
include device/lineage/sepolicy/libperfmgr/sepolicy.mk
|
||||
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
|
||||
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public
|
||||
BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
|
||||
|
||||
# Verified Boot
|
||||
BOARD_AVB_ENABLE := true
|
||||
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
|
||||
BOARD_AVB_VBMETA_SYSTEM := product system system_ext
|
||||
BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096
|
||||
BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
|
||||
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
|
||||
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
|
||||
|
||||
# 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)
|
||||
BOARD_WPA_SUPPLICANT_PRIVATE_LIB_EVENT := "ON"
|
||||
QC_WIFI_HIDL_FEATURE_DUAL_AP := true
|
||||
WIFI_DRIVER_DEFAULT := qca_cld3
|
||||
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
|
||||
|
||||
31
README.md
31
README.md
@@ -1,9 +1,24 @@
|
||||
# Device configuration for Redmi Note 11 Pro 5G
|
||||
# Device Tree for POCO X4 Pro 5G/Redmi Note 11E Pro/Redmi Note 11 Pro 5G/Redmi Note 11 Pro+ 5G (peux/veux)
|
||||
|
||||
```
|
||||
#
|
||||
# Copyright (C) 2023-2024 The LineageOS Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
```
|
||||
## Spec Sheet
|
||||
|
||||
| Feature | Specification |
|
||||
| :--------------- | :-------------------------------------------------------------- |
|
||||
| CPU | Octa-core (2x2.2 GHz Kryo 660 Gold & 6x1.7 GHz Kryo 660 Silver) |
|
||||
| Chipset | Qualcomm SM6375 Snapdragon 695G (6 nm) |
|
||||
| GPU | Adreno 619 |
|
||||
| Memory | 6 GB / 8 GB |
|
||||
| Shipped Software | Android 11, MIUI 13 |
|
||||
| Storage | 128 GB / 256 GB |
|
||||
| Battery | 5000 mAh |
|
||||
| Dimensions | 165.1 x 76.4 x 9.3 mm (6.5 x 3.01 x 0.37 in) |
|
||||
| Display | 6.67 inches, 107.4 cm2 (~86.0% screen-to-body ratio) |
|
||||
| Rear Camera | 108 MP, f/1.9, 26mm (wide), 1/1.52", 0.7µm, PDAF |
|
||||
| | 8 MP, f/2.2, 118˚ (ultrawide) |
|
||||
| | 2 MP, f/2.4, (macro) |
|
||||
| Front Camera | 16 MP, f/2.5, (wide), 1/3.06" 1.0µm |
|
||||
| Release Date | February 2022 |
|
||||
|
||||
## Device Picture
|
||||
|
||||

|
||||
|
||||
46
RemovePackages/Android.bp
Normal file
46
RemovePackages/Android.bp
Normal file
@@ -0,0 +1,46 @@
|
||||
cc_prebuilt_binary {
|
||||
name: "RemovePackagesVeux",
|
||||
overrides: [
|
||||
"AmbientSensePrebuilt",
|
||||
"arcore",
|
||||
"Chrome",
|
||||
"Chrome-Stub",
|
||||
"ConnMO",
|
||||
"ConnMetrics",
|
||||
"DCMO",
|
||||
"DevicePolicyPrebuilt",
|
||||
"DMService",
|
||||
"GCS",
|
||||
"GoogleTTS",
|
||||
"Maps",
|
||||
"MyVerizonServices",
|
||||
"OBDM_Permissions",
|
||||
"obdm_stub",
|
||||
"OdadPrebuilt",
|
||||
"OemDmTrigger",
|
||||
"OPScreenRecord",
|
||||
"Ornament",
|
||||
"PixelBuds",
|
||||
"PixelLiveWallpaperPrebuilt",
|
||||
"RecorderPrebuilt",
|
||||
"SafetyHubPrebuilt",
|
||||
"SCONE",
|
||||
"ScribePrebuilt",
|
||||
"Showcase",
|
||||
"SoundAmplifierPrebuilt",
|
||||
"SprintDM",
|
||||
"SprintHM",
|
||||
"Tycho",
|
||||
"USCCDM",
|
||||
"Via",
|
||||
"Videos",
|
||||
"VZWAPNLib",
|
||||
"VzwOmaTrigger",
|
||||
"YouTube",
|
||||
"YouTubeMusicPrebuilt",
|
||||
],
|
||||
strip: {
|
||||
none: true,
|
||||
},
|
||||
srcs: ["RemovePackagesVeux"],
|
||||
}
|
||||
0
RemovePackages/RemovePackagesVeux
Normal file
0
RemovePackages/RemovePackagesVeux
Normal file
136
audio/audio_effects.xml
Normal file
136
audio/audio_effects.xml
Normal file
@@ -0,0 +1,136 @@
|
||||
<?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. -->
|
||||
|
||||
<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="qcbassboost" path="libqcbassboost.so"/>
|
||||
<library name="qcvirt" path="libqcvirt.so"/>
|
||||
<library name="qcreverb" path="libqcreverb.so"/>
|
||||
<library name="visualizer_sw" path="libvisualizer.so"/>
|
||||
<library name="visualizer_hw" path="libqcomvisualizer.so"/>
|
||||
<library name="spatializer" path="libspatialaudio.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="shoebox" path="libshoebox.so"/>
|
||||
<library name="misoundfx" path="libmisoundfx.so"/>
|
||||
<!--DOLBY DAP-->
|
||||
<library name="dap" path="libswdap.so"/>
|
||||
<!--DOLBY END-->
|
||||
<!--DOLBY GAME-->
|
||||
<library name="gamedap" path="libswgamedap.so"/>
|
||||
<!--DOLBY END-->
|
||||
<!--DOLBY VQE-->
|
||||
<library name="vqe" path="libswvqe.so"/>
|
||||
<!--DOLBY END-->
|
||||
</libraries>
|
||||
<effects>
|
||||
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
|
||||
<libsw library="qcbassboost" uuid="23aca180-44bd-11e2-bcfd-0800200c9a66"/>
|
||||
<libhw library="offload_bundle" uuid="2c4a8c24-1581-487f-94f6-0002a5d5c51b"/>
|
||||
</effectProxy>
|
||||
<effectProxy name="virtualizer" library="proxy" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b">
|
||||
<libsw library="qcvirt" uuid="e6c98a16-22a3-11e2-b87b-f23c91aec05e"/>
|
||||
<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="qcreverb" uuid="a8c1e5f3-293d-43cd-95ec-d5e26c02e217"/>
|
||||
<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="qcreverb" uuid="791fff8b-8129-4655-83a4-59bc61034c3a"/>
|
||||
<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="qcreverb" uuid="53ef1db5-c0c0-445b-b060-e34d20ebb70a"/>
|
||||
<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="qcreverb" uuid="b08a0e38-22a5-11e2-b87b-f23c91aec05e"/>
|
||||
<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="hw_acc" library="offload_bundle" uuid="7d1580bd-297f-4683-9239-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="shoebox" library="shoebox" uuid="1eab784c-1a36-4b2a-b7fc-e34c44cab89e"/>
|
||||
<effect name="misoundfx" library="misoundfx" uuid="5b8e36a5-144a-4c38-b1d7-0002a5d5c51b"/>
|
||||
<!--DOLBY DAP-->
|
||||
<effect name="dap" library="dap" uuid="9d4921da-8225-4f29-aefa-39537a04bcaa"/>
|
||||
<!--DOLBY END-->
|
||||
<!--DOLBY GAME-->
|
||||
<effect name="gamedap" library="gamedap" uuid="3783c334-d3a0-4d13-874f-0032e5fb80e2"/>
|
||||
<!--DOLBY END-->
|
||||
<!--DOLBY VQE-->
|
||||
<effect name="vqe" library="vqe" uuid="64a0f614-7fa4-48b8-b081-d59dc954616f"/>
|
||||
<!--DOLBY END-->
|
||||
</effects>
|
||||
<postprocess>
|
||||
<stream type="music">
|
||||
</stream>
|
||||
<stream type="ring">
|
||||
</stream>
|
||||
<stream type="alarm">
|
||||
</stream>
|
||||
<stream type="voice_call">
|
||||
<apply effect="voice_helper"/>
|
||||
</stream>
|
||||
<stream type="notification">
|
||||
</stream>
|
||||
</postprocess>
|
||||
<preprocess>
|
||||
<stream type="voice_communication">
|
||||
<apply effect="aec"/>
|
||||
<apply effect="ns"/>
|
||||
</stream>
|
||||
</preprocess>
|
||||
</audio_effects_conf>
|
||||
140
audio/audio_io_policy.conf
Normal file
140
audio/audio_io_policy.conf
Normal file
@@ -0,0 +1,140 @@
|
||||
# List of profiles for the output device session where stream is routed.
|
||||
# A stream opened with the inputs attributes which match the "flags" and
|
||||
# "formats" as specified in the profile is routed to a device at
|
||||
# sample rate specified under "sampling_rates" and bit width under
|
||||
# "bit_width" and the topology extracted from the acdb data against
|
||||
# the "app_type".
|
||||
#
|
||||
# the flags and formats are specified using the strings corresponding to
|
||||
# enums in audio.h and audio_policy.h. They are concatenated with "|"
|
||||
# without space or "\n".
|
||||
# the flags and formats should match the ones in "audio_policy.conf"
|
||||
|
||||
outputs {
|
||||
default {
|
||||
flags AUDIO_OUTPUT_FLAG_PRIMARY
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 48000
|
||||
bit_width 16
|
||||
app_type 69937
|
||||
}
|
||||
proaudio {
|
||||
flags AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 48000
|
||||
bit_width 16
|
||||
app_type 69943
|
||||
}
|
||||
voip_rx {
|
||||
flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 8000|16000|32000|48000
|
||||
bit_width 16
|
||||
app_type 69946
|
||||
}
|
||||
deep_buffer {
|
||||
flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 48000
|
||||
bit_width 16
|
||||
app_type 69936
|
||||
}
|
||||
direct_pcm_16 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT
|
||||
formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 16
|
||||
app_type 69936
|
||||
}
|
||||
direct_pcm_24 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT
|
||||
formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000
|
||||
bit_width 24
|
||||
app_type 69940
|
||||
}
|
||||
direct_pcm_32 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT
|
||||
formats AUDIO_FORMAT_PCM_32_BIT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000
|
||||
bit_width 32
|
||||
app_type 69942
|
||||
}
|
||||
compress_passthrough {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH
|
||||
formats AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_E_AC3_JOC|AUDIO_FORMAT_DTS|AUDIO_FORMAT_DTS_HD|AUDIO_FORMAT_DSD
|
||||
sampling_rates 32000|44100|48000|88200|96000|176400|192000|352800
|
||||
bit_width 16
|
||||
app_type 69941
|
||||
}
|
||||
compress_offload_16 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
|
||||
formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_PCM_16_BIT_OFFLOAD|AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2|AUDIO_FORMAT_AAC_LATM_LC|AUDIO_FORMAT_AAC_LATM_HE_V1|AUDIO_FORMAT_AAC_LATM_HE_V2
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 16
|
||||
app_type 69936
|
||||
}
|
||||
compress_offload_24 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
|
||||
formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2|AUDIO_FORMAT_AAC_LATM_LC|AUDIO_FORMAT_AAC_LATM_HE_V1|AUDIO_FORMAT_AAC_LATM_HE_V2
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 24
|
||||
app_type 69940
|
||||
}
|
||||
}
|
||||
|
||||
inputs {
|
||||
record_16bit {
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
|
||||
bit_width 16
|
||||
app_type 69938
|
||||
}
|
||||
record_24bit {
|
||||
formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 24
|
||||
app_type 69948
|
||||
}
|
||||
record_32bit {
|
||||
formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 32
|
||||
app_type 69949
|
||||
}
|
||||
record_compress_16 {
|
||||
flags AUDIO_INPUT_FLAG_COMPRESS
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
|
||||
bit_width 16
|
||||
app_type 69938
|
||||
}
|
||||
record_compress_24 {
|
||||
flags AUDIO_INPUT_FLAG_COMPRESS
|
||||
formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 24
|
||||
app_type 69948
|
||||
}
|
||||
record_compress_32 {
|
||||
flags AUDIO_INPUT_FLAG_COMPRESS
|
||||
formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
|
||||
sampling_rates 44100|48000|88200|96000|176400|192000
|
||||
bit_width 32
|
||||
app_type 69949
|
||||
}
|
||||
voip_tx {
|
||||
flags AUDIO_INPUT_FLAG_VOIP_TX
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 8000|16000|32000|48000
|
||||
bit_width 16
|
||||
app_type 69946
|
||||
}
|
||||
low_latency_voip_tx {
|
||||
flags AUDIO_INPUT_FLAG_FAST|AUDIO_INPUT_FLAG_VOIP_TX
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 48000
|
||||
bit_width 16
|
||||
app_type
|
||||
}
|
||||
}
|
||||
534
audio/audio_platform_info_qrd.xml
Normal file
534
audio/audio_platform_info_qrd.xml
Normal file
@@ -0,0 +1,534 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- Copyright (c) 2014, 2016-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, -->
|
||||
<!-- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
|
||||
<!-- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
||||
<audio_platform_info>
|
||||
<bit_width_configs>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER" bit_width="24"/>
|
||||
</bit_width_configs>
|
||||
<interface_names>
|
||||
<device name="AUDIO_DEVICE_IN_BUILTIN_MIC" interface="TX_CDC_DMA_TX_3" codec_type="internal"/>
|
||||
<device name="AUDIO_DEVICE_IN_BACK_MIC" interface="TX_CDC_DMA_TX_3" codec_type="internal"/>
|
||||
</interface_names>
|
||||
|
||||
<module_ids>
|
||||
<aec>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_TMIC_AEC_NS" module_id="0x10F35" instance_id="0x0" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE" module_id="0x10F34" instance_id="0x0" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS" module_id="0x10F33" instance_id="0x0" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS" module_id="0x10F31" instance_id="0x0" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS" module_id="0x10F33" instance_id="0x0" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS" module_id="0x10F31" instance_id="0x0" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_SB" module_id="0x10F39" instance_id="0x8000" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS_SB" module_id="0x10F38" instance_id="0x8000" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS_SB" module_id="0x10F39" instance_id="0x8000" param_id="0x10EAF" param_value="0x01"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS_SB" module_id="0x10F38" instance_id="0x8000" param_id="0x10EAF" param_value="0x01"/>
|
||||
</aec>
|
||||
<ns>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_TMIC_AEC_NS" module_id="0x10F35" instance_id="0x0" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE" module_id="0x10F34" instance_id="0x0" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS" module_id="0x10F33" instance_id="0x0" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS" module_id="0x10F31" instance_id="0x0" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS" module_id="0x10F33" instance_id="0x0" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS" module_id="0x10F31" instance_id="0x0" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_SB" module_id="0x10F39" instance_id="0x8000" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS_SB" module_id="0x10F38" instance_id="0x8000" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS_SB" module_id="0x10F39" instance_id="0x8000" param_id="0x10EAF" param_value="0x02"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS_SB" module_id="0x10F38" instance_id="0x8000" param_id="0x10EAF" param_value="0x02"/>
|
||||
</ns>
|
||||
</module_ids>
|
||||
|
||||
<pcm_ids>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_LOW_LATENCY" type="out" id="9"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD" type="out" id="7"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD2" type="out" id="11"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD3" type="out" id="43"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD4" type="out" id="24"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD5" type="out" id="25"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD6" type="out" id="26"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD7" type="out" id="27"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD8" type="out" id="28"/>
|
||||
<usecase name="USECASE_VOICEMMODE1_CALL" type="in" id="2"/>
|
||||
<usecase name="USECASE_VOICEMMODE1_CALL" type="out" id="2"/>
|
||||
<usecase name="USECASE_VOICEMMODE2_CALL" type="in" id="15"/>
|
||||
<usecase name="USECASE_VOICEMMODE2_CALL" type="out" id="15"/>
|
||||
<usecase name="USECASE_VOWLAN_CALL" type="in" id="-1"/>
|
||||
<usecase name="USECASE_VOWLAN_CALL" type="out" id="-1"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_FM" type="out" id="30"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_FM" type="in" id="40"/>
|
||||
<usecase name="USECASE_AUDIO_SPKR_CALIB_RX" type="out" id="30"/>
|
||||
<usecase name="USECASE_AUDIO_SPKR_CALIB_TX" type="in" id="33"/>
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
|
||||
<usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
|
||||
<usecase name="USECASE_AUDIO_RECORD_AFE_PROXY2" type="in" id="42"/>
|
||||
<usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
|
||||
<usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
|
||||
<usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="12" />
|
||||
<usecase name="USECASE_AUDIO_HFP_SCO" type="in" id="12" />
|
||||
<usecase name="USECASE_AUDIO_HFP_SCO_WB" type="in" id="12" />
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_MMAP" type="out" id="29" />
|
||||
<usecase name="USECASE_AUDIO_RECORD_MMAP" type="in" id="29" />
|
||||
<usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="38" />
|
||||
<usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="38" />
|
||||
<usecase name="USECASE_INCALL_MUSIC_UPLINK" type="out" id="23" />
|
||||
<usecase name="USECASE_INCALL_MUSIC_UPLINK2" type="out" id="23" />
|
||||
<usecase name="USECASE_AUDIO_RECORD_COMPRESS2" type="in" id="39" />
|
||||
<usecase name="USECASE_INCALL_REC_UPLINK" type="in" id="23" />
|
||||
<usecase name="USECASE_INCALL_REC_DOWNLINK" type="in" id="23" />
|
||||
<usecase name="USECASE_INCALL_REC_UPLINK_AND_DOWNLINK" type="in" id="23" />
|
||||
</pcm_ids>
|
||||
<config_params>
|
||||
<!-- In the below value string, the value indicates default mono -->
|
||||
<!-- speaker. It can be set to either left or right -->
|
||||
<param key="mono_speaker" value="right"/>
|
||||
<param key="true_32_bit" value="true"/>
|
||||
<param key="hifi_filter" value="false"/>
|
||||
<param key="native_audio_mode" value="multiple_mix_dsp"/>
|
||||
<param key="hfp_pcm_dev_id" value="39"/>
|
||||
<param key="input_mic_max_count" value="2"/>
|
||||
<!-- In the below value string, the value indicates whether the -->
|
||||
<!-- target does not supports speaker and headphone working on -->
|
||||
<!-- different fractional and integer sampling rate -->
|
||||
<param key="spkr_hph_single_be_native_concurrency" value="true"/>
|
||||
</config_params>
|
||||
<gain_db_to_level_mapping>
|
||||
<gain_level_map db="-59" level="5"/>
|
||||
<gain_level_map db="-17.4" level="4"/>
|
||||
<gain_level_map db="-13.8" level="3"/>
|
||||
<gain_level_map db="-10.2" level="2"/>
|
||||
<gain_level_map db="0" level="1"/>
|
||||
</gain_db_to_level_mapping>
|
||||
<acdb_ids>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER" acdb_id="421"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_CALI" acdb_id="15"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_REVERSE" acdb_id="15"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED" acdb_id="124"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED" acdb_id="101"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT" acdb_id="124"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT" acdb_id="101"/>
|
||||
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK" acdb_id="102"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED" acdb_id="150"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED_VBAT" acdb_id="150"/>
|
||||
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_1" acdb_id="151"/>
|
||||
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_2" acdb_id="152"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_1" acdb_id="14"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_2" acdb_id="14"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1" acdb_id="10"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" acdb_id="10"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET" acdb_id="45"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_MIC" acdb_id="143"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" acdb_id="144"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" acdb_id="145"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" acdb_id="146"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" acdb_id="147"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" acdb_id="191"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="11"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" acdb_id="7"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_MIC" acdb_id="43"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_RECORD_SPEAKER_MIC" acdb_id="11"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_HANDSET_MIC" acdb_id="41"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_RECORD_HANDSET_MIC" acdb_id="19"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2" acdb_id="15"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES" acdb_id="421"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES" acdb_id="10012"/>
|
||||
<device name="SND_DEVICE_IN_HEADSET_MIC" acdb_id="10008"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_STEREO_MIUI" acdb_id="4"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_STEREO_CTS" acdb_id="35"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_STEREO" acdb_id="4"/>
|
||||
<!-- MIUI patch for karaoke start -->
|
||||
<device name="SND_DEVICE_IN_USB_REALIME_LOOPBACK_MIC" acdb_id="10019"/>
|
||||
<device name="SND_DEVICE_OUT_USB_HEADSET_KARA" acdb_id="10020"/>
|
||||
<device name="SND_DEVICE_IN_REALIME_LOOPBACK_MIC" acdb_id="10019"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES_KARA" acdb_id="10020"/>
|
||||
<!-- MIUI patch for karaoke end -->
|
||||
</acdb_ids>
|
||||
<backend_names>
|
||||
<!-- wt audio mmi-->
|
||||
<device name="SND_DEVICE_IN_FIRST_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SECOND_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_FIRST_MIC_ATA" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SECOND_MIC_ATA" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_OUT_HANDSET_MMI" backend="handset-ata" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_HANDSET_SPK_MODE" backend="handset-ata" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_HANDSET_SPK_MODE_ATA" backend="handset-ata" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_MMI" backend="speaker-mmi" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_HANDSET_ATA" backend="handset-ata" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_ATA" backend="speaker-mmi" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKERLEFT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKERRIGHT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_CALI" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONE_ATA" backend="headphones-ata" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_IN_HEADSET_MIC_ATA" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<!-- wt audio mmi-->
|
||||
<device name="SND_DEVICE_CAPTURE_VI_FEEDBACK" interface="SEC_MI2S_TX"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_GAME_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES_44_1" backend="headphones-44.1" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_BT_SCO_WB" backend="bt-sco-wb" interface="SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_BT_SCO" backend="bt-sco" interface="SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_BT_A2DP" backend="bt-a2dp" interface="SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_LINE" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_ANC_HEADSET" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES" backend="speaker-and-headphones" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER" backend="speaker-and-headphones" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_LINE" backend="speaker-and-headphones" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET" backend="speaker-and-headphones" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_HEADSET" backend="headset" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_ANC_HEADSET" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_LINE" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_TTY_FULL_HEADSET" backend="headset" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_TTY_VCO_HEADSET" backend="headset" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_HANDSET" backend="handset" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_1" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_2" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_REVERSE" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_VBAT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_HANDSET" backend="handset" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" backend="handset" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_GAME_SPEAKER" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_VBAT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_VBAT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_HDMI" interface="SEC_MI2S_RX-and-HDMI"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_DISPLAY_PORT" interface="SEC_MI2S_RX-and-DISPLAY_PORT"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP" interface="SEC_MI2S_RX-and-SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET" interface="RX_CDC_DMA_RX_1"/>
|
||||
<device name="SND_DEVICE_OUT_ANC_FB_HEADSET" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET" interface="RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_ANC_HANDSET" interface="RX_CDC_DMA_RX_1"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED_VBAT" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_WSA" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_WSA" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_WSA" interface="SEC_MI2S_RX"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_RECORD_HANDSET_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_EXTERNAL" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_NS_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_MIC_AEC_NS_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_STEREO" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_STEREO_MIUI" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_DMIC_STEREO_CTS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_NS_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_MIC_AEC_NS_NN" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_GAME_SPEAKER_DMIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_HEADSET_MIC_FLUENCE" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_GAME_HEADSET_MIC_FLUENCE" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_RECORD_SPEAKER_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_HEADSET_MIC_AEC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_MIC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HDMI_MIC" interface="HDMI"/>
|
||||
<device name="SND_DEVICE_IN_BT_SCO_MIC" interface="SLIMBUS_7_TX"/>
|
||||
<device name="SND_DEVICE_IN_BT_SCO_MIC_NREC" interface="SLIMBUS_7_TX"/>
|
||||
<device name="SND_DEVICE_IN_BT_SCO_MIC_WB" interface="SLIMBUS_7_TX"/>
|
||||
<device name="SND_DEVICE_IN_BT_SCO_MIC_WB_NREC" interface="SLIMBUS_7_TX"/>
|
||||
<device name="SND_DEVICE_IN_CAMCORDER_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_CAMCORDER_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_DMIC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_DMIC_SB" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_QMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_MIC_CTS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_MIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_DMIC_STEREO" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_AANC_HANDSET_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_STEREO_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_STEREO_DMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK" interface="WSA_CDC_DMA_TX_0"/>
|
||||
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_1" interface="WSA_CDC_DMA_TX_0"/>
|
||||
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_2" interface="WSA_CDC_DMA_TX_0"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BROADSIDE" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_BROADSIDE" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_BROADSIDE" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_NS_BROADSIDE" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS_BROADSIDE" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_QMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_QMIC_AEC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_QMIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_HEARING_AID" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_TMIC_FLUENCE_PRO" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_TMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_TMIC_AEC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_TMIC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_HANDSET_TMIC_AEC_NS" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_VOICE_REC_TMIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="SEC_MI2S_RX-and-RX_CDC_DMA_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="SEC_MI2S_RX-and-SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb" interface="SEC_MI2S_RX-and-SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_SWB" backend="speaker-and-bt-sco-swb" interface="SEC_MI2S_RX-and-SLIMBUS_7_RX"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES_DSD" backend="headphones-dsd" interface="RX_CDC_DMA_RX_5"/>
|
||||
<device name="SND_DEVICE_IN_ULTRASOUND" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_OUT_ULTRASOUND" interface="SEC_MI2S_RX"/>
|
||||
<!-- MIUI patch for karaoke start -->
|
||||
<device name="SND_DEVICE_IN_REALIME_LOOPBACK_MIC" backend="headset-mic" interface="TX_CDC_DMA_TX_4"/>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES_KARA" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
|
||||
<!-- MIUI patch for karaoke end -->
|
||||
</backend_names>
|
||||
<!-- below values are for ref purpose to OEM, doesn't contain actual hardware info on MTP -->
|
||||
<microphone_characteristics>
|
||||
<microphone valid_mask="31" device_id="builtin_mic_1" type="AUDIO_DEVICE_IN_BUILTIN_MIC" address="bottom" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
|
||||
group="0" index_in_the_group="0" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="93"
|
||||
frequencies="100.00 106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00 20000.00"
|
||||
responses="-0.78 -0.71 -0.64 -0.60 -0.55 -0.50 -0.47 -0.42 -0.39 -0.36 -0.34 -0.33 -0.32 -0.29 -0.28 -0.28 -0.27 -0.25 -0.25 -0.24 -0.23 -0.23 -0.22 -0.22 -0.19 -0.17 -0.15 -0.15 -0.14 -0.14 -0.12 -0.11 -0.10 -0.10 -0.08 -0.07 -0.07 -0.04 -0.03 -0.01 0.00 0.04 0.06 0.07 0.08 0.13 0.09 0.14 0.19 0.23 0.28 0.29 0.31 0.37 0.88 0.86 0.77 0.78 0.84 0.86 1.05 1.12 1.18 1.25 1.43 1.66 1.83 2.02 2.23 2.59 2.84 3.35 4.01 6.82 6.62 6.42 7.30 8.23 7.54 12.68 13.76 18.69 19.68 20.90 23.70 25.10 21.65 16.18 18.84 25.44 23.48 23.22 24.89"
|
||||
sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 0.0 1.0" geometric_location="0.0269 0.0058 0.0079" />
|
||||
<microphone valid_mask="31" device_id="builtin_mic_2" type="AUDIO_DEVICE_IN_BACK_MIC" address="back" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
|
||||
group="0" index_in_the_group="1" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="92"
|
||||
frequencies="106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00 20000.00"
|
||||
responses="-0.75 -0.74 -0.69 -0.65 -0.62 -0.61 -0.56 -0.53 -0.50 -0.47 -0.43 -0.40 -0.37 -0.36 -0.33 -0.30 -0.28 -0.25 -0.24 -0.24 -0.24 -0.25 -0.24 -0.12 -0.10 -0.08 -0.09 -0.07 -0.07 -0.06 -0.06 -0.06 -0.05 -0.04 -0.05 -0.04 -0.01 0.02 0.02 0.00 0.02 0.03 0.07 0.10 0.10 0.13 0.01 0.01 0.10 0.11 0.19 0.24 0.38 0.46 0.26 0.27 0.43 0.76 0.75 1.09 1.09 0.94 1.06 1.21 1.47 1.45 1.36 2.07 2.85 2.90 3.85 4.65 5.84 5.46 6.15 7.50 8.30 10.62 12.70 16.65 20.95 25.41 26.32 20.20 16.60 11.24 7.85 7.62 20.19 7.32 2.87 5.18"
|
||||
sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 1.0 0.0" geometric_location="0.0546 0.1456 0.00415" />
|
||||
<microphone valid_mask="31" device_id="builtin_mic_3" type="AUDIO_DEVICE_IN_BUILTIN_MIC" address="top" location="AUDIO_MICROPHONE_LOCATION_MAINBODY"
|
||||
group="0" index_in_the_group="2" directionality="AUDIO_MICROPHONE_DIRECTIONALITY_OMNI" num_frequency_responses="92"
|
||||
frequencies="100.00 106.00 112.00 118.00 125.00 132.00 140.00 150.00 160.00 170.00 180.00 190.00 200.00 212.00 224.00 236.00 250.00 265.00 280.00 300.00 315.00 335.00 355.00 375.00 400.00 425.00 450.00 475.00 500.00 530.00 560.00 600.00 630.00 670.00 710.00 750.00 800.00 850.00 900.00 950.00 1000.00 1060.00 1120.00 1180.00 1250.00 1320.00 1400.00 1500.00 1600.00 1700.00 1800.00 1900.00 2000.00 2120.00 2240.00 2360.00 2500.00 2650.00 2800.00 3000.00 3150.00 3350.00 3550.00 3750.00 4000.00 4250.00 4500.00 4750.00 5000.00 5300.00 5600.00 6000.00 6300.00 6700.00 7100.00 7500.00 8000.00 8500.00 9000.00 9500.00 10000.00 10600.00 11200.00 11800.00 12500.00 13200.00 14000.00 15000.00 16000.00 17000.00 18000.00 19000.00"
|
||||
responses="-9.24 -9.31 -9.39 -9.45 -9.46 -9.47 -9.50 -9.52 -9.51 -9.52 -9.51 -9.50 -9.49 -9.47 -9.48 -9.49 -9.48 -9.50 -9.51 -9.53 -9.55 -9.59 -9.63 -9.67 -9.58 -9.57 -9.65 -9.68 -9.71 -9.75 -9.79 -9.84 -9.87 -9.87 -9.90 -9.90 -9.91 -9.97 -10.01 -10.05 -9.85 -9.93 -9.94 -9.98 -10.04 -10.12 -10.28 -10.25 -10.01 -9.86 -9.81 -9.82 -9.61 -9.46 -8.27 -8.42 -8.98 -8.99 -8.82 -9.21 -8.92 -8.97 -9.30 -9.44 -9.52 -9.28 -9.09 -8.81 -7.02 -5.72 -5.30 -7.26 -8.39 -12.28 -8.23 -6.99 -5.52 -4.87 -3.82 -6.09 0.00 -2.15 -0.26 1.48 5.22 10.92 6.41 9.55 12.96 3.35 22.00 19.75"
|
||||
sensitivity="-37.0" max_spl="132.5" min_spl="28.5" orientation="0.0 0.0 1.0" geometric_location="0.0274 0.14065 0.0079" />
|
||||
</microphone_characteristics>
|
||||
<snd_devices>
|
||||
<input_snd_device>
|
||||
<input_snd_device_mic_mapping>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_CAMCORDER_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_CAMCORDER_DMIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_AEC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_NS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_REC_MIC_CTS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_DMIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_DMIC_TMUS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_VOICE_SPEAKER_DMIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_AEC_NS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_AEC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_NS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_AEC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_NS">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_UNPROCESSED_THREE_MIC">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_HANDSET_DMIC_STEREO">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
<snd_dev in_snd_device="SND_DEVICE_IN_SPEAKER_DMIC_STEREO">
|
||||
<mic_info mic_device_id="builtin_mic_1"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_2"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
<mic_info mic_device_id="builtin_mic_3"
|
||||
channel_mapping="AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED"/>
|
||||
</snd_dev>
|
||||
</input_snd_device_mic_mapping>
|
||||
</input_snd_device>
|
||||
</snd_devices>
|
||||
</audio_platform_info>
|
||||
|
||||
391
audio/audio_policy_configuration.xml
Normal file
391
audio/audio_policy_configuration.xml
Normal file
@@ -0,0 +1,391 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- Copyright (c) 2016-2020, 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.
|
||||
-->
|
||||
|
||||
<audioPolicyConfiguration version="1.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="false" 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>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_24_BIT_PACKED"
|
||||
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_24_BIT_PACKED"
|
||||
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="compress_passthrough" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
|
||||
</mixPort>
|
||||
<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">
|
||||
<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_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_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</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_IN_7POINT1,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_IN_7POINT1,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_IN_7POINT1,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="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,compress_passthrough,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,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,Telephony Rx"/>
|
||||
<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>
|
||||
|
||||
<!-- 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/audio/sku_holi/r_submix_audio_policy_configuration.xml"/>
|
||||
|
||||
<!-- Bluetooth Audio HAL -->
|
||||
<xi:include href="/vendor/etc/audio/sku_holi/bluetooth_audio_policy_configuration.xml"/>
|
||||
|
||||
</modules>
|
||||
<!-- End of Modules section -->
|
||||
|
||||
<!-- Volume section -->
|
||||
|
||||
<xi:include href="/vendor/etc/audio/sku_holi/audio_policy_volumes.xml"/>
|
||||
<xi:include href="/vendor/etc/audio/sku_holi/default_volume_tables.xml"/>
|
||||
|
||||
<!-- End of Volume section -->
|
||||
|
||||
</audioPolicyConfiguration>
|
||||
263
audio/audio_policy_volumes.xml
Normal file
263
audio/audio_policy_volumes.xml
Normal file
@@ -0,0 +1,263 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<!-- Volume section defines a volume curve for a given use case and device category.
|
||||
It contains a list of points of this curve expressing the attenuation in Millibels for a given
|
||||
volume index from 0 to 100.
|
||||
<volume stream=”AUDIO_STREAM_MUSIC” deviceCategory=””>
|
||||
<point>0,-9600</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
-->
|
||||
|
||||
<volumes>
|
||||
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-2970</point>
|
||||
<point>33,-2010</point>
|
||||
<point>66,-1020</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-6400</point>
|
||||
<point>6,-5900</point>
|
||||
<point>13,-5400</point>
|
||||
<point>20,-4900</point>
|
||||
<point>26,-4400</point>
|
||||
<point>33,-3900</point>
|
||||
<point>40,-3400</point>
|
||||
<point>46,-3000</point>
|
||||
<point>53,-2600</point>
|
||||
<point>60,-2200</point>
|
||||
<point>66,-1800</point>
|
||||
<point>73,-1400</point>
|
||||
<point>80,-1050</point>
|
||||
<point>86,-700</point>
|
||||
<point>93,-350</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-5800</point>
|
||||
<point>6,-5200</point>
|
||||
<point>13,-4450</point>
|
||||
<point>20,-3850</point>
|
||||
<point>26,-3250</point>
|
||||
<point>33,-2650</point>
|
||||
<point>40,-2150</point>
|
||||
<point>46,-1800</point>
|
||||
<point>53,-1500</point>
|
||||
<point>60,-1200</point>
|
||||
<point>66,-900</point>
|
||||
<point>73,-600</point>
|
||||
<point>80,-300</point>
|
||||
<point>86,-200</point>
|
||||
<point>93,-100</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>1,-6400</point>
|
||||
<point>6,-5900</point>
|
||||
<point>13,-5400</point>
|
||||
<point>20,-4900</point>
|
||||
<point>26,-4400</point>
|
||||
<point>33,-3900</point>
|
||||
<point>40,-3400</point>
|
||||
<point>46,-3000</point>
|
||||
<point>53,-2600</point>
|
||||
<point>60,-2200</point>
|
||||
<point>66,-1800</point>
|
||||
<point>73,-1400</point>
|
||||
<point>80,-1050</point>
|
||||
<point>86,-700</point>
|
||||
<point>93,-350</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2970</point>
|
||||
<point>33,-2010</point>
|
||||
<point>66,-1020</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-2970</point>
|
||||
<point>33,-2010</point>
|
||||
<point>66,-1020</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_HEADSET"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_SPEAKER"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EARPIECE"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
|
||||
ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
</volumes>
|
||||
|
||||
1857
audio/dax-default.xml
Normal file
1857
audio/dax-default.xml
Normal file
File diff suppressed because it is too large
Load Diff
153
audio/default_volume_tables.xml
Normal file
153
audio/default_volume_tables.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<!-- Default Volume Tables included by Audio Policy Configuration file -->
|
||||
<!-- Full Default Volume table for all device category -->
|
||||
<volumes>
|
||||
<reference name="FULL_SCALE_VOLUME_CURVE">
|
||||
<!-- Full Scale reference Volume Curve -->
|
||||
<point>0,0</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="SILENT_VOLUME_CURVE">
|
||||
<point>0,-9600</point>
|
||||
<point>100,-9600</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_SYSTEM_VOLUME_CURVE">
|
||||
<!-- Default System reference Volume Curve -->
|
||||
<point>1,-2400</point>
|
||||
<point>33,-1800</point>
|
||||
<point>66,-1200</point>
|
||||
<point>100,-600</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_MEDIA_VOLUME_CURVE">
|
||||
<!-- Default Media reference Volume Curve -->
|
||||
<point>1,-6400</point>
|
||||
<point>6,-5900</point>
|
||||
<point>13,-5400</point>
|
||||
<point>20,-4900</point>
|
||||
<point>26,-4400</point>
|
||||
<point>33,-3900</point>
|
||||
<point>40,-3400</point>
|
||||
<point>46,-3000</point>
|
||||
<point>53,-2600</point>
|
||||
<point>60,-2200</point>
|
||||
<point>66,-1800</point>
|
||||
<point>73,-1400</point>
|
||||
<point>80,-1050</point>
|
||||
<point>86,-700</point>
|
||||
<point>93,-350</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE">
|
||||
<!--Default Volume Curve -->
|
||||
<point>1,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE">
|
||||
<!-- Default is Speaker Media Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>6,-5200</point>
|
||||
<point>13,-4450</point>
|
||||
<point>20,-3850</point>
|
||||
<point>26,-3250</point>
|
||||
<point>33,-2650</point>
|
||||
<point>40,-2150</point>
|
||||
<point>46,-1800</point>
|
||||
<point>53,-1500</point>
|
||||
<point>60,-1200</point>
|
||||
<point>66,-900</point>
|
||||
<point>73,-600</point>
|
||||
<point>80,-300</point>
|
||||
<point>86,-200</point>
|
||||
<point>93,-100</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE">
|
||||
<!--Default Volume Curve -->
|
||||
<point>1,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE">
|
||||
<!-- Default is Ext Media System Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-2100</point>
|
||||
<point>100,-1000</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_HEARING_AID_VOLUME_CURVE">
|
||||
<!-- Default Hearing Aid Volume Curve -->
|
||||
<point>1,-12700</point>
|
||||
<point>20,-8000</point>
|
||||
<point>60,-4000</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<!-- **************************************************************** -->
|
||||
<!-- Non-mutable default volume curves: -->
|
||||
<!-- * first point is always for index 0 -->
|
||||
<!-- * attenuation is small enough that stream can still be heard -->
|
||||
<reference name="DEFAULT_NON_MUTABLE_VOLUME_CURVE">
|
||||
<!-- Default non-mutable reference Volume Curve -->
|
||||
<!-- based on DEFAULT_MEDIA_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE">
|
||||
<!--Default non-mutable Volume Curve for headset -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE -->
|
||||
<point>0,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Speaker Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE">
|
||||
<!--Default non-mutable Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE -->
|
||||
<point>0,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Ext Media System Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-2100</point>
|
||||
<point>100,-1000</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Hearing Aid Volume Curve -->
|
||||
<!-- based on DEFAULT_HEARING_AID_VOLUME_CURVE -->
|
||||
<point>0,-12700</point>
|
||||
<point>20,-8000</point>
|
||||
<point>60,-4000</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
</volumes>
|
||||
4047
audio/mixer_paths.xml
Normal file
4047
audio/mixer_paths.xml
Normal file
File diff suppressed because it is too large
Load Diff
4549
audio/mixer_paths_qrdsku1_AW88261.xml
Normal file
4549
audio/mixer_paths_qrdsku1_AW88261.xml
Normal file
File diff suppressed because it is too large
Load Diff
4545
audio/mixer_paths_qrdsku1_FS1962.xml
Normal file
4545
audio/mixer_paths_qrdsku1_FS1962.xml
Normal file
File diff suppressed because it is too large
Load Diff
343
audio/sound_trigger_mixer_paths.xml
Normal file
343
audio/sound_trigger_mixer_paths.xml
Normal file
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--- Copyright (c) 2014-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. -->
|
||||
|
||||
<mixer>
|
||||
<!-- These are the initial mixer settings -->
|
||||
<ctl name="LSM1 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM2 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM3 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM4 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM5 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM6 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM7 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM8 Mixer VA_CDC_DMA_TX_0" value="0" />
|
||||
<ctl name="LSM1 Port" value="None" />
|
||||
<ctl name="LSM2 Port" value="None" />
|
||||
<ctl name="LSM3 Port" value="None" />
|
||||
<ctl name="LSM4 Port" value="None" />
|
||||
<ctl name="LSM5 Port" value="None" />
|
||||
<ctl name="LSM6 Port" value="None" />
|
||||
<ctl name="LSM7 Port" value="None" />
|
||||
<ctl name="LSM8 Port" value="None" />
|
||||
<ctl name="VA_CDC_DMA_TX_0 Channels" value="One" />
|
||||
<ctl name="VA_CDC_DMA_TX_0 SampleRate" value="KHZ_16" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC0" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC1" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC2" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC3" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC4" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC5" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC6" value="0" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC7" value="0" />
|
||||
<ctl name="VA DEC0 MUX" value="MSM_DMIC" />
|
||||
<ctl name="VA DEC1 MUX" value="MSM_DMIC" />
|
||||
<ctl name="VA DMIC MUX0" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX1" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX2" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX3" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX4" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX5" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX6" value="ZERO" />
|
||||
<ctl name="VA DMIC MUX7" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX0" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX1" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX2" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX3" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX4" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX5" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX6" value="ZERO" />
|
||||
<ctl name="VA SMIC MUX7" value="ZERO" />
|
||||
<ctl name="EC Reference Bit Format" value="0"/>
|
||||
<ctl name="EC Reference SampleRate" value="0"/>
|
||||
<ctl name="ADC1_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2 MUX" value="INP3" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="VA_DEC0 MODE" value="ADC_DEFAULT" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
<ctl name="ADC1 ChMap" value="SWRM_TX1_CH1" />
|
||||
<ctl name="ADC2 ChMap" value="SWRM_TX2_CH1" />
|
||||
<ctl name="ADC1 Volume" value="8" />
|
||||
<ctl name="ADC2 Volume" value="8" />
|
||||
|
||||
<path name="listen-voice-wakeup-1">
|
||||
<ctl name="LSM1 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-2">
|
||||
<ctl name="LSM2 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-3">
|
||||
<ctl name="LSM3 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-4">
|
||||
<ctl name="LSM4 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-5">
|
||||
<ctl name="LSM5 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-6">
|
||||
<ctl name="LSM6 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-7">
|
||||
<ctl name="LSM7 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-8">
|
||||
<ctl name="LSM8 Mixer VA_CDC_DMA_TX_0" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-1 preproc">
|
||||
<path name="listen-voice-wakeup-1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-2 preproc">
|
||||
<path name="listen-voice-wakeup-2" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-3 preproc">
|
||||
<path name="listen-voice-wakeup-3" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-4 preproc">
|
||||
<path name="listen-voice-wakeup-4" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-5 preproc">
|
||||
<path name="listen-voice-wakeup-5" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-6 preproc">
|
||||
<path name="listen-voice-wakeup-6" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-7 preproc">
|
||||
<path name="listen-voice-wakeup-7" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-8 preproc">
|
||||
<path name="listen-voice-wakeup-8" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-1 port">
|
||||
<ctl name="LSM1 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-2 port">
|
||||
<ctl name="LSM2 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-3 port">
|
||||
<ctl name="LSM3 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-4 port">
|
||||
<ctl name="LSM4 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-5 port">
|
||||
<ctl name="LSM5 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-6 port">
|
||||
<ctl name="LSM6 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-7 port">
|
||||
<ctl name="LSM7 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-8 port">
|
||||
<ctl name="LSM8 Port" value="VA_CDC_DMA_TX_0" />
|
||||
<ctl name="LPI Enable" value="1" />
|
||||
<ctl name="ADC2_BCS Disable" value="1" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-1 preproc port">
|
||||
<ctl name="LSM1 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-2 preproc port">
|
||||
<ctl name="LSM2 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-3 preproc port">
|
||||
<ctl name="LSM3 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-4 preproc port">
|
||||
<ctl name="LSM4 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-5 preproc port">
|
||||
<ctl name="LSM5 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-6 preproc port">
|
||||
<ctl name="LSM6 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-7 preproc port">
|
||||
<ctl name="LSM7 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-voice-wakeup-8 preproc port">
|
||||
<ctl name="LSM8 Port" value="ADM_LSM_TX" />
|
||||
<ctl name="LPI Enable" value="0" />
|
||||
<ctl name="ADC2_BCS Disable" value="0" />
|
||||
</path>
|
||||
|
||||
<path name="listen-ape-handset-mic">
|
||||
<ctl name="VA_CDC_DMA_TX_0 Channels" value="One" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC0" value="1" />
|
||||
<ctl name="VA DEC0 MUX" value="SWR_MIC" />
|
||||
<ctl name="VA SMIC MUX0" value="SWR_MIC4" />
|
||||
<ctl name="VA_DEC0 MODE" value="ADC_LOW_PWR" />
|
||||
<ctl name="ADC2 ChMap" value="SWRM_TX2_CH1" />
|
||||
<ctl name="ADC2_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2 MUX" value="INP3" />
|
||||
<ctl name="VA_DEC0 Volume" value="96" />
|
||||
</path>
|
||||
|
||||
<path name="listen-ape-handset-mic-preproc">
|
||||
<path name="listen-ape-handset-mic" />
|
||||
</path>
|
||||
|
||||
<path name="listen-ape-handset-dmic-lpi">
|
||||
<ctl name="VA_CDC_DMA_TX_0 Channels" value="Two" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC0" value="1" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC1" value="1" />
|
||||
<ctl name="VA DEC0 MUX" value="SWR_MIC" />
|
||||
<ctl name="VA DEC1 MUX" value="SWR_MIC" />
|
||||
<ctl name="VA_DEC0 MODE" value="ADC_LOW_PWR" />
|
||||
<ctl name="VA_DEC1 MODE" value="ADC_LOW_PWR" />
|
||||
<ctl name="VA SMIC MUX0" value="SWR_MIC0" />
|
||||
<ctl name="VA SMIC MUX1" value="SWR_MIC4" />
|
||||
<ctl name="ADC1 ChMap" value="SWRM_TX1_CH1" />
|
||||
<ctl name="ADC2 ChMap" value="SWRM_TX2_CH1" />
|
||||
<ctl name="ADC1_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2 MUX" value="INP3" />
|
||||
</path>
|
||||
|
||||
<path name="listen-ape-handset-dmic">
|
||||
<ctl name="VA_CDC_DMA_TX_0 Channels" value="Two" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC0" value="1" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC1" value="1" />
|
||||
<ctl name="VA DEC0 MUX" value="SWR_MIC" />
|
||||
<ctl name="VA DEC1 MUX" value="SWR_MIC" />
|
||||
<ctl name="VA_DEC0 MODE" value="ADC_LOW_PWR" />
|
||||
<ctl name="VA_DEC1 MODE" value="ADC_LOW_PWR" />
|
||||
<ctl name="VA SMIC MUX0" value="SWR_MIC4" />
|
||||
<ctl name="VA SMIC MUX1" value="SWR_MIC0" />
|
||||
<ctl name="ADC2 ChMap" value="SWRM_TX2_CH1" />
|
||||
<ctl name="ADC1 ChMap" value="SWRM_TX1_CH1" />
|
||||
<ctl name="ADC1_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2 MUX" value="INP3" />
|
||||
</path>
|
||||
|
||||
<path name="listen-ape-headset-mic">
|
||||
<ctl name="VA_CDC_DMA_TX_0 Channels" value="One" />
|
||||
<ctl name="VA_AIF1_CAP Mixer DEC0" value="1" />
|
||||
<ctl name="VA DEC0 MUX" value="SWR_MIC" />
|
||||
<ctl name="VA SMIC MUX0" value="SWR_MIC4" />
|
||||
<ctl name="ADC2_MIXER Switch" value="1" />
|
||||
<ctl name="ADC2 MUX" value="INP2" />
|
||||
<ctl name="VA_DEC0 MODE" value="ADC_LOW_PWR" />
|
||||
<ctl name="ADC2 ChMap" value="SWRM_TX2_CH1" />
|
||||
</path>
|
||||
|
||||
<path name="echo-reference">
|
||||
<ctl name="AUDIO_REF_EC_UL1 MUX" value="SEC_MI2S_TX" />
|
||||
<ctl name="SEC_MI2S_RX Channels" value="Two" />
|
||||
<ctl name="EC Reference Channels" value="Two"/>
|
||||
<ctl name="EC Reference Bit Format" value="S32_LE"/>
|
||||
<ctl name="EC Reference SampleRate" value="96000"/>
|
||||
</path>
|
||||
|
||||
<path name="echo-reference handset">
|
||||
<ctl name="AUDIO_REF_EC_UL1 MUX" value="SEC_MI2S_TX" />
|
||||
<ctl name="SEC_MI2S_RX Channels" value="Two" />
|
||||
<ctl name="EC Reference Channels" value="Two"/>
|
||||
<ctl name="EC Reference Bit Format" value="S32_LE"/>
|
||||
<ctl name="EC Reference SampleRate" value="96000"/>
|
||||
</path>
|
||||
|
||||
<path name="echo-reference headphones">
|
||||
<ctl name="AUDIO_REF_EC_UL1 MUX" value="RX_CDC_DMA_RX_0" />
|
||||
<ctl name="EC Reference Channels" value="One"/>
|
||||
<ctl name="EC Reference Bit Format" value="S16_LE"/>
|
||||
<ctl name="EC Reference SampleRate" value="48000"/>
|
||||
</path>
|
||||
|
||||
<path name="echo-reference headset">
|
||||
<path name="echo-reference headphones" />
|
||||
</path>
|
||||
|
||||
<path name="echo-reference a2dp">
|
||||
<ctl name="AUDIO_REF_EC_UL1 MUX" value="SLIM_7_RX"/>
|
||||
<ctl name="EC Reference Channels" value="Two"/>
|
||||
<ctl name="EC Reference Bit Format" value="S16_LE"/>
|
||||
<ctl name="EC Reference SampleRate" value="48000"/>
|
||||
</path>
|
||||
|
||||
</mixer>
|
||||
801
audio/sound_trigger_platform_info.xml
Normal file
801
audio/sound_trigger_platform_info.xml
Normal file
@@ -0,0 +1,801 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--- Copyright (c) 2013-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. -->
|
||||
<sound_trigger_platform_info>
|
||||
<param version="0x0106" /> <!-- this must be the first param -->
|
||||
<!--- Version History: -->
|
||||
<!--- 0x0101: Legacy version. -->
|
||||
<!--- 0x0102: Includes acdb_ids param with the gcs_usecase tag. This matches -->
|
||||
<!--- the gcs_usecase with the acdb device that uses it. -->
|
||||
<!--- 0x0103: app_type and in_channels added to <lsm usecase> and out_channels -->
|
||||
<!--- added to <adm_config> -->
|
||||
<!--- 0x0104: instance id support for both WDSP<CPE> and ADSP lsm usecases -->
|
||||
<!--- 0x0105: Select <lsm_usecase> based on capture device -->
|
||||
<!--- 0x0106: Add module_params tag to support multiple module and param ids -->
|
||||
<!--- per <lsm_usecase> -->
|
||||
|
||||
<common_config>
|
||||
<param implementer_version="0x0102" />
|
||||
<param max_ape_sessions="8" />
|
||||
<param enable_failure_detection="false" />
|
||||
<param support_device_switch="true" />
|
||||
<param transit_to_non_lpi_on_battery_charging="false" />
|
||||
<!-- Below backend params must match with port used in mixer path file -->
|
||||
<!-- param used to configure backend sample rate, format and channels -->
|
||||
<param backend_port_name="VA_CDC_DMA_TX_0" />
|
||||
<!-- Param used to match and obtain device backend index -->
|
||||
<param backend_dai_name="VA_CDC_DMA_TX_0" />
|
||||
<!-- Param used to indicate if SVA has dedicated SLIM ports -->
|
||||
<param dedicated_sva_path="false" />
|
||||
<param dedicated_headset_path="false" />
|
||||
<param platform_lpi_enable="true" />
|
||||
<param enable_debug_dumps="false" />
|
||||
<param support_non_lpi_without_ec="false" />
|
||||
<param concurrent_capture="false" />
|
||||
<param concurrent_voip_call="false" />
|
||||
<param concurrent_voice_call="false" />
|
||||
</common_config>
|
||||
<acdb_ids>
|
||||
<param DEVICE_HANDSET_MIC_APE="100" />
|
||||
<param DEVICE_HANDSET_MIC_PP_APE="135" />
|
||||
<param DEVICE_HANDSET_DMIC_APE="149" />
|
||||
<param DEVICE_HANDSET_DMIC_LPI_APE="179" />
|
||||
<param DEVICE_HANDSET_TMIC_APE="157" />
|
||||
<param DEVICE_HANDSET_TMIC_LPI_APE="180" />
|
||||
<param DEVICE_HANDSET_QMIC_APE="137" />
|
||||
<param DEVICE_HANDSET_QMIC_LPI_APE="181" />
|
||||
<param DEVICE_HEADSET_MIC_APE="141" />
|
||||
<param DEVICE_HEADSET_MIC_APE_LPI="182" />
|
||||
</acdb_ids>
|
||||
|
||||
<!-- Multiple sound_model_config tags can be listed, each with unique -->
|
||||
<!-- vendor_uuid. The below tag represents QTI SVA engine sound model -->
|
||||
<!-- configuration. ISV must use their own unique vendor_uuid. -->
|
||||
|
||||
<!-- QTI SVA -->
|
||||
<sound_model_config>
|
||||
<param vendor_uuid="68ab2d40-e860-11e3-95ef-0002a5d5c51b" />
|
||||
<param execution_type="ADSP" />
|
||||
<param merge_first_stage_sound_models="false"/>
|
||||
<param max_ape_phrases="20" />
|
||||
<param max_ape_users="10" />
|
||||
<!-- Profile specific data which the algorithm can support -->
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/> <!-- Module output channels -->
|
||||
<param dam_token_id="1"/>
|
||||
<arm_ss_usecase>
|
||||
<!-- Options are "KEYWORD_DETECTION", "USER_VERIFICATION", "CUSTOM_DETECTION" -->
|
||||
<param sm_detection_type= "KEYWORD_DETECTION" />
|
||||
<param sm_id="0x2" />
|
||||
<param module_lib="libcapiv2svacnn.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
</arm_ss_usecase>
|
||||
<arm_ss_usecase>
|
||||
<param sm_detection_type= "USER_VERIFICATION" />
|
||||
<param sm_id="0x4" />
|
||||
<param module_lib="libcapiv2vop.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
</arm_ss_usecase>
|
||||
<arm_ss_usecase>
|
||||
<param sm_detection_type= "KEYWORD_DETECTION" />
|
||||
<param sm_id="0x8" />
|
||||
<param module_lib="libcapiv2svarnn.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
</arm_ss_usecase>
|
||||
<!-- Module and param ids with which the algorithm is integrated
|
||||
in non-graphite firmware (note these must come after gcs params)
|
||||
Extends flexibility to have different ids based on execution type.
|
||||
valid execution_type values: "WDSP" "ADSP" -->
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="FLUENCE_DMIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="NON_LPI_BARGE_IN" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="LPI" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HEADSET" />
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<param fluence_type="FLUENCE_MIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
|
||||
<!-- format: "ADPCM_packet" or "PCM_packet" !-->
|
||||
<!-- transfer_mode: "FTRT" or "RT" -->
|
||||
<!-- kw_duration is in milli seconds. It is valid only for FTRT
|
||||
transfer mode -->
|
||||
<param capture_keyword="PCM_packet, RT, 2000" />
|
||||
<param client_capture_read_delay="2000" />
|
||||
</sound_model_config>
|
||||
|
||||
<!-- QTI SVA -->
|
||||
<sound_model_config>
|
||||
<param vendor_uuid="68ab2d40-e860-11e3-95ef-0002a5d5c51c" />
|
||||
<param execution_type="ADSP" />
|
||||
<param merge_first_stage_sound_models="false"/>
|
||||
<param max_ape_phrases="20" />
|
||||
<param max_ape_users="10" />
|
||||
<!-- Profile specific data which the algorithm can support -->
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/> <!-- Module output channels -->
|
||||
<param dam_token_id="1"/>
|
||||
<param kw_start_tolerance="360"/>
|
||||
<param kw_end_tolerance="240"/>
|
||||
|
||||
<arm_ss_usecase>
|
||||
<!-- Options are "KEYWORD_DETECTION", "USER_VERIFICATION", "CUSTOM_DETECTION" -->
|
||||
<param sm_detection_type= "KEYWORD_DETECTION" />
|
||||
<param sm_id="0x2" />
|
||||
<param module_lib="libcapiv2svacnn.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
<param data_after_kw_end="480"/>
|
||||
</arm_ss_usecase>
|
||||
<arm_ss_usecase>
|
||||
<param sm_detection_type= "USER_VERIFICATION" />
|
||||
<param sm_id="0x4" />
|
||||
<param module_lib="libcapiv2vop.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
</arm_ss_usecase>
|
||||
<arm_ss_usecase>
|
||||
<param sm_detection_type= "KEYWORD_DETECTION" />
|
||||
<param sm_id="0x8" />
|
||||
<param module_lib="libcapiv2svarnn.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
<param data_after_kw_end="480"/>
|
||||
</arm_ss_usecase>
|
||||
<!-- Module and param ids with which the algorithm is integrated
|
||||
in non-graphite firmware (note these must come after gcs params)
|
||||
Extends flexibility to have different ids based on execution type.
|
||||
valid execution_type values: "WDSP" "ADSP" -->
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="FLUENCE_DMIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="NON_LPI_BARGE_IN" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="3"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="FLUENCE_DMIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="LPI" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HEADSET" />
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<param fluence_type="FLUENCE_MIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
|
||||
<!-- format: "ADPCM_packet" or "PCM_packet" !-->
|
||||
<!-- transfer_mode: "FTRT" or "RT" -->
|
||||
<!-- kw_duration is in milli seconds. It is valid only for FTRT
|
||||
transfer mode -->
|
||||
<param capture_keyword="PCM_packet, RT, 2000" />
|
||||
<param client_capture_read_delay="2000" />
|
||||
</sound_model_config>
|
||||
|
||||
<!-- QTI SVA -->
|
||||
<sound_model_config>
|
||||
<param vendor_uuid="68ab2d40-e860-11e3-95ef-0002a5d5c51d" />
|
||||
<param execution_type="ADSP" />
|
||||
<param merge_first_stage_sound_models="false"/>
|
||||
<param max_ape_phrases="20" />
|
||||
<param max_ape_users="10" />
|
||||
<!-- Profile specific data which the algorithm can support -->
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/> <!-- Module output channels -->
|
||||
<param dam_token_id="1"/>
|
||||
<param kw_start_tolerance="700"/>
|
||||
<param kw_end_tolerance="600"/>
|
||||
|
||||
<arm_ss_usecase>
|
||||
<!-- Options are "KEYWORD_DETECTION", "USER_VERIFICATION", "CUSTOM_DETECTION" -->
|
||||
<param sm_detection_type= "KEYWORD_DETECTION" />
|
||||
<param sm_id="0x2" />
|
||||
<param module_lib="libcapiv2svacnn.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
<param data_after_kw_end="1000"/>
|
||||
</arm_ss_usecase>
|
||||
<arm_ss_usecase>
|
||||
<param sm_detection_type= "USER_VERIFICATION" />
|
||||
<param sm_id="0x4" />
|
||||
<param module_lib="libcapiv2vop.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
</arm_ss_usecase>
|
||||
<arm_ss_usecase>
|
||||
<param sm_detection_type= "KEYWORD_DETECTION" />
|
||||
<param sm_id="0x8" />
|
||||
<param module_lib="libcapiv2svarnn.so"/>
|
||||
<param sample_rate="16000"/>
|
||||
<param bit_wdith="16"/>
|
||||
<param channel_count="1"/>
|
||||
<param data_after_kw_end="1000"/>
|
||||
</arm_ss_usecase>
|
||||
<!-- Module and param ids with which the algorithm is integrated
|
||||
in non-graphite firmware (note these must come after gcs params)
|
||||
Extends flexibility to have different ids based on execution type.
|
||||
valid execution_type values: "WDSP" "ADSP" -->
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="FLUENCE_DMIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="NON_LPI_BARGE_IN" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="3"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="FLUENCE_DMIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="LPI" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HEADSET" />
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<param fluence_type="FLUENCE_MIC" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="2" /> <!-- app type used in ACDB -->
|
||||
<param pdk5_app_type="5" />
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param module_type="GMM" />
|
||||
<param load_sound_model_ids="0x00012C1C, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C1C, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C1C, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x00012C1C, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x00012C1C, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x00012C1C, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C1C, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
<module_params>
|
||||
<param module_type="PDK5" />
|
||||
<param load_sound_model_ids="0x00012C35, 0x0, 0x00012C36" />
|
||||
<param unload_sound_model_ids="0x00012C35, 0x0, 0x00012C37" />
|
||||
<param confidence_levels_ids="0x00012C35, 0x0, 0x00012C38" />
|
||||
<param custom_config_ids="0x00012C35, 0x0, 0x00012C20" />
|
||||
<param det_event_type_ids="0x00012C35, 0x0, 0x00012C2C" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
|
||||
<!-- format: "ADPCM_packet" or "PCM_packet" !-->
|
||||
<!-- transfer_mode: "FTRT" or "RT" -->
|
||||
<!-- kw_duration is in milli seconds. It is valid only for FTRT
|
||||
transfer mode -->
|
||||
<param capture_keyword="PCM_packet, RT, 2000" />
|
||||
<param client_capture_read_delay="2000" />
|
||||
</sound_model_config>
|
||||
|
||||
<!-- QTI Music Detection !-->
|
||||
<sound_model_config>
|
||||
<param vendor_uuid="876c1b46-9d4d-40cc-a4fd-4d5ec7a80e47" />
|
||||
<param execution_type="ADSP" />
|
||||
<param max_ape_phrases="1" />
|
||||
<param max_ape_users="1" />
|
||||
<!-- Profile specific data which the algorithm can support -->
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/> <!-- Module output channels -->
|
||||
<!-- Module and param ids with which the algorithm is integrated
|
||||
in non-graphite firmware (note these must come after gcs params)
|
||||
Extends flexibility to have different ids based on execution type.
|
||||
valid execution_type values: only "ADSP" -->
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="4" /> <!-- app type for MD used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x00012C22, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C22, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C22, 0x0, 0x00012C07" />
|
||||
<param det_event_type_ids="0x00012C22, 0x0, 0x00012C2C" />
|
||||
<param custom_config_ids="0x00012C22, 0x0, 0x00012C30" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HEADSET" />
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="4" /> <!-- app type for MD used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x00012C22, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x00012C22, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x00012C22, 0x0, 0x00012C07" />
|
||||
<param det_event_type_ids="0x00012C22, 0x0, 0x00012C2C" />
|
||||
<param custom_config_ids="0x00012C22, 0x0, 0x00012C30" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
|
||||
<!-- format: "ADPCM_packet" or "PCM_packet" !-->
|
||||
<!-- transfer_mode: "FTRT" or "RT" -->
|
||||
<!-- kw_duration is in milli seconds. It is valid only for FTRT
|
||||
transfer mode -->
|
||||
<param capture_keyword="PCM_packet, FTRT, 1500" />
|
||||
<param client_capture_read_delay="2000" />
|
||||
</sound_model_config>
|
||||
|
||||
<!-- Google Hotword -->
|
||||
<sound_model_config>
|
||||
<param vendor_uuid="7038ddc8-30f2-11e6-b0ac-40a8f03d3f15" />
|
||||
<param execution_type="ADSP" />
|
||||
<param max_ape_phrases="1" />
|
||||
<param max_ape_users="1" />
|
||||
<!-- Profile specific data which the algorithm can support -->
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/> <!-- Module output channels -->
|
||||
<param dam_token_id="1"/>
|
||||
<param get_module_version="true"/>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="NON_LPI_BARGE_IN" />
|
||||
<param app_type="3" /> <!-- app type used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x18000001, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x18000001, 0x0, 0x00012C15" />
|
||||
<param custom_config_ids="0x18000001, 0x0, 0x00012C20" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
<param version_ids="0x18000001, 0x0, 0x18000101" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<!-- lpi_mode: "NON_LPI_BARGE_IN", "NON_LPI", "LPI" -->
|
||||
<!-- NON_LPI_BARGE_IN: Default non-LPI mode type. lsm_usecase -->
|
||||
<!-- must be present with this mode type to handle barge-in. -->
|
||||
<!-- NON_LPI: If another lsm_usecase is present with this mode -->
|
||||
<!-- type, it will be used for non-LPI non-barge-in usecases. -->
|
||||
<!-- If not present, NON_LPI_BARGE_IN mode type will be used. -->
|
||||
<!-- LPI: This mode type will be used for LPI usecases. -->
|
||||
<param lpi_mode="LPI" />
|
||||
<param app_type="3" /> <!-- app type used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x18000001, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x18000001, 0x0, 0x00012C15" />
|
||||
<param custom_config_ids="0x18000001, 0x0, 0x00012C20" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
<param version_ids="0x18000001, 0x0, 0x18000101" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HEADSET" />
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="3" /> <!-- app type used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x18000001, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x18000001, 0x0, 0x00012C15" />
|
||||
<param custom_config_ids="0x18000001, 0x0, 0x00012C20" />
|
||||
<param lab_dam_cfg_ids="0x00012C08, 0x0, 0x000102C4" />
|
||||
<param version_ids="0x18000001, 0x0, 0x18000101" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
|
||||
<!-- format: "ADPCM_packet" or "PCM_packet" !-->
|
||||
<!-- transfer_mode: "FTRT" or "RT" -->
|
||||
<!-- kw_duration is in milli seconds. It is valid only for FTRT
|
||||
transfer mode -->
|
||||
<param capture_keyword="PCM_raw, FTRT, 2000" />
|
||||
<param client_capture_read_delay="2000" />
|
||||
</sound_model_config>
|
||||
|
||||
<!-- Google Music Detection -->
|
||||
<sound_model_config>
|
||||
<param vendor_uuid="9f6ad62a-1f0b-11e7-87c5-40a8f03d3f15" />
|
||||
<param execution_type="ADSP" />
|
||||
<param max_ape_phrases="1" />
|
||||
<param max_ape_users="1" />
|
||||
<!-- Profile specific data which the algorithm can support -->
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/> <!-- Module output channels -->
|
||||
<lsm_usecase>
|
||||
<param capture_device="HANDSET" />
|
||||
<!-- adm_cfg_profile should match with the one defined under adm_config -->
|
||||
<!-- Set it to NONE if LSM directly connects to AFE -->
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<!-- fluence_type: "FLUENCE_MIC", "FLUENCE_DMIC", "FLUENCE_TMIC" -->
|
||||
<!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
|
||||
<!-- is FFECNS -->
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="3" /> <!-- app type used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x18000001, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x18000001, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x18000001, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x18000001, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x18000001, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x18000001, 0x0, 0x00012C20" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
<lsm_usecase>
|
||||
<param capture_device="HEADSET" />
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<param fluence_type="NONE" />
|
||||
<param execution_mode="ADSP" />
|
||||
<param app_type="3" /> <!-- app type used in ACDB -->
|
||||
<param in_channels="1"/> <!-- Module input channels -->
|
||||
<module_params>
|
||||
<param load_sound_model_ids="0x18000001, 0x0, 0x00012C14" />
|
||||
<param unload_sound_model_ids="0x18000001, 0x0, 0x00012C15" />
|
||||
<param confidence_levels_ids="0x18000001, 0x0, 0x00012C07" />
|
||||
<param operation_mode_ids="0x18000001, 0x0, 0x00012C02" />
|
||||
<param polling_enable_ids="0x18000001, 0x0, 0x00012C1B" />
|
||||
<param custom_config_ids="0x18000001, 0x0, 0x00012C20" />
|
||||
</module_params>
|
||||
</lsm_usecase>
|
||||
|
||||
<!-- format: "ADPCM_packet" or "PCM_packet" !-->
|
||||
<!-- transfer_mode: "FTRT" or "RT" -->
|
||||
<!-- kw_duration is in milli seconds. It is valid only for FTRT
|
||||
transfer mode -->
|
||||
<param capture_keyword="PCM_raw, FTRT, 5000" />
|
||||
<param client_capture_read_delay="2000" />
|
||||
</sound_model_config>
|
||||
|
||||
<!-- Multiple adm_config tags can be listed, each with unique profile name. -->
|
||||
<!-- app_type to match corresponding value from ACDB -->
|
||||
<adm_config>
|
||||
<param adm_cfg_profile="FFECNS" />
|
||||
<param app_type="69947" />
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/>
|
||||
</adm_config>
|
||||
|
||||
<adm_config>
|
||||
<param adm_cfg_profile="DEFAULT" />
|
||||
<param app_type="69938" />
|
||||
<param sample_rate="16000" />
|
||||
<param bit_width="16" />
|
||||
<param out_channels="1"/>
|
||||
</adm_config>
|
||||
</sound_trigger_platform_info>
|
||||
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,
|
||||
}
|
||||
20
configs/camxoverridesettings.txt
Normal file
20
configs/camxoverridesettings.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
MultiCameraEnable=TRUE
|
||||
enable3ADebugData=FALSE
|
||||
enableMCTF=TRUE
|
||||
vsquality=6@30|5@30
|
||||
iseispreviewSupported=TRUE
|
||||
is3rdLightWeightSupported=TRUE
|
||||
vsquality=6@30|5@30
|
||||
iseispreviewSupported=TRUE
|
||||
isPhyicalMultiCameraSupported=TRUE
|
||||
overrideFlashTorchCurrent=375
|
||||
isColorEnhancementSupported=1
|
||||
numPCRsBeforeStreamOn=1
|
||||
enableBayerSAT=FALSE
|
||||
multiCameraSWFrameSyncInterval=0
|
||||
multiCameraHWSyncMask=0x1
|
||||
multiCameraFPSMatchMask=0x1
|
||||
multiCameraFrameSyncMask=0x1
|
||||
multiCameraExposureTimeMatch=FALSE
|
||||
enableTOFInterface=FALSE
|
||||
disableFocusIndication=1
|
||||
19
configs/component-overrides.xml
Normal file
19
configs/component-overrides.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2019 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.
|
||||
-->
|
||||
<config>
|
||||
<component-override package="com.android.bluetooth" >
|
||||
<component class=".avrcpcontroller.AvrcpControllerService" enabled="true" />
|
||||
<component class=".hid.HidDeviceService" enabled="true" />
|
||||
<component class=".sap.SapService" enabled="true" />
|
||||
</component-override>
|
||||
</config>
|
||||
34
configs/display_id_4630947081618265473.xml
Normal file
34
configs/display_id_4630947081618265473.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
|
||||
|
||||
<displayConfiguration>
|
||||
<!-- Global Brightness-Nit mapping -->
|
||||
<screenBrightnessMap>
|
||||
<point>
|
||||
<value>0.003421310</value>
|
||||
<nits>2.0</nits>
|
||||
</point>
|
||||
<point>
|
||||
<value>1.0</value>
|
||||
<nits>450.0</nits>
|
||||
</point>
|
||||
</screenBrightnessMap>
|
||||
|
||||
<screenBrightnessRampIncreaseMaxMillis>2000</screenBrightnessRampIncreaseMaxMillis>
|
||||
|
||||
<ambientBrightnessChangeThresholds>
|
||||
<brighteningThresholds>
|
||||
<minimum>10</minimum>
|
||||
</brighteningThresholds>
|
||||
<darkeningThresholds>
|
||||
<minimum>0</minimum>
|
||||
</darkeningThresholds>
|
||||
</ambientBrightnessChangeThresholds>
|
||||
|
||||
<ambientLightHorizonLong>5000</ambientLightHorizonLong>
|
||||
<ambientLightHorizonShort>50</ambientLightHorizonShort>
|
||||
|
||||
<screenBrightnessRampFastDecrease>0.7047244</screenBrightnessRampFastDecrease>
|
||||
<screenBrightnessRampFastIncrease>0.7047244</screenBrightnessRampFastIncrease>
|
||||
<screenBrightnessRampSlowDecrease>0.05</screenBrightnessRampSlowDecrease>
|
||||
<screenBrightnessRampSlowIncrease>0.05</screenBrightnessRampSlowIncrease>
|
||||
</displayConfiguration>
|
||||
292
configs/media/media_codecs_blair.xml
Normal file
292
configs/media/media_codecs_blair.xml
Normal file
@@ -0,0 +1,292 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright (c) 2018-2021 Qualcomm Technologies, Inc.
|
||||
All Rights Reserved.
|
||||
Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
|
||||
Not a Contribution.
|
||||
|
||||
Copyright (C) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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.
|
||||
-->
|
||||
|
||||
<!--
|
||||
"performance-point"
|
||||
Vendor-guaranteed performance advertised to the applications
|
||||
<Limit name="performance-point-widthxheight" value="fps" />
|
||||
|
||||
-For each of the resolutions, the advertised fps is the max supported,
|
||||
with HW-friendly color format and considering video-only.
|
||||
-Performance for any intermediate resolution will be that of the
|
||||
next-higher-advertised-resolution.
|
||||
|
||||
standard sizes: 480p/576p (SD), 720p (HD), 1080p (FHD), 2160p (UHD)
|
||||
standard frame rates: 24, 25, 30, 48+, 50, 60, 100*, 120*, 200*, 240* fps
|
||||
* HD+ only
|
||||
+ SD only
|
||||
- All supported standard performance points are listed (unless they are
|
||||
covered by another listed standard performance point)
|
||||
- Non-standard performance points are listed along with all the standard
|
||||
performance points covered by them.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Holi Non-Secure decoder capabilities
|
||||
(MB is defined as 16x16)
|
||||
|
||||
_______________________________________________________
|
||||
| Codec | W H fps Mbps MB/s |
|
||||
|_____________|_________________________________________|
|
||||
| h264 | 1920 1088 60 60 489600 |
|
||||
| hevc | 1920 1080 60 60 489600 |
|
||||
| vp9 | 1920 1088 60 60 489600 |
|
||||
|_____________|_________________________________________|
|
||||
|
||||
Secure decoder capabilities
|
||||
(MB is defined as 16x16)
|
||||
|
||||
_____________________________________________________
|
||||
| Codec | W H fps Mbps MB/s |
|
||||
|__________|_________________________________________|
|
||||
| h264 | 1920 1088 60 35 489600 |
|
||||
| vp9 | 1920 1088 60 35 489600 |
|
||||
| hevc | 1920 1088 60 35 489600 |
|
||||
|__________|_________________________________________|
|
||||
|
||||
|
||||
Non-Secure encoder capabilities (Secure not supported)
|
||||
(MB is defined as 16x16)
|
||||
|
||||
______________________________________________________
|
||||
| Codec | W H fps Mbps MB/s |
|
||||
|__________|_________________________________________|
|
||||
| h264 | 1920 1088 60 60 489600 |
|
||||
| hevc | 1920 1088 60 60 489600 |
|
||||
|__________|_________________________________________|
|
||||
-->
|
||||
|
||||
<MediaCodecs>
|
||||
<Include href="media_codecs_dolby_audio.xml" />
|
||||
<Settings>
|
||||
<Domain name="telephony" enabled="true" />
|
||||
<Setting name="max-video-encoder-input-buffers" value="11" />
|
||||
</Settings>
|
||||
<Settings>
|
||||
<Variant name="slow-cpu" enabled="true" />
|
||||
</Settings>
|
||||
<Decoders>
|
||||
<!-- C2 decoders -->
|
||||
<MediaCodec name="c2.qti.avc.decoder" type="video/avc">
|
||||
<Alias name="OMX.qcom.video.decoder.avc"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" range="36-489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
<Limit name="performance-point-1280x720" value="120" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.avc.decoder.low_latency" type="video/avc">
|
||||
<Alias name="OMX.qcom.video.decoder.avc.low_latency"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" range="36-489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="low-latency" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
<Limit name="performance-point-1280x720" value="120" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.avc.decoder.secure" type="video/avc" >
|
||||
<Alias name="OMX.qcom.video.decoder.avc.secure"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="36" max="489600" />
|
||||
<Limit name="bitrate" range="1-35000000" />
|
||||
<Limit name="frame-rate" range="1-60" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="low-latency" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="3" />
|
||||
<Limit name="concurrent-instances" max="3" />
|
||||
<Limit name="performance-point-1920x1080" value="30" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" >
|
||||
<Alias name="OMX.qcom.video.decoder.hevc"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="36" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
<Limit name="performance-point-1280x720" value="120" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.decoder.low_latency" type="video/hevc" >
|
||||
<Alias name="OMX.qcom.video.decoder.hevc.low_latency"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="36" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="low-latency" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
<Limit name="performance-point-1280x720" value="120" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.decoder.secure" type="video/hevc" >
|
||||
<Alias name="OMX.qcom.video.decoder.hevc.secure"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="36" max="489600" />
|
||||
<Limit name="bitrate" range="1-35000000" />
|
||||
<Limit name="frame-rate" range="1-60" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="low-latency" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="3" />
|
||||
<Limit name="performance-point-1920x1080" value="30" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" >
|
||||
<Alias name="OMX.qcom.video.decoder.vp9"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="36" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-60" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="3" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.vp9.decoder.secure" type="video/x-vnd.on2.vp9" >
|
||||
<Alias name="OMX.qcom.video.decoder.vp9.secure"/>
|
||||
<Limit name="size" min="96x96" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="36" max="489600" />
|
||||
<Limit name="bitrate" range="1-35000000" />
|
||||
<Limit name="frame-rate" range="1-60" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="3" />
|
||||
<Limit name="performance-point-1920x1080" value="30" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.av1.decoder" type="video/av01" update="true" variant="slow-cpu">
|
||||
<Limit name="size" min="96x96" max="1920x1080" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="24" max="2073600" />
|
||||
<Limit name="bitrate" range="1-120000000" />
|
||||
<Limit name="frame-rate" range="1-60" />
|
||||
<Feature name="adaptive-playback" />
|
||||
</MediaCodec>
|
||||
</Decoders>
|
||||
<Encoders>
|
||||
<!-- C2 encoders -->
|
||||
<MediaCodec name="c2.qti.avc.encoder" type="video/avc">
|
||||
<Alias name="OMX.qcom.video.encoder.avc"/>
|
||||
<Limit name="size" min="128x128" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="64" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="intra-refresh" />
|
||||
<Feature name="bitrate-modes" value="VBR,CBR" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
<Limit name="performance-point-1280x720" value="120" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.encoder" type="video/hevc">
|
||||
<Alias name="OMX.qcom.video.encoder.hevc"/>
|
||||
<Limit name="size" min="128x128" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="64" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="bitrate-modes" value="VBR,CBR" />
|
||||
<Feature name="intra-refresh" />
|
||||
<Limit name="performance-point-1920x1080" value="60" />
|
||||
<Limit name="performance-point-1280x720" value="120" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.encoder.cq" type="video/hevc">
|
||||
<Alias name="OMX.qcom.video.encoder.hevc.cq"/>
|
||||
<Limit name="size" min="128x128" max="512x512" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="64" max="786432" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Limit name="quality" range="0-100" default="80" />
|
||||
<Feature name="bitrate-modes" value="CQ" />
|
||||
<Limit name="performance-point-512x512" value="3825" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.heic.encoder" type="image/vnd.android.heic">
|
||||
<Alias name="OMX.qcom.video.encoder.heic"/>
|
||||
<Limit name="size" min="512x512" max="8192x8192" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="64" max="786432" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-20" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Limit name="quality" range="0-100" default="80" />
|
||||
<Feature name="bitrate-modes" value="CQ" />
|
||||
<Limit name="performance-point-8192x4320" value="3" />
|
||||
<Limit name="performance-point-1920x1080" value="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true" variant="slow-cpu">
|
||||
<!-- profiles and levels: ProfileMain : MainTierLevel51 -->
|
||||
<Limit name="size" min="2x2" max="512x512" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="8x8" />
|
||||
<Limit name="block-count" range="1-4096" /> <!-- max 512x512 -->
|
||||
<Limit name="blocks-per-second" range="1-122880" />
|
||||
<Limit name="frame-rate" range="1-120" />
|
||||
<Limit name="bitrate" range="1-10000000" />
|
||||
<Limit name="complexity" range="0-10" default="0" />
|
||||
<Limit name="quality" range="0-100" default="80" />
|
||||
<Feature name="bitrate-modes" value="VBR,CBR,CQ" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true" variant="slow-cpu">
|
||||
<!-- profiles and levels: ProfileMain : Level_Version0-3 -->
|
||||
<Limit name="size" min="2x2" max="2048x2048" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<!-- 2016 devices can encode at about 8fps at this block count -->
|
||||
<Limit name="block-count" range="1-3600" /> <!-- max 1280x720 -->
|
||||
<Limit name="bitrate" range="1-40000000" />
|
||||
<Feature name="bitrate-modes" value="VBR,CBR" />
|
||||
</MediaCodec>
|
||||
</Encoders>
|
||||
</MediaCodecs>
|
||||
139
configs/media/media_codecs_performance_blair.xml
Normal file
139
configs/media/media_codecs_performance_blair.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright (c) 2018-2021 Qualcomm Technologies, Inc.
|
||||
All Rights Reserved.
|
||||
Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
|
||||
Not a Contribution.
|
||||
|
||||
Copyright (C) 2012-2017 The Linux Foundation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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.
|
||||
-->
|
||||
|
||||
<MediaCodecs>
|
||||
<Encoders>
|
||||
<MediaCodec name="c2.qti.avc.encoder" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="238-238" />
|
||||
<Limit name="measured-frame-rate-720x480" range="123-123" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="50-50" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="13-50" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.encoder" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="226-226" />
|
||||
<Limit name="measured-frame-rate-720x480" range="121-121" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="49-49" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="12-45" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="400-420" />
|
||||
<Limit name="measured-frame-rate-720x480" range="126-178" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="35-50" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="19-28" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="90-100" />
|
||||
<Limit name="measured-frame-rate-720x480" range="7-10" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="3-6" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="2-3" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.av1-dav1d.decoder" type="video/av01" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="121-286" />
|
||||
<Limit name="measured-frame-rate-720x480" range="60-120" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="60-90" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="40-60" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="256-349" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="250-377" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
|
||||
<Limit name="measured-frame-rate-320x180" range="85-119" />
|
||||
<Limit name="measured-frame-rate-640x360" range="94-133" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="21-30" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="10-15" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.encoder.cq" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="190-300"/>
|
||||
</MediaCodec>
|
||||
</Encoders>
|
||||
<Decoders>
|
||||
<MediaCodec name="c2.qti.avc.decoder" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="480-510" />
|
||||
<Limit name="measured-frame-rate-720x480" range="460-490" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="350-400" />
|
||||
<Limit name="measured-frame-rate-1920x1088" range="180-190" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.avc.decoder.low_latency" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="320-517" />
|
||||
<Limit name="measured-frame-rate-720x480" range="101-221" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="200-420" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="76-167" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-352x288" range="510-530" />
|
||||
<Limit name="measured-frame-rate-720x480" range="465-620" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="200-390" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="210-230" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.hevc.decoder.low_latency" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-352x288" range="273-562" />
|
||||
<Limit name="measured-frame-rate-720x480" range="440-600" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="215-425" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="118-259" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="377-377" />
|
||||
<Limit name="measured-frame-rate-640x360" range="323-323" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="262-262" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="220-220" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="300-320" />
|
||||
<Limit name="measured-frame-rate-720x480" range="42-59" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="17-24" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="25-35" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-352x288" range="500-570" />
|
||||
<Limit name="measured-frame-rate-640x360" range="57-89" />
|
||||
<Limit name="measured-frame-rate-720x480" range="69-99" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="35-51" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="20-29" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="1220-1280" />
|
||||
<Limit name="measured-frame-rate-352x288" range="940-990" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="1230-1290" />
|
||||
<Limit name="measured-frame-rate-480x360" range="800-960" />
|
||||
<Limit name="measured-frame-rate-1080x720" range="420-490" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
|
||||
<Limit name="measured-frame-rate-320x180" range="570-665" />
|
||||
<Limit name="measured-frame-rate-640x360" range="267-378" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="75-107" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="30-43" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
|
||||
<Limit name="measured-frame-rate-320x180" range="850-890" />
|
||||
<Limit name="measured-frame-rate-640x360" range="85-200" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="35-49" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="23-33" />
|
||||
</MediaCodec>
|
||||
</Decoders>
|
||||
</MediaCodecs>
|
||||
1428
configs/media/media_profiles_blair.xml
Normal file
1428
configs/media/media_profiles_blair.xml
Normal file
File diff suppressed because it is too large
Load Diff
36
configs/msm_irqbalance.conf
Normal file
36
configs/msm_irqbalance.conf
Normal file
@@ -0,0 +1,36 @@
|
||||
###########################################################################
|
||||
# Copyright (c) 2020 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
# 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.
|
||||
###########################################################################
|
||||
|
||||
PRIO=1,1,0,0,0,0,0,0
|
||||
#arch_timer, arm-pmu, arch_mem_timer
|
||||
IGNORED_IRQ=19,21,38,209,218
|
||||
336
configs/powerhint.json
Normal file
336
configs/powerhint.json
Normal file
@@ -0,0 +1,336 @@
|
||||
{
|
||||
"Nodes": [
|
||||
{
|
||||
"Name": "CPULittleClusterMaxFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"1651200"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPULittleClusterMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"1651200",
|
||||
"576000"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBigClusterMaxFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"1401600"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBigClusterMinFreq",
|
||||
"Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq",
|
||||
"Values": [
|
||||
"9999999",
|
||||
"1228800",
|
||||
"691200"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUMaxFreq",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/max_pwrlevel",
|
||||
"Values": [
|
||||
"0",
|
||||
"1"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "GPUMinFreq",
|
||||
"Path": "/sys/class/kgsl/kgsl-3d0/min_pwrlevel",
|
||||
"Values": [
|
||||
"0",
|
||||
"1",
|
||||
"5"
|
||||
],
|
||||
"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",
|
||||
"80"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWHystTriggerCount",
|
||||
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-ddr-bw/bw_hwmon/hyst_trigger_count",
|
||||
"Values": [
|
||||
"0",
|
||||
"3"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWHistMemory",
|
||||
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-ddr-bw/bw_hwmon/hist_memory",
|
||||
"Values": [
|
||||
"0",
|
||||
"20"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWHystLength",
|
||||
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-ddr-bw/bw_hwmon/hyst_length",
|
||||
"Values": [
|
||||
"0",
|
||||
"10"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "CPUBWMinFreq",
|
||||
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-ddr-bw/min_freq",
|
||||
"Values": [
|
||||
"7980",
|
||||
"5161",
|
||||
"2929",
|
||||
"762"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "L3LittleClusterMinFreq",
|
||||
"Path": "/sys/class/devfreq/fd90100.qcom,cpu0-cpu-l3-lat/min_freq",
|
||||
"Values": [
|
||||
"1497600000",
|
||||
"300000000"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "L3BigClusterMinFreq",
|
||||
"Path": "/sys/class/devfreq/fd90100.qcom,cpu6-cpu-l3-lat/min_freq",
|
||||
"Values": [
|
||||
"1497600000",
|
||||
"300000000"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
{
|
||||
"Name": "PowerHALRenderingState",
|
||||
"Path": "vendor.powerhal.rendering",
|
||||
"Values": [
|
||||
"EXPENSIVE_RENDERING",
|
||||
""
|
||||
],
|
||||
"Type": "Property"
|
||||
},
|
||||
{
|
||||
"Name": "DoubleTapToWake",
|
||||
"Path": "/proc/tp_gesture",
|
||||
"Values": [
|
||||
"0",
|
||||
"1"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
}
|
||||
],
|
||||
"Actions": [
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPUBigClusterMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "1228800"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPULittleClusterMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "1651200"
|
||||
},
|
||||
{
|
||||
"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": "2929"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBigClusterMaxFreq",
|
||||
"Duration": 3000,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBigClusterMinFreq",
|
||||
"Duration": 3000,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPULittleClusterMinFreq",
|
||||
"Duration": 3000,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWHystTriggerCount",
|
||||
"Duration": 3000,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWHystLength",
|
||||
"Duration": 3000,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWHistMemory",
|
||||
"Duration": 3000,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "CPUBWMinFreq",
|
||||
"Duration": 3000,
|
||||
"Value": "7980"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "GPUForceClkOn",
|
||||
"Duration": 3000,
|
||||
"Value": "1"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "GPUForceRailOn",
|
||||
"Duration": 3000,
|
||||
"Value": "1"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "GPUIdleTimer",
|
||||
"Duration": 3000,
|
||||
"Value": "10000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "L3LittleClusterMinFreq",
|
||||
"Duration": 3000,
|
||||
"Value": "1497600000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "L3BigClusterMinFreq",
|
||||
"Duration": 3000,
|
||||
"Value": "1497600000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "PowerHALRenderingState",
|
||||
"Duration": 0,
|
||||
"Value": "EXPENSIVE_RENDERING"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "GPUMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "1"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "GPUMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "FIXED_PERFORMANCE",
|
||||
"Node": "CPUBigClusterMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "FIXED_PERFORMANCE",
|
||||
"Node": "CPUBigClusterMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "FIXED_PERFORMANCE",
|
||||
"Node": "CPULittleClusterMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "FIXED_PERFORMANCE",
|
||||
"Node": "CPULittleClusterMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "9999999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "FIXED_PERFORMANCE",
|
||||
"Node": "GPUMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "FIXED_PERFORMANCE",
|
||||
"Node": "GPUMinFreq",
|
||||
"Duration": 0,
|
||||
"Value": "0"
|
||||
},
|
||||
{
|
||||
"PowerHint": "DOUBLE_TAP_TO_WAKE",
|
||||
"Node": "DoubleTapToWake",
|
||||
"Duration": 0,
|
||||
"Value": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
21
configs/privapp-permissions-euicc.xml
Normal file
21
configs/privapp-permissions-euicc.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" ?>
|
||||
<permissions>
|
||||
<privapp-permissions package="com.google.android.euicc">
|
||||
<permission name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
|
||||
<permission name="android.permission.FOREGROUND_SERVICE"/>
|
||||
<permission name="android.permission.MODIFY_PHONE_STATE"/>
|
||||
<permission name="android.permission.INTERNET"/>
|
||||
<permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
|
||||
<permission name="android.permission.REBOOT"/>
|
||||
<permission name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<permission name="android.permission.VIBRATE"/>
|
||||
<permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"/>
|
||||
<permission name="android.permission.WRITE_SECURE_SETTINGS"/>
|
||||
<permission name="com.android.permission.INSTALL_EXISTING_PACKAGES" />
|
||||
<permission name="com.android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"/>
|
||||
<permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"/>
|
||||
<permission name="com.google.android.setupwizard.SETUP_COMPAT_SERVICE"/>
|
||||
<permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
|
||||
</privapp-permissions>
|
||||
</permissions>
|
||||
9
configs/properties/odm.prop
Normal file
9
configs/properties/odm.prop
Normal file
@@ -0,0 +1,9 @@
|
||||
# Fwk detect
|
||||
ro.vendor.qti.va_odm.support=1
|
||||
|
||||
# SKU properties
|
||||
ro.product.property_source_order=odm,product,vendor,system_ext,system
|
||||
import /odm/etc/build_${ro.boot.board_id}.prop
|
||||
|
||||
# Display
|
||||
vendor.display.vds_allow_hwc=false
|
||||
47
configs/properties/product.prop
Normal file
47
configs/properties/product.prop
Normal file
@@ -0,0 +1,47 @@
|
||||
# Audio
|
||||
af.fast_track_multiplier=1
|
||||
audio.deep_buffer.media=true
|
||||
audio.offload.min.duration.secs=30
|
||||
audio.offload.video=true
|
||||
ro.af.client_heap_size_kbyte=7168
|
||||
|
||||
# FUSE
|
||||
persist.sys.fuse.passthrough.enable=true
|
||||
|
||||
# Seamless transfer
|
||||
sys.fflag.override.settings_seamless_transfer=true
|
||||
|
||||
# Logs
|
||||
persist.log.tag.OpenGLRenderer=S
|
||||
|
||||
# Declare use of spatial audio
|
||||
ro.audio.spatializer_enabled=true
|
||||
|
||||
# LMKD
|
||||
ro.lmk.kill_heaviest_task=true
|
||||
ro.lmk.thrashing_limit=50
|
||||
ro.lmk.thrashing_limit_decay=25
|
||||
ro.lmk.psi_complete_stall_ms=80
|
||||
ro.lmk.psi_partial_stall_ms=50
|
||||
|
||||
# Disable RescueParty due to high risk of data loss
|
||||
persist.sys.disable_rescue=true
|
||||
|
||||
# Battery Saving
|
||||
persist.radio.add_power_save=1
|
||||
pm.sleep_mode=1
|
||||
ro.ril.disable.power.collapse=0
|
||||
ro.ril.fast.dormancy.rule=1
|
||||
ro.ril.fast.dormancy.timeout=3
|
||||
ro.mot.eri.losalert.delay=100
|
||||
ro.vold.umsdirtyratio=20
|
||||
power.saving.mode=1
|
||||
|
||||
# Skia tracing
|
||||
debug.hwui.skia_tracing_enabled=false
|
||||
debug.hwui.skia_use_perfetto_track_events=false
|
||||
|
||||
# Blur
|
||||
ro.surface_flinger.supports_background_blur=1
|
||||
ro.sf.blurs_are_expensive=1
|
||||
persist.sysui.disableBlur=false
|
||||
47
configs/properties/system.prop
Normal file
47
configs/properties/system.prop
Normal file
@@ -0,0 +1,47 @@
|
||||
# Brightness Curve
|
||||
persist.sys.brightness.low.gamma=true
|
||||
|
||||
# Disable vsync for cpu rendered apps
|
||||
debug.cpurend.vsync=false
|
||||
|
||||
# Logs
|
||||
persist.log.tag.ACDB-LOADER=S
|
||||
|
||||
# Radio VoNR Calling
|
||||
persist.radio.is_vonr_enabled_0=true
|
||||
persist.radio.is_vonr_enabled_1=true
|
||||
persist.vendor.vonr_setting_support=1
|
||||
|
||||
# Ram Management
|
||||
ro.config.fha_enable=true
|
||||
ro.sys.fw.bg_apps_limit=32
|
||||
ro.config.dha_cached_max=16
|
||||
ro.config.dha_empty_max=42
|
||||
ro.config.dha_empty_init=32
|
||||
ro.config.dha_lmk_scale=0.545
|
||||
ro.config.dha_th_rate=2.3
|
||||
ro.config.sdha_apps_bg_max=64
|
||||
ro.config.sdha_apps_bg_min=8
|
||||
|
||||
# RIL Powersaving
|
||||
persist.radio.add_power_save=1
|
||||
pm.sleep_mode=1
|
||||
ro.ril.disable.power.collapse=0
|
||||
ro.ril.fast.dormancy.rule=1
|
||||
ro.ril.fast.dormancy.timeout=3
|
||||
ro.mot.eri.losalert.delay=1000
|
||||
|
||||
# IMS Debugging
|
||||
persist.vendor.ims.disableADBLogs=1
|
||||
persist.vendor.ims.disableDebugLogs=1
|
||||
persist.vendor.ims.disableIMSLogs=1
|
||||
persist.vendor.ims.disableQXDMLogs=1
|
||||
|
||||
# Audio
|
||||
ro.audio.usb.period_us=20375
|
||||
af.resampler.quality=7
|
||||
ro.audio.resampler.psd.stopband=132
|
||||
ro.audio.resampler.psd.halflength=960
|
||||
ro.audio.resampler.psd.cutoff_percent=98
|
||||
ro.audio.resampler.psd.tbwcheat=0
|
||||
persist.bluetooth.sbc_hd_higher_bitrate=1
|
||||
40
configs/properties/system_ext.prop
Normal file
40
configs/properties/system_ext.prop
Normal file
@@ -0,0 +1,40 @@
|
||||
# Audio
|
||||
audio.offload.min.duration.secs=30
|
||||
|
||||
# CNE
|
||||
persist.vendor.cne.feature=1
|
||||
|
||||
# Display
|
||||
debug.sf.enable_hwc_vds=1
|
||||
|
||||
# DPM
|
||||
persist.vendor.dpm.feature=11
|
||||
persist.vendor.dpm.idletimer.mode=default
|
||||
|
||||
# Fwk detect
|
||||
ro.vendor.qti.va_aosp.support=1
|
||||
|
||||
# Media
|
||||
media.stagefright.thumbnail.prefer_hw_codecs=true
|
||||
ro.media.recorder-max-base-layer-fps=60
|
||||
vendor.mm.enable.qcom_parser=16777215
|
||||
|
||||
# Netmgr
|
||||
persist.vendor.data.mode=concurrent
|
||||
|
||||
# WFD
|
||||
persist.debug.wfd.enable=1
|
||||
|
||||
# Legit Touch Hax
|
||||
touch.size.scale=1
|
||||
touch.size.bias=0
|
||||
touch.size.isSummed=0
|
||||
touch.pressure.scale=0.001
|
||||
touch.distance.calibration=none
|
||||
touch.distance.scale=0
|
||||
touch.coverage.calibration=box
|
||||
touch.gestureMode=spots
|
||||
MultitouchSettleInterval=1ms
|
||||
MultitouchMinDistance=1px
|
||||
TapInterval=1ms
|
||||
TapSlop=1px
|
||||
285
configs/properties/vendor.prop
Normal file
285
configs/properties/vendor.prop
Normal file
@@ -0,0 +1,285 @@
|
||||
# Audio
|
||||
aaudio.hw_burst_min_usec=2000
|
||||
aaudio.mmap_exclusive_policy=2
|
||||
aaudio.mmap_policy=2
|
||||
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.delta.refresh=true
|
||||
persist.vendor.audio.fluence.speaker=true
|
||||
persist.vendor.audio.fluence.tmic.enabled=false
|
||||
persist.vendor.audio.fluence.voicecall=true
|
||||
persist.vendor.audio.fluence.voicerec=true
|
||||
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
|
||||
persist.vendor.audio.voicecall.speaker.stereo=true
|
||||
ro.audio.monitorRotation=true
|
||||
ro.config.vc_call_vol_steps=11
|
||||
ro.vendor.audio.sdk.fluencetype=fluence
|
||||
ro.vendor.audio.sdk.ssr=false
|
||||
vendor.audio.adm.buffering.ms=12
|
||||
vendor.audio.chk.cal.spk=2
|
||||
vendor.audio.chk.cal.us=2
|
||||
vendor.audio.dolby.ds2.enabled=false
|
||||
vendor.audio.dolby.ds2.hardbypass=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.compress_in.enable=true
|
||||
vendor.audio.feature.compress_meta_data.enable=true
|
||||
vendor.audio.feature.compr_voip.enable=false
|
||||
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.dsm_feedback.enable=false
|
||||
vendor.audio.feature.dynamic_ecns.enable=true
|
||||
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.ext_hw_plugin.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=false
|
||||
vendor.audio.feature.hfp.enable=true
|
||||
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=false
|
||||
vendor.audio.feature.usb_offload_burst_mode.enable=true
|
||||
vendor.audio.feature.usb_offload.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.hal.boot.timeout.ms=20000
|
||||
vendor.audio_hal.in_period_size=144
|
||||
vendor.audio.hal.output.suspend.supported=true
|
||||
vendor.audio_hal.period_multiplier=3
|
||||
vendor.audio_hal.period_size=192
|
||||
vendor.audio.hw.aac.encoder=true
|
||||
vendor.audio.offload.buffer.size.kb=256
|
||||
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.safx.pbe.enabled=false
|
||||
vendor.audio.use.sw.alac.decoder=true
|
||||
vendor.audio.use.sw.ape.decoder=true
|
||||
vendor.audio.use.sw.mpegh.decoder=true
|
||||
vendor.audio.volume.headset.gain.depcal=true
|
||||
vendor.voice.path.for.pcm.voip=true
|
||||
|
||||
# Bluetooth
|
||||
bluetooth.profile.a2dp.source.enabled=true
|
||||
bluetooth.profile.asha.central.enabled=false
|
||||
bluetooth.profile.avrcp.target.enabled=true
|
||||
bluetooth.profile.avrcp.controller.enabled=false
|
||||
bluetooth.profile.hfp.ag.enabled=true
|
||||
bluetooth.profile.gatt.enabled=true
|
||||
bluetooth.profile.hid.device.enabled=true
|
||||
bluetooth.profile.hid.host.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.bluetooth.a2dp_offload.disabled=false
|
||||
persist.vendor.bluetooth.modem_nv_support=true
|
||||
persist.vendor.bt.aac_frm_ctl.enabled=true
|
||||
persist.vendor.bt.aac_vbr_frm_ctl.enabled=true
|
||||
persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aac-aptx-aptxhd-ldac
|
||||
persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=false
|
||||
persist.vendor.qcom.bluetooth.enable.splita2dp=true
|
||||
persist.vendor.qcom.bluetooth.scram.enabled=false
|
||||
persist.vendor.qcom.bluetooth.twsp_state.enabled=false
|
||||
ro.bluetooth.a2dp_offload.supported=true
|
||||
ro.vendor.bluetooth.wipower=false
|
||||
vendor.qcom.bluetooth.soc=cherokee
|
||||
persist.vendor.btstack.enable.twsplus=true
|
||||
persist.vendor.btstack.enable.twsplussho=true
|
||||
|
||||
# Camera
|
||||
camera.disable_zsl_mode=true
|
||||
vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.android.camera
|
||||
persist.vendor.camera.logInfoMask=false
|
||||
persist.vendor.camera.perflock.enable=0
|
||||
|
||||
# Dalvik
|
||||
dalvik.vm.dex2oat64.enabled=true
|
||||
dalvik.vm.dex2oat-cpu-set=4,5,6,7
|
||||
dalvik.vm.dex2oat-threads=4
|
||||
dalvik.vm.image-dex2oat-cpu-set=4,5,6,7
|
||||
dalvik.vm.image-dex2oat-threads=4
|
||||
|
||||
# Display
|
||||
debug.sf.frame_rate_multiple_threshold=120
|
||||
ro.surface_flinger.enable_frame_rate_override=false
|
||||
ro.surface_flinger.force_hwc_copy_for_virtual_displays=true
|
||||
ro.surface_flinger.game_default_frame_rate_override=120
|
||||
ro.surface_flinger.has_wide_color_display=false
|
||||
ro.surface_flinger.max_virtual_display_dimension=4096
|
||||
ro.surface_flinger.protected_contents=true
|
||||
ro.surface_flinger.use_color_management=true
|
||||
ro.surface_flinger.set_display_power_timer_ms=800
|
||||
ro.surface_flinger.set_idle_timer_ms=3500
|
||||
ro.surface_flinger.set_touch_timer_ms=4000
|
||||
ro.surface_flinger.wcg_composition_dataspace=143261696
|
||||
ro.vendor.display.sensortype=2
|
||||
ro.vendor.display.svi=1
|
||||
vendor.display.comp_mask=0
|
||||
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=0
|
||||
vendor.display.disable_rotator_ubwc=1
|
||||
vendor.display.disable_rounded_corner_thread=0
|
||||
vendor.display.disable_scaler=0
|
||||
vendor.display.enable_allow_idle_fallback=1
|
||||
vendor.display.enable_async_powermode=1
|
||||
vendor.display.enable_camera_smooth=1
|
||||
vendor.display.enable_early_wakeup=1
|
||||
vendor.display.enable_optimize_refresh=1
|
||||
vendor.display.enable_perf_hint_large_comp_cycle=1
|
||||
vendor.display.enable_posted_start_dyn=1
|
||||
vendor.display.enable_rc_support=1
|
||||
vendor.display.enable_rounded_corner=0
|
||||
vendor.display.idle_time=0
|
||||
vendor.display.override_doze_mode=1
|
||||
vendor.display.svi.config=1
|
||||
vendor.display.svi.config_path=/vendor/etc/SVIConfig.xml
|
||||
vendor.display.target.version=3
|
||||
vendor.display.use_smooth_motion=1
|
||||
vendor.display.disable_partial_split=1
|
||||
|
||||
# DPM
|
||||
persist.vendor.dpmhalservice.enable=1
|
||||
|
||||
# DRM
|
||||
drm.service.enabled=true
|
||||
|
||||
# FRP
|
||||
ro.frp.pst=/dev/block/bootdevice/by-name/frp
|
||||
|
||||
# Graphics
|
||||
debug.sf.auto_latch_unsignaled=0
|
||||
debug.sf.disable_backpressure=1
|
||||
debug.sf.disable_client_composition_cache=0
|
||||
debug.sf.enable_adpf_cpu_hint=true
|
||||
debug.sf.enable_advanced_sf_phase_offset=1
|
||||
debug.sf.enable_gl_backpressure=0
|
||||
debug.sf.enable_transaction_tracing=false
|
||||
debug.sf.high_fps_early_gl_phase_offset_ns=-4000000
|
||||
debug.sf.high_fps_early_phase_offset_ns=-4000000
|
||||
debug.sf.high_fps_late_app_phase_offset_ns=1000000
|
||||
debug.sf.high_fps_late_sf_phase_offset_ns=-4000000
|
||||
debug.sf.predict_hwc_composition_strategy=0
|
||||
debug.sf.treat_170m_as_sRGB=1
|
||||
persist.sys.sf.color_mode=7
|
||||
persist.sys.sf.color_saturation=1.0
|
||||
persist.sys.sf.native_mode=258
|
||||
ro.hardware.egl=adreno
|
||||
ro.hardware.vulkan=adreno
|
||||
ro.opengles.version=196610
|
||||
vendor.gralloc.disable_ubwc=0
|
||||
vendor.gralloc.secure_preview_buffer_format=420_sp
|
||||
vendor.gralloc.secure_preview_only=1
|
||||
|
||||
# HWUI
|
||||
ro.hwui.render_ahead=5
|
||||
debug.hwui.use_hint_manager=true
|
||||
debug.hwui.target_cpu_time_percent=30
|
||||
|
||||
# Incremental FS
|
||||
ro.incremental.enable=true
|
||||
|
||||
# Logcat spam
|
||||
persist.log.tag.BackgroundInstallControlService=S
|
||||
persist.log.tag.HWUI=S
|
||||
persist.log.tag.ConnectivityService=S
|
||||
persist.log.tag.vendor.qti.bluetooth@1.0-ibs_handler=S
|
||||
persist.log.tag.vendor.qti.bluetooth@1.0-wake_lock=S
|
||||
persist.log.tag.AppOps=S
|
||||
persist.log.tag.FrameTracker=S
|
||||
|
||||
# Media
|
||||
debug.stagefright.c2inputsurface=-1
|
||||
vendor.media.target_variant=_blair
|
||||
vendor.netflix.bsp_rev=Q4350-32962-1
|
||||
|
||||
# Perf
|
||||
ro.vendor.extension_library=libqti-perfd-client.so
|
||||
vendor.perf.framepacing.enable=1
|
||||
|
||||
# Radio
|
||||
persist.dbg.ims_volte_enable=1
|
||||
persist.dbg.volte_avail_ovr=1
|
||||
persist.dbg.vt_avail_ovr=1
|
||||
persist.dbg.wfc_avail_ovr=1
|
||||
persist.vendor.data.iwlan.enable=true
|
||||
|
||||
# RIL
|
||||
persist.radio.multisim.config=dsds
|
||||
persist.vendor.radio.add_power_save=1
|
||||
persist.vendor.radio.apm_sim_not_pwdn=1
|
||||
persist.vendor.radio.custom_ecc=1
|
||||
persist.vendor.radio.enableadvancedscan=true
|
||||
persist.vendor.radio.enable_temp_dds=true
|
||||
persist.vendor.radio.procedure_bytes=SKIP
|
||||
persist.vendor.radio.rat_on=combine
|
||||
persist.vendor.radio.sib16_support=1
|
||||
ro.telephony.default_network=33,33
|
||||
persist.cust.tel.eons=1
|
||||
ro.telephony.block_binder_thread_on_incoming_calls=false
|
||||
|
||||
# ScrollOptimizer
|
||||
persist.sys.perf.scroll_opt=true
|
||||
persist.sys.perf.scroll_opt.heavy_app=1
|
||||
|
||||
# Sensors
|
||||
persist.vendor.sensors.enable.bypass_worker=true
|
||||
persist.vendor.sensors.enable.mag_filter=true
|
||||
persist.vendor.sensors.enable.rt_task=false
|
||||
persist.vendor.sensors.hal_trigger_ssr=false
|
||||
persist.vendor.sensors.support_direct_channel=false
|
||||
persist.vendor.sensors.sync_request=true
|
||||
|
||||
# SoC
|
||||
ro.boot.product.vendor.sku=holi
|
||||
ro.soc.manufacturer=QTI
|
||||
ro.soc.model=SM6375
|
||||
|
||||
# USB
|
||||
ro.usb.uvc.disable_video_encode_flag=true
|
||||
ro.usb.uvc.enabled=true
|
||||
sys.usb.mtp.batchcancel=1
|
||||
vendor.usb.controller=4e00000.dwc3
|
||||
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
|
||||
vendor.usb.uvc.payload_transfer_size=1024
|
||||
|
||||
# WiFi
|
||||
wifi.aware.interface=wifi-aware0
|
||||
8
configs/public.libraries.txt
Normal file
8
configs/public.libraries.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
libadsprpc.so
|
||||
libcdsprpc.so
|
||||
libsdsprpc.so
|
||||
libfastcvopt.so
|
||||
liblistensoundmodel2.so
|
||||
libOpenCL.so
|
||||
|
||||
libmialgoengine.so 64
|
||||
33
configs/snapdragon_color_libs_config.xml
Normal file
33
configs/snapdragon_color_libs_config.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!--
|
||||
Copyright (c) 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.
|
||||
-->
|
||||
<StcLibraries>
|
||||
<Library>
|
||||
<Name>libsnapdragoncolor-qdcm.so</Name>
|
||||
<ProcessingOrder>1</ProcessingOrder>
|
||||
</Library>
|
||||
</StcLibraries>
|
||||
578
configs/task_profiles.json
Normal file
578
configs/task_profiles.json
Normal file
@@ -0,0 +1,578 @@
|
||||
{
|
||||
"Attributes": [
|
||||
{
|
||||
"Name": "LowCapacityCPUs",
|
||||
"Controller": "cpuset",
|
||||
"File": "background/cpus"
|
||||
},
|
||||
{
|
||||
"Name": "HighCapacityCPUs",
|
||||
"Controller": "cpuset",
|
||||
"File": "foreground/cpus"
|
||||
},
|
||||
{
|
||||
"Name": "MaxCapacityCPUs",
|
||||
"Controller": "cpuset",
|
||||
"File": "top-app/cpus"
|
||||
},
|
||||
{
|
||||
"Name": "AudioAppCapacityCPUs",
|
||||
"Controller": "cpuset",
|
||||
"File": "audio-app/cpus"
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "MemLimit",
|
||||
"Controller": "memory",
|
||||
"File": "memory.limit_in_bytes"
|
||||
},
|
||||
{
|
||||
"Name": "MemSoftLimit",
|
||||
"Controller": "memory",
|
||||
"File": "memory.soft_limit_in_bytes"
|
||||
},
|
||||
{
|
||||
"Name": "MemSwappiness",
|
||||
"Controller": "memory",
|
||||
"File": "memory.swappiness"
|
||||
},
|
||||
{
|
||||
"Name": "UClampMin",
|
||||
"Controller": "cpu",
|
||||
"File": "cpu.uclamp.min"
|
||||
},
|
||||
{
|
||||
"Name": "UClampMax",
|
||||
"Controller": "cpu",
|
||||
"File": "cpu.uclamp.max"
|
||||
}
|
||||
],
|
||||
|
||||
"Profiles": [
|
||||
{
|
||||
"Name": "HighEnergySaving",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": "background"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "NormalPerformance",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "HighPerformance",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": "foreground"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "MaxPerformance",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": "top-app"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "RealtimePerformance",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": "rt"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "AudioAppPerformance",
|
||||
"Actions" : [
|
||||
{
|
||||
"Name" : "JoinCgroup",
|
||||
"Params" :
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": "audio-app"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "CameraServicePerformance",
|
||||
"Actions" : [
|
||||
{
|
||||
"Name" : "JoinCgroup",
|
||||
"Params" :
|
||||
{
|
||||
"Controller": "cpu",
|
||||
"Path": "camera-daemon"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrKernelCapacity",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrServiceCapacityLow",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "system/background"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrServiceCapacityNormal",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "system"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrServiceCapacityHigh",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "system/performance"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrProcessCapacityLow",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "application/background"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrProcessCapacityNormal",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "application"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "VrProcessCapacityHigh",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "application/performance"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "ProcessCapacityLow",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "background"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "ProcessCapacityNormal",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "ProcessCapacityHigh",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "foreground"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "ProcessCapacityMax",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "top-app"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "ServiceCapacityLow",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "system-background"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "ServiceCapacityRestricted",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "restricted"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "CameraServiceCapacity",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "camera-daemon"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "AudioAppCapacity",
|
||||
"Actions" : [
|
||||
{
|
||||
"Name" : "JoinCgroup",
|
||||
"Params" :
|
||||
{
|
||||
"Controller": "cpuset",
|
||||
"Path": "audio-app"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "BlkIOForeground",
|
||||
"Actions" : [
|
||||
{
|
||||
"Name" : "JoinCgroup",
|
||||
"Params" :
|
||||
{
|
||||
"Controller": "blkio",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "BlkIOBackground",
|
||||
"Actions" : [
|
||||
{
|
||||
"Name" : "JoinCgroup",
|
||||
"Params" :
|
||||
{
|
||||
"Controller": "blkio",
|
||||
"Path": "bg"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "LowIoPriority",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "blkio",
|
||||
"Path": "background"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "NormalIoPriority",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "blkio",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "HighIoPriority",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "blkio",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "MaxIoPriority",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "blkio",
|
||||
"Path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "TimerSlackHigh",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "SetTimerSlack",
|
||||
"Params":
|
||||
{
|
||||
"Slack": "40000000"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "TimerSlackNormal",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "SetTimerSlack",
|
||||
"Params":
|
||||
{
|
||||
"Slack": "50000"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "PerfBoost",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "SetClamps",
|
||||
"Params":
|
||||
{
|
||||
"Boost": "50%",
|
||||
"Clamp": "0"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "PerfClamp",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "SetClamps",
|
||||
"Params":
|
||||
{
|
||||
"Boost": "0",
|
||||
"Clamp": "30%"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"Name": "LowMemoryUsage",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "SetAttribute",
|
||||
"Params":
|
||||
{
|
||||
"Name": "MemSoftLimit",
|
||||
"Value": "16MB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "SetAttribute",
|
||||
"Params":
|
||||
{
|
||||
"Name": "MemSwappiness",
|
||||
"Value": "150"
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "HighMemoryUsage",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "SetAttribute",
|
||||
"Params":
|
||||
{
|
||||
"Name": "MemSoftLimit",
|
||||
"Value": "512MB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "SetAttribute",
|
||||
"Params":
|
||||
{
|
||||
"Name": "MemSwappiness",
|
||||
"Value": "100"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "SystemMemoryProcess",
|
||||
"Actions": [
|
||||
{
|
||||
"Name": "JoinCgroup",
|
||||
"Params":
|
||||
{
|
||||
"Controller": "memory",
|
||||
"Path": "system"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
"AggregateProfiles": [
|
||||
{
|
||||
"Name": "SCHED_SP_DEFAULT",
|
||||
"Profiles": [ "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "SCHED_SP_BACKGROUND",
|
||||
"Profiles": [ "HighEnergySaving", "LowIoPriority", "TimerSlackHigh" ]
|
||||
},
|
||||
{
|
||||
"Name": "SCHED_SP_FOREGROUND",
|
||||
"Profiles": [ "HighPerformance", "HighIoPriority", "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "SCHED_SP_TOP_APP",
|
||||
"Profiles": [ "MaxPerformance", "MaxIoPriority", "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "SCHED_SP_RT_APP",
|
||||
"Profiles": [ "RealtimePerformance", "MaxIoPriority", "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "CPUSET_SP_DEFAULT",
|
||||
"Profiles": [ "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "CPUSET_SP_BACKGROUND",
|
||||
"Profiles": [ "HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", "TimerSlackHigh" ]
|
||||
},
|
||||
{
|
||||
"Name": "CPUSET_SP_FOREGROUND",
|
||||
"Profiles": [ "HighPerformance", "ProcessCapacityHigh", "HighIoPriority", "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "CPUSET_SP_TOP_APP",
|
||||
"Profiles": [ "MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "CPUSET_SP_SYSTEM",
|
||||
"Profiles": [ "ServiceCapacityLow", "TimerSlackNormal" ]
|
||||
},
|
||||
{
|
||||
"Name": "CPUSET_SP_RESTRICTED",
|
||||
"Profiles": [ "ServiceCapacityRestricted", "TimerSlackNormal" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,14 +3,6 @@
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
-->
|
||||
<compatibility-matrix version="1.0" type="device">
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.schedulerservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISchedulingPolicyService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.sensorservice</name>
|
||||
<version>1.0</version>
|
||||
219
configs/vintf/device_framework_matrix.xml
Normal file
219
configs/vintf/device_framework_matrix.xml
Normal file
@@ -0,0 +1,219 @@
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<compatibility-matrix version="2.0" type="framework">
|
||||
<hal format="aidl" optional="true">
|
||||
<name>vendor.lineage.health</name>
|
||||
<version>2</version>
|
||||
<interface>
|
||||
<name>IChargingControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>vendor.lineage.health</name>
|
||||
<version>2</version>
|
||||
<interface>
|
||||
<name>IFastCharge</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.goodix.hardware.biometrics.fingerprint</name>
|
||||
<version>2.0-1</version>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemon</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemonExt</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.qti.hardware.radio.qcriNvOpt</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IqcriNvOpt</name>
|
||||
<instance>qcrinvopt0</instance>
|
||||
<instance>qcrinvopt1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.silead.hardware.fingerprintext</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISileadFingerprint</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>android.hardware.graphics.allocator</name>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.boot</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IBootControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.drm</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IDrmFactory</name>
|
||||
<instance>clearkey</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.ir</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IConsumerIr</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>android.hardware.biometrics.fingerprint</name>
|
||||
<version>2.3</version>
|
||||
<interface>
|
||||
<name>IBiometricsFingerprint</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.bluetooth.audio</name>
|
||||
<version>4</version>
|
||||
<interface>
|
||||
<name>IBluetoothAudioProviderFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>android.hardware.boot</name>
|
||||
<version>1.2</version>
|
||||
<interface>
|
||||
<name>IBootControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.health</name>
|
||||
<version>3</version>
|
||||
<interface>
|
||||
<name>IHealth</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.light</name>
|
||||
<version>2</version>
|
||||
<interface>
|
||||
<name>ILights</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.sensors</name>
|
||||
<version>2</version>
|
||||
<interface>
|
||||
<name>ISensors</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.power</name>
|
||||
<version>5</version>
|
||||
<interface>
|
||||
<name>IPower</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.memtrack</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IMemtrack</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.usb</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IUsb</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.thermal</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IThermal</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.vibrator</name>
|
||||
<version>2</version>
|
||||
<interface>
|
||||
<name>IVibrator</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.wifi.hostapd</name>
|
||||
<version>2</version>
|
||||
<interface>
|
||||
<name>IHostapd</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.wifi.supplicant</name>
|
||||
<version>3</version>
|
||||
<interface>
|
||||
<name>ISupplicant</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby.hardware.dms</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.wifi</name>
|
||||
<version>1-2</version>
|
||||
<interface>
|
||||
<name>IWifi</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>vendor.google.google_battery</name>
|
||||
<version>1</version>
|
||||
<interface>
|
||||
<name>IGoogleBattery</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
||||
@@ -2,7 +2,7 @@
|
||||
Copyright (C) 2019-2020 The Linux Foundation
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
-->
|
||||
<manifest version="1.0" type="device" target-level="5">
|
||||
<manifest version="1.0" type="device" target-level="6">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -28,32 +28,11 @@
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::IGatekeeper/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.ir</name>
|
||||
<transport>hwbinder</transport>
|
||||
<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.media.omx</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::IOmx/default</fqname>
|
||||
<fqname>@1.0::IOmxStore/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.memtrack</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::IMemtrack/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.2::INfc/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -67,6 +46,36 @@
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.1::IRadioConfig/default</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.data</name>
|
||||
<fqname>IRadioData/slot1</fqname>
|
||||
<fqname>IRadioData/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.messaging</name>
|
||||
<fqname>IRadioMessaging/slot1</fqname>
|
||||
<fqname>IRadioMessaging/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.modem</name>
|
||||
<fqname>IRadioModem/slot1</fqname>
|
||||
<fqname>IRadioModem/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.network</name>
|
||||
<fqname>IRadioNetwork/slot1</fqname>
|
||||
<fqname>IRadioNetwork/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.sim</name>
|
||||
<fqname>IRadioSim/slot1</fqname>
|
||||
<fqname>IRadioSim/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.voice</name>
|
||||
<fqname>IRadioVoice/slot1</fqname>
|
||||
<fqname>IRadioVoice/slot2</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.soundtrigger</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -80,7 +89,7 @@
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.control</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::IOffloadControl/default</fqname>
|
||||
<fqname>@1.1::IOffloadControl/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.dpm.api</name>
|
||||
@@ -103,11 +112,6 @@
|
||||
<fqname>@2.1::IGoodixFingerprintDaemon/default</fqname>
|
||||
<fqname>@2.1::IGoodixFingerprintDaemonExt/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.nxp.nxpnfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@2.0::INxpNfc/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.data.factory</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -261,14 +265,6 @@
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::ISoter/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.wifidisplaysession</name>
|
||||
<transport>hwbinder</transport>
|
||||
<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>
|
||||
@@ -294,5 +290,12 @@
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.0::ISileadFingerprint/default</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>vendor.google.google_battery</name>
|
||||
<interface>
|
||||
<name>IGoogleBattery</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<kernel target-level="5"/>
|
||||
</manifest>
|
||||
18
configs/vintf/manifest_ese.xml
Normal file
18
configs/vintf/manifest_ese.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest version="2.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.secure_element</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.2::ISecureElement/SIM1</fqname>
|
||||
<fqname>@1.2::ISecureElement/SIM2</fqname>
|
||||
<fqname>@1.2::ISecureElement/eSE1</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.esepowermanager</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.1::IEsePowerManager/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
571
device.mk
571
device.mk
@@ -4,18 +4,581 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# Add common definitions for Qualcomm
|
||||
$(call inherit-product, hardware/qcom-caf/common/common.mk)
|
||||
|
||||
# Enable project quotas and casefolding for emulated storage without sdcardfs
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
|
||||
|
||||
# Enable updating of APEXes
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
|
||||
|
||||
# Setup dalvik vm configs
|
||||
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
|
||||
|
||||
# A/B
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
|
||||
|
||||
AB_OTA_POSTINSTALL_CONFIG += \
|
||||
RUN_POSTINSTALL_system=true \
|
||||
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
|
||||
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=ext4 \
|
||||
POSTINSTALL_OPTIONAL_vendor=true
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
checkpoint_gc \
|
||||
otapreopt_script
|
||||
|
||||
# AAPT
|
||||
PRODUCT_AAPT_CONFIG := normal
|
||||
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
|
||||
|
||||
# ART
|
||||
ART_BUILD_TARGET_NDEBUG := true
|
||||
ART_BUILD_TARGET_DEBUG := false
|
||||
ART_BUILD_HOST_NDEBUG := true
|
||||
ART_BUILD_HOST_DEBUG := false
|
||||
PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile
|
||||
|
||||
# Audio
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.audio@6.0-impl \
|
||||
android.hardware.audio.effect@6.0-impl \
|
||||
android.hardware.audio.service \
|
||||
android.hardware.bluetooth.audio-impl \
|
||||
android.hardware.soundtrigger@2.3-impl
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
audio.bluetooth.default \
|
||||
audio.primary.default \
|
||||
audio.primary.holi \
|
||||
audio.r_submix.default \
|
||||
audio.usb.default \
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
audioadsprpcd \
|
||||
liba2dpoffload \
|
||||
libbatterylistener \
|
||||
libcomprcapture \
|
||||
libexthwplugin \
|
||||
libhdmiedid \
|
||||
libhfp \
|
||||
libqcompostprocbundle \
|
||||
libqcomvisualizer \
|
||||
libqcomvoiceprocessing \
|
||||
libsndmonitor \
|
||||
libspkrprot \
|
||||
libvolumelistener \
|
||||
sound_trigger.primary.holi:32
|
||||
|
||||
AUDIO_HAL_DIR := hardware/qcom-caf/sm8350/audio
|
||||
AUDIO_SKU_DIR := sku_holi
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/audio,$(TARGET_COPY_OUT_VENDOR)/etc/audio/$(AUDIO_SKU_DIR))
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/audio/dax-default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dolby/dax-default.xml \
|
||||
$(AUDIO_HAL_DIR)/configs/holi/audio_tuning_mixer.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer.txt
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/$(AUDIO_SKU_DIR)/bluetooth_audio_policy_configuration.xml \
|
||||
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/$(AUDIO_SKU_DIR)/r_submix_audio_policy_configuration.xml
|
||||
|
||||
$(call soong_config_set,android_hardware_audio,skip_speaker_layout_channel_mask_field,true)
|
||||
|
||||
# Audio service timeout
|
||||
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
||||
audio.service.client_wait_ms=10000
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.bluetooth@1.1.vendor \
|
||||
com.dsi.ant@1.0.vendor \
|
||||
vendor.qti.hardware.bluetooth_audio@2.1.vendor \
|
||||
vendor.qti.hardware.btconfigstore@1.0.vendor \
|
||||
vendor.qti.hardware.btconfigstore@2.0.vendor
|
||||
|
||||
# Boot control
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.boot-service.qti \
|
||||
android.hardware.boot-service.qti.recovery
|
||||
|
||||
# Camera
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.camera.provider@2.4-impl \
|
||||
android.hardware.camera.provider@2.4-service_64
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.camera.postproc@1.0.vendor
|
||||
|
||||
# Camera Health
|
||||
$(call soong_config_set,camera,override_format_from_reserved,true)
|
||||
|
||||
# Camx overrides
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/camxoverridesettings.txt:$(TARGET_COPY_OUT_VENDOR)/etc/camera/camxoverridesettings.txt
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libpiex_shim
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
liblz4.vendor \
|
||||
libpng.vendor
|
||||
|
||||
# Configstore
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.capabilityconfigstore@1.0 \
|
||||
vendor.qti.hardware.capabilityconfigstore@1.0.vendor
|
||||
|
||||
# DebugFS
|
||||
PRODUCT_SET_DEBUGFS_RESTRICTIONS := true
|
||||
|
||||
# Device-specific settings
|
||||
PRODUCT_PACKAGES += \
|
||||
XiaomiDolby \
|
||||
XiaomiParts
|
||||
|
||||
# Device as Webcam
|
||||
PRODUCT_PACKAGES += \
|
||||
DeviceAsWebcam
|
||||
|
||||
# Display
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.display.composer-service
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.graphics.mapper@3.0-impl-qti-display \
|
||||
android.hardware.graphics.mapper@4.0-impl-qti-display \
|
||||
vendor.qti.hardware.display.allocator-service
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.memtrack-service
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libdisplayconfig.qti \
|
||||
libdisplayconfig.system.qti \
|
||||
libqdMetaData.system \
|
||||
vendor.display.config@1.15.vendor \
|
||||
vendor.display.config@2.0.vendor \
|
||||
vendor.qti.hardware.display.mapper@1.1.vendor \
|
||||
vendor.qti.hardware.display.mapper@2.0.vendor
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/display_id_4630947081618265473.xml:$(TARGET_COPY_OUT_VENDOR)/etc/displayconfig/display_id_4630947081618265473.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/snapdragon_color_libs_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/snapdragon_color_libs_config.xml
|
||||
|
||||
# DRM
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm-service.clearkey
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm@1.3.vendor \
|
||||
libcrypto_shim \
|
||||
libcrypto_shim.vendor
|
||||
|
||||
# Fastbootd
|
||||
PRODUCT_PACKAGES += \
|
||||
fastbootd
|
||||
|
||||
# Fingerprint
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.biometrics.fingerprint@2.3-service.xiaomi
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
com.fingerprints.extension@1.0.vendor \
|
||||
libvendor.goodix.hardware.biometrics.fingerprint@2.1.vendor
|
||||
|
||||
# FM
|
||||
PRODUCT_PACKAGES += \
|
||||
FM2 \
|
||||
qcom.fmradio
|
||||
|
||||
# Gatekeeper
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gatekeeper@1.0.vendor
|
||||
|
||||
# GPS
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gnss@2.1-impl-qti \
|
||||
android.hardware.gnss@2.1-service-qti
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libbatching \
|
||||
libgeofencing \
|
||||
libgnss
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
flp.conf \
|
||||
gnss_antenna_info.conf \
|
||||
gps.conf \
|
||||
izat.conf
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libcurl.vendor
|
||||
|
||||
# Health
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.health-service.qti \
|
||||
android.hardware.health-service.qti_recovery
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.health-service.default
|
||||
|
||||
# HIDL
|
||||
PRODUCT_PACKAGES += \
|
||||
libhidltransport.vendor \
|
||||
libhwbinder.vendor
|
||||
|
||||
# Hotword enrollment
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/permissions/privapp-permissions-hotword.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-hotword.xml
|
||||
|
||||
# IFAA manager
|
||||
PRODUCT_PACKAGES += \
|
||||
IFAAService
|
||||
|
||||
# IPACM
|
||||
PRODUCT_PACKAGES += \
|
||||
ipacm \
|
||||
IPACM_cfg.xml
|
||||
|
||||
# IR
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.ir-service.lineage
|
||||
|
||||
# IRQ
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/msm_irqbalance.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance.conf
|
||||
|
||||
# Kernel
|
||||
PRODUCT_ENABLE_UFFD_GC := true
|
||||
|
||||
# Keymaster
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.keymaster@4.1.vendor
|
||||
|
||||
# Light
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.light-service.lineage
|
||||
|
||||
# Lineage health
|
||||
$(call soong_config_set,lineage_health,charging_control_supports_bypass,false)
|
||||
|
||||
# Media
|
||||
PRODUCT_PACKAGES += \
|
||||
libavservices_minijail \
|
||||
libavservices_minijail.vendor \
|
||||
libcodec2_hidl@1.0.vendor \
|
||||
libcodec2_vndk.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libstagefright_softomx_plugin.vendor \
|
||||
libstagefright_foundation-v33
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/media/media_codecs_blair.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_blair.xml \
|
||||
$(LOCAL_PATH)/configs/media/media_codecs_performance_blair.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_blair.xml \
|
||||
$(LOCAL_PATH)/configs/media/media_profiles_blair.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_blair.xml
|
||||
|
||||
# Net
|
||||
PRODUCT_PACKAGES += \
|
||||
android.system.net.netd@1.1.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libnetutils.vendor
|
||||
|
||||
# Neural networks
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.neuralnetworks@1.3.vendor
|
||||
|
||||
# Mlipay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.xiaomi.hardware.mlipay@1.1.vendor \
|
||||
vendor.xiaomi.hardware.mtdservice@1.0.vendor
|
||||
|
||||
# NFC
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.nfc-service.nxp
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libchrome.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
com.android.nfc_extras \
|
||||
Tag
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_pn557/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_pn557/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_pn557/android.hardware.nfc.uicc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_pn557/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_pn557/android.hardware.se.omapi.uicc.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_pn557/com.nxp.mifare.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.nfc.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.nfc.uicc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.se.omapi.ese.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/android.hardware.se.omapi.uicc.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_sn100/com.nxp.mifare.xml
|
||||
|
||||
# Overlays
|
||||
PRODUCT_ENFORCE_RRO_TARGETS := *
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
CarrierConfigOverlayCOMMON \
|
||||
DialerOverlayCOMMON \
|
||||
TelephonyOverlayCOMMON \
|
||||
ApertureOverlay \
|
||||
ApertureQRScannerOverlay \
|
||||
ApertureIconOverlay
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
FrameworkOverlayVEUX \
|
||||
LineageSDKOverlayVEUX \
|
||||
SettingsOverlayVEUX \
|
||||
SystemUIOverlayVEUX \
|
||||
WifiOverlayVEUX
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
SettingsProviderOverlay2201116SG \
|
||||
SettingsProviderOverlay2201116SC \
|
||||
SettingsProviderOverlay2201116SI \
|
||||
SettingsProviderOverlay2201116SR \
|
||||
SettingsProviderOverlay2201116PG \
|
||||
SettingsProviderOverlay2201116PI
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
EuiccOverlay2201116SR \
|
||||
SettingsOverlay2201116SR
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/overlay/config-odm.xml:$(TARGET_COPY_OUT_ODM)/overlay/config/config.xml \
|
||||
$(LOCAL_PATH)/overlay/config-vendor.xml:$(TARGET_COPY_OUT_VENDOR)/overlay/config/config.xml
|
||||
|
||||
# Component overrides
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml
|
||||
|
||||
# Partitions
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor_bt_firmware_mountpoint \
|
||||
vendor_dsp_mountpoint \
|
||||
vendor_firmware_mnt_mountpoint
|
||||
|
||||
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||
|
||||
# Perf
|
||||
PRODUCT_PACKAGES += \
|
||||
libqti-perfd-client
|
||||
|
||||
# Permissions
|
||||
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 \
|
||||
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 \
|
||||
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml \
|
||||
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \
|
||||
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
|
||||
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.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
|
||||
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml \
|
||||
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.euicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.euicc.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.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
|
||||
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 \
|
||||
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.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 \
|
||||
frameworks/native/data/etc/android.software.ipsec_tunnel_migration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnel_migration.xml \
|
||||
frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \
|
||||
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \
|
||||
frameworks/native/data/etc/android.software.opengles.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \
|
||||
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
|
||||
frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml \
|
||||
frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/privapp-permissions-euicc.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-euicc.xml
|
||||
|
||||
# Power
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.power-service.lineage-libperfmgr
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libssl.vendor
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json \
|
||||
$(LOCAL_PATH)/configs/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json
|
||||
|
||||
# Public libraries
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/public.libraries.txt:$(TARGET_COPY_OUT_VENDOR)/etc/public.libraries.txt
|
||||
|
||||
# Protobuf
|
||||
PRODUCT_PACKAGES += \
|
||||
libprotobuf-cpp-full-3.9.1-vendorcompat \
|
||||
libprotobuf-cpp-lite-3.9.1-vendorcompat
|
||||
|
||||
# QMI
|
||||
PRODUCT_PACKAGES += \
|
||||
libjson \
|
||||
libqti_vndfwk_detect.vendor \
|
||||
libvndfwk_detect_jni.qti.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libsqlite \
|
||||
libjsoncpp.vendor \
|
||||
libsqlite.vendor
|
||||
|
||||
# RIL
|
||||
PRODUCT_PACKAGES += \
|
||||
librmnetctl
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.radio-service.compat \
|
||||
android.hardware.radio@1.5.vendor \
|
||||
android.hardware.radio.config@1.2.vendor \
|
||||
android.hardware.radio.deprecated@1.0.vendor \
|
||||
android.hardware.secure_element@1.2.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libutilscallstack.vendor
|
||||
|
||||
# Rootdir
|
||||
PRODUCT_PACKAGES += \
|
||||
fstab.default \
|
||||
fstab.default.vendor_ramdisk \
|
||||
fstab.zram \
|
||||
init.device.rc \
|
||||
init.kernel.post_boot-blair.sh \
|
||||
init.qcom.rc \
|
||||
init.qti.kernel.rc \
|
||||
init.recovery.qcom.rc \
|
||||
init.target.rc \
|
||||
ueventd.qcom.rc
|
||||
|
||||
# Sensors
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.sensors-service.xiaomi-multihal
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.frameworks.sensorservice@1.0 \
|
||||
android.frameworks.sensorservice@1.0.vendor
|
||||
|
||||
# Shipping API level
|
||||
PRODUCT_SHIPPING_API_LEVEL := 30
|
||||
|
||||
# Soong
|
||||
PRODUCT_SOONG_NAMESPACES += \
|
||||
$(LOCAL_PATH)
|
||||
$(LOCAL_PATH) \
|
||||
hardware/google/interfaces \
|
||||
hardware/google/pixel \
|
||||
hardware/lineage/interfaces/power-libperfmgr \
|
||||
hardware/qcom-caf/common/libqti-perfd-client \
|
||||
hardware/xiaomi \
|
||||
vendor/qcom/opensource/usb/etc
|
||||
|
||||
# Speed profile services and wifi-service to reduce RAM and storage
|
||||
PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := everything
|
||||
|
||||
# Telephony
|
||||
PRODUCT_PACKAGES += \
|
||||
ims-ext-common \
|
||||
ims_ext_common.xml \
|
||||
qti-telephony-hidl-wrapper \
|
||||
qti_telephony_hidl_wrapper.xml \
|
||||
qti-telephony-utils \
|
||||
qti_telephony_utils.xml \
|
||||
telephony-ext \
|
||||
xiaomi-telephony-stub
|
||||
|
||||
PRODUCT_BOOT_JARS += \
|
||||
telephony-ext \
|
||||
xiaomi-telephony-stub
|
||||
|
||||
# Thermal
|
||||
ifeq ($(TARGET_USE_QTI_THERMAL_SERVICE),true)
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.thermal-service.qti
|
||||
endif
|
||||
|
||||
# Update engine
|
||||
PRODUCT_PACKAGES += \
|
||||
update_engine \
|
||||
update_engine_sideload \
|
||||
update_verifier
|
||||
|
||||
# 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
|
||||
|
||||
# Vendor service manager
|
||||
PRODUCT_PACKAGES += \
|
||||
vndservicemanager
|
||||
|
||||
# Vibrator
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.vibrator.service
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
vendor/qcom/opensource/vibrator/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
|
||||
|
||||
# WiFi
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi-service \
|
||||
hostapd \
|
||||
libwifi-hal-qcom \
|
||||
libwpa_client \
|
||||
wpa_supplicant \
|
||||
wpa_supplicant.conf
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi.hostapd@1.0.vendor
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/wifi,$(TARGET_COPY_OUT_VENDOR)/etc/wifi)
|
||||
|
||||
# WiFi firmware symlink
|
||||
PRODUCT_PACKAGES += \
|
||||
firmware_WCNSS_qcom_cfg.ini_symlink
|
||||
|
||||
# Inherit from proprietary targets
|
||||
$(call inherit-product, vendor/xiaomi/veux/veux-vendor.mk)
|
||||
|
||||
# Remove unwanted packages
|
||||
PRODUCT_PACKAGES += \
|
||||
RemovePackagesVeux
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<compatibility-matrix version="2.0" type="framework">
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.goodix.hardware.biometrics.fingerprint</name>
|
||||
<version>2.0-1</version>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemon</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemonExt</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.qti.hardware.radio.qcriNvOpt</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IqcriNvOpt</name>
|
||||
<instance>qcrinvopt0</instance>
|
||||
<instance>qcrinvopt1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.silead.hardware.fingerprintext</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISileadFingerprint</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>
|
||||
</compatibility-matrix>
|
||||
26
evolution.dependencies
Normal file
26
evolution.dependencies
Normal file
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"repository": "Xiaomi-Development/device_xiaomi_camera",
|
||||
"target_path": "device/xiaomi/camera",
|
||||
"remote": "github-non-los",
|
||||
"branch": "aosp-16"
|
||||
},
|
||||
{
|
||||
"repository": "hardware_xiaomi",
|
||||
"target_path": "hardware/xiaomi"
|
||||
},
|
||||
{
|
||||
"repository": "kernel_xiaomi_veux",
|
||||
"target_path": "kernel/xiaomi/veux"
|
||||
},
|
||||
{
|
||||
"repository": "vendor_xiaomi_veux",
|
||||
"target_path": "vendor/xiaomi/veux"
|
||||
},
|
||||
{
|
||||
"repository": "xiaomi-development/vendor_xiaomi_camera",
|
||||
"target_path": "vendor/xiaomi/camera",
|
||||
"remote": "gitlab",
|
||||
"branch": "aosp-16"
|
||||
}
|
||||
]
|
||||
87
extract-files.py
Normal file
87
extract-files.py
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from extract_utils.fixups_blob import (
|
||||
blob_fixup,
|
||||
blob_fixups_user_type,
|
||||
)
|
||||
|
||||
from extract_utils.main import (
|
||||
ExtractUtils,
|
||||
ExtractUtilsModule,
|
||||
)
|
||||
|
||||
namespace_imports = [
|
||||
'device/xiaomi/veux',
|
||||
'hardware/qcom-caf/sm8350',
|
||||
'hardware/qcom-caf/wlan',
|
||||
'hardware/xiaomi',
|
||||
'vendor/qcom/opensource/commonsys/display',
|
||||
'vendor/qcom/opensource/commonsys-intf/display',
|
||||
'vendor/qcom/opensource/dataservices',
|
||||
'vendor/qcom/opensource/display',
|
||||
]
|
||||
|
||||
|
||||
def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
|
||||
return f'{lib}_{partition}' if partition == 'vendor' else None
|
||||
|
||||
blob_fixups: blob_fixups_user_type = {
|
||||
'odm/etc/build_*.prop': blob_fixup()
|
||||
.regex_replace(r'.*marketname.*\n', r'')
|
||||
.regex_replace(r'cert', r'model'),
|
||||
|
||||
'system_ext/etc/init/wfdservice.rc': blob_fixup()
|
||||
.regex_replace(r'^(?!service)(.*)wfdservice$', r'\g<1>wfdservice64'),
|
||||
|
||||
'system_ext/lib64/libwfdnative.so': blob_fixup()
|
||||
.remove_needed('android.hidl.base@1.0.so'),
|
||||
|
||||
'vendor/etc/camera/camxoverridesettings.txt': blob_fixup()
|
||||
.regex_replace(r'0x10080', r'0')
|
||||
.regex_replace(r'0x1F', r'0x0'),
|
||||
|
||||
'vendor/etc/init/init.batterysecret.rc': blob_fixup()
|
||||
.regex_replace(r'on charger', r'on property:init.svc.vendor.charger=running'),
|
||||
|
||||
'vendor/etc/libnfc-pn557.conf': blob_fixup()
|
||||
.call(lambda file_path, content:
|
||||
content if "NXP RF" in content
|
||||
else content + '\n' + open(f"{SRC}/vendor/libnfc-nxp_RF.conf").read()),
|
||||
|
||||
'vendor/lib64/android.hardware.secure_element@1.0-impl.so': blob_fixup()
|
||||
.remove_needed('android.hidl.base@1.0.so'),
|
||||
|
||||
'vendor/lib64/camera/components/com.qti.node.mialgocontrol.so': blob_fixup()
|
||||
.add_needed('libpiex_shim.so'),
|
||||
|
||||
('vendor/lib64/libwvhidl.so', 'vendor/lib64/mediadrm/libwvdrmengine.so'): blob_fixup()
|
||||
.add_needed('libcrypto_shim.so'),
|
||||
|
||||
('vendor/lib64/libdlbdsservice.so',
|
||||
'vendor/lib/libstagefright_soft_ac4dec.so',
|
||||
'vendor/lib/libstagefright_soft_ddpdec.so'): blob_fixup()
|
||||
.replace_needed('libstagefright_foundation.so', 'libstagefright_foundation-v33.so'),
|
||||
|
||||
'vendor/etc/libnfc-sn100.conf': blob_fixup()
|
||||
.regex_replace(r'(DEFAULT_ISODEP_ROUTE.*?)0x01', r'\g<1>0xC0')
|
||||
.regex_replace(r'(DEFAULT_SYS_CODE_ROUTE.*?)0x00', r'\g<1>0xC0')
|
||||
.regex_replace(r'(DEFAULT_OFFHOST_ROUTE.*?)0x01', r'\g<1>0xC0')
|
||||
.regex_replace(r'(OFFHOST_ROUTE_ESE.*?)01', r'\g<1>C0')
|
||||
.regex_replace(r'$', r'\nDEFAULT_NFCF_ROUTE=0xC0'),
|
||||
}
|
||||
|
||||
|
||||
module = ExtractUtilsModule(
|
||||
'veux',
|
||||
'xiaomi',
|
||||
blob_fixups=blob_fixups,
|
||||
namespace_imports=namespace_imports,
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
utils = ExtractUtils.device(module)
|
||||
utils.run()
|
||||
@@ -1,61 +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=veux
|
||||
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"
|
||||
4
gps/Android.bp
Normal file
4
gps/Android.bp
Normal file
@@ -0,0 +1,4 @@
|
||||
GNSS_CFLAGS = [
|
||||
"-Werror",
|
||||
"-Wno-undefined-bool-conversion",
|
||||
]
|
||||
214
gps/android/2.1/AGnss.cpp
Normal file
214
gps/android/2.1/AGnss.cpp
Normal file
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* 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_AGnssInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "AGnss.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
static AGnss* spAGnss = nullptr;
|
||||
|
||||
AGnss::AGnss(Gnss* gnss) : mGnss(gnss), mType(LOC_AGPS_TYPE_INVALID) {
|
||||
spAGnss = this;
|
||||
}
|
||||
|
||||
AGnss::~AGnss() {
|
||||
spAGnss = nullptr;
|
||||
}
|
||||
|
||||
void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status) {
|
||||
if (nullptr != spAGnss) {
|
||||
spAGnss->statusCb(status.type, status.status);
|
||||
}
|
||||
}
|
||||
|
||||
void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) {
|
||||
|
||||
V2_0::IAGnssCallback::AGnssType aType;
|
||||
IAGnssCallback::AGnssStatusValue aStatus;
|
||||
|
||||
// cache the AGps Type
|
||||
mType = type;
|
||||
|
||||
switch (type) {
|
||||
case LOC_AGPS_TYPE_SUPL:
|
||||
aType = IAGnssCallback::AGnssType::SUPL;
|
||||
break;
|
||||
case LOC_AGPS_TYPE_SUPL_ES:
|
||||
aType = IAGnssCallback::AGnssType::SUPL_EIMS;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid type: %d", type);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
case LOC_GPS_REQUEST_AGPS_DATA_CONN:
|
||||
aStatus = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_RELEASE_AGPS_DATA_CONN:
|
||||
aStatus = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONNECTED:
|
||||
aStatus = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_DONE:
|
||||
aStatus = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_FAILED:
|
||||
aStatus = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid status: %d", status);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAGnssCbIface != nullptr) {
|
||||
auto r = mAGnssCbIface->agnssStatusCb(aType, aStatus);
|
||||
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<V2_0::IAGnssCallback>& callback) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Save the interface
|
||||
mAGnssCbIface = callback;
|
||||
|
||||
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(uint64_t /*networkHandle*/, const hidl_string& apn,
|
||||
V2_0::IAGnss::ApnIpType apnIpType) {
|
||||
|
||||
if (mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string apnString(apn.c_str());
|
||||
// During Emergency SUPL, an apn name of "sos" means that no
|
||||
// apn was found, like in the simless case, so apn is cleared
|
||||
if (LOC_AGPS_TYPE_SUPL_ES == mType && "sos" == apnString) {
|
||||
LOC_LOGD("dataConnOpen APN name = [sos] cleared");
|
||||
apnString.clear();
|
||||
}
|
||||
|
||||
LOC_LOGD("dataConnOpen APN name = [%s]", apnString.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, apnString.c_str(), apnString.size(), (int)bearerType);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::setServer(V2_0::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::SUPL) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL;
|
||||
} else if (type == IAGnssCallback::AGnssType::C2K) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K;
|
||||
} else if (type == IAGnssCallback::AGnssType::SUPL_EIMS) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL_EIMS;
|
||||
} else if (type == IAGnssCallback::AGnssType::SUPL_IMS) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL_IMS;
|
||||
} else {
|
||||
LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast<uint8_t>(type));
|
||||
return false;
|
||||
}
|
||||
config.assistanceServer.hostName = strdup(hostname.c_str());
|
||||
config.assistanceServer.port = port;
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
80
gps/android/2.1/AGnss.h
Normal file
80
gps/android/2.1/AGnss.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||
|
||||
#include <android/hardware/gnss/2.0/IAGnss.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
using ::android::hardware::gnss::V2_0::IAGnssCallback;
|
||||
|
||||
struct Gnss;
|
||||
struct AGnss : public V2_0::IAGnss {
|
||||
|
||||
AGnss(Gnss* gnss);
|
||||
~AGnss();
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V2_0::IAGnss interface follow.
|
||||
* These declarations were generated from IAGnss.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<V2_0::IAGnssCallback>& callback) override;
|
||||
|
||||
Return<bool> dataConnClosed() override;
|
||||
|
||||
Return<bool> dataConnFailed() override;
|
||||
|
||||
Return<bool> dataConnOpen(uint64_t networkHandle, const hidl_string& apn,
|
||||
V2_0::IAGnss::ApnIpType apnIpType) override;
|
||||
|
||||
Return<bool> setServer(V2_0::IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname, int32_t port) override;
|
||||
|
||||
void statusCb(AGpsExtType type, LocAGpsStatusValue status);
|
||||
|
||||
/* Data call setup callback passed down to GNSS HAL implementation */
|
||||
static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr;
|
||||
|
||||
AGpsExtType mType;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||
135
gps/android/2.1/AGnssRil.cpp
Normal file
135
gps/android/2.1/AGnssRil.cpp
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* 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__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 <DataItemConcreteTypesBase.h>
|
||||
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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;
|
||||
}
|
||||
Return<bool> AGnssRil::updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttributes& attributes) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
std::string apn = attributes.apn;
|
||||
if (nullptr != mGnss && (nullptr != mGnss->getGnssInterface())) {
|
||||
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||
bool roaming = false;
|
||||
if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_METERED) {
|
||||
typeout = loc_core::TYPE_WIFI;
|
||||
} else {
|
||||
typeout = loc_core::TYPE_MOBILE;
|
||||
}
|
||||
if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_ROAMING) {
|
||||
roaming = false;
|
||||
}
|
||||
LOC_LOGd("apn string received is: %s", apn.c_str());
|
||||
mGnss->getGnssInterface()->updateConnectionStatus(attributes.isConnected,
|
||||
typeout, roaming, (NetworkHandle) attributes.networkHandle, apn);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
84
gps/android/2.1/AGnssRil.h
Normal file
84
gps/android/2.1/AGnssRil.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_
|
||||
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_
|
||||
|
||||
#include <android/hardware/gnss/2.0/IAGnssRil.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
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 V2_0::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<V1_0::IAGnssRilCallback>& /*callback*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<void> setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<bool> setSetId(V1_0::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, V1_0::IAGnssRil::NetworkType type, bool roaming) override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow
|
||||
Return<bool> updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttributes& attributes) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_
|
||||
96
gps/android/2.1/Android.bp
Normal file
96
gps/android/2.1/Android.bp
Normal file
@@ -0,0 +1,96 @@
|
||||
cc_library_shared {
|
||||
name: "android.hardware.gnss@2.1-impl-qti",
|
||||
vendor: true,
|
||||
relative_install_path: "hw",
|
||||
srcs: [
|
||||
"AGnss.cpp",
|
||||
"Gnss.cpp",
|
||||
"AGnssRil.cpp",
|
||||
"GnssMeasurement.cpp",
|
||||
"GnssConfiguration.cpp",
|
||||
"GnssBatching.cpp",
|
||||
"GnssGeofencing.cpp",
|
||||
"GnssNi.cpp",
|
||||
"GnssDebug.cpp",
|
||||
"GnssAntennaInfo.cpp",
|
||||
"MeasurementCorrections.cpp",
|
||||
"GnssVisibilityControl.cpp",
|
||||
] + [
|
||||
"location_api/GnssAPIClient.cpp",
|
||||
"location_api/MeasurementAPIClient.cpp",
|
||||
"location_api/GeofenceAPIClient.cpp",
|
||||
"location_api/BatchingAPIClient.cpp",
|
||||
"location_api/LocationUtil.cpp",
|
||||
],
|
||||
|
||||
local_include_dirs: ["location_api"],
|
||||
|
||||
header_libs: [
|
||||
"libgps.utils_headers",
|
||||
"libloc_core_headers",
|
||||
"libloc_pla_headers",
|
||||
"liblocation_api_headers",
|
||||
"liblocbatterylistener_headers",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"liblog",
|
||||
"libhidlbase",
|
||||
"libcutils",
|
||||
"libutils",
|
||||
"android.hardware.gnss@1.0",
|
||||
"android.hardware.gnss@1.1",
|
||||
"android.hardware.gnss@2.0",
|
||||
"android.hardware.gnss@2.1",
|
||||
"android.hardware.gnss.measurement_corrections@1.0",
|
||||
"android.hardware.gnss.measurement_corrections@1.1",
|
||||
"android.hardware.gnss.visibility_control@1.0",
|
||||
"android.hardware.health@1.0",
|
||||
"android.hardware.health@2.0",
|
||||
"android.hardware.health@2.1",
|
||||
"android.hardware.power@1.2",
|
||||
"libbase",
|
||||
] + [
|
||||
"libloc_core",
|
||||
"libgps.utils",
|
||||
"libdl",
|
||||
"liblocation_api",
|
||||
],
|
||||
|
||||
cflags: GNSS_CFLAGS,
|
||||
static_libs: ["liblocbatterylistener"] + ["libhealthhalutils"],
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.gnss@2.1-service-qti",
|
||||
vintf_fragments: ["android.hardware.gnss@2.1-service-qti.xml"],
|
||||
vendor: true,
|
||||
relative_install_path: "hw",
|
||||
init_rc: ["android.hardware.gnss@2.1-service-qti.rc"],
|
||||
srcs: ["service.cpp"],
|
||||
|
||||
header_libs: [
|
||||
"libgps.utils_headers",
|
||||
"libloc_core_headers",
|
||||
"libloc_pla_headers",
|
||||
"liblocation_api_headers",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"liblog",
|
||||
"libcutils",
|
||||
"libdl",
|
||||
"libbase",
|
||||
"libutils",
|
||||
"libgps.utils",
|
||||
"libqti_vndfwk_detect",
|
||||
] + [
|
||||
"libhidlbase",
|
||||
"android.hardware.gnss@1.0",
|
||||
"android.hardware.gnss@1.1",
|
||||
"android.hardware.gnss@2.0",
|
||||
"android.hardware.gnss@2.1",
|
||||
],
|
||||
|
||||
cflags: GNSS_CFLAGS + ["-DLOC_HIDL_VERSION=\"4.0\""],
|
||||
}
|
||||
800
gps/android/2.1/Gnss.cpp
Normal file
800
gps/android/2.1/Gnss.cpp
Normal file
@@ -0,0 +1,800 @@
|
||||
/*
|
||||
* 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 V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl;
|
||||
using ::android::hardware::gnss::measurement_corrections::V1_1::
|
||||
implementation::MeasurementCorrections;
|
||||
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);
|
||||
if (mGnss != nullptr) {
|
||||
mGnss->getGnssInterface()->resetNetworkInfo();
|
||||
mGnss->cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
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(this);
|
||||
}
|
||||
|
||||
Gnss::~Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
sGnss = nullptr;
|
||||
}
|
||||
|
||||
GnssAPIClient* Gnss::getApi() {
|
||||
if (mApi != nullptr) {
|
||||
return mApi;
|
||||
}
|
||||
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface_2_1);
|
||||
} else if (mGnssCbIface_2_0 != nullptr) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface_2_0);
|
||||
} else if (mGnssCbIface_1_1 != nullptr) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface_1_1, mGnssNiCbIface);
|
||||
} else if (mGnssCbIface != nullptr) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);
|
||||
} else {
|
||||
LOC_LOGW("%s] GnssAPIClient is not ready", __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);
|
||||
}
|
||||
}
|
||||
|
||||
return mApi;
|
||||
}
|
||||
|
||||
const GnssInterface* Gnss::getGnssInterface() {
|
||||
static bool getGnssInterfaceFailed = false;
|
||||
if (mGnssInterface == nullptr && !getGnssInterfaceFailed) {
|
||||
void * libHandle = nullptr;
|
||||
getLocationInterface* getter = (getLocationInterface*)
|
||||
dlGetSymFromLib(libHandle, "libgnss.so", "getGnssInterface");
|
||||
if (NULL == getter) {
|
||||
getGnssInterfaceFailed = true;
|
||||
} else {
|
||||
mGnssInterface = (GnssInterface*)(*getter)();
|
||||
}
|
||||
}
|
||||
return mGnssInterface;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
// In case where previous call to setCallback_1_1/setCallback_2_0/setCallback_2_1, then
|
||||
// we need to cleanup these interfaces/callbacks here since we no longer
|
||||
// do so in cleanup() function to keep callbacks around after cleanup()
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks_2_0(nullptr);
|
||||
mApi->gnssUpdateCallbacks_2_1(nullptr);
|
||||
}
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_1_1 = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_0 != nullptr) {
|
||||
mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_2_0 = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
mGnssCbIface_2_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_2_1 = nullptr;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT;
|
||||
mPendingConfig.emergencyExtensionSeconds = gnssConfig.emergencyExtensionSeconds;
|
||||
}
|
||||
}
|
||||
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->gnssStop();
|
||||
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 __unused, int64_t timeReferenceMs __unused,
|
||||
int32_t uncertaintyMs __unused) {
|
||||
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();
|
||||
// deprecated function. Must return nullptr to pass VTS
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
// deprecated function. Must return nullptr to pass VTS
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasurement == nullptr) {
|
||||
mGnssMeasurement = new GnssMeasurement();
|
||||
}
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssConfig == nullptr) {
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
}
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssGeofencingIface == nullptr) {
|
||||
mGnssGeofencingIface = new GnssGeofencing();
|
||||
}
|
||||
return mGnssGeofencingIface;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssBatching == nullptr) {
|
||||
mGnssBatching = new GnssBatching();
|
||||
}
|
||||
return mGnssBatching;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssDebug == nullptr) {
|
||||
mGnssDebug = new GnssDebug(this);
|
||||
}
|
||||
return mGnssDebug;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssRil == nullptr) {
|
||||
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();
|
||||
auto r = callback->gnssNameCb(getVersionString());
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNameCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
|
||||
// In case where previous call to setCallback/setCallback_2_0/setCallback_2_1, then
|
||||
// we need to cleanup these interfaces/callbacks here since we no longer
|
||||
// do so in cleanup() function to keep callbacks around after cleanup()
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks_2_0(nullptr);
|
||||
mApi->gnssUpdateCallbacks_2_1(nullptr);
|
||||
}
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_0 != nullptr) {
|
||||
mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_2_0 = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
mGnssCbIface_2_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_2_1 = nullptr;
|
||||
}
|
||||
|
||||
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
}
|
||||
mGnssCbIface_1_1 = callback;
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
mGnssCbIface_1_1->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||
odcpiRequestCb(odcpiRequest);
|
||||
};
|
||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
||||
}
|
||||
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface_1_1, mGnssNiCbIface);
|
||||
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
|
||||
api->requestCapabilities();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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();
|
||||
#ifdef GNSS_HIDL_LEGACY_MEASURMENTS
|
||||
return nullptr;
|
||||
#else
|
||||
if (mGnssMeasurement == nullptr)
|
||||
mGnssMeasurement = new GnssMeasurement();
|
||||
return mGnssMeasurement;
|
||||
#endif
|
||||
}
|
||||
|
||||
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);
|
||||
gnssInterface->odcpiInject(location);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (ODCPI_REQUEST_TYPE_STOP == request.type) {
|
||||
return;
|
||||
}
|
||||
if (mGnssCbIface_2_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) {
|
||||
LOC_LOGd("gnssRequestLocationCb_2_1 isUserEmergency = %d", request.isEmergencyMode);
|
||||
auto r = mGnssCbIface_2_1->gnssRequestLocationCb_2_0(!request.isEmergencyMode,
|
||||
request.isEmergencyMode);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGe("Error invoking gnssRequestLocationCb_2_0 %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGv("Unsupported ODCPI request type: %d", request.type);
|
||||
}
|
||||
} else if (mGnssCbIface_2_0 != nullptr) {
|
||||
// For emergency mode, request DBH (Device based hybrid) location
|
||||
// Mark Independent from GNSS flag to false.
|
||||
if (ODCPI_REQUEST_TYPE_START == request.type) {
|
||||
LOC_LOGd("gnssRequestLocationCb_2_0 isUserEmergency = %d", request.isEmergencyMode);
|
||||
auto r = mGnssCbIface_2_0->gnssRequestLocationCb_2_0(!request.isEmergencyMode,
|
||||
request.isEmergencyMode);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGe("Error invoking gnssRequestLocationCb_2_0 %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGv("Unsupported ODCPI request type: %d", request.type);
|
||||
}
|
||||
} else 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.");
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnss follow.
|
||||
Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
auto r = callback->gnssNameCb(getVersionString());
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNameCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
|
||||
// In case where previous call to setCallback/setCallback_1_1/setCallback_2_1, then
|
||||
// we need to cleanup these interfaces/callbacks here since we no longer
|
||||
// do so in cleanup() function to keep callbacks around after cleanup()
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(nullptr, nullptr);
|
||||
mApi->gnssUpdateCallbacks_2_1(nullptr);
|
||||
}
|
||||
mGnssNiCbIface = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_1_1 = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
mGnssCbIface_2_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_2_1 = nullptr;
|
||||
}
|
||||
|
||||
|
||||
if (mGnssCbIface_2_0 != nullptr) {
|
||||
mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient);
|
||||
}
|
||||
mGnssCbIface_2_0 = callback;
|
||||
if (mGnssCbIface_2_0 != nullptr) {
|
||||
mGnssCbIface_2_0->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||
odcpiRequestCb(odcpiRequest);
|
||||
};
|
||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
||||
}
|
||||
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks_2_0(mGnssCbIface_2_0);
|
||||
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
|
||||
api->requestCapabilities();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<sp<V2_0::IAGnss>> Gnss::getExtensionAGnss_2_0() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mAGnssIface_2_0 == nullptr) {
|
||||
mAGnssIface_2_0 = new AGnss(this);
|
||||
}
|
||||
return mAGnssIface_2_0;
|
||||
}
|
||||
Return<sp<V2_0::IAGnssRil>> Gnss::getExtensionAGnssRil_2_0() {
|
||||
|
||||
if (mGnssRil == nullptr) {
|
||||
mGnssRil = new AGnssRil(this);
|
||||
}
|
||||
return mGnssRil;
|
||||
}
|
||||
|
||||
Return<sp<V2_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_2_0() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssConfig == nullptr) {
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
}
|
||||
return mGnssConfig;
|
||||
}
|
||||
Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
#ifdef GNSS_HIDL_LEGACY_MEASURMENTS
|
||||
return nullptr;
|
||||
#else
|
||||
if (mGnssMeasurement == nullptr)
|
||||
mGnssMeasurement = new GnssMeasurement();
|
||||
return mGnssMeasurement;
|
||||
#endif
|
||||
}
|
||||
|
||||
Return<sp<IMeasurementCorrectionsV1_0>>
|
||||
Gnss::getExtensionMeasurementCorrections() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasCorr == nullptr) {
|
||||
mGnssMeasCorr = new MeasurementCorrections(this);
|
||||
}
|
||||
return mGnssMeasCorr;
|
||||
}
|
||||
|
||||
Return<sp<IMeasurementCorrectionsV1_1>>
|
||||
Gnss::getExtensionMeasurementCorrections_1_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasCorr == nullptr) {
|
||||
mGnssMeasCorr = new MeasurementCorrections(this);
|
||||
}
|
||||
return mGnssMeasCorr;
|
||||
}
|
||||
|
||||
Return<sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl>>
|
||||
Gnss::getExtensionVisibilityControl() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mVisibCtrl == nullptr) {
|
||||
mVisibCtrl = new GnssVisibilityControl(this);
|
||||
}
|
||||
return mVisibCtrl;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectBestLocation_2_0(const V2_0::GnssLocation& gnssLocation) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
Location location = {};
|
||||
convertGnssLocation(gnssLocation, location);
|
||||
gnssInterface->odcpiInject(location);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<sp<V2_0::IGnssDebug>> Gnss::getExtensionGnssDebug_2_0() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssDebug == nullptr) {
|
||||
mGnssDebug = new GnssDebug(this);
|
||||
}
|
||||
return mGnssDebug;
|
||||
}
|
||||
|
||||
Return<sp<V2_0::IGnssBatching>> Gnss::getExtensionGnssBatching_2_0() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnss follow.
|
||||
Return<bool> Gnss::setCallback_2_1(const sp<V2_1::IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
auto r = callback->gnssNameCb(getVersionString());
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNameCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
|
||||
// In case where previous call to setCallback/setCallback_1_1/setCallback_2_0, then
|
||||
// we need to cleanup these interfaces/callbacks here since we no longer
|
||||
// do so in cleanup() function to keep callbacks around after cleanup()
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssUpdateCallbacks(nullptr, nullptr);
|
||||
mApi->gnssUpdateCallbacks_2_0(nullptr);
|
||||
}
|
||||
mGnssNiCbIface = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_1_1 != nullptr) {
|
||||
mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_1_1 = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_0 != nullptr) {
|
||||
mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient);
|
||||
mGnssCbIface_2_0 = nullptr;
|
||||
}
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
mGnssCbIface_2_1->unlinkToDeath(mGnssDeathRecipient);
|
||||
}
|
||||
mGnssCbIface_2_1 = callback;
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
mGnssCbIface_2_1->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
const GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (gnssInterface != nullptr) {
|
||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||
odcpiRequestCb(odcpiRequest);
|
||||
};
|
||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
||||
}
|
||||
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks_2_1(mGnssCbIface_2_1);
|
||||
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
|
||||
api->requestCapabilities();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Return<sp<V2_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssMeasurement == nullptr) {
|
||||
mGnssMeasurement = new GnssMeasurement();
|
||||
}
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
Return<sp<V2_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_2_1() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssConfig == nullptr) {
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
}
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<sp<V2_1::IGnssAntennaInfo>> Gnss::getExtensionGnssAntennaInfo() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssAntennaInfo == nullptr) {
|
||||
mGnssAntennaInfo = new GnssAntennaInfo(this);
|
||||
}
|
||||
return mGnssAntennaInfo;
|
||||
}
|
||||
|
||||
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 V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
193
gps/android/2.1/Gnss.h
Normal file
193
gps/android/2.1/Gnss.h
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_1_GNSS_H
|
||||
|
||||
#include <AGnss.h>
|
||||
#include <AGnssRil.h>
|
||||
#include <GnssConfiguration.h>
|
||||
#include <GnssMeasurement.h>
|
||||
#include <GnssBatching.h>
|
||||
#include <GnssGeofencing.h>
|
||||
#include <GnssNi.h>
|
||||
#include <GnssDebug.h>
|
||||
#include <GnssAntennaInfo.h>
|
||||
|
||||
#include <android/hardware/gnss/2.1/IGnss.h>
|
||||
#include <android/hardware/gnss/measurement_corrections/1.1/IMeasurementCorrections.h>
|
||||
#include <MeasurementCorrections.h>
|
||||
#include <GnssVisibilityControl.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include "GnssAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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;
|
||||
using IMeasurementCorrectionsV1_0 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrections;
|
||||
using IMeasurementCorrectionsV1_1 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_1::IMeasurementCorrections;
|
||||
using ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl;
|
||||
|
||||
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;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnss follow.
|
||||
Return<bool> setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) override;
|
||||
Return<sp<V2_0::IAGnss>> getExtensionAGnss_2_0() override;
|
||||
Return<sp<V2_0::IAGnssRil>> getExtensionAGnssRil_2_0() override;
|
||||
|
||||
Return<sp<V2_0::IGnssConfiguration>> getExtensionGnssConfiguration_2_0() override;
|
||||
Return<sp<IMeasurementCorrectionsV1_0>> getExtensionMeasurementCorrections() override;
|
||||
Return<sp<IMeasurementCorrectionsV1_1>> getExtensionMeasurementCorrections_1_1() override;
|
||||
Return<sp<V2_0::IGnssMeasurement>> getExtensionGnssMeasurement_2_0() override;
|
||||
|
||||
Return<bool> injectBestLocation_2_0(
|
||||
const ::android::hardware::gnss::V2_0::GnssLocation& location) override;
|
||||
|
||||
Return<sp<V2_0::IGnssBatching>> getExtensionGnssBatching_2_0() override;
|
||||
Return<sp<V2_0::IGnssDebug>> getExtensionGnssDebug_2_0() override;
|
||||
Return<sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl>>
|
||||
getExtensionVisibilityControl() override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnss follow.
|
||||
Return<bool> setCallback_2_1(const sp<V2_1::IGnssCallback>& callback) override;
|
||||
Return<sp<V2_1::IGnssMeasurement>> getExtensionGnssMeasurement_2_1() override;
|
||||
Return<sp<V2_1::IGnssConfiguration>> getExtensionGnssConfiguration_2_1() override;
|
||||
Return<sp<V2_1::IGnssAntennaInfo>> getExtensionGnssAntennaInfo() 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(sp<Gnss> gnss) : mGnss(gnss) {
|
||||
}
|
||||
~GnssDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<Gnss> mGnss;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssDeathRecipient> mGnssDeathRecipient = nullptr;
|
||||
|
||||
sp<V1_0::IGnssNi> mGnssNi = nullptr;
|
||||
sp<V1_0::IGnssGeofencing> mGnssGeofencingIface = nullptr;
|
||||
sp<V1_0::IAGnss> mAGnssIface = nullptr;
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface = nullptr;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
sp<V1_1::IGnssCallback> mGnssCbIface_1_1 = nullptr;
|
||||
sp<V2_0::IAGnss> mAGnssIface_2_0 = nullptr;
|
||||
sp<V2_0::IAGnssRil> mGnssRil = nullptr;
|
||||
sp<V2_0::IGnssBatching> mGnssBatching = nullptr;
|
||||
sp<V2_0::IGnssDebug> mGnssDebug = nullptr;
|
||||
sp<V2_0::IGnssCallback> mGnssCbIface_2_0 = nullptr;
|
||||
sp<V2_1::IGnssCallback> mGnssCbIface_2_1 = nullptr;
|
||||
sp<V2_1::IGnssMeasurement> mGnssMeasurement = nullptr;
|
||||
sp<V2_1::IGnssConfiguration> mGnssConfig = nullptr;
|
||||
sp<V2_1::IGnssAntennaInfo> mGnssAntennaInfo = nullptr;
|
||||
sp<IMeasurementCorrectionsV1_1> mGnssMeasCorr = nullptr;
|
||||
sp<IGnssVisibilityControl> mVisibCtrl = nullptr;
|
||||
|
||||
GnssAPIClient* mApi = nullptr;
|
||||
GnssConfig mPendingConfig;
|
||||
const GnssInterface* mGnssInterface = nullptr;
|
||||
};
|
||||
|
||||
extern "C" V1_0::IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_1_GNSS_H
|
||||
202
gps/android/2.1/GnssAntennaInfo.cpp
Normal file
202
gps/android/2.1/GnssAntennaInfo.cpp
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Copyright (c) 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_TAG "LocSvc_GnssAntennaInfoInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssAntennaInfo.h"
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
static GnssAntennaInfo* spGnssAntennaInfo = nullptr;
|
||||
|
||||
static void convertGnssAntennaInfo(std::vector<GnssAntennaInformation>& in,
|
||||
hidl_vec<IGnssAntennaInfoCallback::GnssAntennaInfo>& antennaInfos);
|
||||
|
||||
void GnssAntennaInfo::GnssAntennaInfoDeathRecipient::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);
|
||||
// we do nothing here
|
||||
// Gnss::GnssDeathRecipient will stop the session
|
||||
// However, we need to inform the adapter that the service has died
|
||||
if (nullptr == spGnssAntennaInfo) {
|
||||
LOC_LOGE("%s]: spGnssAntennaInfo is nullptr", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
if (nullptr == spGnssAntennaInfo->mGnss) {
|
||||
LOC_LOGE("%s]: spGnssAntennaInfo->mGnss is nullptr", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
spGnssAntennaInfo->mGnss->getGnssInterface()->antennaInfoClose();
|
||||
}
|
||||
|
||||
static void convertGnssAntennaInfo(std::vector<GnssAntennaInformation>& in,
|
||||
hidl_vec<IGnssAntennaInfoCallback::GnssAntennaInfo>& out) {
|
||||
|
||||
uint32_t vecSize, numberOfRows, numberOfColumns;
|
||||
vecSize = in.size();
|
||||
out.resize(vecSize);
|
||||
for (uint32_t i = 0; i < vecSize; i++) {
|
||||
out[i].carrierFrequencyMHz = in[i].carrierFrequencyMHz;
|
||||
out[i].phaseCenterOffsetCoordinateMillimeters.x =
|
||||
in[i].phaseCenterOffsetCoordinateMillimeters.x;
|
||||
out[i].phaseCenterOffsetCoordinateMillimeters.xUncertainty =
|
||||
in[i].phaseCenterOffsetCoordinateMillimeters.xUncertainty;
|
||||
out[i].phaseCenterOffsetCoordinateMillimeters.y =
|
||||
in[i].phaseCenterOffsetCoordinateMillimeters.y;
|
||||
out[i].phaseCenterOffsetCoordinateMillimeters.yUncertainty =
|
||||
in[i].phaseCenterOffsetCoordinateMillimeters.yUncertainty;
|
||||
out[i].phaseCenterOffsetCoordinateMillimeters.z =
|
||||
in[i].phaseCenterOffsetCoordinateMillimeters.z;
|
||||
out[i].phaseCenterOffsetCoordinateMillimeters.zUncertainty =
|
||||
in[i].phaseCenterOffsetCoordinateMillimeters.zUncertainty;
|
||||
|
||||
numberOfRows = in[i].phaseCenterVariationCorrectionMillimeters.size();
|
||||
out[i].phaseCenterVariationCorrectionMillimeters.resize(numberOfRows);
|
||||
for (uint32_t j = 0; j < numberOfRows; j++) {
|
||||
numberOfColumns = in[i].phaseCenterVariationCorrectionMillimeters[j].size();
|
||||
out[i].phaseCenterVariationCorrectionMillimeters[j].row.resize(numberOfColumns);
|
||||
for (uint32_t k = 0; k < numberOfColumns; k++) {
|
||||
out[i].phaseCenterVariationCorrectionMillimeters[j].row[k] =
|
||||
in[i].phaseCenterVariationCorrectionMillimeters[j][k];
|
||||
}
|
||||
}
|
||||
|
||||
numberOfRows = in[i].phaseCenterVariationCorrectionUncertaintyMillimeters.size();
|
||||
out[i].phaseCenterVariationCorrectionUncertaintyMillimeters.resize(numberOfRows);
|
||||
for (uint32_t j = 0; j < numberOfRows; j++) {
|
||||
numberOfColumns = in[i].phaseCenterVariationCorrectionUncertaintyMillimeters[j].size();
|
||||
out[i].phaseCenterVariationCorrectionUncertaintyMillimeters[j].
|
||||
row.resize(numberOfColumns);
|
||||
for (uint32_t k = 0; k < numberOfColumns; k++) {
|
||||
out[i].phaseCenterVariationCorrectionUncertaintyMillimeters[j].row[k] =
|
||||
in[i].phaseCenterVariationCorrectionUncertaintyMillimeters[j][k];
|
||||
}
|
||||
}
|
||||
|
||||
numberOfRows = in[i].signalGainCorrectionDbi.size();
|
||||
out[i].signalGainCorrectionDbi.resize(numberOfRows);
|
||||
for (uint32_t j = 0; j < numberOfRows; j++) {
|
||||
numberOfColumns = in[i].signalGainCorrectionDbi[j].size();
|
||||
out[i].signalGainCorrectionDbi[j].row.resize(numberOfColumns);
|
||||
for (uint32_t k = 0; k < numberOfColumns; k++) {
|
||||
out[i].signalGainCorrectionDbi[j].row[k] = in[i].signalGainCorrectionDbi[j][k];
|
||||
}
|
||||
}
|
||||
|
||||
numberOfRows = in[i].signalGainCorrectionUncertaintyDbi.size();
|
||||
out[i].signalGainCorrectionUncertaintyDbi.resize(numberOfRows);
|
||||
for (uint32_t j = 0; j < numberOfRows; j++) {
|
||||
numberOfColumns = in[i].signalGainCorrectionUncertaintyDbi[j].size();
|
||||
out[i].signalGainCorrectionUncertaintyDbi[j].row.resize(numberOfColumns);
|
||||
for (uint32_t k = 0; k < numberOfColumns; k++) {
|
||||
out[i].signalGainCorrectionUncertaintyDbi[j].row[k] =
|
||||
in[i].signalGainCorrectionUncertaintyDbi[j][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GnssAntennaInfo::GnssAntennaInfo(Gnss* gnss) : mGnss(gnss) {
|
||||
mGnssAntennaInfoDeathRecipient = new GnssAntennaInfoDeathRecipient(this);
|
||||
spGnssAntennaInfo = this;
|
||||
}
|
||||
|
||||
GnssAntennaInfo::~GnssAntennaInfo() {
|
||||
spGnssAntennaInfo = nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnssAntennaInfo follow.
|
||||
Return<GnssAntennaInfo::GnssAntennaInfoStatus>
|
||||
GnssAntennaInfo::setCallback(const sp<IGnssAntennaInfoCallback>& callback) {
|
||||
uint32_t retValue;
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return GnssAntennaInfoStatus::ERROR_GENERIC;
|
||||
}
|
||||
|
||||
mGnssAntennaInfoCbIface = callback;
|
||||
retValue = mGnss->getGnssInterface()->antennaInfoInit(aiGnssAntennaInfoCb);
|
||||
|
||||
switch (retValue) {
|
||||
case ANTENNA_INFO_SUCCESS: return GnssAntennaInfoStatus::SUCCESS;
|
||||
case ANTENNA_INFO_ERROR_ALREADY_INIT: return GnssAntennaInfoStatus::ERROR_ALREADY_INIT;
|
||||
case ANTENNA_INFO_ERROR_GENERIC:
|
||||
default: return GnssAntennaInfoStatus::ERROR_GENERIC;
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> GnssAntennaInfo::close(void) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->antennaInfoClose();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
void GnssAntennaInfo::aiGnssAntennaInfoCb
|
||||
(std::vector<GnssAntennaInformation> gnssAntennaInformations) {
|
||||
if (nullptr != spGnssAntennaInfo) {
|
||||
spGnssAntennaInfo->gnssAntennaInfoCb(gnssAntennaInformations);
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAntennaInfo::gnssAntennaInfoCb
|
||||
(std::vector<GnssAntennaInformation> gnssAntennaInformations) {
|
||||
|
||||
if (mGnssAntennaInfoCbIface != nullptr) {
|
||||
hidl_vec<IGnssAntennaInfoCallback::GnssAntennaInfo> antennaInfos;
|
||||
|
||||
// Convert from one structure to another
|
||||
convertGnssAntennaInfo(gnssAntennaInformations, antennaInfos);
|
||||
|
||||
auto r = mGnssAntennaInfoCbIface->gnssAntennaInfoCb(antennaInfos);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error antenna info cb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
90
gps/android/2.1/GnssAntennaInfo.h
Normal file
90
gps/android/2.1/GnssAntennaInfo.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSANTENNAINFO_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_1_GNSSANTENNAINFO_H
|
||||
|
||||
#include <android/hardware/gnss/2.1/IGnssAntennaInfo.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_1::IGnssAntennaInfo;
|
||||
using ::android::hardware::gnss::V2_1::IGnssAntennaInfoCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct GnssAntennaInfo : public IGnssAntennaInfo {
|
||||
GnssAntennaInfo(Gnss* gnss);
|
||||
~GnssAntennaInfo();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_1::IGnssAntennaInfo follow.
|
||||
* These declarations were generated from IGnssAntennaInfo.hal.
|
||||
*/
|
||||
Return<GnssAntennaInfoStatus>
|
||||
setCallback(const sp<IGnssAntennaInfoCallback>& callback) override;
|
||||
Return<void> close(void) override;
|
||||
|
||||
void gnssAntennaInfoCb(std::vector<GnssAntennaInformation> gnssAntennaInformations);
|
||||
|
||||
static void aiGnssAntennaInfoCb(std::vector<GnssAntennaInformation> gnssAntennaInformations);
|
||||
|
||||
private:
|
||||
struct GnssAntennaInfoDeathRecipient : hidl_death_recipient {
|
||||
GnssAntennaInfoDeathRecipient(sp<GnssAntennaInfo> gnssAntennaInfo) :
|
||||
mGnssAntennaInfo(gnssAntennaInfo) {
|
||||
}
|
||||
~GnssAntennaInfoDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssAntennaInfo> mGnssAntennaInfo;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssAntennaInfoDeathRecipient> mGnssAntennaInfoDeathRecipient = nullptr;
|
||||
sp<IGnssAntennaInfoCallback> mGnssAntennaInfoCbIface = nullptr;
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_1_GNSSANTENNAINFO_H
|
||||
163
gps/android/2.1/GnssBatching.cpp
Normal file
163
gps/android/2.1/GnssBatching.cpp
Normal file
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* 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_GnssBatchingInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <BatchingAPIClient.h>
|
||||
#include "GnssBatching.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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);
|
||||
if (mGnssBatching != nullptr) {
|
||||
mGnssBatching->stop();
|
||||
mGnssBatching->cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
GnssBatching::GnssBatching() : mApi(nullptr) {
|
||||
mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this);
|
||||
}
|
||||
|
||||
GnssBatching::~GnssBatching() {
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> GnssBatching::init(const sp<V1_0::IGnssBatchingCallback>& callback) {
|
||||
if (mApi != nullptr) {
|
||||
LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__);
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
|
||||
mApi = new BatchingAPIClient(callback);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
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 (mApi != nullptr) {
|
||||
mApi->stopSession();
|
||||
}
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
mGnssBatchingCbIface = nullptr;
|
||||
}
|
||||
if (mGnssBatchingCbIface_2_0 != nullptr) {
|
||||
mGnssBatchingCbIface_2_0->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
mGnssBatchingCbIface_2_0 = nullptr;
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssBatching follow.
|
||||
Return<bool> GnssBatching::init_2_0(const sp<V2_0::IGnssBatchingCallback>& callback) {
|
||||
if (mApi != nullptr) {
|
||||
LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__);
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
|
||||
mApi = new BatchingAPIClient(callback);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mGnssBatchingCbIface_2_0 != nullptr) {
|
||||
mGnssBatchingCbIface_2_0->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
mGnssBatchingCbIface_2_0 = callback;
|
||||
if (mGnssBatchingCbIface_2_0 != nullptr) {
|
||||
mGnssBatchingCbIface_2_0->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
84
gps/android/2.1/GnssBatching.h
Normal file
84
gps/android/2.1/GnssBatching.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H
|
||||
|
||||
#include <android/hardware/gnss/2.0/IGnssBatching.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V2_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 {
|
||||
GnssBatching();
|
||||
~GnssBatching();
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> init(const sp<V1_0::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;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssBatching follow.
|
||||
Return<bool> init_2_0(const sp<V2_0::IGnssBatchingCallback>& callback) override;
|
||||
|
||||
private:
|
||||
struct GnssBatchingDeathRecipient : hidl_death_recipient {
|
||||
GnssBatchingDeathRecipient(sp<GnssBatching> gnssBatching) :
|
||||
mGnssBatching(gnssBatching) {
|
||||
}
|
||||
~GnssBatchingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssBatching> mGnssBatching;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
|
||||
sp<V1_0::IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
|
||||
BatchingAPIClient* mApi = nullptr;
|
||||
sp<V2_0::IGnssBatchingCallback> mGnssBatchingCbIface_2_0 = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H
|
||||
408
gps/android/2.1/GnssConfiguration.cpp
Normal file
408
gps/android/2.1/GnssConfiguration.cpp
Normal file
@@ -0,0 +1,408 @@
|
||||
/*
|
||||
* 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_GnssConfigurationInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssConfiguration.h"
|
||||
#include "ContextBase.h"
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_0::GnssConstellationType;
|
||||
using namespace loc_core;
|
||||
|
||||
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setSuplEs(bool enabled __unused) {
|
||||
// deprecated function. Must return false to pass VTS
|
||||
return false;
|
||||
}
|
||||
|
||||
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 = {};
|
||||
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_NI;
|
||||
break;
|
||||
case 3:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->updateConfiguration(config);
|
||||
// Must return false to pass VTS
|
||||
return false;
|
||||
}
|
||||
|
||||
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<V1_1::IGnssConfiguration::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, (GnssConstellationType)blacklist[idx].constellation,
|
||||
blacklist[idx].svid) || 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 GnssConstellationType& constellation,
|
||||
const int16_t svid) {
|
||||
|
||||
bool retVal = true;
|
||||
uint16_t svIdOffset = 0;
|
||||
copyToSource.size = sizeof(GnssSvIdSource);
|
||||
copyToSource.svId = svid;
|
||||
|
||||
switch(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;
|
||||
case GnssConstellationType::IRNSS:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_NAVIC;
|
||||
svIdOffset = 0;
|
||||
break;
|
||||
default:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
|
||||
LOC_LOGe("Invalid constellation %hhu", constellation);
|
||||
retVal = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (copyToSource.svId > 0 && svIdOffset > 0) {
|
||||
copyToSource.svId += svIdOffset;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
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 = GNSS_SV_CONFIG_QZSS_INITIAL_SV_ID - 1;
|
||||
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;
|
||||
case GnssConstellationType::IRNSS:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_NAVIC;
|
||||
svIdOffset = GNSS_SV_CONFIG_NAVIC_INITIAL_SV_ID - 1;
|
||||
break;
|
||||
default:
|
||||
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
|
||||
LOC_LOGe("Invalid constellation %hhu", copyFromSource.constellation);
|
||||
retVal = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (copyToSource.svId > 0 && svIdOffset > 0) {
|
||||
copyToSource.svId += svIdOffset;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setEsExtensionSec(uint32_t emergencyExtensionSeconds) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGe("mGnss is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT;
|
||||
config.emergencyExtensionSeconds = emergencyExtensionSeconds;
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setBlacklist_2_1(
|
||||
const hidl_vec<V2_1::IGnssConfiguration::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));
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
88
gps/android/2.1/GnssConfiguration.h
Normal file
88
gps/android/2.1/GnssConfiguration.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H
|
||||
|
||||
#include <android/hardware/gnss/2.1/IGnssConfiguration.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::gnss::V2_0::GnssConstellationType;
|
||||
using ::android::sp;
|
||||
|
||||
/*
|
||||
* Interface for passing GNSS configuration info from platform to HAL.
|
||||
*/
|
||||
struct Gnss;
|
||||
struct GnssConfiguration : public V2_1::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<V1_1::IGnssConfiguration::BlacklistedSource>& blacklist) override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow.
|
||||
Return<bool> setEsExtensionSec(uint32_t emergencyExtensionSeconds) override;
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnssConfiguration follow.
|
||||
Return<bool> setBlacklist_2_1(
|
||||
const hidl_vec<V2_1::IGnssConfiguration::BlacklistedSource>& blacklist) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
bool setBlacklistedSource(
|
||||
GnssSvIdSource& copyToSource,
|
||||
const GnssConfiguration::BlacklistedSource& copyFromSource);
|
||||
bool setBlacklistedSource(
|
||||
GnssSvIdSource& copyToSource, const GnssConstellationType& constellation,
|
||||
const int16_t svid);
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H
|
||||
299
gps/android/2.1/GnssDebug.cpp
Normal file
299
gps/android/2.1/GnssDebug.cpp
Normal file
@@ -0,0 +1,299 @@
|
||||
/*
|
||||
* 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_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 V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::gnss::V2_0::IGnssDebug;
|
||||
|
||||
#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__);
|
||||
|
||||
V1_0::IGnssDebug::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
|
||||
V1_0::IGnssDebug::SatelliteData s = { };
|
||||
std::vector<V1_0::IGnssDebug::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();
|
||||
}
|
||||
|
||||
Return<void> GnssDebug::getDebugData_2_0(getDebugData_2_0_cb _hidl_cb)
|
||||
{
|
||||
LOC_LOGD("%s]: ", __func__);
|
||||
|
||||
V2_0::IGnssDebug::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
|
||||
V2_0::IGnssDebug::SatelliteData s = { };
|
||||
std::vector<V2_0::IGnssDebug::SatelliteData> s_array;
|
||||
|
||||
for (uint32_t i=0; i<reports.mSatelliteInfo.size(); i++) {
|
||||
memset(&s, 0, sizeof(s));
|
||||
s.v1_0.svid = reports.mSatelliteInfo[i].svid;
|
||||
convertGnssConstellationType(
|
||||
reports.mSatelliteInfo[i].constellation, s.constellation);
|
||||
convertGnssEphemerisType(
|
||||
reports.mSatelliteInfo[i].mEphemerisType, s.v1_0.ephemerisType);
|
||||
convertGnssEphemerisSource(
|
||||
reports.mSatelliteInfo[i].mEphemerisSource, s.v1_0.ephemerisSource);
|
||||
convertGnssEphemerisHealth(
|
||||
reports.mSatelliteInfo[i].mEphemerisHealth, s.v1_0.ephemerisHealth);
|
||||
|
||||
s.v1_0.ephemerisAgeSeconds =
|
||||
reports.mSatelliteInfo[i].ephemerisAgeSeconds;
|
||||
s.v1_0.serverPredictionIsAvailable =
|
||||
reports.mSatelliteInfo[i].serverPredictionIsAvailable;
|
||||
s.v1_0.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 V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
62
gps/android/2.1/GnssDebug.h
Normal file
62
gps/android/2.1/GnssDebug.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/2.0/IGnssDebug.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_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
|
||||
Return<void> getDebugData(getDebugData_cb _hidl_cb) override;
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow.
|
||||
Return<void> getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H
|
||||
141
gps/android/2.1/GnssGeofencing.cpp
Normal file
141
gps/android/2.1/GnssGeofencing.cpp
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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 "GnssHal_GnssGeofencing"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <GeofenceAPIClient.h>
|
||||
#include "GnssGeofencing.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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);
|
||||
if (mGnssGeofencing != nullptr) {
|
||||
mGnssGeofencing->removeAllGeofences();
|
||||
}
|
||||
}
|
||||
|
||||
GnssGeofencing::GnssGeofencing() : mApi(nullptr) {
|
||||
mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this);
|
||||
}
|
||||
|
||||
GnssGeofencing::~GnssGeofencing() {
|
||||
if (mApi != nullptr) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
|
||||
if (mApi != nullptr) {
|
||||
LOC_LOGd("mApi is NOT nullptr");
|
||||
return Void();
|
||||
}
|
||||
|
||||
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 V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
91
gps/android/2.1/GnssGeofencing.h
Normal file
91
gps/android/2.1/GnssGeofencing.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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 {
|
||||
GnssGeofencing();
|
||||
~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(sp<GnssGeofencing> gnssGeofencing) :
|
||||
mGnssGeofencing(gnssGeofencing) {
|
||||
}
|
||||
~GnssGeofencingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssGeofencing> mGnssGeofencing;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssGeofencingDeathRecipient> mGnssGeofencingDeathRecipient = nullptr;
|
||||
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface = nullptr;
|
||||
GeofenceAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H
|
||||
211
gps/android/2.1/GnssMeasurement.cpp
Normal file
211
gps/android/2.1/GnssMeasurement.cpp
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* 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_GnssMeasurementInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "GnssMeasurement.h"
|
||||
#include "MeasurementAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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);
|
||||
if (mGnssMeasurement != nullptr) {
|
||||
mGnssMeasurement->close();
|
||||
}
|
||||
}
|
||||
|
||||
GnssMeasurement::GnssMeasurement() {
|
||||
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this);
|
||||
mApi = new MeasurementAPIClient();
|
||||
}
|
||||
|
||||
GnssMeasurement::~GnssMeasurement() {
|
||||
if (mApi) {
|
||||
mApi->destroy();
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||
|
||||
Return<GnssMeasurement::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;
|
||||
}
|
||||
|
||||
clearInterfaces();
|
||||
|
||||
mGnssMeasurementCbIface = callback;
|
||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
return mApi->measurementSetCallback(callback);
|
||||
}
|
||||
|
||||
void GnssMeasurement::clearInterfaces() {
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
}
|
||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
}
|
||||
if (mGnssMeasurementCbIface_2_0 != nullptr) {
|
||||
mGnssMeasurementCbIface_2_0->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface_2_0 = nullptr;
|
||||
}
|
||||
if (mGnssMeasurementCbIface_2_1 != nullptr) {
|
||||
mGnssMeasurementCbIface_2_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface_2_1 = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> GnssMeasurement::close() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
clearInterfaces();
|
||||
mApi->measurementClose();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
||||
const sp<V1_1::IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
||||
|
||||
Return<GnssMeasurement::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;
|
||||
}
|
||||
|
||||
clearInterfaces();
|
||||
|
||||
mGnssMeasurementCbIface_1_1 = callback;
|
||||
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
GnssPowerMode powerMode = enableFullTracking?
|
||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
||||
|
||||
return mApi->measurementSetCallback_1_1(callback, powerMode);
|
||||
}
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow.
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_0(
|
||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) {
|
||||
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface_2_0 != 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;
|
||||
}
|
||||
|
||||
clearInterfaces();
|
||||
|
||||
mGnssMeasurementCbIface_2_0 = callback;
|
||||
mGnssMeasurementCbIface_2_0->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
GnssPowerMode powerMode = enableFullTracking ?
|
||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
||||
|
||||
return mApi->measurementSetCallback_2_0(callback, powerMode);
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnssMeasurement follow.
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_1(
|
||||
const sp<::android::hardware::gnss::V2_1::IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) {
|
||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface_2_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;
|
||||
}
|
||||
|
||||
clearInterfaces();
|
||||
|
||||
mGnssMeasurementCbIface_2_1 = callback;
|
||||
mGnssMeasurementCbIface_2_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||
|
||||
GnssPowerMode powerMode = enableFullTracking ?
|
||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
||||
|
||||
return mApi->measurementSetCallback_2_1(callback, powerMode);
|
||||
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
93
gps/android/2.1/GnssMeasurement.h
Normal file
93
gps/android/2.1/GnssMeasurement.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
||||
|
||||
#include <android/hardware/gnss/2.1/IGnssMeasurement.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
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 V2_1::IGnssMeasurement {
|
||||
GnssMeasurement();
|
||||
~GnssMeasurement();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
* These declarations were generated from IGnssMeasurement.hal.
|
||||
*/
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||
const sp<V1_0::IGnssMeasurementCallback>& callback) override;
|
||||
Return<void> close() override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> setCallback_1_1(
|
||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) override;
|
||||
|
||||
// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow.
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> setCallback_2_0(
|
||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) override;
|
||||
// Methods from ::android::hardware::gnss::V2_1::IGnssMeasurement follow.
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> setCallback_2_1(
|
||||
const sp<::android::hardware::gnss::V2_1::IGnssMeasurementCallback>& callback,
|
||||
bool enableFullTracking) override;
|
||||
|
||||
private:
|
||||
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
|
||||
GnssMeasurementDeathRecipient(sp<GnssMeasurement> gnssMeasurement) :
|
||||
mGnssMeasurement(gnssMeasurement) {
|
||||
}
|
||||
~GnssMeasurementDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssMeasurement> mGnssMeasurement;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
sp<V2_0::IGnssMeasurementCallback> mGnssMeasurementCbIface_2_0 = nullptr;
|
||||
sp<V2_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_2_1 = nullptr;
|
||||
MeasurementAPIClient* mApi;
|
||||
void clearInterfaces();
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
||||
85
gps/android/2.1/GnssNi.cpp
Normal file
85
gps/android/2.1/GnssNi.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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_GnssNiInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssNi.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssNi::GnssNiDeathRecipient::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);
|
||||
// we do nothing here
|
||||
// Gnss::GnssDeathRecipient will stop the session
|
||||
}
|
||||
|
||||
GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) {
|
||||
mGnssNiDeathRecipient = new GnssNiDeathRecipient(this);
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
if (mGnssNiCbIface != nullptr) {
|
||||
mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient);
|
||||
}
|
||||
mGnssNiCbIface = callback;
|
||||
if (mGnssNiCbIface != nullptr) {
|
||||
mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
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 V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
75
gps/android/2.1/GnssNi.h
Normal file
75
gps/android/2.1/GnssNi.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssNi.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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:
|
||||
struct GnssNiDeathRecipient : hidl_death_recipient {
|
||||
GnssNiDeathRecipient(sp<GnssNi> gnssNi) : mGnssNi(gnssNi) {
|
||||
}
|
||||
~GnssNiDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssNi> mGnssNi;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssNiDeathRecipient> mGnssNiDeathRecipient = nullptr;
|
||||
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H
|
||||
169
gps/android/2.1/GnssVisibilityControl.cpp
Normal file
169
gps/android/2.1/GnssVisibilityControl.cpp
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <android/hardware/gnss/visibility_control/1.0/IGnssVisibilityControl.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
#include "GnssVisibilityControl.h"
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace visibility_control {
|
||||
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;
|
||||
|
||||
static GnssVisibilityControl* spGnssVisibilityControl = nullptr;
|
||||
|
||||
static void convertGnssNfwNotification(GnssNfwNotification& in,
|
||||
IGnssVisibilityControlCallback::NfwNotification& out);
|
||||
|
||||
GnssVisibilityControl::GnssVisibilityControl(Gnss* gnss) : mGnss(gnss) {
|
||||
spGnssVisibilityControl = this;
|
||||
}
|
||||
GnssVisibilityControl::~GnssVisibilityControl() {
|
||||
spGnssVisibilityControl = nullptr;
|
||||
}
|
||||
|
||||
void GnssVisibilityControl::nfwStatusCb(GnssNfwNotification notification) {
|
||||
if (nullptr != spGnssVisibilityControl) {
|
||||
spGnssVisibilityControl->statusCb(notification);
|
||||
}
|
||||
}
|
||||
|
||||
bool GnssVisibilityControl::isInEmergencySession() {
|
||||
if (nullptr != spGnssVisibilityControl) {
|
||||
return spGnssVisibilityControl->isE911Session();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void convertGnssNfwNotification(GnssNfwNotification& in,
|
||||
IGnssVisibilityControlCallback::NfwNotification& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssVisibilityControlCallback::NfwNotification));
|
||||
out.proxyAppPackageName = in.proxyAppPackageName;
|
||||
out.protocolStack = (IGnssVisibilityControlCallback::NfwProtocolStack)in.protocolStack;
|
||||
out.otherProtocolStackName = in.otherProtocolStackName;
|
||||
out.requestor = (IGnssVisibilityControlCallback::NfwRequestor)in.requestor;
|
||||
out.requestorId = in.requestorId;
|
||||
out.responseType = (IGnssVisibilityControlCallback::NfwResponseType)in.responseType;
|
||||
out.inEmergencyMode = in.inEmergencyMode;
|
||||
out.isCachedLocation = in.isCachedLocation;
|
||||
}
|
||||
|
||||
void GnssVisibilityControl::statusCb(GnssNfwNotification notification) {
|
||||
|
||||
if (mGnssVisibilityControlCbIface != nullptr) {
|
||||
IGnssVisibilityControlCallback::NfwNotification nfwNotification;
|
||||
|
||||
// Convert from one structure to another
|
||||
convertGnssNfwNotification(notification, nfwNotification);
|
||||
|
||||
auto r = mGnssVisibilityControlCbIface->nfwNotifyCb(nfwNotification);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error invoking NFW status cb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
}
|
||||
}
|
||||
|
||||
bool GnssVisibilityControl::isE911Session() {
|
||||
|
||||
if (mGnssVisibilityControlCbIface != nullptr) {
|
||||
auto r = mGnssVisibilityControlCbIface->isInEmergencySession();
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error invoking NFW status cb %s", r.description().c_str());
|
||||
return false;
|
||||
} else {
|
||||
return (r);
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow.
|
||||
Return<bool> GnssVisibilityControl::enableNfwLocationAccess(const hidl_vec<::android::hardware::hidl_string>& proxyApps) {
|
||||
|
||||
if (nullptr == mGnss || nullptr == mGnss->getGnssInterface()) {
|
||||
LOC_LOGe("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If the vector is empty we need to disable all NFW clients
|
||||
If there is at least one app in the vector we need to enable
|
||||
all NFW clients */
|
||||
if (0 == proxyApps.size()) {
|
||||
mGnss->getGnssInterface()->enableNfwLocationAccess(false);
|
||||
} else {
|
||||
mGnss->getGnssInterface()->enableNfwLocationAccess(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Registers the callback for HAL implementation to use.
|
||||
*
|
||||
* @param callback Handle to IGnssVisibilityControlCallback interface.
|
||||
*/
|
||||
Return<bool> GnssVisibilityControl::setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) {
|
||||
|
||||
if (nullptr == mGnss || nullptr == mGnss->getGnssInterface()) {
|
||||
LOC_LOGe("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
mGnssVisibilityControlCbIface = callback;
|
||||
|
||||
NfwCbInfo cbInfo = {};
|
||||
cbInfo.visibilityControlCb = (void*)nfwStatusCb;
|
||||
cbInfo.isInEmergencySession = (void*)isInEmergencySession;
|
||||
|
||||
mGnss->getGnssInterface()->nfwInit(cbInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace visibility_control
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
90
gps/android/2.1/GnssVisibilityControl.h
Normal file
90
gps/android/2.1/GnssVisibilityControl.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GnssVisibilityControl_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_GnssVisibilityControl_H
|
||||
|
||||
#include <android/hardware/gnss/visibility_control/1.0/IGnssVisibilityControl.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <gps_extended_c.h>
|
||||
#include <location_interface.h>
|
||||
#include "Gnss.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace visibility_control {
|
||||
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::V2_1::implementation::Gnss;
|
||||
|
||||
struct GnssVisibilityControl : public IGnssVisibilityControl {
|
||||
GnssVisibilityControl(Gnss* gnss);
|
||||
~GnssVisibilityControl();
|
||||
|
||||
// Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow.
|
||||
Return<bool> enableNfwLocationAccess(const hidl_vec<::android::hardware::hidl_string>& proxyApps) override;
|
||||
/**
|
||||
* Registers the callback for HAL implementation to use.
|
||||
*
|
||||
* @param callback Handle to IGnssVisibilityControlCallback interface.
|
||||
*/
|
||||
Return<bool> setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) override;
|
||||
|
||||
void statusCb(GnssNfwNotification notification);
|
||||
bool isE911Session();
|
||||
|
||||
/* Data call setup callback passed down to GNSS HAL implementation */
|
||||
static void nfwStatusCb(GnssNfwNotification notification);
|
||||
static bool isInEmergencySession();
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
sp<IGnssVisibilityControlCallback> mGnssVisibilityControlCbIface = nullptr;
|
||||
};
|
||||
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace visibility_control
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_GnssVisibilityControl_H
|
||||
199
gps/android/2.1/MeasurementCorrections.cpp
Normal file
199
gps/android/2.1/MeasurementCorrections.cpp
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* Copyright (c) 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_TAG "LocSvc_MeasurementCorrectionsInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "MeasurementCorrections.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace measurement_corrections {
|
||||
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::measurement_corrections::V1_0::IMeasurementCorrectionsCallback;
|
||||
using ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrections;
|
||||
using MeasurementCorrectionsV1_0 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections;
|
||||
using MeasurementCorrectionsV1_1 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_1::MeasurementCorrections;
|
||||
|
||||
static MeasurementCorrections* spMeasurementCorrections = nullptr;
|
||||
|
||||
void MeasurementCorrections::GnssMeasurementCorrectionsDeathRecipient::serviceDied(uint64_t cookie,
|
||||
const wp<IBase>& who) {
|
||||
LOC_LOGe("service died. cookie: %llu, who: %p", static_cast<unsigned long long>(cookie), &who);
|
||||
// Gnss::GnssDeathrecipient will stop the session
|
||||
// we inform the adapter that service has died
|
||||
if (nullptr == spMeasurementCorrections) {
|
||||
LOC_LOGe("spMeasurementCorrections is nullptr");
|
||||
return;
|
||||
}
|
||||
if (nullptr == spMeasurementCorrections->mGnss ||
|
||||
nullptr == spMeasurementCorrections->mGnss->getGnssInterface()) {
|
||||
LOC_LOGe("Null GNSS interface");
|
||||
return;
|
||||
}
|
||||
spMeasurementCorrections->mGnss->getGnssInterface()->measCorrClose();
|
||||
}
|
||||
|
||||
MeasurementCorrections::MeasurementCorrections(Gnss* gnss) : mGnss(gnss) {
|
||||
mGnssMeasurementCorrectionsDeathRecipient = new GnssMeasurementCorrectionsDeathRecipient(this);
|
||||
spMeasurementCorrections = this;
|
||||
}
|
||||
|
||||
MeasurementCorrections::~MeasurementCorrections() {
|
||||
spMeasurementCorrections = nullptr;
|
||||
}
|
||||
|
||||
void MeasurementCorrections::measCorrSetCapabilitiesCb(
|
||||
GnssMeasurementCorrectionsCapabilitiesMask capabilities) {
|
||||
if (nullptr != spMeasurementCorrections) {
|
||||
spMeasurementCorrections->setCapabilitiesCb(capabilities);
|
||||
}
|
||||
}
|
||||
|
||||
void MeasurementCorrections::setCapabilitiesCb(
|
||||
GnssMeasurementCorrectionsCapabilitiesMask capabilities) {
|
||||
|
||||
if (mMeasurementCorrectionsCbIface != nullptr) {
|
||||
uint32_t measCorrCapabilities = 0;
|
||||
|
||||
// Convert from one enum to another
|
||||
if (capabilities & GNSS_MEAS_CORR_LOS_SATS) {
|
||||
measCorrCapabilities |=
|
||||
IMeasurementCorrectionsCallback::Capabilities::LOS_SATS;
|
||||
}
|
||||
if (capabilities & GNSS_MEAS_CORR_EXCESS_PATH_LENGTH) {
|
||||
measCorrCapabilities |=
|
||||
IMeasurementCorrectionsCallback::Capabilities::EXCESS_PATH_LENGTH;
|
||||
}
|
||||
if (capabilities & GNSS_MEAS_CORR_REFLECTING_PLANE) {
|
||||
measCorrCapabilities |=
|
||||
IMeasurementCorrectionsCallback::Capabilities::REFLECTING_PLANE;
|
||||
}
|
||||
|
||||
auto r = mMeasurementCorrectionsCbIface->setCapabilitiesCb(measCorrCapabilities);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error invoking setCapabilitiesCb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
}
|
||||
}
|
||||
|
||||
Return<bool> MeasurementCorrections::setCorrections(
|
||||
const MeasurementCorrectionsV1_0& corrections) {
|
||||
|
||||
GnssMeasurementCorrections gnssMeasurementCorrections = {};
|
||||
|
||||
V2_1::implementation::convertMeasurementCorrections(corrections, gnssMeasurementCorrections);
|
||||
|
||||
return mGnss->getGnssInterface()->measCorrSetCorrections(gnssMeasurementCorrections);
|
||||
}
|
||||
|
||||
Return<bool> MeasurementCorrections::setCorrections_1_1(
|
||||
const MeasurementCorrectionsV1_1& corrections) {
|
||||
|
||||
GnssMeasurementCorrections gnssMeasurementCorrections = {};
|
||||
|
||||
V2_1::implementation::convertMeasurementCorrections(
|
||||
corrections.v1_0, gnssMeasurementCorrections);
|
||||
|
||||
gnssMeasurementCorrections.hasEnvironmentBearing = corrections.hasEnvironmentBearing;
|
||||
gnssMeasurementCorrections.environmentBearingDegrees =
|
||||
corrections.environmentBearingDegrees;
|
||||
gnssMeasurementCorrections.environmentBearingUncertaintyDegrees =
|
||||
corrections.environmentBearingUncertaintyDegrees;
|
||||
|
||||
for (int i = 0; i < corrections.satCorrections.size(); i++) {
|
||||
GnssSingleSatCorrection gnssSingleSatCorrection = {};
|
||||
|
||||
V2_1::implementation::convertSingleSatCorrections(
|
||||
corrections.satCorrections[i].v1_0, gnssSingleSatCorrection);
|
||||
switch (corrections.satCorrections[i].constellation) {
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::GPS):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_GPS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::SBAS):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_SBAS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::GLONASS):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_GLONASS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::QZSS):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_QZSS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::BEIDOU):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_BEIDOU;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::GALILEO):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_GALILEO;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::IRNSS):
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_NAVIC;
|
||||
break;
|
||||
case (::android::hardware::gnss::V2_0::GnssConstellationType::UNKNOWN):
|
||||
default:
|
||||
gnssSingleSatCorrection.svType = GNSS_SV_TYPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
gnssMeasurementCorrections.satCorrections.push_back(gnssSingleSatCorrection);
|
||||
}
|
||||
|
||||
return mGnss->getGnssInterface()->measCorrSetCorrections(gnssMeasurementCorrections);
|
||||
}
|
||||
|
||||
Return<bool> MeasurementCorrections::setCallback(
|
||||
const sp<V1_0::IMeasurementCorrectionsCallback>& callback) {
|
||||
|
||||
if (nullptr == mGnss || nullptr == mGnss->getGnssInterface()) {
|
||||
LOC_LOGe("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
mMeasurementCorrectionsCbIface = callback;
|
||||
|
||||
return mGnss->getGnssInterface()->measCorrInit(measCorrSetCapabilitiesCb);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace measurement_corrections
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
106
gps/android/2.1/MeasurementCorrections.h
Normal file
106
gps/android/2.1/MeasurementCorrections.h
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_MeasurementCorrections_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_MeasurementCorrections_H
|
||||
|
||||
#include <android/hardware/gnss/measurement_corrections/1.1/IMeasurementCorrections.h>
|
||||
#include <android/hardware/gnss/measurement_corrections/1.0/IMeasurementCorrectionsCallback.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <gps_extended_c.h>
|
||||
#include <location_interface.h>
|
||||
#include "Gnss.h"
|
||||
#include <LocationUtil.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace measurement_corrections {
|
||||
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;
|
||||
using ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrectionsCallback;
|
||||
using ::android::hardware::gnss::V2_1::implementation::Gnss;
|
||||
using MeasurementCorrectionsV1_0 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections;
|
||||
using MeasurementCorrectionsV1_1 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_1::MeasurementCorrections;
|
||||
|
||||
struct MeasurementCorrections : public V1_1::IMeasurementCorrections {
|
||||
MeasurementCorrections(Gnss* gnss);
|
||||
~MeasurementCorrections();
|
||||
|
||||
Return<bool> setCorrections(const MeasurementCorrectionsV1_0& corrections) override;
|
||||
|
||||
// Methods from
|
||||
// ::android::hardware::gnss::measurement_corrections::V1_1::IMeasurementCorrections follow.
|
||||
Return<bool> setCorrections_1_1(const MeasurementCorrectionsV1_1& corrections);
|
||||
|
||||
Return<bool> setCallback(const sp<IMeasurementCorrectionsCallback>& callback) override;
|
||||
|
||||
void setCapabilitiesCb(GnssMeasurementCorrectionsCapabilitiesMask capabilities);
|
||||
|
||||
/* Data call setup callback passed down to GNSS HAL implementation */
|
||||
static void measCorrSetCapabilitiesCb(GnssMeasurementCorrectionsCapabilitiesMask capabilities);
|
||||
|
||||
private:
|
||||
struct GnssMeasurementCorrectionsDeathRecipient : hidl_death_recipient {
|
||||
GnssMeasurementCorrectionsDeathRecipient(
|
||||
sp<MeasurementCorrections> gnssMeasurementCorrections) :
|
||||
mGnssMeasurementCorrections(gnssMeasurementCorrections) {
|
||||
}
|
||||
~GnssMeasurementCorrectionsDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<MeasurementCorrections> mGnssMeasurementCorrections;
|
||||
};
|
||||
Gnss* mGnss = nullptr;
|
||||
sp<GnssMeasurementCorrectionsDeathRecipient> mGnssMeasurementCorrectionsDeathRecipient =
|
||||
nullptr;
|
||||
sp<IMeasurementCorrectionsCallback> mMeasurementCorrectionsCbIface = nullptr;
|
||||
};
|
||||
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace measurement_corrections
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_MeasurementCorrections_H
|
||||
4
gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc
Normal file
4
gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti
|
||||
class hal
|
||||
user gps
|
||||
group system gps radio vendor_qti_diag
|
||||
36
gps/android/2.1/android.hardware.gnss@2.1-service-qti.xml
Executable file
36
gps/android/2.1/android.hardware.gnss@2.1-service-qti.xml
Executable file
@@ -0,0 +1,36 @@
|
||||
<!-- Copyright (c) 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.
|
||||
-->
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gnss</name>
|
||||
<transport>hwbinder</transport>
|
||||
<fqname>@1.1::IGnss/default</fqname>
|
||||
<fqname>@2.1::IGnss/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
||||
292
gps/android/2.1/location_api/BatchingAPIClient.cpp
Normal file
292
gps/android/2.1/location_api/BatchingAPIClient.cpp
Normal file
@@ -0,0 +1,292 @@
|
||||
/* Copyright (c) 2017-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.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_BatchingAPIClient"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
#include <thread>
|
||||
#include "LocationUtil.h"
|
||||
#include "BatchingAPIClient.h"
|
||||
|
||||
#include "limits.h"
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V2_0::IGnssBatchingCallback;
|
||||
using ::android::hardware::gnss::V2_0::GnssLocation;
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask);
|
||||
|
||||
BatchingAPIClient::BatchingAPIClient(const sp<V1_0::IGnssBatchingCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssBatchingCbIface(nullptr),
|
||||
mDefaultId(UINT_MAX),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mGnssBatchingCbIface_2_0(nullptr)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
gnssUpdateCallbacks(callback);
|
||||
}
|
||||
|
||||
BatchingAPIClient::BatchingAPIClient(const sp<V2_0::IGnssBatchingCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssBatchingCbIface(nullptr),
|
||||
mDefaultId(UINT_MAX),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mGnssBatchingCbIface_2_0(nullptr)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
gnssUpdateCallbacks_2_0(callback);
|
||||
}
|
||||
|
||||
BatchingAPIClient::~BatchingAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
int BatchingAPIClient::getBatchSize() {
|
||||
int batchSize = locAPIGetBatchSize();
|
||||
LOC_LOGd("batchSize: %d", batchSize);
|
||||
return batchSize;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::setCallbacks()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::gnssUpdateCallbacks(const sp<V1_0::IGnssBatchingCallback>& callback)
|
||||
{
|
||||
mMutex.lock();
|
||||
mGnssBatchingCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
setCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
void BatchingAPIClient::gnssUpdateCallbacks_2_0(const sp<V2_0::IGnssBatchingCallback>& callback)
|
||||
{
|
||||
mMutex.lock();
|
||||
mGnssBatchingCbIface_2_0 = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
if (mGnssBatchingCbIface_2_0 != nullptr) {
|
||||
setCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) {
|
||||
mMutex.lock();
|
||||
mState = STARTED;
|
||||
mMutex.unlock();
|
||||
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() {
|
||||
mMutex.lock();
|
||||
mState = STOPPING;
|
||||
mMutex.unlock();
|
||||
LOC_LOGD("%s]: ", __FUNCTION__);
|
||||
int retVal = -1;
|
||||
locAPIGetBatchedLocations(mDefaultId, SIZE_MAX);
|
||||
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__);
|
||||
uint32_t retVal = locAPIGetBatchedLocations(mDefaultId, SIZE_MAX);
|
||||
// when flush a stopped session or one doesn't exist, just report an empty batch.
|
||||
if (LOCATION_ERROR_ID_UNKNOWN == retVal) {
|
||||
BatchingOptions opt = {};
|
||||
::std::thread thd(&BatchingAPIClient::onBatchingCb, this, 0, nullptr, opt);
|
||||
thd.detach();
|
||||
}
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onBatchingCb(size_t count, Location* location,
|
||||
BatchingOptions /*batchOptions*/) {
|
||||
bool processReport = false;
|
||||
LOC_LOGd("(count: %zu)", count);
|
||||
mMutex.lock();
|
||||
// back to back stop() and flush() could bring twice onBatchingCb(). Each one might come first.
|
||||
// Combine them both (the first goes to cache, the second in location*) before report to FW
|
||||
switch (mState) {
|
||||
case STOPPING:
|
||||
mState = STOPPED;
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
mBatchedLocationInCache.push_back(location[i]);
|
||||
}
|
||||
break;
|
||||
case STARTED:
|
||||
case STOPPED: // flush() always trigger report, even on a stopped session
|
||||
processReport = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// report location batch when in STARTED state or flush(), combined with cache in last stop()
|
||||
if (processReport) {
|
||||
auto gnssBatchingCbIface(mGnssBatchingCbIface);
|
||||
auto gnssBatchingCbIface_2_0(mGnssBatchingCbIface_2_0);
|
||||
size_t batchCacheCnt = mBatchedLocationInCache.size();
|
||||
LOC_LOGd("(batchCacheCnt: %zu)", batchCacheCnt);
|
||||
if (gnssBatchingCbIface_2_0 != nullptr) {
|
||||
hidl_vec<V2_0::GnssLocation> locationVec;
|
||||
if (count+batchCacheCnt > 0) {
|
||||
locationVec.resize(count+batchCacheCnt);
|
||||
for (size_t i = 0; i < batchCacheCnt; ++i) {
|
||||
convertGnssLocation(mBatchedLocationInCache[i], locationVec[i]);
|
||||
}
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
convertGnssLocation(location[i], locationVec[i+batchCacheCnt]);
|
||||
}
|
||||
}
|
||||
auto r = gnssBatchingCbIface_2_0->gnssLocationBatchCb(locationVec);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationBatchCb 2_0 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssBatchingCbIface != nullptr) {
|
||||
hidl_vec<V1_0::GnssLocation> locationVec;
|
||||
if (count+batchCacheCnt > 0) {
|
||||
locationVec.resize(count+batchCacheCnt);
|
||||
for (size_t i = 0; i < batchCacheCnt; ++i) {
|
||||
convertGnssLocation(mBatchedLocationInCache[i], locationVec[i]);
|
||||
}
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
convertGnssLocation(location[i], locationVec[i+batchCacheCnt]);
|
||||
}
|
||||
}
|
||||
auto r = gnssBatchingCbIface->gnssLocationBatchCb(locationVec);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationBatchCb 1.0 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
mBatchedLocationInCache.clear();
|
||||
}
|
||||
mMutex.unlock();
|
||||
}
|
||||
|
||||
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 V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
88
gps/android/2.1/location_api/BatchingAPIClient.h
Executable file
88
gps/android/2.1/location_api/BatchingAPIClient.h
Executable file
@@ -0,0 +1,88 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BATCHING_API_CLINET_H
|
||||
#define BATCHING_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/2.0/IGnssBatching.h>
|
||||
#include <android/hardware/gnss/2.0/IGnssBatchingCallback.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
enum BATCHING_STATE { STARTED, STOPPING, STOPPED };
|
||||
|
||||
class BatchingAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
BatchingAPIClient(const sp<V1_0::IGnssBatchingCallback>& callback);
|
||||
BatchingAPIClient(const sp<V2_0::IGnssBatchingCallback>& callback);
|
||||
void gnssUpdateCallbacks(const sp<V1_0::IGnssBatchingCallback>& callback);
|
||||
void gnssUpdateCallbacks_2_0(const sp<V2_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();
|
||||
|
||||
void setCallbacks();
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssBatchingCallback> mGnssBatchingCbIface;
|
||||
uint32_t mDefaultId;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
sp<V2_0::IGnssBatchingCallback> mGnssBatchingCbIface_2_0;
|
||||
volatile BATCHING_STATE mState = STOPPED;
|
||||
|
||||
std::vector<Location> mBatchedLocationInCache;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // BATCHING_API_CLINET_H
|
||||
275
gps/android/2.1/location_api/GeofenceAPIClient.cpp
Executable file
275
gps/android/2.1/location_api/GeofenceAPIClient.cpp
Executable file
@@ -0,0 +1,275 @@
|
||||
/* 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_GeofenceApiClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GeofenceAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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;
|
||||
if (mGnssGeofencingCbIface != 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::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__);
|
||||
// TODO locAPIRemoveAllGeofences();
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceBreachNotification.count);
|
||||
if (mGnssGeofencingCbIface != 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 = mGnssGeofencingCbIface->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);
|
||||
if (mGnssGeofencingCbIface != 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 = mGnssGeofencingCbIface->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);
|
||||
if (mGnssGeofencingCbIface != 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 = mGnssGeofencingCbIface->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);
|
||||
if (mGnssGeofencingCbIface != 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 = mGnssGeofencingCbIface->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);
|
||||
if (mGnssGeofencingCbIface != 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 = mGnssGeofencingCbIface->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);
|
||||
if (mGnssGeofencingCbIface != 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 = mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
77
gps/android/2.1/location_api/GeofenceAPIClient.h
Executable file
77
gps/android/2.1/location_api/GeofenceAPIClient.h
Executable file
@@ -0,0 +1,77 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GEOFENCE_API_CLINET_H
|
||||
#define GEOFENCE_API_CLINET_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofenceCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GeofenceAPIClient(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;
|
||||
|
||||
sp<V1_0::IGnssGeofenceCallback> mGnssGeofencingCbIface;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GEOFENCE_API_CLINET_H
|
||||
864
gps/android/2.1/location_api/GnssAPIClient.cpp
Normal file
864
gps/android/2.1/location_api/GnssAPIClient.cpp
Normal file
@@ -0,0 +1,864 @@
|
||||
/* 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 V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_1::IGnss;
|
||||
using ::android::hardware::gnss::V2_1::IGnssCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
|
||||
using ::android::hardware::gnss::V2_0::GnssLocation;
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, V1_0::IGnssCallback::GnssSvStatus& out);
|
||||
static void convertGnssSvStatus(GnssSvNotification& in,
|
||||
hidl_vec<V2_0::IGnssCallback::GnssSvInfo>& out);
|
||||
static void convertGnssSvStatus(GnssSvNotification& in,
|
||||
hidl_vec<V2_1::IGnssCallback::GnssSvInfo>& out);
|
||||
|
||||
GnssAPIClient::GnssAPIClient(const sp<V1_0::IGnssCallback>& gpsCb,
|
||||
const sp<V1_0::IGnssNiCallback>& niCb) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssCbIface(nullptr),
|
||||
mGnssNiCbIface(nullptr),
|
||||
mControlClient(new LocationAPIControlClient()),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mLocationCapabilitiesCached(false),
|
||||
mTracking(false),
|
||||
mGnssCbIface_2_0(nullptr)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
initLocationOptions();
|
||||
gnssUpdateCallbacks(gpsCb, niCb);
|
||||
}
|
||||
|
||||
GnssAPIClient::GnssAPIClient(const sp<V2_0::IGnssCallback>& gpsCb) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssCbIface(nullptr),
|
||||
mGnssNiCbIface(nullptr),
|
||||
mControlClient(new LocationAPIControlClient()),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mLocationCapabilitiesCached(false),
|
||||
mTracking(false),
|
||||
mGnssCbIface_2_0(nullptr)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb);
|
||||
|
||||
initLocationOptions();
|
||||
gnssUpdateCallbacks_2_0(gpsCb);
|
||||
}
|
||||
|
||||
GnssAPIClient::GnssAPIClient(const sp<V2_1::IGnssCallback>& gpsCb) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssCbIface(nullptr),
|
||||
mGnssNiCbIface(nullptr),
|
||||
mControlClient(new LocationAPIControlClient()),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mLocationCapabilitiesCached(false),
|
||||
mTracking(false),
|
||||
mGnssCbIface_2_1(nullptr)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb);
|
||||
|
||||
initLocationOptions();
|
||||
gnssUpdateCallbacks_2_1(gpsCb);
|
||||
}
|
||||
|
||||
GnssAPIClient::~GnssAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient) {
|
||||
delete mControlClient;
|
||||
mControlClient = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::initLocationOptions()
|
||||
{
|
||||
// set default LocationOptions.
|
||||
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
||||
mTrackingOptions.size = sizeof(TrackingOptions);
|
||||
mTrackingOptions.minInterval = 1000;
|
||||
mTrackingOptions.minDistance = 0;
|
||||
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
}
|
||||
|
||||
void GnssAPIClient::setCallbacks()
|
||||
{
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.trackingCb = [this](Location location) {
|
||||
onTrackingCb(location);
|
||||
};
|
||||
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
if (mGnssNiCbIface != nullptr) {
|
||||
loc_core::ContextBase* context =
|
||||
loc_core::LocContext::getLocContext(loc_core::LocContext::mLocationHalName);
|
||||
if (!context->hasAgpsExtendedCapabilities()) {
|
||||
LOC_LOGD("Registering NI CB");
|
||||
locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotify) {
|
||||
onGnssNiCb(id, gnssNiNotify);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) {
|
||||
onGnssSvCb(gnssSvNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) {
|
||||
onGnssNmeaCb(gnssNmeaNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
void GnssAPIClient::gnssUpdateCallbacks(const sp<V1_0::IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssCbIface = gpsCb;
|
||||
mGnssNiCbIface = niCb;
|
||||
mMutex.unlock();
|
||||
|
||||
if (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr) {
|
||||
setCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssUpdateCallbacks_2_0(const sp<V2_0::IGnssCallback>& gpsCb)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssCbIface_2_0 = gpsCb;
|
||||
mMutex.unlock();
|
||||
|
||||
if (mGnssCbIface_2_0 != nullptr) {
|
||||
setCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssUpdateCallbacks_2_1(const sp<V2_1::IGnssCallback>& gpsCb)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssCbIface_2_1 = gpsCb;
|
||||
mMutex.unlock();
|
||||
|
||||
if (mGnssCbIface_2_1 != nullptr) {
|
||||
setCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStart()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
|
||||
mMutex.lock();
|
||||
mTracking = true;
|
||||
mMutex.unlock();
|
||||
|
||||
bool retVal = true;
|
||||
locAPIStartTracking(mTrackingOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStop()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
|
||||
mMutex.lock();
|
||||
mTracking = false;
|
||||
mMutex.unlock();
|
||||
|
||||
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 |
|
||||
GNSS_AIDING_DATA_SV_TYPE_NAVIC_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);
|
||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||
auto gnssCbIface_2_1(mGnssCbIface_2_1);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface_2_1 != nullptr ||gnssCbIface_2_0 != nullptr || gnssCbIface != nullptr) {
|
||||
|
||||
uint32_t antennaInfoVectorSize = 0;
|
||||
uint32_t data = 0;
|
||||
loc_param_s_type ant_info_vector_table[] =
|
||||
{
|
||||
{ "ANTENNA_INFO_VECTOR_SIZE", &antennaInfoVectorSize, NULL, 'n' }
|
||||
};
|
||||
UTIL_READ_CONF(LOC_PATH_ANT_CORR, ant_info_vector_table);
|
||||
|
||||
if (0 != antennaInfoVectorSize) {
|
||||
data |= V2_1::IGnssCallback::Capabilities::ANTENNA_INFO;
|
||||
}
|
||||
|
||||
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 |= V1_0::IGnssCallback::Capabilities::GEOFENCING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT)
|
||||
data |= V1_0::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;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT)
|
||||
data |= IGnssCallback::Capabilities::LOW_POWER_MODE;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT)
|
||||
data |= IGnssCallback::Capabilities::SATELLITE_BLACKLIST;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT)
|
||||
data |= V2_0::IGnssCallback::Capabilities::MEASUREMENT_CORRECTIONS;
|
||||
|
||||
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
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_PRIVACY_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2019
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT) {
|
||||
gnssInfo.yearOfHw++; // 2020
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw);
|
||||
|
||||
if (gnssCbIface_2_1 != nullptr) {
|
||||
auto r = gnssCbIface_2_1->gnssSetCapabilitiesCb_2_1(data);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetCapabilitiesCb_2_1 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface_2_1->gnssSetSystemInfoCb(gnssInfo);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface_2_0 != nullptr) {
|
||||
auto r = gnssCbIface_2_0->gnssSetCapabilitiesCb_2_0(data);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetCapabilitiesCb_2_0 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface_2_0->gnssSetSystemInfoCb(gnssInfo);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssSetCapabilitesCb(data);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
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)
|
||||
{
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||
auto gnssCbIface_2_1(mGnssCbIface_2_1);
|
||||
bool isTracking = mTracking;
|
||||
mMutex.unlock();
|
||||
|
||||
LOC_LOGD("%s]: (flags: %02x isTracking: %d)", __FUNCTION__, location.flags, isTracking);
|
||||
|
||||
if (!isTracking) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gnssCbIface_2_1 != nullptr) {
|
||||
V2_0::GnssLocation gnssLocation;
|
||||
convertGnssLocation(location, gnssLocation);
|
||||
auto r = gnssCbIface_2_1->gnssLocationCb_2_0(gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationCb_2_0 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface_2_0 != nullptr) {
|
||||
V2_0::GnssLocation gnssLocation;
|
||||
convertGnssLocation(location, gnssLocation);
|
||||
auto r = gnssCbIface_2_0->gnssLocationCb_2_0(gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationCb_2_0 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface != nullptr) {
|
||||
V1_0::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());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGW("%s] No GNSS Interface ready for gnssLocationCb ", __FUNCTION__);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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: %u)", __FUNCTION__, gnssSvNotification.count);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||
auto gnssCbIface_2_1(mGnssCbIface_2_1);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface_2_1 != nullptr) {
|
||||
hidl_vec<V2_1::IGnssCallback::GnssSvInfo> svInfoList;
|
||||
convertGnssSvStatus(gnssSvNotification, svInfoList);
|
||||
auto r = gnssCbIface_2_1->gnssSvStatusCb_2_1(svInfoList);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSvStatusCb_2_1 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface_2_0 != nullptr) {
|
||||
hidl_vec<V2_0::IGnssCallback::GnssSvInfo> svInfoList;
|
||||
convertGnssSvStatus(gnssSvNotification, svInfoList);
|
||||
auto r = gnssCbIface_2_0->gnssSvStatusCb_2_0(svInfoList);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSvStatusCb_2_0 description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface != nullptr) {
|
||||
V1_0::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);
|
||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||
auto gnssCbIface_2_1(mGnssCbIface_2_1);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr || gnssCbIface_2_0 != nullptr || gnssCbIface_2_1 != 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());
|
||||
if (gnssCbIface_2_1 != nullptr) {
|
||||
auto r = gnssCbIface_2_1->gnssNmeaCb(
|
||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssCbIface_2_1 nmea=%s length=%u description=%s",
|
||||
__func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length,
|
||||
r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface_2_0 != nullptr) {
|
||||
auto r = gnssCbIface_2_0->gnssNmeaCb(
|
||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssCbIface_2_0 nmea=%s length=%u description=%s",
|
||||
__func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length,
|
||||
r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssNmeaCb(
|
||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%u 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);
|
||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||
auto gnssCbIface_2_1(mGnssCbIface_2_1);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS) {
|
||||
if (gnssCbIface_2_1 != nullptr) {
|
||||
auto r = gnssCbIface_2_1->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 ENGINE_ON description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface_2_1->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 SESSION_BEGIN description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface_2_0 != nullptr) {
|
||||
auto r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 ENGINE_ON description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 SESSION_BEGIN description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (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);
|
||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||
auto gnssCbIface_2_1(mGnssCbIface_2_1);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS) {
|
||||
if (gnssCbIface_2_1 != nullptr) {
|
||||
auto r = gnssCbIface_2_1->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 SESSION_END description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface_2_1->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 ENGINE_OFF description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssCbIface_2_0 != nullptr) {
|
||||
auto r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 SESSION_END description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb 2_0 ENGINE_OFF description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
|
||||
} else if (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, V1_0::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++) {
|
||||
convertGnssSvid(in.gnssSvs[i], out.gnssSvList[i].svid);
|
||||
convertGnssConstellationType(in.gnssSvs[i].type, out.gnssSvList[i].constellation);
|
||||
out.gnssSvList[i].cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
|
||||
out.gnssSvList[i].elevationDegrees = in.gnssSvs[i].elevation;
|
||||
out.gnssSvList[i].azimuthDegrees = in.gnssSvs[i].azimuth;
|
||||
out.gnssSvList[i].carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz;
|
||||
out.gnssSvList[i].svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
|
||||
out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
|
||||
out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
|
||||
out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT)
|
||||
out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY;
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in,
|
||||
hidl_vec<V2_0::IGnssCallback::GnssSvInfo>& out)
|
||||
{
|
||||
out.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
convertGnssSvid(in.gnssSvs[i], out[i].v1_0.svid);
|
||||
out[i].v1_0.cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
|
||||
out[i].v1_0.elevationDegrees = in.gnssSvs[i].elevation;
|
||||
out[i].v1_0.azimuthDegrees = in.gnssSvs[i].azimuth;
|
||||
out[i].v1_0.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz;
|
||||
out[i].v1_0.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
|
||||
out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
|
||||
out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
|
||||
out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT)
|
||||
out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY;
|
||||
|
||||
convertGnssConstellationType(in.gnssSvs[i].type, out[i].constellation);
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in,
|
||||
hidl_vec<V2_1::IGnssCallback::GnssSvInfo>& out)
|
||||
{
|
||||
out.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
convertGnssSvid(in.gnssSvs[i], out[i].v2_0.v1_0.svid);
|
||||
out[i].v2_0.v1_0.cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
|
||||
out[i].v2_0.v1_0.elevationDegrees = in.gnssSvs[i].elevation;
|
||||
out[i].v2_0.v1_0.azimuthDegrees = in.gnssSvs[i].azimuth;
|
||||
out[i].v2_0.v1_0.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz;
|
||||
out[i].v2_0.v1_0.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
|
||||
out[i].v2_0.v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
|
||||
out[i].v2_0.v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
|
||||
out[i].v2_0.v1_0.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT)
|
||||
out[i].v2_0.v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY;
|
||||
|
||||
convertGnssConstellationType(in.gnssSvs[i].type, out[i].v2_0.constellation);
|
||||
out[i].basebandCN0DbHz = in.gnssSvs[i].basebandCarrierToNoiseDbHz;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
118
gps/android/2.1/location_api/GnssAPIClient.h
Executable file
118
gps/android/2.1/location_api/GnssAPIClient.h
Executable file
@@ -0,0 +1,118 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GNSS_API_CLINET_H
|
||||
#define GNSS_API_CLINET_H
|
||||
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/2.1/IGnss.h>
|
||||
#include <android/hardware/gnss/2.1/IGnssCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_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 sp<V2_0::IGnssCallback>& gpsCb);
|
||||
GnssAPIClient(const sp<V2_1::IGnssCallback>& gpsCb);
|
||||
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);
|
||||
void gnssUpdateCallbacks_2_0(const sp<V2_0::IGnssCallback>& gpsCb);
|
||||
void gnssUpdateCallbacks_2_1(const sp<V2_1::IGnssCallback>& gpsCb);
|
||||
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();
|
||||
void setCallbacks();
|
||||
void initLocationOptions();
|
||||
|
||||
sp<V1_0::IGnssCallback> mGnssCbIface;
|
||||
sp<V1_0::IGnssNiCallback> mGnssNiCbIface;
|
||||
std::mutex mMutex;
|
||||
LocationAPIControlClient* mControlClient;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
bool mLocationCapabilitiesCached;
|
||||
TrackingOptions mTrackingOptions;
|
||||
bool mTracking;
|
||||
sp<V2_0::IGnssCallback> mGnssCbIface_2_0;
|
||||
sp<V2_1::IGnssCallback> mGnssCbIface_2_1;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GNSS_API_CLINET_H
|
||||
405
gps/android/2.1/location_api/LocationUtil.cpp
Normal file
405
gps/android/2.1/location_api/LocationUtil.cpp
Normal file
@@ -0,0 +1,405 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <LocationUtil.h>
|
||||
#include <log_util.h>
|
||||
#include <inttypes.h>
|
||||
#include <loc_misc_utils.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V2_0::GnssLocation;
|
||||
using ::android::hardware::gnss::V2_0::ElapsedRealtimeFlags;
|
||||
using ::android::hardware::gnss::V2_0::GnssConstellationType;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocationFlags;
|
||||
using ::android::hardware::gnss::measurement_corrections::V1_0::GnssSingleSatCorrectionFlags;
|
||||
|
||||
void convertGnssLocation(Location& in, V1_0::GnssLocation& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(V1_0::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(Location& in, V2_0::GnssLocation& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(V2_0::GnssLocation));
|
||||
convertGnssLocation(in, out.v1_0);
|
||||
|
||||
if (in.flags & LOCATION_HAS_ELAPSED_REAL_TIME) {
|
||||
out.elapsedRealtime.flags |= ElapsedRealtimeFlags::HAS_TIMESTAMP_NS;
|
||||
out.elapsedRealtime.timestampNs = in.elapsedRealTime;
|
||||
out.elapsedRealtime.flags |= ElapsedRealtimeFlags::HAS_TIME_UNCERTAINTY_NS;
|
||||
out.elapsedRealtime.timeUncertaintyNs = in.elapsedRealTimeUnc;
|
||||
LOC_LOGd("out.elapsedRealtime.timestampNs=%" PRIi64 ""
|
||||
" out.elapsedRealtime.timeUncertaintyNs=%" PRIi64 ""
|
||||
" out.elapsedRealtime.flags=0x%X",
|
||||
out.elapsedRealtime.timestampNs,
|
||||
out.elapsedRealtime.timeUncertaintyNs, out.elapsedRealtime.flags);
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssLocation(const V1_0::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 convertGnssLocation(const V2_0::GnssLocation& in, Location& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
convertGnssLocation(in.v1_0, out);
|
||||
}
|
||||
|
||||
void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = V1_0::GnssConstellationType::GPS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = V1_0::GnssConstellationType::SBAS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
out = V1_0::GnssConstellationType::GLONASS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = V1_0::GnssConstellationType::QZSS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = V1_0::GnssConstellationType::BEIDOU;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = V1_0::GnssConstellationType::GALILEO;
|
||||
break;
|
||||
case GNSS_SV_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = V1_0::GnssConstellationType::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssConstellationType(GnssSvType& in, V2_0::GnssConstellationType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = V2_0::GnssConstellationType::GPS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = V2_0::GnssConstellationType::SBAS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
out = V2_0::GnssConstellationType::GLONASS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = V2_0::GnssConstellationType::QZSS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = V2_0::GnssConstellationType::BEIDOU;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = V2_0::GnssConstellationType::GALILEO;
|
||||
break;
|
||||
case GNSS_SV_TYPE_NAVIC:
|
||||
out = V2_0::GnssConstellationType::IRNSS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = V2_0::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;
|
||||
}
|
||||
}
|
||||
|
||||
void convertSingleSatCorrections(const SingleSatCorrection& in, GnssSingleSatCorrection& out)
|
||||
{
|
||||
out.flags = GNSS_MEAS_CORR_UNKNOWN_BIT;
|
||||
if (in.singleSatCorrectionFlags & (GnssSingleSatCorrectionFlags::HAS_SAT_IS_LOS_PROBABILITY)) {
|
||||
out.flags |= GNSS_MEAS_CORR_HAS_SAT_IS_LOS_PROBABILITY_BIT;
|
||||
}
|
||||
if (in.singleSatCorrectionFlags & (GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH)) {
|
||||
out.flags |= GNSS_MEAS_CORR_HAS_EXCESS_PATH_LENGTH_BIT;
|
||||
}
|
||||
if (in.singleSatCorrectionFlags & (GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH_UNC)) {
|
||||
out.flags |= GNSS_MEAS_CORR_HAS_EXCESS_PATH_LENGTH_UNC_BIT;
|
||||
}
|
||||
if (in.singleSatCorrectionFlags & (GnssSingleSatCorrectionFlags::HAS_REFLECTING_PLANE)) {
|
||||
out.flags |= GNSS_MEAS_CORR_HAS_REFLECTING_PLANE_BIT;
|
||||
}
|
||||
switch (in.constellation) {
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::GPS):
|
||||
out.svType = GNSS_SV_TYPE_GPS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::SBAS):
|
||||
out.svType = GNSS_SV_TYPE_SBAS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::GLONASS):
|
||||
out.svType = GNSS_SV_TYPE_GLONASS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::QZSS):
|
||||
out.svType = GNSS_SV_TYPE_QZSS;
|
||||
break;
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::BEIDOU):
|
||||
out.svType = GNSS_SV_TYPE_BEIDOU;
|
||||
break;
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::GALILEO):
|
||||
out.svType = GNSS_SV_TYPE_GALILEO;
|
||||
break;
|
||||
case (::android::hardware::gnss::V1_0::GnssConstellationType::UNKNOWN):
|
||||
default:
|
||||
out.svType = GNSS_SV_TYPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
out.svId = in.svid;
|
||||
out.carrierFrequencyHz = in.carrierFrequencyHz;
|
||||
out.probSatIsLos = in.probSatIsLos;
|
||||
out.excessPathLengthMeters = in.excessPathLengthMeters;
|
||||
out.excessPathLengthUncertaintyMeters = in.excessPathLengthUncertaintyMeters;
|
||||
|
||||
out.reflectingPlane.latitudeDegrees = in.reflectingPlane.latitudeDegrees;
|
||||
out.reflectingPlane.longitudeDegrees = in.reflectingPlane.longitudeDegrees;
|
||||
out.reflectingPlane.altitudeMeters = in.reflectingPlane.altitudeMeters;
|
||||
out.reflectingPlane.azimuthDegrees = in.reflectingPlane.azimuthDegrees;
|
||||
}
|
||||
|
||||
void convertMeasurementCorrections(const MeasurementCorrectionsV1_0& in,
|
||||
GnssMeasurementCorrections& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(GnssMeasurementCorrections));
|
||||
out.latitudeDegrees = in.latitudeDegrees;
|
||||
out.longitudeDegrees = in.longitudeDegrees;
|
||||
out.altitudeMeters = in.altitudeMeters;
|
||||
out.horizontalPositionUncertaintyMeters = in.horizontalPositionUncertaintyMeters;
|
||||
out.verticalPositionUncertaintyMeters = in.verticalPositionUncertaintyMeters;
|
||||
out.toaGpsNanosecondsOfWeek = in.toaGpsNanosecondsOfWeek;
|
||||
|
||||
for (int i = 0; i < in.satCorrections.size(); i++) {
|
||||
GnssSingleSatCorrection gnssSingleSatCorrection = {};
|
||||
|
||||
convertSingleSatCorrections(in.satCorrections[i], gnssSingleSatCorrection);
|
||||
out.satCorrections.push_back(gnssSingleSatCorrection);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
68
gps/android/2.1/location_api/LocationUtil.h
Normal file
68
gps/android/2.1/location_api/LocationUtil.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOCATION_UTIL_H
|
||||
#define LOCATION_UTIL_H
|
||||
|
||||
#include <android/hardware/gnss/2.0/types.h>
|
||||
#include <android/hardware/gnss/measurement_corrections/1.0/IMeasurementCorrections.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using MeasurementCorrectionsV1_0 =
|
||||
::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections;
|
||||
using ::android::hardware::gnss::measurement_corrections::V1_0::SingleSatCorrection;
|
||||
|
||||
void convertGnssLocation(Location& in, V1_0::GnssLocation& out);
|
||||
void convertGnssLocation(Location& in, V2_0::GnssLocation& out);
|
||||
void convertGnssLocation(const V1_0::GnssLocation& in, Location& out);
|
||||
void convertGnssLocation(const V2_0::GnssLocation& in, Location& out);
|
||||
void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out);
|
||||
void convertGnssConstellationType(GnssSvType& in, V2_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);
|
||||
void convertSingleSatCorrections(const SingleSatCorrection& in, GnssSingleSatCorrection& out);
|
||||
void convertMeasurementCorrections(const MeasurementCorrectionsV1_0& in,
|
||||
GnssMeasurementCorrections& out);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // LOCATION_UTIL_H
|
||||
642
gps/android/2.1/location_api/MeasurementAPIClient.cpp
Normal file
642
gps/android/2.1/location_api/MeasurementAPIClient.cpp
Normal file
@@ -0,0 +1,642 @@
|
||||
/* 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_MeasurementAPIClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "MeasurementAPIClient.h"
|
||||
#include <loc_misc_utils.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V2_0::IGnssMeasurementCallback;
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssData_1_1(GnssMeasurementsNotification& in,
|
||||
V1_1::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssData_2_0(GnssMeasurementsNotification& in,
|
||||
V2_0::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssData_2_1(GnssMeasurementsNotification& in,
|
||||
V2_1::IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssMeasurement& out);
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
||||
static void convertGnssClock_2_1(GnssMeasurementsClock& in,
|
||||
V2_1::IGnssMeasurementCallback::GnssClock& out);
|
||||
static void convertGnssMeasurementsCodeType(GnssMeasurementsCodeType& inCodeType,
|
||||
char* inOtherCodeTypeName,
|
||||
::android::hardware::hidl_string& out);
|
||||
static void convertGnssMeasurementsAccumulatedDeltaRangeState(GnssMeasurementsAdrStateMask& in,
|
||||
::android::hardware::hidl_bitfield
|
||||
<V1_1::IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState>& out);
|
||||
static void convertGnssMeasurementsState(GnssMeasurementsStateMask& in,
|
||||
::android::hardware::hidl_bitfield
|
||||
<V2_0::IGnssMeasurementCallback::GnssMeasurementState>& out);
|
||||
static void convertElapsedRealtimeNanos(GnssMeasurementsNotification& in,
|
||||
::android::hardware::gnss::V2_0::ElapsedRealtime& elapsedRealtimeNanos);
|
||||
|
||||
MeasurementAPIClient::MeasurementAPIClient() :
|
||||
mGnssMeasurementCbIface(nullptr),
|
||||
mGnssMeasurementCbIface_1_1(nullptr),
|
||||
mGnssMeasurementCbIface_2_0(nullptr),
|
||||
mGnssMeasurementCbIface_2_1(nullptr),
|
||||
mTracking(false)
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
MeasurementAPIClient::~MeasurementAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
void MeasurementAPIClient::clearInterfaces()
|
||||
{
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
mGnssMeasurementCbIface_1_1 = nullptr;
|
||||
mGnssMeasurementCbIface_2_0 = nullptr;
|
||||
mGnssMeasurementCbIface_2_1 = nullptr;
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
mMutex.lock();
|
||||
clearInterfaces();
|
||||
mGnssMeasurementCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking();
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback_1_1(
|
||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
||||
|
||||
mMutex.lock();
|
||||
clearInterfaces();
|
||||
mGnssMeasurementCbIface_1_1 = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking(powerMode, timeBetweenMeasurement);
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback_2_0(
|
||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
||||
|
||||
mMutex.lock();
|
||||
clearInterfaces();
|
||||
mGnssMeasurementCbIface_2_0 = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
return startTracking(powerMode, timeBetweenMeasurement);
|
||||
}
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> MeasurementAPIClient::measurementSetCallback_2_1(
|
||||
const sp<V2_1::IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) {
|
||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
||||
|
||||
mMutex.lock();
|
||||
clearInterfaces();
|
||||
mGnssMeasurementCbIface_2_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_2_1 != nullptr ||
|
||||
mGnssMeasurementCbIface_2_0 != nullptr ||
|
||||
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();
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||
GnssMeasurementsNotification gnssMeasurementsNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %u active: %d)",
|
||||
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
|
||||
if (mTracking) {
|
||||
mMutex.lock();
|
||||
sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr;
|
||||
sp<V1_1::IGnssMeasurementCallback> gnssMeasurementCbIface_1_1 = nullptr;
|
||||
sp<V2_0::IGnssMeasurementCallback> gnssMeasurementCbIface_2_0 = nullptr;
|
||||
sp<V2_1::IGnssMeasurementCallback> gnssMeasurementCbIface_2_1 = nullptr;
|
||||
if (mGnssMeasurementCbIface_2_1 != nullptr) {
|
||||
gnssMeasurementCbIface_2_1 = mGnssMeasurementCbIface_2_1;
|
||||
} else if (mGnssMeasurementCbIface_2_0 != nullptr) {
|
||||
gnssMeasurementCbIface_2_0 = mGnssMeasurementCbIface_2_0;
|
||||
} else if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
||||
gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1;
|
||||
} else if (mGnssMeasurementCbIface != nullptr) {
|
||||
gnssMeasurementCbIface = mGnssMeasurementCbIface;
|
||||
}
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssMeasurementCbIface_2_1 != nullptr) {
|
||||
V2_1::IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData_2_1(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface_2_1->gnssMeasurementCb_2_1(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssMeasurementCbIface_2_0 != nullptr) {
|
||||
V2_0::IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData_2_0(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface_2_0->gnssMeasurementCb_2_0(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
} else if (gnssMeasurementCbIface_1_1 != nullptr) {
|
||||
V1_1::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(out));
|
||||
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(out));
|
||||
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 convertGnssClock_2_1(GnssMeasurementsClock& in,
|
||||
V2_1::IGnssMeasurementCallback::GnssClock& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
convertGnssClock(in, out.v1_0);
|
||||
convertGnssConstellationType(in.referenceSignalTypeForIsb.svType,
|
||||
out.referenceSignalTypeForIsb.constellation);
|
||||
out.referenceSignalTypeForIsb.carrierFrequencyHz =
|
||||
in.referenceSignalTypeForIsb.carrierFrequencyHz;
|
||||
convertGnssMeasurementsCodeType(in.referenceSignalTypeForIsb.codeType,
|
||||
in.referenceSignalTypeForIsb.otherCodeTypeName,
|
||||
out.referenceSignalTypeForIsb.codeType);
|
||||
}
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
V1_0::IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(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,
|
||||
V1_1::IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
out.measurements.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0);
|
||||
convertGnssMeasurementsAccumulatedDeltaRangeState(in.measurements[i].adrStateMask,
|
||||
out.measurements[i].accumulatedDeltaRangeState);
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
static void convertGnssData_2_0(GnssMeasurementsNotification& in,
|
||||
V2_0::IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
out.measurements.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_1.v1_0);
|
||||
convertGnssConstellationType(in.measurements[i].svType, out.measurements[i].constellation);
|
||||
convertGnssMeasurementsCodeType(in.measurements[i].codeType,
|
||||
in.measurements[i].otherCodeTypeName,
|
||||
out.measurements[i].codeType);
|
||||
convertGnssMeasurementsAccumulatedDeltaRangeState(in.measurements[i].adrStateMask,
|
||||
out.measurements[i].v1_1.accumulatedDeltaRangeState);
|
||||
convertGnssMeasurementsState(in.measurements[i].stateMask, out.measurements[i].state);
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
convertElapsedRealtimeNanos(in, out.elapsedRealtime);
|
||||
}
|
||||
|
||||
static void convertGnssMeasurementsCodeType(GnssMeasurementsCodeType& inCodeType,
|
||||
char* inOtherCodeTypeName, ::android::hardware::hidl_string& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
switch(inCodeType) {
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_A:
|
||||
out = "A";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_B:
|
||||
out = "B";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_C:
|
||||
out = "C";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_I:
|
||||
out = "I";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_L:
|
||||
out = "L";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_M:
|
||||
out = "M";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_P:
|
||||
out = "P";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_Q:
|
||||
out = "Q";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_S:
|
||||
out = "S";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_W:
|
||||
out = "W";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_X:
|
||||
out = "X";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_Y:
|
||||
out = "Y";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_Z:
|
||||
out = "Z";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_N:
|
||||
out = "N";
|
||||
break;
|
||||
case GNSS_MEASUREMENTS_CODE_TYPE_OTHER:
|
||||
default:
|
||||
out = inOtherCodeTypeName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssMeasurementsAccumulatedDeltaRangeState(GnssMeasurementsAdrStateMask& in,
|
||||
::android::hardware::hidl_bitfield
|
||||
<V1_1::IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState>& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
if (in & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID;
|
||||
if (in & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET;
|
||||
if (in & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP;
|
||||
if (in & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT)
|
||||
out |= IGnssMeasurementCallback::
|
||||
GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED;
|
||||
}
|
||||
|
||||
static void convertGnssMeasurementsState(GnssMeasurementsStateMask& in,
|
||||
::android::hardware::hidl_bitfield
|
||||
<V2_0::IGnssMeasurementCallback::GnssMeasurementState>& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
if (in & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_TOW_KNOWN_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_KNOWN;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_GLO_TOD_KNOWN_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_KNOWN;
|
||||
if (in & GNSS_MEASUREMENTS_STATE_2ND_CODE_LOCK_BIT)
|
||||
out |= IGnssMeasurementCallback::GnssMeasurementState::STATE_2ND_CODE_LOCK;
|
||||
}
|
||||
|
||||
static void convertGnssData_2_1(GnssMeasurementsNotification& in,
|
||||
V2_1::IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(out));
|
||||
out.measurements.resize(in.count);
|
||||
for (size_t i = 0; i < in.count; i++) {
|
||||
out.measurements[i].flags = 0;
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i].v2_0.v1_1.v1_0);
|
||||
convertGnssConstellationType(in.measurements[i].svType,
|
||||
out.measurements[i].v2_0.constellation);
|
||||
convertGnssMeasurementsCodeType(in.measurements[i].codeType,
|
||||
in.measurements[i].otherCodeTypeName,
|
||||
out.measurements[i].v2_0.codeType);
|
||||
convertGnssMeasurementsAccumulatedDeltaRangeState(in.measurements[i].adrStateMask,
|
||||
out.measurements[i].v2_0.v1_1.accumulatedDeltaRangeState);
|
||||
convertGnssMeasurementsState(in.measurements[i].stateMask,
|
||||
out.measurements[i].v2_0.state);
|
||||
out.measurements[i].basebandCN0DbHz = in.measurements[i].basebandCarrierToNoiseDbHz;
|
||||
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) {
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) {
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) {
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) {
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) {
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::
|
||||
GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT) {
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_FULL_ISB_BIT) {
|
||||
out.measurements[i].fullInterSignalBiasNs = in.measurements[i].fullInterSignalBiasNs;
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_FULL_ISB;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_FULL_ISB_UNCERTAINTY_BIT) {
|
||||
out.measurements[i].fullInterSignalBiasUncertaintyNs =
|
||||
in.measurements[i].fullInterSignalBiasUncertaintyNs;
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::
|
||||
GnssMeasurementFlags::HAS_FULL_ISB_UNCERTAINTY;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_SATELLITE_ISB_BIT) {
|
||||
out.measurements[i].satelliteInterSignalBiasNs =
|
||||
in.measurements[i].satelliteInterSignalBiasNs;
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SATELLITE_ISB;
|
||||
}
|
||||
if (in.measurements[i].flags & GNSS_MEASUREMENTS_DATA_SATELLITE_ISB_UNCERTAINTY_BIT) {
|
||||
out.measurements[i].satelliteInterSignalBiasUncertaintyNs =
|
||||
in.measurements[i].satelliteInterSignalBiasUncertaintyNs;
|
||||
out.measurements[i].flags |=
|
||||
V2_1::IGnssMeasurementCallback::
|
||||
GnssMeasurementFlags::HAS_SATELLITE_ISB_UNCERTAINTY;
|
||||
}
|
||||
}
|
||||
convertGnssClock_2_1(in.clock, out.clock);
|
||||
convertElapsedRealtimeNanos(in, out.elapsedRealtime);
|
||||
}
|
||||
|
||||
static void convertElapsedRealtimeNanos(GnssMeasurementsNotification& in,
|
||||
::android::hardware::gnss::V2_0::ElapsedRealtime& elapsedRealtime)
|
||||
{
|
||||
if (in.clock.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_ELAPSED_REAL_TIME_BIT) {
|
||||
elapsedRealtime.flags |= V2_0::ElapsedRealtimeFlags::HAS_TIMESTAMP_NS;
|
||||
elapsedRealtime.timestampNs = in.clock.elapsedRealTime;
|
||||
elapsedRealtime.flags |= V2_0::ElapsedRealtimeFlags::HAS_TIME_UNCERTAINTY_NS;
|
||||
elapsedRealtime.timeUncertaintyNs = in.clock.elapsedRealTimeUnc;
|
||||
LOC_LOGd("elapsedRealtime.timestampNs=%" PRIi64 ""
|
||||
" elapsedRealtime.timeUncertaintyNs=%" PRIi64 " elapsedRealtime.flags=0x%X",
|
||||
elapsedRealtime.timestampNs,
|
||||
elapsedRealtime.timeUncertaintyNs, elapsedRealtime.flags);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
96
gps/android/2.1/location_api/MeasurementAPIClient.h
Normal file
96
gps/android/2.1/location_api/MeasurementAPIClient.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEASUREMENT_API_CLINET_H
|
||||
#define MEASUREMENT_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/2.1/IGnssMeasurement.h>
|
||||
//#include <android/hardware/gnss/1.1/IGnssMeasurementCallback.h>
|
||||
#include <android/hardware/gnss/2.1/IGnssMeasurementCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V2_1 {
|
||||
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);
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_1_1(
|
||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_2_0(
|
||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_2_1(
|
||||
const sp<V2_1::IGnssMeasurementCallback>& callback,
|
||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
||||
void measurementClose();
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
||||
|
||||
// callbacks we are interested in
|
||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||
|
||||
private:
|
||||
virtual ~MeasurementAPIClient();
|
||||
|
||||
std::mutex mMutex;
|
||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface;
|
||||
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1;
|
||||
sp<V2_0::IGnssMeasurementCallback> mGnssMeasurementCbIface_2_0;
|
||||
sp<V2_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_2_1;
|
||||
bool mTracking;
|
||||
void clearInterfaces();
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // MEASUREMENT_API_CLINET_H
|
||||
81
gps/android/2.1/service.cpp
Executable file
81
gps/android/2.1/service.cpp
Executable file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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 "android.hardware.gnss@2.1-service-qti"
|
||||
|
||||
#include <android/hardware/gnss/2.1/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::V2_1::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) {
|
||||
#ifdef LOC_HIDL_VERSION
|
||||
#define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so"
|
||||
|
||||
void* libHandle = NULL;
|
||||
vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*)
|
||||
dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main");
|
||||
if (NULL != vendorEnhancedMainMethod) {
|
||||
(*vendorEnhancedMainMethod)(0, NULL);
|
||||
}
|
||||
#else
|
||||
ALOGI("LOC_HIDL_VERSION not defined.");
|
||||
#endif
|
||||
joinRpcThreadpool();
|
||||
} else {
|
||||
ALOGE("Error while registering IGnss 2.1 service: %d", status);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
38
gps/android/utils/Android.bp
Normal file
38
gps/android/utils/Android.bp
Normal file
@@ -0,0 +1,38 @@
|
||||
cc_library_static {
|
||||
|
||||
name: "liblocbatterylistener",
|
||||
vendor: true,
|
||||
|
||||
|
||||
|
||||
cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"],
|
||||
local_include_dirs: ["."],
|
||||
|
||||
srcs: ["battery_listener.cpp"],
|
||||
|
||||
shared_libs: [
|
||||
"liblog",
|
||||
"libhidlbase",
|
||||
"libcutils",
|
||||
"libutils",
|
||||
"android.hardware.health@1.0",
|
||||
"android.hardware.health@2.0",
|
||||
"android.hardware.health@2.1",
|
||||
"android.hardware.power@1.2",
|
||||
"libbase",
|
||||
],
|
||||
|
||||
static_libs: ["libhealthhalutils"],
|
||||
|
||||
header_libs: [
|
||||
"libgps.utils_headers",
|
||||
"libloc_pla_headers",
|
||||
],
|
||||
}
|
||||
|
||||
cc_library_headers {
|
||||
|
||||
name: "liblocbatterylistener_headers",
|
||||
vendor: true,
|
||||
export_include_dirs: ["."],
|
||||
}
|
||||
285
gps/android/utils/battery_listener.cpp
Normal file
285
gps/android/utils/battery_listener.cpp
Normal file
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
* Copyright (c) 2019-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.
|
||||
*/
|
||||
#include "battery_listener.h"
|
||||
#ifdef LOG_TAG
|
||||
#undef LOG_TAG
|
||||
#endif
|
||||
#define LOG_TAG "LocSvc_BatteryListener"
|
||||
#define LOG_NDEBUG 0
|
||||
|
||||
#include <android/hidl/manager/1.0/IServiceManager.h>
|
||||
#include <android/hardware/health/2.1/IHealth.h>
|
||||
#include <android/hardware/health/2.1/IHealthInfoCallback.h>
|
||||
#include <healthhalutils/HealthHalUtils.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
#include <thread>
|
||||
#include <log_util.h>
|
||||
|
||||
using android::hardware::interfacesEqual;
|
||||
using android::hardware::Return;
|
||||
using android::hardware::Void;
|
||||
using android::hardware::health::V1_0::BatteryStatus;
|
||||
using android::hardware::health::V2_1::HealthInfo;
|
||||
using android::hardware::health::V2_1::IHealthInfoCallback;
|
||||
using android::hardware::health::V2_1::IHealth;
|
||||
using android::hardware::health::V2_0::Result;
|
||||
using android::hidl::manager::V1_0::IServiceManager;
|
||||
using namespace std::literals::chrono_literals;
|
||||
|
||||
static bool sIsBatteryListened = false;
|
||||
namespace android {
|
||||
|
||||
#define GET_HEALTH_SVC_RETRY_CNT 5
|
||||
#define GET_HEALTH_SVC_WAIT_TIME_MS 500
|
||||
|
||||
struct BatteryListenerImpl : public hardware::health::V2_1::IHealthInfoCallback,
|
||||
public hardware::hidl_death_recipient {
|
||||
typedef std::function<void(bool)> cb_fn_t;
|
||||
BatteryListenerImpl(cb_fn_t cb);
|
||||
virtual ~BatteryListenerImpl ();
|
||||
virtual hardware::Return<void> healthInfoChanged(
|
||||
const hardware::health::V2_0::HealthInfo& info);
|
||||
virtual hardware::Return<void> healthInfoChanged_2_1(
|
||||
const hardware::health::V2_1::HealthInfo& info);
|
||||
virtual void serviceDied(uint64_t cookie,
|
||||
const wp<hidl::base::V1_0::IBase>& who);
|
||||
bool isCharging() {
|
||||
std::lock_guard<std::mutex> _l(mLock);
|
||||
return statusToBool(mStatus);
|
||||
}
|
||||
private:
|
||||
sp<hardware::health::V2_1::IHealth> mHealth;
|
||||
status_t init();
|
||||
BatteryStatus mStatus;
|
||||
cb_fn_t mCb;
|
||||
std::mutex mLock;
|
||||
std::condition_variable mCond;
|
||||
std::unique_ptr<std::thread> mThread;
|
||||
bool mDone;
|
||||
bool statusToBool(const BatteryStatus &s) const {
|
||||
return (s == BatteryStatus::CHARGING) ||
|
||||
(s == BatteryStatus::FULL);
|
||||
}
|
||||
};
|
||||
|
||||
status_t BatteryListenerImpl::init()
|
||||
{
|
||||
int tries = 0;
|
||||
|
||||
if (mHealth != NULL)
|
||||
return INVALID_OPERATION;
|
||||
|
||||
do {
|
||||
mHealth = IHealth::getService();
|
||||
if (mHealth != NULL)
|
||||
break;
|
||||
usleep(GET_HEALTH_SVC_WAIT_TIME_MS * 1000);
|
||||
tries++;
|
||||
} while(tries < GET_HEALTH_SVC_RETRY_CNT);
|
||||
|
||||
if (mHealth == NULL) {
|
||||
LOC_LOGe("no health service found, retries %d", tries);
|
||||
return NO_INIT;
|
||||
} else {
|
||||
LOC_LOGi("Get health service in %d tries", tries);
|
||||
}
|
||||
mStatus = BatteryStatus::UNKNOWN;
|
||||
auto ret = mHealth->getChargeStatus([&](Result r, BatteryStatus status) {
|
||||
if (r != Result::SUCCESS) {
|
||||
LOC_LOGe("batterylistener: cannot get battery status");
|
||||
return;
|
||||
}
|
||||
mStatus = status;
|
||||
});
|
||||
if (!ret.isOk()) {
|
||||
LOC_LOGe("batterylistener: get charge status transaction error");
|
||||
}
|
||||
if (mStatus == BatteryStatus::UNKNOWN) {
|
||||
LOC_LOGw("batterylistener: init: invalid battery status");
|
||||
}
|
||||
mDone = false;
|
||||
mThread = std::make_unique<std::thread>([this]() {
|
||||
std::unique_lock<std::mutex> l(mLock);
|
||||
BatteryStatus local_status = mStatus;
|
||||
while (!mDone) {
|
||||
if (local_status == mStatus) {
|
||||
mCond.wait(l);
|
||||
continue;
|
||||
}
|
||||
local_status = mStatus;
|
||||
switch (local_status) {
|
||||
// NOT_CHARGING is a special event that indicates, a battery is connected,
|
||||
// but not charging. This is seen for approx a second
|
||||
// after charger is plugged in. A charging event is eventually received.
|
||||
// We must try to avoid an unnecessary cb to HAL
|
||||
// only to call it again shortly.
|
||||
// An option to deal with this transient event would be to ignore this.
|
||||
// Or process this event with a slight delay (i.e cancel this event
|
||||
// if a different event comes in within a timeout
|
||||
case BatteryStatus::NOT_CHARGING : {
|
||||
auto mStatusnot_ncharging =
|
||||
[this, local_status]() { return mStatus != local_status; };
|
||||
mCond.wait_for(l, 3s, mStatusnot_ncharging);
|
||||
if (mStatusnot_ncharging()) // i.e event changed
|
||||
break;
|
||||
[[clang::fallthrough]]; //explicit fall-through between switch labels
|
||||
}
|
||||
default:
|
||||
bool c = statusToBool(local_status);
|
||||
LOC_LOGi("healthInfo cb thread: cb %s", c ? "CHARGING" : "NOT CHARGING");
|
||||
l.unlock();
|
||||
mCb(c);
|
||||
l.lock();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
auto reg = mHealth->registerCallback(this);
|
||||
if (!reg.isOk()) {
|
||||
LOC_LOGe("Transaction error in registeringCb to HealthHAL death: %s",
|
||||
reg.description().c_str());
|
||||
}
|
||||
|
||||
auto linked = mHealth->linkToDeath(this, 0 /* cookie */);
|
||||
if (!linked.isOk() || linked == false) {
|
||||
LOC_LOGe("Transaction error in linking to HealthHAL death: %s",
|
||||
linked.description().c_str());
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
BatteryListenerImpl::BatteryListenerImpl(cb_fn_t cb) :
|
||||
mCb(cb)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
BatteryListenerImpl::~BatteryListenerImpl()
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> _l(mLock);
|
||||
if (mHealth != NULL) {
|
||||
mHealth->unregisterCallback(this);
|
||||
auto r = mHealth->unlinkToDeath(this);
|
||||
if (!r.isOk() || r == false) {
|
||||
LOC_LOGe("Transaction error in unregister to HealthHAL death: %s",
|
||||
r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
mDone = true;
|
||||
if (NULL != mThread) {
|
||||
mThread->join();
|
||||
}
|
||||
}
|
||||
|
||||
void BatteryListenerImpl::serviceDied(uint64_t cookie __unused,
|
||||
const wp<hidl::base::V1_0::IBase>& who)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> _l(mLock);
|
||||
if (mHealth == NULL || !interfacesEqual(mHealth, who.promote())) {
|
||||
LOC_LOGe("health not initialized or unknown interface died");
|
||||
return;
|
||||
}
|
||||
LOC_LOGi("health service died, reinit");
|
||||
mDone = true;
|
||||
}
|
||||
mHealth = NULL;
|
||||
mCond.notify_one();
|
||||
if (NULL != mThread) {
|
||||
mThread->join();
|
||||
}
|
||||
std::lock_guard<std::mutex> _l(mLock);
|
||||
init();
|
||||
}
|
||||
|
||||
// this callback seems to be a SYNC callback and so
|
||||
// waits for return before next event is issued.
|
||||
// therefore we need not have a queue to process
|
||||
// NOT_CHARGING and CHARGING concurrencies.
|
||||
// Replace single var by a list if this assumption is broken
|
||||
Return<void> BatteryListenerImpl::healthInfoChanged(
|
||||
const hardware::health::V2_0::HealthInfo& info) {
|
||||
LOC_LOGv("healthInfoChanged: %d", info.legacy.batteryStatus);
|
||||
std::unique_lock<std::mutex> l(mLock);
|
||||
if (info.legacy.batteryStatus != mStatus) {
|
||||
mStatus = info.legacy.batteryStatus;
|
||||
mCond.notify_one();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> BatteryListenerImpl::healthInfoChanged_2_1(
|
||||
const hardware::health::V2_1::HealthInfo& info) {
|
||||
LOC_LOGv("healthInfoChanged_2_1: %d", info.legacy.legacy.batteryStatus);
|
||||
healthInfoChanged(info.legacy);
|
||||
return Void();
|
||||
}
|
||||
|
||||
static sp<BatteryListenerImpl> batteryListener;
|
||||
|
||||
bool batteryPropertiesListenerIsCharging() {
|
||||
return batteryListener->isCharging();
|
||||
}
|
||||
|
||||
status_t batteryPropertiesListenerInit(BatteryListenerImpl::cb_fn_t cb) {
|
||||
batteryListener = new BatteryListenerImpl(cb);
|
||||
bool isCharging = batteryPropertiesListenerIsCharging();
|
||||
LOC_LOGv("charging status: %s charging", isCharging ? "" : "not");;
|
||||
if (isCharging) {
|
||||
cb(isCharging);
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
status_t batteryPropertiesListenerDeinit() {
|
||||
batteryListener.clear();
|
||||
return OK;
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
|
||||
void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn) {
|
||||
LOC_LOGv("loc_extn_battery_properties_listener_init entry");
|
||||
if (!sIsBatteryListened) {
|
||||
std::thread t1(android::batteryPropertiesListenerInit,
|
||||
[=](bool charging) { fn(charging); });
|
||||
t1.detach();
|
||||
sIsBatteryListened = true;
|
||||
}
|
||||
}
|
||||
|
||||
void loc_extn_battery_properties_listener_deinit() {
|
||||
android::batteryPropertiesListenerDeinit();
|
||||
}
|
||||
|
||||
bool loc_extn_battery_properties_is_charging() {
|
||||
return android::batteryPropertiesListenerIsCharging();
|
||||
}
|
||||
32
gps/android/utils/battery_listener.h
Normal file
32
gps/android/utils/battery_listener.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
typedef void (* battery_status_change_fn_t)(bool);
|
||||
void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn);
|
||||
void loc_extn_battery_properties_listener_deinit();
|
||||
bool loc_extn_battery_properties_is_charging();
|
||||
31
gps/batching/Android.bp
Normal file
31
gps/batching/Android.bp
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
cc_library_shared {
|
||||
|
||||
name: "libbatching",
|
||||
vendor: true,
|
||||
|
||||
|
||||
|
||||
shared_libs: [
|
||||
"libutils",
|
||||
"libcutils",
|
||||
"liblog",
|
||||
"libloc_core",
|
||||
"libgps.utils",
|
||||
"libdl",
|
||||
],
|
||||
|
||||
srcs: [
|
||||
"location_batching.cpp",
|
||||
"BatchingAdapter.cpp",
|
||||
],
|
||||
|
||||
header_libs: [
|
||||
"libgps.utils_headers",
|
||||
"libloc_core_headers",
|
||||
"libloc_pla_headers",
|
||||
"liblocation_api_headers",
|
||||
],
|
||||
|
||||
cflags: GNSS_CFLAGS,
|
||||
}
|
||||
1051
gps/batching/BatchingAdapter.cpp
Normal file
1051
gps/batching/BatchingAdapter.cpp
Normal file
File diff suppressed because it is too large
Load Diff
152
gps/batching/BatchingAdapter.h
Normal file
152
gps/batching/BatchingAdapter.h
Normal file
@@ -0,0 +1,152 @@
|
||||
/* Copyright (c) 2017-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.
|
||||
*
|
||||
*/
|
||||
#ifndef BATCHING_ADAPTER_H
|
||||
#define BATCHING_ADAPTER_H
|
||||
|
||||
#include <LocAdapterBase.h>
|
||||
#include <LocContext.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <map>
|
||||
|
||||
using namespace loc_core;
|
||||
|
||||
class BatchingAdapter : public LocAdapterBase {
|
||||
|
||||
/* ==== BATCHING ======================================================================= */
|
||||
typedef struct {
|
||||
uint32_t accumulatedDistanceOngoingBatch;
|
||||
uint32_t accumulatedDistanceThisTrip;
|
||||
uint32_t accumulatedDistanceOnTripRestart;
|
||||
uint32_t tripDistance;
|
||||
uint32_t tripTBFInterval;
|
||||
} TripSessionStatus;
|
||||
typedef std::map<uint32_t, TripSessionStatus> TripSessionStatusMap;
|
||||
typedef std::map<LocationSessionKey, BatchingOptions> BatchingSessionMap;
|
||||
|
||||
BatchingSessionMap mBatchingSessions;
|
||||
TripSessionStatusMap mTripSessions;
|
||||
uint32_t mOngoingTripDistance;
|
||||
uint32_t mOngoingTripTBFInterval;
|
||||
bool mTripWithOngoingTBFDropped;
|
||||
bool mTripWithOngoingTripDistanceDropped;
|
||||
|
||||
void startTripBatchingMultiplex(LocationAPI* client, uint32_t sessionId,
|
||||
const BatchingOptions& batchingOptions);
|
||||
void stopTripBatchingMultiplex(LocationAPI* client, uint32_t sessionId,
|
||||
bool restartNeeded,
|
||||
const BatchingOptions& batchOptions);
|
||||
inline void stopTripBatchingMultiplex(LocationAPI* client, uint32_t id) {
|
||||
BatchingOptions batchOptions;
|
||||
stopTripBatchingMultiplex(client, id, false, batchOptions);
|
||||
};
|
||||
void stopTripBatchingMultiplexCommon(LocationError err,
|
||||
LocationAPI* client,
|
||||
uint32_t sessionId,
|
||||
bool restartNeeded,
|
||||
const BatchingOptions& batchOptions);
|
||||
void restartTripBatching(bool queryAccumulatedDistance, uint32_t accDist = 0,
|
||||
uint32_t numbatchedPos = 0);
|
||||
void printTripReport();
|
||||
|
||||
/* ==== CONFIGURATION ================================================================== */
|
||||
uint32_t mBatchingTimeout;
|
||||
uint32_t mBatchingAccuracy;
|
||||
size_t mBatchSize;
|
||||
size_t mTripBatchSize;
|
||||
|
||||
protected:
|
||||
|
||||
/* ==== CLIENT ========================================================================= */
|
||||
virtual void updateClientsEventMask();
|
||||
virtual void stopClientSessions(LocationAPI* client);
|
||||
|
||||
public:
|
||||
BatchingAdapter();
|
||||
virtual ~BatchingAdapter() {}
|
||||
|
||||
/* ==== SSR ============================================================================ */
|
||||
/* ======== EVENTS ====(Called from QMI Thread)========================================= */
|
||||
virtual void handleEngineUpEvent();
|
||||
/* ======== UTILITIES ================================================================== */
|
||||
void restartSessions();
|
||||
|
||||
/* ==== BATCHING ======================================================================= */
|
||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||
uint32_t startBatchingCommand(LocationAPI* client, BatchingOptions &batchOptions);
|
||||
void updateBatchingOptionsCommand(
|
||||
LocationAPI* client, uint32_t id, BatchingOptions& batchOptions);
|
||||
void stopBatchingCommand(LocationAPI* client, uint32_t id);
|
||||
void getBatchedLocationsCommand(LocationAPI* client, uint32_t id, size_t count);
|
||||
/* ======== RESPONSES ================================================================== */
|
||||
void reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId);
|
||||
/* ======== UTILITIES ================================================================== */
|
||||
bool hasBatchingCallback(LocationAPI* client);
|
||||
bool isBatchingSession(LocationAPI* client, uint32_t sessionId);
|
||||
bool isTripSession(uint32_t sessionId);
|
||||
void saveBatchingSession(LocationAPI* client, uint32_t sessionId,
|
||||
const BatchingOptions& batchingOptions);
|
||||
void eraseBatchingSession(LocationAPI* client, uint32_t sessionId);
|
||||
uint32_t autoReportBatchingSessionsCount();
|
||||
void startBatching(LocationAPI* client, uint32_t sessionId,
|
||||
const BatchingOptions& batchingOptions);
|
||||
void stopBatching(LocationAPI* client, uint32_t sessionId, bool restartNeeded,
|
||||
const BatchingOptions& batchOptions);
|
||||
void stopBatching(LocationAPI* client, uint32_t sessionId) {
|
||||
BatchingOptions batchOptions;
|
||||
stopBatching(client, sessionId, false, batchOptions);
|
||||
};
|
||||
|
||||
/* ==== REPORTS ======================================================================== */
|
||||
/* ======== EVENTS ====(Called from QMI Thread)========================================= */
|
||||
void reportLocationsEvent(const Location* locations, size_t count,
|
||||
BatchingMode batchingMode);
|
||||
void reportCompletedTripsEvent(uint32_t accumulatedDistance);
|
||||
void reportBatchStatusChangeEvent(BatchingStatus batchStatus);
|
||||
/* ======== UTILITIES ================================================================== */
|
||||
void reportLocations(Location* locations, size_t count, BatchingMode batchingMode);
|
||||
void reportBatchStatusChange(BatchingStatus batchStatus,
|
||||
std::list<uint32_t> & completedTripsList);
|
||||
|
||||
/* ==== CONFIGURATION ================================================================== */
|
||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||
void readConfigCommand();
|
||||
void setConfigCommand();
|
||||
/* ======== UTILITIES ================================================================== */
|
||||
void setBatchSize(size_t batchSize) { mBatchSize = batchSize; }
|
||||
size_t getBatchSize() { return mBatchSize; }
|
||||
void setTripBatchSize(size_t batchSize) { mTripBatchSize = batchSize; }
|
||||
size_t getTripBatchSize() { return mTripBatchSize; }
|
||||
void setBatchingTimeout(uint32_t batchingTimeout) { mBatchingTimeout = batchingTimeout; }
|
||||
uint32_t getBatchingTimeout() { return mBatchingTimeout; }
|
||||
void setBatchingAccuracy(uint32_t accuracy) { mBatchingAccuracy = accuracy; }
|
||||
uint32_t getBatchingAccuracy() { return mBatchingAccuracy; }
|
||||
|
||||
};
|
||||
|
||||
#endif /* BATCHING_ADAPTER_H */
|
||||
134
gps/batching/location_batching.cpp
Normal file
134
gps/batching/location_batching.cpp
Normal file
@@ -0,0 +1,134 @@
|
||||
/* Copyright (c) 2017-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.
|
||||
*
|
||||
*/
|
||||
#include "BatchingAdapter.h"
|
||||
#include "location_interface.h"
|
||||
|
||||
static BatchingAdapter* gBatchingAdapter = NULL;
|
||||
|
||||
static void initialize();
|
||||
static void deinitialize();
|
||||
|
||||
static void addClient(LocationAPI* client, const LocationCallbacks& callbacks);
|
||||
static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb);
|
||||
static void requestCapabilities(LocationAPI* client);
|
||||
|
||||
static uint32_t startBatching(LocationAPI* client, BatchingOptions&);
|
||||
static void stopBatching(LocationAPI* client, uint32_t id);
|
||||
static void updateBatchingOptions(LocationAPI* client, uint32_t id, BatchingOptions&);
|
||||
static void getBatchedLocations(LocationAPI* client, uint32_t id, size_t count);
|
||||
|
||||
static const BatchingInterface gBatchingInterface = {
|
||||
sizeof(BatchingInterface),
|
||||
initialize,
|
||||
deinitialize,
|
||||
addClient,
|
||||
removeClient,
|
||||
requestCapabilities,
|
||||
startBatching,
|
||||
stopBatching,
|
||||
updateBatchingOptions,
|
||||
getBatchedLocations
|
||||
};
|
||||
|
||||
#ifndef DEBUG_X86
|
||||
extern "C" const BatchingInterface* getBatchingInterface()
|
||||
#else
|
||||
const BatchingInterface* getBatchingInterface()
|
||||
#endif // DEBUG_X86
|
||||
{
|
||||
return &gBatchingInterface;
|
||||
}
|
||||
|
||||
static void initialize()
|
||||
{
|
||||
if (NULL == gBatchingAdapter) {
|
||||
gBatchingAdapter = new BatchingAdapter();
|
||||
}
|
||||
}
|
||||
|
||||
static void deinitialize()
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
delete gBatchingAdapter;
|
||||
gBatchingAdapter = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void addClient(LocationAPI* client, const LocationCallbacks& callbacks)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
gBatchingAdapter->addClientCommand(client, callbacks);
|
||||
}
|
||||
}
|
||||
|
||||
static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
gBatchingAdapter->removeClientCommand(client, rmClientCb);
|
||||
}
|
||||
}
|
||||
|
||||
static void requestCapabilities(LocationAPI* client)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
gBatchingAdapter->requestCapabilitiesCommand(client);
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t startBatching(LocationAPI* client, BatchingOptions &batchOptions)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
return gBatchingAdapter->startBatchingCommand(client, batchOptions);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void stopBatching(LocationAPI* client, uint32_t id)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
gBatchingAdapter->stopBatchingCommand(client, id);
|
||||
}
|
||||
}
|
||||
|
||||
static void updateBatchingOptions(
|
||||
LocationAPI* client, uint32_t id, BatchingOptions& batchOptions)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
gBatchingAdapter->updateBatchingOptionsCommand(client, id, batchOptions);
|
||||
}
|
||||
}
|
||||
|
||||
static void getBatchedLocations(LocationAPI* client, uint32_t id, size_t count)
|
||||
{
|
||||
if (NULL != gBatchingAdapter) {
|
||||
gBatchingAdapter->getBatchedLocationsCommand(client, id, count);
|
||||
}
|
||||
}
|
||||
|
||||
56
gps/core/Android.bp
Normal file
56
gps/core/Android.bp
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
cc_library_shared {
|
||||
|
||||
name: "libloc_core",
|
||||
vendor: true,
|
||||
|
||||
|
||||
|
||||
shared_libs: [
|
||||
"liblog",
|
||||
"libutils",
|
||||
"libcutils",
|
||||
"libgps.utils",
|
||||
"libdl",
|
||||
"liblog",
|
||||
],
|
||||
|
||||
srcs: [
|
||||
"LocApiBase.cpp",
|
||||
"LocAdapterBase.cpp",
|
||||
"ContextBase.cpp",
|
||||
"LocContext.cpp",
|
||||
"loc_core_log.cpp",
|
||||
"data-items/DataItemsFactoryProxy.cpp",
|
||||
"SystemStatusOsObserver.cpp",
|
||||
"SystemStatus.cpp",
|
||||
],
|
||||
|
||||
cflags: [
|
||||
"-fno-short-enums",
|
||||
"-D_ANDROID_",
|
||||
] + GNSS_CFLAGS,
|
||||
|
||||
local_include_dirs: [
|
||||
"data-items",
|
||||
"observer",
|
||||
],
|
||||
|
||||
header_libs: [
|
||||
"libutils_headers",
|
||||
"libgps.utils_headers",
|
||||
"libloc_pla_headers",
|
||||
"liblocation_api_headers",
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
cc_library_headers {
|
||||
|
||||
name: "libloc_core_headers",
|
||||
vendor: true,
|
||||
export_include_dirs: ["."] + [
|
||||
"data-items",
|
||||
"observer",
|
||||
],
|
||||
}
|
||||
384
gps/core/ContextBase.cpp
Normal file
384
gps/core/ContextBase.cpp
Normal file
@@ -0,0 +1,384 @@
|
||||
/* Copyright (c) 2011-2014,2016-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_CtxBase"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
#include <ContextBase.h>
|
||||
#include <msg_q.h>
|
||||
#include <loc_target.h>
|
||||
#include <loc_pla.h>
|
||||
#include <loc_log.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
#define SLL_LOC_API_LIB_NAME "libsynergy_loc_api.so"
|
||||
#define LOC_APIV2_0_LIB_NAME "libloc_api_v02.so"
|
||||
#define IS_SS5_HW_ENABLED 1
|
||||
|
||||
loc_gps_cfg_s_type ContextBase::mGps_conf {};
|
||||
loc_sap_cfg_s_type ContextBase::mSap_conf {};
|
||||
bool ContextBase::sIsEngineCapabilitiesKnown = false;
|
||||
uint64_t ContextBase::sSupportedMsgMask = 0;
|
||||
bool ContextBase::sGnssMeasurementSupported = false;
|
||||
uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||
GnssNMEARptRate ContextBase::sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
|
||||
LocationCapabilitiesMask ContextBase::sQwesFeatureMask = 0;
|
||||
|
||||
const loc_param_s_type ContextBase::mGps_conf_table[] =
|
||||
{
|
||||
{"GPS_LOCK", &mGps_conf.GPS_LOCK, NULL, 'n'},
|
||||
{"SUPL_VER", &mGps_conf.SUPL_VER, NULL, 'n'},
|
||||
{"LPP_PROFILE", &mGps_conf.LPP_PROFILE, NULL, 'n'},
|
||||
{"A_GLONASS_POS_PROTOCOL_SELECT", &mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
||||
{"LPPE_CP_TECHNOLOGY", &mGps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'},
|
||||
{"LPPE_UP_TECHNOLOGY", &mGps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'},
|
||||
{"AGPS_CERT_WRITABLE_MASK", &mGps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
|
||||
{"SUPL_MODE", &mGps_conf.SUPL_MODE, NULL, 'n'},
|
||||
{"SUPL_ES", &mGps_conf.SUPL_ES, NULL, 'n'},
|
||||
{"INTERMEDIATE_POS", &mGps_conf.INTERMEDIATE_POS, NULL, 'n'},
|
||||
{"ACCURACY_THRES", &mGps_conf.ACCURACY_THRES, NULL, 'n'},
|
||||
{"NMEA_PROVIDER", &mGps_conf.NMEA_PROVIDER, NULL, 'n'},
|
||||
{"NMEA_REPORT_RATE", &mGps_conf.NMEA_REPORT_RATE, NULL, 's'},
|
||||
{"CAPABILITIES", &mGps_conf.CAPABILITIES, NULL, 'n'},
|
||||
{"XTRA_SERVER_1", &mGps_conf.XTRA_SERVER_1, NULL, 's'},
|
||||
{"XTRA_SERVER_2", &mGps_conf.XTRA_SERVER_2, NULL, 's'},
|
||||
{"XTRA_SERVER_3", &mGps_conf.XTRA_SERVER_3, NULL, 's'},
|
||||
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL",
|
||||
&mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
|
||||
{"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
|
||||
{"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
|
||||
{"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'},
|
||||
{"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'},
|
||||
{"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' },
|
||||
{"MO_SUPL_HOST", &mGps_conf.MO_SUPL_HOST, NULL, 's' },
|
||||
{"MO_SUPL_PORT", &mGps_conf.MO_SUPL_PORT, NULL, 'n' },
|
||||
{"CONSTRAINED_TIME_UNCERTAINTY_ENABLED",
|
||||
&mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED, NULL, 'n'},
|
||||
{"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD",
|
||||
&mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'},
|
||||
{"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET",
|
||||
&mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'},
|
||||
{"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED",
|
||||
&mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'},
|
||||
{"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' },
|
||||
{"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' },
|
||||
{"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'},
|
||||
{"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED",
|
||||
&mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'},
|
||||
{"NMEA_TAG_BLOCK_GROUPING_ENABLED", &mGps_conf.NMEA_TAG_BLOCK_GROUPING_ENABLED, NULL, 'n'},
|
||||
{"NI_SUPL_DENY_ON_NFW_LOCKED", &mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED, NULL, 'n'},
|
||||
{"ENABLE_NMEA_PRINT", &mGps_conf.ENABLE_NMEA_PRINT, NULL, 'n'}
|
||||
};
|
||||
|
||||
const loc_param_s_type ContextBase::mSap_conf_table[] =
|
||||
{
|
||||
{"GYRO_BIAS_RANDOM_WALK", &mSap_conf.GYRO_BIAS_RANDOM_WALK, &mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'},
|
||||
{"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"SENSOR_ACCEL_BATCHES_PER_SEC", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'},
|
||||
{"SENSOR_ACCEL_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'},
|
||||
{"SENSOR_GYRO_BATCHES_PER_SEC", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'},
|
||||
{"SENSOR_GYRO_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'},
|
||||
{"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
||||
{"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
||||
{"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
||||
{"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
||||
{"SENSOR_CONTROL_MODE", &mSap_conf.SENSOR_CONTROL_MODE, NULL, 'n'},
|
||||
{"SENSOR_ALGORITHM_CONFIG_MASK", &mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}
|
||||
};
|
||||
|
||||
void ContextBase::readConfig()
|
||||
{
|
||||
static bool confReadDone = false;
|
||||
if (!confReadDone) {
|
||||
confReadDone = true;
|
||||
/*Defaults for gps.conf*/
|
||||
mGps_conf.INTERMEDIATE_POS = 0;
|
||||
mGps_conf.ACCURACY_THRES = 0;
|
||||
mGps_conf.NMEA_PROVIDER = 0;
|
||||
mGps_conf.GPS_LOCK = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
|
||||
mGps_conf.SUPL_VER = 0x10000;
|
||||
mGps_conf.SUPL_MODE = 0x1;
|
||||
mGps_conf.SUPL_ES = 0;
|
||||
mGps_conf.CP_MTLR_ES = 0;
|
||||
mGps_conf.SUPL_HOST[0] = 0;
|
||||
mGps_conf.SUPL_PORT = 0;
|
||||
mGps_conf.CAPABILITIES = 0x7;
|
||||
/* LTE Positioning Profile configuration is disable by default*/
|
||||
mGps_conf.LPP_PROFILE = 0;
|
||||
/*By default no positioning protocol is selected on A-GLONASS system*/
|
||||
mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0;
|
||||
/*Use emergency PDN by default*/
|
||||
mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
|
||||
/* By default no LPPe CP technology is enabled*/
|
||||
mGps_conf.LPPE_CP_TECHNOLOGY = 0;
|
||||
/* By default no LPPe UP technology is enabled*/
|
||||
mGps_conf.LPPE_UP_TECHNOLOGY = 0;
|
||||
/* By default we use unknown modem type*/
|
||||
mGps_conf.MODEM_TYPE = 2;
|
||||
|
||||
/*Defaults for sap.conf*/
|
||||
mSap_conf.GYRO_BIAS_RANDOM_WALK = 0;
|
||||
mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
|
||||
mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
|
||||
mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
|
||||
mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
|
||||
mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
|
||||
mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
|
||||
mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
|
||||
mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
|
||||
mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
|
||||
mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
|
||||
/* Values MUST be set by OEMs in configuration for sensor-assisted
|
||||
navigation to work. There are NO default values */
|
||||
mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
|
||||
mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
|
||||
/* None of the 10 slots for agps certificates are writable by default */
|
||||
mGps_conf.AGPS_CERT_WRITABLE_MASK = 0;
|
||||
|
||||
/* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
|
||||
mGps_conf.AGPS_CONFIG_INJECT = 1;
|
||||
|
||||
/* default configuration value of constrained time uncertainty mode:
|
||||
feature disabled, time uncertainty threshold defined by modem,
|
||||
and unlimited power budget */
|
||||
#ifdef FEATURE_AUTOMOTIVE
|
||||
mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 1;
|
||||
#else
|
||||
mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0;
|
||||
#endif
|
||||
mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0;
|
||||
mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0;
|
||||
|
||||
/* default configuration value of position assisted clock estimator mode */
|
||||
mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0;
|
||||
/* default configuration QTI GNSS H/W */
|
||||
mGps_conf.GNSS_DEPLOYMENT = 0;
|
||||
mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0;
|
||||
/* default NMEA Tag Block Grouping is disabled */
|
||||
mGps_conf.NMEA_TAG_BLOCK_GROUPING_ENABLED = 0;
|
||||
/* default configuration for NI_SUPL_DENY_ON_NFW_LOCKED */
|
||||
mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED = 1;
|
||||
/* By default NMEA Printing is disabled */
|
||||
mGps_conf.ENABLE_NMEA_PRINT = 0;
|
||||
|
||||
UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
|
||||
UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
|
||||
|
||||
if (strncmp(mGps_conf.NMEA_REPORT_RATE, "1HZ", sizeof(mGps_conf.NMEA_REPORT_RATE)) == 0) {
|
||||
/* NMEA reporting is configured at 1Hz*/
|
||||
sNmeaReportRate = GNSS_NMEA_REPORT_RATE_1HZ;
|
||||
} else {
|
||||
sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
|
||||
}
|
||||
LOC_LOGI("%s] GNSS Deployment: %s", __FUNCTION__,
|
||||
((mGps_conf.GNSS_DEPLOYMENT == 1) ? "SS5" :
|
||||
((mGps_conf.GNSS_DEPLOYMENT == 2) ? "QFUSION" : "QGNSS")));
|
||||
|
||||
switch (getTargetGnssType(loc_get_target())) {
|
||||
case GNSS_GSS:
|
||||
case GNSS_AUTO:
|
||||
// For APQ targets, MSA/MSB capabilities should be reset
|
||||
mGps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ContextBase::getCarrierCapabilities() {
|
||||
#define carrierMSA (uint32_t)0x2
|
||||
#define carrierMSB (uint32_t)0x1
|
||||
#define gpsConfMSA (uint32_t)0x4
|
||||
#define gpsConfMSB (uint32_t)0x2
|
||||
uint32_t capabilities = mGps_conf.CAPABILITIES;
|
||||
if ((mGps_conf.SUPL_MODE & carrierMSA) != carrierMSA) {
|
||||
capabilities &= ~gpsConfMSA;
|
||||
}
|
||||
if ((mGps_conf.SUPL_MODE & carrierMSB) != carrierMSB) {
|
||||
capabilities &= ~gpsConfMSB;
|
||||
}
|
||||
|
||||
LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x",
|
||||
mGps_conf.CAPABILITIES, mGps_conf.SUPL_MODE, capabilities);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
|
||||
{
|
||||
LBSProxyBase* proxy = NULL;
|
||||
LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName);
|
||||
void* lib = dlopen(libName, RTLD_NOW);
|
||||
|
||||
if ((void*)NULL != lib) {
|
||||
getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy");
|
||||
if (NULL != getter) {
|
||||
proxy = (*getter)();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName);
|
||||
}
|
||||
if (NULL == proxy) {
|
||||
proxy = new LBSProxyBase();
|
||||
}
|
||||
LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__);
|
||||
return proxy;
|
||||
}
|
||||
|
||||
LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
||||
{
|
||||
LocApiBase* locApi = NULL;
|
||||
const char* libname = LOC_APIV2_0_LIB_NAME;
|
||||
|
||||
// Check the target
|
||||
if (TARGET_NO_GNSS != loc_get_target()){
|
||||
|
||||
if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) {
|
||||
void *handle = NULL;
|
||||
|
||||
if (IS_SS5_HW_ENABLED == mGps_conf.GNSS_DEPLOYMENT) {
|
||||
libname = SLL_LOC_API_LIB_NAME;
|
||||
}
|
||||
|
||||
if ((handle = dlopen(libname, RTLD_NOW)) != NULL) {
|
||||
LOC_LOGD("%s:%d]: %s is present", __func__, __LINE__, libname);
|
||||
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
|
||||
if (getter != NULL) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL of %s", __func__,
|
||||
__LINE__, libname);
|
||||
locApi = (*getter)(exMask, this);
|
||||
}
|
||||
}
|
||||
// only RPC is the option now
|
||||
else {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC",
|
||||
__func__, __LINE__);
|
||||
handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
|
||||
if (NULL != handle) {
|
||||
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
|
||||
if (NULL != getter) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__,
|
||||
__LINE__);
|
||||
locApi = (*getter)(exMask, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// locApi could still be NULL at this time
|
||||
// we would then create a dummy one
|
||||
if (NULL == locApi) {
|
||||
locApi = new LocApiBase(exMask, this);
|
||||
}
|
||||
|
||||
return locApi;
|
||||
}
|
||||
|
||||
ContextBase::ContextBase(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
const char* libName) :
|
||||
mLBSProxy(getLBSProxy(libName)),
|
||||
mMsgTask(msgTask),
|
||||
mLocApi(createLocApi(exMask)),
|
||||
mLocApiProxy(mLocApi->getLocApiProxy())
|
||||
{
|
||||
}
|
||||
|
||||
void ContextBase::setEngineCapabilities(uint64_t supportedMsgMask,
|
||||
uint8_t *featureList, bool gnssMeasurementSupported) {
|
||||
|
||||
if (ContextBase::sIsEngineCapabilitiesKnown == false) {
|
||||
ContextBase::sSupportedMsgMask = supportedMsgMask;
|
||||
ContextBase::sGnssMeasurementSupported = gnssMeasurementSupported;
|
||||
if (featureList != NULL) {
|
||||
memcpy((void *)ContextBase::sFeaturesSupported,
|
||||
(void *)featureList, sizeof(ContextBase::sFeaturesSupported));
|
||||
}
|
||||
|
||||
/* */
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION)) {
|
||||
static uint8_t isSapModeKnown = 0;
|
||||
|
||||
if (!isSapModeKnown) {
|
||||
/* Check if SAP is PREMIUM_ENV_AIDING in izat.conf */
|
||||
char conf_feature_sap[LOC_MAX_PARAM_STRING];
|
||||
loc_param_s_type izat_conf_feature_table[] =
|
||||
{
|
||||
{ "SAP", &conf_feature_sap, &isSapModeKnown, 's' }
|
||||
};
|
||||
UTIL_READ_CONF(LOC_PATH_IZAT_CONF, izat_conf_feature_table);
|
||||
|
||||
/* Disable this feature if SAP is not PREMIUM_ENV_AIDING in izat.conf */
|
||||
if (strcmp(conf_feature_sap, "PREMIUM_ENV_AIDING") != 0) {
|
||||
uint8_t arrayIndex = LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION >> 3;
|
||||
uint8_t bitPos = LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION & 7;
|
||||
|
||||
if (arrayIndex < MAX_FEATURE_LENGTH) {
|
||||
/* To disable the feature we need to reset the bit on the "bitPos"
|
||||
position, so shift a "1" to the left by "bitPos" */
|
||||
ContextBase::sFeaturesSupported[arrayIndex] &= ~(1 << bitPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ContextBase::sIsEngineCapabilitiesKnown = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ContextBase::isFeatureSupported(uint8_t featureVal)
|
||||
{
|
||||
uint8_t arrayIndex = featureVal >> 3;
|
||||
uint8_t bitPos = featureVal & 7;
|
||||
|
||||
if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
|
||||
return ((ContextBase::sFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
|
||||
}
|
||||
|
||||
bool ContextBase::gnssConstellationConfig() {
|
||||
return sGnssMeasurementSupported;
|
||||
}
|
||||
|
||||
}
|
||||
385
gps/core/ContextBase.h
Normal file
385
gps/core/ContextBase.h
Normal file
@@ -0,0 +1,385 @@
|
||||
/* Copyright (c) 2011-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.
|
||||
*
|
||||
*/
|
||||
#ifndef __LOC_CONTEXT_BASE__
|
||||
#define __LOC_CONTEXT_BASE__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <ctype.h>
|
||||
#include <MsgTask.h>
|
||||
#include <LocApiBase.h>
|
||||
#include <LBSProxyBase.h>
|
||||
#include <loc_cfg.h>
|
||||
#ifdef NO_UNORDERED_SET_OR_MAP
|
||||
#include <map>
|
||||
#else
|
||||
#include <unordered_map>
|
||||
#endif
|
||||
|
||||
/* GPS.conf support */
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
typedef struct loc_gps_cfg_s
|
||||
{
|
||||
uint32_t INTERMEDIATE_POS;
|
||||
uint32_t ACCURACY_THRES;
|
||||
uint32_t SUPL_VER;
|
||||
uint32_t SUPL_MODE;
|
||||
uint32_t SUPL_ES;
|
||||
uint32_t CAPABILITIES;
|
||||
uint32_t LPP_PROFILE;
|
||||
char XTRA_SERVER_1[LOC_MAX_PARAM_STRING];
|
||||
char XTRA_SERVER_2[LOC_MAX_PARAM_STRING];
|
||||
char XTRA_SERVER_3[LOC_MAX_PARAM_STRING];
|
||||
uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
|
||||
uint32_t NMEA_PROVIDER;
|
||||
char NMEA_REPORT_RATE[LOC_MAX_PARAM_NAME];
|
||||
GnssConfigGpsLock GPS_LOCK;
|
||||
uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
uint32_t AGPS_CERT_WRITABLE_MASK;
|
||||
uint32_t AGPS_CONFIG_INJECT;
|
||||
uint32_t LPPE_CP_TECHNOLOGY;
|
||||
uint32_t LPPE_UP_TECHNOLOGY;
|
||||
uint32_t EXTERNAL_DR_ENABLED;
|
||||
char SUPL_HOST[LOC_MAX_PARAM_STRING];
|
||||
uint32_t SUPL_PORT;
|
||||
uint32_t MODEM_TYPE;
|
||||
char MO_SUPL_HOST[LOC_MAX_PARAM_STRING];
|
||||
uint32_t MO_SUPL_PORT;
|
||||
uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENABLED;
|
||||
double CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD;
|
||||
uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET;
|
||||
uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED;
|
||||
char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING];
|
||||
uint32_t CP_MTLR_ES;
|
||||
uint32_t GNSS_DEPLOYMENT;
|
||||
uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED;
|
||||
uint32_t NI_SUPL_DENY_ON_NFW_LOCKED;
|
||||
uint32_t ENABLE_NMEA_PRINT;
|
||||
uint32_t NMEA_TAG_BLOCK_GROUPING_ENABLED;
|
||||
} loc_gps_cfg_s_type;
|
||||
|
||||
/* NOTE: the implementation of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
/* Meanwhile, *_valid fields are 8 bit fields, and 'f'
|
||||
fields are double. Rigid as they are, it is the
|
||||
the status quo, until the parsing mechanism is
|
||||
changed, that is. */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
|
||||
double GYRO_BIAS_RANDOM_WALK;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_CONTROL_MODE;
|
||||
uint32_t SENSOR_ALGORITHM_CONFIG_MASK;
|
||||
uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ANGLE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double RATE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
} loc_sap_cfg_s_type;
|
||||
|
||||
using namespace loc_util;
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterBase;
|
||||
|
||||
class ContextBase {
|
||||
static LBSProxyBase* getLBSProxy(const char* libName);
|
||||
LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask);
|
||||
static const loc_param_s_type mGps_conf_table[];
|
||||
static const loc_param_s_type mSap_conf_table[];
|
||||
protected:
|
||||
const LBSProxyBase* mLBSProxy;
|
||||
const MsgTask* mMsgTask;
|
||||
LocApiBase* mLocApi;
|
||||
LocApiProxyBase *mLocApiProxy;
|
||||
|
||||
public:
|
||||
ContextBase(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
const char* libName);
|
||||
inline virtual ~ContextBase() {
|
||||
if (nullptr != mLocApi) {
|
||||
mLocApi->destroy();
|
||||
mLocApi = nullptr;
|
||||
}
|
||||
if (nullptr != mLBSProxy) {
|
||||
delete mLBSProxy;
|
||||
mLBSProxy = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
inline const MsgTask* getMsgTask() { return mMsgTask; }
|
||||
inline LocApiBase* getLocApi() { return mLocApi; }
|
||||
inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; }
|
||||
inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); }
|
||||
inline bool hasNativeXtraClient() { return mLBSProxy->hasNativeXtraClient(); }
|
||||
inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); }
|
||||
inline IzatDevId_t getIzatDevId() const {
|
||||
return mLBSProxy->getIzatDevId();
|
||||
}
|
||||
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
|
||||
|
||||
static loc_gps_cfg_s_type mGps_conf;
|
||||
static loc_sap_cfg_s_type mSap_conf;
|
||||
static bool sIsEngineCapabilitiesKnown;
|
||||
static uint64_t sSupportedMsgMask;
|
||||
static uint8_t sFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||
static bool sGnssMeasurementSupported;
|
||||
static GnssNMEARptRate sNmeaReportRate;
|
||||
static LocationCapabilitiesMask sQwesFeatureMask;
|
||||
|
||||
void readConfig();
|
||||
static uint32_t getCarrierCapabilities();
|
||||
void setEngineCapabilities(uint64_t supportedMsgMask,
|
||||
uint8_t *featureList, bool gnssMeasurementSupported);
|
||||
|
||||
static inline bool isEngineCapabilitiesKnown() {
|
||||
return sIsEngineCapabilitiesKnown;
|
||||
}
|
||||
|
||||
static inline bool isMessageSupported(LocCheckingMessagesID msgID) {
|
||||
|
||||
// confirm if msgID is not larger than the number of bits in
|
||||
// mSupportedMsg
|
||||
if ((uint64_t)msgID > (sizeof(sSupportedMsgMask) << 3)) {
|
||||
return false;
|
||||
} else {
|
||||
uint32_t messageChecker = 1 << msgID;
|
||||
return (messageChecker & sSupportedMsgMask) == messageChecker;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Check if a feature is supported
|
||||
*/
|
||||
static bool isFeatureSupported(uint8_t featureVal);
|
||||
|
||||
/*
|
||||
Check if gnss measurement is supported
|
||||
*/
|
||||
static bool gnssConstellationConfig();
|
||||
|
||||
/*
|
||||
set QWES feature status info
|
||||
*/
|
||||
static inline void setQwesFeatureStatus(
|
||||
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap) {
|
||||
std::unordered_map<LocationQwesFeatureType, bool>::const_iterator itr;
|
||||
static LocationQwesFeatureType locQwesFeatType[LOCATION_QWES_FEATURE_TYPE_MAX];
|
||||
for (itr = featureMap.begin(); itr != featureMap.end(); ++itr) {
|
||||
LOC_LOGi("Feature : %d isValid: %d", itr->first, itr->second);
|
||||
locQwesFeatType[itr->first] = itr->second;
|
||||
switch (itr->first) {
|
||||
case LOCATION_QWES_FEATURE_TYPE_CARRIER_PHASE:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_SV_POLYNOMIAL:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_GNSS_SINGLE_FREQUENCY:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_SV_EPH:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_GNSS_MULTI_FREQUENCY:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_PPE:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_PPE;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_PPE;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_QDR2:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_QDR2;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_QDR2;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_QDR3:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_QDR3;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_QDR3;
|
||||
}
|
||||
break;
|
||||
case LOCATION_QWES_FEATURE_TYPE_VPE:
|
||||
if (itr->second) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_VPE;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_VPE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Set CV2X basic when time freq and tunc is set
|
||||
// CV2X_BASIC = LOCATION_QWES_FEATURE_TYPE_TIME_FREQUENCY &
|
||||
// LOCATION_QWES_FEATURE_TYPE_TIME_UNCERTAINTY
|
||||
|
||||
// Set CV2X premium when time freq and tunc is set
|
||||
// CV2X_PREMIUM = CV2X_BASIC & LOCATION_QWES_FEATURE_TYPE_QDR3 &
|
||||
// LOCATION_QWES_FEATURE_TYPE_CLOCK_ESTIMATE
|
||||
|
||||
bool cv2xBasicEnabled = (1 == locQwesFeatType[LOCATION_QWES_FEATURE_TYPE_TIME_FREQUENCY]) &&
|
||||
(1 == locQwesFeatType[LOCATION_QWES_FEATURE_TYPE_TIME_UNCERTAINTY]);
|
||||
bool cv2xPremiumEnabled = cv2xBasicEnabled &&
|
||||
(1 == locQwesFeatType[LOCATION_QWES_FEATURE_TYPE_QDR3]) &&
|
||||
(1 == locQwesFeatType[LOCATION_QWES_FEATURE_TYPE_CLOCK_ESTIMATE]);
|
||||
|
||||
LOC_LOGd("CV2X_BASIC:%d, CV2X_PREMIUM:%d", cv2xBasicEnabled, cv2xPremiumEnabled);
|
||||
if (cv2xBasicEnabled) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC;
|
||||
}
|
||||
if (cv2xPremiumEnabled) {
|
||||
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM;
|
||||
} else {
|
||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
get QWES feature status info
|
||||
*/
|
||||
static inline LocationCapabilitiesMask getQwesFeatureStatus() {
|
||||
return (ContextBase::sQwesFeatureMask);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct LocApiResponse: LocMsg {
|
||||
private:
|
||||
ContextBase& mContext;
|
||||
std::function<void (LocationError err)> mProcImpl;
|
||||
inline virtual void proc() const {
|
||||
mProcImpl(mLocationError);
|
||||
}
|
||||
protected:
|
||||
LocationError mLocationError;
|
||||
public:
|
||||
inline LocApiResponse(ContextBase& context,
|
||||
std::function<void (LocationError err)> procImpl ) :
|
||||
mContext(context), mProcImpl(procImpl) {}
|
||||
|
||||
void returnToSender(const LocationError err) {
|
||||
mLocationError = err;
|
||||
mContext.sendMsg(this);
|
||||
}
|
||||
};
|
||||
|
||||
struct LocApiCollectiveResponse: LocMsg {
|
||||
private:
|
||||
ContextBase& mContext;
|
||||
std::function<void (std::vector<LocationError> errs)> mProcImpl;
|
||||
inline virtual void proc() const {
|
||||
mProcImpl(mLocationErrors);
|
||||
}
|
||||
protected:
|
||||
std::vector<LocationError> mLocationErrors;
|
||||
public:
|
||||
inline LocApiCollectiveResponse(ContextBase& context,
|
||||
std::function<void (std::vector<LocationError> errs)> procImpl ) :
|
||||
mContext(context), mProcImpl(procImpl) {}
|
||||
inline virtual ~LocApiCollectiveResponse() {
|
||||
}
|
||||
|
||||
void returnToSender(std::vector<LocationError>& errs) {
|
||||
mLocationErrors = errs;
|
||||
mContext.sendMsg(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename DATA>
|
||||
struct LocApiResponseData: LocMsg {
|
||||
private:
|
||||
ContextBase& mContext;
|
||||
std::function<void (LocationError err, DATA data)> mProcImpl;
|
||||
inline virtual void proc() const {
|
||||
mProcImpl(mLocationError, mData);
|
||||
}
|
||||
protected:
|
||||
LocationError mLocationError;
|
||||
DATA mData;
|
||||
public:
|
||||
inline LocApiResponseData(ContextBase& context,
|
||||
std::function<void (LocationError err, DATA data)> procImpl ) :
|
||||
mContext(context), mProcImpl(procImpl) {}
|
||||
|
||||
void returnToSender(const LocationError err, const DATA data) {
|
||||
mLocationError = err;
|
||||
mData = data;
|
||||
mContext.sendMsg(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif //__LOC_CONTEXT_BASE__
|
||||
160
gps/core/EngineHubProxyBase.h
Normal file
160
gps/core/EngineHubProxyBase.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef ENGINE_HUB_PROXY_BASE_H
|
||||
#define ENGINE_HUB_PROXY_BASE_H
|
||||
#ifdef NO_UNORDERED_SET_OR_MAP
|
||||
#include <map>
|
||||
#else
|
||||
#include <unordered_map>
|
||||
#endif
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
using namespace loc_util;
|
||||
|
||||
class EngineHubProxyBase {
|
||||
public:
|
||||
inline EngineHubProxyBase() {
|
||||
}
|
||||
inline virtual ~EngineHubProxyBase() {}
|
||||
|
||||
// gnss session related functions
|
||||
inline virtual bool gnssStartFix() {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssStopFix() {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssSetFixMode(const LocPosMode ¶ms) {
|
||||
(void) params;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssDeleteAidingData(const GnssAidingData &aidingData) {
|
||||
(void) aidingData;
|
||||
return false;
|
||||
}
|
||||
|
||||
// GNSS reports
|
||||
inline virtual bool gnssReportPosition(const UlpLocation &location,
|
||||
const GpsLocationExtended &locationExtended,
|
||||
enum loc_sess_status status) {
|
||||
(void) location;
|
||||
(void) locationExtended;
|
||||
(void) status;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportSv(const GnssSvNotification& svNotify) {
|
||||
(void) svNotify;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportSvMeasurement(const GnssSvMeasurementSet& svMeasurementSet) {
|
||||
(void) svMeasurementSet;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportSvPolynomial(const GnssSvPolynomial& svPolynomial) {
|
||||
(void) svPolynomial;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) {
|
||||
(void) svEphemeris;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) {
|
||||
(void) systemInfo;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportKlobucharIonoModel(const GnssKlobucharIonoModel& ionoModel) {
|
||||
(void) ionoModel;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool gnssReportAdditionalSystemInfo(
|
||||
const GnssAdditionalSystemInfo& additionalSystemInfo) {
|
||||
(void) additionalSystemInfo;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) {
|
||||
(void) configInfo;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool configDeadReckoningEngineParams(
|
||||
const DeadReckoningEngineConfig& dreConfig) {
|
||||
(void) dreConfig;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool configEngineRunState(
|
||||
PositioningEngineMask engType, LocEngineRunState engState) {
|
||||
(void) engType;
|
||||
(void) engState;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::function<void(int count, EngineLocationInfo* locationArr)>
|
||||
GnssAdapterReportEnginePositionsEventCb;
|
||||
|
||||
typedef std::function<void(const GnssSvNotification& svNotify,
|
||||
bool fromEngineHub)>
|
||||
GnssAdapterReportSvEventCb;
|
||||
|
||||
typedef std::function<void(const GnssAidingDataSvMask& svDataMask)>
|
||||
GnssAdapterReqAidingDataCb;
|
||||
|
||||
typedef std::function<void(bool nHzNeeded, bool nHzMeasNeeded)>
|
||||
GnssAdapterUpdateNHzRequirementCb;
|
||||
|
||||
typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, bool> &featureMap)>
|
||||
GnssAdapterUpdateQwesFeatureStatusCb;
|
||||
|
||||
// potential parameters: message queue: MsgTask * msgTask;
|
||||
// callback function to report back dr and ppe position and sv report
|
||||
typedef EngineHubProxyBase* (getEngHubProxyFn)(
|
||||
const MsgTask * msgTask,
|
||||
IOsObserver* osObserver,
|
||||
GnssAdapterReportEnginePositionsEventCb positionEventCb,
|
||||
GnssAdapterReportSvEventCb svEventCb,
|
||||
GnssAdapterReqAidingDataCb reqAidingDataCb,
|
||||
GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb,
|
||||
GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb);
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif // ENGINE_HUB_PROXY_BASE_H
|
||||
70
gps/core/LBSProxyBase.h
Normal file
70
gps/core/LBSProxyBase.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/* Copyright (c) 2013-2015, 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 IZAT_PROXY_BASE_H
|
||||
#define IZAT_PROXY_BASE_H
|
||||
#include <gps_extended.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocApiBase;
|
||||
class LocAdapterBase;
|
||||
class ContextBase;
|
||||
|
||||
class LBSProxyBase {
|
||||
friend class ContextBase;
|
||||
inline virtual LocApiBase*
|
||||
getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase* context) const {
|
||||
|
||||
(void)exMask;
|
||||
(void)context;
|
||||
return NULL;
|
||||
}
|
||||
protected:
|
||||
inline LBSProxyBase() {}
|
||||
public:
|
||||
inline virtual ~LBSProxyBase() {}
|
||||
inline virtual bool hasAgpsExtendedCapabilities() const { return false; }
|
||||
inline virtual void modemPowerVote(bool power) const {
|
||||
|
||||
(void)power;
|
||||
}
|
||||
virtual void injectFeatureConfig(ContextBase* context) const {
|
||||
|
||||
(void)context;
|
||||
}
|
||||
inline virtual bool hasNativeXtraClient() const { return false; }
|
||||
inline virtual IzatDevId_t getIzatDevId() const { return 0; }
|
||||
};
|
||||
|
||||
typedef LBSProxyBase* (getLBSProxy_t)();
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif // IZAT_PROXY_BASE_H
|
||||
439
gps/core/LocAdapterBase.cpp
Normal file
439
gps/core/LocAdapterBase.cpp
Normal file
@@ -0,0 +1,439 @@
|
||||
/* Copyright (c) 2011-2014, 2016-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_LocAdapterBase"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <LocAdapterBase.h>
|
||||
#include <loc_target.h>
|
||||
#include <log_util.h>
|
||||
#include <LocAdapterProxyBase.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
// This is the top level class, so the constructor will
|
||||
// always gets called. Here we prepare for the default.
|
||||
// But if getLocApi(targetEnumType target) is overriden,
|
||||
// the right locApi should get created.
|
||||
LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, bool isMaster,
|
||||
LocAdapterProxyBase *adapterProxyBase,
|
||||
bool waitForDoneInit) :
|
||||
mIsMaster(isMaster),
|
||||
mIsEngineCapabilitiesKnown(ContextBase::sIsEngineCapabilitiesKnown),
|
||||
mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()),
|
||||
mLocAdapterProxyBase(adapterProxyBase), mMsgTask(context->getMsgTask())
|
||||
{
|
||||
LOC_LOGd("waitForDoneInit: %d", waitForDoneInit);
|
||||
if (!waitForDoneInit) {
|
||||
mLocApi->addAdapter(this);
|
||||
mAdapterAdded = true;
|
||||
} else {
|
||||
mAdapterAdded = false;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t LocAdapterBase::mSessionIdCounter(1);
|
||||
|
||||
uint32_t LocAdapterBase::generateSessionId()
|
||||
{
|
||||
if (++mSessionIdCounter == 0xFFFFFFFF)
|
||||
mSessionIdCounter = 1;
|
||||
|
||||
return mSessionIdCounter;
|
||||
}
|
||||
|
||||
void LocAdapterBase::handleEngineUpEvent()
|
||||
{
|
||||
if (mLocAdapterProxyBase) {
|
||||
mLocAdapterProxyBase->handleEngineUpEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void LocAdapterBase::handleEngineDownEvent()
|
||||
{
|
||||
if (mLocAdapterProxyBase) {
|
||||
mLocAdapterProxyBase->handleEngineDownEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportPositionEvent(const UlpLocation& location,
|
||||
const GpsLocationExtended& locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask,
|
||||
GnssDataNotification* pDataNotify __unused,
|
||||
int msInWeek __unused)
|
||||
{
|
||||
if (mLocAdapterProxyBase != NULL) {
|
||||
mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location,
|
||||
(GpsLocationExtended&)locationExtended,
|
||||
status,
|
||||
loc_technology_mask);
|
||||
} else {
|
||||
DEFAULT_IMPL()
|
||||
}
|
||||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvEvent(const GnssSvNotification& /*svNotify*/,
|
||||
bool /*fromEngineHub*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvPolynomialEvent(GnssSvPolynomial &/*svPolynomial*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvEphemerisEvent(GnssSvEphemerisReport &/*svEphemeris*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
|
||||
void LocAdapterBase::
|
||||
reportStatus(LocGpsStatusValue /*status*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
|
||||
void LocAdapterBase::
|
||||
reportNmeaEvent(const char* /*nmea*/, size_t /*length*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportDataEvent(const GnssDataNotification& /*dataNotify*/,
|
||||
int /*msInWeek*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportXtraServer(const char* /*url1*/, const char* /*url2*/,
|
||||
const char* /*url3*/, const int /*maxlength*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
reportLocationSystemInfoEvent(const LocationSystemInfo& /*locationSystemInfo*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestXtraData()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestTime()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestLocation()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/,
|
||||
LocApnTypeMask /*apn_type_mask*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
releaseATL(int /*connHandle*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestNiNotifyEvent(const GnssNiNotification &/*notify*/,
|
||||
const void* /*data*/,
|
||||
const LocInEmergency /*emergencyState*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
reportGnssMeasurementsEvent(const GnssMeasurements& /*gnssMeasurements*/,
|
||||
int /*msInWeek*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportWwanZppFix(LocGpsLocation &/*zppLoc*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportZppBestAvailableFix(LocGpsLocation& /*zppLoc*/,
|
||||
GpsLocationExtended& /*location_extended*/, LocPosTechMask /*tech_mask*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::reportGnssSvIdConfigEvent(const GnssSvIdConfig& /*config*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& /*config*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::reportGnssConfigEvent(uint32_t, /* session id*/
|
||||
const GnssConfig& /*gnssConfig*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestOdcpiEvent(OdcpiRequestInfo& /*request*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportGnssEngEnergyConsumedEvent(uint64_t /*energyConsumedSinceFirstBoot*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportDeleteAidingDataEvent(GnssAidingData & /*aidingData*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportKlobucharIonoModelEvent(GnssKlobucharIonoModel& /*ionoModel*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportGnssAdditionalSystemInfoEvent(GnssAdditionalSystemInfo& /*additionalSystemInfo*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
reportNfwNotificationEvent(GnssNfwNotification& /*notification*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::geofenceBreachEvent(size_t /*count*/, uint32_t* /*hwIds*/, Location& /*location*/,
|
||||
GeofenceBreachType /*breachType*/, uint64_t /*timestamp*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::geofenceStatusEvent(GeofenceStatusAvailable /*available*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::reportLocationsEvent(const Location* /*locations*/, size_t /*count*/,
|
||||
BatchingMode /*batchingMode*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::reportCompletedTripsEvent(uint32_t /*accumulated_distance*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::reportBatchStatusChangeEvent(BatchingStatus /*batchStatus*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::reportPositionEvent(UlpLocation& /*location*/,
|
||||
GpsLocationExtended& /*locationExtended*/,
|
||||
enum loc_sess_status /*status*/,
|
||||
LocPosTechMask /*loc_technology_mask*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::saveClient(LocationAPI* client, const LocationCallbacks& callbacks)
|
||||
{
|
||||
mClientData[client] = callbacks;
|
||||
updateClientsEventMask();
|
||||
}
|
||||
|
||||
void
|
||||
LocAdapterBase::eraseClient(LocationAPI* client)
|
||||
{
|
||||
auto it = mClientData.find(client);
|
||||
if (it != mClientData.end()) {
|
||||
mClientData.erase(it);
|
||||
}
|
||||
updateClientsEventMask();
|
||||
}
|
||||
|
||||
LocationCallbacks
|
||||
LocAdapterBase::getClientCallbacks(LocationAPI* client)
|
||||
{
|
||||
LocationCallbacks callbacks = {};
|
||||
auto it = mClientData.find(client);
|
||||
if (it != mClientData.end()) {
|
||||
callbacks = it->second;
|
||||
}
|
||||
return callbacks;
|
||||
}
|
||||
|
||||
LocationCapabilitiesMask
|
||||
LocAdapterBase::getCapabilities()
|
||||
{
|
||||
LocationCapabilitiesMask mask = 0;
|
||||
|
||||
if (isEngineCapabilitiesKnown()) {
|
||||
// time based tracking always supported
|
||||
mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT;
|
||||
if (ContextBase::isMessageSupported(
|
||||
LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)){
|
||||
mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT |
|
||||
LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT;
|
||||
}
|
||||
if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) {
|
||||
mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT;
|
||||
}
|
||||
if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) {
|
||||
mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT;
|
||||
}
|
||||
// geofence always supported
|
||||
mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT;
|
||||
if (ContextBase::gnssConstellationConfig()) {
|
||||
mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT;
|
||||
}
|
||||
uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities();
|
||||
if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) {
|
||||
mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT;
|
||||
}
|
||||
if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) {
|
||||
mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
|
||||
mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) {
|
||||
mask |= LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) {
|
||||
mask |= LOCATION_CAPABILITIES_AGPM_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_LOCATION_PRIVACY)) {
|
||||
mask |= LOCATION_CAPABILITIES_PRIVACY_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION)) {
|
||||
mask |= LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_ROBUST_LOCATION)) {
|
||||
mask |= LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_EDGNSS)) {
|
||||
mask |= LOCATION_CAPABILITIES_EDGNSS_BIT;
|
||||
}
|
||||
} else {
|
||||
LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__);
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
void
|
||||
LocAdapterBase::broadcastCapabilities(LocationCapabilitiesMask mask)
|
||||
{
|
||||
for (auto clientData : mClientData) {
|
||||
if (nullptr != clientData.second.capabilitiesCb) {
|
||||
clientData.second.capabilitiesCb(mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LocAdapterBase::updateClientsEventMask()
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::stopClientSessions(LocationAPI* /*client*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void
|
||||
LocAdapterBase::addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks)
|
||||
{
|
||||
LOC_LOGD("%s]: client %p", __func__, client);
|
||||
|
||||
struct MsgAddClient : public LocMsg {
|
||||
LocAdapterBase& mAdapter;
|
||||
LocationAPI* mClient;
|
||||
const LocationCallbacks mCallbacks;
|
||||
inline MsgAddClient(LocAdapterBase& adapter,
|
||||
LocationAPI* client,
|
||||
const LocationCallbacks& callbacks) :
|
||||
LocMsg(),
|
||||
mAdapter(adapter),
|
||||
mClient(client),
|
||||
mCallbacks(callbacks) {}
|
||||
inline virtual void proc() const {
|
||||
mAdapter.saveClient(mClient, mCallbacks);
|
||||
}
|
||||
};
|
||||
|
||||
sendMsg(new MsgAddClient(*this, client, callbacks));
|
||||
}
|
||||
|
||||
void
|
||||
LocAdapterBase::removeClientCommand(LocationAPI* client,
|
||||
removeClientCompleteCallback rmClientCb)
|
||||
{
|
||||
LOC_LOGD("%s]: client %p", __func__, client);
|
||||
|
||||
struct MsgRemoveClient : public LocMsg {
|
||||
LocAdapterBase& mAdapter;
|
||||
LocationAPI* mClient;
|
||||
removeClientCompleteCallback mRmClientCb;
|
||||
inline MsgRemoveClient(LocAdapterBase& adapter,
|
||||
LocationAPI* client,
|
||||
removeClientCompleteCallback rmCb) :
|
||||
LocMsg(),
|
||||
mAdapter(adapter),
|
||||
mClient(client),
|
||||
mRmClientCb(rmCb){}
|
||||
inline virtual void proc() const {
|
||||
mAdapter.stopClientSessions(mClient);
|
||||
mAdapter.eraseClient(mClient);
|
||||
if (nullptr != mRmClientCb) {
|
||||
(mRmClientCb)(mClient);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sendMsg(new MsgRemoveClient(*this, client, rmClientCb));
|
||||
}
|
||||
|
||||
void
|
||||
LocAdapterBase::requestCapabilitiesCommand(LocationAPI* client)
|
||||
{
|
||||
LOC_LOGD("%s]: ", __func__);
|
||||
|
||||
struct MsgRequestCapabilities : public LocMsg {
|
||||
LocAdapterBase& mAdapter;
|
||||
LocationAPI* mClient;
|
||||
inline MsgRequestCapabilities(LocAdapterBase& adapter,
|
||||
LocationAPI* client) :
|
||||
LocMsg(),
|
||||
mAdapter(adapter),
|
||||
mClient(client) {}
|
||||
inline virtual void proc() const {
|
||||
if (!mAdapter.isEngineCapabilitiesKnown()) {
|
||||
mAdapter.mPendingMsgs.push_back(new MsgRequestCapabilities(*this));
|
||||
return;
|
||||
}
|
||||
LocationCallbacks callbacks = mAdapter.getClientCallbacks(mClient);
|
||||
if (callbacks.capabilitiesCb != nullptr) {
|
||||
callbacks.capabilitiesCb(mAdapter.getCapabilities());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sendMsg(new MsgRequestCapabilities(*this, client));
|
||||
}
|
||||
|
||||
void
|
||||
LocAdapterBase::reportLatencyInfoEvent(const GnssLatencyInfo& /*gnssLatencyInfo*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportQwesCapabilities(const std::unordered_map<LocationQwesFeatureType, bool> &/*featureMap*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
} // namespace loc_core
|
||||
246
gps/core/LocAdapterBase.h
Normal file
246
gps/core/LocAdapterBase.h
Normal file
@@ -0,0 +1,246 @@
|
||||
/* Copyright (c) 2011-2014, 2016-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.
|
||||
*
|
||||
*/
|
||||
#ifndef LOC_API_ADAPTER_BASE_H
|
||||
#define LOC_API_ADAPTER_BASE_H
|
||||
|
||||
#include <gps_extended.h>
|
||||
#include <ContextBase.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <map>
|
||||
|
||||
#define MIN_TRACKING_INTERVAL (100) // 100 msec
|
||||
|
||||
typedef struct LocationSessionKey {
|
||||
LocationAPI* client;
|
||||
uint32_t id;
|
||||
inline LocationSessionKey(LocationAPI* _client, uint32_t _id) :
|
||||
client(_client), id(_id) {}
|
||||
} LocationSessionKey;
|
||||
inline bool operator <(LocationSessionKey const& left, LocationSessionKey const& right) {
|
||||
return left.id < right.id || (left.id == right.id && left.client < right.client);
|
||||
}
|
||||
inline bool operator ==(LocationSessionKey const& left, LocationSessionKey const& right) {
|
||||
return left.id == right.id && left.client == right.client;
|
||||
}
|
||||
inline bool operator !=(LocationSessionKey const& left, LocationSessionKey const& right) {
|
||||
return left.id != right.id || left.client != right.client;
|
||||
}
|
||||
|
||||
typedef void (*removeClientCompleteCallback)(LocationAPI* client);
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterProxyBase;
|
||||
|
||||
class LocAdapterBase {
|
||||
private:
|
||||
static uint32_t mSessionIdCounter;
|
||||
const bool mIsMaster;
|
||||
bool mIsEngineCapabilitiesKnown = false;
|
||||
|
||||
protected:
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
|
||||
ContextBase* mContext;
|
||||
LocApiBase* mLocApi;
|
||||
LocAdapterProxyBase* mLocAdapterProxyBase;
|
||||
const MsgTask* mMsgTask;
|
||||
bool mAdapterAdded;
|
||||
|
||||
inline LocAdapterBase(const MsgTask* msgTask) :
|
||||
mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL),
|
||||
mLocAdapterProxyBase(NULL), mMsgTask(msgTask), mAdapterAdded(false) {}
|
||||
|
||||
/* ==== CLIENT ========================================================================= */
|
||||
typedef std::map<LocationAPI*, LocationCallbacks> ClientDataMap;
|
||||
ClientDataMap mClientData;
|
||||
std::vector<LocMsg*> mPendingMsgs; // For temporal storage of msgs before Open is completed
|
||||
/* ======== UTILITIES ================================================================== */
|
||||
void saveClient(LocationAPI* client, const LocationCallbacks& callbacks);
|
||||
void eraseClient(LocationAPI* client);
|
||||
LocationCallbacks getClientCallbacks(LocationAPI* client);
|
||||
LocationCapabilitiesMask getCapabilities();
|
||||
void broadcastCapabilities(LocationCapabilitiesMask mask);
|
||||
virtual void updateClientsEventMask();
|
||||
virtual void stopClientSessions(LocationAPI* client);
|
||||
|
||||
public:
|
||||
inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
|
||||
// When waitForDoneInit is not specified or specified as false,
|
||||
// handleEngineUpEvent may be called on the child adapter object from
|
||||
// a different thread before the constructor of the child
|
||||
// object finishes.
|
||||
//
|
||||
// If the handleEngineUpEvent relies on member variables of the constructor
|
||||
// of the child adapter to be initialized first, we need to specify the
|
||||
// waitForDoneInit to *TRUE* to delay handleEngineUpEvent to get called
|
||||
// until when the child adapter finishes its initialization and notify
|
||||
// LocAdapterBase via doneInit method.
|
||||
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, bool isMaster = false,
|
||||
LocAdapterProxyBase *adapterProxyBase = NULL,
|
||||
bool waitForDoneInit = false);
|
||||
|
||||
inline void doneInit() {
|
||||
if (!mAdapterAdded) {
|
||||
mLocApi->addAdapter(this);
|
||||
mAdapterAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
inline LOC_API_ADAPTER_EVENT_MASK_T
|
||||
checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {
|
||||
return mEvtMask & mask;
|
||||
}
|
||||
|
||||
inline LOC_API_ADAPTER_EVENT_MASK_T getEvtMask() const {
|
||||
return mEvtMask;
|
||||
}
|
||||
|
||||
inline void sendMsg(const LocMsg* msg) const {
|
||||
mMsgTask->sendMsg(msg);
|
||||
}
|
||||
|
||||
inline void sendMsg(const LocMsg* msg) {
|
||||
mMsgTask->sendMsg(msg);
|
||||
}
|
||||
|
||||
inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status status)
|
||||
{
|
||||
switch(status) {
|
||||
case (LOC_REGISTRATION_MASK_ENABLED):
|
||||
mEvtMask = mEvtMask | event;
|
||||
break;
|
||||
case (LOC_REGISTRATION_MASK_DISABLED):
|
||||
mEvtMask = mEvtMask &~ event;
|
||||
break;
|
||||
case (LOC_REGISTRATION_MASK_SET):
|
||||
mEvtMask = event;
|
||||
break;
|
||||
}
|
||||
mLocApi->updateEvtMask();
|
||||
}
|
||||
|
||||
inline void updateNmeaMask(uint32_t mask)
|
||||
{
|
||||
mLocApi->updateNmeaMask(mask);
|
||||
}
|
||||
|
||||
inline bool isFeatureSupported(uint8_t featureVal) {
|
||||
return ContextBase::isFeatureSupported(featureVal);
|
||||
}
|
||||
|
||||
static uint32_t generateSessionId();
|
||||
|
||||
inline bool isAdapterMaster() {
|
||||
return mIsMaster;
|
||||
}
|
||||
|
||||
inline bool isEngineCapabilitiesKnown() { return mIsEngineCapabilitiesKnown;}
|
||||
inline void setEngineCapabilitiesKnown(bool value) { mIsEngineCapabilitiesKnown = value;}
|
||||
|
||||
virtual void handleEngineUpEvent();
|
||||
virtual void handleEngineDownEvent();
|
||||
virtual void reportPositionEvent(const UlpLocation& location,
|
||||
const GpsLocationExtended& locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask,
|
||||
GnssDataNotification* pDataNotify = nullptr,
|
||||
int msInWeek = -1);
|
||||
virtual void reportEnginePositionsEvent(unsigned int count,
|
||||
EngineLocationInfo* locationArr) {
|
||||
(void)count;
|
||||
(void)locationArr;
|
||||
}
|
||||
virtual void reportSvEvent(const GnssSvNotification& svNotify,
|
||||
bool fromEngineHub=false);
|
||||
virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek);
|
||||
virtual void reportNmeaEvent(const char* nmea, size_t length);
|
||||
virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial);
|
||||
virtual void reportSvEphemerisEvent(GnssSvEphemerisReport &svEphemeris);
|
||||
virtual void reportStatus(LocGpsStatusValue status);
|
||||
virtual bool reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength);
|
||||
virtual void reportLocationSystemInfoEvent(const LocationSystemInfo& locationSystemInfo);
|
||||
|
||||
virtual bool requestXtraData();
|
||||
virtual bool requestTime();
|
||||
virtual bool requestLocation();
|
||||
virtual bool requestATL(int connHandle, LocAGpsType agps_type,
|
||||
LocApnTypeMask apn_type_mask);
|
||||
virtual bool releaseATL(int connHandle);
|
||||
virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data,
|
||||
const LocInEmergency emergencyState);
|
||||
inline virtual bool isInSession() { return false; }
|
||||
ContextBase* getContext() const { return mContext; }
|
||||
virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements,
|
||||
int msInWeek);
|
||||
virtual bool reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||
virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc,
|
||||
GpsLocationExtended &location_extended, LocPosTechMask tech_mask);
|
||||
virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config);
|
||||
virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config);
|
||||
virtual void reportGnssConfigEvent(uint32_t sessionId, const GnssConfig& gnssConfig);
|
||||
virtual bool requestOdcpiEvent(OdcpiRequestInfo& request);
|
||||
virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot);
|
||||
virtual bool reportDeleteAidingDataEvent(GnssAidingData &aidingData);
|
||||
virtual bool reportKlobucharIonoModelEvent(GnssKlobucharIonoModel& ionoModel);
|
||||
virtual bool reportGnssAdditionalSystemInfoEvent(
|
||||
GnssAdditionalSystemInfo& additionalSystemInfo);
|
||||
virtual void reportNfwNotificationEvent(GnssNfwNotification& notification);
|
||||
|
||||
virtual void geofenceBreachEvent(size_t count, uint32_t* hwIds, Location& location,
|
||||
GeofenceBreachType breachType, uint64_t timestamp);
|
||||
virtual void geofenceStatusEvent(GeofenceStatusAvailable available);
|
||||
|
||||
virtual void reportPositionEvent(UlpLocation &location,
|
||||
GpsLocationExtended &locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
|
||||
virtual void reportLocationsEvent(const Location* locations, size_t count,
|
||||
BatchingMode batchingMode);
|
||||
virtual void reportCompletedTripsEvent(uint32_t accumulated_distance);
|
||||
virtual void reportBatchStatusChangeEvent(BatchingStatus batchStatus);
|
||||
|
||||
/* ==== CLIENT ========================================================================= */
|
||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||
void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks);
|
||||
void removeClientCommand(LocationAPI* client,
|
||||
removeClientCompleteCallback rmClientCb);
|
||||
void requestCapabilitiesCommand(LocationAPI* client);
|
||||
|
||||
virtual void reportLatencyInfoEvent(const GnssLatencyInfo& gnssLatencyInfo);
|
||||
virtual bool reportQwesCapabilities(
|
||||
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap);
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif //LOC_API_ADAPTER_BASE_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user