463 Commits
udc ... vic

Author SHA1 Message Date
15e475ab29 veux: Include MiuiCamera 2025-09-13 15:51:06 +02:00
thepriyanshujangid
a83d87ca03 veux: hidl: add missing FCM entries
The following HALs in device manifest are not declared in FCM <= level 6:
  android.hardware.ir.IConsumerIr/default (@1)
  android.hardware.light.ILights/default (@2)
  android.hardware.usb.gadget.IUsbGadget/default (@1)
  vendor.lineage.health.IChargingControl/default (@2)
  vendor.lineage.health.IFastCharge/default (@2)
2025-08-21 23:26:05 +02:00
¨raystef66¨
448b620182 veux: update FCM on IChargingControl and IFastCharge
vendor.lineage.health.IChargingControl/default (@2)
vendor.lineage.health.IFastCharge/default (@2)
2025-08-21 23:15:58 +02:00
Cassie
3f9b05e50d veux: overlay: Use the new auto network selection UI
Change-Id: I76698911103601d5f3ad67e1099790af8c2fdc18
2025-08-12 15:04:06 +02:00
kailua
346ab9a6af veux: update-sha1sums: chmod +x 2025-07-28 16:28:07 +02:00
LuK1337
2977f8037f veux: Migrate to py extract utils
Signed-off-by: Onelots <onelots@onelots.fr>
Co-authored-by: LuK1337 <priv.luk@gmail.com>
Co-authored-by: Skyblueborb <tomaszborbely0710@gmail.com>
2025-07-28 03:46:23 +02:00
8bae52b351 veux: Build DeviceAsWebcam
Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-04 14:51:47 +02:00
Alexander Koskovich
b09998d9a9 veux: Opt out of VIDEO_ENCODE flag for DeviceAsWebcam
DeviceAsWebcam is using USAGE_VIDEO_ENCODE [1] for buffers and
this results in combined usage: (VIDEO_ENCODER | CAMERA_OUTPUT).

On Qcom devices DeviceAsWebcam has red & blue colors swapped.

Originally we tried swapping HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS
with HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS in libgrallocutils,
however that inverted regular camera recording colors in some cases.

[1] d079a82ba4

Change-Id: I6c5f03fe7016f687855351c7ba15270050ea02e2
2025-06-04 14:50:00 +02:00
Yumi Yukimura
6785c1012d veux: rootdir: Remove non-working UVC streaming formats
Test results from land:
* mjpeg 720P: Has a green border on top

Test results from ugglite:
* YUYV: Works for only some seconds, then get stuck
* mjpeg 720P: No video and leads to the following SMMU error
* mjpeg 1080P: Works for only some seconds, then get stuck

Test results from pine:
* YUYV: The left and right parts of image are not synced
* mjpeg 720P: No video and leads to the following SMMU error

Let's keep mjpeg 1080P... as it doesn't have serious issue and looks clear

[  102.676956] CAM-SMMU cam_smmu_check_vaddr_in_range:319 Cannot find vaddr:0000000000000000 in SMMU. cpp uses invalid virtual address
[  102.687715] MSM-CPP msm_cpp_iommu_fault_handler:790 Fault on  identity=0x10002, frame_id=003
[  102.687734] MSM-CPP msm_cpp_dump_addr:716 stripe 0: in 77623a00, out1 77e00000 out2 77e00000, out3 77e00000, out4 77e00000
[  102.687741] MSM-CPP msm_cpp_dump_addr:716 stripe 1: in 77623b26, out1 77e00140 out2 77e00140, out3 77e00140, out4 77e00140
[  102.687748] MSM-CPP msm_cpp_dump_addr:716 stripe 2: in 77623c66, out1 77e00280 out2 77e00280, out3 77e00280, out4 77e00280
[  102.687755] MSM-CPP msm_cpp_dump_addr:716 stripe 3: in 77623da6, out1 77e003c0 out2 77e003c0, out3 77e003c0, out4 77e003c0
[  102.687761] MSM-CPP msm_cpp_dump_addr:716 stripe 4: in 7773a100, out1 77ef0000 out2 77ef0000, out3 77ef0000, out4 77ef0000
[  102.687768] MSM-CPP msm_cpp_dump_addr:716 stripe 5: in 7773a354, out1 77ef0280 out2 77ef0280, out3 77ef0280, out4 77ef0280
[  102.687829] CAM-SMMU cam_smmu_check_vaddr_in_range:319 Cannot find vaddr:0000000000000000 in SMMU. cpp uses invalid virtual address
[  102.694793] MSM-CPP msm_cpp_iommu_fault_handler:779 msm_cpp_iommu_fault_handler:779: Invalid queuelen

Change-Id: I75708c1e6372bbaffb85d0b0a7ae64f3075aa53e
2025-06-04 14:50:00 +02:00
Yumi Yukimura
d4bc838cc8 veux: Set UVC gadget streaming bandwidth to 1024
* Avoids the image getting truncated. Thanks to nift4 for inspiration.

Change-Id: I04dc6468d928cdd85745dc3f58c105bed96729f8
2025-06-04 14:50:00 +02:00
Yumi Yukimura
da28cb061b veux: Setup DeviceAsWebcam
Change-Id: Icf8e10cd21c4eef9a66af624971ffe9c4d39d992
2025-06-04 14:49:40 +02:00
1018776b3c veux: drop fastcharge implementation
Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-04 14:49:30 +02:00
c4a299168b veux: removepackages: do not override Aperture
Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-04 14:49:30 +02:00
johnmart19
0bf5c4849e veux: Guard Qualcomm thermal service hals
* Crashing on Veux, Alioth and some other devices

* Crash:
 * Earlier versions:
    - E android.hardware.thermal@2.0-service.qti: ThermalHAL not initialized properly.
    - E ThermalHalWrapper: Couldn't get temperatures because of HAL error: ThermalHAL not initialized properly.
 * Current one:
    - E ThermalManagerService$ThermalHalWrapper: Couldn't getCurrentCoolingDevices due to invalid status
    - E ThermalManagerService$ThermalHalWrapper: java.lang.IllegalArgumentException: ThermalHAL not initialized properly.
2025-06-04 14:49:30 +02:00
66181999e2 veux: drop ViperFX
* Since that Dolby is back, we don't need this additional package anymore

Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-04 14:49:29 +02:00
49523ef5e7 veux: drop vendorsetup.sh
* We have no use of this now that we can use lunch to clone everything we need.

Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-04 14:49:29 +02:00
yingjiew
fd480e995d veux: gps: Avoid access of deprecated LocUnorderedSetMap entry
When there is no client listens to some DataItemId, we will remove
the map entry. Can't access the deleted entry's iterator anymore.

Change-Id: Id64aadebf7362667fbcf0fd5191f888ed9241727
CRs-Fixed: 3886536
(cherry picked from commit 0049d459cc1772f328e29a4c6b6d129af132e7b8)
2025-06-04 14:49:29 +02:00
Michael Bestas
5b8a8bf765 veux: gps: Remove CleanSpec.mk
Change-Id: Id5a91ac0dfc35cd4c84218f02e50c0905e04c43a
2025-06-02 20:07:14 +02:00
Hridaya Prajapati
6110a1c6e4 veux: switch to common AIDL IR service
Change-Id: I36c05aaa312969e479896c6e63a26a68cf897afa
2025-06-02 20:07:14 +02:00
Sebastiano Barezzi
24a1854cfa veux: Move to Xiaomi IR AIDL
Change-Id: I46094bcbfaba252b5d98ea8211b927fdaa079e2d
2025-06-02 20:07:14 +02:00
Yumi Yukimura
f3025a6b08 veux: Migrate to QTI USB Gadget AIDL HAL
Change-Id: I6adbca2fab9a3fe0477d17f9786166828b786710
2025-06-02 20:07:14 +02:00
904cb3bfd6 veux: Don't explicitly set as an AB target
* Veux is A/B, and nowadays A/B is the default behavior.

Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:14 +02:00
sayann70
3f1a816d6d veux: aidl: Add google_battery to FCM & Manifest
02-09 23:48:41.292  1618  2197 W ActivityManager: Unable to start service Intent { cmp=com.google.android.turboadapter/.GoogleBatteryService } U=0: not found
02-09 23:48:41.293  1618 13122 W ActivityManager: Unable to start service Intent { cmp=com.google.android.turboadapter/.GoogleBatteryService } U=0: not found
02-09 23:48:41.308 15351 15351 E ActivityThread: Service com.google.android.apps.turbo.deadline.library.BatteryFlagService has leaked ServiceConnection axe@16c727f that was originally bound here

Signed-off-by: sayann70 <sayansarkarda2@gmail.com>
2025-06-02 20:07:14 +02:00
718aeef877 veux: props: silent some useless spam
* Silences HWUI, AppOpps and others

Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:14 +02:00
SimpleJony
5e0c46bc2a veux: rootdir: give thermal profiles permissions and fix thermal permissions
01-04 20:38:40.022 3663 12914 W FileUtils: No such file /sys/class/thermal/thermal_message/sconfig for writing
01-04 20:38:40.022  3663 12914 W FileUtils: java.io.FileNotFoundException: /sys/class/thermal/thermal_message/sconfig: open failed: EACCES (Permission denied)
--
05-26 13:15:30.474  2332  3692 W FileUtils: No such file /sys/class/thermal/thermal_message/sconfig for writing
05-26 13:15:30.474  2332  3692 W FileUtils: java.io.FileNotFoundException: /sys/class/thermal/thermal_message/sconfig: open failed: ENOENT (No such file or directory)

Change-Id: Ia1e96e641dc2cedf1b6ab50dc23e703f2dd880af

Co-authored-by: bittencourtjulival <julival.bitencourt@gmail.com>
2025-06-02 20:07:14 +02:00
94afd90696 veux: audio: drop audio_effects.conf
Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:14 +02:00
Pranav Vashi
51c564cf30 veux: dolby: Add profiles overlay for moto dolby
Change-Id: Ided92625cb73f530656e86929b3ba70fea1e940d
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:14 +02:00
Pranav Vashi
d187bc363a veux: dolby: Update dax-default from moto
Change-Id: I430adc74c64093bf3c1439e66607567cb6444b80
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:14 +02:00
Pranav Vashi
81b7421044 veux: libstagefright_foundation-v33 moved to lineage compat
Change-Id: Ib1fd8644e6c2567c89d67967f31c62582cc006ef
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:14 +02:00
dogpoopy
62d71f1263 veux: Switch dolby soundfx to libswdap
* libhwdap.so doesn't work with devices that doesn't have dolby hardware support
* libswdap.so from https://github.com/reiryuki/Dolby-Atmos-Moto-G52-Magisk-Module.git

[@neobuddy89: Pin libswdap.so from above module]
Change-Id: Icb22599d2d439a837b537b59330f30e558869532
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:14 +02:00
Pranav Vashi
280fa8dc46 veux: audio: Add dolby to audio effects
Change-Id: Ie4865489f79b617f2568fc29b382c56bb0cd6f11
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:14 +02:00
Pranav Vashi
48684c0c51 veux: audio: Apply NLSound 4.0 optimization for dolby
Change-Id: I221799b79f80933cc8302418f1290893722a5368
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:14 +02:00
basamaryan
b230059a38 veux: audio: Forcefully disable volume leveler
sed -i "/volume-leveler-enable/ s/true/false/g" configs/audio/dax-default.xml

Change-Id: I7ceb29291a9e55036d57975f5a28a149c7fcb435
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:13 +02:00
Fabian Leutenegger
597b231878 veux: Link Dolby Atmos dependencies against v33 libstagefright_foundation
* fixes crashes and absurdly high CPU usage while using dolby

Co-authored-by: Woomymy <woomy@woomy.be>
Change-Id: Ib72b775dae677f3085d0b0e2afcbb709d8690063
Signed-off-by: basamaryan <basam.aryan@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:13 +02:00
basamaryan
9a5ca49814 veux: Build XiaomiDolby
Change-Id: I31ff2c27a479423951c8a645bf1cd65dc6ad6f81
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:13 +02:00
madmax7896
7676ec5b17 veux: Import Dolby audio blobs and sepolicy
Squashed with:
commit b1baf8e4109edf71727c39bff18077110174dff2
Author: Yuan Si <do4suki@gmail.com>
Date:   Sat Sep 16 06:35:46 2023 +0800

    sweet: sepolicy: Address more Dolby audio denials

    09-16 06:33:17.209   613   613 E SELinux : avc:  denied  { find } for interface=vendor.dolby.hardware.dms::IDms sid=u:r:mediacodec:s0 pid=1262 scontext=u:r:mediacodec:s0 tcontext=u:object_r:hal_dms_hwservice:s0 tclass=hwservice_manager permissive=0
    09-16 06:33:17.209  1262  8489 E DecDynamicConfig: connectService : Connect to Dolby Native Service failed
    09-16 06:33:17.209  1262  8489 E DecDynamicConfig: checkShareConfig: Dolby service is NULL

    Change-Id: Ideb557073b53e7b31f6535d6053933104b455ae7
    Signed-off-by: Yuan Si <do4suki@gmail.com>

commit e83b80995343c56382e43bf0656ee1e2b79ee067
Author: YuKongA <70465933+YuKongA@users.noreply.github.com>
Date:   Thu Oct 12 00:02:27 2023 +0800

    sweet: sepolicy: Address mediacodec denials

    Partially taken from ec0e9c641f and extended to hal_dms_server

    Change-Id: I51cfbbb2f8b9d83e74ef2f44196e8393189ca3dc
    Signed-off-by: basamaryan <basam.aryan@gmail.com>

commit 0a7aab81667f137c57fa95c4661fa7e43e0e2c1c
Author: Pranav Vashi <neobuddy89@gmail.com>
Date:   Fri Aug 2 20:27:52 2024 +0530

    sweet: Move dax-default to device tree

    Change-Id: Id2054bb5e61bcfe58706e32f44d37fe7524aa912
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Change-Id: I2d466238525d074269377a82627a816527aefd74
Signed-off-by: Mesquita <mesquita@aospa.co>
Signed-off-by: basamaryan <basam.aryan@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-06-02 20:07:13 +02:00
ea75958b8d Revert "veux: Set low memory mode"
* The Redmi Note 11 Pro 5G (codename veux/peux) has 6GB+ RAM,
making ART low-memory optimizations unnecessary. Forcing this flag
may disable performance optimizations in Android Runtime (ART)
without tangible memory benefits on this device.

This reverts commit fbfc6f8d4e.
2025-06-02 20:07:13 +02:00
ecbba940be veux: Initialize EvolutionX 10.X
Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:13 +02:00
299809d799 veux: Do not use the fragment for QTI vibrator HAL
* The reverted commit was including the whole fragment for vibrator.
* In this folder, the flag BOARD_OPENSOURCE_DIR was set, which used
to break audio building by setting a bad path for our source, instead
of hardware/qcom-caf/sm8350/audio

This reverts commit 76451d8187.

Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:13 +02:00
Bruno Martins
34dccf9d0b veux: Migrate Lineage Health to soong_config_set
Change-Id: I2eff39e83b9673aa2989d05de65c646241ba61da
2025-06-02 20:07:13 +02:00
Bruno Martins
9cda51c400 veux: Set camera override format from reserved via soong config
Change-Id: I6a089e783f26c4515940d74f8e912dffa2789550
2025-06-02 20:07:13 +02:00
de4728b620 veux: enable viperfx
Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:13 +02:00
Dmitry
4945c19269 veux: remove dolby
remove_spatial (unsupport)
2025-06-02 20:07:13 +02:00
54c034e4b9 veux: drop miuicamera
* This memecam has video recording broken for a while, and AGC is way better...

Signed-off-by: Onelots <onelots@onelots.fr>
2025-06-02 20:07:13 +02:00
donjohanliebert
28b93c027f veux: fix lag while app opening and QS lags
Signed-off-by: donjohanliebert <donjohanliebert@gmail.com>
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
e72a3f96ef veux: Add SystemUI restart to advanced restart menu
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
LuK1337
50b510a168 veux: Adjust override prop key names
Change-Id: I436bbf425023dbe54cf3e2c35f50a5575511bc38
2025-05-21 11:10:34 +02:00
de24f4fd69 veux: sepolicy: adapt genfs_contexts to new lineage common one
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
96c5230463 veux: AGC-Camera: fix soong path
* Soong namespace was defined as vendor/xiaomi/AGC-Camera while the cam was cloned at vendor/xiaomi/AGC-camera

Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
c6ba6a8bc3 veux: sepolicy: move back libperfmgr to lineage path
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
00b646a2a9 veux: TARGET_PRODUCT: define within prop override
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
f345190394 veux: miuicamera: move to github
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 11:10:34 +02:00
EmanuelCN
f3883bcae5 veux: Enhance audio quality
Signed-off-by: NotZeetaa <rodrigo2005contente@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 11:10:34 +02:00
Adithya R
62df004919 veux: Disable IMS debugging in props
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 11:10:34 +02:00
Danny Lin
334f47c211 veux: Optimize native executables for Cortex-A76 CPU
* Allow the compiler to take advantage of ARMv8.2 extensions
   to improve performance in native executables, not
   just Java code compiled by ART.
2025-05-21 11:10:34 +02:00
Amrito | アンブロシア
bc80099b38 veux: Define Correct CPU variant
Reason No.1 :
[Klozz]
This will allow the system to make better optimizations for performance and power efficiency

 * We are using generic for major work of the cpu but enforce to use preferencially cortex-a76 for their optimizations
