274 Commits
vic-new ... bq2

Author SHA1 Message Date
John Galt
92992eea69 sm8350-common: bump clang to r563880c 2026-01-15 00:57:22 +09:00
Michael Bestas
1a56c7787b sm8350-common: Patch some blobs to depend on libtinyxml2-v34.so
libtinyxml2 10.1.0 update which landed in BP4A contains ABI
incompatible changes which cause runtime crashes.

Change-Id: Icc67da5f754b0bb30dce6192b1e520fdf1349ac5
2026-01-14 19:17:53 +09:00
ozturkmutlu65
440bab7c0c sm8350-common: Add com.android.bluetooth context to seapp_contexts 2026-01-14 17:25:57 +09:00
7d92d7d5c3 sm8350-common: sepolicy: Drop duplicate genfs_contexts entries 2025-12-31 01:44:34 +09:00
b7b84e2e71 sm8350-common: Switch to SwitchPreferenceCompat 2025-12-31 01:44:34 +09:00
Bruno Martins
0a48861515 sm8350-common: parts: Apply Expressive theme
Change-Id: I03c814b97c8401428f2b358d065a99503df9d1cc
2025-12-31 01:44:34 +09:00
Bruno Martins
9d601a8e70 sm8350-common: parts: Defer applying divider
Android 16 QPR1 + M3E changes the inflation and lifecycle timing of
PreferenceFragmentCompat layouts, resulting in internal RecyclerView
being created later than before.

As a result, PreferenceFragmentCompat.setDivider() can be invoked
before the internal RecyclerView exists thus causing below NPE:

  11-25 18:06:19.705 7903 7903 E AndroidRuntime: FATAL EXCEPTION: main
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: Process: org.lineageos.lineageparts, PID: 7903
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.invalidateItemDecorations()' on a null object reference
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at androidx.preference.PreferenceFragmentCompat$DividerDecoration.setDivider(PreferenceFragmentCompat.java:909)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at androidx.preference.PreferenceFragmentCompat.setDivider(PreferenceFragmentCompat.java:247)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at com.android.settingslib.widget.SettingsBasePreferenceFragment.onViewCreated(SettingsBasePreferenceFragment.kt:47)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at org.lineageos.lineageparts.SettingsPreferenceFragment.onViewCreated(SettingsPreferenceFragment.java:156)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at org.lineageos.lineageparts.profiles.SetupTriggersFragment.onViewCreated(SetupTriggersFragment.java:89)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3099)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:607)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:285)
  (...)
 # 11-25 18:06:19.705 7903 7903 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:9041)
 # 11-25 18:06:19.705 7903 7903 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
  11-25 18:06:19.705 7903 7903 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
  11-25 18:06:19.727 2241 6629 W ActivityTaskManager: Force finishing activity org.lineageos.lineageparts/.PartsActivity

Test: Open System profiles settings, create a new profile and verify
      that the activity no longer crashes.
Change-Id: Ifb741011baaa6d721d0ca0db2d68d30037eb8930
2025-12-31 01:44:27 +09:00
0xCAFEBABE
d4ae3d2235 sm8350-common: Update some soong config variables to bool type 2025-12-30 22:37:38 +09:00
LuK1337
cd33b79ad5 sm8350-common: Remove vendor/lineage device framework matrix inclusion 2025-12-30 22:34:02 +09:00
beingashwani
dc2446bd7d sm8350-common: disable verbose camera logs
* fixes camera jitter/ui lag in some scenario
2025-10-14 04:16:22 +09:00
Subhajeet Muhuri
a5bae6559a sm8350-common: Silence Codec2 spammy logs
I QC2Buf  : Buffer 0xf3041d10 imported as 0xf3042690
W QC2V4l2Codec: [avcD_13] unknown/unsupported param Output::HdrStaticMetadata index = 0xD200180A

Change-Id: I5de137760aa0ffb5cb52a12ae074c2862de24a40
2025-10-14 04:15:50 +09:00
dhanush281
1de080ddfe sm8350-common: props: Force disable low ram config
Signed-off-by: kenway214 <kenway214@outlook.com>
2025-10-14 04:08:35 +09:00
009b8ac153 Revert "sm8350-common: properties: adjust LMKD"
This reverts commit 0191b499f4.
2025-10-14 04:08:07 +09:00
Sourajit Karmakar
58cb5002e6 sm8350-common: Disable FRP
* This should really be disabled after unlocking the bootloader.

Change-Id: Icf5305cba66e9e613000a6ef53b32fa59760a7f2
2025-10-14 04:04:17 +09:00
Joey Huab
c926702c11 Revert "[SQUASH] sm8350-common: fastcharge implementation"
This reverts commit d2793a3f48.
2025-08-19 12:09:53 +09:00
Joey Huab
eee22f781a Revert "sm8350-common: remove IRestricted from fastcharge"
This reverts commit 307240d592.
2025-08-19 12:03:18 +09:00
Joey Huab
e9a919f61c Revert "sm8350-common: rro_overlays: Enable ambient AOD"
This reverts commit 51f11a7fa7.
2025-08-09 01:48:27 +09:00
Adithya R
510ca4bbf1 sm8350-common: Move citsensorservice to background cpuset
This service hogs a considerable amount of CPU all the time as its
busy calculating compensation for our under-display light sensor
(and also spamming logcat, which we can take care of later).

  PID USER         PR  NI VIRT  RES  SHR S[%CPU] %MEM     TIME+ ARGS
 1969 system 20 0 12G 9.2M 9.0M S 4.6 0.1 1:13.15
vendor.xiaomi.sensor.citsensorservice@2.0-service

Move it to background CPU set like the sensors multihal to lower
power consumption from big cores.

Change-Id: I8c7b2835b2b53654642ac20fd97df3b8a5ad96eb
2025-08-08 22:26:04 +09:00
Giovanni Ricca
9297fe32e1 sm8350-common: Commonize citsensor stack
Change-Id: I2902359ad66a6e94e40cf9dee9f52c0803e9dfad
2025-08-08 22:25:59 +09:00
Sugakesshaa
963c464686 sm8350-common: overlay: Overlay Dolby Atmos profiles
Change-Id: I67998e9329004e416e6e5a66e9d4b0d9fe919b43
2025-08-08 22:11:38 +09:00
Adithya R
2a84ed6887 sm8350-common: Add sepolicy for Dolby Atmos
Change-Id: I8c41ff32e579cec9c871d6a0177ca027034281c8
2025-08-08 21:39:03 +09:00
Fabian Leutenegger
080fdc7bfc sm8350-common: Link dolby blobs against v33 libstagefright_foundation
* fixes crashes and absurdly high CPU usage while using dolby

Co-authored-by: Woomymy <woomy@woomy.be>
Change-Id: Ib72b775dae677f3085d0b0e2afcbb709d8690063
2025-08-08 20:44:32 +09:00
Sugakesshaa
fab88decab sm8350-common: Import Dolby C2 Media service
from OnePlus 11 CPH2447_15.0.0.401(EX01)

Change-Id: Icdfc5b11c7635d0707c2a39f54e0c8d149c771bc
2025-08-08 20:44:26 +09:00
Omkar Chandorkar
9eb7717818 sm8350-common: Introduce Dolby Atmos support
Change-Id: I46b62d08ad51c321c997792301524fc0c18d6ba6
Co-authored-by: Sugakesshaa <sugakesshaa@gmail.com>
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
2025-08-08 20:44:15 +09:00
sushmit1
c67ab03fd1 sm8350-common: Add libmisoundfx 2025-07-25 15:03:52 +09:00
New Author Name
9e457375ca sm8350-common: Remove FM Tuner from audio input devices
* This fixes google voice recorder

Change-Id: If42676a0087e055e3164da4b0cc43987e32d82b3
2025-07-25 11:54:03 +09:00
jjpprrrr
d119fa6826 sm8350-common: audio: Remove quad mic
*This fixes in-game mic for various games
2025-07-25 11:54:03 +09:00
AdarshGrewal
c2785ff90e sm8350-common: audio: Disable Stereo channel support for voip over audio path
* This breaks in-game voice chat and audio in some messaging apps
   causing it to plays with a higher pitch and speed, making it sound
   like chipmunks.

Change-Id: I0baf0d01481b755372c3420bb58b73d2f38eb2d9
2025-07-25 11:54:03 +09:00
Joey Huab
2d44c6d394 Revert "sm8350-common: add ViPER4FX if-exists"
This reverts commit 907517572b.
2025-07-24 16:11:55 +09:00
Vincent Wang
95bfb8503b sm8350-common: rro_overlays: Enable fp screen off unlock feature
Edit: Turn on by default

Bug: 389002332
Flag: android.hardware.biometrics.screen_off_unlock_udfps
Test: 1. FP screen off unlock should be included in settings
      2. FP screen off unlock should be enabled by default
Change-Id: I65eda6ae6f69ff4e6a3191d91fb8be42797c7fcb
Signed-off-by: ralph950412 <ralph950412@gmail.com>
2025-07-17 00:04:45 +09:00
Matt Pietal
51f11a7fa7 sm8350-common: rro_overlays: Enable ambient AOD
Bug: 373844670
Test: manual - check devices
Flag: com.android.systemui.shared.ambient_aod
Change-Id: I793e7dbab1c039ba82a1f96b7d56ca4b3e1ebbfe
2025-07-17 00:04:45 +09:00
Yumi Yukimura
7b92d5a258 sm8350-common: Setup DeviceAsWebcam
Change-Id: Icf8e10cd21c4eef9a66af624971ffe9c4d39d992
2025-07-17 00:04:45 +09:00
Roberto Sartori
eb486d4bb7 sm8350-common: Switch from time_daemon to TimeKeep
* time_daemon just refuses to work properly on mata.
    Sony's TimeKeep, instead, does the job flawlessly,
    so just ditch the former in favor of the latter.

Signed-off-by: Roberto Sartori <roberto.sartori.android@gmail.com>
Change-Id: I54f50ed3d49efc2834d478781b15e6ee428a3062
2025-07-17 00:04:45 +09:00
Giovanni Ricca
6e0adc2285 sm8350-common: Decommonize libQnnHtpStub
Turns out this is platform specific. Fixes crashes on
libarcsoft_super_night_raw calls on yupik devices

Change-Id: I06b22517d313a8eeb116b0b969615203b0d53823
2025-07-17 00:04:45 +09:00
Alexander Winkowski
bcfc991349 sm8350-common: Use SPDX copyright headers
Change-Id: I0ea8da2780914a239929d48de9b9caaccf098224
2025-07-17 00:04:45 +09:00
Edgar Arriaga
2f7dc94b0f sm8350-common: overlay: Set default pin amount for home app
Bug: 288900050
Test: dumpsys pinner
Flag: EXEMPT refactor

Change-Id: I87e15ec968f59acd65e3d4bc80d1bad08704bc53
2025-07-17 00:04:45 +09:00
Michael Bestas
359345383d sm8350-common: overlay: Remove deprecated config_mobile_tcp_buffers/networkAttributes
Change-Id: Ieda947e283cde11cf74a01dc1b438e1deeb902c9
2025-07-17 00:04:45 +09:00
Chenyang Zhong
51901d3c8f sm8350-common: overlay: drop sw372dp dimens
This one seems to be overriding the actual overlayed value of
rounded_corner_content_padding on the device side.

Change-Id: I64383583a6a54e44a9c801bb3c8dd14c11fa45f9
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2025-07-17 00:04:45 +09:00
Giovanni Ricca
3db25260f9 sm8350-common: Add Xiaomi FX Tunnel manifest entry
Change-Id: Id3d1690bf8ce2af92afeb7d4b16d20b5bf30d3f0
2025-07-17 00:04:41 +09:00
Giovanni Ricca
f61b75ba58 sm8350-common: sepolicy: Unlabel Xiaomi Dtool service
Change-Id: I8a35505f4d0d369dd8160f1b425f4c5c48f38325
2025-07-15 17:53:58 +09:00
Demon000
b1c5641e8a sm8350-common: Add support for udfps long press sensor
Change-Id: I7196dce967c9adbc62bb5156ade749c92c7780a1
2025-07-15 17:53:56 +09:00
Giovanni Ricca
e2491ea9c0 sm8350-common: Opt-in libudfpshandler
Change-Id: If67c415d33215d9ef954ded4d118aad5841e589a
2025-07-15 17:53:56 +09:00
Michael Bestas
71ab56973e sm8350-common: Enable UFFD GC
Kernel has support for it now.

Change-Id: I3863ee71477f321fe47646571b857fdc39a1902b
2025-07-15 17:53:42 +09:00
basamaryan
989dd25e37 sm8350-common: Shim libwfdservice with libaudioclient_shim
Change-Id: Idd6603ad16926226f22423a2bba2075d430015d5
2025-07-10 18:43:46 +09:00
Michael Bestas
4114fac832 sm8350-common: sepolicy: Remove duplicate labels
Change-Id: I3575e6bad93b2f9d69f94033944c44b7f9fbc243
2025-07-10 18:43:46 +09:00
ralph950412
a28ac22367 sm8350-common: Commonize libcvapiv2*
Change-Id: I7b4f2df7620177a00b99b35fe58d463ac97ea2fa
2025-07-10 18:43:43 +09:00
ArianK16a
9fce812db4 sm8350-common: Kang libops.so from Davinci
- Helps fix DRM issues
2025-07-10 18:43:43 +09:00
Joey Huab
b95891af58 Revert "sm8350-common: set ART debug to release mode"
This reverts commit 727abe81d8.
2025-07-10 07:44:22 +09:00
ghostrider-reborn
ae9ba3a846 sm8350-common: Fix battery and USB OTG detection in recovery mode
* in lahaina (msm-5.4) 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

[1]:
https://source.codeaurora.org/quic/la/device/qcom/common/commit/rootdir/etc/init.recovery.qcom.rc?h=LA.UM.9.14.r1-18600-LAHAINA.0&id=4e2b0f663a8f4b73000c81999055363411aaf12c

Depends-On: Id0e64302dbbdc53620cbc1825c36e13bb9e58aef
Change-Id: I835fa5daaa53eb704cc6c0777d7069d47ecbe10c
2025-07-02 20:30:08 +09:00
Bruno Martins
596ef97ec6 sm8350-common: sepolicy: Label extcon_usb1 nodes
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/soc:extcon_usb1/extcon/extcon3/cable.0/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/soc:extcon_usb1/extcon/extcon3/cable.1/name. This probably means the selinux policies need to be changed.

Change-Id: I92d728a1bc283beedf33b015c3115221140d527d
2025-07-02 20:30:08 +09:00
Yumi Yukimura
4c3749d1b1 sm8350-common: Migrate to QTI USB Gadget AIDL HAL
Change-Id: I6adbca2fab9a3fe0477d17f9786166828b786710
2025-07-02 11:24:52 +09:00
LuK1337
71ccd9f528 sm8350-common: Pull appropriate USB props from vendor_product.mk
Change-Id: I93b25c5d0989c83d1c8d7b7946a083771febdddd
2025-07-02 11:24:52 +09:00
Pratham Pratap
5081d2b8af sm8350-common: Set sys.usb.mtp.batchcancel for MTP over FFS
* Currently, cancelEvents in MTP will cancel the requests one by
   one, and it will check each response to confirm success or
   failure. However, if kernel usb controller driver got the
   cancel request, the driver will handle all requests in the same
   endpoint so that the second io_cancel in cancelEvents will be
   useless causing the cancelEvents to return error and fail the
   transfer.

 * Fix this by setting sys.usb.mtp.batchcancel for the targets
   using MTP over FFS.

Change-Id: Icea9a2815c79ff710ee887d02e4c99dfe5ad6361
2025-07-02 11:24:52 +09:00
Jack Pham
3e51157bc7 sm8350-common: Configure USB Diag over FFS
On targets where diag-router is used, override the
vendor.usb.diag.func.name property to 'ffs' to
instantiate the Diag function instances to use
F_FS instead of the legacy f_diag driver.

Change-Id: I529a081a0d6988628944a9020b61c061baa877a4
2025-07-02 11:24:52 +09:00
Alexander Koskovich
a27ef14baf sm8350-common: Pick up USB configurations from QCOM
Change-Id: I83882d8992eb367211871130c163f4ca5689fcd4
2025-07-02 11:24:52 +09:00
Giovanni Ricca
460fd03ac3 sm8350-common: udfps: Workaround onFingerDown() race
`onFingerDown()` may be called after authentication has been completed,
leaving HBM enabled. Use a dummy variable to skip HBM activation when
authentication has already succeeded.

Note: This is a temporary solution until we figure out what is really
going on.

Change-Id: Ie738b0dbe8a51e99f2bf9f922b60e725fa2888ee
2025-07-02 11:24:52 +09:00
Arian
b76d62679f sm8350-common: udfps: Switch to unique fd and shared pointer to avoid memory leaks
Change-Id: I746bfd8dbbb20a30ff173ed50b8e0ffaee73bda2
2025-07-02 11:24:52 +09:00
Arian
a03f04db59 sm8350-common: udfps: Kill fod_status
Instead we enable hbm directly from the biometrics hal functions.
This allows to drop a lot of complexity in the touchscreen drivers
and more precise control of when to show the lhbm circle.

Change-Id: I046dd1fdcaf4a8ef93923be04110868b956bc580
2025-07-02 11:24:52 +09:00
Giovanni Ricca
4297204b2b sm8350-common: udfps: Run clang-format
Change-Id: I43243c9d9c74d2f2e64ba5e52d2d7002218b6c21
2025-07-02 11:24:52 +09:00
Steven Moreland
ca638f1631 sm8350-common: Add clang-format with symlink.
Automatic consistency.

Bug: 122835115
Test: manual
Change-Id: I6583f9f7923a822aa11f1839fbf375c1063a89c6
2025-07-02 11:24:52 +09:00
Arian
d3f5be9209 sm8350-common: sepolicy: Allow fingeprint hal to get SYS_NICE capability
This is needed to set the process priority to SCHED_FIFO, which is done
by libgf_hal.so.

Change-Id: I5708e2c5d8eac6f8e8685cce9dd1ddbcd508bb17
2025-06-30 07:38:18 +09:00
kamikaonashi
7c3684e310 sm8350-common: parts: add simple GPU Manager
add a simple GPU Manager to let users adjust some basic GPU controls
2025-06-30 07:38:18 +09:00
kamikaonashi
848f8d9e3b sm8350-common: parts: add simple Kernel Manager
this creates a simple kernel manager, that allows for setting the governos, min and max frequencies for each cluster
lets give the users the possibility to change cpu freq and governor without root
2025-06-30 07:38:18 +09:00
kamikaonashi
ff0caba431 sm8350-common: parts: add Kamis Stuff and shift some settings there 2025-06-30 07:38:18 +09:00
kamikaonashi
0191b499f4 sm8350-common: properties: adjust LMKD
adjust LMKD values
ref:
https://source.android.com/docs/core/perf/lmkd
2025-06-30 07:38:18 +09:00
LuK1337
bb81a8eb38 sm8350-common: Switch to NCM USB tethering
Change-Id: I20b6b2b2e26a45d8b28c7483afc83ad4da4b8643
Signed-off-by: Fiqri Ardyansyah <fiqri191002@gmail.com>
2025-06-30 07:38:18 +09:00
kamikaonashi
dfd2794692 sm8350-common: parts: add core control
Introduce userspace interface for CPU core hotplug management,
allowing individual cores to be brought online/offline dynamically.
Maintains minimum 2-core (little) requirement to ensure system responsiveness
2025-06-10 21:06:01 +09:00
Michael Bestas
74108f49e5 sm8350-common: Freeze SPL to 2025-06-05 2025-06-10 21:06:01 +09:00
Hridaya Prajapati
df80eca563 sm8350-common: switch to common AIDL IR service
Change-Id: I36c05aaa312969e479896c6e63a26a68cf897afa
2025-06-10 21:06:01 +09:00
ralph950412
f84c1a6c11 sm8350-common: Migrate Dolby Vision to soong_config_set
Change-Id: I034804fa97fcc762682724623755cc431d9e91df
2025-06-10 21:06:01 +09:00
Joey Huab
cd45e19ed6 sm8350-common: Initialize for Evolution X 10.x 2025-06-10 21:06:01 +09:00
ccfries
c0336fc343 sm8350-common: Set VENDOR_SECURITY_PATCH to PLATFORM
Set the VENDOR_SECURITY_PATCH level to match the platform security patch level.
These are functionally the same.
2025-05-26 03:41:39 +09:00
yingjiew
2f6dd2000b sm8350-common: 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-05-26 03:41:39 +09:00
rvbeakz
3f1d413014 sm8350-common: sepolicy: label bypass charging 2025-05-26 03:41:39 +09:00
Cyber Knight
7029917841 sm8350-common: sepolicy: Allow cameraserver to search directories in sysfs_leds
- This fixes a SEPolicy denial.

Change-Id: Ie0124422e3b796a3a172a35a67e00ed44691497b
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-05-26 03:41:39 +09:00
chaptsand
3ab24393e3 sm8350-common: sepolicy: Allow platform app to find SoterService
* Fix selinux denied of WeChat fingerprint payment

- E SELinux : avc:  denied  { find } for interface=vendor.qti.hardware.soter::ISoter sid=u:r:platform_app:s0:c512,c768 pid=3613 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_hal_soter_hwservice:s0 tclass=hwservice_manager permissive=0

Issue: https://gitlab.com/LineageOS/issues/android/-/issues/4701

Change-Id: I3176f8e709fb31aec16a31094b78f753d1d16b43
2025-05-26 03:41:39 +09:00
John Galt
8880436bff sm8350-common: camera: Cap max_brightness
* Our maximum brightness is 500.
* However, for safety related reason, I have capped this to 255.
* 255 is more than sufficient, and I do not want to be responsible for LED damage.

* Finding the default percentage took some trial and error, in this case, 59% correlated to 75.

Co-authored-by: rahul <rahul@aospa.co>
Signed-off-by: rahul <rahul@aospa.co>
2025-05-26 03:41:39 +09:00
Jeferson Oliveira
d5a352b543 sm8350-common: rootdir: Restrict apps access to /proc/net/unix
* Banking apps read the file /proc/net/unix to
  check system modifications, (in our case, custom rom)
  Let's avoid this by chmod it 440.

Test: Install a banking app as of Brazilian Nubank or PicPay, login.
Observed no side effects on any other proccess or apps

Signed-off-by: Sanjivns <113604406+Sanjivns@users.noreply.github.com>
Signed-off-by: Pabloescobar-reborn <pabloescobar-reborn@users.noreply.github.com>
2025-05-26 03:41:39 +09:00
AnierinB
7264b3049f sm8350-common: parts: Add thermal profiles tile
* Launches ThermalActivity
2025-05-26 03:41:39 +09:00
Mudit200408
cfe38790e3 sm8350-common: Add support for 60Hz in Landscape in Per-App-RR 2025-05-26 03:41:38 +09:00
Adithya R
e7e23232bc sm8350-common: parts: Fix setting default thermal profile
When the app's default thermal profile was different from the standard
one, it resulted in not being able to set it back to the default mode.

Fixes 37a15544 ("sm8350-common: parts: Automatically determine thermal profile for apps")

Change-Id: I5029cfc72194a93f7ab693b6b6aa966066d7c3bf
2025-05-26 03:41:38 +09:00
Adithya R
1e2b30849e sm8350-common: parts: Automatically determine thermal profile for apps
Assume an appropriate default thermal profile based on package information.
2025-05-26 03:41:38 +09:00
someone5678
75b4710b79 sm8350-common: parts: Add {navigation,video} thermal profiles
* icon taken from https://fonts.google.com

Signed-off-by: Pabloescobar-reborn <pabloescobarreborn77@gmail.com>
Co-authored-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2025-05-26 03:41:38 +09:00
ralph950412
73054892e6 sm8350-common: wifi: Update Wi-Fi configs from star V816.0.9.0.UKAMIXM
Change-Id: I5316642bf25c8f99cba8359bc0456aece2e40036
2025-05-26 03:41:38 +09:00
Chenyang Zhong
c69a26d91f sm8350-common: wifi: import missing wpa_supplicant configs from stock
Stock has these two configs in the default wpa_supplicant.conf. Since
we build and ship wpa_supplicant.conf from source, import the missing
configs to the overlay.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2025-05-26 03:41:38 +09:00
Alcatraz323
897082dc3e sm8350-common: Build DSPVolumeSynchronizer
Change-Id: I46f37b21fc9f0dd7cfb7f1d72ebd07ae5375bb2f
2025-05-26 03:41:38 +09:00
Joey Huab
8b78853a84 Revert "sm8350-common: Remove elf files in copy files check"
This reverts commit a61c4fe556.
2025-05-26 03:41:38 +09:00
Pratyay Borborah
92415ba1d4 sm8350-common: Add SystemUI restart in restart advanced menu 2025-05-26 03:41:38 +09:00
Sebastiano Barezzi
a52948db67 sm8350-common: Partially revert "Move to QTI health AIDL service"
https://github.com/LineageOS/android_system_core/blob/lineage-21.0/init/init.cpp#L1099

This partially reverts commit 4aca996701.

Change-Id: I284f80f364e9057a8373a015f0acaee3ef9e395d
2025-05-26 03:41:38 +09:00
truly-irham
f6f01de0c0 sm8350-common: Address sepolicy denial for per-app thermal profile parts 2025-05-26 03:41:38 +09:00
TogoFire
907517572b sm8350-common: add ViPER4FX if-exists 2025-05-26 03:41:38 +09:00
kamikaonashi
e4b7089b9d sm8350-common: parts: add charging bypass toggle 2025-05-26 03:41:38 +09:00
kamikaonashi
ae44d86594 sm8350-common: drop power extension for dt2w
lets use dt2w via powerhint
less bloated
2025-05-26 03:41:38 +09:00
kamikaonashi
b4146cb3e9 sm8350-common: update security patch string 2025-05-26 03:41:16 +09:00
kamikaonashi
685909faf7 sm8350-common: parts: add ZRAM options
these changes require to ignore neverallow policy while building
2025-05-26 03:41:16 +09:00
Cyber Knight
9943e16f76 sm8350-common: rootdir: label brightness node correctly
- We only utilize switch_2/brightness as a toggle switch so explicitly label it.
2025-05-26 03:41:16 +09:00
Cyber Knight
9c94fcec89 sm8350-common: sepolicy: Address a cameraserver neverallow
- For some reason, allowing cameraserver to access sysfs_leds on lahaina results in a neverallow.
- Hence, allow cameraserver to access a new type, sysfs_torch which only accesses the relevant nodes we utilize to alleviate the neverallow.
2025-05-26 03:41:16 +09:00
John Galt
27c6626d17 sm8350-common: camera: Add enabled bool for finished workarounds
Change-Id: Iede122113f17789cdf88896cb32bc30f574ec54f
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-05-26 03:41:16 +09:00
bengris32
ddad391532 sm8350-common: camera: Implement setTorchModeExt
Change-Id: Id61420be75b7efd1d13a4b0ee1d103ebd3835516
Signed-off-by: electimon <electimon@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-05-26 03:41:16 +09:00
bengris32
fe3d5b54c2 sm8350-common: camera: Implement supportsSetTorchModeExt
Change-Id: I2ec2f4a30723763e6123a1b742468752f38e3d2f
Signed-off-by: bengris32 <bengris32@protonmail.ch>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-05-26 03:41:16 +09:00
Dhina17
8a49082e83 sm8350-common: Implement torch light control
[RealJohnGalt: Modify for oneplus usage and add toggle switch]
[cyberknight777/ralph950412: Adapt nodes and SEPolicy for Xiaomi SM8350]
2025-05-26 03:41:16 +09:00
Thiago
727abe81d8 sm8350-common: set ART debug to release mode 2025-05-26 03:41:16 +09:00
RobertGarciaa
14a69788ef sm8350-common: Define missing HALs in FCM
The following HALs in device manifest are not declared in FCM <= level 6:
   android.hardware.biometrics.fingerprint.IFingerprint/default (@4)
   android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default (@4)
   android.hardware.drm.IDrmFactory/clearkey (@1)
   android.hardware.health.IHealth/default (@3)
   android.hardware.ir.IConsumerIr/default (@1)
   android.hardware.power.IPower/default (@5)
   android.hardware.sensors.ISensors/default (@2)
   android.hardware.thermal.IThermal/default (@1)
   android.hardware.usb.IUsb/default (@1)
   android.hardware.wifi.IWifi/default (@2)
   android.hardware.wifi.hostapd.IHostapd/default (@2)
   android.hardware.wifi.supplicant.ISupplicant/default (@3)
COMPATIBLE
2025-05-26 03:41:16 +09:00
Peter Cai
e2e62f3916 sm8350-common: panic to recovery, not bootloader 2025-05-26 03:41:16 +09:00
kamikaonashi
dc68b66812 sm8350-common: set proper cpu variants 2025-05-26 03:41:16 +09:00
RobertGarciaa
a88bed37d8 sm8350-common: Import 32bit misys blobs & fix Misys ELF checks
[0m vendor/xiaomi/sm8350-common/Android.bp:18:1: dependency "vendor.xiaomi.hardware.misys@1.0" of "libmisys_jni.xiaomi" missing variant:
  os:android,image:,arch:arm64_armv8-2a,sdk:,link:shared
available variants:
  os:android,image:vendor,arch:arm64_armv8-2a (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk: (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:static
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk: (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:static
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
[0m vendor/xiaomi/sm8350-common/Android.bp:18:1: dependency "vendor.xiaomi.hardware.misys@2.0" of "libmisys_jni.xiaomi" missing variant:
  os:android,image:,arch:arm64_armv8-2a,sdk:,link:shared
available variants:
  os:android,image:vendor,arch:arm64_armv8-2a (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk: (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:static
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk: (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:static
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
[0m vendor/xiaomi/sm8350-common/Android.bp:18:1: dependency "vendor.xiaomi.hardware.misys@3.0" of "libmisys_jni.xiaomi" missing variant:
  os:android,image:,arch:arm64_armv8-2a,sdk:,link:shared
available variants:
  os:android,image:vendor,arch:arm64_armv8-2a (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk: (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:static
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk: (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:static
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared,version:)
fatal errors encountered

␛[31merror:␛[0m vendor/xiaomi/sm8350-common/Android.bp:294:1: dependency "libcheckpid" of "vendor.xiaomi.hardware.misys@3.0-impl" missing variant:
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared
available variants:
  os:android,image:vendor,arch:arm64_armv8-2a (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk: (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:static
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
␛[31merror:␛[0m vendor/xiaomi/sm8350-common/Android.bp:294:1: dependency "liblogwrap_vendor" of "vendor.xiaomi.hardware.misys@3.0-impl" missing variant:
  os:android,image:vendor,arch:arm_armv8-a,sdk:,link:shared
available variants:
  os:android,image:vendor,arch:arm64_armv8-2a (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk: (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:static
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:
  os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:latest (alias to os:android,image:vendor,arch:arm64_armv8-2a,sdk:,link:shared,version:)
fatal errors encountered

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:41:16 +09:00
RobertGarciaa
e96fc64628 sm8350-common: Add missing misys vendor blobs
1056 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service": library "libmivsock_utils.so" not found: needed by main executable
1066 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service": library "libmicuttlefish_fs.so" not found: needed by main executable
1081 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service": library "libmicuttlefish_utils.so" not found: needed by main executable

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:41:16 +09:00
johnmart19
77a624d6ca sm8350-common: Import Xiaomi Misys Hal
- Import Xiaomi Misys hal for camera processing
- Build Legacy android.hidl.memory.block, android.hidl.manager in vendor for misys serivce
F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service": library "android.hidl.memory.block@1.0.so" not found: needed by /vendor/lib64/vendor.xiaomi.hardware.misys@3.0.so in namespace (default)
- 636 I hwservicemanager: getTransport: Cannot find entry vendor.xiaomi.hardware.misys@1.0::IMiSys/default in either framework or device VINTF manifest.

Co-authored-by: klozz <klozz@thexperienceproject.org>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:41:16 +09:00
Chenyang Zhong
d0423b36ce sm8350-common: rootdir: import diag related usb entries
Looks like apps like Network Signal Guru connects to the diag-router
through an emulated(?) USB device.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:41:16 +09:00
danielml
3e8efc01c0 sm8350-common: Fix vendor.qti.diaghal@1.0 elf checks
Change-Id: I6336f5a2fda3721e03bfc21030a9b1092d0c9828
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:41:16 +09:00
Adithya R
d1ba3216cd sm8350-common: Add blobs for QTI diag services support
Required for apps like Network Signal Guru.

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:41:16 +09:00
kamikaonashi
307240d592 sm8350-common: remove IRestricted from fastcharge 2025-05-26 03:41:16 +09:00
pix106
667c142da1 sm8350-common: drop fastcharge from FCM
Not needed, fragment is already in fastcharge dir
2025-05-26 03:41:16 +09:00
kamikaonashi
d2793a3f48 [SQUASH] sm8350-common: fastcharge implementation
this commit contains following commits to introduce the fastcharge toggle for venus that use this tree

they were renamed from sm8250-common to venus
 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>

kamikaonashi/device_xiaomi_sm8250-common@6510782

 sm8250-common: fastcharge: Make user setting persistent

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

kamikaonashi/device_xiaomi_sm8250-common@e050f0d

 sm8250-common: fastcharge: Use pragma once

Change-Id: I9a9e193a6f66f045f41394d059af8b71778e8d72

kamikaonashi/device_xiaomi_sm8250-common@ff8e5f6

 sm8250-common: fastcharge: Migrate to blueprint

Change-Id: I200fd6c685183c98f0815b207adae5aa75a37238

kamikaonashi/device_xiaomi_sm8250-common@4e0d22f

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

kamikaonashi/device_xiaomi_sm8250-common@136d369

sm8250-common: Sepolicy: Label FastCharge more general

kamikaonashi/device_xiaomi_sm8250-common@7a61994

sm8250-common: Sepolicy: Fastcharge: Provide needed permissions

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

batterysecret hack
51ebc8de81

rewrite for stone:
e24376df93

add irestrictedcurrent:
c4bf87968b

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-26 03:41:16 +09:00
Bruno Rocha
adb750c5dd sm8350-common: Disable AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE
We're not using perfd so this is useless.
log error:
E/audio_hw_extn(704): audio_extn_perf_lock_acquire: Failed to acquire perf lock, err: -1
E/audio_hw_extn(704): audio_extn_perf_lock_release: Perf lock release error
2025-05-26 03:41:16 +09:00
Bruno Martins
1b8b71f5c1 sm8350-common: power: Abstract android.hardware.power-ndk dependency
Change-Id: Ic8f9bab6898121e3b69ef9c5936d4261fe3062fb
2025-05-26 03:41:16 +09:00
Nolen Johnson
2c35dc78df sm8350-common: power: migrate to android.hardware.power-V5-ndk
Change-Id: I2e8688896265f4db87b071eba291c066b0e08d54
2025-05-26 03:41:16 +09:00
Arian
0d80c1c11f sm8350-common: Provide a static lib for power mode extension
Change-Id: I3e2cf17bf1e733838e9e18afdf3f888e814593dc
2025-05-26 03:41:16 +09:00
Yvonne Yip
408438bb58 sm8350-common: powerhint: game mode tuning
Test: Load powerhint file on device and verify tuned parameters are
default. Start Subway Surfers game and verify tuned parameters are
expected tuned values. Switch away from game, and quit the game, and
verify tuned parameters return to default.

Bug: 294612493
Change-Id: Ibc0ba8fb1a9f2714d9509cecaa30c227aa4f8b69
Signed-off-by: ralph950412 <ralph950412@gmail.com>
2025-05-26 03:41:16 +09:00
Sugakesshaa
6565a59a67 sm8350-common: powerhint: Enable GAME power mode in power HAL
based on https://source.android.com/docs/core/perf/boost

Change-Id: Ib4055bd80db9f6026f0d00d42fb6a2604df9c4dc
Signed-off-by: ralph950412 <ralph950412@gmail.com>
2025-05-26 03:41:16 +09:00
Murat Kozan
112b1b7f6f sm8350-common: powerhint: Drop DisplayWakeup node
libperfmgr: Failed to write to node: /sys/devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card0/sde-crtc-0/early_wakeup with value: 1, fd: -1
2025-05-26 03:41:16 +09:00
bheatleyyy
b990d3d6d1 sm8350-common: powerhint: Import powerhint.json from lahaina
from https://github.com/PixelOS-Devices/device_oneplus_sm8350-common/blob/fourteen-qpr1/configs/powerhint_lahaina.json

Change-Id: I2ddb226cfd379b6b287a4393058c12dd579d38de
2025-05-26 03:41:16 +09:00
Bruno Martins
03785dbba3 sm8350-common: Use common libqti-perfd-client and power-libperfmgr 2025-05-26 03:41:16 +09:00
Wei Wang
21b3cc9432 sm8350-common: Remove QTI perfd 2025-05-26 03:40:36 +09:00
Davide Garberi
473a3a2249 sm8350-common: Build libhidltransport and libhwbinder
05-05 15:53:59.961 12354 12354 E MI_Algo_JNI: Open /system/lib64/libmicampostproc_client.so Error :dlopen failed: library "libhidltransport.so" not found: needed by /system/lib64/libmicampostproc_client.so in namespace clns-shared-4

Change-Id: Id87af3af701000734aaa89f1ec98a80dd70a266b
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:40:35 +09:00
kartik-commits
331217186c sm8350-common: Build Graphics Allocator HAL service and implement it
*Fixes:- E vndksupport: Could not load /vendor/lib64/libmialgoengine.so from sphal namespace: dlopen failed: library "android.hardware.graphics.allocator@3.0.so" not found: needed by /vendor/lib64/libmialgoengine.so in namespace sphal.

Co-authored-by: thepriyanshujangid <priyanshujangid@yahoo.com>
Co-authored-by: Choirul Umam <bavvtm@outlook.com>
Signed-off-by: kartik-commits <kartiklashkare@gmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:40:35 +09:00
Cyber Knight
39725d45d2 sm8350-common: Drop androidboot.memcg=1 kernel CMDLINE
- We are not on a low-end device to use memcg hence let's drop it.
2025-05-26 03:40:35 +09:00
kamikaonashi
c60a64646f sm8350-common: nuke dependencies file
I am syncing manually
2025-05-26 03:40:35 +09:00
Chenyang Zhong
3bc73cabe8 sm8350-common: enable Dolby Vision in hwcomposer
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2025-05-26 03:40:35 +09:00
Sugakesshaa
025a739368 sm8350-common: Build android.hardware.graphics.common-V4-ndk
AOSP upgraded the blob to V5 but xiaomi's libgui requires V4 version of the blob

Change-Id: Ib596cde74c414bcb5ac2ea33c394ad7b83b336f0
2025-05-26 03:40:35 +09:00
Silesh K Nair
e3527d429d sm8350-common: Add missing libloc_api_wds.so 2025-05-26 03:40:35 +09:00
Michael Bestas
4e3aa5da93 sm8350-common: gps: data-items: Fix snprintf usage
Fixes:
gps/core/data-items/DataItemConcreteTypes.cpp:465:9: error: 'snprintf'
will always be truncated; specified size is 10, but format string
expands to at least 20 [-Werror,-Wfortify-source]
  465 |         snprintf(t, sizeof(t),
        "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApSrnMacAddress[0],
      |         ^
gps/core/data-items/DataItemConcreteTypes.cpp:514:9: error: 'snprintf'
will always be truncated; specified size is 10, but format string
expands to at least 20 [-Werror,-Wfortify-source]
  514 |         snprintf(t, sizeof(t),
        "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApSrnMacAddress[0],
      |         ^
2 errors generated.

Change-Id: I37188e7497f7ade97648fb41e2becd73f6b559a9
2025-05-26 03:40:35 +09:00
Michael Bestas
825883e3a8 sm8350-common: gps: Resolve unused parameter warnings
Change-Id: I3f92e977a847583f35a5a597487c52b5e0e09dde
2025-05-26 03:40:35 +09:00
Gareth Kitchen
bb7b7c6ba4 sm8350-common: gps: Localise NTP to improve GPS TTFF
Testing response times to time.android.com from around the globe reveals
in ms:-

Europe			 <30
Middle East		 <68
North America		<150
Johannesburg		 183
Buenos Aires		 220
Tokyo			 226
Sydney			 276
Hong Kong		 285
Brisbane		 295
Mumbai			 349
Beijing			4691
Shanghai		4906
Russia			 n/a

Whilst time.android.com is NOT used for GPS NTP, North American time servers
are, by specifying north-america.pool.ntp.org as default in the framework,
to align with pixel devices.  I am assuming similar response times to these
servers from around the world.

Great for North America and it appears Europe but it does not address the
global issue. Also, the pool.ntp.org project forbids both hardware and
software vendors from using these default zone names.
http://www.pool.ntp.org/en/vendors.html

It makes sense, therefore, to leverage the ntp.org's existing 'android' vendor
name to make the default ntp server for GPS purposes:
1.android.pool.ntp.org this will return a random but accurate NTP server in
close geopraphic proximity to the device.

Testing on my own build in the UK seems to improve hot and cold TTFF
considerably.

Change-Id: I144af45757efa35b32daf034eece6e046d2bde79
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-05-26 03:40:35 +09:00
Silesh K Nair
71552874f0 sm8350-common: Update GPS from LA.UM.9.14.r1-24900-LAHAINA.QSSI14.0 2025-05-26 03:40:35 +09:00
Peng Xu
3871cbbb5e sm8350-common: wifi: Enable support for IEEE80211AX
* This is to allow supporting WiFi 6 mobile hotspots,
   to be noted this is only supported on SDM855+ platforms.
2025-05-26 03:40:35 +09:00
TheCrazyLex
79a2c9aa9e sm8350-common: wifi: smarter decisions on whether to use 2.4/5Ghz AP
* Implement a smarter system on whether to connect to the provided 2Ghz or 5Ghz network.

Change-Id: I4f8363c712d07c64b2bad25538474003a56976b3
Signed-off-by: Ahmad Rulim <personal@rulim34.dev>
2025-05-26 03:40:35 +09:00
Panchajanya1999
1e40096dc3 sm8350-common: wifi: Disable WLAN Firmware loggings
firmware loggings are not at all necessary for general development.

Change-Id: I111943a641670ea052f68148103e377771297d77
2025-05-26 03:40:35 +09:00
Luk1337
31fca7071d sm8350-common: wifi: Disable RX wakelock feature
Change-Id: If79e1512a83f5162444683e1fa8f5560f98b6c9a
2025-05-26 03:40:35 +09:00
lemezohaib
ab5d5e7fb2 sm8350-common: Move libcameraservice extension lib to select()
Signed-off-by: lemezohaib <zhbkhan644@gmail.com>
2025-05-26 03:40:35 +09:00
Bruno Martins
c671a2f79a sm8350-common: Migrate Lineage Health to soong_config_set
Change-Id: I2eff39e83b9673aa2989d05de65c646241ba61da
2025-05-26 03:40:35 +09:00
Michael Bestas
149bea9174 sm8350-common: Migrate powershare to soong_config_set
Change-Id: I2489e8d95d968556a854d7b8314f098d37c382b7
2025-05-26 03:40:35 +09:00
Michael Bestas
20f06c8862 sm8350-common: gps: Remove CleanSpec.mk
Change-Id: Id5a91ac0dfc35cd4c84218f02e50c0905e04c43a
Signed-off-by: Fiqri Ardyansyah <fiqri191002@gmail.com>
2025-05-26 03:40:10 +09:00
Arian
45a7c18454 sm8350-common: qcril-database: Add migration to turn off redir_party_num
Caused incoming caller number not being parsed correctly by Phone app on
VoLTE and VoWiFi. No idea why Xiaomi enabled this ancient prop.

Co-authored-by: Andrzej Perczak <linux@andrzejperczak.com>
Change-Id: I5a9c30c3f0e42c7816d3dc7eebb73e97cdc0fed8
2025-05-26 03:40:10 +09:00
Arian
4570e4c4ea sm8350-common: Generate qcrilNr.db during build
Change-Id: I1f3425713b9b5b1cc7185bc94124b9f01efe3abb
2025-05-26 03:40:10 +09:00
LuK1337
08ca589ac4 sm8350-common: Add libwfdservice_shim for WFD
e69a5be2449122f90220151f9d01ace15221facf in system/hardware/interfaces
broke the ABI ;'(

Change-Id: I3badfc56581a6bf3de5d7e996fa51f59eb164aae
2025-05-26 03:40:10 +09:00
Arian
6c927ddab4 sm8350-common: Update blobs from haydn V816.0.18.0.UKKMIXM
Change-Id: I464ce41901252b17e5433faec6d58eab70ded7ef
2025-05-26 03:40:10 +09:00
AndroidHQ254
1300eaec13 sm8350-common: sepolicy: Label ro.hardware.chipname property
W libc    : Access denied finding property "ro.hardware.chipname"

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
RobertGarciaa
e5c530a6ac sm8350-common: sepolicy: Address some denials
19537 W libc    : Access denied finding property "vendor.camera.sensor.logsystem"
19537 W libc    : Access denied finding property "vendor.panel.display"

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Murat Kozan
e991f43671 sm8350-common: sepolicy: Label ro.miui.build.region
08-28 13:06:16.280   898  7800 W libc    : Access denied finding property "ro.miui.build.region"

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Amit Pundir
47fc5bcabc sm8350-common: sepolicy: Address mediaswcodec denials
- avc: denied { read write } for name="kgsl-3d0" dev="tmpfs" ino=1100 scontext=u:r:mediaswcodec:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=0

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
piscesmk2013
a7301699de sm8350-common: sepolicy: Allow mediaserver to find native service
Change-Id: I7db098069e7aa4be74935a506c9a3ceacfd755e3
2025-04-25 20:21:14 +02:00
Pig
76e13f3e91 sm8350-common: sepolicy: Label ro.product.mod_device
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
AdarshGrewal
ba45918b4f sm8350-common: sepolicy: Label ro.product.marketname
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
minaripenguin
3c215fca7d sm8350-common: sepolicy: Address incremental fs SeLinux denials
* fixes random app crash for apps like coc

logcat reported by user

12-15 09:23:37.767  2383  2383 W TaskThumbnailIc: type=1400 audit(0.0:705): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/base.apk" dev="incremental-fs" ino=176013 ioctlcmd=0x6722 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.android.launcher3
12-15 09:23:37.767  2383  2383 W TaskThumbnailIc: type=1400 audit(0.0:706): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/split_config.en.apk" dev="incremental-fs" ino=175987 ioctlcmd=0x6722 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.android.launcher3
12-15 09:23:37.767  2383  2383 W TaskThumbnailIc: type=1400 audit(0.0:707): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/split_config.xxhdpi.apk" dev="incremental-fs" ino=176007 ioctlcmd=0x6722 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.android.launcher3
12-15 09:23:37.767  2383  2383 W TaskThumbnailIc: type=1400 audit(0.0:708): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/base.apk" dev="incremental-fs" ino=176013 ioctlcmd=0x6722 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.android.launcher3
12-15 09:23:37.767  2383  2383 W TaskThumbnailIc: type=1400 audit(0.0:709): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/base.apk" dev="incremental-fs" ino=176013 ioctlcmd=0x6722 scontext=u

* also noticed incremental-fs denials

12-15 09:23:25.658 16094 16145 I incfs   : IncFs_Features: v1
12-15 09:23:25.654 16094 16094 W com.android.vending: type=1400 audit(0.0:672): avc: denied { read } for comm=62674578656375746F72202332 name="filesystems" dev="proc" ino=4026532355 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:proc_filesystems:s0 tclass=file permissive=0 app=com.android.vending
12-15 09:23:25.661 16094 16130 I Finsky  : [83] ghu.apply(78): AIM: Got app ownership map. App counts: 1. Unique apps: 1
12-15 09:23:25.790 19437 20775 I incfs   : Initial API level of the device: 30
12-15 09:23:25.790 19437 20775 W libc    : Access denied finding property "ro.incremental.enable"
12-15 09:23:25.790 19437 20775 I incfs   : ro.incremental.enable:
12-15 09:23:25.787 19437 19437 W lowpool[13]: type=1400 audit(0.0:673): avc: denied { read } for name="u:object_r:incremental_prop:s0" dev="tmpfs" ino=12498 scontext=u:r:gmscore_app:s0:c512,c768 tcontext=u:object_r:incremental_prop:s0 tclass=file permissive=0 app=com.google.android.gms
12-15 09:23:25.791 19437 19437 W lowpool[13]: type=1400 audit(0.0:674): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/base.apk" dev="incremental-fs" ino=176013 ioctlcmd=0x6722 scontext=u:r:gmscore_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.google.android.gms
12-15 09:23:25.794 19437 19437 W lowpool[13]: type=1400 audit(0.0:675): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/split_config.en.apk" dev="incremental-fs" ino=175987 ioctlcmd=0x6722 scontext=u:r:gmscore_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.google.android.gms
12-15 09:23:25.794 19437 19437 W lowpool[13]: type=1400 audit(0.0:676): avc: denied { ioctl } for path="/data/app/~~AkF5id64oKGn1EZvys0LgA==/com.supercell.clashofclans-oTOm1Cdlt18nhXT8665Pbw==/split_config.xxhdpi.apk" dev="incremental-fs" ino=176007 ioctlcmd=0x6722 scontext=u:r:gmscore_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 app=com.google.android.gms
12-15 09:23:25.795 19437 20775 I incfs   : IncFs_Features: v1

test: boot to homescreen, open fresh installed COC app
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
RobertGarciaa
7139bf5440 sm8350-common: sepolicy: Fix vendor_hal_perf_default denials
avc:  denied  { set } for property=ctl.vendor.msm_irqbalance pid=1057 uid=0 gid=0 scontext=u:r:vendor_hal_perf_default:s0 tcontext=u:object_r:vendor_msm_irqbalance_prop:s0 tclass=property_service permissive=0
avc:  denied  { set } for property=ctl.stop$vendor.msm_irqbalance pid=1057 uid=0 gid=0 scontext=u:r:vendor_hal_perf_default:s0 tcontext=u:object_r:ctl_stop_prop:s0 tclass=property_service permissive=0
avc:  denied  { set } for property=ctl.start$vendor.msm_irqbalance pid=1057 uid=0 gid=0 scontext=u:r:vendor_hal_perf_default:s0 tcontext=u:object_r:ctl_start_prop:s0 tclass=property_service permissive=0

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Elektroschmock
884bc84e3e sm8350-common: sepolicy: Fix isolated_app denial
avc:  denied  { setattr } for  name="model-info.pb" dev="dm-38" ino=16414 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c61,c257,c512,c768 tclass=file permissive=0
avc:  denied  { setattr } for  name="model.tflite" dev="dm-38" ino=14897 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c61,c257,c512,c768 tclass=file permissive=0

Change-Id: I9a70417149c3239b89cc4266942cb3de4da34a4f
Signed-off-by: Kneba <abenkenary3@gmail.com>
Signed-off-by: dotkit <ewprjkt@proton.me>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
RobertGarciaa
8f4cc1e13c sm8350-common: sepolicy: Address some sepolicy denials
avc:  denied  { read } for  name="cmdline" dev="proc" ino=59888 scontext=u:r:vendor_hal_perf_default:s0 tcontext=u:r:hal_camera_default:s0 tclass=file permissive=0
avc:  denied  { read } for  name="comm" dev="proc" ino=59889 scontext=u:r:vendor_hal_perf_default:s0 tcontext=u:r:hal_camera_default:s0 tclass=file permissive=0

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Tri Vo
0639da4bd5 sm8350-common: sepolicy: Neverallow app open access to /dev/ashmem
- Fixes scroll lag in apps such as twitter etc.

Apps are no longer allowed open access to /dev/ashmem, unless they
target API level < Q.

Bug: 113362644
Test: device boots, Chrome, instant apps work
Change-Id: I1cff08f26159fbf48a42afa7cfa08eafa1936f42

Signed-off-by: BladeRunner-A2C <prisoner56898@protonmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
¨raystef66¨
02cf1b43bf sm8350-common: sepolicy: Adress isolated_app denial
* SELinux : avc:  denied  { find } for pid=19014 uid=99025 name=content_capture scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:content_capture_service:s0 tclass=service_manager permissive=0
* SELinux : avc:  denied  { find } for pid=11474 uid=99937 name=content_capture scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:content_capture_service:s0 tclass=service_manager permissive=0

Signed-off-by: RobertGarciaa <chae0218@naver.com>
Change-Id: Ia59e3989a9f0c2aae930f61ed9e266659f6c92fa
2025-04-25 20:21:14 +02:00
minaripenguin
7240fdbcb8 sm8350-common: sepolicy: Resolve qemu_hw_prop denial
avc: denied { read } for name="u:object_r:qemu_hw_prop:s0" dev="tmpfs" ino=1316 scontext=u:r:system_app:s0 tcontext=u:object_r:qemu_hw_prop:s0 tclass=file permissive=0
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
wshamroukh
3e44a9ac47 sm8350-common: sepolicy: dontaudit camera hal default_prop
avc: denied { read } for name="u:object_r:default_prop:s0" dev="tmpfs" ino=2320 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=0

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
kamikaonashi
78c50e9384 sm8350-common: sepolicy: Fix wakeup denials 2025-04-25 20:21:14 +02:00
RobertGarciaa
f464b61aa5 sm8350-common: sepolicy: Label more wakeup
for i in $(realpath /sys/class/wakeup/*); do if ! echo "$(ls -dZ $i)" | grep -q sysfs_wakeup; then echo genfscon sysfs $(echo $i | sed -e 's|/sys||g' -e 's|wakeup/wakeup.|wakeup|g' -e 's|wakeup[0-9]*|wakeup|g') u:object_r:sysfs_wakeup:s0; fi; done | sort -u

09-21 10:21:21.407   813   813 W binder:813_7: type=1400 audit(0.0:1684): avc:  denied  { read } for  name="event_count" dev="sysfs" ino=78308 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
09-21 10:21:21.407   813   813 W binder:813_7: type=1400 audit(0.0:1685): avc:  denied  { read } for  name="max_time_ms" dev="sysfs" ino=78313 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
09-21 10:21:21.407   813   813 W binder:813_7: type=1400 audit(0.0:1686): avc:  denied  { read } for  name="wakeup_count" dev="sysfs" ino=78309 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
09-21 10:21:21.407   813   813 W binder:813_7: type=1400 audit(0.0:1687): avc:  denied  { read } for  name="total_time_ms" dev="sysfs" ino=78312 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
09-21 10:21:21.407   813   813 W binder:813_7: type=1400 audit(0.0:1688): avc:  denied  { read } for  name="expire_count" dev="sysfs" ino=78310 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

09-21 10:17:28.575   813  2119 E android.system.suspend-service: Error opening event_count for wakeup32: Permission denied
09-21 10:17:28.575   813  2119 E android.system.suspend-service: Error reading event_count for wakeup32: Bad file descriptor
09-21 10:17:28.575   813  2119 E android.system.suspend-service: Error opening max_time_ms for wakeup32: Permission denied
09-21 10:17:28.575   813  2119 E android.system.suspend-service: Error reading max_time_ms for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening wakeup_count for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading wakeup_count for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening total_time_ms for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading total_time_ms for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening expire_count for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading expire_count for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening active_count for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading active_count for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening last_change_ms for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading last_change_ms for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening waiting_for_supplier for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading waiting_for_supplier for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening prevent_suspend_time_ms for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading prevent_suspend_time_ms for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening name for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading name for wakeup32: Bad file descriptor
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error opening active_time_ms for wakeup32: Permission denied
09-21 10:17:28.576   813  2119 E android.system.suspend-service: Error reading active_time_ms for wakeup32: Bad file descriptor

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
ArianK16a
be40b0be38 sm8350-common: sepolicy: Address power HAL denials 2025-04-25 20:21:14 +02:00
LuK1337
f74995890b sm8350-common: sepolicy: Allow libperfmgr to read and write to sde-crtc-*
Change-Id: I5abde96b2a6bdde7f7b5cd577f878ce93b8dc8b3
Signed-off-by: ralph950412 <ralph950412@gmail.com>
2025-04-25 20:21:14 +02:00
Sugakesshaa
218cb422eb sm8350-common: sepolicy: Allow powerhal write to /proc
Change-Id: Id894d56fdf0df323e75004c90c0b904eb450837c
2025-04-25 20:21:14 +02:00
RobertGarciaa
5f6a0ed571 sm8350-common: sepolicy: Address sepolicy for MIUI camera
13202 com.android.camera W .android.camera: type=1400 audit(0.0:137): avc:  denied  { read } for  name="u:object_r:vendor_audio_prop:s0" dev="tmpfs" ino=11770 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_audio_prop:s0 tclass=file permissive=0 app=com.android.camera
13202 com.android.camera W libc: Access denied finding property "ro.vendor.audio.us.proximity"​
05-28 18:59:04.807   995 12991 W libc    : Access denied finding property "camera.debug.superlowlight"

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
RobertGarciaa
82ed1be43a sm8350-common: sepolicy: Add sepolicy for MIUI camera
1 W /system/bin/init: type=1107 audit(0.0:133): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc:  denied  { set } for property=persist.vendor.aiie_capture_log.debug pid=992 uid=1047 gid=1005 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:vendor_default_prop:s0 tclass=property_service permissive=0'
7940 W libc    : Access denied finding property "persist.al.cfr.loglevel"
391 E init    : Unable to set property 'persist.vendor.aiie_capture_log.debug' from uid:1047 gid:1005 pid:992: SELinux permission check failed

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
bheatleyyy
904c658791 sm8350-common: sepolicy: Allow cameraserver write to property socket
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Kuba Wojciechowski
2ca7690b80 sm8350-common: sepolicy: Address camera denials
Change-Id: Ie6546e690c5acd6b1f544ec1a110ec5341406481
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Adithya R
2d66aa7a47 sm8350-common: sepolicy: Update camera property contexts
Change-Id: I874a71c70b5e7d5e46e68e6109014e2b632a2ea2
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
Carlos Arriaga
a2f12c3adc sm8350-common: sepolicy: Add camera label's
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: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
dianlujitao
8515e9be77 sm8350-common: sepolicy: Make fastrpc_shell_3 publicly available
* Used by GCAM for DSP-accelerated HDR processing
 * Arguably we should label /vendor/dsp/cdsp/fastrpc_shell_3 to
   same_process_hal_file like Pixels, but the partition is prebuilt thus
   we're unable to relabel it.
 * Copy the file to writable tmpfs, setup attributes and bind mount back
   to workaround the limitation.

[ghostrider-reborn]:
Allow adsp/cdsprpcd and neuralnetworks HAL to access fastrpc_shell_3

[kras edit:
 1. rename some contexts as per qva/kona
 2. extend to allow camera HAL and VPP service to access it as well]

Co-authored-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Change-Id: Ide90e5c7307d413db5ece736e859559f06679545
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
ralph950412
7b790c3bf5 sm8350-common: sepolicy: Make vendor_camera_sensor_prop public
Change-Id: Id714049ef81ef69337cebbdb4860b7eed0d958f6
2025-04-25 20:21:14 +02:00
SVB
e703385062 sm8350-common: rootdir: Allow all filesystems for USB-OTG
Change-Id: Ie9cef57485c337c39bae559a71582b4c66127d85
2025-04-25 20:21:14 +02:00
Randall Huang
1fa3053f5b sm8350-common: 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
2025-04-25 20:21:14 +02:00
Bruno Martins
6cc86cd9a8 sm8350-common: rootdir: Enable powerhint parsing after boot completion
Change-Id: Ie065f234bfd949264b962bae80e400a446f65b80
Signed-off-by: Vaisakh Murali <mvaisakh@statixos.com>
2025-04-25 20:21:14 +02:00
Jake Weinstein
6dc9b86c25 sm8350-common: rootdir: init: Increase CPU Boost duration from 120ms to 200ms
Increases scroll responsiveness

Change-Id: Iea5ff9233f6b7dde41d6845dbe400f7225753729
2025-04-25 20:21:14 +02:00
Dobsgw
72c973102a sm8350-common: rootdir: Fix PowerHAL nodes
Fix for:
libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us with value: 2000, fd: -1
libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu0/cpufreq/schedutil/down_rate_limit_us with value: 2000, fd: -1
libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu4/cpufreq/schedutil/up_rate_limit_us with value: 2000, fd: -1
libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu4/cpufreq/schedutil/down_rate_limit_us with value: 2000, fd: -1
libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu7/cpufreq/schedutil/up_rate_limit_us with value: 2000, fd: -1
libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu7/cpufreq/schedutil/down_rate_limit_us with value: 2000, fd: -1

Change-Id: I1e232a488ed8e7d87607f543425b6138cd6df53a
2025-04-25 20:21:14 +02:00
Mohammed Mirza Mandayappurath Manzoor
b55f7baa6f sm8350-common: rootdir: Set permissions for KGSL sysfs node
Some KGSL sysfs nodes need to be access controlled,
set proper permissions for the same.

Change-Id: Idc7e2447d02742074873901c6539f2c6d9d25862
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
2025-04-25 20:21:14 +02:00
Adithya R
34303f04ea sm8350-common: rootdir: Move citsensorservice to background cpuset
This service hogs a considerable amount of CPU all the time as its
busy calculating compensation for our under-display light sensor
(and also spamming logcat, which we can take care of later).

  PID USER         PR  NI VIRT  RES  SHR S[%CPU] %MEM     TIME+ ARGS
 1969 system 20 0 12G 9.2M 9.0M S 4.6 0.1 1:13.15
vendor.xiaomi.sensor.citsensorservice@2.0-service

Move it to background CPU set like the sensors multihal to lower
power consumption from big cores.

Change-Id: I8c7b2835b2b53654642ac20fd97df3b8a5ad96eb
2025-04-25 20:21:14 +02:00
Hanuma Sri Saketh Valluri
9cf7a2b24b sm8350-common: rootdir: Set hidraw node to 0660 system system
This is required for dynamic sensor HAL to access hidraw node, which is
needed to enable Headtracking for Spatial Audio on Halliday.2.0

Change-Id: I525b276e3de0558303727d8f2675367d227834cd
2025-04-25 20:21:14 +02:00
Albert I
f2722259e6 sm8350-common: rootdir: Remove sdcard1 entries 2025-04-25 20:21:14 +02:00
basamaryan
7a3efbe823 sm8350-common: rootdir: Fix PowerOffAlarm 2025-04-25 20:21:14 +02:00
YH_Lin
26fdcd1905 sm8350-common: rootdir: fstab: Use metadata_csum for /metadata
This enhances ext4 stability.

Bug: 155085096
Bug: 154823675
Bug: 153923818

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: YH_Lin <yhli@google.com>
Change-Id: I8cebe30bdf66f39f0e4cc5955e53aca4d4f22f64
2025-04-25 20:21:14 +02:00
Randall Huang
3e2256eb79 sm8350-common: rootdir: fstab: add the noatime for read-only ext4 partitions
This is to avoid unnecessary ext4 behavior

Bug: 289631992
Test: boot to home
Change-Id: If86f229c18b0a8aa2d2361a9844b235e06ce9cf1
Signed-off-by: Randall Huang <huangrandall@google.com>
2025-04-25 20:21:14 +02:00
Randall Huang
56f1dc65d4 sm8350-common: rootdir: fstab: Set data=journal,commit=1 for /metadata
Since Ext4 doesn't implement "-o sync", it commits metadata at every 5 secs.
This may cause /metadata corruption.

Bug: 162883014
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Randall Huang <huangrandall@google.com>
Signed-off-by: Vaisakh Murali <mvaisakh@statixos.com>
Signed-off-by: ralph950412 <ralph950412@gmail.com>
Change-Id: Icd38754bad1b1529d01165ea8c703c214d20bb4b
2025-04-25 20:21:14 +02:00
jro1979oliver
71b45dc3e7 sm8350-common: rootdir: chown cgroup nodes
* Perf-hal tries to access the nodes but need permissions as pointed  on the logs:
  E ANDR-PERF-OPTSHANDLER: Cannot open/create foreground cgroup file
2025-04-25 20:21:14 +02:00
Danny Lin
b778bf2b98 sm8350-common: 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-04-25 20:21:14 +02:00
David Sehr
ceaa111f95 sm8350-common: props: Enable usage of dex2oat64
Use 64-bit dex2oat for better dexopt time.

Bug: 153380900
Test: boot and install an application
Change-Id: I3e7a6e6e9385ff6564d1a2e6dda004ebb061f095
(cherry picked from commit 126f03be80f57a8a0411842011152d9381589b78)
Merged-In: I3e7a6e6e9385ff6564d1a2e6dda004ebb061f095
2025-04-25 20:21:14 +02:00
RJ RAIJIN
5772552b44 sm8350-common: props: Fix Qti_Power_Hal logspam
* This fixes the following logspam:

E/ QTI PowerHAL: Failed to acquire lock for hint_id: 1040
E/ QTI PowerHAL: Failed to acquire lock for hint_id: 1041
E/ QTI PowerHAL: Failed to acquire lock for hint_id: 10A5
2025-04-25 20:21:14 +02:00
Bruno Martins
cafad4609a sm8350-common: props: Enable apk fs-verity
* for some reason, some apps automatically detects that we're rooted due to verityUtils failing to measure the apps apk fs-verity.
2025-04-25 20:21:14 +02:00
pjgowtham
d8fb38c86e sm8350-common: props: Disable logging sensors-hal events
This sets log_level to 0
10-14 14:17:17.674 14629 14629 I sensors-hal: get_system_config:67, log_level: 0

This is done especially to disable spammy logging of ambient light sensor events
10-14 14:17:12.821 12603 14590 I sensors-hal: handle_ambient_light_event:157, _ambient_light: ts=3858719100254, lux=11, data_c=0, delta_ms=0, data_cnt=0
2025-04-25 20:21:14 +02:00
1xtAsh
c2169159e0 sm8350-common: props: Set game refresh rate override to 120
This props fixes frame rate restrictions in games

Signed-off-by: 1xtAsh <ashraykrsingh321@gmail.com>
Signed-off-by: Thereache <thereache2003@gmail.com>
2025-04-25 20:21:14 +02:00
Jun Wang
797c3c9709 sm8350-common: 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.
2025-04-25 20:21:14 +02:00
Danny Trunk
cd5c3e3c8b sm8350-common: props: Do not block binder thread on incoming calls
Change-Id: I6a2c41e35cc3514e60e104d8eb967f331176594e
Signed-off-by: NotHarshhaa <reddyharshhaa12@gmail.com>
2025-04-25 20:21:14 +02:00
kdrag0n
a82450337e sm8350-common: props: Disable sf EGL image tracking
This is a surfaceflinger debugging feature that we don't care about, so disable it to reduce overhead.

Signed-off-by: pri0818 <priyanshusinghal0818@gmail.com>
Signed-off-by: MrErenK <akbaseren4751@gmail.com>
Signed-off-by: NotZeetaa <rodrigo2005contente@gmail.com>
Signed-off-by: DarkAngelGR <asavvo01@gmail.com>
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
2025-04-25 20:21:14 +02:00
New Author Name
3923426253 sm8350-common: props: drop ro.surface_flinger.force_hwc_copy_for_virtual_displays=true
fixes lag in pip mode
2025-04-25 20:21:14 +02:00
Adithya R
d9e77b60b2 sm8350-common: props: Set SF idle timeout to 1100ms
When a clock with seconds tick is on the display, it switches back and
forth between high and low refresh rate if the timer is <=1000ms (1s).
Set it to 1.1s which is just slightly higher to avoid this issue.
This also matches stock value.
2025-04-25 20:21:14 +02:00
Midas Chien
e0323e8391 sm8350-common: props: 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
2025-04-25 20:21:14 +02:00
helliscloser
53db250126 sm8350-common: props: Explicitly disable "Enable 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.

Enabling or completely removing the prop here sm6150-davinci/device_xiaomi_sm6150-common@d6233e0 doesn't seem to make an effect.
Explicitly disabling the "Enable GL comp backpressure" prop seems to slove the issue.

Lag & janks are gone now, even with blur.
2025-04-25 20:21:14 +02:00
kamikaonashi
5df6e082fe sm8350-common: props: set stock color profile to natural
adaptive can cause jank and lag
2025-04-25 20:21:14 +02:00
kamikaonashi
de7105bad2 sm8350-common: props: silence minksocket error spam 2025-04-25 20:21:14 +02:00
Владимир
742bf30270 sm8350-common: props: silence log spam OpenGLRenderer
E OpenGLRenderer: Unable to match the desired swap behavior.

Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 20:21:14 +02:00
kamikaonashi
0a905624a5 sm8350-common: parts: restore brightness after HBM usage
after disabling HBM, the brightness would rise back up, save brightness before enabling HBM and restore it after disabling
2025-04-25 20:21:14 +02:00
Ramii Ahmed
3c739bf739 sm8350-common: parts: Add High Touch Polling Rate
Used to handle our node to force enable Xiaomi's High Touch polling rate mode from kernel
2025-04-25 20:21:14 +02:00
kamikaonashi
6ed927ed63 sm8350-common: parts: Import DC Dimming and HBM Settings
* Implement DC Dimming preference
* Disable DC Dimming if it's not supported
* Implement HBM switch
* Adapt HBM and DC dimming settings to S style
* Define DC dimming and HBM nodes / keys in one place
* Declare exported flags in manifest
* Fix compilation for QPR1
* Fix compilation for Android 15
* Adapt to sm8350-common devices

Co-authored-by: Nauval Rizky <enuma.alrizky@gmail.com>
Co-authored-by: Adhitya Mohan <me@adhityamohan.in>
Co-authored-by: TheScarastic <warabhishek@gmail.com>
Co-authored-by: alibei <sebastiankotzias83@gmail.com>
Co-authored-by: kamikaonashi <thorschi93@gmx.at>
2025-04-25 20:21:14 +02:00
Adithya R
18ebd02b14 sm8350-common: parts: Get rid of proguard flags
This is obsolete.

Change-Id: I1b692d3e1a96c49ac6efd54907ea23c4b4494f7e
2025-04-25 20:21:14 +02:00
kssrao13882
ad186a2148 sm8350-common: parts: Remove order preference for Thermal Profiles
- In Infinity X rom this tab at top spoils the look of Battery section
2025-04-25 20:21:14 +02:00
Chaohui Wang
6e69d7a5c6 sm8350-common: 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
2025-04-25 20:21:14 +02:00
Peter Kalauskas
d72bfc2c17 sm8350-common: parts: Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: I0c1bd901429bbe3bf81c1530e156735f8637a96e
2025-04-25 20:21:14 +02:00
Adithya R
17f19ec14d sm8350-common: parts: Fix thermal profile screen state handling 2025-04-25 20:21:14 +02:00
EmanuelCN
2e8dcace58 sm8350-common: parts: Checkout thermal profiles to xiaomi-sm8250 implementation 2025-04-25 20:21:14 +02:00
truly-irham
165b4df2c2 sm8350-common: parts: Address sepolicy denial for per-app thermal profile parts 2025-04-25 20:21:13 +02:00
Arian
3ae26d7fed sm8350-common: parts: Import from xiaomi_sdm845-common
e261035d91/parts

Change-Id: I442f48780ca020f3e420ee4ccaf8ac07b05457cb
Signed-off-by: Anush02198 <anush.4376@gmail.com>
2025-04-25 20:21:13 +02:00
Jesse Chan
dae5c827a6 sm8350-common: overlay: configure sqlite to operate in MEMORY mode
* This change yields considerable SQLite performance gains.
* It should be generally safe as this device has irremovable battery.
* Some OEMs have been doing this for years.

Signed-off-by: Jesse Chan <jc@lineageos.org>
Change-Id: Ib3a95350b2d02d656d89181f25044faca44765bb
2025-04-25 20:21:13 +02:00
kdrag0n
31575aafb3 sm8350-common: overlay: Don't pin camera app in memory
The default camera app can be *huge* in some cases, e.g. when the app in
question is Google Camera. The system will only pin up to the first 80
MiB of the APK file, as well as the first 80 MiB of its odex. There are
several problems with this:

  - We could easily end up with 160 MiB of camera app files pinned,
    which is a tall order with the ~3.5 GiB of usable RAM that we have
  - The data that gets pinned may not even be the most critical data for
    launching the camera

Let's disable pinning of the camera app to save precious RAM on this
device.

Change-Id: I745e39b6ff212dfaf9213517d2a2be8ff7384e24
2025-04-25 18:28:36 +02:00
Karan Parashar
8b348a317b sm8350-common: overlay: Enable force LTE_CA toggle
Change-Id: I79715f210feb4958b5bb8d4b67b099eb4e577401
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 18:28:36 +02:00
Jongduck You
11bf8c393f sm8350-common: overlay: Enable dynamic routing
Enable dynamic routing feature for India, Israel, Taiwan, Singapore,
Switzerland, Slovakia, Poland, Slovenia, and Bosnia and Herzegovina.

Add emergency numbers requiring normal routing for India, Israel, France, Taiwan, Singapore, Switzerland, Guadeloupe, Slovakia, Poland, Reunion, Slovenia, and Bosnia and Herzegovina.

Bug: 336759603
Test: build and manual test

Change-Id: Ic9a3faccd43c12c30be42f800b2ab9781b46970b
2025-04-25 18:28:36 +02:00
johnmart19
6170f6647f sm8350-common: overlay: Push screen recorder max FPS to 120FPS
Signed-off-by: Thereache <thereache2003@gmail.com>
2025-04-25 18:28:36 +02:00
ZeeLog
a0ea99d362 sm8350-common: overlay: Enable VT over IMS availability for carriers 2025-04-25 18:28:36 +02:00
Pranav Vashi
343b9248ee sm8350-common: overlay: Enable video pause workaround for video calling 2025-04-25 18:28:36 +02:00
Sebastiano Barezzi
0f77e5bd9e sm8350-common: overlay: Drop MMS user agent overlays
Current profile URL points to a 404 page
2025-04-25 18:28:36 +02:00
kdrag0n
3bcc8c2098 sm8350-common: overlay: Offload WM shell to another thread
Android 12 added this config to offload some window management to a
dedicated thread. Enable it to improve performance when the main System
UI thread is busy.

Change-Id: I9eef4cdbc26d0880f3a9aaf875d5e36ebd693238
2025-04-25 18:28:36 +02:00
kamikaonashi
f1732e7705 sm8350-common: overlay: set animations to 0.8x by default 2025-04-25 18:28:36 +02:00
kamikaonashi
3ea58cbe1a sm8350-common: overlay: enable automatic brightness by default 2025-04-25 18:28:36 +02:00
kamikaonashi
d9f41127dc sm8350-common: overlay: disable pickup gesture by default 2025-04-25 18:28:36 +02:00
pengfeix
e9260309c0 sm8350-common: 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-04-25 18:28:36 +02:00
althafvly
b1e5968b56 sm8350-common: overlay: Update CarrierConfig from munch V816.0.2.0.ULMMIXM
Change-Id: I4df6ab6ac380b3eeed1ab6ed64f64bc0e0d0ed3f
2025-04-25 18:28:36 +02:00
ghostrider-reborn
b5422e2ff7 sm8350-common: overlay: Define OEM fast charge sysfs node
- This forces android to display 'charging rapidly' whenever our proprietary 33w charger is connected, based on the value of this node (0/1)

Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
2025-04-25 18:28:36 +02:00
Lowxorx
f1612c9dc7 sm8350-common: overlay: show min/max refresh rate in settings 2025-04-25 18:28:36 +02:00
Omkar Chandorkar
c5c536e31a sm8350-common: overlay: Update CarrierConfig from phone1
* From Nothing OS 2.0.4

Signed-off-by: flakeforever <113103193+flakeforever@users.noreply.github.com>
2025-04-25 18:28:36 +02:00
johnmart19
16a3234c5d sm8350-common: overlay: Enable VoNR Calls support 2025-04-25 18:28:36 +02:00
Lup Gabriel
b405c60c29 sm8350-common: overlay: Enable screen off udfps support 2025-04-25 18:28:36 +02:00
Tim Zimmermann
314398a91f sm8350-common: overlay: CarrierConfig: Set LTE+ threshold bandwidth to 0
* so LTE+ icon will show whenever it's available

Change-Id: I45a569fa52d19f4b9af370d7a18c4198e29febc6
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 18:28:36 +02:00
Vishalcj17
7085c6b426 sm8350-common: overlay: CarrierConfig: Globally enable LTE+ icon
Change-Id: Ifcad30636c0ee76a1fa4830bc0c8143d2b7be879
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 18:28:36 +02:00
Cassie
01516c9814 sm8350-common: overlay: Use the new auto network selection UI
Change-Id: I76698911103601d5f3ad67e1099790af8c2fdc18
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 18:28:36 +02:00
LuK1337
eaed3854a5 sm8350-common: overlay: Set max network scan search time to 254
Matches value found in stock TeleServiceQcom.

Change-Id: If2b224298ffe731f8ccfd0b4f3b6d8a257b6f968
Signed-off-by: aswin7469 <aswinas@pixysos.com>
Signed-off-by: NotHarshhaa <reddyharshhaa12@gmail.com>
Signed-off-by: RobertGarciaa <chae0218@naver.com>
2025-04-25 18:28:36 +02:00
Michael Bestas
54ac27cbd9 sm8350-common: Enable ELF checks for libwpa_client dependent libs
Change-Id: I490df02b68da4b9a7088a239672a1dcace66d270
2025-04-25 18:28:36 +02:00
basamaryan
9b79d71a60 sm8350-common: Don't explicitly set as an AB target
AB is the default

Change-Id: I93346d29da38405bf571f138ae905d67966c1f9c
2025-04-25 18:28:36 +02:00
Nolen Johnson
227bbd907c sm8350-common: Drop PRODUCT_PACKAGES_DEBUG entry
* unnecessary

Change-Id: I22ae2c744ec55168b8367c826e55110e7534466e
2025-04-25 18:28:36 +02:00
Cosmin Tanislav
1a6a54547d sm8350-common: switch to common QCOM AIDL bootctrl HAL
Change-Id: I04ab771d3b1c38b58913607fbff1bb3b55e1fe25
2025-04-25 18:28:36 +02:00
x0x00044
66b0a9380e sm8350-common: overlay: Remove config_cellBroadcastAppLinks
- This is true by default.

Change-Id: I9f91f4bf49995975d434ad8b74b175693409862a
2025-04-25 18:28:36 +02:00
feiyuchen
7300cfe1bb sm8350-common: rootdir: Add "system" group to Audio HAL
needed for using EdgeTpu.
Due to this code goes to AOSP, please see CL details and test result in
b/289097511#comment24.

Bug: 289097511
Change-Id: Ie0969309346cd85b4bb8ac71860a529710c73345
2025-04-25 18:28:36 +02:00
Andy Hung
b3c874d9da sm8350-common: rootdir: Optimize for Spatial Audio
Add CAP_SYS_NICE.
Allow util_clamp_min for Spatializer Effect worker thread.
Reduce glitches caused by core migration.
Reduce power consumption as Spatializer Effect is DSP compute bound.
This change only affects Spatial Audio Effect processing.

Test: instrumented
Test: adb shell 'uclampset -a -p $(pgrep -of
android.hardware.audio.service)'
Test: adb shell cat "/proc/$(adb shell pgrep -of
android.hardware.audio.service)/status"
Test: adb shell 'ps -Tl -p $(pgrep -of android.hardware.audio.service)'
Bug: 181148259
Bug: 260918856
Bug: 261228892
Bug: 261686532
Bug: 262803152
Merged-In: I59ea99e8a1720f61954747f6c29e14cfea9a0f56
Change-Id: I59ea99e8a1720f61954747f6c29e14cfea9a0f56

Change-Id: I21697423e8c20b34040c5a6641126918b0d75bb5
2025-04-25 18:28:36 +02:00
Andy Hung
e01e87521b sm8350-common: rootdir: Enable RT priority inheritance
Test: instrumented
Bug: 181148259
Bug: 260918856
Merged-In: If56e449a9c6f1a49e372591893d8714534574e3a
Change-Id: If56e449a9c6f1a49e372591893d8714534574e3a
2025-04-25 18:28:36 +02:00
emilchung
307bc739dc sm8350-common: rootdir: add context_hub into audio hal group
While implementing the capo nanoapp for audio configuration, we met
some chre socket connected error due to the access group denied.

Add context_hub group for audio hal to connect chre socket.

go/capo-algo

Bug: 141128522
Bug: 149069556
Test: FULL build with audio hal part and local prebuilts nanoapp.
Test: Audio HAL communicates normally with CHRE socket.
Change-Id: Iea84411682f4c3e08f8b37a5b21818b0e9b04983
2025-04-25 18:28:36 +02:00
Alexander Koskovich
7ead71b7d0 sm8350-common: Remove vendor RenderScript implementation.
* RenderScript is deprecated on newer platforms and
   is being officially replaced.

 * On April 19, 2021, Google announced that RenderScript
   will be deprecated in Android 12, and recommended
   porting existing code to Vulkan.

   https://android-developers.googleblog.com/2021/04/android-gpu-compute-going-forward.html

Change-Id: I19460ef266a646b046f1e7d2f0b4eab7c48ae536
2025-04-25 18:28:36 +02:00
Yung Ti Su
b6086a849c sm8350-common: Enabling sound trigger V2_3
Bug: 139071862
Test: manual

Signed-off-by: Yung Ti Su <andysu@google.com>
Change-Id: I4123b0af64fc7bed934026540136e3811fab32f3
2025-04-25 18:28:36 +02:00
Giovanni Ricca
c941b3d259 sm8350-common: hidl: Unset kernel target level
Change-Id: Id2941d31ff7f1e5e1bb479fe31f5695345b02f12
2025-04-25 18:28:36 +02:00
basamaryan
9728164f39 sm8350-common: Use the common Xiaomi FCM
Change-Id: I0ca395bc5c23c26e1546d3dd1839592530cc0e3f
2025-04-25 18:28:36 +02:00
Bruno Martins
c64fd3015f sm8350-common: Inherit from QTI FCM
Change-Id: I0bdd4d63b60a1e29cdd69e71f7268932a105c16b
2025-04-25 18:28:36 +02:00
Bruno Martins
f053823ed2 sm8350-common: Use the common device compatibility matrix from QCOM
Change-Id: I0c0f3ecddbe6d7b232cc0d13c78ca58094e4e720
2025-04-25 18:28:36 +02:00
Yan Yan
2029ba383b sm8350-common: 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
2025-04-25 18:28:36 +02:00
Yumi Yukimura
4fe8c5b17c sm8350-common: manifest: Bump target-level to 6
Change-Id: I8d419d248f29b7d316a87d55e19ae7ff141e19a5
2025-04-25 18:28:36 +02:00
Giovanni Ricca
4a9877ef16 fixup! sm8350-common: Mark CNE symlink target as required package
Change-Id: I54480890f80789596dafe5b1fc3a1866d2baa989
2025-04-25 18:28:36 +02:00
Giovanni Ricca
669f207ec9 fixup! sm8350-common: Nuke ATFWD
Change-Id: I61fbb2ab8a8d5b86c1aa0250b71fb9b0b12c4ece
2025-04-25 18:28:36 +02:00
Giovanni Ricca
9d2aa061a0 sm8350-common: sepolicy: Reformat it
Change-Id: I052f1941e8193e331d3548d2b548f776890f1193
2025-04-25 18:28:36 +02:00
Giovanni Ricca
966097b760 sm8350-common: sepolicy: Drop redundant dynamic_fps node label
* The whole folder is labeled with `vendor_sysfs_graphics` on
  genfs_contexts.

Change-Id: I2e772590a988be8c106a0c3070a4d4dc7b1502a8
2025-04-25 18:28:36 +02:00
Giovanni Ricca
071d62ed4a sm8350-common: sepolicy: Drop vendor_sysfs_double_tap definition
* We use `/dev/xiaomi-touch` to handle dt2w.

Change-Id: I86f733ad1b0a1d28de67e39b987a8bf19a9dcd5b
2025-04-25 18:28:36 +02:00
LuK1337
3820ca057e sm8350-common: Move WfdCommon boot jar declaration to vendor
Change-Id: I8fa2c0f64692873b432cc252ec88b388a32023a1
2025-04-25 18:28:36 +02:00
Michael Bestas
9db5356b17 sm8350-common: Migrate mount point creation out of Android.mk
Change-Id: Id5986b8a740e45f864eecdd2bd82d9455f128d6b
2025-04-25 18:28:36 +02:00
Tyler Wear
7ef8b190bb sm8350-common: tetheroffload: Version 1.1
Update tetheroffload to version 1.1.

Change-Id: I004e44e416a88a1b39a4c80366df9008722f096b
2025-04-25 18:28:36 +02:00
Bruno Martins
b822991de4 sm8350-common: sepolicy: Remove duplicate snxxx AIDL rules
These are now part of qcom/sepolicy_vndr.

Change-Id: I709c29e827d51e22507027862a56cca1efcdc984
2025-04-25 18:28:36 +02:00
Pawin Vongmasa
3730863cf4 sm8350-common: Move input surface to CCodec
Test: atest CtsMediaTestCases -- \
--module-arg CtsMediaTestCases:size:small
Bug: 131800183
Change-Id: I8783a7de4a4fdf7ff2eac6697c71f6592c9a9e06

Change-Id: I0789784bcdb7d42ec344a8ad7ec4cae03ae82a41
2025-04-25 18:28:36 +02:00
dianlujitao
8f4d603448 sm8350-common: 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-04-25 18:28:36 +02:00
Bruno Martins
ab2a08bee2 sm8350-common: Remove software OMX blobs
Default to C2 codecs from swcodec apex.

Change-Id: I32f0b0abe680c1f350268115a3cc5488a2a57ec3
2025-04-25 18:28:36 +02:00
Giovanni Ricca
8c61a3f60c sm8350-common: Remove unused media_codecs_vendor_audio.xml
Change-Id: Ia4bb3b9d0ec170ba9c94e2481baacd9b8d874607
2025-04-25 18:28:36 +02:00
Michael Bestas
7a382af84a sm8350-common: Remove unused media_codecs_c2_audio inclusion
Change-Id: Ia163033eb53d24faf74c09f301f227dea9f89a1a
2025-04-25 18:28:36 +02:00
Michael Bestas
83cad23e24 fixup! sm8350-common: Remove software omx codec references
Change-Id: Ib96c6ff0a0ad7cd9769a008b2b0669effc62db7c
2025-04-25 18:28:36 +02:00
Michael Bestas
a3489510b8 sm8350-common: sepolicy: Remove /sys/class/qcom-battery label
It's set globally now

Change-Id: Idccb51649fa72f6343534cdc4a951cd96909ff62
2025-04-25 18:28:36 +02:00
Yumi Yukimura
f9dd0dbdc8 sm8350-common: Switch to QTI Memtrack AIDL HAL
Change-Id: Ibcbaff02fd56fbccc3a88c01a5f46a89cb212ef5
2025-04-25 18:28:36 +02:00
Giovanni Ricca
0c9c897f0e fixup! sm8350-common: do not manually build dependencies.
Change-Id: I0b2ea4e8e0f8872e25f71c0075e7b6730aa75a83
2025-04-25 18:28:24 +02:00
258 changed files with 19215 additions and 6408 deletions

1
.clang-format Symbolic link
View File

@@ -0,0 +1 @@
../../../build/soong/scripts/system-clang-format

View File

@@ -1,12 +1,14 @@
//
// Copyright (C) 2020-2024 The LineageOS Project
// SPDX-FileCopyrightText: The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
soong_namespace {
imports: [
"hardware/qcom-caf/bootctrl",
"hardware/xiaomi",
"hardware/google/interfaces",
"hardware/google/pixel",
"hardware/lineage/interfaces/power-libperfmgr",
],
}

View File

@@ -1,39 +0,0 @@
#
# Copyright (C) 2020-2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
LOCAL_PATH := $(call my-dir)
ifneq ($(filter haydn lisa mars odin redwood renoir star venus,$(TARGET_DEVICE)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
include $(CLEAR_VARS)
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
VM_SYSTEM_MOUNT_POINT := $(TARGET_OUT_VENDOR)/vm-system
$(VM_SYSTEM_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
@echo "Creating $(VM_SYSTEM_MOUNT_POINT)"
@mkdir -p $(TARGET_OUT_VENDOR)/vm-system
ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT)
ALL_DEFAULT_INSTALLED_MODULES += $(BT_FIRMWARE_MOUNT_POINT)
ALL_DEFAULT_INSTALLED_MODULES += $(DSP_MOUNT_POINT)
ALL_DEFAULT_INSTALLED_MODULES += $(VM_SYSTEM_MOUNT_POINT)
endif

View File

@@ -1,14 +1,17 @@
#
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-FileCopyrightText: The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
COMMON_PATH := device/xiaomi/sm8350-common
# A/B
AB_OTA_UPDATER := true
BOARD_VENDOR := xiaomi
# Ignore overriding commands errors
BUILD_BROKEN_DUP_RULES := true
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
# A/B
AB_OTA_PARTITIONS += \
boot \
dtbo \
@@ -24,18 +27,16 @@ AB_OTA_PARTITIONS += \
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-2a
TARGET_ARCH_VARIANT := armv8-2a-dotprod
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic
TARGET_CPU_VARIANT_RUNTIME := kryo385
TARGET_CPU_VARIANT := cortex-a76
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_ARCH_VARIANT := armv8-2a
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := generic
TARGET_2ND_CPU_VARIANT_RUNTIME := kryo385
TARGET_2ND_CPU_VARIANT := cortex-a76
# Audio
AUDIO_FEATURE_ENABLED_EXTENDED_COMPRESS_FORMAT := true
@@ -47,6 +48,9 @@ TARGET_PROVIDES_AUDIO_EXTNS := true
# Bootloader
TARGET_NO_BOOTLOADER := true
# Camera
TARGET_CAMERA_SERVICE_EXT_LIB := //$(COMMON_PATH):libcameraservice_extension.xiaomi_sm8350
# Display
TARGET_SCREEN_DENSITY ?= 440
@@ -57,17 +61,23 @@ TARGET_FS_CONFIG_GEN := $(COMMON_PATH)/config.fs
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
# HIDL
DEVICE_MATRIX_FILE := $(COMMON_PATH)/hidl/compatibility_matrix.xml
DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
hardware/xiaomi/vintf/xiaomi_framework_compatibility_matrix.xml \
$(COMMON_PATH)/hidl/vendor_framework_compatibility_matrix.xml \
$(COMMON_PATH)/hidl/xiaomi_framework_compatibility_matrix.xml \
vendor/lineage/config/device_framework_matrix.xml
$(COMMON_PATH)/hidl/xiaomi_framework_compatibility_matrix.xml
DEVICE_MANIFEST_FILE := \
$(COMMON_PATH)/hidl/manifest_lahaina.xml \
$(COMMON_PATH)/hidl/manifest_xiaomi.xml
ifeq ($(TARGET_HAS_UDFPS),true)
DEVICE_MANIFEST_FILE += \
$(COMMON_PATH)/hidl/manifest_udfps.xml
endif
# Kernel
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_IMAGE_NAME := Image
@@ -81,10 +91,10 @@ TARGET_KERNEL_ADDITIONAL_FLAGS := TARGET_PRODUCT=$(PRODUCT_DEVICE)
TARGET_KERNEL_NO_GCC := true
TARGET_KERNEL_SOURCE := kernel/xiaomi/sm8350
TARGET_KERNEL_CONFIG := vendor/lahaina-qgki_defconfig vendor/debugfs.config vendor/xiaomi_QGKI.config
TARGET_KERNEL_CLANG_VERSION := r563880c
BOARD_KERNEL_CMDLINE += androidboot.console=ttyMSM0
BOARD_KERNEL_CMDLINE += androidboot.hardware=qcom
BOARD_KERNEL_CMDLINE += androidboot.memcg=1
BOARD_KERNEL_CMDLINE += androidboot.usbcontroller=a600000.dwc3
BOARD_KERNEL_CMDLINE += cgroup.memory=nokmem,nosocket
BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8
@@ -95,9 +105,7 @@ BOARD_KERNEL_CMDLINE += swiotlb=0
BOARD_KERNEL_CMDLINE += pcie_ports=compat
BOARD_KERNEL_CMDLINE += iptable_raw.raw_before_defrag=1
BOARD_KERNEL_CMDLINE += ip6table_raw.raw_before_defrag=1
# Lineage Health
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
BOARD_KERNEL_CMDLINE += androidboot.init_fatal_reboot_target=recovery
# Partitions
BOARD_FLASH_BLOCK_SIZE := 131072
@@ -131,12 +139,6 @@ TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
# Platform
TARGET_BOARD_PLATFORM := lahaina
# Power
TARGET_POWERHAL_MODE_EXT := $(COMMON_PATH)/power/power-mode.cpp
# PowerShare
TARGET_POWERSHARE_PATH := /sys/class/qcom-battery/reverse_chg_mode
# Properties
TARGET_ODM_PROP += $(COMMON_PATH)/odm.prop
TARGET_SYSTEM_PROP += $(COMMON_PATH)/system.prop
@@ -158,14 +160,17 @@ TARGET_USERIMAGES_USE_F2FS := true
ENABLE_VENDOR_RIL_SERVICE := true
# Security patch level
VENDOR_SECURITY_PATCH := 2024-11-01
VENDOR_SECURITY_PATCH := 2025-06-05
# Sepolicy
include device/lineage/sepolicy/libperfmgr/sepolicy.mk
include device/qcom/sepolicy_vndr/SEPolicy.mk
include hardware/sony/timekeep/sepolicy/SEPolicy.mk
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/public
BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor
SELINUX_IGNORE_NEVERALLOWS := true
# Verified Boot
BOARD_AVB_ENABLE := true
@@ -187,6 +192,7 @@ BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
CONFIG_IEEE80211AX := true
QC_WIFI_HIDL_FEATURE_DUAL_AP := true
WIFI_DRIVER_DEFAULT := wlan
WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"

View File

@@ -41,6 +41,10 @@
<library name="volume_listener" path="libvolumelistener.so"/>
<library name="audiosphere" path="libasphere.so"/>
<library name="shoebox" path="libshoebox.so"/>
<!-- DOLBY DAP -->
<library name="dap_sw" path="libswdap_v3_6.so"/>
<library name="dap_hw" path="libhwdap_v3_6.so"/>
<!-- DOLBY END -->
</libraries>
<effects>
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
@@ -89,6 +93,12 @@
<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"/>
<!-- DOLBY DAP -->
<effectProxy name="dap" library="proxy" uuid="9d4921da-8225-4f29-aefa-39537a04bcaa">
<libsw library="dap_sw" uuid="6ab06da4-c516-4611-8166-452799218539"/>
<libhw library="dap_hw" uuid="a0c30891-8246-4aef-b8ad-d53e26da0253"/>
</effectProxy>
<!-- DOLBY END -->
</effects>
<postprocess>
<stream type="music">

View File

@@ -90,7 +90,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<item>Telephony Tx</item>
<item>Built-In Mic</item>
<item>Built-In Back Mic</item>
<item>FM Tuner</item>
<item>Telephony Rx</item>
</attachedDevices>
<defaultOutputDevice>Speaker</defaultOutputDevice>
@@ -190,7 +189,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<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,AUDIO_CHANNEL_OUT_STEREO"/>
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
</mixPort>
<mixPort name="incall_music_uplink" role="source"
flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
@@ -210,11 +209,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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"
@@ -324,11 +318,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
</devicePort>
<devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
</devicePort>
<devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -381,13 +370,11 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<route type="mix" sink="voice_rx"
sources="Telephony Rx"/>
<route type="mix" sink="primary input"
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
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,Wired Headset Mic"/>
<route type="mix" sink="quad mic"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Wired Headset Mic"/>
<route type="mix" sink="voip_tx"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
<route type="mix" sink="record_24"

View File

@@ -1,5 +1,5 @@
//
// Copyright (C) 2018 The Android Open Source Project
// Copyright (C) 2022 The LineageOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,11 +12,11 @@
// 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.
//
cc_library_shared {
name: "android.hardware.boot@1.2-impl-qti",
stem: "android.hardware.boot@1.0-impl-1.2-qti",
defaults: ["android.hardware.boot@1.2-impl-qti_defaults"],
static_libs: ["libgptutils.xiaomi_sm8350"],
cc_library_static {
name: "libcameraservice_extension.xiaomi_sm8350",
srcs: ["CameraProviderExtension.cpp"],
include_dirs: [
"frameworks/av/services/camera/libcameraservice/common"
],
}

View File

@@ -0,0 +1,75 @@
/*
* Copyright (C) 2024 LibreMobileOS Foundation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "CameraProviderExtension.h"
#include <fstream>
#define TORCH_BRIGHTNESS "brightness"
#define TORCH_MAX_BRIGHTNESS "max_brightness"
#define TOGGLE_SWITCH "/sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8350c@2:qcom,flash_led@ee00/leds/led:switch_2/brightness"
static std::string kTorchLedPath = "/sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8350c@2:qcom,flash_led@ee00/leds/led:torch_0";
/**
* Write value to path and close file.
*/
template <typename T>
static void set(const std::string& path, const T& value) {
std::ofstream file(path);
file << value;
}
/**
* Read value from the path and close file.
*/
template <typename T>
static T get(const std::string& path, const T& def) {
std::ifstream file(path);
T result;
file >> result;
return file.fail() ? def : result;
}
bool supportsTorchStrengthControlExt() {
return true;
}
bool supportsSetTorchModeExt() {
return false;
}
int32_t getTorchDefaultStrengthLevelExt() {
// Our default value is 75. This corresponds to 15%.
// As we have changed the maximum value, 59% now corresponds to 75.
return 59;
}
int32_t getTorchMaxStrengthLevelExt() {
// 255 out of 500 is a sane brightness.
// Let's cap it to 255 as max, we can go much higher, but I don't want to test this.
return 255;
}
int32_t getTorchStrengthLevelExt() {
// We write same value in the both LEDs,
// so get from one.
auto node = kTorchLedPath + "/" + TORCH_BRIGHTNESS;
return get(node, 0);
}
void setTorchStrengthLevelExt(int32_t torchStrength, bool enabled) {
set(TOGGLE_SWITCH, 0);
auto node = kTorchLedPath + "/" + TORCH_BRIGHTNESS;
set(node, torchStrength);
if (enabled)
set(TOGGLE_SWITCH, 255);
}
void setTorchModeExt(bool enabled) {
int32_t strength = getTorchDefaultStrengthLevelExt();
setTorchStrengthLevelExt(enabled ? strength : 0, enabled);
}

134
common.mk
View File

@@ -1,11 +1,11 @@
#
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-FileCopyrightText: The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
# Inherit from those products. Most specific first.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
TARGET_SUPPORTS_OMX_SERVICE := false
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
# Enable virtual A/B OTA
@@ -43,7 +43,7 @@ PRODUCT_PACKAGES += \
android.hardware.audio@6.0-impl \
android.hardware.audio.effect@6.0-impl \
android.hardware.audio.service \
android.hardware.soundtrigger@2.2-impl
android.hardware.soundtrigger@2.3-impl
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/audio/audio_tuning_mixer.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer.txt
@@ -107,17 +107,16 @@ TARGET_SCREEN_WIDTH := 1080
# Boot control
PRODUCT_PACKAGES += \
android.hardware.boot@1.2-impl-qti \
android.hardware.boot@1.2-impl-qti.recovery \
android.hardware.boot@1.2-service
PRODUCT_PACKAGES_DEBUG += \
bootctl
android.hardware.boot-service.qti \
android.hardware.boot-service.qti.recovery
# Camera
PRODUCT_PACKAGES += \
android.hidl.memory@1.0.vendor \
android.hidl.memory.block@1.0.vendor \
android.hardware.camera.provider@2.4-impl \
android.hardware.camera.provider@2.4-service_64
android.hardware.camera.provider@2.4-service_64 \
android.hardware.graphics.common-V4-ndk
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/camera_cnf.txt:$(TARGET_COPY_OUT_VENDOR)/etc/camera/camera_cnf.txt
@@ -128,27 +127,37 @@ PRODUCT_COPY_FILES += \
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
$(call soong_config_set,libcameraservice,ext_lib,libcameraservice_extension.xiaomi_sm8350)
# DebugFS
PRODUCT_SET_DEBUGFS_RESTRICTIONS := true
# Device-specific settings
PRODUCT_PACKAGES += \
DSPVolumeSynchronizer \
XiaomiDolby \
XiaomiDolbyResCommon \
XiaomiParts
# Display
PRODUCT_PACKAGES += \
android.hardware.graphics.mapper@3.0-impl-qti-display \
android.hardware.graphics.mapper@4.0-impl-qti-display \
android.hardware.memtrack@1.0-impl \
android.hardware.memtrack@1.0-service \
vendor.qti.hardware.display.allocator-service \
vendor.qti.hardware.display.composer-service \
vendor.qti.hardware.display.composer-service.rc \
vendor.qti.hardware.display.composer-service.xml
vendor.qti.hardware.display.composer-service.xml \
vendor.qti.hardware.memtrack-service
PRODUCT_PACKAGES += \
libqdMetaData.system \
memtrack.default
android.hardware.graphics.allocator@3.0
PRODUCT_COPY_FILES += \
hardware/qcom-caf/sm8350/display/config/snapdragon_color_libs_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/snapdragon_color_libs_config.xml
# Dolby Vision
$(call soong_config_set, dolby_vision, enabled, true)
# DRM
PRODUCT_PACKAGES += \
android.hardware.drm-service.clearkey
@@ -161,6 +170,18 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint-service.xiaomi
ifeq ($(TARGET_HAS_UDFPS),true)
PRODUCT_PACKAGES += \
libudfpshandler \
sensors.xiaomi.v2
PRODUCT_PACKAGES += \
FrameworkOverlayUDFPS
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.sensors.xiaomi.udfps=true
endif
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
@@ -210,6 +231,11 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
android.hardware.health-service.qti
PRODUCT_PACKAGES += \
libhidltransport \
libhwbinder \
android.hidl.manager@1.0.vendor
# HotwordEnrollement
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/privapp-permissions-hotword.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-hotword.xml
@@ -219,7 +245,6 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/etc/init.batterysecret.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.batterysecret.rc \
$(LOCAL_PATH)/rootdir/etc/init.mi_thermald.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.mi_thermald.rc \
$(LOCAL_PATH)/rootdir/etc/init.qcom.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qcom.rc \
$(LOCAL_PATH)/rootdir/etc/init.qcom.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qcom.usb.rc \
$(LOCAL_PATH)/rootdir/etc/init.qti.kernel.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qti.kernel.rc \
$(LOCAL_PATH)/rootdir/etc/init.target.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.target.rc
@@ -242,32 +267,25 @@ PRODUCT_PACKAGES += \
# IR
PRODUCT_PACKAGES += \
android.hardware.ir-service.xiaomi
android.hardware.ir-service.lineage
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
# Kernel
PRODUCT_ENABLE_UFFD_GC := false
PRODUCT_ENABLE_UFFD_GC := true
# Lineage Health
PRODUCT_PACKAGES += \
vendor.lineage.health-service.default
# Media
PRODUCT_PACKAGES += \
libmm-omxcore \
libOmxAacEnc \
libOmxAmrEnc \
libOmxCore \
libOmxEvrcEnc \
libOmxG711Enc \
libOmxQcelp13Enc \
libstagefrighthw
$(call soong_config_set_bool,lineage_health,charging_control_supports_bypass,false)
# Media
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/media/init.qti.media.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.media.sh \
$(LOCAL_PATH)/media/init.qti.media.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.qti.media.rc
$(LOCAL_PATH)/media/init.qti.media.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.qti.media.rc \
$(LOCAL_PATH)/media/media_codecs_c2_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_c2_dolby_audio.xml
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/media/lahaina/media_codecs_lahaina.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_lahaina.xml \
@@ -290,7 +308,8 @@ PRODUCT_COPY_FILES += \
# Network
PRODUCT_COPY_FILES += \
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.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \
frameworks/native/data/etc/android.software.ipsec_tunnel_migration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnel_migration.xml
# NFC
PRODUCT_PACKAGES += \
@@ -318,19 +337,30 @@ DEVICE_PACKAGE_OVERLAYS += \
PRODUCT_ENFORCE_RRO_TARGETS := *
PRODUCT_PACKAGES += \
DeviceAsWebcamOverlaySM8350 \
NcmTetheringOverlay
# Partitions
PRODUCT_PACKAGES += \
vendor_bt_firmware_mountpoint \
vendor_dsp_mountpoint \
vendor_firmware_mnt_mountpoint
PRODUCT_BUILD_SUPER_PARTITION := false
PRODUCT_USE_DYNAMIC_PARTITIONS := true
# Power
PRODUCT_PACKAGES += \
android.hardware.power-service-qti
android.hardware.power-service.lineage-libperfmgr \
libqti-perfd-client
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json
$(LOCAL_PATH)/configs/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json \
$(LOCAL_PATH)/configs/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
PRODUCT_COPY_FILES += \
vendor/qcom/opensource/power/config/lahaina/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
# PowerShare
$(call soong_config_set,lineage_powershare,powershare_path,/sys/class/qcom-battery/reverse_chg_mode)
# QTI
PRODUCT_COPY_FILES += \
@@ -341,13 +371,9 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/etc/init.recovery.qcom.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.qcom.rc
# RenderScript HAL
PRODUCT_PACKAGES += \
android.hardware.renderscript@1.0-impl
# QTI fwk-detect
PRODUCT_PACKAGES += \
libvndfwk_detect_jni.qti.vendor:64 # Needed by CNE app
libvndfwk_detect_jni.qti.vendor # Needed by CNE app
# RIL
PRODUCT_PACKAGES += \
@@ -371,6 +397,10 @@ PRODUCT_COPY_FILES += \
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
hardware/google/interfaces \
hardware/google/pixel \
hardware/lineage/interfaces/power-libperfmgr \
hardware/qcom-caf/common/libqti-perfd-client \
hardware/xiaomi
# Telephony
@@ -384,6 +414,9 @@ PRODUCT_PACKAGES += \
telephony-ext \
xiaomi-telephony-stub
PRODUCT_PACKAGES += \
qcrilNrDb_vendor
PRODUCT_BOOT_JARS += \
telephony-ext \
xiaomi-telephony-stub
@@ -398,6 +431,10 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
android.hardware.thermal-service.qti
# TimeKeep
PRODUCT_PACKAGES += \
TimeKeep
# Touchscreen
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
@@ -412,12 +449,18 @@ PRODUCT_PACKAGES += \
update_engine_sideload \
update_verifier
PRODUCT_PACKAGES_DEBUG += \
update_engine_client
# USB
PRODUCT_PACKAGES += \
android.hardware.usb-service.qti
android.hardware.usb-service.qti \
android.hardware.usb.gadget-service.qti \
usb_compositions.conf
PRODUCT_PACKAGES += \
init.qcom.usb.rc \
init.qcom.usb.sh
PRODUCT_SOONG_NAMESPACES += \
vendor/qcom/opensource/usb/etc
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
@@ -453,7 +496,6 @@ PRODUCT_PACKAGES += \
android.hardware.wifi-service \
hostapd \
libwifi-hal-qcom \
libwpa_client \
WifiOverlay \
wpa_cli \
wpa_supplicant \
@@ -474,7 +516,3 @@ PRODUCT_COPY_FILES += \
# WiFi firmware symlinks
PRODUCT_PACKAGES += \
firmware_WCNSS_qcom_cfg.ini_symlink
# WiFi Display
PRODUCT_BOOT_JARS += \
WfdCommon

622
configs/powerhint.json Normal file
View File

@@ -0,0 +1,622 @@
{
"Nodes": [
{
"Name": "CPULittleClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"1612800"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "CPULittleClusterMinFreq",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"1708800",
"1305600",
"691200"
],
"ResetOnInit": true
},
{
"Name": "CPULittleClusterUpRateLimit",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us",
"Values": [
"500",
"2000"
],
"ResetOnInit": true
},
{
"Name": "CPULittleClusterDownRateLimit",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/schedutil/down_rate_limit_us",
"Values": [
"20000",
"2000"
],
"ResetOnInit": true
},
{
"Name": "CPUBigClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"1324800"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "CPUBigClusterMinFreq",
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"1324800",
"1075200",
"710400"
],
"ResetOnInit": true
},
{
"Name": "CPUBigClusterUpRateLimit",
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/schedutil/up_rate_limit_us",
"Values": [
"500",
"2000"
],
"ResetOnInit": true
},
{
"Name": "CPUBigClusterDownRateLimit",
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/schedutil/down_rate_limit_us",
"Values": [
"10000",
"2000"
],
"ResetOnInit": true
},
{
"Name": "CPUBigPlusClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"1555200"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "CPUBigPlusClusterMinFreq",
"Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"1075200",
"844800"
],
"ResetOnInit": true
},
{
"Name": "CPUBigPlusClusterUpRateLimit",
"Path": "/sys/devices/system/cpu/cpu7/cpufreq/schedutil/up_rate_limit_us",
"Values": [
"500",
"2000"
],
"ResetOnInit": true
},
{
"Name": "CPUBigPlusClusterDownRateLimit",
"Path": "/sys/devices/system/cpu/cpu7/cpufreq/schedutil/down_rate_limit_us",
"Values": [
"5000",
"2000"
],
"ResetOnInit": true
},
{
"Name": "UclampTAMin",
"Path": "/dev/cpuctl/top-app/cpu.uclamp.min",
"Values": [
"0",
"25",
"50"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "UclampTALatency",
"Path": "/dev/cpuctl/top-app/cpu.uclamp.latency_sensitive",
"Values": [
"1",
"0"
],
"ResetOnInit": true
},
{
"Name": "UclampFgMin",
"Path": "/dev/cpuctl/foreground/cpu.uclamp.min",
"Values": [
"0",
"50"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "SchedPreferSpread",
"Path": "/proc/sys/kernel/sched_prefer_spread",
"Values": [
"4",
"0"
],
"ResetOnInit": true
},
{
"Name": "SchedBusyHystNs",
"Path": "/proc/sys/kernel/sched_busy_hyst_ns",
"Values": [
"99000000",
"3000000",
"0"
],
"ResetOnInit": true
},
{
"Name": "SchedBusyHystEnableCPUs",
"Path": "/proc/sys/kernel/sched_busy_hysteresis_enable_cpus",
"Values": [
"255",
"15",
"0"
],
"ResetOnInit": true
},
{
"Name": "SchedMinTaskUtilForBoost",
"Path": "/proc/sys/kernel/sched_min_task_util_for_boost",
"Values": [
"0",
"51"
],
"ResetOnInit": true
},
{
"Name": "SchedMinTaskUtilForColoc",
"Path": "/proc/sys/kernel/sched_min_task_util_for_colocation",
"Values": [
"0",
"35"
],
"ResetOnInit": true
},
{
"Name": "GPUMaxFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/devfreq/max_freq",
"Values": [
"840000000",
"540000000",
"443000000"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "GPUMinFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/devfreq/min_freq",
"Values": [
"540000000",
"379000000",
"315000000"
],
"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",
"58"
],
"ResetOnInit": true
},
{
"Name": "CPUBWHystTriggerCount",
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hyst_trigger_count",
"Values": [
"0",
"3"
],
"ResetOnInit": true
},
{
"Name": "CPUBWHistMemory",
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hist_memory",
"Values": [
"0",
"20"
],
"ResetOnInit": true
},
{
"Name": "CPUBWHystLength",
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hyst_length",
"Values": [
"0",
"10"
],
"ResetOnInit": true
},
{
"Name": "CPUBWMinFreq",
"Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/min_freq",
"Values": [
"12298",
"9155",
"4577"
],
"ResetOnInit": true
},
{
"Name": "LLCCBWMinFreq",
"Path": "/sys/class/devfreq/soc:qcom,cpu-llcc-ddr-bw/min_freq",
"Values": [
"6515",
"3879",
"762"
],
"ResetOnInit": true
},
{
"Name": "PowerHALMainState",
"Path": "vendor.powerhal.state",
"Values": [
"SUSTAINED_PERFORMANCE",
""
],
"Type": "Property"
},
{
"Name": "PowerHALRenderingState",
"Path": "vendor.powerhal.rendering",
"Values": [
"EXPENSIVE_RENDERING",
""
],
"Type": "Property"
},
{
"Name": "DoubleTapToWake",
"Path": "/sys/devices/virtual/touch/tp_dev/double_tap",
"Values": [
"0",
"1"
],
"DefaultIndex": 0,
"ResetOnInit": true
}
],
"Actions": [
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "PowerHALMainState",
"Duration": 0,
"Value": "SUSTAINED_PERFORMANCE"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "1324800"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPUBigPlusClusterMaxFreq",
"Duration": 0,
"Value": "1555200"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPULittleClusterMaxFreq",
"Duration": 0,
"Value": "1612800"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "540000000"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBigClusterMinFreq",
"Duration": 0,
"Value": "1324800"
},
{
"PowerHint": "INTERACTION",
"Node": "CPULittleClusterMinFreq",
"Duration": 0,
"Value": "1708800"
},
{
"PowerHint": "INTERACTION",
"Node": "UclampTAMin",
"Duration": 0,
"Value": "25"
},
{
"PowerHint": "INTERACTION",
"Node": "UclampTALatency",
"Duration": 0,
"Value": "1"
},
{
"PowerHint": "INTERACTION",
"Node": "SchedPreferSpread",
"Duration": 0,
"Value": "4"
},
{
"PowerHint": "INTERACTION",
"Node": "SchedBusyHystNs",
"Duration": 0,
"Value": "99000000"
},
{
"PowerHint": "INTERACTION",
"Node": "SchedBusyHystEnableCPUs",
"Duration": 0,
"Value": "255"
},
{
"PowerHint": "INTERACTION",
"Node": "SchedMinTaskUtilForBoost",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "INTERACTION",
"Node": "SchedMinTaskUtilForColoc",
"Duration": 0,
"Value": "0"
},
{
"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": "9155"
},
{
"PowerHint": "INTERACTION",
"Node": "LLCCBWMinFreq",
"Duration": 0,
"Value": "3879"
},
{
"PowerHint": "INTERACTIVE",
"Node": "CPULittleClusterUpRateLimit",
"Duration": 0,
"Value": "500"
},
{
"PowerHint": "INTERACTIVE",
"Node": "CPULittleClusterDownRateLimit",
"Duration": 0,
"Value": "20000"
},
{
"PowerHint": "INTERACTIVE",
"Node": "CPUBigClusterUpRateLimit",
"Duration": 0,
"Value": "500"
},
{
"PowerHint": "INTERACTIVE",
"Node": "CPUBigClusterDownRateLimit",
"Duration": 0,
"Value": "10000"
},
{
"PowerHint": "INTERACTIVE",
"Node": "CPUBigPlusClusterUpRateLimit",
"Duration": 0,
"Value": "500"
},
{
"PowerHint": "INTERACTIVE",
"Node": "CPUBigPlusClusterDownRateLimit",
"Duration": 0,
"Value": "5000"
},
{
"PowerHint": "INTERACTIVE",
"Node": "SchedBusyHystNs",
"Duration": 0,
"Value": "3000000"
},
{
"PowerHint": "INTERACTIVE",
"Node": "SchedBusyHystEnableCPUs",
"Duration": 0,
"Value": "15"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBigClusterMinFreq",
"Duration": 3000,
"Value": "9999999"
},
{
"PowerHint": "LAUNCH",
"Node": "CPULittleClusterMinFreq",
"Duration": 3000,
"Value": "9999999"
},
{
"PowerHint": "LAUNCH",
"Node": "UclampFgMin",
"Duration": 3000,
"Value": "50"
},
{
"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": "12298"
},
{
"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": "LLCCBWMinFreq",
"Duration": 3000,
"Value": "6515"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "PowerHALRenderingState",
"Duration": 0,
"Value": "EXPENSIVE_RENDERING"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "GPUMinFreq",
"Duration": 0,
"Value": "540000000"
},
{
"PowerHint": "Flipendo",
"Node": "CPULittleClusterMaxFreq",
"Duration": 0,
"Value": "1612800"
},
{
"PowerHint": "Flipendo",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "1324800"
},
{
"PowerHint": "Flipendo",
"Node": "CPUBigPlusClusterMaxFreq",
"Duration": 0,
"Value": "1555200"
},
{
"PowerHint": "GAME",
"Node": "CPUBigClusterMinFreq",
"Duration": 0,
"Value": "1075200"
},
{
"PowerHint": "GAME",
"Node": "CPULittleClusterMinFreq",
"Duration": 0,
"Value": "9999999"
},
{
"PowerHint": "GAME",
"Node": "GPUMinFreq",
"Duration": 0,
"Value": "379000000"
},
{
"PowerHint": "GAME",
"Node": "CPULittleClusterDownRateLimit",
"Duration": 0,
"Value": "2000"
},
{
"PowerHint": "GAME",
"Node": "CPUBigClusterDownRateLimit",
"Duration": 0,
"Value": "2000"
},
{
"PowerHint": "GAME",
"Node": "CPUBigPlusClusterDownRateLimit",
"Duration": 0,
"Value": "2000"
},
{
"PowerHint": "DOUBLE_TAP_TO_WAKE",
"Node": "DoubleTapToWake",
"Duration": 0,
"Value": "1"
}
]
}

View File

@@ -1,4 +1,3 @@
libqti-perfd-client.so
libadsprpc.so
libcdsprpc.so
libsdsprpc.so

View File

@@ -9,7 +9,6 @@ from extract_utils.fixups_blob import (
blob_fixups_user_type,
)
from extract_utils.fixups_lib import (
lib_fixup_remove,
lib_fixups,
lib_fixups_user_type,
)
@@ -39,26 +38,32 @@ lib_fixups: lib_fixups_user_type = {
(
'com.qualcomm.qti.dpm.api@1.0',
'libmmosal',
'vendor.qti.diaghal@1.0',
'vendor.qti.hardware.wifidisplaysession@1.0',
'vendor.qti.imsrtpservice@3.0',
'vendor.xiaomi.hardware.misys@1.0',
'vendor.xiaomi.hardware.misys@2.0',
'vendor.xiaomi.hardware.misys@3.0',
'vendor.xiaomi.hardware.misys@4.0',
): lib_fixup_vendor_suffix,
(
'libOmxCore',
'libwpa_client',
): lib_fixup_remove,
}
blob_fixups: blob_fixups_user_type = {
'system_ext/bin/wfdservice64': blob_fixup()
.add_needed('libwfdservice_shim.so'),
'system_ext/etc/init/wfdservice.rc': blob_fixup()
.regex_replace(r'(start|stop) wfdservice\b', r'\1 wfdservice64'),
'system_ext/lib64/libwfdmmsrc_system.so': blob_fixup()
.add_needed('libgui_shim.so'),
'system_ext/lib64/libwfdservice.so': blob_fixup()
('system_ext/lib/libwfdservice.so', 'system_ext/lib64/libwfdservice.so'): blob_fixup()
.add_needed('libaudioclient_shim.so')
.replace_needed('android.media.audio.common.types-V2-cpp.so', 'android.media.audio.common.types-V4-cpp.so'),
'system_ext/lib64/libwfdnative.so': blob_fixup()
.remove_needed('android.hidl.base@1.0.so')
.add_needed('libbinder_shim.so')
.add_needed('libinput_shim.so'),
'vendor/etc/init/vendor.xiaomi.hardware.citsensorservice@1.1-service.rc': blob_fixup()
.add_line_if_missing(' task_profiles ServiceCapacityLow'),
('vendor/etc/media_lahaina/video_system_specs.json', 'vendor/etc/media_shima_v1/video_system_specs.json', 'vendor/etc/media_yupik_v1/video_system_specs.json'): blob_fixup()
.regex_replace('"max_retry_alloc_output_timeout": 10000,', '"max_retry_alloc_output_timeout": 0,'),
'vendor/etc/vintf/manifest/c2_manifest_vendor.xml': blob_fixup()
@@ -68,6 +73,40 @@ blob_fixups: blob_fixups_user_type = {
.add_needed('libcrypto_shim.so'),
'vendor/lib64/android.hardware.secure_element@1.0-impl.so': blob_fixup()
.remove_needed('android.hidl.base@1.0.so'),
# Dolby START
'odm/bin/hw/vendor.dolby_sp.media.c2@1.0-service': blob_fixup()
.replace_needed('libcodec2_hidl@1.0.so', 'libcodec2_hidl@1.0_sp.so')
.replace_needed('libcodec2_vndk.so', 'libcodec2_vndk_sp.so'),
'odm/lib64/libcodec2_store_dolby_sp.so': blob_fixup()
.replace_needed('libcodec2_vndk.so', 'libcodec2_vndk_sp.so'),
('odm/lib64/libcodec2_soft_ac4dec_sp.so', 'odm/lib64/libcodec2_soft_ddpdec_sp.so'): blob_fixup()
.replace_needed('libcodec2_vndk.so', 'libcodec2_vndk_sp.so')
.replace_needed('libcodec2_soft_common.so', 'libcodec2_soft_common_sp.so')
.replace_needed('libstagefright_foundation.so', 'libstagefright_foundation-v33.so'),
('odm/lib64/libcodec2_soft_common_sp.so', 'odm/lib64/libcodec2_hidl_plugin_sp.so'): blob_fixup()
.replace_needed('libcodec2_vndk.so', 'libcodec2_vndk_sp.so')
.replace_needed('libstagefright_foundation.so', 'libstagefright_foundation-v33.so'),
(
'odm/lib/libdlbdsservice_v3_6.so',
'odm/lib/libstagefright_soft_ddpdec.so',
'odm/lib64/libdlbdsservice_sp.so',
'odm/lib64/libdlbdsservice_v3_6.so'
): blob_fixup().replace_needed('libstagefright_foundation.so', 'libstagefright_foundation-v33.so'),
'odm/lib64/libcodec2_vndk_sp.so': blob_fixup()
.replace_needed('libui.so', 'libui_sp.so')
.replace_needed('libstagefright_foundation.so', 'libstagefright_foundation-v33.so'),
'odm/lib64/libcodec2_hidl@1.0_sp.so': blob_fixup()
.replace_needed('libcodec2_hidl_plugin.so', 'libcodec2_hidl_plugin_sp.so')
.replace_needed('libcodec2_vndk.so', 'libcodec2_vndk_sp.so'),
'odm/lib64/libui_sp.so': blob_fixup()
.replace_needed('android.hardware.graphics.common-V3-ndk.so', 'android.hardware.graphics.common-V5-ndk.so')
.replace_needed('android.hardware.graphics.allocator-V1-ndk.so', 'android.hardware.graphics.allocator-V2-ndk.so'),
# Dolby END
(
'vendor/lib64/libdpps.so',
'vendor/lib64/libsnapdragoncolor-manager.so',
): blob_fixup()
.replace_needed('libtinyxml2.so', 'libtinyxml2-v34.so'),
} # fmt: skip
module = ExtractUtilsModule(

View File

@@ -1,4 +1,18 @@
GNSS_CFLAGS = [
"-Werror",
"-Wno-undefined-bool-conversion",
"-Wno-error=unused-parameter",
"-Wno-error=macro-redefined",
"-Wno-error=reorder",
"-Wno-error=missing-braces",
"-Wno-error=self-assign",
"-Wno-error=enum-conversion",
"-Wno-error=logical-op-parentheses",
"-Wno-error=null-arithmetic",
"-Wno-error=null-conversion",
"-Wno-error=parentheses-equality",
"-Wno-error=undefined-bool-conversion",
"-Wno-error=tautological-compare",
"-Wno-error=switch",
"-Wno-error=date-time",
]

View File

@@ -1,50 +0,0 @@
# Copyright (C) 2007 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# If you don't need to do a full clean build but would like to touch
# a file or delete some intermediate files, add a clean step to the end
# of the list. These steps will only be run once, if they haven't been
# run before.
#
# E.g.:
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
#
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
# files that are missing or have been moved.
#
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
# Use $(OUT_DIR) to refer to the "out" directory.
#
# If you need to re-do something that's already mentioned, just copy
# the command and add it to the bottom of the list. E.g., if a change
# that you made last week required touching a file and a change you
# made today requires touching the same file, just copy the old
# touch step and add it to the end of the list.
#
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
# For example:
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*)

View File

@@ -51,9 +51,6 @@ 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;
@@ -87,8 +84,13 @@ void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) {
return;
}
if (mAGnssCbIface != nullptr) {
auto r = mAGnssCbIface->agnssStatusCb(aType, aStatus);
mMutex.lock();
// cache the AGps Type
mType = type;
auto aGnssCbIface = mAGnssCbIface;
mMutex.unlock();
if (aGnssCbIface != nullptr) {
auto r = aGnssCbIface->agnssStatusCb(aType, aStatus);
if (!r.isOk()) {
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
}
@@ -106,7 +108,9 @@ Return<void> AGnss::setCallback(const sp<V2_0::IAGnssCallback>& callback) {
}
// Save the interface
mMutex.lock();
mAGnssCbIface = callback;
mMutex.unlock();
AgpsCbInfo cbInfo = {};
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;

View File

@@ -21,6 +21,7 @@
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
#include <mutex>
#include <android/hardware/gnss/2.0/IAGnss.h>
#include <hidl/Status.h>
#include <gps_extended_c.h>
@@ -66,6 +67,7 @@ struct AGnss : public V2_0::IAGnss {
private:
Gnss* mGnss = nullptr;
std::mutex mMutex;
sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr;
AGpsExtType mType;

View File

@@ -29,7 +29,7 @@
#include <string>
#include "Gnss.h"
#include "AGnssRil.h"
#include <DataItemConcreteTypesBase.h>
#include <DataItemConcreteTypes.h>
typedef void* (getLocationInterface)();

View File

@@ -459,7 +459,8 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
@@ -610,7 +611,8 @@ Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) {
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
@@ -748,7 +750,8 @@ Return<bool> Gnss::setCallback_2_1(const sp<V2_1::IGnssCallback>& callback) {
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();

View File

@@ -18,11 +18,15 @@
* limitations under the License.
*/
/* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
#include <log_util.h>
#include "GnssMeasurement.h"
#include "MeasurementAPIClient.h"
namespace android {
namespace hardware {
@@ -54,32 +58,44 @@ GnssMeasurement::~GnssMeasurement() {
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
const sp<V1_0::IGnssMeasurementCallback>& callback) {
return setCallback(callback, mGnssMeasurementCbIface, GNSS_POWER_MODE_INVALID);
}
template <typename T>
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode) {
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;
}
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
return ret;
}
clearInterfaces();
if (myCallback != callback) {
if (nullptr == callback) {
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
mApi->measurementSetCallback(callback);
close();
} else {
if (nullptr != myCallback) {
myCallback->unlinkToDeath(mGnssMeasurementDeathRecipient);
}
myCallback = callback;
myCallback->linkToDeath(mGnssMeasurementDeathRecipient, 0);
ret = mApi->measurementSetCallback(callback, powerMode);
}
}
mGnssMeasurementCbIface = callback;
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
return mApi->measurementSetCallback(callback);
return ret;
}
void GnssMeasurement::clearInterfaces() {
if (mApi != nullptr) {
mApi->measurementSetCallback<V1_0::IGnssMeasurementCallback>(nullptr);
mApi->measurementSetCallback<V1_1::IGnssMeasurementCallback>(nullptr);
mApi->measurementSetCallback<V2_0::IGnssMeasurementCallback>(nullptr);
mApi->measurementSetCallback<V2_1::IGnssMeasurementCallback>(nullptr);
}
if (mGnssMeasurementCbIface != nullptr) {
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
mGnssMeasurementCbIface = nullptr;
@@ -113,95 +129,24 @@ Return<void> GnssMeasurement::close() {
// 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);
return setCallback(callback, mGnssMeasurementCbIface_1_1,
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
}
// 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);
return setCallback(callback, mGnssMeasurementCbIface_2_0,
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
}
// 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);
return setCallback(callback, mGnssMeasurementCbIface_2_1,
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
}
} // namespace implementation

View File

@@ -18,12 +18,18 @@
* limitations under the License.
*/
/* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#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>
#include "MeasurementAPIClient.h"
namespace android {
namespace hardware {
@@ -74,7 +80,9 @@ struct GnssMeasurement : public V2_1::IGnssMeasurement {
sp<GnssMeasurement> mGnssMeasurement;
};
private:
template <typename T>
Return<IGnssMeasurement::GnssMeasurementStatus> setCallback(
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode);
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;

View File

@@ -1,4 +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
group system gps radio vendor_qti_diag inet

View File

@@ -95,65 +95,6 @@ void MeasurementAPIClient::clearInterfaces()
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)
@@ -162,16 +103,6 @@ MeasurementAPIClient::startTracking(
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 ||
@@ -195,7 +126,8 @@ MeasurementAPIClient::startTracking(
}
mTracking = true;
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
LOC_LOGd("(powermode: %d) (tbm %d)", (int)powerMode, timeBetweenMeasurement);
locAPIStartTracking(options);
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
}
@@ -204,6 +136,7 @@ MeasurementAPIClient::startTracking(
void MeasurementAPIClient::measurementClose() {
LOC_LOGD("%s]: ()", __FUNCTION__);
mTracking = false;
clearInterfaces();
locAPIStopTracking();
}

View File

@@ -32,7 +32,6 @@
#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>
@@ -54,20 +53,16 @@ public:
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);
template <typename T>
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
const sp<T>& callback, GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID) {
mMutex.lock();
setCallbackLocked(callback);
mMutex.unlock();
return startTracking(powerMode);
}
void measurementClose();
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
@@ -77,6 +72,18 @@ public:
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
private:
inline void setCallbackLocked(const sp<V1_0::IGnssMeasurementCallback>& callback) {
mGnssMeasurementCbIface = callback;
}
inline void setCallbackLocked(const sp<V1_1::IGnssMeasurementCallback>& callback) {
mGnssMeasurementCbIface_1_1 = callback;
}
inline void setCallbackLocked(const sp<V2_0::IGnssMeasurementCallback>& callback) {
mGnssMeasurementCbIface_2_0 = callback;
}
inline void setCallbackLocked(const sp<V2_1::IGnssMeasurementCallback>& callback) {
mGnssMeasurementCbIface_2_1 = callback;
}
virtual ~MeasurementAPIClient();
std::mutex mMutex;

View File

@@ -22,6 +22,7 @@ cc_library_shared {
"LocContext.cpp",
"loc_core_log.cpp",
"data-items/DataItemsFactoryProxy.cpp",
"data-items/DataItemConcreteTypes.cpp",
"SystemStatusOsObserver.cpp",
"SystemStatus.cpp",
],

View File

@@ -26,6 +26,43 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_CtxBase"
@@ -51,6 +88,7 @@ bool ContextBase::sGnssMeasurementSupported = false;
uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
GnssNMEARptRate ContextBase::sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
LocationCapabilitiesMask ContextBase::sQwesFeatureMask = 0;
LocationCapabilitiesMask ContextBase::sHwCapabilitiesMask = 0;
const loc_param_s_type ContextBase::mGps_conf_table[] =
{

View File

@@ -26,6 +26,42 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LOC_CONTEXT_BASE__
#define __LOC_CONTEXT_BASE__
@@ -158,7 +194,10 @@ public:
return mLBSProxy->getIzatDevId();
}
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
inline bool checkFeatureStatus(int* fids,
LocFeatureStatus* status, uint32_t idCount, bool directQwesCall = false) const {
return mLocApiProxy->checkFeatureStatus(fids, status, idCount, directQwesCall);
}
static loc_gps_cfg_s_type mGps_conf;
static loc_sap_cfg_s_type mSap_conf;
static bool sIsEngineCapabilitiesKnown;
@@ -167,6 +206,7 @@ public:
static bool sGnssMeasurementSupported;
static GnssNMEARptRate sNmeaReportRate;
static LocationCapabilitiesMask sQwesFeatureMask;
static LocationHwCapabilitiesMask sHwCapabilitiesMask;
void readConfig();
static uint32_t getCarrierCapabilities();
@@ -273,6 +313,27 @@ public:
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_VPE;
}
break;
case LOCATION_QWES_FEATURE_TYPE_DGNSS:
if (itr->second) {
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_DGNSS;
} else {
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_DGNSS;
}
break;
case LOCATION_QWES_FEATURE_TYPE_RSSI_POSITIONING:
if (itr->second) {
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING;
} else {
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING;
}
break;
case LOCATION_QWES_FEATURE_TYPE_RTT_POSITIONING:
if (itr->second) {
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING;
} else {
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING;
}
break;
}
}
@@ -310,7 +371,19 @@ public:
return (ContextBase::sQwesFeatureMask);
}
/*
set HW feature status info
*/
static inline void setHwCapabilities(const LocationHwCapabilitiesMask& mask) {
sHwCapabilitiesMask |= mask;
}
/*
get HW feature status info
*/
static inline LocationHwCapabilitiesMask getHwCapabilitiesMask() {
return (ContextBase::sHwCapabilitiesMask);
}
};
struct LocApiResponse: LocMsg {

View File

@@ -33,6 +33,7 @@
#else
#include <unordered_map>
#endif
#include <ContextBase.h>
namespace loc_core {
@@ -148,6 +149,7 @@ typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, boo
// callback function to report back dr and ppe position and sv report
typedef EngineHubProxyBase* (getEngHubProxyFn)(
const MsgTask * msgTask,
const ContextBase * context,
IOsObserver* osObserver,
GnssAdapterReportEnginePositionsEventCb positionEventCb,
GnssAdapterReportSvEventCb svEventCb,

View File

@@ -26,6 +26,43 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_LocAdapterBase"
@@ -322,6 +359,19 @@ LocAdapterBase::getCapabilities()
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_EDGNSS)) {
mask |= LOCATION_CAPABILITIES_EDGNSS_BIT;
}
if ((ContextBase::getQwesFeatureStatus() & LOCATION_CAPABILITIES_QWES_PPE)) {
mask |= LOCATION_CAPABILITIES_QWES_PPE;
}
//Get QWES feature status mask
mask |= ContextBase::getQwesFeatureStatus();
//Get HW feature status mask
LocationHwCapabilitiesMask hwMask = ContextBase::getHwCapabilitiesMask();
if ((hwMask & LOCATION_WIFI_CAPABILITY_RTT) != 0) {
mask |= LOCATION_CAPABILITIES_WIFI_RTT_POSITIONING;
}
if ((hwMask & LOCATION_WIFI_CAPABILITY_RSSI) != 0) {
mask |= LOCATION_CAPABILITIES_WIFI_RSSI_POSITIONING;
}
} else {
LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__);
}

View File

@@ -489,6 +489,8 @@ void LocApiBase::reportQwesCapabilities
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap
)
{
//Set Qwes feature status map in ContextBase
ContextBase::setQwesFeatureStatus(featureMap);
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportQwesCapabilities(featureMap));
}
@@ -1034,7 +1036,7 @@ bool ElapsedRealtimeEstimator::getCurrentTime(
struct timespec sinceBootTime;
struct timespec sinceBootTimeTest;
bool clockGetTimeSuccess = false;
const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 15000;
const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 2000000; // 2 milli-seconds
const uint32_t MAX_GET_TIME_COUNT = 20;
/* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption
or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */

View File

@@ -26,6 +26,44 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LOC_API_BASE_H
#define LOC_API_BASE_H
@@ -101,6 +139,9 @@ public:
inline virtual void* getSibling2() { return NULL; }
inline virtual double getGloRfLoss(uint32_t left __unused,
uint32_t center __unused, uint32_t right __unused, uint8_t gloFrequency __unused) { return 0.0; }
inline virtual float getGeoidalSeparation(double latitude __unused, double longitude __unused) { return 0.0; }
inline virtual bool checkFeatureStatus(int* fids __unused, LocFeatureStatus* status __unused,
uint32_t idCount __unused, bool directQwesCall __unused = false) {return false;}
};
class LocApiBase {
@@ -135,14 +176,17 @@ protected:
}
bool isInSession();
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
bool isMaster();
public:
bool isMaster();
inline void sendMsg(const LocMsg* msg) const {
if (nullptr != mMsgTask) {
mMsgTask->sendMsg(msg);
}
}
inline MsgTask* getMsgTask() const {
return mMsgTask;
}
inline void destroy() {
close();
struct LocKillMsg : public LocMsg {

View File

@@ -22,7 +22,8 @@ libloc_core_la_h_sources = \
EngineHubProxyBase.h \
data-items/DataItemId.h \
data-items/IDataItemCore.h \
data-items/DataItemConcreteTypesBase.h \
data-items/DataItemConcreteTypes.h \
data-items/DataItemsFactoryProxy.h \
observer/IDataItemObserver.h \
observer/IDataItemSubscription.h \
observer/IFrameworkActionReq.h \
@@ -37,6 +38,7 @@ libloc_core_la_c_sources = \
LocContext.cpp \
loc_core_log.cpp \
data-items/DataItemsFactoryProxy.cpp \
data-items/DataItemConcreteTypes.cpp \
SystemStatusOsObserver.cpp \
SystemStatus.cpp

View File

@@ -26,6 +26,43 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define LOG_TAG "LocSvc_SystemStatus"
#include <inttypes.h>
@@ -40,7 +77,7 @@
#include <DataItemsFactoryProxy.h>
#include <SystemStatus.h>
#include <SystemStatusOsObserver.h>
#include <DataItemConcreteTypesBase.h>
#include <DataItemConcreteTypes.h>
namespace loc_core
{
@@ -748,18 +785,17 @@ SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea
{
}
bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer)
{
if ((mGpsWeek != peer.mGpsWeek) ||
(mGpsTowMs != peer.mGpsTowMs) ||
(mTimeValid != peer.mTimeValid) ||
(mTimeSource != peer.mTimeSource) ||
(mTimeUnc != peer.mTimeUnc) ||
(mClockFreqBias != peer.mClockFreqBias) ||
(mClockFreqBiasUnc != peer.mClockFreqBiasUnc) ||
(mLeapSeconds != peer.mLeapSeconds) ||
(mLeapSecUnc != peer.mLeapSecUnc) ||
(mTimeUncNs != peer.mTimeUncNs)) {
bool SystemStatusTimeAndClock::equals(const SystemStatusItemBase& peer) {
if ((mGpsWeek != ((const SystemStatusTimeAndClock&)peer).mGpsWeek) ||
(mGpsTowMs != ((const SystemStatusTimeAndClock&)peer).mGpsTowMs) ||
(mTimeValid != ((const SystemStatusTimeAndClock&)peer).mTimeValid) ||
(mTimeSource != ((const SystemStatusTimeAndClock&)peer).mTimeSource) ||
(mTimeUnc != ((const SystemStatusTimeAndClock&)peer).mTimeUnc) ||
(mClockFreqBias != ((const SystemStatusTimeAndClock&)peer).mClockFreqBias) ||
(mClockFreqBiasUnc != ((const SystemStatusTimeAndClock&)peer).mClockFreqBiasUnc) ||
(mLeapSeconds != ((const SystemStatusTimeAndClock&)peer).mLeapSeconds) ||
(mLeapSecUnc != ((const SystemStatusTimeAndClock&)peer).mLeapSecUnc) ||
(mTimeUncNs != ((const SystemStatusTimeAndClock&)peer).mTimeUncNs)) {
return false;
}
return true;
@@ -790,9 +826,8 @@ SystemStatusXoState::SystemStatusXoState(const SystemStatusPQWM1& nmea) :
{
}
bool SystemStatusXoState::equals(const SystemStatusXoState& peer)
{
if (mXoState != peer.mXoState) {
bool SystemStatusXoState::equals(const SystemStatusItemBase& peer) {
if (mXoState != ((const SystemStatusXoState&)peer).mXoState) {
return false;
}
return true;
@@ -832,27 +867,26 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea)
{
}
bool SystemStatusRfAndParams::equals(const SystemStatusRfAndParams& peer)
{
if ((mPgaGain != peer.mPgaGain) ||
(mGpsBpAmpI != peer.mGpsBpAmpI) ||
(mGpsBpAmpQ != peer.mGpsBpAmpQ) ||
(mAdcI != peer.mAdcI) ||
(mAdcQ != peer.mAdcQ) ||
(mJammerGps != peer.mJammerGps) ||
(mJammerGlo != peer.mJammerGlo) ||
(mJammerBds != peer.mJammerBds) ||
(mJammerGal != peer.mJammerGal) ||
(mAgcGps != peer.mAgcGps) ||
(mAgcGlo != peer.mAgcGlo) ||
(mAgcBds != peer.mAgcBds) ||
(mAgcGal != peer.mAgcGal) ||
(mGloBpAmpI != peer.mGloBpAmpI) ||
(mGloBpAmpQ != peer.mGloBpAmpQ) ||
(mBdsBpAmpI != peer.mBdsBpAmpI) ||
(mBdsBpAmpQ != peer.mBdsBpAmpQ) ||
(mGalBpAmpI != peer.mGalBpAmpI) ||
(mGalBpAmpQ != peer.mGalBpAmpQ)) {
bool SystemStatusRfAndParams::equals(const SystemStatusItemBase& peer) {
if ((mPgaGain != ((const SystemStatusRfAndParams&)peer).mPgaGain) ||
(mGpsBpAmpI != ((const SystemStatusRfAndParams&)peer).mGpsBpAmpI) ||
(mGpsBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGpsBpAmpQ) ||
(mAdcI != ((const SystemStatusRfAndParams&)peer).mAdcI) ||
(mAdcQ != ((const SystemStatusRfAndParams&)peer).mAdcQ) ||
(mJammerGps != ((const SystemStatusRfAndParams&)peer).mJammerGps) ||
(mJammerGlo != ((const SystemStatusRfAndParams&)peer).mJammerGlo) ||
(mJammerBds != ((const SystemStatusRfAndParams&)peer).mJammerBds) ||
(mJammerGal != ((const SystemStatusRfAndParams&)peer).mJammerGal) ||
(mAgcGps != ((const SystemStatusRfAndParams&)peer).mAgcGps) ||
(mAgcGlo != ((const SystemStatusRfAndParams&)peer).mAgcGlo) ||
(mAgcBds != ((const SystemStatusRfAndParams&)peer).mAgcBds) ||
(mAgcGal != ((const SystemStatusRfAndParams&)peer).mAgcGal) ||
(mGloBpAmpI != ((const SystemStatusRfAndParams&)peer).mGloBpAmpI) ||
(mGloBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGloBpAmpQ) ||
(mBdsBpAmpI != ((const SystemStatusRfAndParams&)peer).mBdsBpAmpI) ||
(mBdsBpAmpQ != ((const SystemStatusRfAndParams&)peer).mBdsBpAmpQ) ||
(mGalBpAmpI != ((const SystemStatusRfAndParams&)peer).mGalBpAmpI) ||
(mGalBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGalBpAmpQ)) {
return false;
}
return true;
@@ -888,9 +922,8 @@ SystemStatusErrRecovery::SystemStatusErrRecovery(const SystemStatusPQWM1& nmea)
{
}
bool SystemStatusErrRecovery::equals(const SystemStatusErrRecovery& peer)
{
if (mRecErrorRecovery != peer.mRecErrorRecovery) {
bool SystemStatusErrRecovery::equals(const SystemStatusItemBase& peer) {
if (mRecErrorRecovery != ((const SystemStatusErrRecovery&)peer).mRecErrorRecovery) {
return false;
}
return true;
@@ -918,15 +951,14 @@ SystemStatusInjectedPosition::SystemStatusInjectedPosition(const SystemStatusPQW
{
}
bool SystemStatusInjectedPosition::equals(const SystemStatusInjectedPosition& peer)
{
if ((mEpiValidity != peer.mEpiValidity) ||
(mEpiLat != peer.mEpiLat) ||
(mEpiLon != peer.mEpiLon) ||
(mEpiAlt != peer.mEpiAlt) ||
(mEpiHepe != peer.mEpiHepe) ||
(mEpiAltUnc != peer.mEpiAltUnc) ||
(mEpiSrc != peer.mEpiSrc)) {
bool SystemStatusInjectedPosition::equals(const SystemStatusItemBase& peer) {
if ((mEpiValidity != ((const SystemStatusInjectedPosition&)peer).mEpiValidity) ||
(mEpiLat != ((const SystemStatusInjectedPosition&)peer).mEpiLat) ||
(mEpiLon != ((const SystemStatusInjectedPosition&)peer).mEpiLon) ||
(mEpiAlt != ((const SystemStatusInjectedPosition&)peer).mEpiAlt) ||
(mEpiHepe != ((const SystemStatusInjectedPosition&)peer).mEpiHepe) ||
(mEpiAltUnc != ((const SystemStatusInjectedPosition&)peer).mEpiAltUnc) ||
(mEpiSrc != ((const SystemStatusInjectedPosition&)peer).mEpiSrc)) {
return false;
}
return true;
@@ -959,13 +991,12 @@ SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea
{
}
bool SystemStatusBestPosition::equals(const SystemStatusBestPosition& peer)
{
if ((mBestLat != peer.mBestLat) ||
(mBestLon != peer.mBestLon) ||
(mBestAlt != peer.mBestAlt) ||
(mBestHepe != peer.mBestHepe) ||
(mBestAltUnc != peer.mBestAltUnc)) {
bool SystemStatusBestPosition::equals(const SystemStatusItemBase& peer) {
if ((mBestLat != ((const SystemStatusBestPosition&)peer).mBestLat) ||
(mBestLon != ((const SystemStatusBestPosition&)peer).mBestLon) ||
(mBestAlt != ((const SystemStatusBestPosition&)peer).mBestAlt) ||
(mBestHepe != ((const SystemStatusBestPosition&)peer).mBestHepe) ||
(mBestAltUnc != ((const SystemStatusBestPosition&)peer).mBestAltUnc)) {
return false;
}
return true;
@@ -1003,21 +1034,20 @@ SystemStatusXtra::SystemStatusXtra(const SystemStatusPQWP3& nmea) :
{
}
bool SystemStatusXtra::equals(const SystemStatusXtra& peer)
{
if ((mXtraValidMask != peer.mXtraValidMask) ||
(mGpsXtraAge != peer.mGpsXtraAge) ||
(mGloXtraAge != peer.mGloXtraAge) ||
(mBdsXtraAge != peer.mBdsXtraAge) ||
(mGalXtraAge != peer.mGalXtraAge) ||
(mQzssXtraAge != peer.mQzssXtraAge) ||
(mNavicXtraAge != peer.mNavicXtraAge) ||
(mGpsXtraValid != peer.mGpsXtraValid) ||
(mGloXtraValid != peer.mGloXtraValid) ||
(mBdsXtraValid != peer.mBdsXtraValid) ||
(mGalXtraValid != peer.mGalXtraValid) ||
(mQzssXtraValid != peer.mQzssXtraValid) ||
(mNavicXtraValid != peer.mNavicXtraValid)) {
bool SystemStatusXtra::equals(const SystemStatusItemBase& peer) {
if ((mXtraValidMask != ((const SystemStatusXtra&)peer).mXtraValidMask) ||
(mGpsXtraAge != ((const SystemStatusXtra&)peer).mGpsXtraAge) ||
(mGloXtraAge != ((const SystemStatusXtra&)peer).mGloXtraAge) ||
(mBdsXtraAge != ((const SystemStatusXtra&)peer).mBdsXtraAge) ||
(mGalXtraAge != ((const SystemStatusXtra&)peer).mGalXtraAge) ||
(mQzssXtraAge != ((const SystemStatusXtra&)peer).mQzssXtraAge) ||
(mNavicXtraAge != ((const SystemStatusXtra&)peer).mNavicXtraAge) ||
(mGpsXtraValid != ((const SystemStatusXtra&)peer).mGpsXtraValid) ||
(mGloXtraValid != ((const SystemStatusXtra&)peer).mGloXtraValid) ||
(mBdsXtraValid != ((const SystemStatusXtra&)peer).mBdsXtraValid) ||
(mGalXtraValid != ((const SystemStatusXtra&)peer).mGalXtraValid) ||
(mQzssXtraValid != ((const SystemStatusXtra&)peer).mQzssXtraValid) ||
(mNavicXtraValid != ((const SystemStatusXtra&)peer).mNavicXtraValid)) {
return false;
}
return true;
@@ -1053,13 +1083,12 @@ SystemStatusEphemeris::SystemStatusEphemeris(const SystemStatusPQWP4& nmea) :
{
}
bool SystemStatusEphemeris::equals(const SystemStatusEphemeris& peer)
{
if ((mGpsEpheValid != peer.mGpsEpheValid) ||
(mGloEpheValid != peer.mGloEpheValid) ||
(mBdsEpheValid != peer.mBdsEpheValid) ||
(mGalEpheValid != peer.mGalEpheValid) ||
(mQzssEpheValid != peer.mQzssEpheValid)) {
bool SystemStatusEphemeris::equals(const SystemStatusItemBase& peer) {
if ((mGpsEpheValid != ((const SystemStatusEphemeris&)peer).mGpsEpheValid) ||
(mGloEpheValid != ((const SystemStatusEphemeris&)peer).mGloEpheValid) ||
(mBdsEpheValid != ((const SystemStatusEphemeris&)peer).mBdsEpheValid) ||
(mGalEpheValid != ((const SystemStatusEphemeris&)peer).mGalEpheValid) ||
(mQzssEpheValid != ((const SystemStatusEphemeris&)peer).mQzssEpheValid)) {
return false;
}
return true;
@@ -1102,23 +1131,22 @@ SystemStatusSvHealth::SystemStatusSvHealth(const SystemStatusPQWP5& nmea) :
{
}
bool SystemStatusSvHealth::equals(const SystemStatusSvHealth& peer)
{
if ((mGpsUnknownMask != peer.mGpsUnknownMask) ||
(mGloUnknownMask != peer.mGloUnknownMask) ||
(mBdsUnknownMask != peer.mBdsUnknownMask) ||
(mGalUnknownMask != peer.mGalUnknownMask) ||
(mQzssUnknownMask != peer.mQzssUnknownMask) ||
(mGpsGoodMask != peer.mGpsGoodMask) ||
(mGloGoodMask != peer.mGloGoodMask) ||
(mBdsGoodMask != peer.mBdsGoodMask) ||
(mGalGoodMask != peer.mGalGoodMask) ||
(mQzssGoodMask != peer.mQzssGoodMask) ||
(mGpsBadMask != peer.mGpsBadMask) ||
(mGloBadMask != peer.mGloBadMask) ||
(mBdsBadMask != peer.mBdsBadMask) ||
(mGalBadMask != peer.mGalBadMask) ||
(mQzssBadMask != peer.mQzssBadMask)) {
bool SystemStatusSvHealth::equals(const SystemStatusItemBase& peer) {
if ((mGpsUnknownMask != ((const SystemStatusSvHealth&)peer).mGpsUnknownMask) ||
(mGloUnknownMask != ((const SystemStatusSvHealth&)peer).mGloUnknownMask) ||
(mBdsUnknownMask != ((const SystemStatusSvHealth&)peer).mBdsUnknownMask) ||
(mGalUnknownMask != ((const SystemStatusSvHealth&)peer).mGalUnknownMask) ||
(mQzssUnknownMask != ((const SystemStatusSvHealth&)peer).mQzssUnknownMask) ||
(mGpsGoodMask != ((const SystemStatusSvHealth&)peer).mGpsGoodMask) ||
(mGloGoodMask != ((const SystemStatusSvHealth&)peer).mGloGoodMask) ||
(mBdsGoodMask != ((const SystemStatusSvHealth&)peer).mBdsGoodMask) ||
(mGalGoodMask != ((const SystemStatusSvHealth&)peer).mGalGoodMask) ||
(mQzssGoodMask != ((const SystemStatusSvHealth&)peer).mQzssGoodMask) ||
(mGpsBadMask != ((const SystemStatusSvHealth&)peer).mGpsBadMask) ||
(mGloBadMask != ((const SystemStatusSvHealth&)peer).mGloBadMask) ||
(mBdsBadMask != ((const SystemStatusSvHealth&)peer).mBdsBadMask) ||
(mGalBadMask != ((const SystemStatusSvHealth&)peer).mGalBadMask) ||
(mQzssBadMask != ((const SystemStatusSvHealth&)peer).mQzssBadMask)) {
return false;
}
return true;
@@ -1157,9 +1185,8 @@ SystemStatusPdr::SystemStatusPdr(const SystemStatusPQWP6& nmea) :
{
}
bool SystemStatusPdr::equals(const SystemStatusPdr& peer)
{
if (mFixInfoMask != peer.mFixInfoMask) {
bool SystemStatusPdr::equals(const SystemStatusItemBase& peer) {
if (mFixInfoMask != ((const SystemStatusPdr&)peer).mFixInfoMask) {
return false;
}
return true;
@@ -1183,12 +1210,11 @@ SystemStatusNavData::SystemStatusNavData(const SystemStatusPQWP7& nmea)
}
}
bool SystemStatusNavData::equals(const SystemStatusNavData& peer)
{
bool SystemStatusNavData::equals(const SystemStatusItemBase& peer) {
for (uint32_t i=0; i<SV_ALL_NUM; i++) {
if ((mNav[i].mType != peer.mNav[i].mType) ||
(mNav[i].mSource != peer.mNav[i].mSource) ||
(mNav[i].mAgeSec != peer.mNav[i].mAgeSec)) {
if ((mNav[i].mType != ((const SystemStatusNavData&)peer).mNav[i].mType) ||
(mNav[i].mSource != ((const SystemStatusNavData&)peer).mNav[i].mSource) ||
(mNav[i].mAgeSec != ((const SystemStatusNavData&)peer).mNav[i].mAgeSec)) {
return false;
}
}
@@ -1215,10 +1241,9 @@ SystemStatusPositionFailure::SystemStatusPositionFailure(const SystemStatusPQWS1
{
}
bool SystemStatusPositionFailure::equals(const SystemStatusPositionFailure& peer)
{
if ((mFixInfoMask != peer.mFixInfoMask) ||
(mHepeLimit != peer.mHepeLimit)) {
bool SystemStatusPositionFailure::equals(const SystemStatusItemBase& peer) {
if ((mFixInfoMask != ((const SystemStatusPositionFailure&)peer).mFixInfoMask) ||
(mHepeLimit != ((const SystemStatusPositionFailure&)peer).mHepeLimit)) {
return false;
}
return true;
@@ -1236,11 +1261,13 @@ void SystemStatusPositionFailure::dump()
/******************************************************************************
SystemStatusLocation
******************************************************************************/
bool SystemStatusLocation::equals(const SystemStatusLocation& peer)
{
if ((mLocation.gpsLocation.latitude != peer.mLocation.gpsLocation.latitude) ||
(mLocation.gpsLocation.longitude != peer.mLocation.gpsLocation.longitude) ||
(mLocation.gpsLocation.altitude != peer.mLocation.gpsLocation.altitude)) {
bool SystemStatusLocation::equals(const SystemStatusItemBase& peer) {
if ((mLocation.gpsLocation.latitude !=
((const SystemStatusLocation&)peer).mLocation.gpsLocation.latitude) ||
(mLocation.gpsLocation.longitude !=
((const SystemStatusLocation&)peer).mLocation.gpsLocation.longitude) ||
(mLocation.gpsLocation.altitude !=
((const SystemStatusLocation&)peer).mLocation.gpsLocation.altitude)) {
return false;
}
return true;
@@ -1290,8 +1317,10 @@ void SystemStatus::destroyInstance()
void SystemStatus::resetNetworkInfo() {
for (int i=0; i<mCache.mNetworkInfo.size(); ++i) {
// Reset all the cached NetworkInfo Items as disconnected
eventConnectionStatus(false, mCache.mNetworkInfo[i].mType, mCache.mNetworkInfo[i].mRoaming,
mCache.mNetworkInfo[i].mNetworkHandle, mCache.mNetworkInfo[i].mApn);
eventConnectionStatus(false, mCache.mNetworkInfo[i].mDataItem.mType,
mCache.mNetworkInfo[i].mDataItem.mRoaming,
mCache.mNetworkInfo[i].mDataItem.mNetworkHandle,
mCache.mNetworkInfo[i].mDataItem.mApn);
}
}
@@ -1496,91 +1525,109 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem)
{
case AIRPLANEMODE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mAirplaneMode,
SystemStatusAirplaneMode(*(static_cast<AirplaneModeDataItemBase*>(dataitem))));
SystemStatusAirplaneMode(*(static_cast<AirplaneModeDataItem*>(dataitem))));
break;
case ENH_DATA_ITEM_ID:
ret = setIteminReport(mCache.mENH,
SystemStatusENH(*(static_cast<ENHDataItemBase*>(dataitem))));
SystemStatusENH(*(static_cast<ENHDataItem*>(dataitem))));
break;
case GPSSTATE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mGPSState,
SystemStatusGpsState(*(static_cast<GPSStateDataItemBase*>(dataitem))));
SystemStatusGpsState(*(static_cast<GPSStateDataItem*>(dataitem))));
break;
case NLPSTATUS_DATA_ITEM_ID:
ret = setIteminReport(mCache.mNLPStatus,
SystemStatusNLPStatus(*(static_cast<NLPStatusDataItemBase*>(dataitem))));
SystemStatusNLPStatus(*(static_cast<NLPStatusDataItem*>(dataitem))));
break;
case WIFIHARDWARESTATE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mWifiHardwareState,
SystemStatusWifiHardwareState(*(static_cast<WifiHardwareStateDataItemBase*>(dataitem))));
ret = setIteminReport(mCache.mWifiHardwareState, SystemStatusWifiHardwareState(
*(static_cast<WifiHardwareStateDataItem*>(dataitem))));
break;
case NETWORKINFO_DATA_ITEM_ID:
ret = setIteminReport(mCache.mNetworkInfo,
SystemStatusNetworkInfo(*(static_cast<NetworkInfoDataItemBase*>(dataitem))));
SystemStatusNetworkInfo(*(static_cast<NetworkInfoDataItem*>(dataitem))));
// Update latest mAllTypes/mAllNetworkHandles of original obj to notify clients
if (ret) {
(static_cast<NetworkInfoDataItem*>(dataitem))->mAllTypes =
mCache.mNetworkInfo.back().mDataItem.mAllTypes;
memcpy((static_cast<NetworkInfoDataItem*>(dataitem))->mAllNetworkHandles,
mCache.mNetworkInfo.back().mDataItem.mAllNetworkHandles, sizeof((
static_cast<NetworkInfoDataItem*>(dataitem))->mAllNetworkHandles));
}
break;
case RILSERVICEINFO_DATA_ITEM_ID:
ret = setIteminReport(mCache.mRilServiceInfo,
SystemStatusServiceInfo(*(static_cast<RilServiceInfoDataItemBase*>(dataitem))));
SystemStatusServiceInfo(*(static_cast<RilServiceInfoDataItem*>(dataitem))));
break;
case RILCELLINFO_DATA_ITEM_ID:
ret = setIteminReport(mCache.mRilCellInfo,
SystemStatusRilCellInfo(*(static_cast<RilCellInfoDataItemBase*>(dataitem))));
SystemStatusRilCellInfo(*(static_cast<RilCellInfoDataItem*>(dataitem))));
break;
case SERVICESTATUS_DATA_ITEM_ID:
ret = setIteminReport(mCache.mServiceStatus,
SystemStatusServiceStatus(*(static_cast<ServiceStatusDataItemBase*>(dataitem))));
SystemStatusServiceStatus(*(static_cast<ServiceStatusDataItem*>(dataitem))));
break;
case MODEL_DATA_ITEM_ID:
ret = setIteminReport(mCache.mModel,
SystemStatusModel(*(static_cast<ModelDataItemBase*>(dataitem))));
SystemStatusModel(*(static_cast<ModelDataItem*>(dataitem))));
break;
case MANUFACTURER_DATA_ITEM_ID:
ret = setIteminReport(mCache.mManufacturer,
SystemStatusManufacturer(*(static_cast<ManufacturerDataItemBase*>(dataitem))));
SystemStatusManufacturer(*(static_cast<ManufacturerDataItem*>(dataitem))));
break;
case IN_EMERGENCY_CALL_DATA_ITEM_ID:
ret = setIteminReport(mCache.mInEmergencyCall,
SystemStatusInEmergencyCall(
*(static_cast<InEmergencyCallDataItem*>(dataitem))));
break;
case ASSISTED_GPS_DATA_ITEM_ID:
ret = setIteminReport(mCache.mAssistedGps,
SystemStatusAssistedGps(*(static_cast<AssistedGpsDataItemBase*>(dataitem))));
SystemStatusAssistedGps(*(static_cast<AssistedGpsDataItem*>(dataitem))));
break;
case SCREEN_STATE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mScreenState,
SystemStatusScreenState(*(static_cast<ScreenStateDataItemBase*>(dataitem))));
SystemStatusScreenState(*(static_cast<ScreenStateDataItem*>(dataitem))));
break;
case POWER_CONNECTED_STATE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mPowerConnectState,
SystemStatusPowerConnectState(*(static_cast<PowerConnectStateDataItemBase*>(dataitem))));
ret = setIteminReport(mCache.mPowerConnectState, SystemStatusPowerConnectState(
*(static_cast<PowerConnectStateDataItem*>(dataitem))));
break;
case TIMEZONE_CHANGE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mTimeZoneChange,
SystemStatusTimeZoneChange(*(static_cast<TimeZoneChangeDataItemBase*>(dataitem))));
SystemStatusTimeZoneChange(*(static_cast<TimeZoneChangeDataItem*>(dataitem))));
break;
case TIME_CHANGE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mTimeChange,
SystemStatusTimeChange(*(static_cast<TimeChangeDataItemBase*>(dataitem))));
SystemStatusTimeChange(*(static_cast<TimeChangeDataItem*>(dataitem))));
break;
case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID:
ret = setIteminReport(mCache.mWifiSupplicantStatus,
SystemStatusWifiSupplicantStatus(*(static_cast<WifiSupplicantStatusDataItemBase*>(dataitem))));
ret = setIteminReport(mCache.mWifiSupplicantStatus, SystemStatusWifiSupplicantStatus(
*(static_cast<WifiSupplicantStatusDataItem*>(dataitem))));
break;
case SHUTDOWN_STATE_DATA_ITEM_ID:
ret = setIteminReport(mCache.mShutdownState,
SystemStatusShutdownState(*(static_cast<ShutdownStateDataItemBase*>(dataitem))));
SystemStatusShutdownState(*(static_cast<ShutdownStateDataItem*>(dataitem))));
break;
case TAC_DATA_ITEM_ID:
ret = setIteminReport(mCache.mTac,
SystemStatusTac(*(static_cast<TacDataItemBase*>(dataitem))));
SystemStatusTac(*(static_cast<TacDataItem*>(dataitem))));
break;
case MCCMNC_DATA_ITEM_ID:
ret = setIteminReport(mCache.mMccMnc,
SystemStatusMccMnc(*(static_cast<MccmncDataItemBase*>(dataitem))));
SystemStatusMccMnc(*(static_cast<MccmncDataItem*>(dataitem))));
break;
case BTLE_SCAN_DATA_ITEM_ID:
ret = setIteminReport(mCache.mBtDeviceScanDetail,
SystemStatusBtDeviceScanDetail(*(static_cast<BtDeviceScanDetailsDataItemBase*>(dataitem))));
ret = setIteminReport(mCache.mBtDeviceScanDetail, SystemStatusBtDeviceScanDetail(
*(static_cast<BtDeviceScanDetailsDataItem*>(dataitem))));
break;
case BT_SCAN_DATA_ITEM_ID:
ret = setIteminReport(mCache.mBtLeDeviceScanDetail,
SystemStatusBtleDeviceScanDetail(*(static_cast<BtLeDeviceScanDetailsDataItemBase*>(dataitem))));
ret = setIteminReport(mCache.mBtLeDeviceScanDetail, SystemStatusBtleDeviceScanDetail(
*(static_cast<BtLeDeviceScanDetailsDataItem*>(dataitem))));
break;
case LOC_FEATURE_STATUS_DATA_ITEM_ID:
ret = setIteminReport(mCache.mLocFeatureStatus,
SystemStatusLocFeatureStatus(
*(static_cast<LocFeatureStatusDataItem*>(dataitem))));
break;
default:
break;
@@ -1739,7 +1786,7 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type,
// send networkinof dataitem to systemstatus observer clients
SystemStatusNetworkInfo s(type, "", "", connected, roaming,
(uint64_t) networkHandle, apn);
mSysStatusObsvr.notify({&s});
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
@@ -1754,7 +1801,62 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type,
bool SystemStatus::updatePowerConnectState(bool charging)
{
SystemStatusPowerConnectState s(charging);
mSysStatusObsvr.notify({&s});
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
/******************************************************************************
@brief API to update ENH
@param[In] user consent
@return true when successfully done
******************************************************************************/
bool SystemStatus::eventOptInStatus(bool userConsent)
{
SystemStatusENH s(userConsent, ENHDataItem::FIELD_CONSENT);
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
/******************************************************************************
@brief API to update Region
@param[In] region
@return true when successfully done
******************************************************************************/
bool SystemStatus::eventRegionStatus(bool region)
{
SystemStatusENH s(region, ENHDataItem::FIELD_REGION);
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
/******************************************************************************
@brief API to update Location feature QWES status
@param[In] Location feature QWES status
@return true when successfully done
******************************************************************************/
bool SystemStatus::eventLocFeatureStatus(std::unordered_set<int> fids) {
SystemStatusLocFeatureStatus s(fids);
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
/******************************************************************************
@brief API to notify emergency call
@param[In] is emergency call
@return true when successfully done
******************************************************************************/
bool SystemStatus::eventInEmergencyCall(bool isEmergency)
{
SystemStatusInEmergencyCall s(isEmergency);
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
} // namespace loc_core

View File

@@ -26,6 +26,43 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __SYSTEM_STATUS__
#define __SYSTEM_STATUS__
@@ -39,7 +76,7 @@
#include <MsgTask.h>
#include <IDataItemCore.h>
#include <IOsObserver.h>
#include <DataItemConcreteTypesBase.h>
#include <DataItemConcreteTypes.h>
#include <SystemStatusOsObserver.h>
#include <gps_extended_c.h>
@@ -88,6 +125,7 @@ public:
}
virtual void dump(void) {};
inline virtual bool ignore() { return false; };
virtual bool equals(const SystemStatusItemBase& peer __unused) { return false; }
};
class SystemStatusLocation : public SystemStatusItemBase
@@ -103,7 +141,7 @@ public:
mValid(true),
mLocation(location),
mLocationEx(locationEx) {}
bool equals(const SystemStatusLocation& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -133,7 +171,7 @@ public:
mLeapSecUnc(0),
mTimeUncNs(0ULL) {}
inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea);
bool equals(const SystemStatusTimeAndClock& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -144,7 +182,7 @@ public:
inline SystemStatusXoState() :
mXoState(0) {}
inline SystemStatusXoState(const SystemStatusPQWM1& nmea);
bool equals(const SystemStatusXoState& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -191,7 +229,7 @@ public:
mGalBpAmpI(0),
mGalBpAmpQ(0) {}
inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea);
bool equals(const SystemStatusRfAndParams& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -202,7 +240,7 @@ public:
inline SystemStatusErrRecovery() :
mRecErrorRecovery(0) {};
inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea);
bool equals(const SystemStatusErrRecovery& peer);
bool equals(const SystemStatusItemBase& peer) override;
inline bool ignore() override { return 0 == mRecErrorRecovery; };
void dump(void) override;
};
@@ -227,7 +265,7 @@ public:
mEpiAltUnc(0),
mEpiSrc(0) {}
inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea);
bool equals(const SystemStatusInjectedPosition& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -249,7 +287,7 @@ public:
mBestHepe(0),
mBestAltUnc(0) {}
inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea);
bool equals(const SystemStatusBestPosition& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -285,7 +323,7 @@ public:
mQzssXtraValid(0),
mNavicXtraValid(0) {}
inline SystemStatusXtra(const SystemStatusPQWP3& nmea);
bool equals(const SystemStatusXtra& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -305,7 +343,7 @@ public:
mGalEpheValid(0ULL),
mQzssEpheValid(0) {}
inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea);
bool equals(const SystemStatusEphemeris& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -351,7 +389,7 @@ public:
mQzssBadMask(0),
mNavicBadMask(0) {}
inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea);
bool equals(const SystemStatusSvHealth& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -363,7 +401,7 @@ public:
inline SystemStatusPdr() :
mFixInfoMask(0) {}
inline SystemStatusPdr(const SystemStatusPQWP6& nmea);
bool equals(const SystemStatusPdr& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -387,7 +425,7 @@ public:
}
}
inline SystemStatusNavData(const SystemStatusPQWP7& nmea);
bool equals(const SystemStatusNavData& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
@@ -401,153 +439,139 @@ public:
mFixInfoMask(0),
mHepeLimit(0) {}
inline SystemStatusPositionFailure(const SystemStatusPQWS1& nmea);
bool equals(const SystemStatusPositionFailure& peer);
bool equals(const SystemStatusItemBase& peer) override;
void dump(void) override;
};
/******************************************************************************
SystemStatus report data structure - from DataItem observer
******************************************************************************/
class SystemStatusAirplaneMode : public SystemStatusItemBase,
public AirplaneModeDataItemBase
{
class SystemStatusAirplaneMode : public SystemStatusItemBase {
public:
inline SystemStatusAirplaneMode(bool mode=false) :
AirplaneModeDataItemBase(mode) {}
inline SystemStatusAirplaneMode(const AirplaneModeDataItemBase& itemBase) :
AirplaneModeDataItemBase(itemBase) {}
inline bool equals(const SystemStatusAirplaneMode& peer) {
return (mMode == peer.mMode);
AirplaneModeDataItem mDataItem;
inline SystemStatusAirplaneMode(bool mode=false): mDataItem(mode) {}
inline SystemStatusAirplaneMode(const AirplaneModeDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mMode == ((const SystemStatusAirplaneMode&)peer).mDataItem.mMode;
}
};
class SystemStatusENH : public SystemStatusItemBase,
public ENHDataItemBase
{
class SystemStatusENH : public SystemStatusItemBase {
public:
inline SystemStatusENH(bool enabled=false) :
ENHDataItemBase(enabled) {}
inline SystemStatusENH(const ENHDataItemBase& itemBase) :
ENHDataItemBase(itemBase) {}
inline bool equals(const SystemStatusENH& peer) {
return (mEnabled == peer.mEnabled);
ENHDataItem mDataItem;
inline SystemStatusENH(bool enabled, ENHDataItem::Fields updateBit = ENHDataItem::FIELD_MAX):
mDataItem(enabled, updateBit) {}
inline SystemStatusENH(const ENHDataItem& itemBase): mDataItem(itemBase) {}
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& peer) {
mDataItem.mEnhFields = ((const SystemStatusENH&)peer).mDataItem.mEnhFields;
mDataItem.updateFields();
return *this;
}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mEnhFields == ((const SystemStatusENH&)peer).mDataItem.mEnhFields;
}
};
class SystemStatusGpsState : public SystemStatusItemBase,
public GPSStateDataItemBase
{
class SystemStatusGpsState : public SystemStatusItemBase {
public:
inline SystemStatusGpsState(bool enabled=false) :
GPSStateDataItemBase(enabled) {}
inline SystemStatusGpsState(const GPSStateDataItemBase& itemBase) :
GPSStateDataItemBase(itemBase) {}
inline bool equals(const SystemStatusGpsState& peer) {
return (mEnabled == peer.mEnabled);
GPSStateDataItem mDataItem;
inline SystemStatusGpsState(bool enabled=false): mDataItem(enabled) {}
inline SystemStatusGpsState(const GPSStateDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mEnabled == ((const SystemStatusGpsState&)peer).mDataItem.mEnabled;
}
inline void dump(void) override {
LOC_LOGD("GpsState: state=%u", mEnabled);
LOC_LOGD("GpsState: state=%u", mDataItem.mEnabled);
}
};
class SystemStatusNLPStatus : public SystemStatusItemBase,
public NLPStatusDataItemBase
{
class SystemStatusNLPStatus : public SystemStatusItemBase {
public:
inline SystemStatusNLPStatus(bool enabled=false) :
NLPStatusDataItemBase(enabled) {}
inline SystemStatusNLPStatus(const NLPStatusDataItemBase& itemBase) :
NLPStatusDataItemBase(itemBase) {}
inline bool equals(const SystemStatusNLPStatus& peer) {
return (mEnabled == peer.mEnabled);
NLPStatusDataItem mDataItem;
inline SystemStatusNLPStatus(bool enabled=false): mDataItem(enabled) {}
inline SystemStatusNLPStatus(const NLPStatusDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mEnabled == ((const SystemStatusNLPStatus&)peer).mDataItem.mEnabled;
}
};
class SystemStatusWifiHardwareState : public SystemStatusItemBase,
public WifiHardwareStateDataItemBase
{
class SystemStatusWifiHardwareState : public SystemStatusItemBase {
public:
inline SystemStatusWifiHardwareState(bool enabled=false) :
WifiHardwareStateDataItemBase(enabled) {}
inline SystemStatusWifiHardwareState(const WifiHardwareStateDataItemBase& itemBase) :
WifiHardwareStateDataItemBase(itemBase) {}
inline bool equals(const SystemStatusWifiHardwareState& peer) {
return (mEnabled == peer.mEnabled);
WifiHardwareStateDataItem mDataItem;
inline SystemStatusWifiHardwareState(bool enabled=false): mDataItem(enabled) {}
inline SystemStatusWifiHardwareState(const WifiHardwareStateDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mEnabled == ((const SystemStatusWifiHardwareState&)peer).mDataItem.mEnabled;
}
};
class SystemStatusNetworkInfo : public SystemStatusItemBase,
public NetworkInfoDataItemBase
{
NetworkInfoDataItemBase* mSrcObjPtr;
class SystemStatusNetworkInfo : public SystemStatusItemBase {
public:
inline SystemStatusNetworkInfo(
int32_t type = 0,
std::string typeName = "",
string subTypeName = "",
bool connected = false,
bool roaming = false,
uint64_t networkHandle = NETWORK_HANDLE_UNKNOWN,
string apn = "") :
NetworkInfoDataItemBase(
(NetworkType)type,
type,
typeName,
subTypeName,
connected && (!roaming),
connected,
roaming,
networkHandle, apn),
mSrcObjPtr(nullptr) {}
inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) :
NetworkInfoDataItemBase(itemBase),
mSrcObjPtr((NetworkInfoDataItemBase*)&itemBase) {
mType = (int32_t)itemBase.getType();
}
inline bool equals(const SystemStatusNetworkInfo& peer) {
bool rtv = (peer.mConnected == mConnected);
NetworkInfoDataItem mDataItem;
inline SystemStatusNetworkInfo(int32_t type=0, std::string typeName="", string subTypeName="",
bool connected=false, bool roaming=false,
uint64_t networkHandle=NETWORK_HANDLE_UNKNOWN, string apn = "") :
mDataItem((NetworkType)type, type, typeName,
subTypeName, connected && (!roaming), connected, roaming, networkHandle,
apn) {}
inline SystemStatusNetworkInfo(const NetworkInfoDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
const NetworkInfoDataItem peerDI = ((const SystemStatusNetworkInfo&)peer).mDataItem;
bool rtv = (mDataItem.mAllTypes == peerDI.mAllTypes) &&
(mDataItem.mConnected == peerDI.mConnected);
for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) {
rtv &= (mAllNetworkHandles[i] == peer.mAllNetworkHandles[i]);
rtv = (mDataItem.mAllNetworkHandles[i] == peerDI.mAllNetworkHandles[i]) && rtv;
}
return rtv && !peer.mApn.compare(mApn);
rtv = rtv && !peerDI.mApn.compare(mDataItem.mApn);
LOC_LOGv("NetworkInfoDataItem quals: %d", rtv);
return rtv;
}
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
LOC_LOGv("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s",
mAllTypes, mConnected, mType, mApn.c_str());
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;
string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mApn;
mDataItem.mAllTypes, mDataItem.mConnected, mDataItem.mType,
mDataItem.mApn.c_str());
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mDataItem.mAllTypes;
string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mDataItem.mApn;
// Replace current with cached table for now and then update
memcpy(mAllNetworkHandles,
(static_cast<SystemStatusNetworkInfo&>(curInfo)).getNetworkHandle(),
sizeof(mAllNetworkHandles));
// Update the apn for non-mobile type connections.
if (TYPE_MOBILE != mType && apn.compare("") != 0) {
mApn = apn;
}
if (mConnected) {
mAllTypes |= allTypes;
memcpy(mDataItem.mAllNetworkHandles,
static_cast<SystemStatusNetworkInfo&>(curInfo).mDataItem.getNetworkHandle(),
sizeof(mDataItem.mAllNetworkHandles));
// Update the apn for non-mobile type connections.
if (TYPE_MOBILE != mDataItem.mType && apn.compare("") != 0) {
mDataItem.mApn = apn;
}
if (mDataItem.mConnected) {
mDataItem.mAllTypes |= allTypes;
for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
if (mNetworkHandle == mAllNetworkHandles[i].networkHandle) {
if (mDataItem.mNetworkHandle ==
mDataItem.mAllNetworkHandles[i].networkHandle) {
LOC_LOGD("collate duplicate detected, not updating");
break;
}
if (NETWORK_HANDLE_UNKNOWN == mAllNetworkHandles[i].networkHandle) {
mAllNetworkHandles[i].networkHandle = mNetworkHandle;
mAllNetworkHandles[i].networkType = (loc_core::NetworkType) mType;
if (NETWORK_HANDLE_UNKNOWN ==
mDataItem.mAllNetworkHandles[i].networkHandle) {
mDataItem.mAllNetworkHandles[i].networkHandle =
mDataItem.mNetworkHandle;
mDataItem.mAllNetworkHandles[i].networkType =
(loc_core::NetworkType) mDataItem.mType;
break;
}
}
} else if (0 != mAllTypes) {
} else if (0 != mDataItem.mAllTypes) {
uint8_t deletedIndex = MAX_NETWORK_HANDLES;
uint8_t lastValidIndex = 0;
uint8_t typeCount = 0;
for (; lastValidIndex < MAX_NETWORK_HANDLES &&
NETWORK_HANDLE_UNKNOWN != mAllNetworkHandles[lastValidIndex].networkHandle;
for (; lastValidIndex < MAX_NETWORK_HANDLES && NETWORK_HANDLE_UNKNOWN !=
mDataItem.mAllNetworkHandles[lastValidIndex].networkHandle;
++lastValidIndex) {
// Maintain count for number of network handles still
// connected for given type
if (mType == (int32_t)mAllNetworkHandles[lastValidIndex].networkType) {
if (mNetworkHandle == mAllNetworkHandles[lastValidIndex].networkHandle) {
if (mDataItem.mType ==
mDataItem.mAllNetworkHandles[lastValidIndex].networkType) {
if (mDataItem.mNetworkHandle ==
mDataItem.mAllNetworkHandles[lastValidIndex].networkHandle) {
deletedIndex = lastValidIndex;
} else {
typeCount++;
@@ -562,264 +586,273 @@ public:
if (MAX_NETWORK_HANDLES != deletedIndex) {
LOC_LOGd("deletedIndex:%u, lastValidIndex:%u, typeCount:%u",
deletedIndex, lastValidIndex, typeCount);
mAllNetworkHandles[deletedIndex] = mAllNetworkHandles[lastValidIndex];
mAllNetworkHandles[lastValidIndex].networkHandle = NETWORK_HANDLE_UNKNOWN;
mAllNetworkHandles[lastValidIndex].networkType = TYPE_UNKNOWN;
mDataItem.mAllNetworkHandles[deletedIndex] =
mDataItem.mAllNetworkHandles[lastValidIndex];
mDataItem.mAllNetworkHandles[lastValidIndex].networkHandle =
NETWORK_HANDLE_UNKNOWN;
mDataItem.mAllNetworkHandles[lastValidIndex].networkType = TYPE_UNKNOWN;
}
// If no more handles of given type, set bitmask
if (0 == typeCount) {
mAllTypes = (allTypes & (~mAllTypes));
LOC_LOGD("mAllTypes:%" PRIx64, mAllTypes);
mDataItem.mAllTypes = (allTypes & (~mDataItem.mAllTypes));
LOC_LOGD("mAllTypes:%" PRIx64, mDataItem.mAllTypes);
}
} // else (mConnected == false && mAllTypes == 0)
// we keep mAllTypes as 0, which means no more connections.
if (nullptr != mSrcObjPtr) {
// this is critical, changing mAllTypes of the original obj
mSrcObjPtr->mAllTypes = mAllTypes;
memcpy(mSrcObjPtr->mAllNetworkHandles,
mAllNetworkHandles,
sizeof(mSrcObjPtr->mAllNetworkHandles));
}
} // else (mDataItem.mConnected == false && mDataItem.mAllTypes == 0)
// we keep mDataItem->mAllTypes as 0, which means no more connections.
return *this;
}
inline void dump(void) override {
LOC_LOGD("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s",
mAllTypes, mConnected, mType, mApn.c_str());
mDataItem.mAllTypes, mDataItem.mConnected, mDataItem.mType, mDataItem.mApn.c_str());
}
};
class SystemStatusServiceInfo : public SystemStatusItemBase,
public RilServiceInfoDataItemBase
{
class SystemStatusServiceInfo : public SystemStatusItemBase {
public:
inline SystemStatusServiceInfo() :
RilServiceInfoDataItemBase() {}
inline SystemStatusServiceInfo(const RilServiceInfoDataItemBase& itemBase) :
RilServiceInfoDataItemBase(itemBase) {}
inline bool equals(const SystemStatusServiceInfo& peer) {
return static_cast<const RilServiceInfoDataItemBase&>(peer) ==
static_cast<const RilServiceInfoDataItemBase&>(*this);
RilServiceInfoDataItem mDataItem;
inline SystemStatusServiceInfo(): mDataItem() {}
inline SystemStatusServiceInfo(const RilServiceInfoDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return ((const SystemStatusServiceInfo&)peer).mDataItem == mDataItem;
}
};
class SystemStatusRilCellInfo : public SystemStatusItemBase,
public RilCellInfoDataItemBase
{
class SystemStatusRilCellInfo : public SystemStatusItemBase {
public:
inline SystemStatusRilCellInfo() :
RilCellInfoDataItemBase() {}
inline SystemStatusRilCellInfo(const RilCellInfoDataItemBase& itemBase) :
RilCellInfoDataItemBase(itemBase) {}
inline bool equals(const SystemStatusRilCellInfo& peer) {
return static_cast<const RilCellInfoDataItemBase&>(peer) ==
static_cast<const RilCellInfoDataItemBase&>(*this);
RilCellInfoDataItem mDataItem;
inline SystemStatusRilCellInfo(): mDataItem() {}
inline SystemStatusRilCellInfo(const RilCellInfoDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return ((const SystemStatusRilCellInfo&)peer).mDataItem == mDataItem;
}
};
class SystemStatusServiceStatus : public SystemStatusItemBase,
public ServiceStatusDataItemBase
{
class SystemStatusServiceStatus : public SystemStatusItemBase {
public:
inline SystemStatusServiceStatus(int32_t mServiceState=0) :
ServiceStatusDataItemBase(mServiceState) {}
inline SystemStatusServiceStatus(const ServiceStatusDataItemBase& itemBase) :
ServiceStatusDataItemBase(itemBase) {}
inline bool equals(const SystemStatusServiceStatus& peer) {
return (mServiceState == peer.mServiceState);
ServiceStatusDataItem mDataItem;
inline SystemStatusServiceStatus(int32_t mServiceState=0): mDataItem(mServiceState) {}
inline SystemStatusServiceStatus(const ServiceStatusDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mServiceState ==
((const SystemStatusServiceStatus&)peer).mDataItem.mServiceState;
}
};
class SystemStatusModel : public SystemStatusItemBase,
public ModelDataItemBase
{
class SystemStatusModel : public SystemStatusItemBase {
public:
inline SystemStatusModel(string name="") :
ModelDataItemBase(name) {}
inline SystemStatusModel(const ModelDataItemBase& itemBase) :
ModelDataItemBase(itemBase) {}
inline bool equals(const SystemStatusModel& peer) {
return (mModel == peer.mModel);
}
};
class SystemStatusManufacturer : public SystemStatusItemBase,
public ManufacturerDataItemBase
{
public:
inline SystemStatusManufacturer(string name="") :
ManufacturerDataItemBase(name) {}
inline SystemStatusManufacturer(const ManufacturerDataItemBase& itemBase) :
ManufacturerDataItemBase(itemBase) {}
inline bool equals(const SystemStatusManufacturer& peer) {
return (mManufacturer == peer.mManufacturer);
ModelDataItem mDataItem;
inline SystemStatusModel(string name=""): mDataItem(name) {}
inline SystemStatusModel(const ModelDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mModel == ((const SystemStatusModel&)peer).mDataItem.mModel;
}
};
class SystemStatusAssistedGps : public SystemStatusItemBase,
public AssistedGpsDataItemBase
{
class SystemStatusManufacturer : public SystemStatusItemBase {
public:
inline SystemStatusAssistedGps(bool enabled=false) :
AssistedGpsDataItemBase(enabled) {}
inline SystemStatusAssistedGps(const AssistedGpsDataItemBase& itemBase) :
AssistedGpsDataItemBase(itemBase) {}
inline bool equals(const SystemStatusAssistedGps& peer) {
return (mEnabled == peer.mEnabled);
ManufacturerDataItem mDataItem;
inline SystemStatusManufacturer(string name=""): mDataItem(name) {}
inline SystemStatusManufacturer(const ManufacturerDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mManufacturer ==
((const SystemStatusManufacturer&)peer).mDataItem.mManufacturer;
}
};
class SystemStatusScreenState : public SystemStatusItemBase,
public ScreenStateDataItemBase
{
class SystemStatusAssistedGps : public SystemStatusItemBase {
public:
inline SystemStatusScreenState(bool state=false) :
ScreenStateDataItemBase(state) {}
inline SystemStatusScreenState(const ScreenStateDataItemBase& itemBase) :
ScreenStateDataItemBase(itemBase) {}
inline bool equals(const SystemStatusScreenState& peer) {
return (mState == peer.mState);
AssistedGpsDataItem mDataItem;
inline SystemStatusAssistedGps(bool enabled=false): mDataItem(enabled) {}
inline SystemStatusAssistedGps(const AssistedGpsDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mEnabled == ((const SystemStatusAssistedGps&)peer).mDataItem.mEnabled;
}
};
class SystemStatusPowerConnectState : public SystemStatusItemBase,
public PowerConnectStateDataItemBase
{
class SystemStatusScreenState : public SystemStatusItemBase {
public:
inline SystemStatusPowerConnectState(bool state=false) :
PowerConnectStateDataItemBase(state) {}
inline SystemStatusPowerConnectState(const PowerConnectStateDataItemBase& itemBase) :
PowerConnectStateDataItemBase(itemBase) {}
inline bool equals(const SystemStatusPowerConnectState& peer) {
return (mState == peer.mState);
ScreenStateDataItem mDataItem;
inline SystemStatusScreenState(bool state=false): mDataItem(state) {}
inline SystemStatusScreenState(const ScreenStateDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mState == ((const SystemStatusScreenState&)peer).mDataItem.mState;
}
};
class SystemStatusTimeZoneChange : public SystemStatusItemBase,
public TimeZoneChangeDataItemBase
{
class SystemStatusPowerConnectState : public SystemStatusItemBase {
public:
inline SystemStatusTimeZoneChange(
int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) :
TimeZoneChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {}
inline SystemStatusTimeZoneChange(const TimeZoneChangeDataItemBase& itemBase) :
TimeZoneChangeDataItemBase(itemBase) {}
inline bool equals(const SystemStatusTimeZoneChange& peer) {
return ((mCurrTimeMillis == peer.mCurrTimeMillis) &&
(mRawOffsetTZ == peer.mRawOffsetTZ) &&
(mDstOffsetTZ == peer.mDstOffsetTZ));
PowerConnectStateDataItem mDataItem;
inline SystemStatusPowerConnectState(bool state=false): mDataItem(state) {}
inline SystemStatusPowerConnectState(const PowerConnectStateDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mState == ((const SystemStatusPowerConnectState&)peer).mDataItem.mState;
}
};
class SystemStatusTimeChange : public SystemStatusItemBase,
public TimeChangeDataItemBase
{
class SystemStatusTimeZoneChange : public SystemStatusItemBase {
public:
TimeZoneChangeDataItem mDataItem;
inline SystemStatusTimeZoneChange(int64_t currTimeMillis=0ULL, int32_t rawOffset=0,
int32_t dstOffset=0): mDataItem(currTimeMillis, rawOffset, dstOffset) {}
inline SystemStatusTimeZoneChange(const TimeZoneChangeDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mCurrTimeMillis ==
((const SystemStatusTimeZoneChange&)peer).mDataItem.mCurrTimeMillis &&
mDataItem.mRawOffsetTZ ==
((const SystemStatusTimeZoneChange&)peer).mDataItem.mRawOffsetTZ &&
mDataItem.mDstOffsetTZ ==
((const SystemStatusTimeZoneChange&)peer).mDataItem.mDstOffsetTZ;
}
};
class SystemStatusTimeChange : public SystemStatusItemBase {
public:
TimeChangeDataItem mDataItem;
inline SystemStatusTimeChange(
int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) :
TimeChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {}
inline SystemStatusTimeChange(const TimeChangeDataItemBase& itemBase) :
TimeChangeDataItemBase(itemBase) {}
inline bool equals(const SystemStatusTimeChange& peer) {
return ((mCurrTimeMillis == peer.mCurrTimeMillis) &&
(mRawOffsetTZ == peer.mRawOffsetTZ) &&
(mDstOffsetTZ == peer.mDstOffsetTZ));
int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0):
mDataItem(currTimeMillis, rawOffset, dstOffset) {}
inline SystemStatusTimeChange(const TimeChangeDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mCurrTimeMillis ==
((const SystemStatusTimeChange&)peer).mDataItem.mCurrTimeMillis &&
mDataItem.mRawOffsetTZ ==
((const SystemStatusTimeChange&)peer).mDataItem.mRawOffsetTZ &&
mDataItem.mDstOffsetTZ ==
((const SystemStatusTimeChange&)peer).mDataItem.mDstOffsetTZ;
}
};
class SystemStatusWifiSupplicantStatus : public SystemStatusItemBase,
public WifiSupplicantStatusDataItemBase
{
class SystemStatusWifiSupplicantStatus : public SystemStatusItemBase {
public:
inline SystemStatusWifiSupplicantStatus() :
WifiSupplicantStatusDataItemBase() {}
inline SystemStatusWifiSupplicantStatus(const WifiSupplicantStatusDataItemBase& itemBase) :
WifiSupplicantStatusDataItemBase(itemBase) {}
inline bool equals(const SystemStatusWifiSupplicantStatus& peer) {
return ((mState == peer.mState) &&
(mApMacAddressValid == peer.mApMacAddressValid) &&
(mWifiApSsidValid == peer.mWifiApSsidValid) &&
(mWifiApSsid == peer.mWifiApSsid));
WifiSupplicantStatusDataItem mDataItem;
inline SystemStatusWifiSupplicantStatus(): mDataItem() {}
inline SystemStatusWifiSupplicantStatus(const WifiSupplicantStatusDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mState ==
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mState &&
mDataItem.mApMacAddressValid ==
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mApMacAddressValid &&
mDataItem.mWifiApSsidValid ==
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mWifiApSsidValid &&
mDataItem.mWifiApSsid ==
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mWifiApSsid;
}
};
class SystemStatusShutdownState : public SystemStatusItemBase,
public ShutdownStateDataItemBase
{
class SystemStatusShutdownState : public SystemStatusItemBase {
public:
inline SystemStatusShutdownState(bool state=false) :
ShutdownStateDataItemBase(state) {}
inline SystemStatusShutdownState(const ShutdownStateDataItemBase& itemBase) :
ShutdownStateDataItemBase(itemBase) {}
inline bool equals(const SystemStatusShutdownState& peer) {
return (mState == peer.mState);
ShutdownStateDataItem mDataItem;
inline SystemStatusShutdownState(bool state=false): mDataItem(state) {}
inline SystemStatusShutdownState(const ShutdownStateDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mState == ((const SystemStatusShutdownState&)peer).mDataItem.mState;
}
};
class SystemStatusTac : public SystemStatusItemBase,
public TacDataItemBase
{
class SystemStatusTac : public SystemStatusItemBase {
public:
inline SystemStatusTac(std::string value="") :
TacDataItemBase(value) {}
inline SystemStatusTac(const TacDataItemBase& itemBase) :
TacDataItemBase(itemBase) {}
inline bool equals(const SystemStatusTac& peer) {
return (mValue == peer.mValue);
TacDataItem mDataItem;
inline SystemStatusTac(std::string value=""): mDataItem(value) {}
inline SystemStatusTac(const TacDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mValue == ((const SystemStatusTac&)peer).mDataItem.mValue;
}
inline void dump(void) override {
LOC_LOGD("Tac: value=%s", mValue.c_str());
LOC_LOGD("Tac: value=%s", mDataItem.mValue.c_str());
}
};
class SystemStatusMccMnc : public SystemStatusItemBase,
public MccmncDataItemBase
{
class SystemStatusMccMnc : public SystemStatusItemBase {
public:
inline SystemStatusMccMnc(std::string value="") :
MccmncDataItemBase(value) {}
inline SystemStatusMccMnc(const MccmncDataItemBase& itemBase) :
MccmncDataItemBase(itemBase) {}
inline bool equals(const SystemStatusMccMnc& peer) {
return (mValue == peer.mValue);
MccmncDataItem mDataItem;
inline SystemStatusMccMnc(std::string value=""): mDataItem(value) {}
inline SystemStatusMccMnc(const MccmncDataItem& itemBase): mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mValue == ((const SystemStatusMccMnc&)peer).mDataItem.mValue;
}
inline void dump(void) override {
LOC_LOGD("TacMccMnc value=%s", mValue.c_str());
LOC_LOGD("TacMccMnc value=%s", mDataItem.mValue.c_str());
}
};
class SystemStatusBtDeviceScanDetail : public SystemStatusItemBase,
public BtDeviceScanDetailsDataItemBase
{
class SystemStatusBtDeviceScanDetail : public SystemStatusItemBase {
public:
inline SystemStatusBtDeviceScanDetail() :
BtDeviceScanDetailsDataItemBase() {}
inline SystemStatusBtDeviceScanDetail(const BtDeviceScanDetailsDataItemBase& itemBase) :
BtDeviceScanDetailsDataItemBase(itemBase) {}
inline bool equals(const SystemStatusBtDeviceScanDetail& peer) {
return ((mApSrnRssi == peer.mApSrnRssi) &&
(0 == memcmp(mApSrnMacAddress, peer.mApSrnMacAddress, sizeof(mApSrnMacAddress))) &&
(mApSrnTimestamp == peer.mApSrnTimestamp) &&
(mRequestTimestamp == peer.mRequestTimestamp) &&
(mReceiveTimestamp == peer.mReceiveTimestamp));
BtDeviceScanDetailsDataItem mDataItem;
inline SystemStatusBtDeviceScanDetail(): mDataItem() {}
inline SystemStatusBtDeviceScanDetail(const BtDeviceScanDetailsDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mApSrnRssi ==
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mApSrnRssi &&
memcmp(mDataItem.mApSrnMacAddress,
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mApSrnMacAddress,
sizeof(mDataItem.mApSrnMacAddress)) == 0 &&
mDataItem.mApSrnTimestamp ==
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mApSrnTimestamp &&
mDataItem.mRequestTimestamp ==
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mRequestTimestamp &&
mDataItem.mReceiveTimestamp ==
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mReceiveTimestamp;
}
};
class SystemStatusBtleDeviceScanDetail : public SystemStatusItemBase,
public BtLeDeviceScanDetailsDataItemBase
{
class SystemStatusBtleDeviceScanDetail : public SystemStatusItemBase {
public:
inline SystemStatusBtleDeviceScanDetail() :
BtLeDeviceScanDetailsDataItemBase() {}
inline SystemStatusBtleDeviceScanDetail(const BtLeDeviceScanDetailsDataItemBase& itemBase) :
BtLeDeviceScanDetailsDataItemBase(itemBase) {}
inline bool equals(const SystemStatusBtleDeviceScanDetail& peer) {
return ((mApSrnRssi == peer.mApSrnRssi) &&
(0 == memcmp(mApSrnMacAddress, peer.mApSrnMacAddress, sizeof(mApSrnMacAddress))) &&
(mApSrnTimestamp == peer.mApSrnTimestamp) &&
(mRequestTimestamp == peer.mRequestTimestamp) &&
(mReceiveTimestamp == peer.mReceiveTimestamp));
BtLeDeviceScanDetailsDataItem mDataItem;
inline SystemStatusBtleDeviceScanDetail(): mDataItem() {}
inline SystemStatusBtleDeviceScanDetail(const BtLeDeviceScanDetailsDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mApSrnRssi ==
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mApSrnRssi &&
memcmp(mDataItem.mApSrnMacAddress,
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mApSrnMacAddress,
sizeof(mDataItem.mApSrnMacAddress)) == 0 &&
mDataItem.mApSrnTimestamp ==
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mApSrnTimestamp &&
mDataItem.mRequestTimestamp ==
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mRequestTimestamp &&
mDataItem.mReceiveTimestamp ==
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mReceiveTimestamp;
}
};
class SystemStatusLocFeatureStatus : public SystemStatusItemBase {
public:
LocFeatureStatusDataItem mDataItem;
inline SystemStatusLocFeatureStatus(std::unordered_set<int> fids) : mDataItem(fids) {}
inline SystemStatusLocFeatureStatus(const LocFeatureStatusDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mFids ==
((const SystemStatusLocFeatureStatus&)peer).mDataItem.mFids;
}
inline void dump(void) override {
string str;
mDataItem.stringify(str);
LOC_LOGd("Location feature qwes status: %s", str.c_str());
}
};
class SystemStatusInEmergencyCall : public SystemStatusItemBase {
public:
InEmergencyCallDataItem mDataItem;
inline SystemStatusInEmergencyCall(bool value = false): mDataItem(value) {}
inline SystemStatusInEmergencyCall(const InEmergencyCallDataItem& itemBase):
mDataItem(itemBase) {}
inline bool equals(const SystemStatusItemBase& peer) override {
return mDataItem.mIsEmergency ==
((const SystemStatusInEmergencyCall&)peer).mDataItem.mIsEmergency;
}
inline void dump(void) override {
LOC_LOGd("In Emergency Call: %d", mDataItem.mIsEmergency);
}
};
@@ -862,6 +895,7 @@ public:
std::vector<SystemStatusServiceStatus> mServiceStatus;
std::vector<SystemStatusModel> mModel;
std::vector<SystemStatusManufacturer> mManufacturer;
std::vector<SystemStatusInEmergencyCall> mInEmergencyCall;
std::vector<SystemStatusAssistedGps> mAssistedGps;
std::vector<SystemStatusScreenState> mScreenState;
std::vector<SystemStatusPowerConnectState> mPowerConnectState;
@@ -873,6 +907,7 @@ public:
std::vector<SystemStatusMccMnc> mMccMnc;
std::vector<SystemStatusBtDeviceScanDetail> mBtDeviceScanDetail;
std::vector<SystemStatusBtleDeviceScanDetail> mBtLeDeviceScanDetail;
std::vector<SystemStatusLocFeatureStatus> mLocFeatureStatus;
};
/******************************************************************************
@@ -918,6 +953,10 @@ public:
bool roaming, NetworkHandle networkHandle, string& apn);
bool updatePowerConnectState(bool charging);
void resetNetworkInfo();
bool eventOptInStatus(bool userConsent);
bool eventRegionStatus(bool region);
bool eventLocFeatureStatus(std::unordered_set<int> fids);
bool eventInEmergencyCall(bool isEmergency);
};
} // namespace loc_core

View File

@@ -46,9 +46,6 @@ COUT SystemStatusOsObserver::containerTransfer(CINT& inContainer) {
}
SystemStatusOsObserver::~SystemStatusOsObserver() {
// Close data-item library handle
DataItemsFactoryProxy::closeDataItemLibraryHandle();
// Destroy cache
for (auto each : mDataItemCache) {
if (nullptr != each.second) {
@@ -112,10 +109,10 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
// Send subscription set to framework
if (nullptr != mParent->mContext.mSubscriptionObj) {
if (mToRequestData) {
LOC_LOGD("Request Data sent to framework for the following");
LOC_LOGd("Request Data sent to framework for the following");
mParent->mContext.mSubscriptionObj->requestData(diItemlist, mParent);
} else if (!dataItemsToSubscribe.empty()) {
LOC_LOGD("Subscribe Request sent to framework for the following");
LOC_LOGd("Subscribe Request sent to framework for the following");
mParent->logMe(dataItemsToSubscribe);
mParent->mContext.mSubscriptionObj->subscribe(
containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
@@ -177,7 +174,7 @@ void SystemStatusOsObserver::updateSubscription(
if (nullptr != mParent->mContext.mSubscriptionObj) {
// Send subscription set to framework
if (!dataItemsToSubscribe.empty()) {
LOC_LOGD("Subscribe Request sent to framework for the following");
LOC_LOGd("Subscribe Request sent to framework for the following");
mParent->logMe(dataItemsToSubscribe);
mParent->mContext.mSubscriptionObj->subscribe(
@@ -188,7 +185,7 @@ void SystemStatusOsObserver::updateSubscription(
// Send unsubscribe to framework
if (!dataItemsToUnsubscribe.empty()) {
LOC_LOGD("Unsubscribe Request sent to framework for the following");
LOC_LOGd("Unsubscribe Request sent to framework for the following");
mParent->logMe(dataItemsToUnsubscribe);
mParent->mContext.mSubscriptionObj->unsubscribe(
@@ -230,7 +227,7 @@ void SystemStatusOsObserver::unsubscribe(
&dataItemsToUnsubscribe, nullptr);
if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToUnsubscribe.empty()) {
LOC_LOGD("Unsubscribe Request sent to framework for the following data items");
LOC_LOGd("Unsubscribe Request sent to framework for the following data items");
mParent->logMe(dataItemsToUnsubscribe);
// Send unsubscribe to framework
@@ -271,7 +268,7 @@ void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client)
if (!dataItemsToUnsubscribe.empty() &&
nullptr != mParent->mContext.mSubscriptionObj) {
LOC_LOGD("Unsubscribe Request sent to framework for the following data items");
LOC_LOGd("Unsubscribe Request sent to framework for the following data items");
mParent->logMe(dataItemsToUnsubscribe);
// Send unsubscribe to framework
@@ -347,19 +344,16 @@ void SystemStatusOsObserver::notify(const list<IDataItemCore*>& dlist)
};
if (!dlist.empty()) {
vector<IDataItemCore*> dataItemVec(dlist.size());
vector<IDataItemCore*> dataItemVec;
for (auto each : dlist) {
IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId());
IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each);
if (nullptr == di) {
LOC_LOGw("Unable to create dataitem:%d", each->getId());
continue;
}
// Copy contents into the newly created data item
di->copy(each);
// add this dataitem if updated from last one
dataItemVec.push_back(di);
IF_LOC_LOGD {
@@ -381,7 +375,7 @@ void SystemStatusOsObserver::notify(const list<IDataItemCore*>& dlist)
void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
{
if (nullptr == mContext.mFrameworkActionReqObj) {
LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__);
LOC_LOGe("Framework action request object is NULL");
return;
}
@@ -392,7 +386,7 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
// Add reference count as 1 and add dataitem to map
pair<DataItemId, int> cpair(dit, 1);
mActiveRequestCount.insert(cpair);
LOC_LOGD("Sending turnOn request");
LOC_LOGd("Sending turnOn request");
// Send action turn on to framework
struct HandleTurnOnMsg : public LocMsg {
@@ -413,14 +407,14 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
else {
// Found in map, update reference count
citer->second++;
LOC_LOGD("turnOn - Data item:%d Num_refs:%d", dit, citer->second);
LOC_LOGd("turnOn - Data item:%d Num_refs:%d", dit, citer->second);
}
}
void SystemStatusOsObserver::turnOff(DataItemId dit)
{
if (nullptr == mContext.mFrameworkActionReqObj) {
LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__);
LOC_LOGe("Framework action request object is NULL");
return;
}
@@ -429,7 +423,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit)
if (citer != mActiveRequestCount.end()) {
// found
citer->second--;
LOC_LOGD("turnOff - Data item:%d Remaining:%d", dit, citer->second);
LOC_LOGd("turnOff - Data item:%d Remaining:%d", dit, citer->second);
if(citer->second == 0) {
// if this was last reference, remove item from map and turn off module
mActiveRequestCount.erase(citer);
@@ -542,7 +536,7 @@ void SystemStatusOsObserver::sendCachedDataItems(
if (citer != mDataItemCache.end()) {
string dv;
citer->second->stringify(dv);
LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str());
LOC_LOGi("DataItem: %s >> %s", dv.c_str(), clientName.c_str());
dataItems.push_front(citer->second);
}
}
@@ -564,27 +558,22 @@ bool SystemStatusOsObserver::updateCache(IDataItemCore* d)
// handling it, so SystemStatusOsObserver also doesn't.
// So it has to be true to proceed.
if (nullptr != d && mSystemStatus->eventDataItemNotify(d)) {
dataItemUpdated = true;
auto citer = mDataItemCache.find(d->getId());
if (citer == mDataItemCache.end()) {
// New data item; not found in cache
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId());
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d);
if (nullptr != dataitem) {
// Copy the contents of the data item
dataitem->copy(d);
// Insert in mDataItemCache
mDataItemCache.insert(std::make_pair(d->getId(), dataitem));
dataItemUpdated = true;
}
} else {
// Found in cache; Update cache if necessary
citer->second->copy(d, &dataItemUpdated);
}
if (dataItemUpdated) {
LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated);
citer->second->copyFrom(d);
}
}
LOC_LOGd("DataItem:%d updated:%d", d->getId(), dataItemUpdated);
return dataItemUpdated;
}

View File

@@ -0,0 +1,983 @@
/* 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.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#include "DataItemConcreteTypes.h"
#include <inttypes.h>
#include <log_util.h>
#define ENH_FIELD_ENABLED "IS_QUALCOMM_ENHANCED_PROVIDER_ENABLED"
#define AIRPLANEMODE_FIELD_MODE "IS_AIRPLANE_MODE_ON"
#define ENH_FIELD_ENABLED "IS_QUALCOMM_ENHANCED_PROVIDER_ENABLED"
#define GPSSTATE_FIELD_ENABLED "IS_GPS_PROVIDER_ENABLED"
#define NLPSTATUS_FIELD_ENABLED "IS_NETWORK_PROVIDER_ENABLED"
#define WIFIHARDWARESTATE_FIELD_ENABLED "IS_WIFI_HARDWARE_ON"
#define SCREENSTATE_FIELD_ENABLED "IS_SCREEN_ON"
#define POWERCONNECTSTATE_FIELD_ENABLED "IS_POWER_CONNECTED"
#define TIMEZONECHANGE_FIELD_ENABLED "IS_TIMEZONE_CHANGED"
#define TIMECHANGE_FIELD_ENABLED "IS_TIME_CHANGED"
#define TIMECHANGE_FIELD_CURRENT_TIME_MILLIS "CURR_TIME_MILLIS"
#define TIMECHANGE_FIELD_RAW_OFFSET_TZ "RAW_OFFSET_TZ"
#define TIMECHANGE_FIELD_DST_OFFSET_TZ "DST_OFFSET_TZ"
#define SHUTDOWN_FIELD_ENABLED "IS_SHUTDOWN"
#define ASSISTEDGPS_FIELD_ENABLED "IS_ASSISTED_GPS_ENABLED"
#define NETWORKINFO_CARD "ACTIVE_NETWORK_INFO"
#define NETWORKINFO_FIELD_TYPE "TYPE"
#define NETWORKINFO_FIELD_TYPENAME "TYPE_NAME"
#define NETWORKINFO_FIELD_SUBTYPENAME "SUB_TYPE_NAME"
#define NETWORKINFO_FIELD_AVAILABLE "IS_AVAILABLE"
#define NETWORKINFO_FIELD_CONNECTED "IS_CONNECTED"
#define NETWORKINFO_FIELD_ROAMING "IS_ROAMING"
#define NETWORKINFO_FIELD_NETWORKHANDLE_0 "NETWORK_HANDLE_0"
#define NETWORKINFO_FIELD_NETWORKHANDLE_1 "NETWORK_HANDLE_1"
#define NETWORKINFO_FIELD_NETWORKHANDLE_2 "NETWORK_HANDLE_2"
#define NETWORKINFO_FIELD_NETWORKHANDLE_3 "NETWORK_HANDLE_3"
#define NETWORKINFO_FIELD_NETWORKHANDLE_4 "NETWORK_HANDLE_4"
#define NETWORKINFO_FIELD_NETWORKHANDLE_5 "NETWORK_HANDLE_5"
#define NETWORKINFO_FIELD_NETWORKHANDLE_6 "NETWORK_HANDLE_6"
#define NETWORKINFO_FIELD_NETWORKHANDLE_7 "NETWORK_HANDLE_7"
#define NETWORKINFO_FIELD_NETWORKHANDLE_8 "NETWORK_HANDLE_8"
#define NETWORKINFO_FIELD_NETWORKHANDLE_9 "NETWORK_HANDLE_9"
#define SERVICESTATUS_FIELD_STATE "CELL_NETWORK_STATUS"
#define MODEL_FIELD_NAME "MODEL"
#define MANUFACTURER_FIELD_NAME "MANUFACTURER"
#define OSSTATUS_CARD "ACTIVE_NETWORK_INFO"
#define RILSERVICEINFO_CARD "RIL-SERVICE-INFO"
#define RILSERVICEINFO_FIELD_ARIF_TYPE_MASK "SUPPORTED-AIRINTERFACE-TYPE-MASK"
#define RILSERVICEINFO_FIELD_CARRIER_ARIF_TYPE "CARRIER-AIRINTERFACE-TYPE"
#define RILSERVICEINFO_FIELD_CARRIER_MCC "MOBILE-COUNTRY-CODE"
#define RILSERVICEINFO_FIELD_CARRIER_MNC "MOBILE-NETWORK-CODE"
#define RILSERVICEINFO_FIELD_CARRIER_NAME "HOME-CARRIER-NAME"
#define RILCELLINFO_CARD "RIL-CELL-UPDATE"
#define RILCELLINFO_FIELD_NETWORK_STATUS "NETWORK-STATUS"
#define RILCELLINFO_FIELD_RIL_TECH_TYPE "RIL-TECH-TYPE"
#define RILLCELLINFO_FIELD_MCC "MOBILE-COUNTRY-CODE"
#define RILLCELLINFO_FIELD_MNC "MOBILE-NETWORK-CODE"
#define RILLCELLINFO_FIELD_LAC "LOCATION-AREA-CODE"
#define RILLCELLINFO_FIELD_CID "CELL-ID"
#define RILLCELLINFO_FIELD_SID "SYSTEM-ID"
#define RILLCELLINFO_FIELD_NID "NETWORK-ID"
#define RILLCELLINFO_FIELD_BSID "BASE-STATION-ID"
#define RILLCELLINFO_FIELD_BSLAT "BASE-STATION-LATITUDE"
#define RILLCELLINFO_FIELD_BSLON "BASE-STATION-LONGITUDE"
#define RILLCELLINFO_FIELD_UTC_TIME_OFFSET "TIME-ZONE-OFFSET"
#define RILLCELLINFO_FIELD_DAYLIGHT_TIMEZONE "IN-DAY-LIGHT-SAVING"
#define RILLCELLINFO_FIELD_TAC "TRACKING-AREA-CODE"
#define RILLCELLINFO_FIELD_PCI "PHYSICAL-CELL-ID"
#define RILLCELLINFO_FIELD_NB_MODE "NB-MODE"
#define RILLCELLINFO_FIELD_NB_EARFCN_OFFSET "NB-EARFCN-OFFSET"
#define WIFI_SUPPLICANT_FIELD_STATE "WIFI-SUPPLICANT-STATE"
#define TAC_FIELD_NAME "TAC"
#define MCCMNC_FIELD_NAME "MCCMNC"
#define BTLESCANDETAILS_FIELD_VALID "BTLE_VALID_DEV"
#define BTLESCANDETAILS_FIELD_RSSI "BTLE_DEV_RSSI"
#define BTLESCANDETAILS_FIELD_MAC "BTLE_DEV_MAC"
#define BTLESCANDETAILS_FIELD_SCANREQ "BTLE_SCAN_REQ_TIME"
#define BTLESCANDETAILS_FIELD_SCANSTART "BTLE_SCAN_START_TIME"
#define BTLESCANDETAILS_FIELD_SCANRECV "BTLE_SCAN_RECV_TIME"
#define BTLESCANDETAILS_FIELD_SCANERROR "BTLE_SCAN_ERR"
#define BTSCANDETAILS_FIELD_VALID "BT_VALID_DEV"
#define BTSCANDETAILS_FIELD_RSSI "BT_DEV_RSSI"
#define BTSCANDETAILS_FIELD_MAC "BT_DEV_MAC"
#define BTSCANDETAILS_FIELD_SCANREQ "BT_SCAN_REQ_TIME"
#define BTSCANDETAILS_FIELD_SCANSTART "BT_SCAN_START_TIME"
#define BTSCANDETAILS_FIELD_SCANRECV "BT_SCAN_RECV_TIME"
#define BTSCANDETAILS_FIELD_SCANERROR "BT_SCAN_ERR"
#define OEM_GTP_UPLAOD_TRIGGER_READY_FIELD_NAME "OEM-GTP-UPLOAD-TRIGGER-READY"
#define BATTERYLEVEL_FIELD_BATTERY_PCT "BATTERY_PCT"
#define IN_EMERGENCY_CALL_FIELD_NAME "IS_EMERGENCY"
#define LOC_FEATURE_STATUS_FIELD_NAME "LOC_FEATURE_STATUS"
namespace loc_core
{
// stringify
void AirplaneModeDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(AirplaneModeDataItem, AIRPLANEMODE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = AIRPLANEMODE_FIELD_MODE;
valueStr += ": ";
valueStr += (d->mMode) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void ENHDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
valueStr.clear ();
valueStr = ENH_FIELD_ENABLED;
if (!d->isEnabled()) {
Fields field = FIELD_MAX;
switch (mFieldUpdate) {
case FIELD_CONSENT:
valueStr += "_FIELD_CONSENT";
field = FIELD_CONSENT;
break;
case FIELD_REGION:
valueStr += "_FIELD_REGION";
field = FIELD_REGION;
break;
default:
break;
}
valueStr += ": ";
valueStr += (((1 << field) & d->mEnhFields) != 0) ? "true" : "false";
} else {
valueStr += ": ";
valueStr += "true";
}
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void GPSStateDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(GPSStateDataItem, GPSSTATE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = GPSSTATE_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mEnabled) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void NLPStatusDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(NLPStatusDataItem, NLPSTATUS_DATA_ITEM_ID);
valueStr.clear ();
valueStr = NLPSTATUS_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mEnabled) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void WifiHardwareStateDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(WifiHardwareStateDataItem,
WIFIHARDWARESTATE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = WIFIHARDWARESTATE_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mEnabled) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void ScreenStateDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ScreenStateDataItem, SCREEN_STATE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = SCREENSTATE_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mState) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void PowerConnectStateDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(PowerConnectStateDataItem,
POWER_CONNECTED_STATE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = POWERCONNECTSTATE_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mState) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void BatteryLevelDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(BatteryLevelDataItem, BATTERY_LEVEL_DATA_ITEM_ID);
valueStr.clear ();
valueStr += BATTERYLEVEL_FIELD_BATTERY_PCT;
valueStr += ": ";
char state [12];
snprintf (state, 12, "%d", d->mBatteryPct);
valueStr += string (state);
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void TimeZoneChangeDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(TimeZoneChangeDataItem, TIMEZONE_CHANGE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = TIMEZONECHANGE_FIELD_ENABLED;
valueStr += ": ";
valueStr += "true";
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void TimeChangeDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(TimeChangeDataItem, TIME_CHANGE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = TIMECHANGE_FIELD_ENABLED;
valueStr += ": ";
valueStr += "true";
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void ShutdownStateDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ShutdownStateDataItem, SHUTDOWN_STATE_DATA_ITEM_ID);
valueStr.clear ();
valueStr = SHUTDOWN_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mState) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void AssistedGpsDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(AssistedGpsDataItem, ASSISTED_GPS_DATA_ITEM_ID);
valueStr.clear ();
valueStr = ASSISTEDGPS_FIELD_ENABLED;
valueStr += ": ";
valueStr += (d->mEnabled) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void NetworkInfoDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(NetworkInfoDataItem, NETWORKINFO_DATA_ITEM_ID);
valueStr.clear ();
valueStr = NETWORKINFO_CARD;
valueStr += "::";
valueStr += NETWORKINFO_FIELD_TYPE;
valueStr += "s_MASK: ";
char type [12];
snprintf (type, 12, "%" PRIu64, mAllTypes);
valueStr += string (type);
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_TYPENAME;
valueStr += ": ";
valueStr += d->mTypeName;
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_SUBTYPENAME;
valueStr += ": ";
valueStr += d->mSubTypeName;
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_AVAILABLE;
valueStr += ": ";
valueStr += (d->mAvailable) ? ("true") : ("false");
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_CONNECTED;
valueStr += ": ";
valueStr += (d->mConnected) ? ("true") : ("false");
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_ROAMING;
valueStr += ": ";
valueStr += (d->mRoaming) ? ("true") : ("false");
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_0;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[0].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_1;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[1].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_2;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[2].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_3;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[3].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_4;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[4].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_5;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[5].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_6;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[6].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_7;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[7].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_8;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[8].toString();
valueStr += ", ";
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_9;
valueStr += ": ";
valueStr += d->mAllNetworkHandles[9].toString();
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void ServiceStatusDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ServiceStatusDataItem, SERVICESTATUS_DATA_ITEM_ID);
valueStr.clear ();
valueStr += SERVICESTATUS_FIELD_STATE;
valueStr += ": ";
char state [12];
snprintf (state, 12, "%d", d->mServiceState);
valueStr += string (state);
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void ModelDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ModelDataItem, MODEL_DATA_ITEM_ID);
valueStr.clear ();
valueStr += MODEL_FIELD_NAME;
valueStr += ": ";
valueStr += d->mModel;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void ManufacturerDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ManufacturerDataItem, MANUFACTURER_DATA_ITEM_ID);
valueStr.clear ();
valueStr += MANUFACTURER_FIELD_NAME;
valueStr += ": ";
valueStr += d->mManufacturer;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void WifiSupplicantStatusDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(WifiSupplicantStatusDataItem,
WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID);
valueStr += "Attach state: ";
char t[50];
memset (t, '\0', 50);
snprintf (t, 50, "%d", d->mState);
valueStr += t;
valueStr += ", Mac address valid: ";
valueStr += (d->mApMacAddressValid) ? ("true") : ("false");
valueStr += ", AP MAC address: ";
memset (t, '\0', 50);
snprintf(t, 50, "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApMacAddress[0], d->mApMacAddress[1],
d->mApMacAddress[2], d->mApMacAddress[3], d->mApMacAddress[4], d->mApMacAddress[5]);
valueStr += t;
valueStr += ", Wifi-Ap SSID Valid: ";
valueStr += (d->mWifiApSsidValid) ? ("true") : ("false");
valueStr += ", SSID: ";
valueStr += d->mWifiApSsid;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void TacDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(TacDataItem, TAC_DATA_ITEM_ID);
valueStr.clear ();
valueStr += TAC_FIELD_NAME;
valueStr += ": ";
valueStr += d->mValue;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void MccmncDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(MccmncDataItem, MCCMNC_DATA_ITEM_ID);
valueStr.clear ();
valueStr += MCCMNC_FIELD_NAME;
valueStr += ": ";
valueStr += d->mValue;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void BtLeDeviceScanDetailsDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(BtLeDeviceScanDetailsDataItem, BTLE_SCAN_DATA_ITEM_ID);
valueStr.clear ();
valueStr += BTLESCANDETAILS_FIELD_VALID;
valueStr += ": ";
valueStr += d->mValidSrnData;
valueStr += ", ";
valueStr += BTLESCANDETAILS_FIELD_RSSI;
valueStr += ": ";
valueStr += d->mApSrnRssi;
valueStr += ", ";
char t[20];
memset (t, '\0', 20);
valueStr += BTLESCANDETAILS_FIELD_MAC;
valueStr += ": ";
snprintf(t, 20, "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApSrnMacAddress[0],
d->mApSrnMacAddress[1], d->mApSrnMacAddress[2], d->mApSrnMacAddress[3],
d->mApSrnMacAddress[4], d->mApSrnMacAddress[5]);
valueStr += t;
valueStr += ", ";
valueStr += BTLESCANDETAILS_FIELD_SCANREQ;
valueStr += ": ";
valueStr += d->mApSrnTimestamp;
valueStr += ", ";
valueStr += BTLESCANDETAILS_FIELD_SCANSTART;
valueStr += ": ";
valueStr += d->mRequestTimestamp;
valueStr += ", ";
valueStr += BTLESCANDETAILS_FIELD_SCANRECV;
valueStr += ": ";
valueStr += d->mReceiveTimestamp;
valueStr += ", ";
valueStr += BTLESCANDETAILS_FIELD_SCANERROR;
valueStr += ": ";
valueStr += d->mErrorCause;
valueStr += ", ";
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
void BtDeviceScanDetailsDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(BtDeviceScanDetailsDataItem, BT_SCAN_DATA_ITEM_ID);
valueStr.clear ();
valueStr += BTSCANDETAILS_FIELD_VALID;
valueStr += ": ";
valueStr += d->mValidSrnData;
valueStr += ", ";
valueStr += BTSCANDETAILS_FIELD_RSSI;
valueStr += ": ";
valueStr += d->mApSrnRssi;
valueStr += ", ";
char t[20];
memset (t, '\0', 20);
valueStr += BTSCANDETAILS_FIELD_MAC;
valueStr += ": ";
snprintf(t, 20, "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApSrnMacAddress[0],
d->mApSrnMacAddress[1], d->mApSrnMacAddress[2], d->mApSrnMacAddress[3],
d->mApSrnMacAddress[4], d->mApSrnMacAddress[5]);
valueStr += t;
valueStr += ", ";
valueStr += BTSCANDETAILS_FIELD_SCANREQ;
valueStr += ": ";
valueStr += d->mApSrnTimestamp;
valueStr += ", ";
valueStr += BTSCANDETAILS_FIELD_SCANSTART;
valueStr += ": ";
valueStr += d->mRequestTimestamp;
valueStr += ", ";
valueStr += BTSCANDETAILS_FIELD_SCANRECV;
valueStr += ": ";
valueStr += d->mReceiveTimestamp;
valueStr += ", ";
valueStr += BTSCANDETAILS_FIELD_SCANERROR;
valueStr += ": ";
valueStr += d->mErrorCause;
valueStr += ", ";
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
// copy
int32_t AirplaneModeDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(AirplaneModeDataItem, AIRPLANEMODE_DATA_ITEM_ID);
if (s->mMode == d->mMode) { result = 0; break; }
s->mMode = d->mMode;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
void InEmergencyCallDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(
InEmergencyCallDataItem, IN_EMERGENCY_CALL_DATA_ITEM_ID);
valueStr.clear ();
valueStr += IN_EMERGENCY_CALL_FIELD_NAME;
valueStr += ": ";
valueStr += (d->mIsEmergency) ? ("true") : ("false");
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
int32_t ENHDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
if (s->mEnhFields == d->mEnhFields) { result = true; break; }
switch (d->mAction) {
case SET:
s->mEnhFields |= (1 << d->mFieldUpdate);
break;
case CLEAR:
s->mEnhFields &= ~(1 << d->mFieldUpdate);
break;
default:
break;
}
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t GPSStateDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(GPSStateDataItem, GPSSTATE_DATA_ITEM_ID);
if (s->mEnabled == d->mEnabled) { result = 0; break; }
s->mEnabled = d->mEnabled;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t NLPStatusDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(NLPStatusDataItem, NLPSTATUS_DATA_ITEM_ID);
if (s->mEnabled == d->mEnabled) { result = 0; break; }
s->mEnabled = d->mEnabled;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t WifiHardwareStateDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(WifiHardwareStateDataItem, WIFIHARDWARESTATE_DATA_ITEM_ID);
if (s->mEnabled == d->mEnabled) { result = 0; break; }
s->mEnabled = d->mEnabled;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t ScreenStateDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ScreenStateDataItem, SCREEN_STATE_DATA_ITEM_ID);
if (s->mState == d->mState) { result = 0; break; }
s->mState = d->mState;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t PowerConnectStateDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(PowerConnectStateDataItem,
POWER_CONNECTED_STATE_DATA_ITEM_ID);
if (s->mState == d->mState) { result = 0; break; }
s->mState = d->mState;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t BatteryLevelDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(BatteryLevelDataItem, BATTERY_LEVEL_DATA_ITEM_ID);
if (s->mBatteryPct == d->mBatteryPct) { result = 0; break; }
s->mBatteryPct = d->mBatteryPct;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t TimeZoneChangeDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(TimeZoneChangeDataItem, TIMEZONE_CHANGE_DATA_ITEM_ID);
if (s->mCurrTimeMillis == d->mCurrTimeMillis &&
s->mRawOffsetTZ == d->mRawOffsetTZ &&
s->mDstOffsetTZ == d->mDstOffsetTZ) {
result = 0;
break;
}
s->mCurrTimeMillis = d->mCurrTimeMillis;
s->mRawOffsetTZ = d->mRawOffsetTZ;
s->mDstOffsetTZ = d->mDstOffsetTZ;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t TimeChangeDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(TimeChangeDataItem, TIME_CHANGE_DATA_ITEM_ID);
if (s->mCurrTimeMillis == d->mCurrTimeMillis &&
s->mRawOffsetTZ == d->mRawOffsetTZ &&
s->mDstOffsetTZ == d->mDstOffsetTZ) {
result = 0;
break;
}
s->mCurrTimeMillis = d->mCurrTimeMillis;
s->mRawOffsetTZ = d->mRawOffsetTZ;
s->mDstOffsetTZ = d->mDstOffsetTZ;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t ShutdownStateDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ShutdownStateDataItem, SHUTDOWN_STATE_DATA_ITEM_ID);
if (s->mState == d->mState) { result = 0; break; }
s->mState = d->mState;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t AssistedGpsDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(AssistedGpsDataItem, ASSISTED_GPS_DATA_ITEM_ID);
if (s->mEnabled == d->mEnabled) { result = 0; break; }
s->mEnabled = d->mEnabled;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t NetworkInfoDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(NetworkInfoDataItem, NETWORKINFO_DATA_ITEM_ID);
NetworkType type = ((NetworkInfoDataItem*)d)->getType();
if ( (s->mAllTypes == d->mAllTypes) &&
(s->getType() == type) && (0 == s->mTypeName.compare(d->mTypeName)) &&
(0 == s->mSubTypeName.compare(d->mSubTypeName)) &&
(s->mAvailable == d->mAvailable) &&
(s->mConnected == d->mConnected) &&
(s->mRoaming == d->mRoaming) &&
(memcmp(s->mAllNetworkHandles, d->mAllNetworkHandles,
sizeof(s->mAllNetworkHandles)) == 0) &&
(s->mNetworkHandle == d->mNetworkHandle) ) {
result = 0;
break;
}
s->mAllTypes = (d->mAllTypes == 0) ? typeToAllTypes(type) : d->mAllTypes;
if (s->getType() != type) { s->setType(type);}
if (0 != s->mTypeName.compare(d->mTypeName)) { s->mTypeName = d->mTypeName;}
if (0 != s->mSubTypeName.compare(d->mSubTypeName)) {s->mSubTypeName = d->mSubTypeName;}
if (s->mAvailable != d->mAvailable) {s->mAvailable = d->mAvailable;}
if (s->mConnected != d->mConnected) {s->mConnected = d->mConnected;}
if (s->mRoaming != d->mRoaming) {s->mRoaming = d->mRoaming;}
if (memcmp(s->mAllNetworkHandles, d->mAllNetworkHandles,
sizeof(s->mAllNetworkHandles)) != 0) {
memcpy(static_cast<void*>(s->mAllNetworkHandles),
static_cast<void *>(d->mAllNetworkHandles), sizeof(s->mAllNetworkHandles));
}
if (s->mNetworkHandle != d->mNetworkHandle) {s->mNetworkHandle = d->mNetworkHandle;}
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t ServiceStatusDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ServiceStatusDataItem, SERVICESTATUS_DATA_ITEM_ID);
if (s->mServiceState == d->mServiceState) { result = 0; break; }
s->mServiceState = d->mServiceState;
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
int32_t ModelDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ModelDataItem, MODEL_DATA_ITEM_ID);
if (0 == s->mModel.compare(d->mModel)) { result = 0; break; }
s->mModel = d->mModel;
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t ManufacturerDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(ManufacturerDataItem, MANUFACTURER_DATA_ITEM_ID);
if (0 == s->mManufacturer.compare(d->mManufacturer)) { result = 0; break; }
s->mManufacturer = d->mManufacturer;
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
int32_t WifiSupplicantStatusDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(WifiSupplicantStatusDataItem,
WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID);
if ( (s->mState == d->mState) &&
(s->mApMacAddressValid == d->mApMacAddressValid) &&
(s->mWifiApSsidValid == d->mWifiApSsidValid)) {
// compare mac address
if (memcmp(s->mApMacAddress, d->mApMacAddress, sizeof(s->mApMacAddress)) == 0) {
// compare ssid
if (s->mWifiApSsid.compare(d->mWifiApSsid) == 0) {
result = 0;
break;
}
}
}
if (s->mState != d->mState) { s->mState = d->mState;}
if (s->mApMacAddressValid != d->mApMacAddressValid) {
s->mApMacAddressValid = d->mApMacAddressValid;
}
if (s->mWifiApSsidValid != d->mWifiApSsidValid) {s->mWifiApSsidValid = d->mWifiApSsidValid;}
if (memcmp(s->mApMacAddress, d->mApMacAddress, sizeof(s->mApMacAddress)) != 0) {
memcpy(static_cast<void*>(s->mApMacAddress), static_cast<void *>(d->mApMacAddress),
sizeof(s->mApMacAddress));
}
if (s->mWifiApSsid.compare(d->mWifiApSsid) != 0) {
s->mWifiApSsid = d->mWifiApSsid;
}
result = 0;
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
int32_t TacDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(TacDataItem, TAC_DATA_ITEM_ID);
if (0 == s->mValue.compare(d->mValue)) { result = 0; break; }
s->mValue = d->mValue;
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
int32_t MccmncDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(MccmncDataItem, MCCMNC_DATA_ITEM_ID);
if (0 == s->mValue.compare(d->mValue)) { result = 0; break; }
s->mValue= d->mValue;
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
int32_t BtLeDeviceScanDetailsDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(BtLeDeviceScanDetailsDataItem, BTLE_SCAN_DATA_ITEM_ID);
if (s->mValidSrnData != d->mValidSrnData) { s->mValidSrnData = d->mValidSrnData;}
if (s->mApSrnRssi != d->mApSrnRssi) { s->mApSrnRssi = d->mApSrnRssi;}
if (memcmp(s->mApSrnMacAddress, d->mApSrnMacAddress, sizeof(s->mApSrnMacAddress)) != 0) {
memcpy(static_cast<void*>(s->mApSrnMacAddress), static_cast<void*>(d->mApSrnMacAddress),
sizeof(s->mApSrnMacAddress));
}
if (s->mApSrnTimestamp != d->mApSrnTimestamp) {s->mApSrnTimestamp = d->mApSrnTimestamp;}
if (s->mRequestTimestamp != d->mRequestTimestamp) {
s->mRequestTimestamp = d->mRequestTimestamp;
}
if (s->mReceiveTimestamp != d->mReceiveTimestamp) {
s->mReceiveTimestamp = d->mReceiveTimestamp;
}
if (s->mErrorCause != d->mErrorCause) {s->mErrorCause = d->mErrorCause;}
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
int32_t BtDeviceScanDetailsDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(BtDeviceScanDetailsDataItem, BT_SCAN_DATA_ITEM_ID);
if (s->mValidSrnData != d->mValidSrnData) { s->mValidSrnData = d->mValidSrnData;}
if (s->mApSrnRssi != d->mApSrnRssi) { s->mApSrnRssi = d->mApSrnRssi;}
if (memcmp(s->mApSrnMacAddress, d->mApSrnMacAddress, sizeof(s->mApSrnMacAddress)) != 0) {
memcpy(static_cast<void*>(s->mApSrnMacAddress), static_cast<void*>(d->mApSrnMacAddress),
sizeof(s->mApSrnMacAddress));
}
if (s->mApSrnTimestamp != d->mApSrnTimestamp) {s->mApSrnTimestamp = d->mApSrnTimestamp;}
if (s->mRequestTimestamp != d->mRequestTimestamp) {
s->mRequestTimestamp = d->mRequestTimestamp;
}
if (s->mReceiveTimestamp != d->mReceiveTimestamp) {
s->mReceiveTimestamp = d->mReceiveTimestamp;
}
if (s->mErrorCause != d->mErrorCause) {s->mErrorCause = d->mErrorCause;}
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
void LocFeatureStatusDataItem::stringify(string& valueStr) {
int32_t result = 0;
ENTRY_LOG();
do {
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(
LocFeatureStatusDataItem, LOC_FEATURE_STATUS_DATA_ITEM_ID);
valueStr.clear ();
valueStr += LOC_FEATURE_STATUS_FIELD_NAME;
valueStr += ": {";
for (int item : d->mFids) {
valueStr += std::to_string(item) + ", ";
}
valueStr += "}";
} while (0);
EXIT_LOG_WITH_ERROR("%d", result);
}
int32_t LocFeatureStatusDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(
LocFeatureStatusDataItem, LOC_FEATURE_STATUS_DATA_ITEM_ID);
s->mFids = d->mFids;
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
int32_t InEmergencyCallDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
do {
COPIER_ERROR_CHECK_AND_DOWN_CAST(
InEmergencyCallDataItem, IN_EMERGENCY_CALL_DATA_ITEM_ID);
s->mIsEmergency = d->mIsEmergency;
result = 0;
} while (0);
EXIT_LOG("%d", result);
return result;
}
} //namespace loc_core

View File

@@ -0,0 +1,656 @@
/* 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.
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef DATAITEM_CONCRETETYPES_H
#define DATAITEM_CONCRETETYPES_H
#include <string>
#include <cstring>
#include <sstream>
#include <DataItemId.h>
#include <IDataItemCore.h>
#include <gps_extended_c.h>
#include <inttypes.h>
#include <unordered_set>
#define MAC_ADDRESS_LENGTH 6
// MAC address length in bytes
// QMI_LOC_SRN_MAC_ADDR_LENGTH_V02
#define SRN_MAC_ADDRESS_LENGTH 6
#define WIFI_SUPPLICANT_DEFAULT_STATE 0
#define TIME_DEFAULT_CURRTIME 0
#define TIMEZONE_DEFAULT_RAWOFFSET 0
#define TIMEZONE_DEFAULT_DSTOFFSET 0
#define NETWORKINFO_DEFAULT_TYPE 300
#define SERVICESTATUS_DEFAULT_STATE 3 /// OOO
#define BATTERY_PCT_DEFAULT 50
#define STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(T, ID) \
if (getId() != ID) { result = 1; break; } \
T * d = static_cast<T *>(this);
// macro for copier
#define COPIER_ERROR_CHECK_AND_DOWN_CAST(T, ID) \
if (src == NULL) { result = 1; break; } \
if (getId() != src->getId()) { result = 2; break; } \
if (getId() != ID) { result = 3; break; } \
T * s = static_cast<T *>(this); \
T * d = static_cast<T *>(src);
static constexpr char sDelimit = ':';
namespace loc_core {
using namespace std;
enum NetworkType {
TYPE_MOBILE = 0,
TYPE_WIFI,
TYPE_ETHERNET,
TYPE_BLUETOOTH,
TYPE_MMS,
TYPE_SUPL,
TYPE_DUN,
TYPE_HIPRI,
TYPE_WIMAX,
TYPE_PROXY,
TYPE_UNKNOWN,
};
typedef struct NetworkInfoType {
// Unique network handle ID
uint64_t networkHandle;
// Type of network for corresponding network handle
NetworkType networkType;
NetworkInfoType() : networkHandle(NETWORK_HANDLE_UNKNOWN), networkType(TYPE_UNKNOWN) {}
NetworkInfoType(string strObj) {
size_t posDelimit = strObj.find(sDelimit);
if ( posDelimit != string::npos) {
int32_t type = TYPE_UNKNOWN;
string handleStr = strObj.substr(0, posDelimit);
string typeStr = strObj.substr(posDelimit + 1, strObj.length() - posDelimit - 1);
stringstream(handleStr) >> networkHandle;
stringstream(typeStr) >> type;
networkType = (NetworkType) type;
} else {
networkHandle = NETWORK_HANDLE_UNKNOWN;
networkType = TYPE_UNKNOWN;
}
}
bool operator== (const NetworkInfoType& other) {
return ((networkHandle == other.networkHandle) && (networkType == other.networkType));
}
string toString() {
string valueStr;
valueStr.clear ();
char nethandle [32];
memset (nethandle, 0, 32);
snprintf(nethandle, sizeof(nethandle), "%" PRIu64, networkHandle);
valueStr += string(nethandle);
valueStr += sDelimit;
char type [12];
memset (type, 0, 12);
snprintf (type, 12, "%u", networkType);
valueStr += string (type);
return valueStr;
}
} NetworkInfoType;
class AirplaneModeDataItem: public IDataItemCore {
public:
AirplaneModeDataItem(IDataItemCore* di):
AirplaneModeDataItem(((AirplaneModeDataItem*)di)->mMode) {}
AirplaneModeDataItem(bool mode = false):
mMode(mode) {mId = AIRPLANEMODE_DATA_ITEM_ID;}
virtual ~AirplaneModeDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mMode;
};
class ENHDataItem: public IDataItemCore {
public:
enum Fields { FIELD_CONSENT, FIELD_REGION, FIELD_MAX };
enum Actions { NO_OP, SET, CLEAR };
ENHDataItem(bool enabled = false, Fields updateBit = FIELD_MAX) :
mEnhFields(0), mFieldUpdate(updateBit) {
mId = ENH_DATA_ITEM_ID;
setAction(enabled ? SET : CLEAR);
}
virtual ~ENHDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
inline bool isEnabled() const {
uint8_t combinedBits = (1 << FIELD_MAX) - 1;
return (combinedBits == (mEnhFields & combinedBits));
}
void setAction(Actions action = NO_OP) {
mAction = action;
if (NO_OP != mAction) {
updateFields();
}
}
void updateFields() {
if (FIELD_MAX > mFieldUpdate) {
switch (mAction) {
case SET:
mEnhFields |= (1 << mFieldUpdate);
break;
case CLEAR:
mEnhFields &= ~(1 << mFieldUpdate);
break;
case NO_OP:
default:
break;
}
}
}
// Data members
uint32_t mEnhFields;
private:
Actions mAction;
Fields mFieldUpdate;
};
class GPSStateDataItem: public IDataItemCore {
public:
GPSStateDataItem(bool enabled = false) :
mEnabled(enabled) {mId = GPSSTATE_DATA_ITEM_ID;}
virtual ~GPSStateDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mEnabled;
};
class NLPStatusDataItem: public IDataItemCore {
public:
NLPStatusDataItem(bool enabled = false) :
mEnabled(enabled) {mId = NLPSTATUS_DATA_ITEM_ID;}
virtual ~NLPStatusDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mEnabled;
};
class WifiHardwareStateDataItem: public IDataItemCore {
public:
WifiHardwareStateDataItem(bool enabled = false) :
mEnabled(enabled) {mId = WIFIHARDWARESTATE_DATA_ITEM_ID;}
virtual ~WifiHardwareStateDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mEnabled;
};
class ScreenStateDataItem: public IDataItemCore {
public:
ScreenStateDataItem(bool state = false) :
mState(state) {mId = SCREEN_STATE_DATA_ITEM_ID;}
virtual ~ScreenStateDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mState;
};
class PowerConnectStateDataItem: public IDataItemCore {
public:
PowerConnectStateDataItem(bool state = false) :
mState(state) {mId = POWER_CONNECTED_STATE_DATA_ITEM_ID;}
virtual ~PowerConnectStateDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mState;
};
class TimeZoneChangeDataItem: public IDataItemCore {
public:
TimeZoneChangeDataItem(int64_t currTimeMillis = TIME_DEFAULT_CURRTIME,
int32_t rawOffset = TIMEZONE_DEFAULT_RAWOFFSET,
int32_t dstOffset = TIMEZONE_DEFAULT_DSTOFFSET) :
mCurrTimeMillis (currTimeMillis),
mRawOffsetTZ (rawOffset),
mDstOffsetTZ (dstOffset) {mId = TIMEZONE_CHANGE_DATA_ITEM_ID;}
virtual ~TimeZoneChangeDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
int64_t mCurrTimeMillis;
int32_t mRawOffsetTZ;
int32_t mDstOffsetTZ;
};
class TimeChangeDataItem: public IDataItemCore {
public:
TimeChangeDataItem(int64_t currTimeMillis = TIME_DEFAULT_CURRTIME,
int32_t rawOffset = TIMEZONE_DEFAULT_RAWOFFSET,
int32_t dstOffset = TIMEZONE_DEFAULT_DSTOFFSET) :
mCurrTimeMillis (currTimeMillis),
mRawOffsetTZ (rawOffset),
mDstOffsetTZ (dstOffset) {mId = TIME_CHANGE_DATA_ITEM_ID;}
virtual ~TimeChangeDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
int64_t mCurrTimeMillis;
int32_t mRawOffsetTZ;
int32_t mDstOffsetTZ;
};
class ShutdownStateDataItem: public IDataItemCore {
public:
ShutdownStateDataItem(bool state = false) :
mState (state) {mId = SHUTDOWN_STATE_DATA_ITEM_ID;}
virtual ~ShutdownStateDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mState;
};
class AssistedGpsDataItem: public IDataItemCore {
public:
AssistedGpsDataItem(bool enabled = false) :
mEnabled(enabled) {mId = ASSISTED_GPS_DATA_ITEM_ID;}
virtual ~AssistedGpsDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mEnabled;
};
class NetworkInfoDataItem: public IDataItemCore {
public:
NetworkInfoDataItem(
int32_t type = NETWORKINFO_DEFAULT_TYPE,
std::string typeName = "",
std::string subTypeName = "",
bool available = false,
bool connected = false,
bool roaming = false,
uint64_t networkHandle = NETWORK_HANDLE_UNKNOWN, string apn __unused = ""):
NetworkInfoDataItem(getNormalizedType(type), type, typeName, subTypeName, available,
connected, roaming, networkHandle, "") {}
NetworkInfoDataItem(NetworkType initialType, int32_t type, string typeName,
string subTypeName, bool available, bool connected, bool roaming,
uint64_t networkHandle, string apn):
mAllTypes(typeToAllTypes(initialType)),
mType(type),
mTypeName(typeName),
mSubTypeName(subTypeName),
mAvailable(available),
mConnected(connected),
mRoaming(roaming),
mNetworkHandle(networkHandle), mApn(apn) {
mId = NETWORKINFO_DATA_ITEM_ID;
mAllNetworkHandles[0].networkHandle = networkHandle;
mAllNetworkHandles[0].networkType = initialType;
}
virtual ~NetworkInfoDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
inline uint64_t getAllTypes() { return mAllTypes; }
inline NetworkInfoType* getNetworkHandle() {
return &mAllNetworkHandles[0];
}
inline virtual NetworkType getType(void) const {
return getNormalizedType(mType);
}
inline static NetworkType getNormalizedType(int32_t type) {
NetworkType typeout = TYPE_UNKNOWN;
switch (type) {
case 100:
typeout = TYPE_WIFI;
break;
case 101:
typeout = TYPE_ETHERNET;
break;
case 102:
typeout = TYPE_BLUETOOTH;
break;
case 201:
typeout = TYPE_MOBILE;
break;
case 202:
typeout = TYPE_DUN;
break;
case 203:
typeout = TYPE_HIPRI;
break;
case 204:
typeout = TYPE_MMS;
break;
case 205:
typeout = TYPE_SUPL;
break;
case 220:
typeout = TYPE_WIMAX;
break;
case 300:
default:
typeout = TYPE_UNKNOWN;
break;
}
return typeout;
}
// Data members
uint64_t mAllTypes;
int32_t mType;
string mTypeName;
string mSubTypeName;
bool mAvailable;
bool mConnected;
bool mRoaming;
NetworkInfoType mAllNetworkHandles[MAX_NETWORK_HANDLES];
uint64_t mNetworkHandle;
string mApn;
protected:
inline uint64_t typeToAllTypes(NetworkType type) {
return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1<<type);
}
private:
inline void setType(NetworkType type) {
switch (type) {
case TYPE_WIFI:
mType = 100;
break;
case TYPE_ETHERNET:
mType = 101;
break;
case TYPE_BLUETOOTH:
mType = 102;
break;
case TYPE_MOBILE:
mType = 201;
break;
case TYPE_DUN:
mType = 202;
break;
case TYPE_HIPRI:
mType = 203;
break;
case TYPE_MMS:
mType = 204;
break;
case TYPE_SUPL:
mType = 205;
break;
case TYPE_WIMAX:
mType = 220;
break;
default:
mType = 300;
break;
}
}
};
class ServiceStatusDataItem: public IDataItemCore {
public:
ServiceStatusDataItem(int32_t serviceState = SERVICESTATUS_DEFAULT_STATE) :
mServiceState (serviceState) {mId = SERVICESTATUS_DATA_ITEM_ID;}
virtual ~ServiceStatusDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
int32_t mServiceState;
};
class ModelDataItem: public IDataItemCore {
public:
ModelDataItem(const string & name = "") :
mModel (name) {mId = MODEL_DATA_ITEM_ID;}
virtual ~ModelDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
string mModel;
};
class ManufacturerDataItem: public IDataItemCore {
public:
ManufacturerDataItem(const string & name = "") :
mManufacturer (name) {mId = MANUFACTURER_DATA_ITEM_ID;}
virtual ~ManufacturerDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
string mManufacturer;
};
class RilServiceInfoDataItem : public IDataItemCore {
public:
inline RilServiceInfoDataItem() :
mData(nullptr) {mId = RILSERVICEINFO_DATA_ITEM_ID;}
inline virtual ~RilServiceInfoDataItem() { if (nullptr != mData) free(mData); }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copyFrom(IDataItemCore* src) {
memcpy(mData, ((RilServiceInfoDataItem*)src)->mData, mLength);
return 0;
}
inline RilServiceInfoDataItem(const RilServiceInfoDataItem& peer) :
RilServiceInfoDataItem() {
mLength = peer.mLength;
mData = malloc(mLength);
memcpy(mData, peer.mData, mLength);
peer.setPeerData(*this);
}
inline virtual bool operator==(const RilServiceInfoDataItem& other) const {
return other.mData == mData;
}
inline virtual void setPeerData(RilServiceInfoDataItem& /*peer*/) const {}
void* mData;
int mLength;
};
class RilCellInfoDataItem : public IDataItemCore {
public:
inline RilCellInfoDataItem() :
mData(nullptr) {mId = RILCELLINFO_DATA_ITEM_ID;}
inline virtual ~RilCellInfoDataItem() { if (nullptr != mData) free(mData); }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copyFrom(IDataItemCore* src) {
memcpy(mData, ((RilCellInfoDataItem*)src)->mData, mLength);
return 0;
}
inline RilCellInfoDataItem(const RilCellInfoDataItem& peer) :
RilCellInfoDataItem() {
mLength = peer.mLength;
mData = malloc(mLength);
memcpy(mData, peer.mData, mLength);
peer.setPeerData(*this);
}
inline virtual bool operator==(const RilCellInfoDataItem& other) const {
return other.mData == mData;
}
inline virtual void setPeerData(RilCellInfoDataItem& /*peer*/) const {}
void* mData;
int mLength;
};
class WifiSupplicantStatusDataItem: public IDataItemCore {
public:
WifiSupplicantStatusDataItem() :
mState((WifiSupplicantState)WIFI_SUPPLICANT_DEFAULT_STATE),
mApMacAddressValid(false),
mWifiApSsidValid(false) {
mId = WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID;
memset (mApMacAddress, 0, sizeof (mApMacAddress));
mWifiApSsid.clear();
}
virtual ~WifiSupplicantStatusDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
typedef enum WifiSupplicantState {
DISCONNECTED,
INTERFACE_DISABLED,
INACTIVE,
SCANNING,
AUTHENTICATING,
ASSOCIATING,
ASSOCIATED,
FOUR_WAY_HANDSHAKE,
GROUP_HANDSHAKE,
COMPLETED,
DORMANT,
UNINITIALIZED,
INVALID
} WifiSupplicantState;
/* Represents whether access point attach state*/
WifiSupplicantState mState;
/* Represents info on whether ap mac address is valid */
bool mApMacAddressValid;
/* Represents mac address of the wifi access point*/
uint8_t mApMacAddress[MAC_ADDRESS_LENGTH];
/* Represents info on whether ap SSID is valid */
bool mWifiApSsidValid;
/* Represents Wifi SSID string*/
string mWifiApSsid;
};
class TacDataItem: public IDataItemCore {
public:
TacDataItem(const string & name = "") :
mValue (name) {mId = TAC_DATA_ITEM_ID;}
virtual ~TacDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
string mValue;
};
class MccmncDataItem: public IDataItemCore {
public:
MccmncDataItem(const string & name = "") :
mValue(name) {mId = MCCMNC_DATA_ITEM_ID;}
virtual ~MccmncDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
string mValue;
};
class SrnDeviceScanDetailsDataItem: public IDataItemCore {
public:
SrnDeviceScanDetailsDataItem(DataItemId Id) :
mValidSrnData(false),
mApSrnRssi(-1),
mApSrnTimestamp(0),
mRequestTimestamp(0),
mReceiveTimestamp(0),
mErrorCause(-1) {mId = Id;}
virtual ~SrnDeviceScanDetailsDataItem() {}
// Data members common to all SRN tech types
/* Represents info on whether SRN data is valid (no error)*/
bool mValidSrnData;
/* SRN device RSSI reported */
int32_t mApSrnRssi;
/* MAC adress of SRN device */
uint8_t mApSrnMacAddress[SRN_MAC_ADDRESS_LENGTH];
/* UTC timestamp at which the scan was requested.for this SRN device*/
int64_t mApSrnTimestamp;
/* UTC timestamp at which the scan was started. */
int64_t mRequestTimestamp;
/* UTC timestamp at which the scan was received.*/
int64_t mReceiveTimestamp;
/* Reason for the error/failure if SRN details are not valid */
int32_t mErrorCause;
};
class BtDeviceScanDetailsDataItem: public SrnDeviceScanDetailsDataItem {
public:
BtDeviceScanDetailsDataItem() :
SrnDeviceScanDetailsDataItem(BT_SCAN_DATA_ITEM_ID) {}
virtual ~BtDeviceScanDetailsDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
};
class BtLeDeviceScanDetailsDataItem: public SrnDeviceScanDetailsDataItem {
public:
BtLeDeviceScanDetailsDataItem() :
SrnDeviceScanDetailsDataItem(BTLE_SCAN_DATA_ITEM_ID) {}
virtual ~BtLeDeviceScanDetailsDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
};
class BatteryLevelDataItem: public IDataItemCore {
public:
inline BatteryLevelDataItem(uint8_t batteryPct = BATTERY_PCT_DEFAULT) :
mBatteryPct(batteryPct) {mId = BATTERY_LEVEL_DATA_ITEM_ID;}
inline ~BatteryLevelDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
uint8_t mBatteryPct;
};
class LocFeatureStatusDataItem: public IDataItemCore {
public:
LocFeatureStatusDataItem(std::unordered_set<int> fids) :
mFids(fids) {mId = LOC_FEATURE_STATUS_DATA_ITEM_ID;}
virtual ~LocFeatureStatusDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
std::unordered_set<int> mFids;
};
class InEmergencyCallDataItem: public IDataItemCore {
public:
InEmergencyCallDataItem(bool isEmergency = false) :
mIsEmergency(isEmergency) {mId = IN_EMERGENCY_CALL_DATA_ITEM_ID;}
virtual ~InEmergencyCallDataItem() {}
virtual void stringify(string& /*valueStr*/) override;
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
// Data members
bool mIsEmergency;
};
} // namespace loc_core
#endif //DATAITEM_CONCRETETYPES_H

View File

@@ -1,555 +0,0 @@
/* Copyright (c) 2015-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 __DATAITEMCONCRETEBASETYPES__
#define __DATAITEMCONCRETEBASETYPES__
#include <string>
#include <cstring>
#include <sstream>
#include <DataItemId.h>
#include <IDataItemCore.h>
#include <gps_extended_c.h>
#include <inttypes.h>
#define MAC_ADDRESS_LENGTH 6
// MAC address length in bytes
// QMI_LOC_SRN_MAC_ADDR_LENGTH_V02
#define SRN_MAC_ADDRESS_LENGTH 6
#define WIFI_SUPPLICANT_DEFAULT_STATE 0
static constexpr char sDelimit = ':';
namespace loc_core
{
using namespace std;
enum NetworkType {
TYPE_MOBILE = 0,
TYPE_WIFI,
TYPE_ETHERNET,
TYPE_BLUETOOTH,
TYPE_MMS,
TYPE_SUPL,
TYPE_DUN,
TYPE_HIPRI,
TYPE_WIMAX,
TYPE_PROXY,
TYPE_UNKNOWN,
};
typedef struct NetworkInfoType
{
// Unique network handle ID
uint64_t networkHandle;
// Type of network for corresponding network handle
NetworkType networkType;
NetworkInfoType() : networkHandle(NETWORK_HANDLE_UNKNOWN), networkType(TYPE_UNKNOWN) {}
NetworkInfoType(string strObj) {
size_t posDelimit = strObj.find(sDelimit);
if ( posDelimit != string::npos) {
int32_t type = TYPE_UNKNOWN;
string handleStr = strObj.substr(0, posDelimit);
string typeStr = strObj.substr(posDelimit + 1, strObj.length() - posDelimit - 1);
stringstream(handleStr) >> networkHandle;
stringstream(typeStr) >> type;
networkType = (NetworkType) type;
} else {
networkHandle = NETWORK_HANDLE_UNKNOWN;
networkType = TYPE_UNKNOWN;
}
}
bool operator== (const NetworkInfoType& other) {
return ((networkHandle == other.networkHandle) && (networkType == other.networkType));
}
string toString() {
string valueStr;
valueStr.clear ();
char nethandle [32];
memset (nethandle, 0, 32);
snprintf(nethandle, sizeof(nethandle), "%" PRIu64, networkHandle);
valueStr += string(nethandle);
valueStr += sDelimit;
char type [12];
memset (type, 0, 12);
snprintf (type, 12, "%u", networkType);
valueStr += string (type);
return valueStr;
}
} NetworkInfoType;
class AirplaneModeDataItemBase : public IDataItemCore {
public:
AirplaneModeDataItemBase(bool mode):
mMode(mode),
mId(AIRPLANEMODE_DATA_ITEM_ID) {}
virtual ~AirplaneModeDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mMode;
protected:
DataItemId mId;
};
class ENHDataItemBase : public IDataItemCore {
public:
ENHDataItemBase(bool enabled) :
mEnabled(enabled),
mId(ENH_DATA_ITEM_ID) {}
virtual ~ENHDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mEnabled;
protected:
DataItemId mId;
};
class GPSStateDataItemBase : public IDataItemCore {
public:
GPSStateDataItemBase(bool enabled) :
mEnabled(enabled),
mId(GPSSTATE_DATA_ITEM_ID) {}
virtual ~GPSStateDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mEnabled;
protected:
DataItemId mId;
};
class NLPStatusDataItemBase : public IDataItemCore {
public:
NLPStatusDataItemBase(bool enabled) :
mEnabled(enabled),
mId(NLPSTATUS_DATA_ITEM_ID) {}
virtual ~NLPStatusDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mEnabled;
protected:
DataItemId mId;
};
class WifiHardwareStateDataItemBase : public IDataItemCore {
public:
WifiHardwareStateDataItemBase(bool enabled) :
mEnabled(enabled),
mId(WIFIHARDWARESTATE_DATA_ITEM_ID) {}
virtual ~WifiHardwareStateDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mEnabled;
protected:
DataItemId mId;
};
class ScreenStateDataItemBase : public IDataItemCore {
public:
ScreenStateDataItemBase(bool state) :
mState(state),
mId(SCREEN_STATE_DATA_ITEM_ID) {}
virtual ~ScreenStateDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mState;
protected:
DataItemId mId;
};
class PowerConnectStateDataItemBase : public IDataItemCore {
public:
PowerConnectStateDataItemBase(bool state) :
mState(state),
mId(POWER_CONNECTED_STATE_DATA_ITEM_ID) {}
virtual ~PowerConnectStateDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mState;
protected:
DataItemId mId;
};
class TimeZoneChangeDataItemBase : public IDataItemCore {
public:
TimeZoneChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) :
mCurrTimeMillis (currTimeMillis),
mRawOffsetTZ (rawOffset),
mDstOffsetTZ (dstOffset),
mId(TIMEZONE_CHANGE_DATA_ITEM_ID) {}
virtual ~TimeZoneChangeDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
int64_t mCurrTimeMillis;
int32_t mRawOffsetTZ;
int32_t mDstOffsetTZ;
protected:
DataItemId mId;
};
class TimeChangeDataItemBase : public IDataItemCore {
public:
TimeChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) :
mCurrTimeMillis (currTimeMillis),
mRawOffsetTZ (rawOffset),
mDstOffsetTZ (dstOffset),
mId(TIME_CHANGE_DATA_ITEM_ID) {}
virtual ~TimeChangeDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
int64_t mCurrTimeMillis;
int32_t mRawOffsetTZ;
int32_t mDstOffsetTZ;
protected:
DataItemId mId;
};
class ShutdownStateDataItemBase : public IDataItemCore {
public:
ShutdownStateDataItemBase(bool state) :
mState (state),
mId(SHUTDOWN_STATE_DATA_ITEM_ID) {}
virtual ~ShutdownStateDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mState;
protected:
DataItemId mId;
};
class AssistedGpsDataItemBase : public IDataItemCore {
public:
AssistedGpsDataItemBase(bool enabled) :
mEnabled(enabled),
mId(ASSISTED_GPS_DATA_ITEM_ID) {}
virtual ~AssistedGpsDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
bool mEnabled;
protected:
DataItemId mId;
};
class NetworkInfoDataItemBase : public IDataItemCore {
public:
NetworkInfoDataItemBase(
NetworkType initialType, int32_t type, string typeName, string subTypeName,
bool available, bool connected, bool roaming, uint64_t networkHandle, string apn):
mAllTypes(typeToAllTypes(initialType)),
mType(type),
mTypeName(typeName),
mSubTypeName(subTypeName),
mAvailable(available),
mConnected(connected),
mRoaming(roaming),
mNetworkHandle(networkHandle),
mApn(apn), mId(NETWORKINFO_DATA_ITEM_ID) {
mAllNetworkHandles[0].networkHandle = networkHandle;
mAllNetworkHandles[0].networkType = initialType;
}
virtual ~NetworkInfoDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
inline virtual NetworkType getType(void) const {
return (NetworkType)mType;
}
inline uint64_t getAllTypes() { return mAllTypes; }
inline NetworkInfoType* getNetworkHandle() {
return &mAllNetworkHandles[0];
}
// Data members
uint64_t mAllTypes;
int32_t mType;
string mTypeName;
string mSubTypeName;
bool mAvailable;
bool mConnected;
bool mRoaming;
NetworkInfoType mAllNetworkHandles[MAX_NETWORK_HANDLES];
uint64_t mNetworkHandle;
string mApn;
protected:
DataItemId mId;
inline uint64_t typeToAllTypes(NetworkType type) {
return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1<<type);
}
};
class ServiceStatusDataItemBase : public IDataItemCore {
public:
ServiceStatusDataItemBase(int32_t serviceState) :
mServiceState (serviceState),
mId(SERVICESTATUS_DATA_ITEM_ID) {}
virtual ~ServiceStatusDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
int32_t mServiceState;
protected:
DataItemId mId;
};
class ModelDataItemBase : public IDataItemCore {
public:
ModelDataItemBase(const string & name) :
mModel (name),
mId(MODEL_DATA_ITEM_ID) {}
virtual ~ModelDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
string mModel;
protected:
DataItemId mId;
};
class ManufacturerDataItemBase : public IDataItemCore {
public:
ManufacturerDataItemBase(const string & name) :
mManufacturer (name),
mId(MANUFACTURER_DATA_ITEM_ID) {}
virtual ~ManufacturerDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
string mManufacturer;
protected:
DataItemId mId;
};
class RilServiceInfoDataItemBase : public IDataItemCore {
public:
inline RilServiceInfoDataItemBase() :
mData(nullptr), mId(RILSERVICEINFO_DATA_ITEM_ID) {}
inline virtual ~RilServiceInfoDataItemBase() { if (nullptr != mData) free(mData); }
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
inline RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase& peer) :
RilServiceInfoDataItemBase() {
peer.setPeerData(*this);
}
inline virtual bool operator==(const RilServiceInfoDataItemBase& other) const {
return other.mData == mData;
}
inline virtual void setPeerData(RilServiceInfoDataItemBase& /*peer*/) const {}
void* mData;
protected:
DataItemId mId;
};
class RilCellInfoDataItemBase : public IDataItemCore {
public:
inline RilCellInfoDataItemBase() :
mData(nullptr), mId(RILCELLINFO_DATA_ITEM_ID) {}
inline virtual ~RilCellInfoDataItemBase() { if (nullptr != mData) free(mData); }
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
inline RilCellInfoDataItemBase(const RilCellInfoDataItemBase& peer) :
RilCellInfoDataItemBase() {
peer.setPeerData(*this);
}
inline virtual bool operator==(const RilCellInfoDataItemBase& other) const {
return other.mData == mData;
}
inline virtual void setPeerData(RilCellInfoDataItemBase& /*peer*/) const {}
void* mData;
protected:
DataItemId mId;
};
class WifiSupplicantStatusDataItemBase : public IDataItemCore {
public:
WifiSupplicantStatusDataItemBase() :
mState((WifiSupplicantState)WIFI_SUPPLICANT_DEFAULT_STATE),
mApMacAddressValid(false),
mWifiApSsidValid(false),
mId(WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID) {
memset (&mApMacAddress, 0, sizeof (mApMacAddress));
mWifiApSsid.clear();
}
virtual ~WifiSupplicantStatusDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
typedef enum WifiSupplicantState {
DISCONNECTED,
INTERFACE_DISABLED,
INACTIVE,
SCANNING,
AUTHENTICATING,
ASSOCIATING,
ASSOCIATED,
FOUR_WAY_HANDSHAKE,
GROUP_HANDSHAKE,
COMPLETED,
DORMANT,
UNINITIALIZED,
INVALID
} WifiSupplicantState;
/* Represents whether access point attach state*/
WifiSupplicantState mState;
/* Represents info on whether ap mac address is valid */
bool mApMacAddressValid;
/* Represents mac address of the wifi access point*/
uint8_t mApMacAddress[MAC_ADDRESS_LENGTH];
/* Represents info on whether ap SSID is valid */
bool mWifiApSsidValid;
/* Represents Wifi SSID string*/
string mWifiApSsid;
protected:
DataItemId mId;
};
class TacDataItemBase : public IDataItemCore {
public:
TacDataItemBase(const string & name) :
mValue (name),
mId(TAC_DATA_ITEM_ID) {}
virtual ~TacDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
string mValue;
protected:
DataItemId mId;
};
class MccmncDataItemBase : public IDataItemCore {
public:
MccmncDataItemBase(const string & name) :
mValue(name),
mId(MCCMNC_DATA_ITEM_ID) {}
virtual ~MccmncDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
// Data members
string mValue;
protected:
DataItemId mId;
};
class SrnDeviceScanDetailsDataItemBase : public IDataItemCore {
public:
SrnDeviceScanDetailsDataItemBase(DataItemId Id) :
mValidSrnData(false),
mApSrnRssi(-1),
mApSrnTimestamp(0),
mRequestTimestamp(0),
mReceiveTimestamp(0),
mErrorCause(-1),
mId(Id) {}
virtual ~SrnDeviceScanDetailsDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
// Data members common to all SRN tech types
/* Represents info on whether SRN data is valid (no error)*/
bool mValidSrnData;
/* SRN device RSSI reported */
int32_t mApSrnRssi;
/* MAC adress of SRN device */
uint8_t mApSrnMacAddress[SRN_MAC_ADDRESS_LENGTH];
/* UTC timestamp at which the scan was requested.for this SRN device*/
int64_t mApSrnTimestamp;
/* UTC timestamp at which the scan was started. */
int64_t mRequestTimestamp;
/* UTC timestamp at which the scan was received.*/
int64_t mReceiveTimestamp;
/* Reason for the error/failure if SRN details are not valid */
int32_t mErrorCause;
protected:
DataItemId mId;
};
class BtDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase {
public:
BtDeviceScanDetailsDataItemBase() :
SrnDeviceScanDetailsDataItemBase(BT_SCAN_DATA_ITEM_ID) {}
virtual ~BtDeviceScanDetailsDataItemBase() {}
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
};
class BtLeDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase {
public:
BtLeDeviceScanDetailsDataItemBase() :
SrnDeviceScanDetailsDataItemBase(BTLE_SCAN_DATA_ITEM_ID) {}
virtual ~BtLeDeviceScanDetailsDataItemBase() {}
virtual void stringify(string& /*valueStr*/) {}
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
};
class BatteryLevelDataItemBase : public IDataItemCore {
public:
inline BatteryLevelDataItemBase(uint8_t batteryPct) :
mBatteryPct(batteryPct), mId(BATTERY_LEVEL_DATA_ITEM_ID) {}
inline ~BatteryLevelDataItemBase() {}
inline virtual DataItemId getId() { return mId; }
// Data members
uint8_t mBatteryPct;
protected:
DataItemId mId;
};
} // namespace loc_core
#endif //__DATAITEMCONCRETEBASETYPES__

View File

@@ -72,6 +72,8 @@ typedef enum e_DataItemId {
// 26 -
BATTERY_LEVEL_DATA_ITEM_ID,
IN_EMERGENCY_CALL_DATA_ITEM_ID,
LOC_FEATURE_STATUS_DATA_ITEM_ID,
MAX_DATA_ITEM_ID_1_1,
} DataItemId;

View File

@@ -32,50 +32,101 @@
#include <DataItemId.h>
#include <IDataItemCore.h>
#include <DataItemsFactoryProxy.h>
#include <DataItemConcreteTypes.h>
#include <loc_pla.h>
#include <log_util.h>
#include "loc_misc_utils.h"
namespace loc_core
{
void* DataItemsFactoryProxy::dataItemLibHandle = NULL;
get_concrete_data_item_fn* DataItemsFactoryProxy::getConcreteDIFunc = NULL;
IDataItemCore* DataItemsFactoryProxy::createNewDataItem(DataItemId id)
{
IDataItemCore* DataItemsFactoryProxy::createNewDataItem(IDataItemCore* dataItem) {
IDataItemCore *mydi = nullptr;
if (NULL != getConcreteDIFunc) {
mydi = (*getConcreteDIFunc)(id);
}
else {
getConcreteDIFunc = (get_concrete_data_item_fn * )
dlGetSymFromLib(dataItemLibHandle, DATA_ITEMS_LIB_NAME, DATA_ITEMS_GET_CONCRETE_DI);
if (NULL != getConcreteDIFunc) {
LOC_LOGd("Loaded function %s : %p", DATA_ITEMS_GET_CONCRETE_DI, getConcreteDIFunc);
mydi = (*getConcreteDIFunc)(id);
}
else {
// dlysm failed.
const char * err = dlerror();
if (NULL == err)
{
err = "Unknown";
}
LOC_LOGe("failed to find symbol %s; error=%s", DATA_ITEMS_GET_CONCRETE_DI, err);
}
}
switch (dataItem->getId()) {
case AIRPLANEMODE_DATA_ITEM_ID:
mydi = new AirplaneModeDataItem(*((AirplaneModeDataItem*)dataItem));
break;
case ENH_DATA_ITEM_ID:
mydi = new ENHDataItem(*((ENHDataItem*)dataItem));
break;
case GPSSTATE_DATA_ITEM_ID:
mydi = new GPSStateDataItem(*((GPSStateDataItem*)dataItem));
break;
case NLPSTATUS_DATA_ITEM_ID:
mydi = new NLPStatusDataItem(*((NLPStatusDataItem*)dataItem));
break;
case WIFIHARDWARESTATE_DATA_ITEM_ID:
mydi = new WifiHardwareStateDataItem(*((WifiHardwareStateDataItem*)dataItem));
break;
case NETWORKINFO_DATA_ITEM_ID:
mydi = new NetworkInfoDataItem(*((NetworkInfoDataItem*)dataItem));
break;
case SERVICESTATUS_DATA_ITEM_ID:
mydi = new ServiceStatusDataItem(*((ServiceStatusDataItem*)dataItem));
break;
case RILCELLINFO_DATA_ITEM_ID:
mydi = new RilCellInfoDataItem(*((RilCellInfoDataItem*)dataItem));
break;
case RILSERVICEINFO_DATA_ITEM_ID:
mydi = new RilServiceInfoDataItem(*((RilServiceInfoDataItem*)dataItem));
break;
case MODEL_DATA_ITEM_ID:
mydi = new ModelDataItem(*((ModelDataItem*)dataItem));
break;
case MANUFACTURER_DATA_ITEM_ID:
mydi = new ManufacturerDataItem(*((ManufacturerDataItem*)dataItem));
break;
case IN_EMERGENCY_CALL_DATA_ITEM_ID:
mydi = new InEmergencyCallDataItem(*((InEmergencyCallDataItem*)dataItem));
break;
case ASSISTED_GPS_DATA_ITEM_ID:
mydi = new AssistedGpsDataItem(*((AssistedGpsDataItem*)dataItem));
break;
case SCREEN_STATE_DATA_ITEM_ID:
mydi = new ScreenStateDataItem(*((ScreenStateDataItem*)dataItem));
break;
case POWER_CONNECTED_STATE_DATA_ITEM_ID:
mydi = new PowerConnectStateDataItem(*((PowerConnectStateDataItem*)dataItem));
break;
case TIMEZONE_CHANGE_DATA_ITEM_ID:
mydi = new TimeZoneChangeDataItem(*((TimeZoneChangeDataItem*)dataItem));
break;
case TIME_CHANGE_DATA_ITEM_ID:
mydi = new TimeChangeDataItem(*((TimeChangeDataItem*)dataItem));
break;
case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID:
mydi = new WifiSupplicantStatusDataItem(*((WifiSupplicantStatusDataItem*)dataItem));
break;
case SHUTDOWN_STATE_DATA_ITEM_ID:
mydi = new ShutdownStateDataItem(*((ShutdownStateDataItem*)dataItem));
break;
case TAC_DATA_ITEM_ID:
mydi = new TacDataItem(*((TacDataItem*)dataItem));
break;
case MCCMNC_DATA_ITEM_ID:
mydi = new MccmncDataItem(*((MccmncDataItem*)dataItem));
break;
case BTLE_SCAN_DATA_ITEM_ID:
mydi = new BtLeDeviceScanDetailsDataItem(*((BtLeDeviceScanDetailsDataItem*)dataItem));
break;
case BT_SCAN_DATA_ITEM_ID:
mydi = new BtDeviceScanDetailsDataItem(*((BtDeviceScanDetailsDataItem*)dataItem));
break;
case BATTERY_LEVEL_DATA_ITEM_ID:
mydi = new BatteryLevelDataItem(*((BatteryLevelDataItem*)dataItem));
break;
case LOC_FEATURE_STATUS_DATA_ITEM_ID:
mydi = new LocFeatureStatusDataItem(*((LocFeatureStatusDataItem*)dataItem));
break;
case INVALID_DATA_ITEM_ID:
case MAX_DATA_ITEM_ID:
default:
break;
};
return mydi;
}
void DataItemsFactoryProxy::closeDataItemLibraryHandle()
{
if (NULL != dataItemLibHandle) {
dlclose(dataItemLibHandle);
dataItemLibHandle = NULL;
}
}
} // namespace loc_core

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* 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
@@ -35,18 +35,9 @@
namespace loc_core
{
#define DATA_ITEMS_LIB_NAME "libdataitems.so"
#define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem"
typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId);
class DataItemsFactoryProxy {
public:
static IDataItemCore* createNewDataItem(DataItemId id);
static void closeDataItemLibraryHandle();
static void *dataItemLibHandle;
static get_concrete_data_item_fn *getConcreteDIFunc;
static IDataItemCore* createNewDataItem(IDataItemCore* di);
};
} // namespace loc_core

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved.
/* Copyright (c) 2015, 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
@@ -49,7 +49,7 @@ public:
* @details Gets Data item id.
* @return Data item id.
*/
virtual DataItemId getId () = 0;
inline DataItemId getId() { return mId; }
/**
* @brief Stringify.
@@ -68,13 +68,15 @@ public:
*
* @return Zero for success or non zero for failure.
*/
virtual int32_t copy (IDataItemCore * src, bool *dataItemCopied = nullptr) = 0;
virtual int32_t copyFrom(IDataItemCore * src) = 0;
/**
* @brief Destructor.
* @details Destructor.
*/
virtual ~IDataItemCore () {}
protected:
DataItemId mId = INVALID_DATA_ITEM_ID;
};
} // namespace loc_core

View File

@@ -4,7 +4,7 @@
ERR_ESTIMATE=0
#NTP server
NTP_SERVER=time.xtracloud.net
NTP_SERVER=1.android.pool.ntp.org
NTP_SERVER_2=asia.pool.ntp.org
NTP_SERVER_3=0.cn.pool.ntp.org

View File

@@ -123,6 +123,7 @@ GnssAdapter::GnssAdapter() :
mOdcpiRequestCb(nullptr),
mOdcpiRequestActive(false),
mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW),
mOdcpiStateMask(0),
mOdcpiTimer(this),
mOdcpiRequest(),
mLastDeleteAidingDataTime(0),
@@ -176,8 +177,7 @@ GnssAdapter::GnssAdapter() :
doneInit();
}
void
GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks)
void GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks)
{
struct MsgSetControlCallbacks : public LocMsg {
GnssAdapter& mAdapter;
@@ -2690,48 +2690,6 @@ void GnssAdapter::checkAndRestartTimeBasedSession()
}
}
LocationCapabilitiesMask
GnssAdapter::getCapabilities()
{
LocationCapabilitiesMask mask = 0;
uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities();
// time based tracking always supported
mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT;
// geofence always supported
mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT;
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::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;
}
if (ContextBase::gnssConstellationConfig()) {
mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_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;
}
//Get QWES feature status mask
mask |= ContextBase::getQwesFeatureStatus();
return mask;
}
void
GnssAdapter::notifyClientOfCachedLocationSystemInfo(
LocationAPI* client, const LocationCallbacks& callbacks) {
@@ -4822,6 +4780,7 @@ GnssAdapter::requestOdcpiEvent(OdcpiRequestInfo& request)
void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
{
if (nullptr != mOdcpiRequestCb) {
bool sendEmergencyCallStatusEvent = false;
LOC_LOGd("request: type %d, tbf %d, isEmergency %d"
" requestActive: %d timerActive: %d",
request.type, request.tbfMillis, request.isEmergencyMode,
@@ -4829,23 +4788,26 @@ void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
// ODCPI START and ODCPI STOP from modem can come in quick succession
// so the mOdcpiTimer helps avoid spamming the framework as well as
// extending the odcpi session past 30 seconds if needed
if (ODCPI_REQUEST_TYPE_START == request.type) {
if (false == mOdcpiRequestActive && false == mOdcpiTimer.isActive()) {
mOdcpiRequestCb(request);
mOdcpiRequestActive = true;
if (!(mOdcpiStateMask & ODCPI_REQ_ACTIVE) && false == mOdcpiTimer.isActive()) {
fireOdcpiRequest(request);
mOdcpiStateMask |= ODCPI_REQ_ACTIVE;
mOdcpiTimer.start();
sendEmergencyCallStatusEvent = true;
// if the current active odcpi session is non-emergency, and the new
// odcpi request is emergency, replace the odcpi request with new request
// and restart the timer
} else if (false == mOdcpiRequest.isEmergencyMode &&
true == request.isEmergencyMode) {
mOdcpiRequestCb(request);
mOdcpiRequestActive = true;
fireOdcpiRequest(request);
mOdcpiStateMask |= ODCPI_REQ_ACTIVE;
if (true == mOdcpiTimer.isActive()) {
mOdcpiTimer.restart();
} else {
mOdcpiTimer.start();
}
sendEmergencyCallStatusEvent = true;
// if ODCPI request is not active but the timer is active, then
// just update the active state and wait for timer to expire
// before requesting new ODCPI to avoid spamming ODCPI requests
@@ -4858,11 +4820,22 @@ void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
// to avoid spamming more odcpi requests to the framework
} else if (ODCPI_REQUEST_TYPE_STOP == request.type) {
LOC_LOGd("request: type %d, isEmergency %d", request.type, request.isEmergencyMode);
mOdcpiRequestCb(request);
mOdcpiRequestActive = false;
fireOdcpiRequest(request);
mOdcpiStateMask = 0;
sendEmergencyCallStatusEvent = true;
} else {
LOC_LOGE("Invalid ODCPI request type..");
}
// Raise InEmergencyCall event
if (sendEmergencyCallStatusEvent && request.isEmergencyMode) {
SystemStatus* systemstatus = getSystemStatus();
if (nullptr != systemstatus) {
systemstatus->eventInEmergencyCall(0 != mOdcpiStateMask);
} else {
LOC_LOGe("Failed to get system status instance.");
}
}
} else {
LOC_LOGw("ODCPI request not supported");
}
@@ -4902,9 +4875,6 @@ bool GnssAdapter::reportQwesCapabilities(
mAdapter(adapter),
mFeatureMap(std::move(featureMap)) {}
inline virtual void proc() const {
LOC_LOGi("ReportQwesFeatureStatus before caps %" PRIx64 " ",
mAdapter.getCapabilities());
ContextBase::setQwesFeatureStatus(mFeatureMap);
LOC_LOGi("ReportQwesFeatureStatus After caps %" PRIx64 " ",
mAdapter.getCapabilities());
mAdapter.broadcastCapabilities(mAdapter.getCapabilities());
@@ -4916,36 +4886,84 @@ bool GnssAdapter::reportQwesCapabilities(
}
void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback,
OdcpiPrioritytype priority)
OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask)
{
struct MsgInitOdcpi : public LocMsg {
GnssAdapter& mAdapter;
OdcpiRequestCallback mOdcpiCb;
OdcpiPrioritytype mPriority;
OdcpiCallbackTypeMask mTypeMask;
inline MsgInitOdcpi(GnssAdapter& adapter,
const OdcpiRequestCallback& callback,
OdcpiPrioritytype priority) :
OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask) :
LocMsg(),
mAdapter(adapter),
mOdcpiCb(callback), mPriority(priority){}
mOdcpiCb(callback), mPriority(priority),
mTypeMask(typeMask) {}
inline virtual void proc() const {
mAdapter.initOdcpi(mOdcpiCb, mPriority);
mAdapter.initOdcpi(mOdcpiCb, mPriority, mTypeMask);
}
};
sendMsg(new MsgInitOdcpi(*this, callback, priority));
sendMsg(new MsgInitOdcpi(*this, callback, priority, typeMask));
}
void GnssAdapter::deRegisterOdcpiCommand(OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask) {
struct MsgDeRegisterNonEsOdcpi : public LocMsg {
GnssAdapter& mAdapter;
OdcpiPrioritytype mPriority;
OdcpiCallbackTypeMask mTypeMask;
inline MsgDeRegisterNonEsOdcpi(GnssAdapter& adapter,
OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask) :
LocMsg(),
mAdapter(adapter),
mPriority(priority),
mTypeMask(typeMask) {}
inline virtual void proc() const {
mAdapter.deRegisterOdcpi(mPriority, mTypeMask);
}
};
sendMsg(new MsgDeRegisterNonEsOdcpi(*this, priority, typeMask));
}
void GnssAdapter::fireOdcpiRequest(const OdcpiRequestInfo& request) {
if (request.isEmergencyMode) {
mOdcpiRequestCb(request);
} else {
std::unordered_map<OdcpiPrioritytype, OdcpiRequestCallback>::iterator iter;
for (int priority = ODCPI_HANDLER_PRIORITY_HIGH;
priority >= ODCPI_HANDLER_PRIORITY_LOW && iter == mNonEsOdcpiReqCbMap.end();
priority--) {
iter = mNonEsOdcpiReqCbMap.find((OdcpiPrioritytype)priority);
}
if (iter != mNonEsOdcpiReqCbMap.end()) {
iter->second(request);
}
}
}
void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback,
OdcpiPrioritytype priority)
{
LOC_LOGd("In priority: %d, Curr priority: %d", priority, mCallbackPriority);
if (priority >= mCallbackPriority) {
mOdcpiRequestCb = callback;
mCallbackPriority = priority;
/* Register for WIFI request */
updateEvtMask(LOC_API_ADAPTER_BIT_REQUEST_WIFI,
LOC_REGISTRATION_MASK_ENABLED);
OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
if (typeMask & EMERGENCY_ODCPI) {
LOC_LOGd("In priority: %d, Curr priority: %d", priority, mCallbackPriority);
if (priority >= mCallbackPriority) {
mOdcpiRequestCb = callback;
mCallbackPriority = priority;
/* Register for WIFI request */
updateEvtMask(LOC_API_ADAPTER_BIT_REQUEST_WIFI,
LOC_REGISTRATION_MASK_ENABLED);
}
}
if (typeMask & NON_EMERGENCY_ODCPI) {
//If this is for non emergency odcpi,
//Only set callback to mNonEsOdcpiReqCbMap according to its priority
//Will overwrite callback with same priority in this map
mNonEsOdcpiReqCbMap[priority] = callback;
}
}
@@ -5005,8 +5023,8 @@ void GnssAdapter::odcpiTimerExpire()
// if ODCPI request is still active after timer
// expires, request again and restart timer
if (mOdcpiRequestActive) {
mOdcpiRequestCb(mOdcpiRequest);
if (mOdcpiStateMask & ODCPI_REQ_ACTIVE) {
fireOdcpiRequest(mOdcpiRequest);
mOdcpiTimer.restart();
} else {
mOdcpiTimer.stop();
@@ -5844,26 +5862,27 @@ GnssAdapter::nfwControlCommand(bool enable) {
mApi(api),
mEnable(enable) {}
inline virtual void proc() const {
GnssConfigGpsLock gpsLock;
gpsLock = ContextBase::mGps_conf.GPS_LOCK;
if (mEnable) {
gpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI;
if (mAdapter.mSupportNfwControl) {
GnssConfigGpsLock gpsLock;
gpsLock = ContextBase::mGps_conf.GPS_LOCK;
if (mEnable) {
gpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI;
} else {
gpsLock |= GNSS_CONFIG_GPS_LOCK_NI;
}
ContextBase::mGps_conf.GPS_LOCK = gpsLock;
mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock);
}));
} else {
gpsLock |= GNSS_CONFIG_GPS_LOCK_NI;
LOC_LOGw("NFW control is not supported, do not use this for NFW");
}
ContextBase::mGps_conf.GPS_LOCK = gpsLock;
mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock);
}));
}
};
if (mSupportNfwControl) {
sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable));
} else {
LOC_LOGw("NFW control is not supported, do not use this for NFW");
}
sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable));
}
// Set tunc constrained mode, use 0 session id to indicate
@@ -6518,8 +6537,7 @@ GnssAdapter::initEngHubProxyCommand() {
sendMsg(new MsgInitEngHubProxy(this));
}
bool
GnssAdapter::initEngHubProxy() {
bool GnssAdapter::initEngHubProxy() {
static bool firstTime = true;
static bool engHubLoadSuccessful = false;
@@ -6616,16 +6634,19 @@ GnssAdapter::initEngHubProxy() {
GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb =
[this] (const std::unordered_map<LocationQwesFeatureType, bool> &featureMap) {
ContextBase::setQwesFeatureStatus(featureMap);
reportQwesCapabilities(featureMap);
};
getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy");
if(getter != nullptr) {
EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(),
reportPositionEventCb,
reportSvEventCb, reqAidingDataCb,
updateNHzRequirementCb,
updateQwesFeatureStatusCb);
// Wait for the script(rootdir/etc/init.qcom.rc) to create socket folder
EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mContext,
mSystemStatus->getOsObserver(),
reportPositionEventCb, reportSvEventCb, reqAidingDataCb,
updateNHzRequirementCb, updateQwesFeatureStatusCb);
if (hubProxy != nullptr) {
mEngHubProxy = hubProxy;
engHubLoadSuccessful = true;

View File

@@ -42,6 +42,7 @@
#include <loc_misc_utils.h>
#include <queue>
#include <NativeAgpsHandler.h>
#include <unordered_map>
#define MAX_URL_LEN 256
#define NMEA_SENTENCE_MAX_LENGTH 200
@@ -258,10 +259,17 @@ class GnssAdapter : public LocAdapterBase {
OdcpiRequestCallback mOdcpiRequestCb;
bool mOdcpiRequestActive;
OdcpiPrioritytype mCallbackPriority;
typedef uint8_t OdcpiStateMask;
OdcpiStateMask mOdcpiStateMask;
typedef enum {
ODCPI_REQ_ACTIVE = (1<<0),
CIVIC_ADDRESS_REQ_ACTIVE = (1<<1)
} OdcpiStateBits;
OdcpiTimer mOdcpiTimer;
OdcpiRequestInfo mOdcpiRequest;
std::unordered_map<OdcpiPrioritytype, OdcpiRequestCallback> mNonEsOdcpiReqCbMap;
void odcpiTimerExpire();
std::function<void(const Location&)> mAddressRequestCb;
/* ==== DELETEAIDINGDATA =============================================================== */
int64_t mLastDeleteAidingDataTime;
@@ -300,8 +308,20 @@ class GnssAdapter : public LocAdapterBase {
int totalSvCntInThisConstellation);
/* ======== UTILITIES ================================================================== */
inline void initOdcpi(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
inline void initOdcpi(const OdcpiRequestCallback& callback,
OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask);
inline void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
if (typeMask & NON_EMERGENCY_ODCPI) {
mNonEsOdcpiReqCbMap.erase(priority);
}
}
inline void injectOdcpi(const Location& location);
void fireOdcpiRequest(const OdcpiRequestInfo& request);
//inline void setAddressRequestCb(const std::function<void(const Location&)>& addressRequestCb)
//{ mAddressRequestCb = addressRequestCb;}
//inline void injectLocationAndAddr(const Location& location, const GnssCivicAddress& addr)
//{ mLocApi->injectPositionAndCivicAddress(location, addr);}
static bool isFlpClient(LocationCallbacks& locationCallbacks);
/*==== DGnss Ntrip Source ==========================================================*/
@@ -468,8 +488,12 @@ public:
LocEngineRunState engState);
/* ========= ODCPI ===================================================================== */
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
void initOdcpiCommand(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
void initOdcpiCommand(const OdcpiRequestCallback& callback,
OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask);
void deRegisterOdcpiCommand(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
void injectOdcpiCommand(const Location& location);
/* ======== RESPONSES ================================================================== */
void reportResponse(LocationError err, uint32_t sessionId);
@@ -628,7 +652,6 @@ public:
void setSuplHostServer(const char* server, int port, LocServerType type);
void notifyClientOfCachedLocationSystemInfo(LocationAPI* client,
const LocationCallbacks& callbacks);
LocationCapabilitiesMask getCapabilities();
void updateSystemPowerStateCommand(PowerStateType systemPowerState);
/*==== DGnss Usable Report Flag ====================================================*/

View File

@@ -32,7 +32,7 @@
#include <SystemStatus.h>
#include <DataItemId.h>
#include <DataItemsFactoryProxy.h>
#include <DataItemConcreteTypesBase.h>
#include <DataItemConcreteTypes.h>
#include <loc_log.h>
#include <NativeAgpsHandler.h>
#include <GnssAdapter.h>
@@ -48,8 +48,8 @@ void NativeAgpsHandler::notify(const list<IDataItemCore*>& dlist) {
for (auto each : dlist) {
switch (each->getId()) {
case NETWORKINFO_DATA_ITEM_ID: {
NetworkInfoDataItemBase* networkInfo =
static_cast<NetworkInfoDataItemBase*>(each);
NetworkInfoDataItem* networkInfo =
static_cast<NetworkInfoDataItem*>(each);
uint64_t mobileBit = (uint64_t )1 << loc_core::TYPE_MOBILE;
uint64_t allTypes = networkInfo->mAllTypes;
mConnected = ((networkInfo->mAllTypes & mobileBit) == mobileBit);

View File

@@ -47,7 +47,7 @@
#include <LocAdapterBase.h>
#include <DataItemId.h>
#include <DataItemsFactoryProxy.h>
#include <DataItemConcreteTypesBase.h>
#include <DataItemConcreteTypes.h>
using namespace loc_util;
using namespace loc_core;
@@ -322,13 +322,10 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
const list<IDataItemCore*>& dataItemList) :
mXtraSysStatObj(xtraSysStatObs) {
for (auto eachItem : dataItemList) {
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(
eachItem->getId());
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(eachItem);
if (NULL == dataitem) {
break;
}
// Copy the contents of the data item
dataitem->copy(eachItem);
mDataItemList.push_back(dataitem);
}
@@ -349,8 +346,7 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
{
case NETWORKINFO_DATA_ITEM_ID:
{
NetworkInfoDataItemBase* networkInfo =
static_cast<NetworkInfoDataItemBase*>(each);
NetworkInfoDataItem* networkInfo = static_cast<NetworkInfoDataItem*>(each);
NetworkInfoType* networkHandleInfo =
static_cast<NetworkInfoType*>(networkInfo->getNetworkHandle());
mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(),
@@ -360,16 +356,14 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
case TAC_DATA_ITEM_ID:
{
TacDataItemBase* tac =
static_cast<TacDataItemBase*>(each);
TacDataItem* tac = static_cast<TacDataItem*>(each);
mXtraSysStatObj->updateTac(tac->mValue);
}
break;
case MCCMNC_DATA_ITEM_ID:
{
MccmncDataItemBase* mccmnc =
static_cast<MccmncDataItemBase*>(each);
MccmncDataItem* mccmnc = static_cast<MccmncDataItem*>(each);
mXtraSysStatObj->updateMccMnc(mccmnc->mValue);
}
break;

View File

@@ -27,6 +27,42 @@
*
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "GnssAdapter.h"
#include "location_interface.h"
@@ -73,7 +109,9 @@ static void enableNfwLocationAccess(bool enable);
static void nfwInit(const NfwCbInfo& cbInfo);
static void getPowerStateChanges(std::function<void(bool)> powerStateCb);
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask);
static void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
static void odcpiInject(const Location& location);
static void blockCPI(double latitude, double longitude, float accuracy,
@@ -135,6 +173,7 @@ static const GnssInterface gGnssInterface = {
getDebugReport,
updateConnectionStatus,
odcpiInit,
deRegisterOdcpi,
odcpiInject,
blockCPI,
getGnssEnergyConsumed,
@@ -379,10 +418,17 @@ static void updateConnectionStatus(bool connected, int8_t type,
}
}
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority)
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask)
{
if (NULL != gGnssAdapter) {
gGnssAdapter->initOdcpiCommand(callback, priority);
gGnssAdapter->initOdcpiCommand(callback, priority, typeMask);
}
}
static void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
if (NULL != gGnssAdapter) {
gGnssAdapter->deRegisterOdcpiCommand(priority, typeMask);
}
}

View File

@@ -30,7 +30,6 @@ PRODUCT_PACKAGES += gnss_antenna_info.conf
PRODUCT_PACKAGES += gnss@2.0-base.policy
PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy
PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy
PRODUCT_PACKAGES += gnss@2.0-xtwifi-inet-agent.policy
PRODUCT_PACKAGES += libloc_pla_headers
PRODUCT_PACKAGES += liblocation_api_headers
PRODUCT_PACKAGES += libgps.utils_headers

View File

@@ -25,6 +25,42 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_LocationAPI"

View File

@@ -26,6 +26,11 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_APIClientBase"
@@ -357,7 +362,8 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(TrackingOptions& options)
pthread_mutex_lock(&mMutex);
if (mLocationAPI) {
if (mTracking) {
LOC_LOGW("%s:%d] Existing tracking session present", __FUNCTION__, __LINE__);
pthread_mutex_unlock(&mMutex);
locAPIUpdateTrackingOptions(options);
} else {
uint32_t session = mLocationAPI->startTracking(options);
LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session);
@@ -367,11 +373,13 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(TrackingOptions& options)
mRequestQueues[REQUEST_TRACKING].reset(session);
mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this));
mTracking = true;
pthread_mutex_unlock(&mMutex);
}
retVal = LOCATION_ERROR_SUCCESS;
} else {
pthread_mutex_unlock(&mMutex);
}
pthread_mutex_unlock(&mMutex);
return retVal;
}

View File

@@ -26,6 +26,40 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LOCATIONDATATYPES_H
#define LOCATIONDATATYPES_H
@@ -238,77 +272,91 @@ typedef enum {
// Set of masks for Modem and QWES capabilities.
typedef uint64_t LocationCapabilitiesMask;
typedef enum {
// supports startTracking API with minInterval param
LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT = (1<<0),
// supports startBatching API with minInterval param
LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT = (1<<1),
// supports startTracking API with minDistance param
LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT = (1<<2),
// supports startBatching API with minDistance param
LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT = (1<<3),
// supports addGeofences API
LOCATION_CAPABILITIES_GEOFENCE_BIT = (1<<4),
// supports GnssMeasurementsCallback
LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT = (1<<5),
// supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based)
LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6),
// supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted)
LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7),
// supports debug nmea sentences in the debugNmeaCallback
LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8),
// support outdoor trip batching
LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9),
// support constellation enablement
LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT = (1<<10),
// support agpm
LOCATION_CAPABILITIES_AGPM_BIT = (1<<11),
// support location privacy
LOCATION_CAPABILITIES_PRIVACY_BIT = (1<<12),
// support measurement corrections
LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT = (1<<13),
// support Robust Location
LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT = (1<<14),
// support precise location edgnss
LOCATION_CAPABILITIES_EDGNSS_BIT = (1<<15),
// Modem supports Carrier Phase for Precise Positioning
// Measurement Engine (PPME).
LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT = (1<<16),
// Modem supports SV Polynomial for tightly coupled external
// DR support. This is a Standalone Feature.
LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT = (1<<17),
// Modem supports SV Ephemeris for tightly coupled external
// PPE engines. This is a Standalone Feature.
LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT = (1<<18),
// Modem supports GNSS Single Frequency feature. This is a
// Standalone Feature.
LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY = (1<<19),
// Modem supports GNSS Multi Frequency feature. Multi Frequency
// enables Single frequency also.
LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY = (1<<20),
// This mask indicates VPe license bundle is enabled. VEPP
// bundle include Carrier Phase and SV Polynomial features.
LOCATION_CAPABILITIES_QWES_VPE = (1<<21),
// This mask indicates support for CV2X Location basic features.
// This bundle includes features for GTS Time & Freq, C-TUNC
// (Constrained Time uncertainity.
LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC = (1<<22),
// This mask indicates support for CV2X Location premium features.
// This bundle includes features for CV2X Location Basic features,
// QDR3 feature, and PACE. (Position Assisted Clock Estimator.
LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM = (1<<23),
// This mask indicates that PPE (Precise Positioning Engine)
// library is enabled or Precise Positioning Framework (PPF)
// is available. This bundle includes features for Carrier
// Phase and SV Ephermeris.
LOCATION_CAPABILITIES_QWES_PPE = (1<<24),
// This mask indicates QDR2_C license bundle is enabled. This
// bundle includes features for SV Polynomial.
LOCATION_CAPABILITIES_QWES_QDR2 = (1<<25),
// This mask indicates QDR3_C license bundle is enabled. This
// bundle includes features for SV Polynomial.
LOCATION_CAPABILITIES_QWES_QDR3 = (1<<26),
} LocationCapabilitiesBits;
// supports startTracking API with minInterval param
#define LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT (1<<0)
// supports startBatching API with minInterval param
#define LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT (1<<1)
// supports startTracking API with minDistance param
#define LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT (1<<2)
// supports startBatching API with minDistance param
#define LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT (1<<3)
// supports addGeofences API
#define LOCATION_CAPABILITIES_GEOFENCE_BIT (1<<4)
// supports GnssMeasurementsCallback
#define LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT (1<<5)
// supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based)
#define LOCATION_CAPABILITIES_GNSS_MSB_BIT (1<<6)
// supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted)
#define LOCATION_CAPABILITIES_GNSS_MSA_BIT (1<<7)
// supports debug nmea sentences in the debugNmeaCallback
#define LOCATION_CAPABILITIES_DEBUG_NMEA_BIT (1<<8)
// support outdoor trip batching
#define LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT (1<<9)
// support constellation enablement
#define LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT (1<<10)
// support agpm
#define LOCATION_CAPABILITIES_AGPM_BIT (1<<11)
// support location privacy
#define LOCATION_CAPABILITIES_PRIVACY_BIT (1<<12)
// support measurement corrections
#define LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT (1<<13)
// support Robust Location
#define LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT (1<<14)
// support precise location edgnss
#define LOCATION_CAPABILITIES_EDGNSS_BIT (1<<15)
// Modem supports Carrier Phase for Precise Positioning
// Measurement Engine (PPME).
#define LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT (1<<16)
// Modem supports SV Polynomial for tightly coupled external
// DR support. This is a Standalone Feature.
#define LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT (1<<17)
// Modem supports SV Ephemeris for tightly coupled external
// PPE engines. This is a Standalone Feature.
#define LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT (1<<18)
// Modem supports GNSS Single Frequency feature. This is a
// Standalone Feature.
#define LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY (1<<19)
// Modem supports GNSS Multi Frequency feature. Multi Frequency
// enables Single frequency also.
#define LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY (1<<20)
// This mask indicates VPe license bundle is enabled. VEPP
// bundle include Carrier Phase and SV Polynomial features.
#define LOCATION_CAPABILITIES_QWES_VPE (1<<21)
// This mask indicates support for CV2X Location basic features.
// This bundle includes features for GTS Time & Freq, C-TUNC
// (Constrained Time uncertainity.
#define LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC (1<<22)
// This mask indicates support for CV2X Location premium features.
// This bundle includes features for CV2X Location Basic features,
// QDR3 feature, and PACE. (Position Assisted Clock Estimator.
#define LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM (1<<23)
// This mask indicates that PPE (Precise Positioning Engine)
// library is enabled or Precise Positioning Framework (PPF)
// is available. This bundle includes features for Carrier
// Phase and SV Ephermeris.
#define LOCATION_CAPABILITIES_QWES_PPE (1<<24)
// This mask indicates QDR2_C license bundle is enabled. This
// bundle includes features for SV Polynomial.
#define LOCATION_CAPABILITIES_QWES_QDR2 (1<<25)
// This mask indicates QDR3_C license bundle is enabled. This
// bundle includes features for SV Polynomial.
#define LOCATION_CAPABILITIES_QWES_QDR3 (1<<26)
// This mask indicates DGNSS license bundle is enabled.
#define LOCATION_CAPABILITIES_QWES_DGNSS (1<<27)
// This mask indicates Antenna info is enabled.
#define LOCATION_CAPABILITIES_ANTENNA_INFO (1<<28)
// This mask indicates qppe or qfe library is presented.
#define LOCATION_CAPABILITIES_PRECISE_LIB_PRESENT (1<<29)
// This mask indicates wifi RSSI positioning is
// enabled by QWES license.
#define LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING (1ULL<<30)
// This mask indicates wifi RTT positioning is
// enabled by QWES license.
#define LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING (1ULL<<31)
// This mask indicates wifi RSSI positioning is supported.
#define LOCATION_CAPABILITIES_WIFI_RSSI_POSITIONING (1ULL<<32)
// This mask indicates wifi RTT positioning is supported.
#define LOCATION_CAPABILITIES_WIFI_RTT_POSITIONING (1ULL<<33)
typedef uint8_t LocationQwesFeatureType;
typedef enum {
@@ -347,10 +395,29 @@ typedef enum {
// This indicates VEPP license bundle is enabled. VEPP
// bundle include Carrier Phase and SV Polynomial features.
LOCATION_QWES_FEATURE_TYPE_VPE,
// This indicates DGNSS license is enabled.
LOCATION_QWES_FEATURE_TYPE_DGNSS,
// This indicates DLP feature is enabled by QESDK APP
// license
LOCATION_QWES_FEATURE_TYPE_DLP_QESDK,
// This indicates wifi RSSI positioning is
// enabled by QWES license.
LOCATION_QWES_FEATURE_TYPE_RSSI_POSITIONING,
// This indicates wifi RTT positioning is
// enabled by QWES license.
LOCATION_QWES_FEATURE_TYPE_RTT_POSITIONING,
// Max value
LOCATION_QWES_FEATURE_TYPE_MAX
} LocationQwesFeatureTypes;
typedef uint64_t LocationHwCapabilitiesMask;
typedef enum {
// This indicates wifi HW has RSSI capability.
LOCATION_WIFI_CAPABILITY_RSSI = (1<<0),
// This indicates wifi HW has RTT capability.
LOCATION_WIFI_CAPABILITY_RTT = (1<<1)
} LocationHwCapabilitiesBits;
typedef enum {
LOCATION_TECHNOLOGY_TYPE_GNSS = 0,
} LocationTechnologyType;
@@ -2067,4 +2134,11 @@ typedef struct {
uint64_t hlosQtimer5;
} GnssLatencyInfo;
enum {
NON_EMERGENCY_ODCPI = (1<<0),
EMERGENCY_ODCPI = (1<<1)
} OdcpiCallbackTypeMaskBits;
typedef uint16_t OdcpiCallbackTypeMask;
#endif /* LOCATIONDATATYPES_H */

View File

@@ -26,6 +26,41 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Changes from Qualcomm Innovation Center are provided under the following license:
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LOCATION_INTERFACE_H
#define LOCATION_INTERFACE_H
@@ -79,7 +114,9 @@ struct GnssInterface {
void (*getDebugReport)(GnssDebugReport& report);
void (*updateConnectionStatus)(bool connected, int8_t type, bool roaming,
NetworkHandle networkHandle, std::string& apn);
void (*odcpiInit)(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
void (*odcpiInit)(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
OdcpiCallbackTypeMask typeMask);
void (*deRegisterOdcpi)(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
void (*odcpiInject)(const Location& location);
void (*blockCPI)(double latitude, double longitude, float accuracy,
int blockDurationMsec, double latLonDiffThreshold);

View File

@@ -141,8 +141,11 @@ public:
unordered_set<KEY>* goneKeys, unordered_set<VAL>* goneVals) {
for (auto key : keys) {
auto iter = mMap.find(key);
if (iter != mMap.end() && trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) {
goneKeys->insert(iter->first);
if (iter != mMap.end()) {
KEY goneKey = iter->first;
if (trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) {
goneKeys->insert(goneKey);
}
}
}
}

View File

@@ -2341,10 +2341,17 @@ typedef std::function<void(const OdcpiRequestInfo& request)> OdcpiRequestCallbac
/* ODCPI callback priorities*/
enum OdcpiPrioritytype {
//ODCPI callback registered by AFW via IGNSS AIDL has LOW priority
ODCPI_HANDLER_PRIORITY_LOW,
ODCPI_HANDLER_PRIORITY_DEFAULT = ODCPI_HANDLER_PRIORITY_LOW,
//ODCPI callback registered by IzatProvider on LE/KaiOS has medium priority
ODCPI_HANDLER_PRIORITY_MEDIUM,
//Non emergency ODCPI callback registered by IzatManager for RTT position injection
//has high priority
ODCPI_HANDLER_PRIORITY_HIGH
};
/*
* Callback with AGNSS(IpV4) status information.
*
@@ -2422,6 +2429,13 @@ typedef uint64_t NetworkHandle;
#define NETWORK_HANDLE_UNKNOWN ~0
#define MAX_NETWORK_HANDLES 10
typedef enum {
LOC_FEATURE_STATUS_UNKNOWN = 0,
LOC_FEATURE_STATUS_NONE = 1,
LOC_FEATURE_STATUS_OK = 2,
LOC_FEATURE_STATUS_EXPIRED = 3
} LocFeatureStatus;
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -1,41 +0,0 @@
//
// Copyright (C) 2018 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.
//
cc_library {
name: "libgptutils.xiaomi_sm8350",
vendor: true,
recovery_available: true,
shared_libs: [
"libcutils",
"liblog",
"libz",
],
cflags: [
"-Wall",
"-Werror",
"-D_BSG_FRAMEWORK_KERNEL_HEADERS",
],
srcs: [
"gpt-utils.cpp",
"recovery-ufs-bsg.cpp",
],
owner: "qti",
header_libs: [
"generated_kernel_headers",
],
export_include_dirs: ["."],
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,195 +0,0 @@
/*
* Copyright (c) 2013,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 __GPT_UTILS_H__
#define __GPT_UTILS_H__
#include <vector>
#include <string>
#include <map>
#ifdef __cplusplus
extern "C" {
#endif
#include <unistd.h>
#include <stdlib.h>
/******************************************************************************
* GPT HEADER DEFINES
******************************************************************************/
#define GPT_SIGNATURE "EFI PART"
#define HEADER_SIZE_OFFSET 12
#define HEADER_CRC_OFFSET 16
#define PRIMARY_HEADER_OFFSET 24
#define BACKUP_HEADER_OFFSET 32
#define FIRST_USABLE_LBA_OFFSET 40
#define LAST_USABLE_LBA_OFFSET 48
#define PENTRIES_OFFSET 72
#define PARTITION_COUNT_OFFSET 80
#define PENTRY_SIZE_OFFSET 84
#define PARTITION_CRC_OFFSET 88
#define TYPE_GUID_OFFSET 0
#define TYPE_GUID_SIZE 16
#define PTN_ENTRY_SIZE 128
#define UNIQUE_GUID_OFFSET 16
#define FIRST_LBA_OFFSET 32
#define LAST_LBA_OFFSET 40
#define ATTRIBUTE_FLAG_OFFSET 48
#define PARTITION_NAME_OFFSET 56
#define MAX_GPT_NAME_SIZE 72
/******************************************************************************
* AB RELATED DEFINES
******************************************************************************/
//Bit 48 onwords in the attribute field are the ones where we are allowed to
//store our AB attributes.
#define AB_FLAG_OFFSET (ATTRIBUTE_FLAG_OFFSET + 6)
#define GPT_DISK_INIT_MAGIC 0xABCD
#define AB_PARTITION_ATTR_SLOT_ACTIVE (0x1<<2)
#define AB_PARTITION_ATTR_BOOT_SUCCESSFUL (0x1<<6)
#define AB_PARTITION_ATTR_UNBOOTABLE (0x1<<7)
#define AB_SLOT_ACTIVE_VAL 0x3F
#define AB_SLOT_INACTIVE_VAL 0x0
#define AB_SLOT_ACTIVE 1
#define AB_SLOT_INACTIVE 0
#define AB_SLOT_A_SUFFIX "_a"
#define AB_SLOT_B_SUFFIX "_b"
#define PTN_XBL "xbl"
#define PTN_XBL_CFG "xbl_config"
#define PTN_MULTIIMGOEM "multiimgoem"
#define PTN_MULTIIMGQTI "multiimgqti"
#define PTN_SWAP_LIST PTN_XBL, PTN_XBL_CFG, PTN_MULTIIMGOEM, PTN_MULTIIMGQTI, "sbl1", "rpm", "tz", "aboot", "abl", "hyp", "lksecapp", "keymaster", "cmnlib", "cmnlib32", "cmnlib64", "pmic", "apdp", "devcfg", "hosd", "keystore", "msadp", "mdtp", "mdtpsecapp", "dsp", "aop", "qupfw", "vbmeta", "dtbo", "imagefv", "ImageFv", "uefisecapp", "vm-bootsys", "shrm", "cpucp", "featenabler", "vbmeta_system"
#define AB_PTN_LIST PTN_SWAP_LIST, "boot", "vendor_boot", "system", "system_ext", "product", "vendor", "vendor_dlkm", "odm", "modem", "bluetooth"
#define BOOT_DEV_DIR "/dev/block/bootdevice/by-name"
/******************************************************************************
* HELPER MACROS
******************************************************************************/
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
/******************************************************************************
* TYPES
******************************************************************************/
enum boot_update_stage {
UPDATE_MAIN = 1,
UPDATE_BACKUP,
UPDATE_FINALIZE
};
enum gpt_instance {
PRIMARY_GPT = 0,
SECONDARY_GPT
};
enum boot_chain {
NORMAL_BOOT = 0,
BACKUP_BOOT
};
struct gpt_disk {
//GPT primary header
uint8_t *hdr;
//primary header crc
uint32_t hdr_crc;
//GPT backup header
uint8_t *hdr_bak;
//backup header crc
uint32_t hdr_bak_crc;
//Partition entries array
uint8_t *pentry_arr;
//Partition entries array for backup table
uint8_t *pentry_arr_bak;
//Size of the pentry array
uint32_t pentry_arr_size;
//Size of each element in the pentry array
uint32_t pentry_size;
//CRC of the partition entry array
uint32_t pentry_arr_crc;
//CRC of the backup partition entry array
uint32_t pentry_arr_bak_crc;
//Path to block dev representing the disk
char devpath[PATH_MAX];
//Block size of disk
uint32_t block_size;
uint32_t is_initialized;
};
/******************************************************************************
* FUNCTION PROTOTYPES
******************************************************************************/
int prepare_boot_update(enum boot_update_stage stage);
//GPT disk methods
struct gpt_disk* gpt_disk_alloc();
//Free previously allocated gpt_disk struct
void gpt_disk_free(struct gpt_disk *disk);
//Get the details of the disk holding the partition whose name
//is passed in via dev
int gpt_disk_get_disk_info(const char *dev, struct gpt_disk *disk);
//Get pointer to partition entry from a allocated gpt_disk structure
uint8_t* gpt_disk_get_pentry(struct gpt_disk *disk,
const char *partname,
enum gpt_instance instance);
//Update the crc fields of the modified disk structure
int gpt_disk_update_crc(struct gpt_disk *disk);
//Write the contents of struct gpt_disk back to the actual disk
int gpt_disk_commit(struct gpt_disk *disk);
//Return if the current device is UFS based or not
int gpt_utils_is_ufs_device();
//Swtich betwieen using either the primary or the backup
//boot LUN for boot. This is required since UFS boot partitions
//cannot have a backup GPT which is what we use for failsafe
//updates of the other 'critical' partitions. This function will
//not be invoked for emmc targets and on UFS targets is only required
//to be invoked for XBL.
//
//The algorithm to do this is as follows:
//- Find the real block device(eg: /dev/block/sdb) that corresponds
// to the /dev/block/bootdevice/by-name/xbl(bak) symlink
//
//- Once we have the block device 'node' name(sdb in the above example)
// use this node to to locate the scsi generic device that represents
// it by checking the file /sys/block/sdb/device/scsi_generic/sgY
//
//- Once we locate sgY we call the query ioctl on /dev/sgy to switch
//the boot lun to either LUNA or LUNB
int gpt_utils_set_xbl_boot_partition(enum boot_chain chain);
//Given a vector of partition names as a input and a reference to a map,
//populate the map to indicate which physical disk each of the partitions
//sits on. The key in the map is the path to the block device where the
//partiton lies and the value is a vector of strings indicating which of
//the passed in partiton names sits on that device.
int gpt_utils_get_partition_map(std::vector<std::string>& partition_list,
std::map<std::string,std::vector<std::string>>& partition_map);
#ifdef __cplusplus
}
#endif
#endif /* __GPT_UTILS_H__ */

View File

@@ -1,255 +0,0 @@
/*
* 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 "recovery_ufs"
#include "recovery-ufs-bsg.h"
#ifndef _BSG_FRAMEWORK_KERNEL_HEADERS
#ifndef _GENERIC_KERNEL_HEADERS
#include <scsi/ufs/ioctl.h>
#include <scsi/ufs/ufs.h>
#endif
#endif
//Size of the buffer that needs to be passed to the UFS ioctl
#define UFS_ATTR_DATA_SIZE 32
#ifdef _BSG_FRAMEWORK_KERNEL_HEADERS
static int get_ufs_bsg_dev(void)
{
DIR *dir;
struct dirent *ent;
int ret = -ENODEV;
if ((dir = opendir ("/dev")) != NULL) {
/* read all the files and directories within directory */
while ((ent = readdir(dir)) != NULL) {
if (!strcmp(ent->d_name, "ufs-bsg") ||
!strcmp(ent->d_name, "ufs-bsg0")) {
snprintf(ufs_bsg_dev, FNAME_SZ, "/dev/%s", ent->d_name);
ret = 0;
break;
}
}
if (ret)
ALOGE("could not find the ufs-bsg dev\n");
closedir (dir);
} else {
/* could not open directory */
ALOGE("could not open /dev (error no: %d)\n", errno);
ret = -EINVAL;
}
return ret;
}
int ufs_bsg_dev_open(void)
{
int ret;
if (!fd_ufs_bsg) {
fd_ufs_bsg = open(ufs_bsg_dev, O_RDWR);
ret = errno;
if (fd_ufs_bsg < 0) {
ALOGE("Unable to open %s (error no: %d)",
ufs_bsg_dev, errno);
fd_ufs_bsg = 0;
return ret;
}
}
return 0;
}
void ufs_bsg_dev_close(void)
{
if (fd_ufs_bsg) {
close(fd_ufs_bsg);
fd_ufs_bsg = 0;
}
}
static int ufs_bsg_ioctl(int fd, struct ufs_bsg_request *req,
struct ufs_bsg_reply *rsp, __u8 *buf, __u32 buf_len,
enum bsg_ioctl_dir dir)
{
int ret;
struct sg_io_v4 sg_io{};
sg_io.guard = 'Q';
sg_io.protocol = BSG_PROTOCOL_SCSI;
sg_io.subprotocol = BSG_SUB_PROTOCOL_SCSI_TRANSPORT;
sg_io.request_len = sizeof(*req);
sg_io.request = (__u64)req;
sg_io.response = (__u64)rsp;
sg_io.max_response_len = sizeof(*rsp);
if (dir == BSG_IOCTL_DIR_FROM_DEV) {
sg_io.din_xfer_len = buf_len;
sg_io.din_xferp = (__u64)(buf);
} else {
sg_io.dout_xfer_len = buf_len;
sg_io.dout_xferp = (__u64)(buf);
}
ret = ioctl(fd, SG_IO, &sg_io);
if (ret)
ALOGE("%s: Error from sg_io ioctl (return value: %d, error no: %d, reply result from LLD: %d\n)",
__func__, ret, errno, rsp->result);
if (sg_io.info || rsp->result) {
ALOGE("%s: Error from sg_io info (check sg info: device_status: 0x%x, transport_status: 0x%x, driver_status: 0x%x, reply result from LLD: %d\n)",
__func__, sg_io.device_status, sg_io.transport_status,
sg_io.driver_status, rsp->result);
ret = -EAGAIN;
}
return ret;
}
static void compose_ufs_bsg_query_req(struct ufs_bsg_request *req, __u8 func,
__u8 opcode, __u8 idn, __u8 index, __u8 sel,
__u16 length)
{
struct utp_upiu_header *hdr = &req->upiu_req.header;
struct utp_upiu_query *qr = &req->upiu_req.qr;
req->msgcode = UTP_UPIU_QUERY_REQ;
hdr->dword_0 = DWORD(UTP_UPIU_QUERY_REQ, 0, 0, 0);
hdr->dword_1 = DWORD(0, func, 0, 0);
hdr->dword_2 = DWORD(0, 0, length >> 8, (__u8)length);
qr->opcode = opcode;
qr->idn = idn;
qr->index = index;
qr->selector = sel;
qr->length = htobe16(length);
}
static int ufs_query_attr(int fd, __u32 value,
__u8 func, __u8 opcode, __u8 idn,
__u8 index, __u8 sel)
{
struct ufs_bsg_request req{};
struct ufs_bsg_reply rsp{};
enum bsg_ioctl_dir dir = BSG_IOCTL_DIR_FROM_DEV;
int ret = 0;
if (opcode == QUERY_REQ_OP_WRITE_DESC || opcode == QUERY_REQ_OP_WRITE_ATTR)
dir = BSG_IOCTL_DIR_TO_DEV;
req.upiu_req.qr.value = htobe32(value);
compose_ufs_bsg_query_req(&req, func, opcode, idn, index, sel, 0);
ret = ufs_bsg_ioctl(fd, &req, &rsp, 0, 0, dir);
if (ret)
ALOGE("%s: Error from ufs_bsg_ioctl (return value: %d, error no: %d\n)",
__func__, ret, errno);
return ret;
}
int32_t set_boot_lun(char *sg_dev __unused,uint8_t lun_id)
{
int32_t ret;
__u32 boot_lun_id = lun_id;
ret = get_ufs_bsg_dev();
if (ret)
return ret;
ALOGV("Found the ufs bsg dev: %s\n", ufs_bsg_dev);
ret = ufs_bsg_dev_open();
if (ret)
return ret;
ALOGV("Opened ufs bsg dev: %s\n", ufs_bsg_dev);
ret = ufs_query_attr(fd_ufs_bsg, boot_lun_id, QUERY_REQ_FUNC_STD_WRITE,
QUERY_REQ_OP_WRITE_ATTR, QUERY_ATTR_IDN_BOOT_LU_EN, 0, 0);
if (ret) {
ALOGE("Error requesting ufs attr idn %d via query ioctl (return value: %d, error no: %d)",
QUERY_ATTR_IDN_BOOT_LU_EN, ret, errno);
goto out;
}
out:
ufs_bsg_dev_close();
return ret;
}
#endif
#ifndef _BSG_FRAMEWORK_KERNEL_HEADERS
int32_t set_boot_lun(char *sg_dev, uint8_t boot_lun_id)
{
#ifndef _GENERIC_KERNEL_HEADERS
int fd = -1;
int rc;
struct ufs_ioctl_query_data *data = NULL;
size_t ioctl_data_size = sizeof(struct ufs_ioctl_query_data) + UFS_ATTR_DATA_SIZE;
data = (struct ufs_ioctl_query_data*)malloc(ioctl_data_size);
if (!data) {
fprintf(stderr, "%s: Failed to alloc query data struct\n",
__func__);
goto error;
}
memset(data, 0, ioctl_data_size);
data->opcode = UPIU_QUERY_OPCODE_WRITE_ATTR;
data->idn = QUERY_ATTR_IDN_BOOT_LU_EN;
data->buf_size = UFS_ATTR_DATA_SIZE;
data->buffer[0] = boot_lun_id;
fd = open(sg_dev, O_RDWR);
if (fd < 0) {
fprintf(stderr, "%s: Failed to open %s(%s)\n",
__func__,
sg_dev,
strerror(errno));
goto error;
}
rc = ioctl(fd, UFS_IOCTL_QUERY, data);
if (rc) {
fprintf(stderr, "%s: UFS query ioctl failed(%s)\n",
__func__,
strerror(errno));
goto error;
}
close(fd);
free(data);
return 0;
error:
if (fd >= 0)
close(fd);
if (data)
free(data);
return -1;
#else
return 0;
#endif
}
#endif

View File

@@ -1,131 +0,0 @@
#ifndef __RECOVERY_UFS_BSG_H__
#define __RECOVERY_UFS_BSG_H__
/*
* 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.
*/
#include <linux/bsg.h>
#include <scsi/scsi_bsg_ufs.h>
#include <endian.h>
#include <dirent.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#ifdef ANDROID
#include "cutils/log.h"
#endif
#ifdef OE
#include <syslog.h>
#define LOGI(...) syslog(LOG_NOTICE, "INFO:" __VA_ARGS__)
#define LOGV(...) syslog(LOG_NOTICE,"VERB:" __VA_ARGS__)
#define LOGD(...) syslog(LOG_DEBUG,"DBG:" __VA_ARGS__)
#define LOGE(...) syslog(LOG_ERR,"ERR:" __VA_ARGS__)
#define LOGW(...) syslog(LOG_WARNING,"WRN:" __VA_ARGS__)
#define strlcat(d,s,l) snprintf(d+strlen(d),l,"%s",s)
#endif
#define FNAME_SZ 64
#define SG_IO 0x2285
#define DWORD(b3, b2, b1, b0) htobe32((b3 << 24) | (b2 << 16) |\
(b1 << 8) | b0)
/* UFS BSG device nodes */
char ufs_bsg_dev[FNAME_SZ] = "/dev/ufs-bsg";
int fd_ufs_bsg;
int32_t set_ufs_lun(uint8_t lun_id);
#ifdef _BSG_FRAMEWORK_KERNEL_HEADERS
/* UPIU Transaction Codes */
enum {
UTP_UPIU_NOP_OUT = 0x00,
UTP_UPIU_COMMAND = 0x01,
UTP_UPIU_DATA_OUT = 0x02,
UTP_UPIU_TASK_REQ = 0x04,
UTP_UPIU_QUERY_REQ = 0x16,
};
/* UPIU Query Function field */
enum {
QUERY_REQ_FUNC_STD_READ = 0x01,
QUERY_REQ_FUNC_STD_WRITE = 0x81,
};
enum query_req_opcode {
QUERY_REQ_OP_READ_DESC = 0x1,
QUERY_REQ_OP_WRITE_DESC = 0x2,
QUERY_REQ_OP_READ_ATTR = 0x3,
QUERY_REQ_OP_WRITE_ATTR = 0x4,
QUERY_REQ_OP_READ_FLAG = 0x5,
QUERY_REQ_OP_SET_FLAG = 0x6,
QUERY_REQ_OP_CLEAR_FLAG = 0x7,
QUERY_REQ_OP_TOGGLE_FLAG = 0x8,
};
enum query_desc_idn {
QUERY_DESC_IDN_DEVICE = 0x0,
QUERY_DESC_IDN_UNIT = 0x2,
QUERY_DESC_IDN_GEOMETRY = 0x7,
};
enum query_desc_size {
QUERY_DESC_SIZE_DEVICE = 0x40,
QUERY_DESC_SIZE_GEOMETRY = 0x48,
QUERY_DESC_SIZE_UNIT = 0x23,
};
enum bsg_ioctl_dir {
BSG_IOCTL_DIR_TO_DEV,
BSG_IOCTL_DIR_FROM_DEV,
};
enum query_attr_idn {
QUERY_ATTR_IDN_BOOT_LU_EN = 0x00,
QUERY_ATTR_IDN_RESERVED = 0x01,
QUERY_ATTR_IDN_POWER_MODE = 0x02,
QUERY_ATTR_IDN_ACTIVE_ICC_LVL = 0x03,
};
#endif /* _BSG_FRAMEWORK_KERNEL_HEADERS */
#endif /* __RECOVERY_UFS_BSG_H__ */

View File

@@ -1,103 +0,0 @@
<!-- Copyright (c) 2017, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<compatibility-matrix version="1.0" type="device">
<hal format="hidl" optional="false">
<name>android.frameworks.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>
<interface>
<name>ISensorManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="false">
<name>android.hidl.allocator</name>
<version>1.0</version>
<interface>
<name>IAllocator</name>
<instance>ashmem</instance>
</interface>
</hal>
<hal format="hidl" optional="false">
<name>android.hidl.manager</name>
<version>1.0</version>
<interface>
<name>IServiceManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="false">
<name>android.hidl.memory</name>
<version>1.0</version>
<interface>
<name>IMapper</name>
<instance>ashmem</instance>
</interface>
</hal>
<hal format="hidl" optional="false">
<name>android.hidl.token</name>
<version>1.0</version>
<interface>
<name>ITokenManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="false">
<name>android.system.wifi.keystore</name>
<version>1.0</version>
<interface>
<name>IKeystore</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.sigma_miracast</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>Isigma_miracast</name>
<instance>sigmahal</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.qccsyshal</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IQccsyshal</name>
<instance>qccsyshal</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@@ -25,8 +25,7 @@ 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" target-level="5">
<kernel target-level="5"/>
<manifest version="1.0" type="device" target-level="6">
<!-- CapabilityConfigStore HAL Service -->
<hal format="hidl">
<name>vendor.qti.hardware.capabilityconfigstore</name>
@@ -64,20 +63,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.media.omx</name>
<transport>hwbinder</transport>
<impl level="generic"></impl>
<version>1.0</version>
<interface>
<name>IOmx</name>
<instance>default</instance>
</interface>
<interface>
<name>IOmxStore</name>
<instance>default</instance>
</interface>
</hal>
<!-- VPP Service -->
<hal format="hidl">
<name>vendor.qti.hardware.vpp</name>
@@ -130,15 +115,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<instance>wifidisplaysessionimagetrack</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.memtrack</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IMemtrack</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.keymaster</name>
<transport>hwbinder</transport>
@@ -410,7 +386,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<hal format="hidl">
<name>android.hardware.tetheroffload.control</name>
<transport>hwbinder</transport>
<version>1.0</version>
<version>1.1</version>
<interface>
<name>IOffloadControl</name>
<instance>default</instance>
@@ -455,16 +431,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<instance>default</instance>
</interface>
</hal>
<!-- Perf HAL service -->
<hal format="hidl">
<name>vendor.qti.hardware.perf</name>
<transport>hwbinder</transport>
<version>2.2</version>
<interface>
<name>IPerf</name>
<instance>default</instance>
</interface>
</hal>
<!-- bluetooth -->
<hal format="hidl">
<name>android.hardware.bluetooth</name>

11
hidl/manifest_udfps.xml Normal file
View File

@@ -0,0 +1,11 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>vendor.xiaomi.hardware.fx.tunnel</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IMiFxTunnel</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -26,865 +26,100 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<compatibility-matrix version="1.0" type="framework">
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.scve.panorama</name>
<version>1.0</version>
<interface>
<name>IPanoramaTracking</name>
<instance>panoTracking</instance>
</interface>
<interface>
<name>IPanoramaStitching</name>
<instance>panoStitching</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.scve.objecttracker</name>
<version>1.0</version>
<interface>
<name>IObjectTracker</name>
<instance>objectTracker</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.perf</name>
<version>2.0-2</version>
<hal format="aidl" optional="true">
<name>android.hardware.biometrics.fingerprint</name>
<version>4</version>
<interface>
<name>IPerf</name>
<instance>default</instance>
<name>IFingerprint</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.display.color</name>
<version>1.0-6</version>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.bluetooth.audio</name>
<version>4</version>
<interface>
<name>IDisplayColor</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.display.postproc</name>
<version>1.0</version>
<interface>
<name>IDisplayPostproc</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.display.demura</name>
<version>1.0</version>
<version>2.0</version>
<interface>
<name>IDemuraFileFinder</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.qteeconnector</name>
<version>1.0</version>
<interface>
<name>IAppConnector</name>
<name>IBluetoothAudioProviderFactory</name>
<instance>default</instance>
</interface>
<interface>
<name>IGPAppConnector</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.debugutils</name>
<version>1.0</version>
<interface>
<name>IDebugUtils</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.factory</name>
<version>1.0-1</version>
<interface>
<name>IFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.qualcomm.qti.dpm.api</name>
<version>1.0</version>
<interface>
<name>IdpmQmi</name>
<instance>dpmQmiService</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.radio</name>
<version>1.0-4</version>
<interface>
<name>IRadio</name>
<instance>slot1</instance>
<instance>slot2</instance>
</interface>
<interface>
<name>ISap</name>
<instance>slot1</instance>
<instance>slot2</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.seccam</name>
<version>1.0</version>
<interface>
<name>ISecCam</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.bluetooth_audio</name>
<version>2.0-1</version>
<interface>
<name>IBluetoothAudioProvidersFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.qualcomm.qti.imscmservice</name>
<version>2.0-2</version>
<interface>
<name>IImsCmService</name>
<instance>qti.ims.connectionmanagerservice</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.qualcomm.qti.uceservice</name>
<version>2.0-1</version>
<version>2.2</version>
<version>2.3</version>
<interface>
<name>IUceService</name>
<instance>com.qualcomm.qti.uceservice</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.qualcomm.qti.wifidisplayhal</name>
<version>1.0</version>
<interface>
<name>IHDCPSession</name>
<instance>wifidisplayhdcphal</instance>
</interface>
<interface>
<name>IDSManager</name>
<instance>wifidisplaydshal</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wifidisplaysession</name>
<version>1.0</version>
<interface>
<name>IWifiDisplaySession</name>
<instance>wifidisplaysession</instance>
</interface>
<interface>
<name>IWifiDisplaySessionVideoTrack</name>
<instance>wifidisplaysessionvideotrack</instance>
</interface>
<interface>
<name>IWifiDisplaySessionAudioTrack</name>
<instance>wifidisplaysessionaudiotrack</instance>
</interface>
<interface>
<name>IWifiDisplaySessionImageTrack</name>
<instance>wifidisplaysessionimagetrack</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.quicinc.cne.server</name>
<version>2.0-2</version>
<interface>
<name>IServer</name>
<instance>cnd</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.quicinc.cne.api</name>
<version>1.0-1</version>
<interface>
<name>IApiService</name>
<instance>cnd</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.nxp.nxpnfc_aidl</name>
<name>android.hardware.drm</name>
<version>1</version>
<interface>
<name>INxpNfc</name>
<instance>default</instance>
<name>IDrmFactory</name>
<instance>clearkey</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.esepowermanager</name>
<version>1.0-1</version>
<interface>
<name>IEsePowerManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.alarm</name>
<version>1.0</version>
<interface>
<name>IAlarm</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.data.latency</name>
<impl level="generic"></impl>
<version>1.0</version>
<interface>
<name>ILinkLatency</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.data.connection</name>
<version>1.0-1</version>
<interface>
<name>IDataConnection</name>
<instance>slot1</instance>
<instance>slot2</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.cacert</name>
<version>1.0</version>
<interface>
<name>IService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.fm</name>
<version>1.0</version>
<interface>
<name>IFmHci</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.btconfigstore</name>
<version>1.0</version>
<version>2.0</version>
<interface>
<name>IBTConfigStore</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.dsi.ant</name>
<version>1.0</version>
<interface>
<name>IAnt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.qdutils_disp</name>
<version>1.0</version>
<interface>
<name>IQdutilsDisp</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.am</name>
<version>1.0</version>
<hal format="aidl" optional="true">
<name>android.hardware.health</name>
<version>3</version>
<interface>
<name>IQcRilAudio</name>
<instance>slot1</instance>
<instance>slot2</instance>
<name>IHealth</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.ims</name>
<version>1.0-7</version>
<interface>
<name>IImsRadio</name>
<instance>imsradio0</instance>
<instance>imsradio1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.internal.deviceinfo</name>
<version>1.0</version>
<hal format="aidl" optional="true">
<name>android.hardware.ir</name>
<version>1</version>
<interface>
<name>IConsumerIr</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.sensors</name>
<version>2</version>
<interface>
<name>ISensors</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.usb</name>
<version>1</version>
<interface>
<name>IDeviceInfo</name>
<instance>deviceinfo</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.lpa</name>
<version>1.0-1</version>
<interface>
<name>IUimLpa</name>
<instance>UimLpa0</instance>
<instance>UimLpa1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.qcrilhook</name>
<version>1.0</version>
<interface>
<name>IQtiOemHook</name>
<instance>oemhook0</instance>
<instance>oemhook1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.qtiradio</name>
<version>1.0</version>
<version>2.0-6</version>
<interface>
<name>IQtiRadio</name>
<instance>slot1</instance>
<instance>slot2</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.uim_remote_client</name>
<version>1.0</version>
<interface>
<name>IUimRemoteServiceClient</name>
<instance>uimRemoteClient0</instance>
<instance>uimRemoteClient1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.uim_remote_server</name>
<version>1.0</version>
<interface>
<name>IUimRemoteServiceServer</name>
<instance>uimRemoteServer0</instance>
<instance>uimRemoteServer1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.radio.uim</name>
<version>1.1-2</version>
<interface>
<name>IUim</name>
<instance>Uim0</instance>
<instance>Uim1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.sensorscalibrate</name>
<version>1.0</version>
<interface>
<name>ISensorsCalibrate</name>
<name>IUsb</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.soter</name>
<version>1.0</version>
<hal format="aidl" optional="true">
<name>android.hardware.wifi</name>
<version>1-2</version>
<interface>
<name>ISoter</name>
<name>IWifi</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.eid</name>
<version>1.0</version>
<hal format="aidl" optional="true">
<name>android.hardware.wifi.hostapd</name>
<version>2</version>
<interface>
<name>IEid</name>
<name>IHostapd</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.vpp</name>
<version>1.1-3</version>
<version>2.0</version>
<interface>
<name>IHidlVppService</name>
<instance>vppService</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.qconfig</name>
<version>1.0</version>
<interface>
<name>IQConfig</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.dsp</name>
<version>1.0</version>
<interface>
<name>IDspService</name>
<instance>dspservice</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<hal format="aidl" optional="true">
<name>android.hardware.wifi.supplicant</name>
<version>1.0-2</version>
<version>3</version>
<interface>
<name>ISupplicant</name>
<instance>default</instance>
<instance>wigigp2p</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wigig.netperftuner</name>
<version>1.0</version>
<interface>
<name>INetPerfTuner</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wigig.supptunnel</name>
<version>1.0</version>
<interface>
<name>ISuppTunnelProvider</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.fstman</name>
<version>1.0</version>
<interface>
<name>IFstManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.imsrtpservice</name>
<version>3.0</version>
<interface>
<name>IRTPService</name>
<instance>imsrtpservice</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.voiceprint</name>
<version>1.0</version>
<interface>
<name>IQtiVoicePrintService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.gnss</name>
<version>1.0-1</version>
<version>2.0-1</version>
<interface>
<name>IGnss</name>
<instance>gnss_vendor</instance>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.gnss</name>
<version>1.0-2</version>
<version>2.0-1</version>
<version>3.0</version>
<version>4.0-1</version>
<interface>
<name>ILocHidlGnss</name>
<instance>gnss_vendor</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wifi.supplicant</name>
<version>2.0-3</version>
<interface>
<name>ISupplicantVendor</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wifi.hostapd</name>
<version>1.0-3</version>
<interface>
<name>IHostapdVendor</name>
<instance>default</instance>
<instance>wigighostapd</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.ims.callinfo</name>
<version>1.0</version>
<interface>
<name>IService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.data.factory</name>
<version>1.0</version>
<version>2.0-3</version>
<interface>
<name>IFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.display.config</name>
<version>1.0-15</version>
<version>2.0</version>
<interface>
<name>IDisplayConfig</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.improvetouch.blobmanager</name>
<version>1.0</version>
<interface>
<name>IBlobManager</name>
<instance>BlobManagerService</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.improvetouch.gesturemanager</name>
<version>1.0</version>
<interface>
<name>IGestureManager</name>
<instance>GestureManagerService</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.improvetouch.touchcompanion</name>
<version>1.0</version>
<interface>
<name>ITouchCompanion</name>
<instance>TouchCompanionService</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wipower</name>
<version>1.0</version>
<interface>
<name>IWipower</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.fingerprint</name>
<version>1.0</version>
<interface>
<name>IQtiExtendedFingerprint</name>
<instance>default</instance>
</interface>
</hal>
<!-- Memory PASR HAL -->
<hal format="hidl" optional="true">
<name>vendor.qti.memory.pasrmanager</name>
<transport>hwbinder</transport>
<version>1.0-1</version>
<interface>
<name>IPasrManager</name>
<instance>pasrhal</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.power.pasrmanager</name>
<version>1.0</version>
<interface>
<name>IPasrManager</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.radio.config</name>
<version>1.0-1</version>
<interface>
<name>IRadioConfig</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.capabilityconfigstore</name>
<version>1.0</version>
<interface>
<name>ICapabilityConfigStore</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.data.iwlan</name>
<version>1.0</version>
<interface>
<name>IIWlan</name>
<instance>slot1</instance>
<instance>slot2</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.cvp</name>
<version>1.0</version>
<interface>
<name>ICvp</name>
<instance>cvphalservice</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.audiohalext</name>
<version>1.0</version>
<interface>
<name>IAudioHalExt</name>
<instance>default</instance>
</interface>
</hal>
<!-- Codec2 HAl service -->
<hal format="hidl" optional="true">
<name>android.hardware.media.c2</name>
<version>1.0</version>
<interface>
<name>IComponentStore</name>
<instance>default</instance>
<instance>software</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.display.allocator</name>
<version>1.0</version>
<version>3.0</version>
<version>4.0</version>
<interface>
<name>IQtiAllocator</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.display.mapper</name>
<version>2.0</version>
<version>3.0</version>
<version>4.0</version>
<interface>
<name>IQtiMapper</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.display.composer</name>
<version>2.0-1</version>
<version>3.0</version>
<interface>
<name>IQtiComposer</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.diaghal</name>
<version>1.0</version>
<interface>
<name>Idiag</name>
<instance>default</instance>
</interface>
</hal>
<!-- BluetoothSar service-->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.bluetooth_sar</name>
<version>1.0-1</version>
<interface>
<name>IBluetoothSar</name>
<instance>default</instance>
</interface>
</hal>
<!-- WifiStats HAL service-->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wifi.wifilearner</name>
<version>1.0</version>
<interface>
<name>IWifiStats</name>
<instance>wifiStats</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.automotive.evs</name>
<version>1.1</version>
<interface>
<name>IEvsEnumerator</name>
<instance>EvsEnumeratorHw-Mock</instance>
<instance>default</instance>
<instance>EvsEnumeratorHw</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.automotive.qcarcam</name>
<version>1.0</version>
<interface>
<name>IQcarCamera</name>
<instance>default</instance>
</interface>
</hal>
<!-- System Helper HAL Service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.systemhelper</name>
<version>1.0</version>
<interface>
<name>ISystemEvent</name>
<instance>default</instance>
</interface>
<interface>
<name>ISystemResource</name>
<instance>default</instance>
</interface>
</hal>
<!-- Trusted UI HAL Service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.trustedui</name>
<version>1.0-2</version>
<interface>
<name>ITrustedUI</name>
<instance>default</instance>
<instance>qtee-vm</instance>
</interface>
<interface>
<name>ITrustedInput</name>
<instance>default</instance>
<instance>qtee-vm</instance>
</interface>
</hal>
<!-- Secure image data processor HAL Service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.secureprocessor.device</name>
<version>1.0</version>
<interface>
<name>ISecureProcessor</name>
<instance>qti-tee</instance>
</interface>
</hal>
<!-- cryptfshw HAL service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.cryptfshw</name>
<version>1.0</version>
<interface>
<name>ICryptfsHw</name>
<instance>default</instance>
</interface>
</hal>
<!-- Camera PostProcessing service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.camera.postproc</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IPostProcService</name>
<instance>camerapostprocservice</instance>
</interface>
</hal>
<!-- eMBMS HAL service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.embmssl</name>
<version>1.0-1</version>
<interface>
<name>IEmbms</name>
<instance>embmsslServer0</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.ims.factory</name>
<version>1.0-1</version>
<interface>
<name>IImsFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.spu</name>
<version>1.0-1</version>
<interface>
<name>ISPUManager</name>
<instance>default</instance>
</interface>
</hal>
<!-- SlmAdapter HAL service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.slmadapter</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ISlmAdapter</name>
<instance>SlmAdapter</instance>
</interface>
</hal>
<!-- MwqemAdapter HAL service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.mwqemadapter</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IMwqemAdapter</name>
<instance>MwqemAdapter</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.qccsyshal</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IQccsyshal</name>
<instance>qccsyshal</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.limits</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ILimits</name>
<instance>default</instance>
</interface>
</hal>
<!-- Audio Graph Manager service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.AGMIPC</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IAGM</name>
<instance>default</instance>
</interface>
</hal>
<!-- Audio Platform adatation service -->
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.pal</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IPAL</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.wifi.wifimyftm</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IWifiMyFtm</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.qesdhal</name>
<transport>hwbinder</transport>
<version>1.0-1</version>
<interface>
<name>IQesdhal</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.qti.hardware.sxrhal</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ISxrCrypto</name>
<instance>sxrhalservice</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@@ -1,70 +1,13 @@
<compatibility-matrix version="1.0" type="framework">
<hal format="hidl" optional="true">
<name>com.fingerprints.extension</name>
<version>3.0</version>
<interface>
<name>IFingerprintNavigation</name>
<instance>default</instance>
</interface>
<interface>
<name>IFingerprintSensorTest</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.cameraperf</name>
<version>1.0</version>
<interface>
<name>IMiCameraPerfService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.campostproc</name>
<version>1.0</version>
<interface>
<name>IMiPostProcService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.xiaomi.hardware.citsensorservice</name>
<name>vendor.xiaomi.hardware.misys</name>
<transport>hwbinder</transport>
<version>1.1</version>
<interface>
<name>ICitSensorService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.dtool</name>
<version>1.0</version>
<version>2.0</version>
<version>3.0</version>
<version>4.0</version>
<interface>
<name>IDtool</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.fingerprintextension</name>
<version>1.0</version>
<interface>
<name>IXiaomiFingerprint</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.fx.tunnel</name>
<version>1.0</version>
<interface>
<name>IMiFxTunnel</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.mlipay</name>
<version>1.1</version>
<interface>
<name>IMlipayService</name>
<name>IMiSys</name>
<instance>default</instance>
</interface>
</hal>

View File

@@ -1,10 +0,0 @@
[
{
"repository": "android_kernel_xiaomi_sm8350",
"target_path": "kernel/xiaomi/sm8350"
},
{
"repository": "android_hardware_xiaomi",
"target_path": "hardware/xiaomi"
}
]

View File

@@ -103,8 +103,9 @@
-->
<MediaCodecs>
<Include href="media_codecs_c2_audio.xml" />
<Include href="media_codecs_c2_dolby_audio.xml" />
<Settings>
<Domain name="telephony" enabled="true" />
<Setting name="max-video-encoder-input-buffers" value="11" />
</Settings>
<Decoders>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
This program is protected under international and U.S. copyright laws as
an unpublished work. This program is confidential and proprietary to the
copyright owners. Reproduction or disclosure, in whole or in part, or the
production of derivative works therefrom without the express permission of
the copyright owners is prohibited.
Copyright (C) 2020-2021 by Dolby Laboratories,
All rights reserved.
-->
<Included>
<Decoders>
<!-- DOLBY_UDC -->
<MediaCodec name="c2.dolby.eac3.decoder" >
<Type name="audio/ac3">
<Alias name="OMX.dolby.ac3.decoder" />
<Limit name="channel-count" max="6" />
<Limit name="sample-rate" ranges="32000,44100,48000" />
<Limit name="bitrate" range="32000-640000" />
</Type>
<Type name="audio/eac3">
<Alias name="OMX.dolby.eac3.decoder" />
<Limit name="channel-count" max="8" />
<Limit name="sample-rate" ranges="32000,44100,48000" />
<Limit name="bitrate" range="32000-6144000" />
</Type>
<Type name="audio/eac3-joc">
<Alias name="OMX.dolby.eac3-joc.decoder" />
<Limit name="channel-count" max="16" />
<Limit name="sample-rate" ranges="48000" />
<Limit name="bitrate" range="32000-6144000" />
</Type>
</MediaCodec>
<!-- DOLBY_UDC END -->
</Decoders>
</Included>

View File

@@ -83,7 +83,9 @@
-->
<MediaCodecs>
<Include href="media_codecs_c2_dolby_audio.xml" />
<Settings>
<Domain name="telephony" enabled="true" />
<Setting name="max-video-encoder-input-buffers" value="11" />
</Settings>
<Decoders>

View File

@@ -75,7 +75,9 @@
-->
<MediaCodecs>
<Include href="media_codecs_c2_dolby_audio.xml" />
<Settings>
<Domain name="telephony" enabled="true" />
<Setting name="max-video-encoder-input-buffers" value="11" />
</Settings>
<Decoders>

View File

@@ -1,2 +1,9 @@
# Qcom
ro.vendor.qti.va_odm.support=1
# Dolby
ro.vendor.dolby.dax.version=DAX3_3.6.0.12_r1
ro.vendor.dolby.model=PAFM00
ro.vendor.dolby.device=OP46C3
ro.vendor.dolby.manufacturer=OPLUS
ro.vendor.dolby.brand=OPLUS

View File

@@ -19,8 +19,8 @@
<!-- Defines the actions shown in advanced reboot submenu -->
<string-array name="config_restartActionsList">
<item>restart</item>
<item>restart_systemui</item>
<item>restart_recovery</item>
<item>restart_bootloader</item>
<item>restart_fastboot</item>
</string-array>
</resources>

View File

@@ -21,58 +21,6 @@
<!-- The restoring is handled by modem if it is true-->
<bool name="skip_restoring_network_selection">true</bool>
<!-- Set to true to add links to Cell Broadcast app from Settings and MMS app. -->
<bool name="config_cellBroadcastAppLinks">true</bool>
<!-- M user agent string -->
<string name="config_mms_user_agent">Android-Mms/2.0</string>
<!-- MMS user agent prolfile url -->
<string name="config_mms_user_agent_profile_url">http://www.google.com/oha/rdf/ua-profile-kila.xml</string>
<!-- This string array should be overridden by the device to present a list of network
attributes. This is used by the connectivity manager to decide which networks can coexist
based on the hardware -->
<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
<!-- the 5th element "resore-time" indicates the number of milliseconds to delay
before automatically restore the default connection. Set -1 if the connection
does not require auto-restore. -->
<!-- the 6th element indicates boot-time dependency-met value. -->
<string-array name="networkAttributes">
<item>wifi,1,1,1,-1,true</item>
<item>mobile,0,0,0,-1,true</item>
<item>mobile_mms,2,0,4,60000,true</item>
<item>mobile_supl,3,0,2,60000,true</item>
<item>mobile_dun,4,0,2,60000,true</item>
<item>mobile_hipri,5,0,3,60000,true</item>
<item>mobile_fota,10,0,2,60000,true</item>
<item>mobile_ims,11,0,2,60000,true</item>
<item>mobile_cbs,12,0,2,60000,true</item>
<item>bluetooth,7,7,2,-1,true</item>
<item>mobile_emergency,15,0,5,-1,true</item>
<item>ethernet,9,9,9,-1,true</item>
<item>wifi_slave,30,1,1,-1,true</item>
</string-array>
<!-- Configure mobile tcp buffer sizes in the form:
rat-name:rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max
If no value is found for the rat-name in use, the system default will be applied.
-->
<string-array name="config_mobile_tcp_buffers">
<item>5gnr:2097152,6291456,16777216,512000,2097152,8388608</item>
<item>lte:2097152,4194304,8388608,262144,524288,1048576</item>
<item>lte_ca:4096,6291456,12582912,4096,1048576,2097152</item>
<item>umts:4094,87380,1220608,4096,16384,1220608</item>
<item>hspa:4094,87380,1220608,4096,16384,1220608</item>
<item>hsupa:4094,87380,1220608,4096,16384,1220608</item>
<item>hsdpa:4094,87380,1220608,4096,16384,1220608</item>
<item>hspap:4094,87380,1220608,4096,16384,1220608</item>
<item>edge:4093,26280,35040,4096,16384,35040</item>
<item>gprs:4092,8760,11680,4096,8760,11680</item>
<item>evdo:4094,87380,524288,4096,16384,262144</item>
</string-array>
<!-- This string array should be overridden by the device to present a list of radio
attributes. This is used by the connectivity manager to decide which networks can coexist
based on the hardware -->
@@ -129,6 +77,11 @@
<!-- Flag specifying whether VoLTE is available on device -->
<bool name="config_device_vt_available">true</bool>
<!-- Flag specifying whether VT should be available for carrier: independent of
carrier provisioning. If false: hard disabled. If true: then depends on carrier
provisioning, availability etc -->
<bool name="config_carrier_vt_available">true</bool>
<!-- Flag specifying whether WFC over IMS is available on device -->
<bool name="config_device_wfc_ims_available">true</bool>
@@ -142,6 +95,11 @@
provisioning, availability etc -->
<bool name="config_carrier_wfc_ims_available">true</bool>
<!-- When true, indicates that the vendor's IMS implementation requires a workaround when
sending a request to enable or disable the camera while the video session is also
paused. -->
<bool name="config_useVideoPauseWorkaround">true</bool>
<!-- IWLAN data service package name to bind to by default. If none is specified in an overlay, an
empty string is passed in -->
<string name="config_wlan_data_service_package">vendor.qti.iwlan</string>
@@ -206,8 +164,11 @@
<item>"/system/bin/surfaceflinger"</item>
</string-array>
<!-- Should the pinner service pin the Home application? -->
<bool name="config_pinnerHomeApp">true</bool>
<!-- Bytes that the PinnerService will pin for Home app -->
<integer name="config_pinnerHomePinBytes">6291456</integer>
<!-- True if camera app should be pinned via Pinner Service -->
<bool name="config_pinnerCameraApp">false</bool>
<!-- Enable doze mode
ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
@@ -280,4 +241,37 @@
manually by the user. Off by default, since the expected haptic feedback may not be
available on some devices. -->
<bool name="config_enableHapticTextHandle">true</bool>
<!-- Whether the new Auto Selection Network UI should be shown -->
<bool name="config_enableNewAutoSelectNetworkUI">true</bool>
<!-- Whether devices suports in-display fingerprint when screen is off -->
<bool name="config_supportScreenOffUdfps">true</bool>
<!-- Whether device has turbo power charging support -->
<bool name="config_hasTurboPowerCharger">true</bool>
<!-- Path to fast charging status file to detect whether an oem fast charger is active -->
<string name="config_oemFastChargerStatusPath" translatable="false">/sys/class/qcom-battery/fastchg_mode</string>
<!-- Control whether the pickup gesture is enabled by default. This value will be used
during initialization when the setting is still null. -->
<bool name="config_dozePickupGestureEnabled">false</bool>
<!-- Determines whether the shell features all run on another thread. -->
<bool name="config_enableShellMainThread">true</bool>
<!-- SQLite -->
<string name="db_default_journal_mode">MEMORY</string>
<string name="db_default_sync_mode">OFF</string>
<string name="db_wal_sync_mode">OFF</string>
<!-- Smart 5G -->
<bool name="config_supportSmart5G">true</bool>
<!-- Whether the device supports Smart Pixels -->
<bool name="config_supportSmartPixels">true</bool>
<!-- PowerOffAlarmService -->
<bool name="config_powerOffAlarmEnabled">true</bool>
</resources>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (c) 2006, The Android Open Source Project
/**
* 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.
@@ -13,8 +14,15 @@
* 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.
*/
*/
-->
<resources>
<dimen name="rounded_corner_content_padding">16dp</dimen>
<!-- Set the automatic brightness mode on by default -->
<bool name="def_screen_brightness_automatic_mode">true</bool>
<!-- Speed up the animations -->
<fraction name="def_window_animation_scale">80%</fraction>
<fraction name="def_window_transition_scale">80%</fraction>
</resources>

View File

@@ -57,4 +57,13 @@
<!-- Preferred max refresh rate at keyguard, if supported by the display. -->
<integer name="config_keyguardMaxRefreshRate">60</integer>
<!-- Preferred max refresh rate at AOD & Ambient Display, if supported by the display. -->
<integer name="config_aodMaxRefreshRate">60</integer>
<!-- If not zero, limits the internal screen recorder's framerate to the set value. -->
<integer name="config_screenRecorderMaxFramerate">120</integer>
<!-- The CPU temperature divider, if needed -->
<integer name="config_cpuTempDivider" translatable="false">1000</integer>
</resources>

View File

@@ -15,6 +15,9 @@
-->
<resources>
<!-- Device specific doze package -->
<string name="config_customDozePackage" translatable="false">org.lineageos.settings/org.lineageos.settings.doze.DozeSettingsActivity</string>
<!-- The number of vibration intensity levels supported by the device.
Note that this should correspond to the ability to vary the vibration amplitude, with
@@ -33,4 +36,22 @@
should be either LOW (1) or HIGH (3).
-->
<integer name="config_vibration_supported_intensity_levels">2</integer>
<!-- Max network scan search time in seconds -->
<integer name="config_network_scan_helper_max_search_time_sec">254</integer>
<!-- Whether to show peak refresh rate in display settings -->
<bool name="config_show_peak_refresh_rate_switch">true</bool>
<!-- Whether to show min refresh rate in display settings -->
<bool name="config_show_min_refresh_rate_switch">true</bool>
<!-- Show Force LTE_CA toggle -->
<bool name="config_showForceLteCaToggle" translatable="false">true</bool>
<!-- Whether to show volume steps settings -->
<bool name="config_supports_volume_steps" translatable="false">true</bool>
<!-- Whether to show vendor security patch level -->
<bool name="config_show_vendor_patch_level" translatable="false">false</bool>
</resources>

View File

@@ -19,4 +19,42 @@
<!-- String indicating the package name of the device ImsService implementation for RCS. -->
<string name="config_ims_rcs_package" translatable="false">org.codeaurora.ims</string>
<!-- Dynamic routing of emergency calls: trying normal routing if it's available.
Otherwise, emergency routing. -->
<bool name="dynamic_routing_emergency_enabled">true</bool>
<!-- Array of countries that the dynamic routing is supported.
Values should be ISO3166 country codes in lowercase. -->
<string-array name="config_countries_dynamic_routing_emergency_enabled"
translatable="false">
<item>in</item>
<item>il</item>
<item>tw</item>
<item>sg</item>
<item>ch</item>
<item>sk</item>
<item>pl</item>
<item>si</item>
<item>ba</item>
</string-array>
<!-- Array of emergency numbers for dynamic routing.
Values are the tuples of Country ISO, MNC, and numbers. -->
<string-array name="config_dynamic_routing_emergency_numbers"
translatable="false">
<item>in,,101,102,103,108</item>
<item>il,,101,102</item>
<item>tw,,110,119</item>
<item>sg,,995</item>
<item>ch,,1414</item>
<item>gp,,115,119,191,196,197,116000,116111,116117</item>
<item>sk,,159</item>
<item>pl,01,984,985,997,998,999</item>
<item>pl,06,984,985,997,998,999</item>
<item>pl,,986,987,989,991,992,993,994,995,996</item>
<item>re,,115,119,191,196,197,116000,116111,116117</item>
<item>si,,113</item>
<item>ba,,122,123,124</item>
</string-array>
</resources>

20
parts/Android.bp Normal file
View File

@@ -0,0 +1,20 @@
//
// Copyright (C) 2017-2020 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
android_app {
name: "XiaomiParts",
srcs: ["src/**/*.java"],
certificate: "platform",
platform_apis: true,
system_ext_specific: true,
privileged: true,
static_libs: [
"org.lineageos.settings.resources",
],
}

246
parts/AndroidManifest.xml Normal file
View File

@@ -0,0 +1,246 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 The CyanogenMod Project
2017-2018 The LineageOS 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.settings"
android:versionCode="1"
android:versionName="1.0"
android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_TASKS" />
<protected-broadcast android:name="com.android.systemui.doze.pulse" />
<uses-sdk
android:minSdkVersion="24"
android:targetSdkVersion="30"/>
<application
android:label="@string/device_settings_app_name"
android:persistent="true"
android:defaultToDeviceProtectedStorage="true"
android:directBootAware="true"
android:theme="@style/Theme.SubSettingsBase.Expressive">
<receiver android:name=".BootCompletedReceiver">
<intent-filter android:priority="1000">
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity
android:name=".kamisstuff.KamisStuffActivity"
android:label="@string/kamis_stuff_title">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.system" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/kamis_stuff_summary" />
<meta-data
android:name="com.android.settings.icon"
android:resource="@drawable/ic_kami" />
</activity>
<activity
android:name=".zram.ZramActivity"
android:label="@string/zram_size_title"
android:exported="false" />
<activity
android:name=".charge.ChargeActivity"
android:label="@string/charge_bypass_title"
android:exported="false" />
<activity
android:name=".corecontrol.CoreControlActivity"
android:label="@string/core_control_title"
android:exported="false" />
<activity
android:name=".kernelmanager.KernelManagerActivity"
android:label="@string/kernel_manager_title"
android:exported="false" />
<activity
android:name=".gpumanager.GpuManagerActivity"
android:label="@string/gpu_manager_title"
android:exported="false" />
<activity
android:name=".doze.DozeSettingsActivity"
android:label="@string/ambient_display_title">
</activity>
<service android:name=".doze.DozeService"
android:permission="XiaomiDozeService">
</service>
<activity
android:name=".thermal.ThermalActivity"
android:label="@string/thermal_title">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.battery" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/thermal_summary" />
</activity>
<service
android:name=".thermal.ThermalService"
android:permission="ThermalService">
</service>
<activity
android:name=".touchsampling.TouchSamplingSettingsActivity"
android:label="@string/htsr_enable_title"
android:exported="false">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.display" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/htsr_enable_summary" />
</activity>
<service
android:name=".touchsampling.TouchSamplingTileService"
android:icon="@drawable/ic_htsr"
android:label="@string/htsr_enable_title"
android:exported="true"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<activity
android:name=".speaker.ClearSpeakerActivity"
android:label="@string/clear_speaker_title">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.sound" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/clear_speaker_summary" />
</activity>
<activity
android:name=".refreshrate.RefreshActivity"
android:label="@string/refresh_title"
android:exported="false">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.display" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/refresh_summary" />
</activity>
<service
android:name=".refreshrate.RefreshService"
android:exported="true"
android:permission="RefreshService">
</service>
<service
android:name=".thermal.ThermalTileService"
android:icon="@drawable/ic_thermal"
android:label="@string/thermal_title"
android:exported="true"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action
android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
<service
android:name=".display.DcDimmingTileService"
android:exported="true"
android:icon="@drawable/ic_dc_tile"
android:label="@string/dc_dimming_enable_title"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action
android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
<activity
android:name=".display.DcDimmingSettingsActivity"
android:label="@string/dc_dimming_enable_title"
android:exported="true">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.display" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/dc_dimming_enable_summary" />
</activity>
<activity
android:name=".hbm.HBMActivity"
android:label="@string/hbm_fragment_title"
android:exported="false">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.display" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/hbm_fragment_summary" />
</activity>
<activity
android:name=".hbm.HBMFragment" />
<service
android:name=".hbm.AutoHBMService"
android:exported="false" />
<service
android:name=".hbm.HBMModeTileService"
android:icon="@drawable/ic_hbm_tile"
android:label="@string/hbm_mode_title"
android:exported="true"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
</application>
</manifest>

View File

@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M20 4H4C2.9 4 2 4.9 2 6v12c0 1.1 0.9 2 2 2h16c1.1 0 2-0.9 2-2V6c0-1.1-0.9-2-2-2zm0 14H4V6h16v12z"/>
<path
android:fillColor="#000"
android:pathData="M8.29 15.71c-0.49-0.49-0.88-1.06-1.14-1.7c-0.26-0.64-0.4-1.32-0.4-2.01c0-1.35 0.52-2.69 1.53-3.72L7.05 7.05C5.68 8.41 5 10.21 5 12s0.68 3.59 2.06 4.94l1.23-1.23zM12 15.5c1.93 0 3.5-1.57 3.5-3.5S13.93 8.5 12 8.5S8.5 10.07 8.5 12s1.57 3.5 3.5 3.5zm0-5c0.83 0 1.5 0.67 1.5 1.5s-0.67 1.5-1.5 1.5s-1.5-0.67-1.5-1.5s0.67-1.5 1.5-1.5zm3.72 5.22l1.23 1.23C18.32 15.59 19 13.79 19 12s-0.68-3.59-2.06-4.94l-1.23 1.23c0.49 0.49 0.88 1.06 1.14 1.7c0.26 0.64 0.4 1.32 0.4 2.01c0 1.35-0.52 2.69-1.53 3.72z"/>
</vector>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M8,8h8c0.55,0 1,0.45 1,1v6c0,0.55 -0.45,1 -1,1H8c-0.55,0 -1,-0.45 -1,-1V9c0,-0.55 0.45,-1 1,-1z" />
<path android:fillColor="#000" android:pathData="M9,6h1v2H9z" />
<path android:fillColor="#000" android:pathData="M11,6h1v2h-1z" />
<path android:fillColor="#000" android:pathData="M13,6h1v2h-1z" />
<path android:fillColor="#000" android:pathData="M15,6h1v2h-1z" />
<path android:fillColor="#000" android:pathData="M9,16h1v2H9z" />
<path android:fillColor="#000" android:pathData="M11,16h1v2h-1z" />
<path android:fillColor="#000" android:pathData="M13,16h1v2h-1z" />
<path android:fillColor="#000" android:pathData="M15,16h1v2h-1z" />
<path android:fillColor="#000" android:pathData="M6,9h2v1H6z" />
<path android:fillColor="#000" android:pathData="M6,11h2v1H6z" />
<path android:fillColor="#000" android:pathData="M6,13h2v1H6z" />
<path android:fillColor="#000" android:pathData="M6,15h2v1H6z" />
<path android:fillColor="#000" android:pathData="M16,9h2v1h-2z" />
<path android:fillColor="#000" android:pathData="M16,11h2v1h-2z" />
<path android:fillColor="#000" android:pathData="M16,13h2v1h-2z" />
<path android:fillColor="#000" android:pathData="M16,15h2v1h-2z" />
<path android:fillColor="#FFF" android:pathData="M9.5,9.5h2v2h-2z" />
<path android:fillColor="#FFF" android:pathData="M12.5,9.5h2v2h-2z" />
<path android:fillColor="#FFF" android:pathData="M9.5,12.5h2v2h-2z" />
<path android:fillColor="#FFF" android:pathData="M12.5,12.5h2v2h-2z" />
</vector>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018-2021 crDroid Android 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0" >
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M19,13H5V11H19V13Z" />
</vector>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018-2021 crDroid Android 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="48.0"
android:viewportHeight="48.0" >
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M38.0,26.0L26.0,26.0l0.0,12.0l-4.0,0.0L22.0,26.0L10.0,26.0l0.0,-4.0l12.0,0.0L22.0,10.0l4.0,0.0l0.0,12.0l12.0,0.0l0.0,4.0z" />
</vector>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018-2021 crDroid Android 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0" >
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z" />
</vector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#fff" android:pathData="M14,8.5A1.5,1.5 0 0,0 12.5,10A1.5,1.5 0 0,0 14,11.5A1.5,1.5 0 0,0 15.5,10A1.5,1.5 0 0,0 14,8.5M14,12.5A1.5,1.5 0 0,0 12.5,14A1.5,1.5 0 0,0 14,15.5A1.5,1.5 0 0,0 15.5,14A1.5,1.5 0 0,0 14,12.5M10,17A1,1 0 0,0 9,18A1,1 0 0,0 10,19A1,1 0 0,0 11,18A1,1 0 0,0 10,17M10,8.5A1.5,1.5 0 0,0 8.5,10A1.5,1.5 0 0,0 10,11.5A1.5,1.5 0 0,0 11.5,10A1.5,1.5 0 0,0 10,8.5M14,20.5A0.5,0.5 0 0,0 13.5,21A0.5,0.5 0 0,0 14,21.5A0.5,0.5 0 0,0 14.5,21A0.5,0.5 0 0,0 14,20.5M14,17A1,1 0 0,0 13,18A1,1 0 0,0 14,19A1,1 0 0,0 15,18A1,1 0 0,0 14,17M21,13.5A0.5,0.5 0 0,0 20.5,14A0.5,0.5 0 0,0 21,14.5A0.5,0.5 0 0,0 21.5,14A0.5,0.5 0 0,0 21,13.5M18,5A1,1 0 0,0 17,6A1,1 0 0,0 18,7A1,1 0 0,0 19,6A1,1 0 0,0 18,5M18,9A1,1 0 0,0 17,10A1,1 0 0,0 18,11A1,1 0 0,0 19,10A1,1 0 0,0 18,9M18,17A1,1 0 0,0 17,18A1,1 0 0,0 18,19A1,1 0 0,0 19,18A1,1 0 0,0 18,17M18,13A1,1 0 0,0 17,14A1,1 0 0,0 18,15A1,1 0 0,0 19,14A1,1 0 0,0 18,13M10,12.5A1.5,1.5 0 0,0 8.5,14A1.5,1.5 0 0,0 10,15.5A1.5,1.5 0 0,0 11.5,14A1.5,1.5 0 0,0 10,12.5M10,7A1,1 0 0,0 11,6A1,1 0 0,0 10,5A1,1 0 0,0 9,6A1,1 0 0,0 10,7M10,3.5A0.5,0.5 0 0,0 10.5,3A0.5,0.5 0 0,0 10,2.5A0.5,0.5 0 0,0 9.5,3A0.5,0.5 0 0,0 10,3.5M10,20.5A0.5,0.5 0 0,0 9.5,21A0.5,0.5 0 0,0 10,21.5A0.5,0.5 0 0,0 10.5,21A0.5,0.5 0 0,0 10,20.5M3,13.5A0.5,0.5 0 0,0 2.5,14A0.5,0.5 0 0,0 3,14.5A0.5,0.5 0 0,0 3.5,14A0.5,0.5 0 0,0 3,13.5M14,3.5A0.5,0.5 0 0,0 14.5,3A0.5,0.5 0 0,0 14,2.5A0.5,0.5 0 0,0 13.5,3A0.5,0.5 0 0,0 14,3.5M14,7A1,1 0 0,0 15,6A1,1 0 0,0 14,5A1,1 0 0,0 13,6A1,1 0 0,0 14,7M21,10.5A0.5,0.5 0 0,0 21.5,10A0.5,0.5 0 0,0 21,9.5A0.5,0.5 0 0,0 20.5,10A0.5,0.5 0 0,0 21,10.5M6,5A1,1 0 0,0 5,6A1,1 0 0,0 6,7A1,1 0 0,0 7,6A1,1 0 0,0 6,5M3,9.5A0.5,0.5 0 0,0 2.5,10A0.5,0.5 0 0,0 3,10.5A0.5,0.5 0 0,0 3.5,10A0.5,0.5 0 0,0 3,9.5M6,9A1,1 0 0,0 5,10A1,1 0 0,0 6,11A1,1 0 0,0 7,10A1,1 0 0,0 6,9M6,17A1,1 0 0,0 5,18A1,1 0 0,0 6,19A1,1 0 0,0 7,18A1,1 0 0,0 6,17M6,13A1,1 0 0,0 5,14A1,1 0 0,0 6,15A1,1 0 0,0 7,14A1,1 0 0,0 6,13Z" />
</vector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M23.5,17L18.5,22L15,18.5L16.5,17L18.5,19L22,15.5L23.5,17M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.75,12.65 22.44,13.26 22.08,13.85C21.5,13.5 20.86,13.25 20.18,13.12L20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12C4.83,15.36 8.24,17.5 12,17.5L13.21,17.43C13.07,17.93 13,18.46 13,19V19.46L12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5Z" />
</vector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M17,19V5H7V19H17M17,1A2,2 0 0,1 19,3V21A2,2 0 0,1 17,23H7C5.89,23 5,22.1 5,21V3C5,1.89 5.89,1 7,1H17M9,7H15V9H9V7M9,11H13V13H9V11Z" />
</vector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M14.3,16L13.6,14H10.4L9.7,16H7.8L11,7H13L16.2,16H14.3M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69M10.85,12.65H13.15L12,9L10.85,12.65Z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69Z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z"/>
</vector>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M15.67,4H14V2h-4v2H8.33C7.6,4 7,4.6 7,5.33v15.33C7,21.4 7.6,22 8.33,22h7.33c0.74,0 1.34,-0.6 1.34,-1.33V5.33C17,4.6 16.4,4 15.67,4z" />
<path
android:fillColor="#FFF"
android:pathData="M13,7h-2l-1,5h2l-1,5 3,-5h-2l1,-5z" />
</vector>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M21,16v-2l-8,-5V3.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,2.67 10,3.5V9l-8,5v2l8,-2.5V19l-2,1.5V22l3.5,-1L15,22v-1.5L13,19v-5.5L21,16z" />
<path
android:fillColor="#000"
android:pathData="M3,3h2v2H3z" />
<path
android:fillColor="#000"
android:pathData="M19,3h2v2h-2z" />
<path
android:fillColor="#000"
android:pathData="M3,19h2v2H3z" />
<path
android:fillColor="#000"
android:pathData="M19,19h2v2h-2z" />
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M11,4V1H13V4ZM11,23V20H13V23ZM20,13V11H23V13ZM1,13V11H4V13ZM18.7,6.7 L17.3,5.3 19.05,3.5 20.5,4.95ZM4.95,20.5 L3.5,19.05 5.3,17.3 6.7,18.7ZM19.05,20.5 L17.3,18.7 18.7,17.3 20.5,19.05ZM5.3,6.7 L3.5,4.95 4.95,3.5 6.7,5.3ZM12,18Q9.5,18 7.75,16.25Q6,14.5 6,12Q6,9.5 7.75,7.75Q9.5,6 12,6Q14.5,6 16.25,7.75Q18,9.5 18,12Q18,14.5 16.25,16.25Q14.5,18 12,18ZM12,16Q13.675,16 14.838,14.837Q16,13.675 16,12Q16,10.325 14.838,9.162Q13.675,8 12,8Q10.325,8 9.163,9.162Q8,10.325 8,12Q8,13.675 9.163,14.837Q10.325,16 12,16ZM12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M20.22,10l-4.15,0.01c-0.16,-0.01 -0.31,0.02 -0.45,0.08l-0.59,0.26L13.2,6.25c-0.56,-1.26 -2.04,-1.83 -3.3,-1.27s-1.83,2.04 -1.27,3.3l3.3,7.45l-1.87,0.39c-0.19,0.05 -0.99,0.27 -1.36,1.21L8,19.19l6.78,2.67c0.49,0.19 1.05,0.18 1.53,-0.04l5.99,-2.65c0.89,-0.4 1.37,-1.38 1.13,-2.32l-1.36,-5.34C21.85,10.65 21.1,10.04 20.22,10zM21.49,17.34L15.5,20l-4.92,-1.96l4.18,-0.88l-4.3,-9.7c-0.11,-0.25 0,-0.55 0.25,-0.66c0.25,-0.11 0.55,0 0.66,0.25l2.5,5.65l1.61,-0.71L20.13,12L21.49,17.34zM2.06,5.56L1,4.5L4.5,1L8,4.5L6.94,5.56L5.32,3.94C5.11,4.76 5,5.62 5,6.5c0,2.42 0.82,4.65 2.2,6.43L6.13,14C4.49,11.95 3.5,9.34 3.5,6.5c0,-0.92 0.1,-1.82 0.3,-2.68L2.06,5.56z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<!-- drawable/ic_info_outline.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z" />
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" />
</vector>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2V17zM13,9h-2V7h2V9z" />
<path
android:fillColor="#000"
android:pathData="M4,12h2v2H4z" />
<path
android:fillColor="#000"
android:pathData="M18,12h2v2h-2z" />
<path
android:fillColor="#000"
android:pathData="M12,4h2v2h-2z" />
<path
android:fillColor="#000"
android:pathData="M12,18h2v2h-2z" />
</vector>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorAccent">
<path
android:fillColor="#ff000000"
android:pathData="M17 1.01L7 1C5.9 1 5 1.9 5 3v4h2V3h10v18H7v-4H5v4c0 1.1 0.9 2 2 2h10c1.1 0 2-0.9 2-2V3c0-1.1-0.9-1.99-2-1.99Z"/>
<path
android:fillColor="#ff000000"
android:pathData="M1 8v1.56h1.56v6.22H4.1V8H1Z"/>
<path
android:fillColor="#ff000000"
android:pathData="M4.89 8v1.56H8v1.55H6.44c-0.4 0-0.8 0.17-1.1 0.46-0.29 0.29-0.45 0.68-0.45 1.1v3.1h4.67v-1.55H6.44v-1.55H8c0.41 0 0.8-0.17 1.1-0.46 0.3-0.3 0.46-0.69 0.46-1.1V9.56c0-0.42-0.17-0.81-0.46-1.1C8.8 8.16 8.41 8 8 8H4.89Z"/>
<path
android:fillColor="#ff000000"
android:strokeColor="#ff000000"
android:strokeWidth="1"
android:pathData="M11.89 9.06h-0.5v0.5 4.66 0.5h0.5 1.55 0.5v-0.5-4.66-0.5h-0.5-1.55ZM11.14 8.8c0.2-0.2 0.47-0.31 0.75-0.31h1.55c0.28 0 0.55 0.11 0.75 0.3 0.2 0.2 0.31 0.48 0.31 0.76v4.66c0 0.28-0.11 0.55-0.3 0.75-0.2 0.2-0.48 0.3-0.76 0.3H11.9c-0.28 0-0.55-0.1-0.75-0.3-0.2-0.2-0.3-0.47-0.3-0.75V9.56c0-0.28 0.1-0.55 0.3-0.75Z"/>
</vector>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorAccent">
<path
android:fillColor="#ff000000"
android:pathData="M6.55 8c-0.4 0-0.8 0.16-1.1 0.46C5.17 8.75 5 9.14 5 9.56v4.66c0 0.4 0.16 0.8 0.46 1.1 0.29 0.29 0.68 0.45 1.1 0.45H8.1c0.41 0 0.8-0.16 1.1-0.46 0.29-0.29 0.45-0.68 0.45-1.1v-1.55c0-0.41-0.16-0.8-0.45-1.1-0.3-0.29-0.69-0.45-1.1-0.45H6.55V9.55h3.11V8h-3.1Zm0 4.66h1.56v1.56H6.55v-1.56Z"/>
<path
android:fillColor="#ff000000"
android:pathData="M12 8c-0.42 0-0.81 0.16-1.1 0.46-0.3 0.29-0.46 0.68-0.46 1.1v4.66c0 0.4 0.16 0.8 0.45 1.1 0.3 0.29 0.69 0.45 1.1 0.45h1.56c0.4 0 0.8-0.16 1.1-0.46 0.29-0.29 0.45-0.68 0.45-1.1V9.56c0-0.4-0.16-0.8-0.46-1.1C14.35 8.17 13.96 8 13.54 8H12Zm0 1.55h1.55v4.67h-1.56V9.55Z"/>
<path
android:fillColor="#ff000000"
android:pathData="M17 1.01L7 1C5.9 1 5 1.9 5 3v4h2V3h10v18H7v-4H5v4c0 1.1 0.9 2 2 2h10c1.1 0 2-0.9 2-2V3c0-1.1-0.9-1.99-2-1.99Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorAccent">
<path
android:fillColor="#ff000000"
android:pathData="M17 3.01V15l2 2V3.01c0-1.1-0.9-1.99-2-1.99L7 1C6 0.99 5 1.99 5 2.99L7 5V3.01h10Zm4.2 18.19L19 19.01l-2-2-10-10-2-2-2.19-2.19L1.4 4.23 5 7.84v13.17c0 1.1 0.9 2 2 2h10c0.85 0 1.58-0.55 1.87-1.3l0.91 0.91 1.41-1.42ZM17 21.01H7L17 21v-0.99 1Zm-10 0V9.84l10 10.17V21L7 21.01Z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<!-- drawable/music_clef_bass.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M18.5 5A1.5 1.5 0 1 1 17 6.5A1.5 1.5 0 0 1 18.5 5M18.5 11A1.5 1.5 0 1 1 17 12.5A1.5 1.5 0 0 1 18.5 11M10 4A5 5 0 0 0 5 9V10A2 2 0 1 0 7.18 8A3 3 0 0 1 10 6A4 4 0 0 1 14 10C14 13.59 11.77 16.19 7 18.2L7.76 20.04C13.31 17.72 16 14.43 16 10A6 6 0 0 0 10 4Z" />
</vector>

Some files were not shown because too many files have changed in this diff Show More