TARGET_CPU_VARIANT := generic: This setting tells the system to use general optimizations for any CPU type, without targeting Cortex-A78 specific features.
TARGET_CPU_VARIANT_RUNTIME := cortex-a76: Here you are telling the system that even if it uses general optimizations, it should assume that it is running on a Cortex-A76 processor during OS execution.
This is the closest you can get to taking advantage of A76 features on an A78, as AOSP does not have direct support for the A78.

The current setting is the most recommended for your Cortex-A78 device, as it gives you a good balance between optimizations and compatibility.
By using generic for the TARGET_CPU_VARIANT and cortex-a76 for the TARGET_CPU_VARIANT_RUNTIME, you are taking full advantage of your processor's capabilities without taking unnecessary risks.
Since aosp does not support Cortex-a78 the closest is cortex-a76.

* Using cortex-a55 for 2nd cpu clusters
By specifying cortex-a55 for both TARGET_2ND_CPU_VARIANT and TARGET_2ND_CPU_VARIANT_RUNTIME, we are providing the system with accurate information about the hardware in the second cluster.
This will allow the system to perform specific optimizations for these cores, thus improving performance and power efficiency.

Reason No.2 :
[amritokun]
As mentioned in the above text AOSP has no direct support for the Cortex-A78 & SM6375 (SD695) has two big clusters locked at 2.21 GHz based on Cortex-A78
As Per previous configuration by @dereference23 , He mentioned in 38dd683b70 commit
both were set to Cortex-A55 even the big ones .
This was hurting CPU performence & optimisation considerebly

Also Reffer to -
a9309428b8

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
Co-Authored-By: klozz (TeamMEX) <carlosj@klozz.dev>
2025-05-21 11:10:34 +02:00
luffy-2510
2a00eb27c6 veux: Optimize ram management
Signed-off-by: luffy-2510 <25rb10@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 11:10:33 +02:00
Cosmin Tanislav
bbda6af0c1 veux: switch to common QCOM AIDL bootctrl HAL
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 11:10:33 +02:00
75b583403a veux: removepackages: move to bp
Signed-off-by: Onelots <onelots@onelots.fr>
2025-05-21 10:53:07 +02:00
Amrito | アンブロシア
33f0b5256f veux: Fix HAL compatibility in device manifest: Update FCM <= level 6
All HALs in device manifest are declared in FCM <= level 6
ERROR: files are incompatible: Framework manifest and device compatibility matri
x are incompatible: HALs incompatible. The following requirements are not met:
android.frameworks.schedulerservice:
    required: @1.0::ISchedulingPolicyService/default
    provided:
: Success
2025-05-21 10:53:07 +02:00
Rocky7842
c677fb3f24 veux: Disable ssrec and hdmipassthru since it depends on proprietary headers
E audio_hw_extn: snd_mon_feature_init: dlopen failed
E audio_hw_extn: ssrec_feature_init: dlopen failed
E audio_hw_extn: hdmi_edid_feature_init: dlopen failed
E audio_hw_extn: spkr_prot_feature_init: dlopen failed
E audio_hw_extn: hfp_feature_init: dlopen failed
E audio_hw_extn: hdmi_passthrough_feature_init: dlopen failed

Change-Id: I948abc32a013cafc703ec30a1fb852698fd7f057
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Akash Srivastava
c9089c6b53 veux: prop: Update adm value to 12 to fix sound cracking
Change-Id: d21afb625847fa42cb0bbc138a48867475c58f8b
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Yumi Yukimura
27f0e9f7ec veux: init: Set ro.boot.hardware.revision property
* The value would be shown on Settings > About phone > Model > Hardware version.

Change-Id: I3a9707597ba01690bdf992e77d7d59d67213bca9
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Citlali-Itztli
e65b567a5d veux: WifiOverlay: Disable NL80211_REG_CHANGED event
* This is caused crash Wificond service as per logcat said "wificond: Failed to get NL80211_ATTR_MAX_NUM_AKM_SUITES"

Change-Id: db39d8043c7bb9de6cc0df977132c75f9325a582
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Jeff Johnson
0d0d46cf52 veux: wifi: Remove obsolete Intf*MacAddress items
MAC addresses are now provisioned via a separate file and
configuration via the INI file is no longer supported, so
remove the obsolete default value assignments.

Change-Id: I177da3189b60c12fb96f42f9ea63cc6148f80dc8
CRs-Fixed: 2497142
Signed-off-by: Dmitrii <bankersenator@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Park Ju Hyung
0ef8e47c82 veux: wifi: Disable firmware log
Change-Id: ed2fad32309dd7300bb302f90ed33e7beb136f99
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Dmitrii <bankersenator@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Sugakesshaa
c297e102e5 veux: display: Disable HWC usage for VDS
Fixes system freezes and janks while screen recording.

Change-Id: Ic21a277a520cda57c765cecace68d2bc0a7f1ded
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2025-05-21 10:53:07 +02:00
Yumi Yukimura
0b2398af3a veux: manifest: Bump target-level to 6
Change-Id: I8d419d248f29b7d316a87d55e19ae7ff141e19a5
2025-05-21 10:53:07 +02:00
Michael Bestas
59ea79efd1 veux: Enable UFFD GC
Kernel has support for it now.

ref: c73faa2aa2
Change-Id: I3863ee71477f321fe47646571b857fdc39a1902b
2025-05-21 10:53:07 +02:00
Amrito | アンブロシア
2dd1002605 veux: Switch to Leica Cam 2025-05-21 10:53:07 +02:00
Yan Yan
24679e1d20 veux: Add feature flag for IPSEC_TUNNEL_MIGRATION
This commit adds the IPSEC_TUNNEL_MIGRATION feature flag,
with XFRM_MIGRATE used as the implementation

Bug: 273379472
Test: build, flash and verify with "adb shell pm list features"
Test: atest IpSecManagerTunnelTest
Change-Id: Id2ee3e65183e32ea63f6251ba921e1e4c6b09ed0
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Sushrut1101
e929adcb1e veux: overlay: Remove ambient auto-brightness integer-array
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:07 +02:00
Sushrut1101
53caa15651 veux: overlay: Use integer instead of float for Doze brightness
* Set it to 55.

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
SVB
bdf5376c78 veux: init: Allow all filesystems for USB-OTG
Change-Id: I43dba6a51e68b389e750906d84aadd1f035fdad0
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Juhyung Park
38d5345adb veux: Relax refresh rate timers
Follow 38d39eb9a1 for lahaina.

[amritokun]: Adapt to holi.

ref: "arm64: dts: Delete oplus and memc timing nodes"
Change-Id: 0f5fbe5b08667acced664d81abbe079d88e626dc
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Co-Authored-By: Amrito | アンブロシア <bhabanidas431@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
kamikaonashi
bf5b6ad49a veux: overlay: set animations to 0.8x by default
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Han Wang
40ff04ef3d veux: Drop enable gl comp backpressure
* This is no-op when debug.sf.disable_backpressure=1
   is set. Just follow CAF here and remove this ricing.

Change-Id: If01753e3ba27dcde6576e2cc3f058ae5121cf773
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
ghostrider-reborn
f90051b059 veux: Enable frame pacing for smoother visual performance
- Enabled `vendor.perf.framepacing.enable` to improve visual smoothness by regulating frame timing. This enhancement ensures consistent frame delivery, reducing stuttering and enhancing overall visual quality, particularly in graphics-intensive applications such as games.

Change-Id: Ia5ca6707652c69e9a4aa0bdb30c20805782220b5
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
officialputuid
184e08869b veux: Remove Force triple frame buffers
* Causing some apps laggy & UI performance regression

Change-Id: I1a88503cdfbb6c52fbb66d6f67ffe26d9c51043c
Co-Authored-By: Reinazhard <reinazhard@gmail.com>
Co-Authored-By: Ratoriku <a1063021545@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
mtsxxx
a6dc8901e2 veux: props: Remove debug.sf.disable_client_composition_cache 1
Because it causes jank when pulling up quick settings.

Change-Id: I7e31389caa31b2045c7b5f73b5bf31f577bdb6f6
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Sushrut1101
4dd83eb509 veux: rootdir: Improve post_boot scripts
* Thanks to Sushrut Gupta For Helping Me

Change-Id: fe2c767966cb7aae575b93819b52283aaaa337bc
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
Co-Authored-By: Amrito | アンブロシア <amrito@myyahoo.com>
2025-05-21 10:53:06 +02:00
Tyler Wear
e11a86a08f veux: tetheroffload: Version 1.1
Update tetheroffload to version 1.1.

Change-Id: I004e44e416a88a1b39a4c80366df9008722f096b
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Ken Huang
d2de54df0f veux: Set 120Hz frame rate multiple threshold
Bug: 215043570
Test: play 24fps video and check refresh rate
Change-Id: Ie638f9dcf11e25bdd903d6cde2d0eeb794668e52
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Bruno Martins
0b75582946 veux: sepolicy: Remove duplicate snxxx AIDL rules
These are now part of qcom/sepolicy_vndr.

Change-Id: I709c29e827d51e22507027862a56cca1efcdc984
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
dianlujitao
de78490898 veux: move to aidl bootctrl hal
Change-Id: I50fd09148097f0cda03c1a105340a3fd5f55ce8d
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Sushrut1101
f4ca83ac18 veux: sepolicy: Address btmac and wifimac denials
* W libc    : Unable to set property "ro.vendor.ril.oem.wifimac" to "e0806b3fdf01": connection failed: Permission dennied
* W libc    : Unable to set property "ro.vendor.ril.oem.btmac" to "e0806b3fdf02": connection failed: Permission denied

Change-Id: I6c89c06b7f53fa625275221d732c80055435d6d6
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
basamaryan
8eaec09854 veux: overlay: Disable turbulence noise
Change-Id: I390163d0197e0cb7091b8e5df77337a42cba2efb
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
justinweng
0f5358b933 veux: props: Extend audio offload buffer size to 256kb
Extend buffer size for offload playback to reduce the frequency of CPU
wake up.
It makes ADSP to process more data one time and reduce the number of
times to wake up CPU.

Bug: 137973303
Test: MP3 playback
Change-Id: If8eb1d3041161979063bf852e2b0b397e87e7c05
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Michael Bestas
3fdee36431 veux: Migrate mount point creation out of Android.mk
Change-Id: Id5986b8a740e45f864eecdd2bd82d9455f128d6b
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
RobertGarciaa
7f1fcd26c4 veux: sepolicy: Address some denials for MIUI camera
* W libc    : Access denied finding property "persist.camera.hdr.checkerdump"
* W libc    : Access denied finding property "persist.vendor.low.cutoff"

Signed-off-by: romgharti <romgharti@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
AdarshGrewal
1174d183fb veux: props: Allow games to use 120fps
Change-Id: I7aec742ca74bb117d742cdcb6cdf2e18c3447c42
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Michael Bestas
59b0effba3 veux: gps: Convert remaining Android.mk to bp
Change-Id: I75e6af92795fe755a48557aa06106406b14c6750
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Pulkit077
29afc7cd11 veux: sepolicy: Address radio.qcriNvOpt hwservice denial
Signed-off-by: Pulkit077 <pulkitagarwal2k1@gmail.com>
2025-05-21 10:53:06 +02:00
Ramii Ahmed
9ef0427150 veux: sepolicy: Label goodix debug fingerprint properties
* W libc    : Access denied finding property "gf.debug.dump_talog_data"
2025-05-21 10:53:06 +02:00
romgharti
b6630479f7 veux: sepolicy: Address some properties
* W libc    : Access denied finding property ro.vendor.display.type
* W libc    : Access denied finding property vendor.panel.display

Signed-off-by: romgharti <romgharti@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
chrisl7
f511c519bb veux: sepolicy: Label vendor.camera.sensor.logsystem property
* W libc    : Access denied finding property "vendor.camera.sensor.logsystem"

Signed-off-by: romgharti <romgharti@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
AndroidHQ254
b9a0ced29f veux: sepolicy: Label ro.hardware.chipname property
* W libc    : Access denied finding property "ro.hardware.chipname"

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
ZIDAN44
14c1b9e0c6 veux: sepolicy: Allow mediaprovider app to find radio service
* I auditd  : avc=avc:  denied  { find } for pid=2953 uid=10242 name=isub scontext=u:r:mediaprovider_app:s0:c242,c256,c512,c768 tcontext=u:object_r:radio_service:s0 tclass=service_manager permissive=0

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Carlos Arriaga
ef7d9e35cb veux: sepolicy: Add camera labels
* W libc    : Access denied finding property "ro.camera.req.fmq.size"
* W libc    : Access denied finding property "ro.camera.res.fmq.size"

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Frost
46843ba2d2 veux: sepolicy: Label ro.miui.customized.region property
* W libc    : Access denied finding property "ro.miui.customized.region"

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Akash Srivastava
af94a179b7 veux: sepolicy: Label ro.fota.oem and ro.product.marketname property
* W libc    : Access denied finding property "ro.fota.oem"
* W libc    : Access denied finding property "ro.product.marketname"

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Deanlancer
255a4eb734 veux: sepolicy: Fix denials during suspend
* I auditd  : avc=avc:  denied  { find } for pid=29208 uid=1000 name=suspend_control scontext=u:r:system_app:s0 tcontext=u:object_r:system_suspend_control_service:s0 tclass=service_manager permissive=0
* I auditd  : avc=avc:  denied  { find } for pid=29208 uid=1000 name=suspend_control_internal scontext=u:r:system_app:s0 tcontext=u:object_r:system_suspend_control_internal_service:s0 tclass=service_manager permissive=0
* I auditd  : avc=avc:  denied  { find } for pid=29208 uid=1000 name=tracing.proxy scontext=u:r:system_app:s0 tcontext=u:object_r:tracingproxy_service:s0 tclass=service_manager permissive=0

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Alistair Delva
e2a617f817 veux: sepolicy: Label aware properties
* W libc    : Access denied finding property "ro.vendor.aware_available"

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-05-21 10:53:06 +02:00
Amrito | アンブロシア
4e9b076c2b veux: vendorsetup: Switch Vendor repo to github 2025-05-21 10:53:06 +02:00
kamikaonashi
def1b433ca veux: fastcharge: add IRestrictedCurrent
add IRestrictedCurrent to stop log spam
2025-05-21 10:53:06 +02:00
Amrito Das
63ae132332 [SQUASH] veux: fastcharge implementation
this commit contains following commits to introduce the fastcharge toggle for veux device that use this tree

they were renamed from sm8250-common to veux

 sm8250-common: add fastcharge implementation

 * Disabling fast charge may be useful for reducing the heat produced by
   the device while charging, or for extending the lifespan of the battery

 * This commit introduces the fastcharge HIDL, which writes in the node

              /sys/class/qcom-battery/restrict_chg

   0 or 1 depeding on user selection.
   0 means that fastcharge is enabled, while 1 means that fastcharge is
     disabled

Change-Id: I369ba9c437b3a83a88c2ce74d603b7d7ddd9cfbb
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Signed-off-by: althafvly <althafvly@gmail.com>

6510782439

 sm8250-common: fastcharge: Make user setting persistent

Change-Id: I4ff051d6f9685e94022eab32035bfe86a65264b8
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>

e050f0dab0

 sm8250-common: fastcharge: Use pragma once

Change-Id: I9a9e193a6f66f045f41394d059af8b71778e8d72

ff8e5f6173

 sm8250-common: fastcharge: Migrate to blueprint

Change-Id: I200fd6c685183c98f0815b207adae5aa75a37238

4e0d22f486

sm8250-common: Build fastcharge implementation
Change-Id: I3e6994d2c2f419dc8ce98a060204fda3dd16df81

136d369c4e

sm8250-common: Sepolicy: Label FastCharge more general

7a619945ca

sm8250-common: Sepolicy: Fastcharge: Provide needed permissions

https: //github.com/kamikaonashi/device_xiaomi_sm8250-common/commit/298ff28a2ab9c04f953780958de6a8971a947c51

batterysecret hack
51ebc8de81

Co-Authored-By: Ivan Martynov <johnivan19999@gmail.com>
Co-Authored-By: Bruno Martins <1696148+bgcngm@users.noreply.github.com>
Co-Authored-By: Francescodario Cuzzocrea <bosconovic@gmail.com>
Co-Authored-By: Davide Garberi <dade.garberi@gmail.com>
Co-Authored-By: Mohammed Althaf Thayyil <me@althafvly.com>
Co-Authored-By: blazerpaul15 <107421375+blazerpaul15@users.noreply.github.com>
2025-05-21 10:53:06 +02:00
Terminator-J
435506d9c7 veux: Fix the battery drain due to statsd
Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
2025-05-21 10:53:04 +02:00
Lup Gabriel
854000133a veux: DeviceSettings: change settingslib widget to collapsingtoolbar
device/xiaomi/veux/parts/src/org/lineageos/settings/touchsampling/TouchSamplingSettingsActivity.java
error: cannot find symbol
import com.android.settingslib.widget.R;
Signed-off-by: pabloescobar-reborn <pabloescobarreborn77@gmail.com>
2025-03-20 09:46:49 +01:00
ahmedtohamy1
a8e25dbe19 veux: sepolicy: remove multiple different specifications for vendor.nxp.nxpnfc_aidl.INxpNfc/default 2025-03-20 09:46:49 +01:00
Arian
6f40641601 veux: sepolicy: Import initial sepolicy for Xiaomi parts
Signed-off-by: pabloescobar-reborn <pabloescobarreborn77@gmail.com>
2025-03-20 09:46:49 +01:00
GreekSummer
5b154b2a2c veux: Switch to common light HAL
Lineage has switched to common light HAL. Xiaomi light was also removed completely. (#3)

* dc3069c44b

Signed-off-by: Amrito Das <bhabanidas431@gmail.com>
2025-03-20 09:46:49 +01:00
RahulGorai0206
fc63ae5b03 veux: enable window-level blur effect
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 09:46:49 +01:00
Pabloescobar-reborn
45891ef52e veux: parts: Introduce Display Satutaion Service and TileUtils
* Adjust Saturation Value Handling for Device Color Mode Compatibility

parts: Rename xiaomiparts title to Xiaomi Settings

This update refines the saturation adjustment mechanism. When the seek bar progress is set, the method executes
the command "service call SurfaceFlinger 1022 f [saturation]" via Runtime.getRuntime().exec() to apply the saturation changes.
However, it was observed that when the device's color mode is set to "saturated," a saturation value of 1.0 does not trigger any visual changes.
To address this, the code now sets a value of 1.001 for a seek bar value of 100, ensuring the desired effect is consistently applied.

* TileUtils Implementation: Implemented TileUtils to handle the addition of Quick Settings tiles, specifically for the saturation feature.
This is done with reference to the guidelines provided by Google
https://developer.android.com/develop/ui/views/quicksettings-tiles#prompt-user
this ensuring a seamless integration and user experience when creating new tiles.

Signed-off-by: Pabloescobar-reborn <pabloescobarreborn77@gmail.com>
Co-Authored-By: kenway214 <kenway214@outlook.com>
Co-Authored-By: AnierinB <anierin@evolution-x.org>
Co-Authored-By: SKULSHADY <anushekprasal@gmail.com>
Co-Authored-By: jhenrique09 <jhenrique09.mcz@hotmail.com>
2025-03-20 09:46:49 +01:00
johnmart19
e319b1f0a1 veux: parts: Implement SeekBarPreference
* Updated custom Seekbar layout
* Fixed icon behavior in custom SeekBarPreference
* Fixed iconSpaceReserved behavior on our custom Seekbar

Co-Authored-By: TheScarastic <warabhishek@gmail.com>
Co-Authored-By: Nauval Rizky <enuma.alrizky@gmail.com>
2025-03-20 09:46:48 +01:00
johnmart19
2310ebbefd veux: parts: Move to SwitchPreferenceCompat for QPR2
* More modern view and matching QPR2 settings
* Pre-QPR2 builds might expect visual issues, so recommended A14 QPR2 and higher.

Co-Authored-By: Michael Bestas <mkbestas@lineageos.org>
2025-03-20 09:46:48 +01:00
Ramii Ahmed
5eff57199a veux: parts: Initialize High Touch Polling Rate support
Used to handle our node to force enable Xiaomi's High Touch polling rate mode from kernel

Adapted High Touch Polling Rate support to S style
2025-03-20 09:46:48 +01:00
wangchaohui
9683c15870 veux: parts: Dirac: Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427
Test: manual - check Settings pages
Test: m RunSettingsLibRoboTests
2025-03-20 09:46:48 +01:00
Peter Kalauskas
8c545ab44b veux: parts: dirac: Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Fix for UQPR2
2025-03-20 09:46:48 +01:00
kamikaonashi
2e7be67627 veux: parts: import dirac from marble 2025-03-20 09:46:48 +01:00
Taki
03443e47ce veux: Add mediacodecs support For Dolby
* Useful for Apple Music

Co-Authored-By: Abhay Singh Gill <abhaygill017@gmail.com>
Co-Authored-By: Zenka <54382817+zenkabestia@users.noreply.github.com>
2025-03-20 09:46:48 +01:00
Arindam Bhattacharjee
5d0ccc4ef0 veux: Add Support For Sony Dolby
in this commit, we are adding support for Sony's Dolby Atmos.

Signed-off-by: mnasibzade <euoryexe@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 09:46:48 +01:00
Murat Kozan
b75187a5ad veux: sepolicy: Address Google WirelessCharger hal denial
avc:  denied  { find } for interface=vendor.google.wireless_charger::IWirelessCharger sid=u:r:platform_app:s0:c512,c768 pid=2811 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_hwservice:s0 tclass=hwservice_manager permissive=0
2025-03-20 09:46:48 +01:00
RobertGarciaa
a65cd25410 veux: Define missing HALs in FCM
The following HALs in device manifest are not declared in FCM <= level 5:
android.hardware.drm.IDrmFactory/clearkey (@1)
android.hardware.biometrics.fingerprint@2.3::IBiometricsFingerprint/default
android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default (@4)
android.hardware.boot@1.2::IBootControl/default
android.hardware.usb.IUsb/default (@1)
android.hardware.power.IPower/default (@5)
android.hardware.memtrack.IMemtrack/default (@1)
android.hardware.health.IHealth/default (@3)
android.hardware.ir.IConsumerIr/default (@1)
android.hardware.sensors.ISensors/default (@2)
android.hardware.wifi.IWifi/default (@1)
android.hardware.wifi.IWifi/default (@2)
android.hardware.wifi.hostapd.IHostapd/default (@2)
android.hardware.wifi.supplicant.ISupplicant/default (@3)
COMPATIBLE

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 09:46:48 +01:00
afterallafk
ebf297041e veux: Enable LTO Optimizations
Signed-off-by: afterallafk <shivamatiet2001@gmail.com>
2025-03-20 09:46:48 +01:00
alternoegraha
e3fe67bbca veux: prop: Update Skia Tracing Properties
Since Android 14 (U), debug.hwui.skia_atrace_enabled prop have been replaced with debug.hwui.skia_tracing_enabled and new prop called debug.hwui.skia_use_perfetto_track_events that allows Skia renderengine traced with Perfetto instead of ATrace. So, let's replace debug.hwui.skia_atrace_enabled prop from A13 (or older) with debug.hwui.skia_tracing_enabled and add debug.hwui.skia_use_perfetto_track_events into the properties, and set both props to false since we're going to disable Skia Tracing on Android 14.

Ref: 799b574b2d%5E%21/#F1
2025-03-20 09:46:48 +01:00
Yohan Black
5c8b45bec3 veux: props: disable Skia tracing by default
If the prop "debug.hwui.skia_atrace_enabled" is enabled, too many skia tracing calls will be printed in every frame. This has obvious overhead on performance/power, and can cause many janks. So disable it by default, and user can set it manually if necessary.

Co-Authored-By: CHRISL7 <70589286+CHRISL7@users.noreply.github.com>
2025-03-20 09:46:48 +01:00
Amrito | アンブロシア
3507e2b593 vendorsetup: Track vendor_xiaomi_miuicamera from my bitbucket 2025-03-20 09:46:48 +01:00
luk1337
5dd8c5dac8 veux: Add script to update sha1sums of kanged blobs
Squash of:
* Add script to update sha1sums of kanged blobs
* Handle moved blobs in update-sha1sums.py script
* Add unpinning support to update-sha1sums.py script
* Format update-sha1sums.py with yapf
* Better handle line breaks
* Handle line with opts

Signed-off-by: LuK1337 <priv.luk@gmail.com>
Change-Id: Ia5c2a7fcdd6e8472f43b2b2d2f4aa2a0de81b188
2025-03-20 09:46:48 +01:00
sdm695dev
0890e3807f veux: Add ViPER4Android FX support
Signed-off-by: sdm695dev <sdm695dev@gmail.com>
2025-03-20 09:46:46 +01:00
dianlujitao
8fcf83d3ae veux: remove OMX
* OMX HW video codecs are no longer used after enabling Codec2
 * OMX HW audio codecs won't work without QCOM A/V enhancements, which
   we don't have on Lineage.

Change-Id: I65852151c8fb6387add5fc4402ba3f13c97b5f64
2025-03-20 09:46:10 +01:00
dianlujitao
8435215da8 veux: nuke ATFWD
It's normally not used at all.

Change-Id: Idb824b3b8c783b6ac962e604df05f9154beb4ed2
2025-03-20 09:46:10 +01:00
Amrito | アンブロシア
8beffa8775 veux: Reorder libs with the help of the script
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 09:46:10 +01:00
Devin Moore
8d0523f869 veux: Switch to new AIDL IR service
Test: atest VtsHalIrTargetTest hal_implementation_test
Bug: 205000342
Change-Id: I70c54aa8e8962939cc8f4b42fbbe828e9dad7f0d
Signed-off-by: Ramadhani <ramadhanifals@gmail.com>
2025-03-20 08:58:11 +01:00
someone5678
63e1a0d505 veux: Build vendor.qti.hardware.capabilityconfigstore@1.0
Log:
07-08 14:11:18.637  1300  1300 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:18.724  1366  1366 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/vppservice": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by /vendor/lib64/libvpplibrary.so in namespace (default)
07-08 14:11:23.638  3100  3100 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:28.644  3177  3177 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:33.651  3194  3194 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:28.395  5816  5816 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:45.348  7112  7112 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable

Signed-off-by: sdm695dev <sdm695dev@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:11 +01:00
Omkar Chandorkar
6cd27537e2 veux: Use AOSP assert seperator
- why deviate?

Change-Id: I07a016d4d793c855ccbfac3c5251c22efdeb0a68
Signed-off-by: sdm695dev <sdm695dev@gmail.com>
2025-03-20 08:58:11 +01:00
Sebastiano Barezzi
21b1479af2 veux: Add a script to reorder blobs list
Change-Id: I76e85e07f5a562b7e2a3683da264ccebff5c3613
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:11 +01:00
pkm774
72d836c5ec veux: Disable slow blur effect to avoid laggish blur effect
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:11 +01:00
zeelog
aa3e20d972 veux: overlay: enable config_ui_enableFadingMarquee
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
UtsavBanar1231
dd9dd1471f veux: configs: Disable logging from camx module
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
UtsavBanar1231
8a9bf28549 veux: Import camxoverride settings configuration
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
Amrito | アンブロシア
7ae7a2ddac veux: overlay: Configure Regulatory info
* Extracted From Redmi/veux_global/veux:13/TKQ1.221114.001/V816.0.12.0.TKCMIXM:user/release-keys

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
Fabian Leutenegger
204eb3cbd5 veux: overlays: Add more modern camera icon overlay for aperture camera
* Fix Some Typo Issues Too
2025-03-20 08:58:10 +01:00
Sarthak Roy
308c953ee1 veux: overlays: Add Aperture QRCodeComponent support
* Fixes QR QS tile in All Builds (Which Have Same Bugs)

Signed-off-by: Sarthak Roy <sarthakroy2002@gmail.com>
Change-Id: Idd692578418f662ce6aa42ed10b227cd4816d9c9
Signed-off-by: Sushrut1101 <guptasushrut@gmail.com>
Co-Authored-By: Michael Bestas <mikeNG@users.noreply.github.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
Omkar Chandorkar
3793d2cdbe veux: overlay: Configure Aperture camera
- Also add overlay to unlock additional camera framerates
This unlocks 60fps recording on main back camera (cam ID 0) and secondary back camera (cam ID 1). As for front facing camera (cam ID 1), it only supports 30fps recording on resolutions up to 1080p.

[amritokun]: Adapt to sm6375-common

Change-Id: I14e9bf9ba71c9d9f4aca04f3b558a1d72e248a60
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
kamikaonashi
fbfc6f8d4e veux: Set low memory mode
Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
kamikaonashi
164fedb1fa veux: set ART debug to release mode 2025-03-20 08:58:10 +01:00
kamikaonashi
3d4f372bd6 veux: parts: update clear_speaker_sound.mp3
nobody uses it, so include easter egg :)
2025-03-20 08:58:10 +01:00
karthik558
7b0ae38051 veux: Add props to improve battery backup
Change-Id: I1a81620df08180ded82fd527e17aa9a8fe0d01d3
Signed-off-by: tanvirr007 <tanvir.mymnsngh@gmail.com>
2025-03-20 08:58:10 +01:00
Amrito | アンブロシア
25343d8c21 veux: Nuke libqti-perfd-client.so from public.libraries.txt
* We are using `libperfmgr`

Signed-off-by: Amrito | アンブロシア <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
Ramii Ahmed
c9b19dd302 veux: import public libraries list
* From veux_global-user 11 RKQ1.211001.001 V13.0.10.0.RKCMIXM release-keys

Change-Id: Ibb726df72d42e5836c3591bd28a836aa9b674c8e
2025-03-20 08:58:10 +01:00
wshamroukh
0b30a3e446 veux: rootdir: Disable adsprpcd
ADSP is spamming the logs:
E adsprpcd: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /vendor/lib/rfsa/adsp/adsprpcd.farf. (No such file or directory)
E adsprpcd: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /vendor/dsp/adsp/adsprpcd.farf. (No such file or directory)
E adsprpcd: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /vendor/dsp/adsprpcd.farf. (No such file or directory)
E sscrpcd : vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2846: Error 0x200: apps_dev_init failed for domain 2, errno Transport endpoint is not connected
E sscrpcd : vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2944: Error 0x200: open_dev (-1) failed for domain 2 (errno Transport endpoint is not connected)
E sscrpcd : vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1334: Error 0x200: remote_handle_open failed for adsp_default_listener (errno Success)
2025-03-20 08:58:10 +01:00
DennySPb
70578033f2 veux: Ship liba2dpoffload.so from stock
This reverts commit 90b58e5c07346f7c1a0d04a182796cf7b89321ca.
-fixes crash on audio service
01-19 23:18:42.254 30055 30055 F DEBUG   :       #00 pc 000034e0  /vendor/lib/libtinyalsa.so (mixer_get_ctl_by_name+16) (BuildId: db2bf4d0ca706ad6d995570ca7224631)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #01 pc 00008e27  /vendor/lib/liba2dpoffload.so (reset_a2dp_enc_config_params+46) (BuildId: a5badbc2ec4caa8aa8bc51178a100607)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #02 pc 00008cf3  /vendor/lib/liba2dpoffload.so (reset_codec_config+2) (BuildId: a5badbc2ec4caa8aa8bc51178a100607)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #03 pc 00007db9  /vendor/lib/liba2dpoffload.so (a2dp_set_parameters+1248) (BuildId: a5badbc2ec4caa8aa8bc51178a100607)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #04 pc 00045f49  /vendor/lib/hw/audio.primary.veux.so (adev_set_parameters+1508) (BuildId: ae56f34eb3e3f0a9c019e9b0828a5d3e)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #05 pc 000175df  /vendor/lib/hw/android.hardware.audio@6.0-impl.so (android::hardware::audio::V6_0::implementation::ParametersUtil::setParametersImpl(android::hardware::hidl_vec<android::hardware::audio::V6_0::ParameterValue> const&, android::hardware::hidl_vec<android::hardware::audio::V6_0::ParameterValue> const&)+266) (BuildId: 32ec11fe38cbe1b8386a5049ed0c26c1)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #06 pc 000156f3  /vendor/lib/hw/android.hardware.audio@6.0-impl.so (android::hardware::audio::V6_0::implementation::Device::setParameters(android::hardware::hidl_vec<android::hardware::audio::V6_0::ParameterValue> const&, android::hardware::hidl_vec<android::hardware::audio::V6_0::ParameterValue> const&)+10) (BuildId: 32ec11fe38cbe1b8386a5049ed0c26c1)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #07 pc 0001801d  /vendor/lib/hw/android.hardware.audio@6.0-impl.so (android::hardware::audio::V6_0::implementation::PrimaryDevice::setParameters(android::hardware::hidl_vec<android::hardware::audio::V6_0::ParameterValue> const&, android::hardware::hidl_vec<android::hardware::audio::V6_0::ParameterValue> const&)+12) (BuildId: 32ec11fe38cbe1b8386a5049ed0c26c1)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #08 pc 0003905b  /vendor/lib/android.hardware.audio@6.0.so (android::hardware::audio::V6_0::BnHwDevice::_hidl_setParameters(android::hidl::base::V1_0::BnHwBase*, android::hardware::Parcel const&, android::hardware::Parcel*, std::__1::function<void (android::hardware::Parcel&)>)+286) (BuildId: 3de82f5f37dab67def58a76fd3720beb)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #09 pc 000507b5  /vendor/lib/android.hardware.audio@6.0.so (android::hardware::audio::V6_0::BnHwPrimaryDevice::onTransact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+2620) (BuildId: 3de82f5f37dab67def58a76fd3720beb)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #10 pc 0003a85b  /vendor/lib/libhidlbase.so (android::hardware::BHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+94) (BuildId: 7f62dcadb51cbf1ea118537bfdaea0a0)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #11 pc 00031e89  /vendor/lib/libhidlbase.so (android::hardware::IPCThreadState::joinThreadPool(bool)+636) (BuildId: 7f62dcadb51cbf1ea118537bfdaea0a0)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #12 pc 0000309d  /vendor/bin/hw/android.hardware.audio.service (main+4056) (BuildId: cc22e9aec32327099cce91a22eea1db9)
01-19 23:18:42.254 30055 30055 F DEBUG   :       #13 pc 0003636b  /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+74) (BuildId: ce474fc58869ea891c1ed8c192c84527)

Signed-off-by: DennySPb <dennyspb@gmail.com>
Signed-off-by: sdm695dev <sdm695dev@gmail.com>
2025-03-20 08:58:10 +01:00
Danny Lin
6fb5e25804 veux: rootdir: kill statsd service
When opening and closing activities in Settings, a measurably
significant amount of CPU time is spent processing and logging stats
events in statsd:

0.02%     /apex/com.android.os.statsd/lib64/libstatspull.so                                                                                         @plt
0.01%     /apex/com.android.os.statsd/bin/statsd                                                                                                    @plt
0.01%     /apex/com.android.os.statsd/bin/statsd                                                                                                    SocketListener::runListener()
0.01%     /apex/com.android.os.statsd/bin/statsd                                                                                                    android::os::statsd::LogEvent::parseBuffer(unsigned char*, unsigned long)
0.01%     /apex/com.android.os.statsd/bin/statsd                                                                                                    android::os::statsd::LogEvent::parseAnnotations(unsigned char, int)

Over longer device uptimes with real-world usage, statsd uses a
substantial amount of total CPU time. We have no use for the stats
recorded by statsd, so disable the service entirely to save CPU in
potential hotpaths.

This is the system/core part of the change; changes to frameworks/base
are also required.

Test: simpleperf record -a; verify that statsd no longer appears in
      sample hits
Change-Id: Idf6fdb0eff987169bd5f370dd72315e831a669e6
2025-03-20 08:58:10 +01:00
Amrito | アンブロシア
0da9d6ab26 veux: Make masterclear.allow_retain_esim_profiles_after_fdr veriant specific
* Only Japanese variant has E sim , so let it be the part of Japanese variant not  all variants across the globe
2025-03-20 08:58:10 +01:00
dlwlrma123
938d8ed333 veux: props: add touch improvements sysprops
* i was surpised that these props still exists (codewise) at [1] and [2], iirc this was also discussed on xda [3].

[1]: https://github.com/projectarcana-aosp/platform_frameworks_native/blob/12.x/services/inputflinger/reader/InputReader.cpp
[2]: https://github.com/projectarcana-aosp/platform_frameworks_native/blob/12.x/services/inputflinger/reader/mapper/TouchInputMapper.cpp
[3]: https://forum.xda-developers.com/t/possible-fix-for-touchscreen-issues-misses-updated-08-29.3172100/

Change-Id: Ic9fa4b4105ffcc44fd7e05f52b7d609e1193d92e
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
Signed-off-by: JaswalAshish <ashish@m.ms.evolution-x.org>
Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
2025-03-20 08:58:10 +01:00
Danny Trunk
dbe740ed76 veux: Do not block binder thread on incoming calls 2025-03-20 08:58:10 +01:00
Alexander Martinz
6969d9c242 veux: disable partial split strategy in sm
Disable the partial SRC split strategy in SDM.

Signed-off-by: Amrito Das <bhabanidas431@gmail.com>
2025-03-20 08:58:10 +01:00
Amrito | アンブロシア
ab7776e4b3 veux: shallow clone everything and switch to bit bucket for vendor 2025-01-29 21:59:01 +05:30
Amrito | アンブロシア
01d039f99a veux: parts: Add 90hz per app refresh rate 2025-01-29 21:59:01 +05:30
kamikaonashi
40b376ec06 veux: configs: move task_profiles.json to dt 2025-01-27 23:03:30 +05:30
Ryan Mitchell
663772ffd1 veux: Use component-override to configure Bluetooth
Runtime Resource Overlays (RROs) can no longer change the value of
resources in manifest when read during PackagerParser.

This change uses component-override to enable the service by default.

Remove usages of profile_supported_* from overlays as they no
longer configure the enable state of Bluetooth components.

Bug: 135048762
Test: adb shell pm query-services \
      com.android.bluetooth/.avrcpcontroller.AvrcpControllerService
      adb shell pm query-services \
      com.android.bluetooth/.hid.HidDeviceService
      adb shell pm query-services \
      com.android.bluetooth/.sap.SapService

Change-Id: I284d254a921b14d1533745611a083f4b5a27d9dc
2025-01-27 23:03:30 +05:30
RealJohnGalt
26cbd09e3a veux: media: add dav1d av1 decoder entry
Based on 10bit av1 for msmnile which can do up to 1080p60 10bit av1
without frame drops.

NOTE: YouTube app ignores perf limits
Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
2025-01-27 23:03:30 +05:30
Terminator-J
97762a0b2d veux: Fix the battery drain due to statsd...?
- Could it really be so simple?

Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
2025-01-27 23:03:30 +05:30
Cyber Knight
75f7828206 veux: Apply dex2oat optimizations
- Set only 4 threads to be utilized for dex2oat as dex2oat supports concurrent jobs since [1].
- Moreover, set only 4 threads to be utilized for boot image dex2oat as well.

[1]: 93c605c0d6

Change-Id: I8cf2544efeb4cd0c9befbaa2c208eed68c4204ac
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: angelomds42 <angelomds42@gmail.com>
Signed-off-by: alternoegraha <noegrahachan@gmail.com>
2025-01-27 23:03:30 +05:30
Vaisakh Murali
b502f42b23 veux: Use HintManager for HWUI
This will send HWUI timings to HintManager for better CPU scheduling.
Setting a 30% margin for CPU should heavily reduce CPU loads for HWUI and
use GPU for the rest.

Change-Id: Icc1fe5fbd4712e385464b9b340a7e53e166316f2
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: alternoegraha <noegrahachan@gmail.com>
2025-01-27 23:03:30 +05:30
kdrag0n
ff2f1999d6 veux: Disable RescueParty
RescueParty's aggressive approach to error recovery almost never helps
with the problems we're likely to face, and its risk of data loss is far
too high. Force-disable it entirely and remove all other conditions,
especially those that depend on data integrity in the first place, to
reduce the risk of RescueParty triggering falsely and causing data loss.

Note that it is still possible to force-enable RescueParty for testing
purposes using the persist.sys.enable_rescue property.

Change-Id: I72e833e0fcea8833a91448a2eac1a4fd5f65c007
Signed-off-by: tanvirr007 <tanvir.mymnsngh@gmail.com>
Signed-off-by: alternoegraha <noegrahachan@gmail.com>
2025-01-27 23:03:30 +05:30
angelomds42
f277455b7b veux: Add lmkd properties to improve responsiveness
- `ro.lmk.kill_heaviest_task=true`: Prioritizes killing the heaviest task.
- `ro.lmk.thrashing_limit=50`: Sets a balanced thrashing threshold.
- `ro.lmk.thrashing_limit_decay=25`: Adjusts thrashing decay dynamically.
- `ro.lmk.psi_complete_stall_ms=80`: Speeds up critical stall detection.
- `ro.lmk.psi_partial_stall_ms=50`: Prevents performance degradation.

- Some of these values are balanced between Google's recommendations for low-RAM and high-end devices, as our device fits this mid-range category.
- The adjustments reduce overhead without significant regression in multitasking.

Signed-off-by: angelomds42 <angelomds42@gmail.com>
2025-01-27 23:03:30 +05:30
kamikaonashi
58a43b88e0 veux: rootdir: label IRQs correctly
209 = kgsl_3d0_irq
218 = msm_drm
2025-01-27 23:03:30 +05:30
EmanuelCN
34f984aa0b veux: rootdir: Move KGSL and MSM_DRM to cores 6 and 7
By putting them on the bigger cores, they can be processed quicker,
resulting in improved responsiveness.
2025-01-27 23:03:30 +05:30
Jake Weinstein
7fc62ea31a veux: Do not balance msm_drm and kgsl_3d0 IRQs
These are critical for display performance and should not be balanced
in order to improve latency and responsiveness.
2025-01-27 23:03:30 +05:30
Michael Bestas
9c20f9e830 veux: Drop COMMON_LUNCH_CHOICES
As of 14 QPR2 this is broken, let's remove it instead of updating it
every 3 months. breakfast is the way to go.

Change-Id: I097bd54b894d9a49c7ce8b1ab6f343349e268fd8
2025-01-27 23:03:30 +05:30
kamikaonashi
8ec10281cc veux: configs: move msm_irqbalance to device tree
move from vendor to device tree
2025-01-27 23:03:30 +05:30
lahaina
7028d50e4b veux: rootdir: Disable EuiccGoogle in non-JP SKUs 2025-01-27 23:03:30 +05:30
Ramii Ahmed
f5450f93b2 veux: Import snapdragon color configs
* From veux_global-user 11 RKQ1.211001.001 V13.0.10.0.RKCMIXM release-keys

Change-Id: Iefd4a4cfc026ec3ff9e888e694c84a1dbf711c1f
2025-01-27 23:03:30 +05:30
Amrito | アンブロシア
2c5526e7cd veux: move config.fs to config directory
Signed-off-by: Amrito Das / <amrito@myyahoo.com>
2025-01-27 23:03:30 +05:30
Amrito | アンブロシア
a5198b702c veux: move FCM and other manifest files to different directory
Some times cleaning main dir is better

Signed-off-by: Amrito Das / <amrito@myyahoo.com>
2025-01-27 23:03:30 +05:30
npjohnson
f332bae97f veux: Ensure we build the vendor version of libcrypto_shim
Fix:
F linker  : CANNOT LINK EXECUTABLE /vendor/bin/hw/android.hardware.drm@1.3-service.widevine: library libcrypto_shim.so not found: needed by /vendor/lib64/libwvhidl.so in namespace (default)

Reference: Ia42de59ff157cddc930a111f8ce5e36e645055ed
Change-Id: Ie9823e19a86e3066343c010f34f7832b167a2633
Signed-off-by: alternoegraha <noegrahachan@gmail.com>
2025-01-27 23:03:30 +05:30
lahaina
c6dddd053f veux: Configure eSIM & Regulatory info 2025-01-27 23:03:30 +05:30
lahaina
5e0437bda3 veux: extract-files: Fixup for enable felica 2025-01-27 23:03:30 +05:30
lahaina
e2f4291797 veux: Don't presign EuiccGoogle
* Fixes compilation issues after QPR2.
2025-01-27 23:03:30 +05:30
lahaina
43ffbd8284 veux: Pull Japan-specific blobs 2025-01-27 23:03:30 +05:30
Amrito | アンブロシア
9a70b8bfe7 veux: Switch Vendor To Gitea 2025-01-27 23:03:30 +05:30
Amrito | アンブロシア
639d3aaabe veux: Update To V816.0.12.0.TKCMIXM 2025-01-27 23:03:30 +05:30
Prathamk07
927ca695ba veux: Include AGC Camera
Signed-off-by: Prathamk07 <prathamkalra.dev@gmail.com>
2025-01-27 23:03:30 +05:30
Alexander Winkowski
8816e7a454 veux: Include MiuiCamera
Change-Id: Ic043018f738c92212564ae499e05e34f6b3e6d11
Signed-off-by: MrTopia <redkarmakar@gmail.com>
2025-01-27 23:03:30 +05:30
Amrito Das /
30f7717136 vendorsetup: Use My Fork Of hardware_qcom-caf_sm8350_audio_configs_holi 2025-01-27 23:03:30 +05:30
ghostrider-reborn
b502e17124 veux: Fix battery and USB OTG detection
* In cape (msm-5.10) pmic driver now lies in adsp [1], so
   adsp firmware must to be loaded along with qti battery/
   charger kernel module, in order to get battery and usb
   power_supply up & running

 * With this, we dont need to set usb mode to peripheral
   explicitly either

 * The GKI kernel for 5.10 explicitly disabled
   FW_LOADER_USER_HELPER_FALLBACK, and the right way to enable it is to
   echo 1 to the /proc/sys/kernel/firmware_config/force_sysfs_fallback,
   so do this before writing to adsp sysfs node.

[1]: 4e2b0f663a

Depends-On: Id0e64302dbbdc53620cbc1825c36e13bb9e58aef
Change-Id: I835fa5daaa53eb704cc6c0777d7069d47ecbe10c
Signed-off-by: MrTopia <redkarmakar@gmail.com>
2025-01-27 23:03:30 +05:30
MrTopia
539b809f84 veux: Add Support for BCR
Signed-off-by: MrTopia <redkarmakar@gmail.com>
2025-01-27 23:03:30 +05:30
Lunarixus
ad5c46d5f7 veux: Remove unwanted GApps
Signed-off-by: MrTopia <redkarmakar@gmail.com>
2025-01-27 23:03:30 +05:30
Taki /
82bd6f1f29 veux: audio: Use QCOM implementation for audio effects
* AOSP effects doesn't give as thicc'n'sicc bass boost as the QC effects do.

Co-Authored-By: ANUSH MADATHUMKARA <Anush.4376@gmail.com>
Co-Authored-By: Ivan Martynov <johnivan19999@gmail.com>
Co-Authored-By: Murat Kozan <muratkozan350@gmail.com>
2025-01-27 23:03:30 +05:30
Frost
9119452353 veux: Update from V816.0.9.0.TKCMIXM
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-27 23:03:30 +05:30
Frost
8f0e38d802 veux: Fix soname of renamed libraries
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-27 23:03:30 +05:30
Sebastiano Barezzi
ff16eba6c1 veux: Rename prebuilt audio HAL and libs
Change-Id: Ia46a5ba431767795135f058f092aa38999e860ae
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-27 23:03:30 +05:30
Frost
4528b4aaa8 veux: Update proprietary files list
Add missing libs

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-27 23:03:30 +05:30
Park Ju Hyung
9d91ded6c5 veux: Optimize everything on preopt We have plenty of space left at /system
Change-Id: I39d552259b66ec329c56cd4f4a7fc46fb2c07457
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: orgesified <gesishabani1@gmail.com>
Signed-off-by: clarencelol <clarencekuiek@icloud.com>
Signed-off-by: mutixd <afatsum.605@gmail.com>
Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
2025-01-27 23:03:30 +05:30
DarkJoker360
81581b436a veux: rootdir: Stop bootanimation service after boot * Some users reported bootanimation lags and freezes after a while. Looking from logs it fails to exit once boot is completed. Stopping bootanimation service, as workaround, is preventing this issue.
Signed-off-by: improbir <ghosh_probir@yahoo.com>
Signed-off-by: kssrao13882 <kssrao13882@gmail.com>
Signed-off-by: Omar Mohamed <omarcoptan9@gmail.com>
Signed-off-by: Arijit78 <sahaarijit2007@gmail.com>
2025-01-27 23:03:30 +05:30
Eric Laurent
7872ed359c veux: Configuration for spatial audio
Update audio configuration to enable spatial audio:
- build with spatial audio feature enabled and rondo library
- list spatializer effect in audio effect configuration file
- update audio policy configuration files to declare spatializer output
- declare immersive end point in audio platform configuration
- updated spatial audio blobs from cheetah-14-AP1A.240405.002

Bug: 237677573
Test: spatial audio playback
Change-Id: Ic9c32d813a19ba2789425e12ee9016d53ab30678
Signed-off-by: ULTIMATE-RITESH <ultimateritesh987@gmail.com>
Signed-off-by: MrTopia <redkarmakar@gmail.com>
2025-01-27 23:03:30 +05:30
Chenyang Zhong
fcff21282a veux: enable Seamless Transfer
It allows users to switch between audio output devices by tapping the music
note icon on the notification of a music app.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Signed-off-by: krtonia <krtonia@gmail.com>
2025-01-27 23:03:30 +05:30
Daniel Jacob Chittoor
2c36c1aaa5 veux: init: Enable suspend to RAM
* Improve idle drain considerably
2025-01-27 23:03:30 +05:30
ZVNexus
e8354787f0 veux: properties: Enable Qualcomm TrueWireless™ Stereo audio
* Enable/Disable TWS plus feature support using persist property - persist.vendor.btstack.enable.twsplus

* TWS plus feature is supported only if property is set to True else feature is not supported.By default property is set to False.

Signed-off-by: kibria5 <mdkibria687@gmail.com>
2025-01-27 23:03:30 +05:30
Tommaso Fonda
5eff01a540 veux: gps: Use GrapheneOS's SUPL server 2025-01-27 23:03:23 +05:30
Amrito Das /
61832e4f6c veux: Migrate Some Audio Configs [2/2]
* From - https://github.com/Amrito-Projects/hardware_qcom-caf_sm8350_audio_configs_holi.git
2025-01-23 14:08:47 +05:30
kamikaonashi
1cac48164a veux: switch to AOSP WFD 2025-01-23 14:08:47 +05:30
Amrito Das /
dfecebad48 stone: Introduce Vendorsetup.sh To Clone Device Tree Dependencies 2025-01-23 14:08:47 +05:30
danielml
2a64862a3d veux: Build xiaomi-telephony-stub
To provide the required Xiaomi IMS methods

Change-Id: I1e75476a0d2ed55b5eae2a0a2c6ca4c3c4e2c0f1
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
kleidione Freitas
fb9564251c veux: parts: Drop doze settings
Signed-off-by: kleidione <kleidione@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Malathi Gottam
83f9b863c5 veux: media_profiles: Edit profiles xml in accordance with schema
Export of Video Editor codec profiles & levels and
configuration of Video editor capalibilies,
these two entries are no longer needed hence removed.

Original-Change-Id: I8252415f37f2b1089e7281eec32deda9fd6e98cf
Change-Id: Ib8b4f52b4b83a0a31a66d118c75005ac9945a4e9
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Bruno Martins
5a4d080af0 veux: Remove software OMX blobs
Default to C2 codecs from swcodec apex.

Change-Id: I32f0b0abe680c1f350268115a3cc5488a2a57ec3
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Michael Bestas
ca38ce9667 veux: Remove media_codecs_google_c2*
AOSP codecs can be used by default and it is not necessary to include
them device side.

Change-Id: I8227b06f0466b614f12fa9008402b92461ea3dd0
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Michael Bestas
4caa5c965d veux: Use AOSP default Codec2/OMX ranks
debug.stagefright.ccodec=4
is the default value in frameworks.

debug.stagefright.omx_default_rank=0
was used to rank OMX SW codecs lower than OMX HW codecs
but we have removed all OMX SW codecs now.

Change-Id: Idf55ec02c2c0f4d2fa73f949cffef0d820a54570
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Aaron Kling
e3171b8e6b veux: Remove software omx codec references
These are no longer available as of Android 14 QPR3. The C2 codecs
available by default in the swcodec apex will be used instead.

Change-Id: I8cdf3e700823779a7382c66c3df8410d41209b7c
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Frost
3f5af6f742 veux: Import media configs
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Michael Bestas
a6a8cccf3c veux: Switch to AIDL USB HAL
Change-Id: I70f6a4e57eef577d86987bfae44f381a4f107624
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Frost
ed5eb9816d veux: Update proprietary files list
Add missing files

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Frost
095396c63a veux: Update from V816.0.8.0.TKCMIXM
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:47 +05:30
Michael Bestas
65b1544d5d veux: Switch to AIDL thermal HAL
Change-Id: I6ae621194044ab66fad69b9ef997b3b347bf6120
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Manish Kushwaha
fe57bebf65 veux: Migrate sensor HAL to AIDL interface
Bug: 247478991
Test: tested on-device (P23) ab/P46941077
Test: `sensor_test -ahal list` and `sensor_test list`
Test: `sensor_test -ahal sample -s0` and `sensor_test sample -s0`

Change-Id: I40f6ab6b7780c53cd638a1f77c95f6c324dc2d15
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Michael Bestas
a4a8e47e3e veux: Shim libwvhidl and libwvdrmengine with libcrypto_shim
The following change
e202e51cb0
removed symbols that our libs require.

Change-Id: I1325c34ecec3d339dd68c665010ecb36fa2e6a29
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Michael Bestas
0b2985e4e1 veux: Sync extract scripts with 22 templates
Change-Id: I7963ae050cfb193c5d0c2636da9c1e8f82bcdbdb
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Frost
6055f17895 veux: sepolicy: Label qcom rtc sysfs
* rtc-pm8xxx: probe of 1c40000.qcom,spmi:qcom,pm6125@0:qcom,pm6125_rtc failed with error -1

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
blazerpaul15
c88530e0ab veux: props: Silence ACDB-LOADER log spam
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Rheygine Medel
13da909ceb veux: Add IDisplayConfig 2.0 libraries to product packages
This will generate the 32-bit version of vendor.display.config@2.0
and libdisplayconfig.qti.so libraries.

Change-Id: Id4e49fa23a89bf4e5f62a7bbf7a8768a8197f50c
CRs-Fixed: 2672109
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Bruno Martins
d7012fa37a veux: Declare EGL libs as symlinks during extraction
Change-Id: I4b2f3e79b5e518889d9771bf8990e27babca8b61
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Frost
c5768cd748 Revert "veux: Inherit common partition reserved sizes"
This reverts commit 448d360799dbd980cc70a4de2d0f954d8ead2286.

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-23 14:08:20 +05:30
Master
ecffd99448 veux: audio: Set correct channel mask
* AidlConversionCppNdk: legacy2aidl_audio_channel_mask_t_AudioChannelLayout: no AudioChannelLayout found for legacy output audio_channel_mask_t value 0x10

Change-Id: I31fa119c7bdaae2d6df27864f738fb0af11c0a39
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Kyuofox
77e141465d veux: Allow gettid call for atfwd
We never know what upstream is thinking:
W ATFWD-daemon: libminijail[4756]: failed to get path of fd 3: No such file or directory
W ATFWD-daemon: libminijail[4756]: allowing syscall: connect
W ATFWD-daemon: libminijail[4756]: allowing syscall: fcntl
W ATFWD-daemon: libminijail[4756]: allowing syscall: sendto
W ATFWD-daemon: libminijail[4756]: allowing syscall: socket
W ATFWD-daemon: libminijail[4756]: allowing syscall: writev
W ATFWD-daemon: libminijail[4756]: logging seccomp filter failures
E ATFWD-daemon: libminijail[4756]: blocked syscall: gettid

Change-Id: I42e638f9f25395b37df57471fce68cc73e11e83f
Signed-off-by: Kyuofox <kyuofox@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Yumi Yukimura
f37edfd759 veux: Disable UFFD GC via OVERRIDE_ENABLE_UFFD_GC
Unable to determine UFFD GC flag for kernel version "5.4.259-qgki".
You can fix this by explicitly setting PRODUCT_ENABLE_UFFD_GC to "true"
or
"false" based on the kernel version.
1. Set PRODUCT_ENABLE_UFFD_GC to "true" if the kernel supports
userfaultfd(2)
   and MREMAP_DONTUNMAP.
2. Set PRODUCT_ENABLE_UFFD_GC to "false" otherwise.

Change-Id: Ia8a17467e13d343c03ee29e514994946e7e84985
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Frost
a028c2785e Revert "[TMP] veux: Use prebuilt DTBO"
This reverts commit b9a34b74bd77db26944c8f6feeef5a2c44004f2b.

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Frost
0d60a3e73e veux: Update from V816.0.6.0.TKCMIXM
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
minaripenguin
e87392b4e9 veux: sepolicy: Allow system apps to access zram nodes
* needed by settings app

E ndroid.settings: Can't find memory status under: /sys/block/zram0/

Signed-off-by: minaripenguin <minaripenguin@users.noreply.github.com>
Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
Change-Id: Ic40d2aef2812344d0a94bcd1da4367a2ee9272fe
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Michael Bestas
c6ae175ee4 veux: Sync extract scripts with templates
Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Pawin Vongmasa
b75902fc43 veux: props: Move input surface to CCodec
Test: atest CtsMediaTestCases -- \
--module-arg CtsMediaTestCases:size:small
Bug: 131800183
Change-Id: I8783a7de4a4fdf7ff2eac6697c71f6592c9a9e06
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
basamaryan
43219b8a23 veux: rootdir: Fix PowerOffAlarm
* As seen on sweet MIUI V14.0.7.0.TKFMIXM

Change-Id: I5d4e6f515d52290463d4f46882ec771fba7049b1
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Kanishk
4d296b4b9f veux: props: Disable backpressure propagation
• According to 42bc4bf8e0

Signed-off-by: Kanishk <kanishkthederp@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Michael Bestas
cd867154b1 veux: sepolicy: Move common wakeup nodes to qcom sepolicy
These are not device specific and don't belong here.

Change-Id: I47de84155fa4bd81fb67b3d6ba5465b0b5db4437
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Yumi Yukimura
174b561531 veux: Switch to QTI Memtrack AIDL HAL
Change-Id: Ibcbaff02fd56fbccc3a88c01a5f46a89cb212ef5
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
roynatech2544
d73e2021c0 veux: audio: Disable DRC
* DRC is audio policy to 'compress' volume table, which causes low max volume. Disable it for now

Change-Id: I2e2d8729a8cc5886861e09bf71f5a170f1deb121
Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
LuK1337
af9a02aa78 veux: props: Enable ro.audio.monitorRotation
Adjusts stereo speaker according to device orientation.

Change-Id: I3084018f6caec67c42959dc97bde8dee00eba388
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Zhou Song
ee978acf81 veux: rootdir: Start audio rpc daemon early to improve performance
Audio HAL initialization relies on rpc daemon to load
dynamic libs, if daemon is not ready when HAL tries
to load libs, HAL has to wait until that finished.
Start this daemon early can smooth boot up of audio HAL
process, as this can save time for dynamic libs loading.

Change-Id: Id05ffc46fab812a718b6cb601e0610974b123679
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
SamarV-121
6eb4e8a228 veux: props: Disable continuous transaction tracing on all build types
Change-Id: I95657a00e38f1229675682e784b20cca12c119b0
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
UtsavBalar1231
99c2ab37ae veux: sepolicy: Label qcom extcon sysfs
Error -
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/1628000.qcom,msm-eud/extcon/extcon0/cable.1/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: java.io.FileNotFoundException: /sys/class/extcon/extcon0/cable.1/name: open failed: EACCES (Permission denied)
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/soc:rt-pd-manager/extcon/extcon5/cable.1/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: java.io.FileNotFoundException: /sys/class/extcon/extcon5/cable.1/name: open failed: EACCES (Permission denied)

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:15:52 +05:30
Frost
6d44031797 veux: Update from V816.0.5.0.TKCMIXM
- Blobs from veux-user-13-TKQ1.221114.001-V816.0.5.0.TKCMIXM-release-keys

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
PainKiller3
2807faa5df veux: props: Disable vsync for CPU rendered Apps
Choreographer VSync has some performance impact for CPU rendered apps
as the app has to wait for VSync to start a new frame draw. When the
frame draw time exceeds one VSync, this has a direct impact on the FPS.
debug.cpurend.vsync property controls the VSync for CPU rendered apps.

Disable VSync for CPU rendered app, by setting this property to false.

Change-Id: I6fd7f570aef796ed2b16f9531d5d897f2c533e4d
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
LiMee233
df8559d489 veux: overlay: Auto brightness adjustment
* Make auto brightness more stable, prevent the brightness from
  jittering repeatedly in dim environment.

Change-Id: I720e04dc4ea28a73af2c48967fd0f943c825245c
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Kanishk
207f96257e veux: powerhint: Drop SUSTAINED_PERFORMANCE
• This sometimes keeps the CPU frequencies locked at the set limit even when it's not needed, i.e. playing videos which need hardware decoder, leading to increased power draw, battery drain and heat. Drop SUSTAINED_PERFORMANCE tick from powerhint and let the CPU ramp up it's frequencies when needed, i.e. on demand to counteract the said issue.

Signed-off-by: Kanishk <kanishkthederp@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Frost
8dee7088aa veux: powerhint: Set launch boost to 3000ms (3s)
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Adithya R
5b390698b4 veux: parts: Get rid of proguard flags
This is obsolete.

Change-Id: I1b692d3e1a96c49ac6efd54907ea23c4b4494f7e
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Jyotiraditya Panda
4aa60d0af9 veux: parts: Refactor ClearSpeakerFragment code
- Remove unused imports
- Proper resource release by using try-finally block
- Add null checks for MediaPlayer methods
- Remove audio parameter as it's unused

Change-Id: I7dc2ba7baf6e0193e13583a7454da296254d7333
Signed-off-by: Jyotiraditya Panda <jyotiraditya@aospa.co>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
kssrao13882
5d29cdaaac veux: parts: Remove order preference for Thermal Profiles
- In VoltageOS this tab at top spoils the look of Battery section

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
truly-irham
445bd558b7 veux: sepolicy: Address denial for per-app thermal profile parts
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Chaohui Wang
2d6175edd0 veux: parts: Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427
Test: manual - check Settings pages
Test: m RunSettingsLibRoboTests
Change-Id: I85a70d4c504d8584030ea4a058f30d74206ab835
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Peter Kalauskas
0d6daeb2bb veux: parts: Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: I0c1bd901429bbe3bf81c1530e156735f8637a96e
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Adithya R
fc9390f9d0 veux: parts: Fix thermal profile screen state handling
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
EmanuelCN
12412399a9 veux: parts: Checkout thermal profiles to xiaomi-sm8250 implementation
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Arian
ee8f6209e0 veux: parts: Import from xiaomi_sdm845-common
e261035d91/parts

Change-Id: I442f48780ca020f3e420ee4ccaf8ac07b05457cb
Signed-off-by: Anush02198 <anush.4376@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Arian
fb3311544d veux: props: Redefine bluetooth a2dp offload capabilities
Drop unsupported aptx codecs and rank aac below aptx

Change-Id: Ic0c4cefce9f4c39b609490b124230882dec605e9
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Bruno Martins
158d15aa81 veux: Unset BUILD_BROKEN_INCORRECT_PARTITION_IMAGES
Qualcomm targets can now build hermetic partitions.

Change-Id: I241105e01d85fea983b34846ca675666ac07541b
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Bruno Martins
e8861fe9bd veux: Convert WiFi firmware symlink to install_symlink target
The last bit that was preventing building hermetic images.

Change-Id: I75bb7de4593a7992f6015317cf97e088beeba0cb
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Bruno Martins
b9a6a4c017 veux: Move to new RFS install_symlink targets
Change-Id: I9560fd0da00958d9349a0881b5a5f64a2c02e495
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Sebastiano Barezzi
76451d8187 veux: Use the fragment for QTI vibrator HAL
Change-Id: Id07088526d4698af0872ab427d1b823e098e39d1
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Michael Bestas
772b7f66b7 veux: Build missing libraries for 14 QPR3
Change-Id: I6a84526ca1e9f4e5140c8068646433cab3fe85b2
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Bruno Martins
d2e4e9a53a veux: Inherit from common Xiaomi FCM
Change-Id: I8d4d54bba1b3dff27c11b0034852697b818ee609
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
helliscloser
8f678d4e92 veux: props: Explicitly disable GL comp backpressure
When blur is enabled, There is severe lag in Launcher3 while scrolling apps in App drawer, scrolling through recents and occasionally on QS pull down. Lag & janks are gone now, even with blur.

Signed-off-by: helliscloser <mrumais@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Bart Van Assche
99b43abec3 veux: rootdir: Restore I/O performance
As one can see in cfq_arm_slice_timer(), the CFQ I/O scheduler supports
two parameters that can make it delay I/O: group_idle and slice_idle.
Restore I/O performance by setting both the group_idle and slice_idle
parameters to zero.

Bug: 213617178
Bug: 313578691
Change-Id: I02429876790a6456ca957ff7c38f0c8bf88127f9
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
TheStrechh
e1cb5380db veux: props: Enable WiFi calling over IMS
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Alex Sarraf
1bf6750934 veux: props: Set debug.sf.auto_latch_unsignaled to 0
Need to explicitly set auto_latch_unsignaled property to
disabled state to keep latch-unsignaled as the default
behavior.

Change-Id: I3856caaf0a68e7e720819f25338d1eb9196f56b0
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Alexander Winkowski
6e42a3ed22 veux: props: Fix vendor.qcom.bluetooth.soc value
BT stack sets persist.vendor.qcom.bluetooth.soc which has
the correct value. This fixes FM radio.

Change-Id: I28f9bd479e966264b3d615f7d5fc5ee891cd31d6
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Alan Chen
7eef457d05 veux: wifi: Enable Optimized Power Management
- This config was renamed as of CLO commit [1] and [2].

[1]: 10989ba376
[2]: 9ef1447db3

Change-Id: Ie6ffbeebb45e5dd97b98592b7dfc195a4fb7045d
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Michael Bestas
8002d028e4 veux: Inherit common partition reserved sizes
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
markakash
8bb68ccc74 veux: audio: Fix mic issues in apps like WhatsApp
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:33 +05:30
Bruno Martins
4c1ef0e0f6 veux: Use common libqti-perfd-client and power-libperfmgr
Change-Id: I22d6b35c72629553817005deaefcae60abc72cfd
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
adi8900
780fa845f1 veux: Address QCOM WFD denials
* Fixes buggy QCOM WFD connections.

Change-Id: I9e0b92e7bc9d0ae5e3f50a4f18a0b19988da9a00
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Edwin Moquete
170e956869 veux: Build android.media.audio.common.types-V2-cpp
* Needed for WFD, and not built by default on QPR2

Change-Id: If860613ef4cb6bae7f7a7e72707c24510e36abd6
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Georg Veichtlbauer
201caa6ff3 veux: powerhint: Add DT2W
Change-Id: I7d0dfe249798864a39afd4f339b692584faaf3ec
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
UtsavBalar1231
621dabf80e veux: Define AAPT configuration
Change-Id: Ic12fc243a6b86a0972ef5dc0bb26148be540be57
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Mathieu Chartier
22c326690b veux: Speed profile services and wifi-service
* Reduce RAM and Storage

Change-Id: I1d907b24cb2760ddd9cc65ac4335730c8e61a0a3
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Albert I
c37f3d30c9 veux: Configure zRAM using fstab
* "32-bit overflow" CAF mentioned in the function wrapper inside post-boot
  script sounds very bs, since if it's 64-bit it won't be affected anyways

* We do the setup using fstab instead to allow setting up more flags such
  as setting up backing device and compression streams; as such kanged from
  Pixels

* zRAM size = 50% and swappiness 30%

* Use LZ4 compression even for regular devices

Signed-off-by: Albert I <kras@raphielgang.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Change-Id: Ia6efb3d28e56fb026d9b28fc6633b2eac77dfa47
Signed-off-by: Nippon <adamayyad1999@hotmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Sebastiano Barezzi
567d0c0937 veux: Switch to common Xiaomi light HAL
Change-Id: Ic773e6e411a5cf178bba3a61b20457d62d177db0
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Alex Naidis
b6aa28ec9d veux: wifi: Tune bmps listening interval
Tune the BMPS listening interval for the moderate power level to achieve
 power savings during wifi idle.

Change-Id: I0f5f8fafb6f6b3eaa6a855aa1a7dc12c3886ddce
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
GeoPD
445f9dfe5c veux: props: Disable camera perflock
* Seems to improve the HDR processing in Gcam a bit fast
   and we don't have any boostframework binaries either

Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com>
Signed-off-by: LinkBoi00 <linkdevel@protonmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Pranav Vashi
78da980dc1 veux: overlay: Support smart pixels
- Disabled by default in source, enable it by device side overlay
 - Reference : 0449022bdc (diff-afc3235e8e72a3a65b4bbb5c62a40d0c3624b40f1a1f1eac9b751b2038c140b1)

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Rajan Palaniya
90b1063b5d veux: overlay: Set smooth display config to false
* Enabling smooth display causes flicker to some screens in veux

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Alex Naidis
3a8d750aa2 veux: wifi: Improve 5GHz AP selection preference
* Implement a smarter system on whether to connect to the provided 2Ghz or 5Ghz network.

Change-Id: Idd41e3d9a5e2bde3ea9b4873dffc4274d1530324
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Tim Zimmermann
c5f8a19eb4 veux: overlay: Disable STATE_DOZE_SUSPEND
* Screen content never gets updated with AOD

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
AtlanPrime
5aabdca6e3 veux: props: Set wide color display prop to false
* Fixes yellowish tint in Google-Photos

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Pranav Vashi
08b97d7606 veux: audio: Use 24 bit packed format
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
dataoutputstream
0998d9a071 veux: Build audio.primary.default
Fixes:
AudioSystem-JNI: AudioSystem::listAudioPorts error -19

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
LuK1337
27b550a79d veux: overlay: Don't check proximity sensor before pulsing
- Since we don't have a proper proximity sensor, doze is unable to perform a proximity check
- Fixes ambient display

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Demon000
a7e416ef83 veux: overlay: Disable proximity usage during doze
* We have a virtual (ultrasound) proximity sensor so this will never work

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Ramii Ahmed
b5effbd1ba veux: Allow OTA assert
* to support both variants of the device

Change-Id: Idbf3d58c306a317ff21636c93c34b1420c714cba
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
aryan
f73f315c15 veux: props: Use low gamma implementation for brightness curve
Change-Id: I976fc4fdf9c3baae089cb4aa1a64927deb13f87b
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
TheScarastic
658ad1d45c veux: overlay: Add support for doze auto brightness
- Based on observing it's values, xiaomi.sensor.aod reports
  the following events:

3.0: Dark environment
4.0: Bright environment
5.0: Switched from bright to dark environment

3.0 does not seem to be triggered anymore after bright
environment has been reported.

- Enable brightness buckets in doze to disable animation
  between the brightness levels.

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Doctor Strange
5046f7567b veux: overlay: disable STATE_DOZE
- Our device doesn't support doze
- Fixes AOD flickering issues

Change-Id: I44855e85f7d9e26666a8efb79afc202c69770615
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Michael Bestas
1df37897d5 veux: Build Lineage Health HAL
Change-Id: I70cc903a03ac9fa3303bb8fa039c9de4806449bf
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
sashascurtu
6e2a7d1fc1 veux: Build sensorservice 1.0 HAL
Fixes:
W HidlServiceManagement: Waited one second for android.frameworks.sensorservice@1.0::ISensorManager/default
I hwservicemanager: Since android.frameworks.sensorservice@1.0::ISensorManager/default is not registered, trying to start it as a lazy HAL (if it's not configured to be a lazy HAL, it may be stuck starting or still starting).
I HidlServiceManagement: getService: Trying again for android.frameworks.sensorservice@1.0::ISensorManager/default...
W libc    : Unable to set property "ctl.interface_start" to "android.frameworks.sensorservice@1.0::ISensorManager/default": error code: 0x20
I hwservicemanager: Tried to start android.frameworks.sensorservice@1.0::ISensorManager/default as a lazy service, but was unable to. Usually this happens when a service is not installed, but if the service is intended to be used as a lazy service, then it may be configured incorrectly.

Change-Id: If6fdef9dc39daaba9138fe3f8acf06cb6a0e78f8
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
ghostrider-reborn
ed3f020865 veux: props: Enable QCRIL radio power saving
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
¨raystef66¨
67f4859f9c veux: overlay: Push 120 FPS for ScreenRecorder
Our Device is with 120hz display and Snapdragon 695, there is no reason to lock on 60fps

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Cole Faust
cce760c2ec veux: Add BUILD_BROKEN_INCORRECT_PARTITION_IMAGES
Qcom has issues that prevent it from working with a hermetic
partition build.

Bug: 205632228
Test: Presubmits
Change-Id: I490a29da38a6f68e7dd3650d8140cb11adaa8c7a
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
sabarop
41eeb16dd5 veux: props: Silence OpenGLRenderer logspam
E OpenGLRenderer: Unable to match the desired swap behavior

Signed-off-by: BalayBera <balaybera@proton.me>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
ExactExampl
e6890ee9f2 veux: props: Enable ro.hwui.render_ahead
* Rendering ahead makes some animations handling better (especially qs pulldown on a13 qpr2)

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Alessio Balsini
e1d19e1a8e veux: props: Use FUSE passthrough by default
Enable the persist.sys.fuse.passthrough.enable flag for the veux device
configuration to enable the FUSE passthrough feature.
This feature has been enabled on Cuttlefish, Wembley and Redbull devices for
months and no issues have been detected yet.

Fixup:
- The prop is supposed to be set in product instead of system as per [1].

[1]: https://source.android.com/docs/core/storage/fuse-passthrough

Bug: 168023149
Test: 'adb shell getprop | grep persist.sys.fuse.passthrough.enable',
    ScopedStorageTest
Signed-off-by: Alessio Balsini <balsini@google.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
afterallafk
0def20655a veux: props: Enable IMS Volte
Signed-off-by: afterallafk <shivamatiet2001@gmail.com>
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
pengfeix
4cd437b6a4 veux: overlay: Enable IMS feature flags for supported carriers
- Enable VoLTE/VoWIFI for all indian cariers
- Enable VoLTE for Viettel Vietnam
- Enable VoLTE for Mobifone Vietnam
- Add full Support Carrier Smartfren VoLTE
- Enable VoLTE support for Indosat and XL Axiata
- Enable VoLTE support for Telkomsel (Indonesia)
- Enable VoLTE support for Three
- Enable VoLTE support for Bakcell (Azerbaijan)

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
johnmart19
be9ba9e153 veux: props: Enable VoNR Calls support
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Adithya R
cd2996acd2 veux: Enable VoNR on Jio 5G
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
basamaryan
796556f43a veux: Don't explicitly include updatable_apex.mk
It is inherited by base_system.mk as of QPR2

Change-Id: I020a05b233f61ea28d03199cbc76051e6e97e1dc
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Ido Ben-Hur
7369895f64 veux: overlay: Limit AOD refresh rate to 60hz
- This is second part of VoltageOS/frameworks_base@cb296b8

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Frost
720a397d25 veux: props: Move to proper path
- Minor Cleanup
- Add system.prop
- Copy out props from BoardConfig.mk

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
mikeNG
1b233d6ff9 veux: overlay: Enable battery cycle count
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Tomasz Wasilczyk
5f1995a47d veux: gps: Don't include cutils/threads.h
Bug: 289414897
Test: buildserver
Change-Id: I14b99f42feaae7af00cbd17cfe482eb2e5da71e8
Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
Frost
b27c98b473 veux: Update from V816.0.3.0.TKCMIXM
* Update blobs from latest HyperOS update

Signed-off-by: Frost <159105703+Karan-Frost@users.noreply.github.com>
2025-01-22 00:14:08 +05:30
chuspita
e8aeac976a veux: Add props for better signal
Signed-off-by: Frost <karanraj132804@gmail.com>
2025-01-22 00:14:08 +05:30
spkal01
3d84251568 veux: Add Battery Information in battery settings
Signed-off-by: Frost <karanraj132804@gmail.com>
2025-01-05 20:26:03 +05:30
Frost
c68331cec0 veux: README: Update with proper information
Update according to device

Signed-off-by: Frost <karanraj132804@gmail.com>
2025-01-05 20:26:03 +05:30
Alexander Winkowski
f5bbf337ab veux: overlay: Override WifiCustomization resources
Change-Id: I13e70f752d4688189ef301d515876294a0fc0677
Signed-off-by: Frost <karanraj132804@gmail.com>
2025-01-05 20:26:03 +05:30
Alexander Winkowski
6c038b4503 [TMP] veux: Use prebuilt DTBO
Change-Id: I879c4080c8edc9bf645c49ff14b888843240290e
2025-01-05 20:26:03 +05:30
Alexander Winkowski
8d1c1f2a6f veux: Update WFD blobs
Change-Id: I663d4132969fc50c117ac29760b36536269712c2
2025-01-05 20:26:03 +05:30
Alexander Winkowski
3e7463c029 veux: Include MiuiCamera
Change-Id: Ic043018f738c92212564ae499e05e34f6b3e6d11
2025-01-05 20:26:03 +05:30
Alexander Winkowski
a836057489 veux: overlay: Allow lower auto brightness
Change-Id: I493ed432717dc19b1014a106debaaea47f8c0459
2025-01-05 20:26:03 +05:30
Alexander Winkowski
e721889223 veux: Set device name as per the stock ROM
Change-Id: I611e5f912096b3853a7d80f4135656d20bbf7f26
2025-01-05 20:26:03 +05:30
Alexander Winkowski
66cf74c7d5 veux: Add support for different NFC variants
Change-Id: I28efbcacbabb8c00405eec2ca87a47fb09fa143a
2025-01-05 20:26:03 +05:30
Alexander Winkowski
d1f9e40007 veux: rootdir: Enable libperfmgr
Change-Id: I4d99ad4b474df8c3631d13735d1d72f7297ec5a8
2025-01-05 20:26:03 +05:30
Alexander Winkowski
296ab55e4f veux: sepolicy: Initial adaptation
* Reformat and alphabettically sort

* Remove cameraperf, camerapostproc_xiaomi,
  udfps, perfd, powershare, citsensor, mius
  and touchfeature parts

* nv_mac seems to be "merged" into BT HAL
  on this device

* Add libperfmgr rules from Xiaomi SM6250

Change-Id: I38d6934f94cc5615a72a58785f79c19e02df38b0
2025-01-05 20:26:03 +05:30
Alexander Winkowski
b4f5197dae veux: Pull SELinux policy from Xiaomi SM8350 tree
At commit 67b8a98cf0128e04a1f33614690b5bfa5ac443b9

Change-Id: I8cdf0dd602347a9a4440f2a2ab813eb734f55646
2025-01-05 20:26:03 +05:30
Alexander Winkowski
928f894425 veux: Reserve space in dynamic partitions
Reserve 1G in system partitions for flashing GApps packages when they're
not included, otherwise, reserve 24M in each partition.

Change-Id: I76d5583cd85d87a88a9b38aee5305927eb5067de
2025-01-05 20:26:03 +05:30
LuK1337
b376f93318 veux: Prevent adding same dependency twice in blob_fixup
Change-Id: Idedeb51e027a09f64a29ac67a3a2f2a0594213f6
2025-01-05 20:26:03 +05:30
althafvly
f59be6ee8e veux: Add libpiex_shim for com.mi.node.mialgocontrol.so
Change-Id: I9e8b125ab5dfaa325db63b02a7fcf51577ee7b0d
2025-01-05 20:26:03 +05:30
Arian
bbb438416c veux: Patch ims.apk
Patched to remove com.qti.permission.BIND_QTI_IMS_SERVICE and
Landroid/telephony/TelephonyBaseUtilsStub;->isMiuiRom()

Full patch: https://paste.myself5.de/zitiketuto.diff

Change-Id: I1ecff29d7089bffa50d41acb6b55c6d8e36d1d9c
2025-01-05 20:26:03 +05:30
Alexander Winkowski
701db1a72f veux: Update display blobs from tundra
To match the display HAL

Change-Id: Idb215acad93043cfd8d4cc5ba3696d9ebcd5fbb8
2025-01-05 20:26:03 +05:30
Jabiyeff
13b009e886 veux: Strip size of com.qti.node.mialgocontrol.so
* Size decreased from 148 mb to 12 mb.

Change-Id: If680f2b0511f9e348973ea2a98f9f832745f6d79
Signed-off-by: Jabiyeff <cebiyevanar@gmail.com>
2025-01-05 20:26:03 +05:30
Bruno Martins
fb9f762af4 veux: Fix charger init triggers after moving to health AIDL
Change-Id: I58e7c493d3b300b1efb1685fba637fee6b56bec3
2025-01-05 20:26:03 +05:30
Pig
d529a19b51 veux: Suppress CamX debug
Change-Id: I001be38a19664bcf4994fc88fa1f4448c8cc7891
2025-01-05 20:26:03 +05:30
dianlujitao
ae276fbaf2 veux: Drop dependencies on android.hidl.base@1.0.so
Change-Id: I4c6803a6f1bfdd3fde7d83f59c0642f3398f531b
2025-01-05 20:26:03 +05:30
Alexander Winkowski
745b875236 veux: Control wfdservice64 with vendor.wfdservice prop
Change-Id: I984c413ce2455065b717c04df02cd2d121640798
2025-01-05 20:26:03 +05:30
Alexander Winkowski
72fba1966a veux: Add SKU props from stock
Change-Id: Ib7b6a0d8b992f264762c21f477c42f2114e51c7f
2025-01-05 20:26:03 +05:30
Chirayu Desai
4a6f5475a3 veux: Set BOOT_SECURITY_PATCH
* This is put in vbmeta, and stock OS sets it

Change-Id: I69485c8207eca5ee9e7f1f4e02d684707c6dece3
2025-01-05 20:26:03 +05:30
Alexander Winkowski
e2daa24031 veux: Initial proprietary files list
Change-Id: Ie0b6450e1494fdb4342497c5c5f5e55ed7d916d3
2025-01-05 20:26:03 +05:30
Edwin Moquete
fb16daa101 veux: Disable display refresh rate override
This got enabled by default on U, and it causes apps like
Chrome and Youtube to set the refresh rate to 30FPS when
playing some videos.

Change-Id: I649bf03d550c2b9726c7957d15ed09e455d874ec
2025-01-05 20:26:03 +05:30
danielml
d763266ac0 veux: Override doze mode support
Change-Id: Ibdc4080dc66b5667993307f4c8ff6f83dc751e85
2025-01-05 20:26:03 +05:30
Midas Chien
3d6d47ebf6 veux: Don't latch unsignal buffers
Set debug.sf.latch_unsignaled=1 is used to allow surfaceflinger to
latch unsignal buffers that can give more time for buffer to render.
But if the buffer takes longer time to finish, it will block whole
display pipeline result to jank.

Bug: 157964883
Test: scrolling, launch
Change-Id: I56c3e05921de5fc9569bf3f93fde03022a64b6a4
2025-01-05 20:26:03 +05:30
LuK1337
1bfb6d0577 veux: Pull appropriate USB props from vendor_product.mk
Change-Id: I93b25c5d0989c83d1c8d7b7946a083771febdddd
2025-01-05 20:26:03 +05:30
Arian
f20f036e97 veux: Set ro.media.xml_variant.profiles to choose media profiles
This was introduced with [1] and allows to choose target specific media
profiles without caf changes to frameworks/av. Unset media.settings.xml
so that the new property gets respected.

[1]: eaac82f33f#

Change-Id: I7ec306bf3dd595c09308ed26c9d3a6db8490c7f0
2025-01-05 20:26:03 +05:30
Alexander Winkowski
75e1613d7f veux: Inline init.qti.media.sh into build.prop
Change-Id: I23d206aef57ab0b729fe5180f94c035f93d7ef3d
2025-01-05 20:26:03 +05:30
Alexander Winkowski
13abb0f9f9 veux: Set vendor SKU in build.prop
Stock QCV scripts don't set it for holi platform.

Change-Id: I4b160246c24c889e80a5fa94e26d21fcbb7d91dd
2025-01-05 20:26:03 +05:30
Alexander Winkowski
43fcf8e65b veux: Import build properties from V14.0.6.0.TKCMIXM
Change-Id: I3e9ac05a2ef9d934ff2fcd26ac09c9100a9b9cb9
2025-01-05 20:26:03 +05:30
Sebastiano Barezzi
cb960bf7d1 veux: Build vendor interfaces libraries
Change-Id: I0c8760ff6923c2d2a43ec058554d724ca6600f3c
2025-01-05 20:26:03 +05:30
Sebastiano Barezzi
95c1688d5e veux: Build WFD libs
Change-Id: I859cd3ff8e1729323f2c72df4feca55559262878
2025-01-05 20:26:03 +05:30
Jimmy Chen
14c3c85be6 veux: Move supplicant service init to wpa_supplicant
Bug: 138790309
Test: boot and wifi function is ok
Change-Id: I35cf3e03566443e20799623045eacd423fd7f5c4
2025-01-05 20:26:03 +05:30
Alexander Winkowski
fa4d3ed867 veux: Import WiFi configs from V14.0.6.0.TKCMIXM
Change-Id: Idb380aa74bdf146739adefb076acb49c2e89bfbd
2025-01-05 20:26:03 +05:30
Mohammad Asaad Akram
444111da5a veux: Enable asynchronous library events in WPA supplicant
Change-Id: I3b028afa54605bd57d9fb5700d792cb9e5e0e76f
2025-01-05 20:26:03 +05:30
Demon000
1a8e2981c0 veux: Build WiFi packages
Change-Id: Id0e785d1d22bda58922658de6ab0b5b0cf1e9927
2025-01-05 20:26:03 +05:30
Fenglin Wu
622f7ccf5d veux: Add config to exclude haptics devices from input subsystem
Haptics devices which registers as input FF devices are not supposed to
be detected by input subsystem. Add excluded-input-devices.xml file for
input subsystem to exclude them.

Change-Id: I52dc6e502b29e2813299d073195a0991bb2cf692
2025-01-05 20:26:03 +05:30
Bharat Pawar
2c66b0ebd0 veux: Enable LED based vibrator
Enable LED based vibrator for talos, moorea and
atoll targets.

Change-Id: I079eefaefff77fe19304acc8749773febf91a7fc
2025-01-05 20:26:03 +05:30
LuK1337
10744a6c52 veux: Build vndservicemanager
* Needed for FCM >= R.

Change-Id: I6d5eb8084127e295e4abec2c0192c0ad5b07b867
2025-01-05 20:26:03 +05:30
Sebastiano Barezzi
be7b4b2109 veux: Use QTI USB init configs from USB HAL repo
Change-Id: I966d251a2756c9d9e91f621cbc5872448d022de4
2025-01-05 20:26:03 +05:30
Cosmin Tanislav
d17a3b6a53 veux: Build QTI USB service
Change-Id: I2c6ed5c909c31837321fc587050ff810422d95b0
2025-01-05 20:26:03 +05:30
Alex Deymo
5e1ebb998d veux: Build A/B update engine
Change-Id: I9dbf84e1531ed3e32b21c8fec13266cfe4d23cd3
2025-01-05 20:26:03 +05:30
LuK1337
bdbc377cc2 veux: Build android.hardware.thermal@2.0-service.qti
As seen on stock ROM.

Change-Id: I950ab50ded7b3c1164ff88ab18d7f1e3365a6086
2025-01-05 20:26:03 +05:30
Demon000
11c03d0848 veux: Build telephony packages
Change-Id: I5fafc22fc696b04abc2f79100306f1625ac03fbc
2025-01-05 20:26:03 +05:30
Alexander Winkowski
f0aab1f074 veux: Set shipping API level
Change-Id: Ic710848ea8329eb0b0eabbfb3771ecf9cba3c7e7
2025-01-05 20:26:03 +05:30
Alexander Winkowski
149f023bfa veux: Build Xiaomi common sensors Multi-HAL
Change-Id: I96425bc0907b37ebebfca8600eb07c71f3afaab8
2025-01-05 20:26:03 +05:30
Nolen Johnson
e03320c624 veux: Simplify AVB flag logic
* AVB's `--flags 3` argument builds a disabled VBMeta with
  disabled hashtree, so no need to set both flags individually.

Change-Id: Ibe9ee322a5af58f13e76d53e18dee49451fe8838
2025-01-05 20:26:03 +05:30
Christian Oder
efadedd2db veux: Build disabled VBMeta image
Partitions that use vbmeta_system can be found by looking at
avb flag in fstab from boot ramdisk.

--flags 2 makes the verification function of avb always return a
positive result.

--set_hashtree_disabled_flag builds the vbmeta images with the
HASHTREE_DISABLED bit set and as a result they don't need to manually
disable dm-verity via e.g. 'adb disable-verity'.

The rest of the configuration is taken from
https://source.android.com/devices/tech/ota/dynamic_partitions/implement#avb-configuration-changes

Change-Id: I381feef8f6fefc8449ca50d85d704b67bcc8a77e
2025-01-05 20:26:03 +05:30
Michael Bestas
82aca7d218 veux: Implement xtra-daemon control via property
Default to false if the property is not set.
Device init scripts will need to be adapted to restart
loc_launcher service when property change is detected.

Change-Id: Icbda789cd2a9a3391f437af2c07fc5127f2f09ab
2025-01-05 20:26:03 +05:30
Michael Bestas
a64c76be49 veux: ueventd: Remove all permissions from /sys/devices/soc0/serial_number
Change-Id: I688347cfe59f56e4de2e4bf3c3324ca465f7a897
2025-01-05 20:26:03 +05:30
Michael Bestas
1a8181f2ea veux: ueventd: Remove stray line
Change-Id: Iddee28c06db20b20a8977c3d9d4982f86a279e92
2025-01-05 20:26:03 +05:30
PRANAY BHARGAV BHAVARAJU
84ef27863b veux: ueventd: Avoid setting permission for /dev/hw_random
Below patch from system/core is setting required access policy
for /dev/hw_random. And CTS test is updated accordingly

https://android-review.googlesource.com/c/platform/system/core/+/2229337
https://android-review.googlesource.com/c/platform/cts/+/2232052

Change-Id: I762dfa3b1e84dee6c49fc178b5b75cf1c134cfb7
2025-01-05 20:26:03 +05:30
Mohammed Mirza Mandayappurath Manzoor
96eebadd98 veux: ueventd: Set permissions for KGSL sysfs node
Some KGSL sysfs nodes need to be access controlled. Set proper
permissions for the same.

Change-Id: Idc7e2447d02742074873901c6539f2c6d9d25862
2025-01-05 20:26:03 +05:30
Albert I
c70ec864fd veux: fstab: Handle avb= fs_mgr flags correctly
Specifying avb=<vbmeta-partition> is only necessary for first entry of
partition groups that use same vbmeta partition. The following entry can have
<vbmeta-parititon> part omitted.

Test: None
Link: https://source.android.com/devices/architecture/kernel/mounting-partitions-early#fstab-entries
Change-Id: I5a42fd3de72c400acfae56d6a1e1b85c22a79537
Signed-off-by: Albert I <kras@raphielgang.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2025-01-05 20:26:03 +05:30
Alexander Winkowski
e2b73731d4 veux: fstab: Remove MIUI partitions
Change-Id: Iec571091763012f599c74f11d27e368e80371b38
2025-01-05 20:26:03 +05:30
LuK1337
2ebd063a0d veux: rootdir: Set SSR restart level to 'RELATED'
Change-Id: I32fc08c9ad36b9c8ebfc019fc87a19eece18f0b4
2025-01-05 20:26:03 +05:30
Randall Huang
e106a1b33c veux: rootdir: Remove IO read_ahead_kb tune
If we set 2048KB ra value in the beginning of the
boot process, services initialized at this time would
keep 2048KB ra value even though we adjust the ra value
to 128KB after boot completion.

This may cause memory pressure.

Bug: 174700194
Signed-off-by: Randall Huang <huangrandall@google.com>
Change-Id: I97ee0ee9511eaada011f2634afd68d68cdca4570
2025-01-05 20:26:03 +05:30
Miguel de Dios
43470f2669 veux: rootdir: Change readahead to 128KiB on post-boot
Reduce readahead from 512KiB to 128KiB to reduce thrashing when we
have a lot of apps running.

Bug: 110908295
Bug:  80426378
Test: manual - device boots
Test: manual - check app launch does not take long
Test: cts-tradefed.sh run cts -m CtsCameraTestCases
Change-Id: I59c1f2f8a6fbb5e0d956ba07a40a2bfac3b61481
2025-01-05 20:26:03 +05:30
Prabhanjan Kandula
2ab8e5e563 veux: rootdir: Avoid delay for vblank disable from DRM
Set drm_vblank_offdelay parameter to -1, to make DRM
issue the vblank disable immediately with out delay.
By defailt  the DRM framework has a delay of 5 secs
timeout before issuing the vblank disable.

Change-Id: Idc1dfe6a6994f2ac2d3c60ae8fd5a4e883b675d9
2025-01-05 20:26:03 +05:30
Alexander Winkowski
f1e73bc7c0 veux: rootdir: Clean up
Change-Id: Id7277abb5725140fce1683e6d878e90dd7f17011
2025-01-05 20:26:03 +05:30
Kamal Wadhwa
ce90bcd3bc veux: Remove charger service restart and modem partition mount calls
Holi supports linux based charging and not via ADSP,
hence remove the modem partition mount logic.
This improves the entry time into power-off charging mode.

Change-Id: I69337e773f6078bc0847b7db199fc21e8c975a8a
2025-01-05 20:26:03 +05:30
Rama Aparna Mallavarapu
a8a6f4da35 veux: rootdir: Import kernel rc script to be run during the boot
All the kernel tunables are now part of the kernel scripts.
Invoke kernel RC script during the boot. Also move the kernel
related settings to kernel-scripts folder.

Change-Id: Ic8f1114377345f1dc6ca8ec441aa99de61a7a453
2025-01-05 20:26:03 +05:30
Alexander Winkowski
692e19ab59 veux: rootdir: Mark modem config copy completed unconditionally
Normally ro.vendor.ril.mbn_copy_completed is set by init.qcom.sh but
that script was dropped because it does nothing else on this platform.

Change-Id: I19edf64df2c8ed9ab405b5684cedbb1dc4248eab
2025-01-05 20:26:03 +05:30
Alexander Winkowski
4b49ec56c3 veux: Import rootdir from V14.0.6.0.TKCMIXM
Change-Id: I1b51318f885e734f322864f7c61a599e9a7113c6
2025-01-05 20:26:03 +05:30
Arian
fae3c5717f veux: Build librmnetctl
Change-Id: Ica941c1d2521e738d4990261bab41fee5daffa9d
2025-01-05 20:26:03 +05:30
Sebastiano Barezzi
0e8a214f4b veux: Build QTI Framework detect libs
Change-Id: Ic4db96f8bd5a19f4805bd9c40544ed51d0352c61
2025-01-05 20:26:03 +05:30
LuK1337
093c94ed50 veux: Build libprotobuf-cpp-lite-3.9.1-vendorcompat
Change-Id: I0aac742db9c2b4b3e48ee20158f19405863893c2
2025-01-05 20:26:03 +05:30
Krzysztof Kosiński
da7c777c09 veux: Add prebuilt protobuf 3.9.1 to vendor partition
Needed to work around a Qualcomm HAL prebuilt.

Bug: 203713560
Bug: 258322017
Bug: 254854421
Test: Forrest
Change-Id: I4eebc60f10fbea6a66127ed3e08441db32536f78
2025-01-05 20:26:03 +05:30
Alexander Winkowski
9c0ebaeb3b veux: Refine powerhint according to freqbench results
Change-Id: Id4727badf9d85609c9a3697aadf1677906abb7b5
2025-01-05 20:26:03 +05:30
Alexander Winkowski
c380469132 veux: configs: Add initial powerhint for blair
Based on redbull, adapted nodes, removed unused/unneeded hints.

Change-Id: Iee610168800d9cbecccc4ca121418a9bce717cce
2025-01-05 20:26:03 +05:30
Alexander Winkowski
3dd20b99bb veux: Build Xiaomi common power AIDL HAL
Change-Id: I0e10f0b36598b8cbf25ee2dc08b8a4eced95c2ed
2025-01-05 20:26:03 +05:30
Alexander Winkowski
2f536d6bea veux: Copy permissions from V14.0.6.0.TKCMIXM
Add android.software.opengles.deqp.level.xml, which seems to be missing.

Change-Id: Idd2f358b4aefd74bed26a9450870be85e67a44cf
2025-01-05 20:26:03 +05:30
Alexander Winkowski
db0177336d veux: Override task_profiles.json
Change-Id: I7291a318d523c030bbb3f5aa71364d512eb7490c
2025-01-05 20:26:03 +05:30
Sebastiano Barezzi
8706a67f36 veux: libqti-perfd-client: Move to C
* Why bothering with C++ mangling when we can just build it as a standard C library?

Change-Id: I45ea977edf7ea7fab6fece76f3049654a8d24c5d
2025-01-05 20:26:03 +05:30
Chenyang Zhong
41531425a8 veux: libqti-perfd-client: return a dummy value
Return a positive integer for perf lock acquire and release so
that Goodix/FPC fingerprint sensor blobs will not complain.

Goodix:
E [goodixHAL][gf_hal_milan_f_series]: goodix_perf_lock_acquire: Failed to acquire perf lock, err: 0
E [goodixHAL][gf_hal_milan_f_series]: goodix_perf_lock_release: Perf lock release error 0

FPC:
E fpc_tac : fpc_perf_lock_acquire: Incorrect params, Failed to acquire perf lock, err
E fpc_tac : fpc_perf_lock_release: Perf lock release error 0

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I861672e9a738c2204755d802670f4b28b662f286
2025-01-05 20:26:03 +05:30
Bruno Martins
ef9d7f291a veux: libqti-perfd-client: Remove namespace declaration
It's pointless when using extern "C".

Change-Id: Ibdf9f06a70aa3a75687b33781c78cf2172bb334d
2025-01-05 20:26:03 +05:30
Lucchetto
1e448dc0a3 veux: Create dummy libqti-perfd-client
* proprietary perfd blobs can finally be nuked without breaking goodix
* we could even map the functions to use libperfmgr powerhints in the future

Change-Id: I124652f3041761966a3e3bd97c757fecc39cc5fb
2025-01-05 20:26:03 +05:30
Demon000
1d4331384b veux: Use dynamic partitons
Change-Id: Iac89f608a7f8efa78da5200c68cb45ab2f439fd0
2025-01-05 20:26:03 +05:30
Danny Baumann
cc7a0c9be7 veux: overlay: Enable call recording
Change-Id: I1b4478b330b13cf5d0fe1ed0d40f43e4b3825f33
2025-01-05 20:26:03 +05:30
Alexander Winkowski
3bae00c883 veux: overlay: Initial LineageSDK overlay
Change-Id: Ifecb5f30cbc1e95c130781eb306bab96d1f1765b
2025-01-05 20:26:03 +05:30
Jake Weinstein
f8595591e4 veux: overlay: Allow VoLTE and VoWiFi/WFC by default
Change-Id: I0df3d87074378224a6b29b26166dcf2fc59f34c2
2025-01-05 20:26:03 +05:30
Dyneteve
64045a6978 veux: overlay: Remove "SIM x is HD capable" message
sed -i '/config_update_service_status/d' overlay/CarrierConfigOverlayCOMMON/res/xml/vendor.xml

Change-Id: I26ce187483d6d8c18bcd1901cd6d71ca6ec1e31f
2025-01-05 20:26:03 +05:30
Alexander Koskovich
efa4aa39d7 veux: overlay: Use CarrierConfig DTMF & CSP booleans
* Overlays were deprecated awhile ago for these.

Change-Id: I51b70aa15f128186063ce52446cb67715a957185
2025-01-05 20:26:03 +05:30
Alexander Winkowski
6145694f25 veux: overlay: Initial product overlays
Based on V14.0.6.0.TKCMIXM

Change-Id: I415b5877bf41fc3b78ae83a53450076a7c2b9386
2025-01-05 20:26:03 +05:30
Alexander Winkowski
1b2a7fca21 veux: overlay: Initial vendor overlays
Based on V14.0.6.0.TKCMIXM, brightness overlays from lynx.

Change-Id: I4a06896f7cc3a599794cd3affd304e2c25f077e1
2025-01-05 20:26:03 +05:30
Anton Hansson
695d09afab veux: Enforce RRO for all resource overlays
Bug: 118823052
Test: make
Change-Id: I579d09480c7a482543ea616dd5c493d825bb98b1
2025-01-05 20:26:03 +05:30
Alexander Winkowski
2f06b04a3a veux: Build extra NFC packages
Change-Id: Ide2ddbe1bd5e9626fa5c883475d1fafe6dcebbb1
2025-01-05 20:26:03 +05:30
LuK1337
c6d248a70b veux: Build AIDL NXP NFC HAL
Change-Id: I6ace3ac149c84d2cb9e2773e7ef5ddbf24c35b92
2025-01-05 20:26:03 +05:30
Sebastiano Barezzi
6cde167e4f veux: Build mtdservice interface lib from source
Change-Id: Ie739f283c4be1b77d57aaee1941ed46957da1d1a
2025-01-05 20:26:03 +05:30
Bruno Martins
c34764393e veux: Build mlipay interface from source
Change-Id: I41361a4f1405950f73f94609171851972803d099
2025-01-05 20:26:03 +05:30
Alexander Koskovich
c8891b4148 veux: Copy out media permissions and build media packages
Change-Id: I26674be6f3d4d10685cd004b6dccf98a14d50f28
2025-01-05 20:26:03 +05:30
Volodymyr Zhdanov
8ee12b870f veux: Build IR HAL from source
Change-Id: I619157582ece00d6fb7adef00182347211716706
2025-01-05 20:26:03 +05:30
Volodymyr Zhdanov
a5c50603d1 veux: Build IPACM from source
Change-Id: Id40cea7059316370fc18dfbdb9e00b5b84f28b10
2025-01-05 20:26:03 +05:30
Giovanni Ricca
5a2f6e86ee veux: Build common iFAA service
Change-Id: Ib777523cbb3cbc29086c8f6ef3cc0c31d49b9405
2025-01-05 20:26:03 +05:30
Christian Oder
407b72ff58 veux: Add basic permission file for HotwordEnrollment
Change-Id: I2986ba3599fe65a8da27649d98d70cd548257aa8
2025-01-05 20:26:03 +05:30
Alexander Koskovich
ce7154e948 veux: Build vendor HIDL transport and HWBinder libraries
* Both these libraries are still widely used by QTI
   binaries & libraries.

Change-Id: Ib7a4576577426ffaf557ba8b9b4ca52573285fef
2025-01-05 20:26:03 +05:30
Alexander Koskovich
314cea81c6 veux: Build the QTI health HAL
Change-Id: I86abeb45119d1cdf05dfb1fd28090628cee64925
2025-01-05 20:26:03 +05:30
Alexander Winkowski
16d5e96af3 veux: Build GNSS HAL from source
Change-Id: I92f2767976ff9cd70effd884d7c0fe22dde56a9e
2025-01-05 20:26:03 +05:30
Alexander Winkowski
1f3385aed5 veux: gps: Enable lowi-server
To match Pixel setup.

Change-Id: I60097ef00debd3bcddb03d4e95c220d166d2a5de
2025-01-05 20:26:03 +05:30
Michael Bestas
f5dba3bdda veux: gps: Disable unused location services
Disable xtwifi & slim_daemon, matching Pixel setup.

Change-Id: I27156e772ef138c9b2e112469c264236ea5c398c
2025-01-05 20:26:02 +05:30
Alexander Winkowski
661438a1f1 veux: gps: Import izat.conf
From V14.0.3.0.TKCMIXM

Change-Id: I0d8a94672a011458d713e190a8e121f7ceb320ec
2025-01-05 20:26:02 +05:30
Michael Bestas
2c38b8513b veux: gps: Remove all Wno-error flags
Almost all warnings/errors have been fixed.
Ignore undefined bool conversion error on purpose.

Change-Id: I00cb5f38711fa9f873da030fc6a0ebc6cde3ceeb
2025-01-05 20:26:02 +05:30
Yi Kong
ad39ee3e10 veux: gps: Fix unqualified-std-cast-call warning
hardware/qcom/sm8150/gps/utils/LocIpc.cpp:315:24: error: unqualified call to std::move [-Werror,-Wunqualified-std-cast-call]
            mIpcRecver(move(ipcRecver)) {}
                       ^
                       std::

Test: presubmit
Change-Id: I7378416e788f20ebb3f8d1d065d60964dc76eb99
2025-01-05 20:26:02 +05:30
Madhanraj Chelladurai
25f6c3871b veux: gps: Add NULL check before object access
Correct the NULL check code block and add NULL check before
object access.

Change-Id: Ic41b781b41fb4e21bbff8801d500a41a6d7219d0
CRs-fixed: 3084543
2025-01-05 20:26:02 +05:30
Albert I
5b55d96bcb veux: gps: Implement list empty error code for msg_q
This fixes enum-conversion warning due to implicit type enum casting
between linked_list and msg_q which happens only for status -6.

Change-Id: I27ba74c4d840b7ba0cb1017d69a30fc25b80d6b9
2025-01-05 20:26:02 +05:30
Albert I
c5ce3457e5 veux: gps: Address logical-op-parentheses warning
Change-Id: I45d621a2b995afeb7757df3f89614a0d95552f33
2025-01-05 20:26:02 +05:30
Albert I
61b6b38b43 veux: gps: Reorder initializations list to satisfy warnings
-Wreorder-ctor is a compile-time, Clang-only flag which is enabled by
default since Clang 12, which will warn whenever a specified field will
be initialized right after field specified below it. However, since it
doesn't sweep through all fields, compiler may miss some of them.

This order has been checked thoroughly through many trial and errors to
ensure that no such warns will be triggered anymore.

Change-Id: Id24cbb7277dc8d6c02767f8f365818ab6c017683
2025-01-05 20:26:02 +05:30
Pirama Arumuga Nainar
19b261165f veux: gps: Fix -Wbitwise-instead-of-logical
Bug: http://b/215753485

Reported by clang-r445002

error: use of bitwise '|' with boolean operands [-Werro
r,-Wbitwise-instead-of-logical]

  if (gnssCbIface != nullptr || gnssCbIface_2_0 != nullptr| gnssCbIface_2_1 != nullptr) {
                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                          ||

Test: build with clang-r445002
Change-Id: I9410eb5208227dd70bd036aee02fb2aeb912f266
Merged-In: I9410eb5208227dd70bd036aee02fb2aeb912f266
2025-01-05 20:26:02 +05:30
Michael Bestas
7b40e4d542 veux: gps: Lower debug level
* Kill logcat spam

Change-Id: I20d1f698d3c2d1b56e79f6eb6c5c17069e43c60f
2025-01-05 20:26:02 +05:30
Michael Bestas
31d066e9e9 veux: gps: Resolve unused parameter warnings
Change-Id: I0acef3da2c3567a28edd0a71dac89a5828f7725d
2025-01-05 20:26:02 +05:30
Alexander Winkowski
726c510b5a veux: Import GPS HAL from LA.UM.9.14.r1-19100-LAHAINA.0
Cleaned up with commands:

rm -rf android/{1.*,2.0}/
rm -rf etc/seccomp_policy/
rm gps_vendor_*
find \( -name Makefile.am -o -name configure.ac -o -name '*.pc.in' \) -exec rm {} \;

Change-Id: If82619231c1a6d6eaa39adf9af94f341b8654320
2025-01-05 20:26:02 +05:30
Alexander Winkowski
12e84bcd8b veux: Build FM2 app
Change-Id: I6ff5a9352c5a2723e8850d1006707cad2458cfe0
2025-01-05 20:26:02 +05:30
Giovanni Ricca
0a7affa856 veux: Build Goodix interface from source
Change-Id: Ibaf1b9489b509318032c720c9c83e315cfe6ab3e
2025-01-05 20:26:02 +05:30
Giovanni Ricca
a963b1d6d8 veux: Build FPC interface from source
Change-Id: I80dd66139d1e53873beb14f7937cbfb721e582ca
2025-01-05 20:26:02 +05:30
Alexander Winkowski
95d386713c veux: Build Xiaomi common fingerprint service
Change-Id: Ie78d7d44630256162e41f1b22d22252e3377798b
2025-01-05 20:26:02 +05:30
Demon000
6f845f8679 veux: Build fastbootd
Change-Id: I1056d3ed331c1590dce00f980bc78c6a5e23a799
2025-01-05 20:26:02 +05:30
Robert Shih
16551d87c6 veux: enable AIDL DRM HALs
Bug: 219538389
Test: atest GtsMediaTestCases
Change-Id: I431554dcbef014f8235f048ee062a218a2131f9c
2025-01-05 20:26:02 +05:30
Alexander Winkowski
e845f1eb5a veux: configs: Pull brightness configs from lynx
Change-Id: Ic58fb5a638c290e68633d9716be9bf907841f0af
2025-01-05 20:26:02 +05:30
Alexander Winkowski
877fbd9ae0 veux: Import display config from V14.0.6.0.TKCMIXM
Change-Id: I7017b425c091a7ae67adb0e6e9509f49dd314442
2025-01-05 20:26:02 +05:30
Sebastiano Barezzi
10e0896b95 veux: Build display stack
Change-Id: I8aa97b9847fd49fb1bebd35f8193aefa7e8997e1
2025-01-05 20:26:02 +05:30
P.Adarsh Reddy
4d6d8f8d6c veux: Enforce android-S new launch debugfs restrictions
Change-Id: I78878e1c4177c07d66b13e5659d4360252c5f87b
2025-01-05 20:26:02 +05:30
Sebastiano Barezzi
17d996d9d7 veux: Build camera libs
Change-Id: I9b5d730c54018614c8e28a946a1d234663339b0c
2025-01-05 20:26:02 +05:30
LuK1337
7e2ddfe589 veux: Build QTI bootctrl HAL
Change-Id: I1e907c64ee4f88507bac78afe56e8fba0310f6d1
2025-01-05 20:26:02 +05:30
Cosmin Tanislav
43ceefd049 veux: gpt-utils: add system_ext and product to AB_PTN_LIST
Change-Id: I8d570695ed9d00c0b28f0e299ae11a61899d4dc9
2025-01-05 20:26:02 +05:30
Cosmin Tanislav
b8d34ed042 veux: gpt-utils: add vbmeta_system to PTN_SWAP_LIST
Change-Id: Icbc04d6f326a7852a407835169cfc9e3066fb7ac
2025-01-05 20:26:02 +05:30
Luofan Chen
7d5a015377 veux: gpt-utils: Check ufs device first before checking partition names
Change-Id: I51663ff8e074681191ac708fcd7b4d28e890deaf
2025-01-05 20:26:02 +05:30
Siddeswar Aluganti
6092ee0191 veux: gpt-utils: Add OTA handling for new partitions
Add new partitions to list of partitions needed for A/B update handling.

Change-Id: I9e1ad1b2d08730a0ab18728b5919c35ff5b6bc44
CRs-Fixed:: 2877573
2025-01-05 20:26:02 +05:30
Siddeswar Aluganti
03b1c9595a veux: gpt-utils: Update PTN_SWAP_LIST and handle multiimg(oem/qti)
* Update PTN_SWAP_LIST to reflect partition entry changes
   to BOOT LUN and handle "multiimgoem", "multiimgqti"
   partitions, similar to other BOOT LUN partitions.

Change-Id: I3fb2934c44f3c2555ef36437ae97c9a47bb874ed
2025-01-05 20:26:02 +05:30
LuK1337
cef599f2f9 veux: gpt-utils: Fix build errors
Change-Id: Ie8245d1637e12b5979a8af1b864cc713135b5c95
2025-01-05 20:26:02 +05:30
LuK1337
b6bc43cc2d veux: gpt-utils: Drop unnecessary include
* When using generated_kernel_headers including
   stdio.h will cause errors due to redefined macros.

Change-Id: I2f753a64f760b636be1325873e17697466fbf33d
2025-01-05 20:26:02 +05:30
LuK1337
4b97c9ed81 veux: gpt-utils: Drop unnecessary include
* When using generated_kernel_headers including
   asm/byteorder.h will cause a warning due to
   unused static functions.

Change-Id: I2a74ec92487c13c4645048c96da8cb92b3cbd9f0
2025-01-05 20:26:02 +05:30
Tao Bao
0223de540d veux: gpt-utils: Address the warnings
[ 11% 2/18] target  C++: libgptutils <= device/google/crosshatch/gpt-utils/gpt-utils.cpp
In file included from device/google/crosshatch/gpt-utils/gpt-utils.cpp:54:
system/core/libcutils/include_vndk/cutils/log.h:38:2: warning: "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h" [-W#warnings]
 ^
device/google/crosshatch/gpt-utils/gpt-utils.cpp:750:17: warning: unused variable 'ufs_dir_stat' [-Wunused-variable]
    struct stat ufs_dir_stat;
                ^
device/google/crosshatch/gpt-utils/gpt-utils.cpp:973:13: warning: unused variable 'r' [-Wunused-variable]
        int r, fd;
            ^
device/google/crosshatch/gpt-utils/gpt-utils.cpp:973:16: warning: unused variable 'fd' [-Wunused-variable]
        int r, fd;
               ^
4 warnings generated.

Test: lunch blueline-userdebug && m -j libgptutils
Change-Id: Idd9174276d8a5b7b77c2ec48c745a78184f65fcf
2025-01-05 20:26:02 +05:30
Alexander Koskovich
df3d99bf9b veux: Import gpt-utils from LA.UM.9.14.r1-19800.01-LAHAINA.QSSI12.0
Change-Id: I92baccc0524f88dcb439095288ac75fbc1401ae7
2025-01-05 20:26:02 +05:30
Sebastiano Barezzi
91908c435f veux: Build bluetooth libs
Change-Id: I999905b2b7a0f7fe8f808e88c7ab428f1d50b263
2025-01-05 20:26:02 +05:30
iovxw
3f36ab14f8 veux: Remove FM Tuner from audio input devices
* This fixes google voice recorder

Change-Id: Id90fc9ac1ad24b5d439592aecfdf4f8912893935
2025-01-05 20:26:02 +05:30
llololo
a2c136cae5 veux: Remove A2DP input module in audio policy configuration
No Pixel device support A2DP sink functionality.

Bug: 163050296
Test: A2DP related test.
Change-Id: I269220cf29451ea79362fc004fa073713f72fdb2
2025-01-05 20:26:02 +05:30
dianlujitao
078bc0e173 veux: audio: Enable AOSP bluetooth audio HAL v2
Change-Id: I4d12752ae5fb2829d6612647c8740c84967f5434
2025-01-05 20:26:02 +05:30
LuK1337
bc23a4eb9c veux: audio: Don't advertise vorbis offloading support
* Doesn't work at all.

Change-Id: I8cd6341b240c3820dbbdef497e23e785b6ed99dc
2025-01-05 20:26:02 +05:30
Alexander Winkowski
f4b9e9d55b veux: Import audio configs from V14.0.6.0.TKCMIXM
* Use generic configs when possible

* Audio policy configuration from /vendor/etc/audio
  (identified by running dumpsys media.audio_policy on stock ROM)

* Mixer paths and sound_trigger configs from /vendor/etc

* audio_tuning_mixer.txt is copied to /vendor/etc
  because this is the only path libacdbloader supports

* Other configs from /vendor/etc/audio/sku_holi

* audio_policy_volumes.xml was edited to be compatible with AOSP

Change-Id: I424b4df55add814d29e713497f7f323766b8b72b
2025-01-05 20:26:02 +05:30
Bruno Martins
eb7e328055 veux: Build opensource soundtrigger HAL
Change-Id: I956d53a67841a9e1e296de6b73f08ef2efac7470
2025-01-05 20:26:02 +05:30
Sebastiano Barezzi
79a30a9c2d veux: Build audio stack
Change-Id: Id1e28604c0c83093e309656a2059c517084984f5
2025-01-05 20:26:02 +05:30
Demon000
c2f31ba636 veux: Include QCOM SEPolicy
Change-Id: Iaf54a187cda5e6921b791031fa2132a91a62d184
2025-01-05 20:26:02 +05:30
Demon000
9f565e7096 veux: Define vendor RIL service usage
This can be checked by looking for a rild service in system.
If it's missing, then a vendor ril service is being used, in
our case, it is qcrild.

Change-Id: I5378de6eec4ff2511a49c19c0fc474658efe338f
2025-01-05 20:26:02 +05:30
Alexander Winkowski
b295f44004 veux: Add recovery flags
Change-Id: I3def36bfc0644fae2c94531aecc5831bf389a8f9
2025-01-05 20:26:02 +05:30
Alexander Winkowski
8abf5a094a veux: Add platform flags
Change-Id: I4b583a43f133293dfee20d093aa0c0e5b17b2769
2025-01-05 20:26:02 +05:30
Alexander Winkowski
8b561ab03b veux: Add partition flags
Change-Id: Iab108c3b116a0ab76d0ad33a3d32ea9a3a1931ba
2025-01-05 20:26:02 +05:30
Leo Liou
b765fd805d veux: Inherit the virtual A/B config
For devices launching with virtual A/B, inherit the virtual A/B
device base configuration.

Bug: 146466421
Test: Build and boot & manual OTA.
Change-Id: I752178c2525335b3cebafa0254c077d93831b8ba
2025-01-05 20:26:02 +05:30
Alexander Winkowski
5db4263997 veux: Add kernel flags
Based on boot.img and vendor_boot.img from V14.0.6.0.TKCMIXM

Change-Id: I75c18ca39d3377eac10029b9bc20e6bc632c5020
2025-01-05 20:26:02 +05:30
417 changed files with 86051 additions and 310 deletions

View File

@@ -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",
}

View File

@@ -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

View File

@@ -7,7 +7,3 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage_veux.mk
COMMON_LUNCH_CHOICES := \
lineage_veux-user \
lineage_veux-userdebug \
lineage_veux-eng

View File

@@ -9,38 +9,211 @@ 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
# 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
# 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 \
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

View File

@@ -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
![POCO X4 Pro 5G/Redmi Note 11E Pro/Redmi Note 11 Pro 5G/Redmi Note 11 Pro+ 5G](https://i.ibb.co/4syxpfw/330608dc148bfa50f6326d996d6c8e8b.png "POCO X4 Pro 5G/Redmi Note 11E Pro/Redmi Note 11 Pro 5G/Redmi Note 11 Pro+ 5G")

46
RemovePackages/Android.bp Normal file
View 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"],
}

View File

136
audio/audio_effects.xml Normal file
View 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
View 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
}
}

View 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>

View 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>

View 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

File diff suppressed because it is too large Load Diff

View 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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View 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>

View 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
View 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,
}

View 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

View 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>

View 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>

View 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>

View 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>

File diff suppressed because it is too large Load Diff

View 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
View 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"
}
]
}

View 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>

View 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

View 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

View File

@@ -0,0 +1,39 @@
# 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
# 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

View 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

View File

@@ -0,0 +1,278 @@
# 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.enable_advanced_sf_phase_offset=1
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
# 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

View File

@@ -0,0 +1,8 @@
libadsprpc.so
libcdsprpc.so
libsdsprpc.so
libfastcvopt.so
liblistensoundmodel2.so
libOpenCL.so
libmialgoengine.so 64

View 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
View 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" ]
}
]
}

View File

@@ -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>

View File

@@ -0,0 +1,212 @@
<!--
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="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>

View File

@@ -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>
@@ -80,7 +59,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 +82,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 +235,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 +260,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>

View 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>

563
device.mk
View File

@@ -4,18 +4,573 @@
# 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
# 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
# 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@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

View File

@@ -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
View File

@@ -0,0 +1,26 @@
[
{
"repository": "Xiaomi-Development/device_xiaomi_camera",
"target_path": "device/xiaomi/camera",
"remote": "github-non-los",
"branch": "aosp-15"
},
{
"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-15"
}
]

87
extract-files.py Normal file
View 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()

View File

@@ -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
View File

@@ -0,0 +1,4 @@
GNSS_CFLAGS = [
"-Werror",
"-Wno-undefined-bool-conversion",
]

214
gps/android/2.1/AGnss.cpp Normal file
View 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
View 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

View 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

View 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_

View 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
View 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
View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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
View 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

View 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

View 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

View 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

View 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

View 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

View 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>

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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
View 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;
}

View 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: ["."],
}

View 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();
}

View 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
View 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,
}

File diff suppressed because it is too large Load Diff

View 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 */

View 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
View 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
View 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
View 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__

View 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 &params) {
(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
View 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
View 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
View 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 &notify, 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