438 Commits
bka ... udc

Author SHA1 Message Date
pjgowtham
754e0196d8 cepheus: fingerprint: Set dim layer zOrder
Requires: I367b2c395aeb8cb7cb9e3cc38eca98477befe007
Change-Id: I881db78186fa9c7b350e79ac4ef90f53ee4cfbcf
2024-11-13 22:32:55 +01:00
basamaryan
67db15d158 cepheus: overlay: Disable turbulence noise 2024-10-12 11:11:43 +02:00
luffitys
3f7d519e7c cepheus: Build missing WFD libs
Co-authored-by: Edwin Moquete <edwinmmoquete@gmail.com>
Change-Id: I2cd360cc7fc1260e99111f18f09fefb8231ce01f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-09-10 21:45:37 +02:00
chematelegram
0499be91c1 cepheus: Remove extra slash
* It's harmless but let's sanitize and avoid any possible risk in the future
2024-09-09 09:33:51 +02:00
chematelegram
d204e63df9 cepheus: Adjust reserved size for GApps
* Again hitting the Super partition size. We won't miss that reserved size in System anyway
2024-09-05 10:48:05 +02:00
Yumi Yukimura
0a2c7d8154 cepheus: Switch to QTI Memtrack AIDL HAL 2024-09-04 15:31:50 +02:00
chematelegram
c55b20840b cepheus: Support automated DC dimming 2024-09-02 10:00:47 +02:00
chematelegram
9153997a3a cepheus: Move Soterservice to vendor 2024-09-01 21:33:05 +02:00
chematelegram
39f9d55360 cepheus: Drop updatable GPU drivers 2024-09-01 21:19:07 +02:00
chematelegram
c5fec692f0 Revert "cepheus: Import sensors.mius.proximity.so"
This reverts commit f2b7a133c5.
2024-09-01 18:10:18 +02:00
¨raystef66¨
1ba5793a8d cepheus: Switch back to nabu V13.0.3.0.RKXCNXM graphics blobs
* So Magic Eraser/Editor stops crashing.
* Also stop crashes while editing on Google Photos

This reverts following commits:

37941cbdb03469fdefb50fc749e2314c5063704e
ca151b80e89f73aa8a189dbf7227ae3ec3414ef3
610cc43636f3bd4d7b1726a5b22ff6684fcf8d1d
bd485be6dd076641f9bb2a0186ea284a3befcd57

Based on a7c8a40fe6
2024-09-01 18:09:23 +02:00
chematelegram
f81a9ee53e Merge pull request #1 from dkpost3/patch-1
fix symlink
2024-08-19 00:25:01 +02:00
Dmitry
283c4371f7 fix symlink 2024-08-18 20:50:12 +03:00
chematelegram
3c52c76f0e cepheus: Update dependencies
* Use hardware_xiaomi from EvolutionX
 * Use my fork for the miui camera and use a different target path to avoid problems with other devices using roomservice
2024-08-15 12:08:38 +02:00
chematelegram
a0230da208 cepheus: Include miuicamera in dependencies 2024-07-30 22:22:05 +02:00
chematelegram
80bca5f62f cepheus: Use MINI GApps 2024-07-25 23:57:39 +02:00
chematelegram
3af209eacd Revert "cepheus: Drop MIUI camera support"
This reverts commit eab7db2e5d.
2024-07-25 23:30:31 +02:00
Akash Srivastava
f82f48eed5 cepheus: sepolicy: fix denials for hal_health_default 2024-07-22 03:54:07 +02:00
chematelegram
84503c6717 cepheus: overlay: Support volume steps 2024-07-21 17:41:28 +02:00
chematelegram
a3c8487745 cepheus: overlay: Show double-tap-to-ambient settings 2024-07-21 17:39:59 +02:00
chematelegram
6d0e07853f cepheus: Include Seedvault
* It is optional now in sources
2024-07-19 08:59:17 +02:00
chematelegram
739cb9c880 cepheus: overlay: Remove config_suspendWhenScreenOffDueToProximity
* I don't know if this has something to do with our freezes or black screens but
   definitely proximity is not something we should trust on our device
2024-07-19 08:46:50 +02:00
chematelegram
0c0cc1168f cepheus: Switch to clang 19 2024-07-19 08:46:40 +02:00
chematelegram
a1e79adf81 cepheus: Adjust reserved sizes for GApps 2024-07-13 00:46:37 +02:00
Bruno Martins
3348335f17 cepheus: Mark CNE symlink target as required package
Change-Id: I0bfe65ba61b6aa9916fe6459be2a84d772939a2f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-13 00:46:37 +02:00
Bruno Martins
fce0063510 cepheus: Declare WFD lib as symlinks during extraction
Change-Id: I2a035323a483b8b2422b4a54219b2f6268ab4a61
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-13 00:46:37 +02:00
x0x00044
fdf252599b cepheus: overlay: Remove config_cellBroadcastAppLinks 2024-07-13 00:46:37 +02:00
Michael Bestas
a4ae0e17c7 cepheus: Include lineage FCM 2024-07-13 00:46:37 +02:00
Bruno Martins
faa6a1b30d cepheus: Inherit from QTI FCM 2024-07-13 00:46:37 +02:00
Bruno Martins
c2fb52a337 cepheus: Convert WiFi firmware symlinks to install_symlink targets
* The last bit that was preventing building hermetic images.

Change-Id: I75bb7de4593a7992f6015317cf97e088beeba0cb
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-13 00:46:37 +02:00
Bruno Martins
8431c2c877 cepheus: Declare EGL libs as symlinks during extraction
Change-Id: I4b2f3e79b5e518889d9771bf8990e27babca8b61
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-13 00:46:37 +02:00
Bruno Martins
5910f81105 cepheus: Declare IMS libs as symlinks during extraction
Change-Id: Ia1b8097d28dd4888232fe383b830515b1b9bafaa
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-13 00:46:37 +02:00
Bruno Martins
845b2ce962 cepheus: Move to new RFS install_symlink targets
Change-Id: I9560fd0da00958d9349a0881b5a5f64a2c02e495
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-13 00:46:37 +02:00
Paul Crowley
9045d28b5c cepheus: Remove wait_for_keymaster and all references
No longer needed now init listens for property changes on a
separate thread.

Bug: 186580823
Test: Cuttlefish boots successfully
Change-Id: Ief3a546d2154231d18957c2f703bd128966d7288
2024-07-13 00:46:37 +02:00
Alex Sarraf
8e3b60efbd cepheus: Disable SF client composition cache
Disable SF client composition cache. Helps with framework
client target fence management.

Change-Id: I73e03e76f51d00fafad38479be00f4005be50665
2024-07-13 00:46:37 +02:00
Josh Wu
9eddb81bd1 cepheus: Switch BtAudio to AIDL
Test: m
Bug: 203490261
Change-Id: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
Merged-In: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
2024-07-13 00:46:37 +02:00
Master
0436201169 cepheus: Disable sparse for ext/f2fs images
* Sparse images cause kPostInstallMountError

Co-authored-by: yairpatch <yair.zarfati@gmail.com>
Change-Id: Ifdb2fc87d88c9c2139b3e73b6ccad36f09888b75
Signed-off-by: ralph950412 <ralph950412@gmail.com>
Signed-off-by: alternoegraha <noegrahachan@gmail.com>
2024-07-13 00:46:37 +02:00
Bruno Martins
b2affd500c cepheus: Use the common device compatibility matrix from QCOM
Change-Id: I6b58cd68542f5b8b4d66433c0264919100eebde4
2024-07-13 00:46:37 +02:00
Bruno Martins
bb670b3bb0 cepheus: Unset BUILD_BROKEN_INCORRECT_PARTITION_IMAGES 2024-07-13 00:46:37 +02:00
Tim Zimmermann
997ebe1969 cepheus: Set manifest target-level to 5 2024-07-13 00:46:37 +02:00
¨raystef66¨
d3e9aadf30 cepheus: Add device FCM 2024-07-13 00:46:37 +02:00
¨raystef66¨
2191b77895 cepheus: build libpiex 2024-07-13 00:46:37 +02:00
Marc Bourgoin
ca67fb1652 cepheus: Fix audio on QPR3 with alsa audio
As of Android 14 QPR3, our device requires the use of alsa audio,
otherwise audio HAL keeps crashing with error messages of being
unable to route audio and listAudioPorts failed
2024-07-13 00:46:37 +02:00
dataoutputstream
95f9be1670 cepheus: Build audio.primary.default
* Without these modules, logcat gets spammed with:
   AudioSystem-JNI: AudioSystem::listAudioPorts error -19
2024-07-13 00:45:48 +02:00
Michael Bestas
8a8b36da6d cepheus: Build missing libraries for 14 QPR3 2024-07-09 14:27:56 +02:00
chematelegram
d61680872f cepheus: Prove I am human 2024-05-23 19:36:14 +02:00
chematelegram
ac2e58ebe7 cepheus: overlay: Do not include Pocket Mode
* our proximity sensor is one of the biggest shit in the world
2024-05-22 13:25:03 +02:00
chematelegram
666b90a1bf cepheus: sepolicy: Remove duplicates 2024-05-19 16:53:28 +02:00
chematelegram
fac0149fb6 cepheus: overlay: Declare LED capabilities 2024-05-19 16:53:28 +02:00
chematelegram
6fb38dbf51 cepheus: overlay: Update battery info when charging 2024-05-17 10:06:54 +02:00
chematelegram
82ed5dccd4 cepheus: Support screen-off UDFPS 2024-05-17 10:04:01 +02:00
chematelegram
f3cdc1198b cepheus: Support UDFPS icons and animations 2024-05-14 07:33:26 +02:00
chematelegram
a74e83e8cb cepheus: Remove old workflow setup 2024-05-13 22:59:56 +02:00
chematelegram
ac3d4a792e cepheus: Add dependencies 2024-05-13 22:56:58 +02:00
chematelegram
e316771154 cepheus: overlay: Aperture: Fix path to overlay 2024-05-13 01:20:00 +02:00
chematelegram
eab7db2e5d cepheus: Drop MIUI camera support 2024-05-13 01:18:04 +02:00
chematelegram
7387313bdc Revert "Revert "cepheus: overlay: Update camera IDs for aperture""
This reverts commit 6cb462431b.
2024-05-12 22:34:45 +02:00
johnmart19
27907d32a0 cepheus: Set TARGET_CAMERA_PACKAGE_NAME for Miui/Leica Camera 2024-05-12 00:03:02 +02:00
chematelegram
b1305b70fb cepheus: Clean the tree
* Complete the tree adaptation to the lineage-based sources
 * Remove unused flags
 * Remove unused overlays and rename others
2024-05-02 11:47:38 +02:00
chematelegram
5530d72cf7 cepheus: Disable EPPE
* enforce-product-pakages-exist
2024-05-01 14:44:16 +02:00
chematelegram
f859539437 cepheus: Adjust the partitions reserved sizes
* since we are exceeding the super partition size after QPR2
2024-05-01 14:43:12 +02:00
¨raystef66¨
501cf229e9 cepheus: Reserve space for gapps install 2024-05-01 14:43:12 +02:00
Sebastiano Barezzi
dcdce2c343 cepheus: Treat retrofit devices as launching with dynamic
*RuntimeError: Device with retrofit dynamic partitions must use regular (non-Virtual) A/B
2024-05-01 14:43:12 +02:00
chematelegram
e720183e0d cepheus: sepolicy: Switch to '-isolated_app_all' where needed
* From error:
 * Found prohibited permission granted for isolated like types. Please
 * replace your allow statements that involve '-isolated_app' with '-isolated_app_all'.
2024-05-01 14:43:12 +02:00
chematelegram
e1871cfa28 Revert "cepheus: fastcharge: Extend Fastcharge implementation"
This reverts commit 8dea951d2a.
2024-05-01 14:43:12 +02:00
chematelegram
5cc3207d0e cepheus: Stop ignoring neverallows 2024-05-01 14:43:12 +02:00
chematelegram
56ae8bfcd4 cepheus: Initial adaptation for new ROM sources 2024-05-01 14:43:12 +02:00
chematelegram
63e141b17e Revert "cepheus: sepolicy: Suppress system suspend denials spam"
This reverts commit 9b4cd2cc62.
2024-05-01 14:43:12 +02:00
chematelegram
0e381ee495 Revert "cepheus: sepolicy: Silence denials by suspend wakeups"
This reverts commit 8a2052c96f.
2024-05-01 14:43:12 +02:00
chematelegram
3e3f7f364f Revert "cepheus: thermal: Cleanup modules already defined in sources"
This reverts commit 815f241e19.
2024-05-01 14:43:12 +02:00
chematelegram
4ebd9deb90 [TMP] cepheus: Add some flags for jemalloc 2024-05-01 14:43:12 +02:00
chematelegram
5e2130a931 cepheus: Remove dependencies for now 2024-04-17 10:45:22 +02:00
chematelegram
6e0553e34b cepheus: sepolicy: Clean rules about MIUI camera
* this sepolicy is provided by the camera repository
2024-04-17 10:36:36 +02:00
tribual
07320f2185 cepheus: Add build fingerprint 2024-04-17 07:05:15 +02:00
¨raystef66¨
8ea33780de cepheus: update MotoDolby: Add activity to AOSP sound settings 2024-04-17 02:23:03 +02:00
basamaryan
78f09d2e4f cepheus: Don't explicitly include updatable_apex.mk
It is inherited by base_system.mk as of QPR2
2024-04-17 02:23:03 +02:00
Michael Bestas
4255c44104 cepheus: Switch to android.hardware.usb@1.3-service.dual_role_usb 2024-04-17 02:22:43 +02:00
Cole Faust
27ed04ebbe cepheus: Add BUILD_BROKEN_INCORRECT_PARTITION_IMAGES
Qcom has issues that prevent it from working with a hermetic
partition build.
2024-04-17 02:22:20 +02:00
Pranav Vashi
a4f53acd6d cepheus: Update dolby mod from v3.7 module 2024-04-17 02:21:57 +02:00
Chaohui Wang
326dce342c cepheus: parts: Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427 | AOSP
Test: manual - check Settings pages
Test: m RunSettingsLibRoboTests
Change-Id: I85a70d4c504d8584030ea4a058f30d74206ab835
2024-03-28 16:17:25 +01:00
Peter Kalauskas
25faeb2c65 cepheus: parts: Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: I0c1bd901429bbe3bf81c1530e156735f8637a96e
2024-03-28 16:17:03 +01:00
Tomasz Wasilczyk
51651efdb9 cepheus: gps: Don't include cutils/threads.h
Bug: 289414897
Test: buildserver
Change-Id: I14b99f42feaae7af00cbd17cfe482eb2e5da71e8
2024-03-28 11:32:34 +01:00
Alessio Balsini
96098ce71d cepheus: Use FUSE passthrough by default 2024-02-24 10:15:28 +01:00
chematelegram
e47f44677c cepheus: Update dependencies 2024-01-26 11:41:24 +01:00
Pranav Vashi
dec89dcb0a cepheus: Set correct manufacturer
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-01-20 03:12:08 +01:00
jhenrique09
fe95e995a2 cepheus: overlay: Forcefully disable Now Playing components
Change-Id: I269d7490b55762b2c982d9cedfe9f5e4269c2ce7
Reviewed-on: https://review.statixos.com/c/android_vendor_statix/+/3947
Reviewed-by: Henrique <call190now@statixos.com>
Tested-by: Henrique <call190now@statixos.com>
2024-01-20 02:40:31 +01:00
chematelegram
1bbd6ce794 cepheus: Enable fastbootd 2024-01-20 02:26:17 +01:00
chematelegram
9d60547b8e cepheus: fstab: Make Metadata encryptable again 2024-01-19 14:21:07 +01:00
=?UTF-8?q?=C2=A8raystef66=C2=A8?=
f89d853b2a cepheus: CarrierConfigOverlay: Update CarrierConfig from munch V14.0.3.0.TLMMIXM 2024-01-18 08:55:29 +01:00
chematelegram
5afdf0155f cepheus: Remove unused config 2024-01-18 08:50:44 +01:00
Pranav Vashi
449e446123 cepheus: Add dolby to cloned apps exemption list
Change-Id: I47ab06f7d5152c4c993359ac85d121e41c8df235
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-01-17 15:24:33 +01:00
Pranav Vashi
673add438d cepheus: Update dolby mod from v3.0 module
Change-Id: Ia544cb1d0d4cc8e671921452257e624103130c7d
2024-01-17 15:18:29 +01:00
Pranav Vashi
b2f432a700 cepheus: Link dolby blobs with v33 libstagefright_foundation
Change-Id: I592c2f459f37d050dff978db88884cec11faeffb
2024-01-17 15:16:58 +01:00
Pranav Vashi
1369fd51a4 cepheus: Update daxService from A14
Change-Id: I48f3eb7e3b902c9856ee44d7ac7a66e61cdcbed5
2024-01-17 15:07:58 +01:00
chematelegram
1ea0ab5166 Revert "[SQUASH] cepheus: Drop Dolby support"
This reverts commit 4ccff76263.
2024-01-17 15:03:45 +01:00
chematelegram
beb2c4882f cepheus: SystemUIRes: Adjust the faceunlock icon height in lockscreen 2024-01-17 13:28:17 +01:00
chematelegram
c8b48bf8eb cepheus: overlay: Convert overlays to RRO 2024-01-02 13:25:51 +01:00
chematelegram
4a5e20b361 cepheus: rootdir: Add formattable flag for EXT4 /data 2023-12-31 12:14:51 +01:00
chematelegram
405f282ea9 Revert "cepheus: audio: Use AOSP USB v2 audio HAL"
This reverts commit 5a3d21797e.
2023-12-30 13:18:27 +01:00
chematelegram
06f0b22496 cepheus: overlay: Disable Bluetooth by default 2023-12-30 00:44:09 +01:00
Alexander Koskovich
d1109e1cbe cepheus: overlay: Remove obsolete fps location config
Change-Id: I2569c77b4daa84263903f710d421d05d0a491d08
2023-12-30 00:35:14 +01:00
chematelegram
6d0b71907f cepheus: overlay: Remove Pocket Mode setting 2023-12-30 00:25:45 +01:00
chematelegram
6f5e766ca6 cepheus: overlay: Removed unused configs 2023-12-30 00:22:32 +01:00
Alex Sarraf
9193ddefa1 cepheus: Set debug.sf.auto_latch_unsignaled to 0
* Need to explicitly set auto_latch_unsignaled property to disabled state
   to keep latch-unsignaled as the default behaviour

Change-Id: I3856caaf0a68e7e720819f25338d1eb9196f56b0
2023-12-30 00:01:08 +01:00
chematelegram
06547168ba Revert "cepheus: Disable debug.sf.latch_unsignaled"
This reverts commit 7eb4f800e7.
2023-12-30 00:01:08 +01:00
Jake Weinstein
6b3e8c163a cepheus: rootdir: Make less cores available for background tasks
With SurfaceFlinger and HWC on the foreground cpuset,
important rendering tasks are moved off of the background
cpusets, so let's reserve one little core for foreground
and top-app.

Change-Id: I4f0982f3ff4dce756095667df0d08f18817b896a
2023-12-29 17:13:45 +01:00
Fabian Leutenegger
27ca1dfd98 cepheus: overlay: Move FaceUnlock indication above UDFPS icon 2023-12-29 16:29:25 +01:00
Edwin Moquete
adab781b4e cepheus: Disable display refresh rate override
* This got enabled by default on U, and it causes apps like
   Chrome and Youtube to set the refresh rate to 30FPS when
   playing some videos.

Change-Id: I649bf03d550c2b9726c7957d15ed09e455d874ec
2023-12-29 03:51:28 +01:00
chematelegram
d76e73c74b Revert "[TMP] cepheus: Disable Quick Tap support"
This reverts commit 778ee287af.
2023-12-26 22:32:57 +01:00
chematelegram
9c67e2cb00 cepheus: overlay: Pin SystemUIGoogle 2023-12-22 14:50:12 +01:00
chematelegram
290b2f69fd Revert "cepheus: Ship Gramophone and ViMusic"
This reverts commit 4cba64077a.
2023-12-22 14:47:41 +01:00
4cba64077a cepheus: Ship Gramophone and ViMusic 2023-12-15 23:48:36 +01:00
778ee287af [TMP] cepheus: Disable Quick Tap support 2023-12-15 23:46:17 +01:00
chematelegram
52677d8b66 cepheus: Update dependencies 2023-12-11 09:01:38 +01:00
chematelegram
ca2767cd8a cepheus: Go with full gapps 2023-12-11 08:46:00 +01:00
chematelegram
c41b69ce94 cepheus: Copy fstab to ramdisk 2023-12-11 08:46:00 +01:00
EcrosoftXiao
fbb0e4de8e fixup! cepheus: Flash dummy super image if needed 2023-12-11 08:46:00 +01:00
Chenyang Zhong
85498e0c83 cepheus: move super_dummy build to Android.mk
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-12-11 08:46:00 +01:00
Tim Zimmermann
37cde22ec9 cepheus: Flash dummy super image if needed
* Needed because stock does not use dynamic partitions so
  there's no existing metadata that could be used

Change-Id: Icbc828389465f3d4681ca8e4c3adec782540752e
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-12-11 08:46:00 +01:00
Martin Liu
36904c52af cepheus: fstab: Set readahead_size_kb=128 2023-12-11 08:46:00 +01:00
Tim Zimmermann
50295c2dfa cepheus: Ensure vbmeta is available during first stage init
* Without this it is no longer accessible in first stage init on T
  breaking DSU
* According to a0b391dd6a
  this must be done if there's no avb=vbmeta anywhere

Change-Id: I5d278f41772086ac90706ae5daa5f0d76bb6e755
2023-12-11 08:46:00 +01:00
EcrosoftXiao
3c389e6090 cepheus: rootdir: fstab: Drop metadata encryption for now
Bootloader reports raw as our metadata partition type in below command

host> fastboot getvar partition-type:metadata
partition-type:metadata: raw
Finished. Total time: 0.005s

Commit [1] causes bootloop issues after doing a factory reset in AOSP
recovery. Fix it by drop metadata encryption for now.

[1]: https://android-review.googlesource.com/c/platform/bootable/recovery/+/1908136

Signed-off-by: EcrosoftXiao <xy19990903@gmail.com>
2023-12-11 08:46:00 +01:00
Jaegeuk Kim
24ff8bdf4d cepheus: fstab: 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>
Change-Id: Icd38754bad1b1529d01165ea8c703c214d20bb4b
2023-12-11 08:46:00 +01:00
David Ng
5830211954 cepheus: rootdir: Mount metadata fs during first stage init per UDC spec
Mount metadata at first stage init.

Change-Id: I51408b0c6b5edb4434d32be803daf3a21beb91e1
2023-12-11 08:46:00 +01:00
Chenyang Zhong
a73fcf5497 cepheus: rootdir: move system & vendor to fstab for dynamic partition
"The device tree and device tree overlays must not contain fstab
entries" [1], so move system & vendor back to fstab and convert
them to early-mounted logical partitions.

[1] https://source.android.com/devices/tech/ota/dynamic_partitions/implement#fstab-changes

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-12-11 08:46:00 +01:00
me-cafebabe
b861a9487c cepheus: Add system_ext product odm partitions 2023-12-11 08:46:00 +01:00
Chenyang Zhong
6ebe42cd8a cepheus: specify androidboot.boot_devices
so that /dev/block/by-name/ symlinks are created.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-12-11 08:46:00 +01:00
Chenyang Zhong
442d4977ca cepheus: switch to retrofit dynamic partitioning
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-12-11 08:46:00 +01:00
chematelegram
b533da37de cepheus: Import some blobs for DRM
* E QSEECOMD: : Init dlopen(libsecureui.so, RLTD_NOW) is failed.... dlopen failed: library "libsecureui.so" not found
 * Imported fromLA.UM.9.1.r1-12900-SMxxx0.0
2023-12-11 08:46:00 +01:00
chematelegram
975bced273 cepheus: Clean the house 2023-12-11 08:46:00 +01:00
chematelegram
9ac14013f0 cepheus: Build some more telephony packages
* this will be added in the proper commit with proper authorship rebasing
2023-12-11 08:46:00 +01:00
chematelegram
f1efdcca80 cepheus: Import libxlog.so
* from V12.5.6.0.RFACNXM

 * E android.hardware.audio.service: _xog_get_handle DLOPEN failed for vendor/lib/vndk/libxlog.so
2023-12-11 08:46:00 +01:00
chematelegram
f2b7a133c5 cepheus: Import sensors.mius.proximity.so
* from V12.5.6.0.RFACNXM

 * W android.hardware.sensors@1.0-service: dlerror(): dlopen failed: library "sensors.mius.proximity.so" not found
2023-12-11 08:46:00 +01:00
Omkar Chandorkar
8580795993 cepheus: overlay: Move UDFPS enroll radius to settings
- required after LineageOS/android_packages_apps_Settings@af35c7c

Change-Id: I79ecd91513df0d195e1d15d20b4438d1b283743f
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
2023-12-11 08:46:00 +01:00
Joker-V2
197f8c5396 cepheus: bluetooth: Build android.hardware.bluetooth.audio-impl
* W audiohalservice: Could not register Bluetooth Audio Offload API
 * E audiohalservice: Failed to dlopen android.hardware.bluetooth.audio-impl.so: dlopen failed: library "android.hardware.bluetooth.audio-impl.so" not found
 * W audiohalservice: createIBluetoothAudioProviderFactory() from android.hardware.bluetooth.audio-impl failed

Change-Id: I44fa882ea93cf0e815a022d714dabe2e558031fb
Signed-off-by: Joker-V2 <nipinna0@gmail.com>
2023-12-11 08:46:00 +01:00
Bruno Martins
040330a700 cepheus: Migrate to restructured sepolicy_vndr
The new folder structure now looks like this:

  device/qcom/sepolicy_vndr
  ├─ legacy-um (meant for sdm845 until sm8350)
  ├─ sm8450
  └─ sm8550

SEPolicy.mk placed in the root automatically redirects devices to the
proper subfolder.
2023-12-11 08:46:00 +01:00
chematelegram
1eb610f053 Revert "cepheus: Add Basic Call Recording support"
This reverts commit 80b33c16fb.

 * It's included in the ROM now
2023-12-11 08:46:00 +01:00
chematelegram
64d026cbad cepheus: Build libwifi-hal-ctrl 2023-10-29 23:47:22 +01:00
chematelegram
bb78111b6b cepheus: Build Telephony packages 2023-10-29 23:47:22 +01:00
adi8900
ee0f49f83e cepheus: Update IMS and RIL from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
adi8900
cff4742676 cepheus: Update Power-off Alarm from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
adi8900
5184b89626 cepheus: Update DPM from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
adi8900
ac8d3ca514 cepheus: Update CNE from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
adi8900
347f4f8c50 cepheus: Build system vendor.qti.hardware.display.config-V5-ndk…
… from source for wfd stack

Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
adi8900
199f54cb8e cepheus: Add missing permissions for WFD app
* else it doesnt boot with this error in log

10-09 09:48:30.794  3365  3365 E AndroidRuntime: java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {com.qualcomm.wfd.service (/system_ext/priv-app/WfdService): android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND}
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.server.pm.permission.PermissionManagerServiceImpl.onSystemReady(PermissionManagerServiceImpl.java:4447)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.server.pm.permission.PermissionManagerService$PermissionManagerServiceInternalImpl.onSystemReady(PermissionManagerService.java:743)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.server.pm.PackageManagerService.systemReady(PackageManagerService.java:4253)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.server.SystemServer.startOtherServices(SystemServer.java:2798)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.server.SystemServer.run(SystemServer.java:942)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.server.SystemServer.main(SystemServer.java:664)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at java.lang.reflect.Method.invoke(Native Method)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
10-09 09:48:30.794  3365  3365 E AndroidRuntime:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:949)
10-09 09:48:30.795  3365  3365 I DropBoxManagerService: add tag=system_server_crash isTagEnabled=true flags=0x2

Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
adi8900
1c44dbe267 cepheus: Update system wfd blobs from pong 14
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-29 23:47:22 +01:00
Pranav Vashi
ebf9a808bc cepheus: Update libstdc++ package name
Change-Id: Ia3255d7823a400bd378e40b02b87c74e40158787
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-10-29 23:47:22 +01:00
Pranav Vashi
dc5e653aa1 cepheus: Update netmgr props
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-10-29 23:47:02 +01:00
chematelegram
8bd5178ce7 cepheus: Switch to TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED 2023-10-23 16:11:09 +02:00
chematelegram
5c4d19d76c cepheus: Use MINI gapps 2023-10-23 16:08:28 +02:00
chematelegram
263aa8668c cepheus: Switch to clang r498229b
* 17.0.4
2023-10-23 16:06:36 +02:00
chematelegram
4ccff76263 [SQUASH] cepheus: Drop Dolby support
This is a combination of 5 commits.

Revert "cepheus: Update dax-default profiles"

This reverts commit 60190c1d81.

Revert "cepheus: Import QCOM audio effects blobs"

This reverts commit 94636824a7.

Revert "cepheus: audio: Update dolby config values from oneplus"

This reverts commit 0435e77bd9.

Revert "cepheus: Update dax-default"

This reverts commit 4d672540e1.

Revert "cepheus: Add Moto Dolby support"

This reverts commit e0e49f846d.
2023-10-22 02:12:46 +02:00
Tim Zimmermann
9ffab25984 cepheus: Build libprotobuf-cpp-full-3.9.1 vendorcompat
* Our old blobs depends on this older version of protobuf, instead new 21-7.

Change-Id: I8d1fbc40bebf66abea342780b02cda68d64899b1
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-22 01:19:41 +02:00
adi8900
b8e97d73e9 cepheus: Patch blobs to use full protobuf
grep -r libprotobuf-cpp-lite-3.9.1.so
grep: proprietary/vendor/lib64/libsnsdiaglog.so: binary file matches
grep: proprietary/vendor/lib64/sensors.ssc.so: binary file matches
grep: proprietary/vendor/lib64/libssc.so: binary file matches
grep: proprietary/vendor/lib64/libwvhidl.so: binary file matches
grep: proprietary/vendor/lib64/mediadrm/libwvdrmengine.so: binary file matches
grep: proprietary/vendor/lib64/libsnsapi.so: binary file matches
grep: proprietary/vendor/bin/sensors.qti: binary file matches

Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-22 00:45:13 +02:00
Sarthak Roy
6625e4a454 cepheus: Switch to Wifi service AIDL
Change-Id: I5a2864b4159b7815eff4dd2f0de02a3dabbacfa5
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-10-21 23:22:53 +02:00
wulan17
e5ddd684c3 cepheus: rootdir: Fix KeyError: '/system' 2023-10-21 17:46:47 +02:00
AmeChanRain
c3d707c781 cepheus: gps: Fix misleading indentation
* That makes clang17 happy
* Fix:
  device/xiaomi/violet/gps/android/utils/battery_listener.cpp:191:13: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
            auto r = mHealth->unlinkToDeath(this);
            ^
device/xiaomi/violet/gps/android/utils/battery_listener.cpp:189:9: note: previous statement is here
        if (mHealth != NULL)
        ^
1 warning and 1 error generated.

Change-Id: I3be1e3de45ce184c9d3dbcede57a312375a91498
Signed-off-by: Nanhumly <admin@warbler.cc>
2023-10-21 14:59:41 +02:00
ralph950412
119a1b43c5 cepheus: gps: Fix unqualified-std-cast-call warning
error: unqualified call to std::move [-Werror,-Wunqualified-std-cast-call]
            mIpcRecver(move(ipcRecver)) {}
                       ^
                       std::
2023-10-21 13:37:35 +02:00
Chih-Hung Hsieh
dfc5124488 cepheus: power-libpermgr: Use tidy_checks_as_errors not -warnings-as-errors 2023-10-21 12:44:23 +02:00
chematelegram
9d55e00ed4 cepheus: Drop BOARD_BUILD_SYSTEM_ROOT_IMAGE 2023-10-21 10:54:54 +02:00
kenway214
80b33c16fb cepheus: Add Basic Call Recording support 2023-10-04 20:57:14 +02:00
5993702032 cepheus: overlay: Enable Lineage Health service 2023-09-13 19:35:47 +00:00
chematelegram
c44ada533e Revert "cepheus: textclassifier: Add and ship prebuilt textclassifier"
This reverts commit 5a8933c2b2.
2023-09-12 13:13:35 +00:00
elpaablo
8dea951d2a cepheus: fastcharge: Extend Fastcharge implementation
* Add implementation for setting max current allowed when not fast charging
2023-09-12 10:19:50 +00:00
chematelegram
b53a30ece2 cepheus: Build lineage health HAL
* Support for Charging Control
2023-09-09 23:30:09 +00:00
marshmello61
5a8933c2b2 cepheus: textclassifier: Add and ship prebuilt textclassifier
- Helps fix the delay we have in copying text and that being available in clipboard

Signed-off-by: Mayur <ultramayur123@gmail.com>
2023-09-03 23:23:24 +00:00
chematelegram
65b63d225f cepheus: overlay: Enable Fast Charge toggle 2023-09-03 23:23:24 +00:00
kamikaonashi
42a4f18f58 cepheus: rootdir: Give permission to restricht_chg
Co-Authored-By: Tofu <ralph950412@gmail.com>
2023-09-03 23:23:24 +00:00
FlowerSea0208
79aae32e5c cepheus: rootdir: Add init.xiaomi.rc 2023-09-03 23:23:24 +00:00
johnmart19
1403a2164b cepheus: sepolicy: Fastcharge: Provide needed permissions 2023-09-03 23:23:24 +00:00
johnmart19
9eac76f987 cepheus: sepolicy: Label FastCharge more general 2023-09-03 23:23:24 +00:00
althafvly
107602ff0e cepheus: Build fastcharge implementation 2023-09-03 23:23:24 +00:00
Davide Garberi
593fa44235 cepheus: fastcharge: Migrate to blueprint
Change-Id: I200fd6c685183c98f0815b207adae5aa75a37238
2023-09-03 23:23:24 +00:00
Bruno Martins
dff3ec0576 cepheus: fastcharge: Use pragma once
Change-Id: I9a9e193a6f66f045f41394d059af8b71778e8d72
2023-09-03 23:23:24 +00:00
Bruno Martins
438ffc794c cepheus: fastcharge: Make user setting persistent
Change-Id: I4ff051d6f9685e94022eab32035bfe86a65264b8
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
2023-09-03 23:23:24 +00:00
Francescodario Cuzzocrea
8b206fbb6c cepheus: 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>
2023-09-03 23:23:24 +00:00
Pranav Vashi
60190c1d81 cepheus: Update dax-default profiles
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-08-20 07:40:17 +00:00
chematelegram
af8c4b7989 cepheus: Add missing flags for MIUI camera 2023-08-17 18:03:36 +00:00
chematelegram
6e865304e7 cepheus: Switch to Pico GApps 2023-08-17 18:03:36 +00:00
adi8900
555e3c1eb6 cepheus: Switch to QTI WFD 2023-08-17 18:03:36 +00:00
chematelegram
3a5f23c7bf cepheus: Switch to AOSP clang
* clang 17.0.2 based on r487747c
2023-08-17 18:03:36 +00:00
chematelegram
cc2f419c78 cepheus: Add dependencies 2023-08-17 18:03:23 +00:00
kondors1995
94636824a7 cepheus: Import QCOM audio effects blobs 2023-08-04 02:11:09 +00:00
Pranav Vashi
0435e77bd9 cepheus: audio: Update dolby config values from oneplus
Fixes: https://github.com/crdroidandroid/issue_tracker/issues/144

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-08-04 02:11:09 +00:00
Pranav Vashi
4d672540e1 cepheus: Update dax-default
* Updated from Moto dubai device. More clarity.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-08-04 02:11:09 +00:00
Pranav Vashi
e0e49f846d cepheus: Add Moto Dolby support 2023-08-04 02:10:54 +00:00
chematelegram
60782fc2be Revert "cepheus: Add Dolby"
This reverts commit d8ac947579.
2023-08-02 10:22:20 +00:00
chematelegram
17a2171339 cepheus: Remove MiSound blob 2023-08-02 10:07:17 +00:00
ade602c508 cepheus: Update maintainer links 2023-07-29 07:18:23 +00:00
chematelegram
17db7007d4 cepheus: Build Aperture camera 2023-07-29 03:56:52 +00:00
chematelegram
6cb462431b Revert "cepheus: overlay: Update camera IDs for aperture"
This reverts commit 5dae5b2c35.
2023-07-20 22:26:27 +00:00
baalgx
586ee76199 cepheus: Import Snapdragon NPE blob from stock
- From cepheus-user-11-RKQ1.200826.002-V12.5.3.0.RFACNXM
- E CamX: [ERROR][UTILS] camxosutilslinux.cpp:874 LibMap() dlopen: dlopen failed: library "libSNPE.so" not found: needed by /vendor/lib64/libcamera_scene.so in namespace (default), on '/vendor/lib64/camera/components/com.mi.node.aiasd.so'

Signed-off-by: baalgx <jose@pixelos.net>
2023-07-19 13:43:00 +00:00
chematelegram
0b1d292cff cepheus: Support the MIUI camera 2023-07-19 13:33:53 +00:00
chematelegram
402d1d2363 cepheus: overlay: Remove unused config
* This config is no longer used in the ROM sources
2023-07-19 13:33:53 +00:00
chematelegram
c345c1d546 cepheus: Support the quick tap gesture 2023-06-21 00:07:13 +00:00
Bruno Martins
95cd5bad3e cepheus: overlay: Use CodeAurora ImsService implementation for RCS 2023-04-23 04:42:08 +00:00
chematelegram
61ffb4fd5f cepheus: overlay: Add config for Smart charge
* after 3604b0437b5481bbb96058592f44cbe37d7063b4
2023-04-23 04:42:08 +00:00
chematelegram
7967131aa9 [SQUASH] cepheus: Switch back to previous UDFPS implementation"
Revert "sensors: udfps: Rename to avoid naming conflict"

This reverts commit c9531164355f10ffd6be4317db84cba0dcd402b2.

Revert "cepheus: fingerprint: Refactor for udfps sensor"

This reverts commit 39db29ed865a278decd9ddea1a44123a95c18b9b.

Revert "cepheus: Switch to udfps sensor impl"

This reverts commit 047fd87f6c7af88d85f6f1f8e493bc430dfcfb7b.

Revert "cepheus: sensors: Implement UDFPS sensors 1.0 sub-HAL"

This reverts commit bcbbc1b941d444ba22eb8a4efd3ea039cfb9f363.
2023-04-23 04:42:08 +00:00
chematelegram
fd6add0574 cepheus: overlay: Increase the radius of the fingerprint enrollment progress bar
* There are people with big hands. If you are one of
   them, do know that you are not alone, I Know how
   it feels having thumbs like f*cking bears. I know
   how it is to enroll your fingerprint while your
   finger is covering the UDFPS reader, the progress
   bar and half of the screen.
   And they made it for people with tiny fingers by
   default but, you know what? Our time has come
   buddies, we have the overlay and nothing's gonna
   stop us. Let's give our thumbs the space that
   they deserve.
2023-04-23 04:42:08 +00:00
EcrosoftXiao
959f103e9f sensors: udfps: Rename to avoid naming conflict 2023-04-23 04:42:08 +00:00
EcrosoftXiao
624de22224 cepheus: fingerprint: Refactor for udfps sensor 2023-04-23 04:42:08 +00:00
EcrosoftXiao
6ac3e53761 cepheus: Switch to udfps sensor impl 2023-04-23 04:42:08 +00:00
Ivan Vecera
f15e8801ca cepheus: sensors: Implement UDFPS sensors 1.0 sub-HAL
* Implement minimalistic UDFPS sensors sub-HAL for Xiaomi devices
  that implement Sensors HAL 1.
* It uses sysfs attribute /sys/devices/virtual/touch/tp_dev exported
  by touchscreen drivers but list of supported paths can be extended.

Change-Id: I5c7653bfbbed20b2f3e00fd8a32cb1277b753b4b
2023-04-23 04:42:08 +00:00
=?UTF-8?q?Jos=C3=A9=20M?=
f2d375b4fd cepheus: overlay: cepheus: Remove 4K video support from front camera
- Not supported
2023-04-23 04:42:08 +00:00
chematelegram
3306a6eef0 Revert "cepheus: Add GCam"
This reverts commit dfa06a5c38.

All lenses are available for video in Aperture now
2023-04-23 04:42:08 +00:00
kdrag0n
14ac894689 cepheus: overlay: Show memory usage in app info
The system tracks memory usage for each app, so we might as well show it
to the user so that users can track down which apps are hogging their
memory. This shouldn't be a developer-only feature that was previously
only exposed in Developer Options.

Signed-off-by: anandhan07 <anandhasayanan007jb@gmail.com>
2023-04-23 04:42:08 +00:00
Arian
ea9a29c410 cepheus: overlay: Remove dsp. prefix from audio and video power profiles
* AOSP power_profile.xml does not include this prefix

Change-Id: I39ee47d4bccfc7eb5454aa64595eaad2a17a1dcf
Signed-off-by: Ahmed Harhash <Lacentix@tutanota.com>
2023-04-23 04:42:08 +00:00
Edwin Moquete
ad690f0a79 cepheus: Remove unused persist.bluetooth.a2dp_offload.cap property
This prop has no effect as of T QPR1.

See: cf25e33147

Change-Id: Ic762812dd59429d344ccc55c01bf96b0ffd6dbab
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-04-23 04:42:08 +00:00
Edwin Moquete
101d3985cc cepheus: Restore vendor bluetooth props
These are read by the BT audio blobs, even without the
QTI BT stack.

Change-Id: Ia2335bedfd7e19899c2cb32c23fcc664f2cfe8ce
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-04-23 04:42:08 +00:00
EcrosoftXiao
ad635494fd cepheus: sepolicy: Drop debugfs related rules 2023-04-23 04:42:08 +00:00
Chenyang Zhong
d8ea756c84 cepheus: drop unnecessary ims system blobs
Everything is fine on AOSP without them.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-04-23 04:42:08 +00:00
Chenyang Zhong
c888ee3712 cepheus: add the missing vendor.qti.imsrtpservice@3.1
Otherwise, carrier video calling is broken.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-04-23 04:42:08 +00:00
Chenyang Zhong
396007652a cepheus: clean up aux camera package list
Drop org.codeaurora.snapcam because BSG gcams actually do not rely
on this prop to enable aux lenses.

Drop the dev variant of Aperture because we are not going to debug
this app.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-04-23 04:42:08 +00:00
Terminator-J
1a9847620d cepheus: overlay: Fix hyper orange night light
With the recent (end of September) changes in android_framework_base to incorporate kdrag0n's modifications
to ColorDisplayManager's color transformation handling, the old
Night Light default config.xml value for maximum color temperature
(which corresponds to the lowest-intensity end of the slider) was
revealed to be rather far from the default hard-coded color temp
value (6500K).

Setting the maximum color temperature available when Night Light
is enabled to equal the default color temperature means that the
effect intensity slider now has an effective intensity range of
0% to 100% (the minimum color temperature value, in degrees Kelvin)
rather than starting from ~4000K max (still very amber compared to
6500K).

Signed-off-by: ImPrashantt <prashant33968@gmail.com>
Signed-off-by: OmarAlCoptan <omarcoptan9@gmail.com>
2023-04-23 04:42:08 +00:00
chematelegram
d2f33edd3a cepheus: overlay: Remove setColorTransform config
* The boolean is 'true' now by default in the ROM sources
2023-04-23 04:42:08 +00:00
chematelegram
14aa809106 cepheus: Build some camera blobs from source
- Inspired from LineageOS sm8150-common [1] and cepheus [2] trees.

 [1]: https://github.com/xiaomi-sm8150-devs/android_device_xiaomi_sm8150-common/
 [2]: https://github.com/xiaomi-sm8150-devs/android_device_xiaomi_cepheus/

Signed-off-by: baalgx <jose@pixelos.net>
2023-04-23 04:41:53 +00:00
Cyber Knight
5e432936c6 cepheus: Fix permissions for poweroffalarm
- This fixes a certain bug regarding poweroffalarm with AOSP clock.

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2023-02-17 08:32:52 +00:00
Georg Veichtlbauer
df8a7f325d cepheus: Fix PowerOffAlarm
* The APK is prepared to not run as system user
* Adjust /persist/alarm/data permissions accordingly

Change-Id: Ie24ccb3749d1dda2deb670cdb531e35d153034ed
2023-02-17 08:32:52 +00:00
Qimeng Pan
4aee9fc21a cepheus: rootdir: add power_off_alarm into init.rc
Add power_off_alarm into init.rc on charge mode

Change-Id: I18158cde8b3ae0890a92bd1ced56782fa053230a
CRs-Fixed: 2373093
2023-02-17 08:32:52 +00:00
Mao Jinlong
1d15f90c77 cepheus: rootdir: Add vendor prefix to power_off_alarm service
power_off_alarm is a vendor service. Add vendor prefix to it.

Change-Id: Ib4a988467a54bbe4544960180afeeeb5dd0e85f3
2023-02-17 08:32:52 +00:00
Mao Jinlong
1e5e6076db cepheus: rootdir: Add power off alarm service
Add power off alarm service for power off alarm feature to
reboot device when power off alarm is up in some special
mode like power off charging mode.

CRs-Fixed: 2095984
Change-Id: Ib8d82e63e92a85a7f60d5559064a1f19e0de5a22
2023-02-17 08:32:52 +00:00
Alexander Martinz
86944c2d6e cepheus: Drop aptx blobs
They live within the bluetooth apex now.

Change-Id: I01ef1d665ce05b7ce5b1ee03129ccf3ce6058634
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2023-02-17 08:32:09 +00:00
José M
e77df5c137 cepheus: overlay: Remove 4K video support from (2.0x) telephoto
- Not supported, camera goes black.

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-17 06:41:59 +00:00
balgxmr
5dae5b2c35 cepheus: overlay: Update camera IDs for aperture
- Since [1], camera IDs changed, hence let's update them.
- Ultra wide (0.7x), and telephoto (2.0x) now shows on video.

[1]: 36db35bca7

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-17 06:41:41 +00:00
Bruno Martins
862e5ba7dd cepheus: overlay: Unlock additional camera framerates
Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-17 06:39:41 +00:00
Sebastiano Barezzi
5a3d21797e cepheus: audio: Use AOSP USB v2 audio HAL
Change-Id: I579e442a8c41ec62acc1e5be7478889bf5bc24b8
2023-02-17 06:37:31 +00:00
fiirefly24
919fcb016e cepheus: parts: Fix thernal compilation for QPR1 merge
Change-Id: I71ad7db85592ca18e3f0f8155bba5a472bfadbaa
2023-02-06 23:41:24 +00:00
Nauval Rizky
8cf3ee6c3e cepheus: parts: Thermal settings's app list improvement
* Migrate from ListView to RecyclerView for better integration with the
  collapsing toolbar and smoother scrolling
* Several UX improvement over the item's layout

Change-Id: I2a2b566020c9869979cc3f6e8c2be7a92c8d325f
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: PainKiller3 <ninadpatil100@gmail.com>
2023-02-06 23:41:24 +00:00
TheScarastic
2f78a8d178 cepheus: parts: Fix thermal profile build for android-12
bfc9e59361

Change-Id: Idb137239c916f94d0bbef2166bb688f381e4ad28
2023-02-06 23:41:24 +00:00
TheScarastic
9262d08e8f cepheus: parts: Adapt Thermal Parts to S style
Change-Id: Id69636b5356b7a56cb1b6ba74271905f6316e651
2023-02-06 23:41:24 +00:00
TheScarastic
81724c3ebc cepheus: parts: Add dynamic thermal profile implementation
Change-Id: I4667b24a8a29a418796dc51b245ede0aca51eea6

sm8250-common: parts: Make thermal profiles naming completely generic

Drop the reference to YouTube because that's product-specific.
Moreover, the purpose of such thermal profile should be video streaming,
so name it in that generic way.

Change-Id: Ifa8c97a2d231a24fda016a876c06b59825a068a6

sm8250-common: Switch back to default thermal profile when screen off

Change-Id: I72aae3c1fbb13f44ff7a637ba9ad70cf451d71a2

sm8250-common: Set dynamic thermal interval to 5 sec

Change-Id: I96a67297645ad9074045e94fce84e664723aa64c

sm8250-common: parts: Switch to TaskStackListener

Change-Id: I18cb22decddb38420e8137aafdc56810e81d4603

sm8250-common: parts: Refactor whole code

Change-Id: I14303556c66ea6bd3d111b5ce7e176711a676824

sm8250-common: parts: Check if kernel support Thermal Profiles

Change-Id: Ief3911b0c1238ed6e209f7b66dde68d67a69ea88

sm8250-common: parts: Add ACTION_SCREEN_ON intent filter

 * this should fix thermal/touchscreen profiles not
   getting restored after turning screen back on

Change-Id: Idb485fc7f1942f1a2d117025fe5c4237afc3ec81

sm8250-common: parts: Use correct gaming thermal

* thermal-pubg.conf is missing which is selected with 13, instead we have thermal-tgame.conf which is 9.
* thanks amack766 for informing

Change-Id: If2e95fc04b26a1fa87e77f854ec0c325243cd097
2023-02-05 01:14:38 +00:00
Pranav Vashi
4d664f27a7 cepheus: overlay: Add temp divider value for cpu info overlay 2023-01-31 06:20:50 +00:00
redcliff-op
dfa06a5c38 cepheus: Add GCam
* BSG MGC_8.1.101_A9_GV2b_MGC
 * This is an excellent option until we get all the lenses
   to be available in Aperture for video
2023-01-31 06:14:52 +00:00
¨raystef66¨
01c3fb3956 cepheus: sepolicy: Remove duplicate genfs entries 2023-01-24 15:05:28 +00:00
chematelegram
48ce6c81c3 cepheus: Use Mini GApps 2023-01-23 00:09:57 +00:00
AdarshGrewal
ab1cb9493c cepheus: Include MiuiCamera if exists 2023-01-23 00:05:10 +00:00
EcrosoftXiao
12a79850ef cepheus: sepolicy: Label vendor.xiaomi.hardware.campostproc service
Change-Id: If9fe7e6131fff272d6311ca2ea30c3c61ecfee36
2023-01-22 23:57:50 +00:00
AndroidHQ254
808129402a cepheus: sepolicy: miuicamera: Address sepolicy denials
E SELinux : avc:  denied  { find } for interface=vendor.xiaomi.hardware.misys::IMiSys sid=u:r:platform_app:s0:c512,c768 pid=7115 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_hwservice:s0 tclass=hwservice_manager permissive=0

E SELinux : avc:  denied  { find } for interface=vendor.xiaomi.hardware.campostproc::IMiPostProcService sid=u:r:platform_app:s0:c512,c768 pid=7115 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:hal_camerapostproc_xiaomi_hwservice:s0 tclass=hwservice_manager permissive=0

E vndksupport: Could not load /vendor/lib64/libmialgoengine.so from sphal namespace: dlopen failed: library "/vendor/lib64/libmialgoengine.so" not found.
2023-01-22 23:57:50 +00:00
Adithya R
540a9447c4 cepheus: sepolicy: Allow camera HAL to get/set vendor_video_prop
12-08 17:08:40.576   994  4737 E libc    : Access denied finding property "vendor.video.disable.ubwc"
12-08 17:08:40.574   994   994 W HwBinder:994_3: type=1400 audit(0.0:181): avc: denied { read } for uid=1047 name="u:object_r:vendor_video_prop:s0" dev="tmpfs" ino=12913 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:vendor_video_prop:s0 tclass=file permissive=0
2023-01-22 23:57:50 +00:00
Nolen Johnson
590610023b cepheus: Remove deprecated TARGET_USES_QTI_CAMERA_DEVICE
* Dead as of https://review.lineageos.org/c/LineageOS/android_vendor_lineage/+/331507.
* We already build vendor.qti.hardware.camera.device@1.0
  so we have what we need.

Change-Id: I8ec420d6264fee70a1602eecdbb4f34f2e5db3dc
2023-01-22 23:57:50 +00:00
Albert I
5dc97f4521 cepheus: sepolicy: Allow apps and camera HAL access to secure ADSP domain
Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: Ibb1071299632ab53726638dbcc134d4bca59fc52

Signed-off-by: Sonal Singh <sonal.singh.19993@gmail.com>
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-22 23:57:50 +00:00
Sebastiano Barezzi
6f044c50d8 cepheus: libqti-perfd-client: Move to C
* Why bothering with C++ mangling when we can just build it as a standard C library?

Change-Id: I45ea977edf7ea7fab6fece76f3049654a8d24c5d
2023-01-22 23:57:50 +00:00
Chenyang Zhong
bba3e42154 cepheus: libqti-perfd-client: Return a dummy value
Return a positive integer for perf lock acquire and release so
that Goodix/FPC fingerprint sensor blobs will not complain.

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

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

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I861672e9a738c2204755d802670f4b28b662f286
2023-01-22 23:57:50 +00:00
Bruno Martins
ba7de287ce cepheus: libqti-perfd-client: Remove namespace declaration
It's pointless when using extern "C".

Change-Id: Ibdf9f06a70aa3a75687b33781c78cf2172bb334d
2023-01-22 23:57:50 +00:00
Lucchetto
2529c7f25c cepheus: Create dummy libqti-perfd-client
* proprietary perfd blobs can finally be nuked without breaking goodix
* we could even map the functions to use libperfmgr powerhints in the future

Signed-off-by: Lucchetto <lucchetto.tie@live.com>
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I124652f3041761966a3e3bd97c757fecc39cc5fb
2023-01-22 23:57:50 +00:00
Weikai Kong
1003d8db31 cepheus: Add back ro.vendor.extension_library definition
* We aren't using QCOM's perfd but our blobs still check for this.
 * To avoid unnecessary errors, let's just add it back.

Change-Id: Icc44b330f21a658cfa8ded691a6628d8f62c3649
2023-01-22 23:57:50 +00:00
Wei Wang
c793d59925 cepheus: Remove QTI perfd
Bug: 69270928
Test: Build and boot device and test camera

Change-Id: I87b283206f462fb5c8ec9cdd303ae2934fe9bfc4
2023-01-22 23:57:50 +00:00
ghostrider-reborn
d25eb2997b cepheus: Disable QTI perf lock usage in camera HAL
* our dummy qti-perfd-client doesnt play well with our
   camera hal and crashes everytime lens is switched

11-26 00:15:37.902 16507 16507 F DEBUG   : pid: 15967, tid: 16032, name: HwBinder:15967_  >>> /vendor/bin/hw/android.hardware.camera.provider@2.4-service <<<
11-26 00:15:37.902 16507 16507 F DEBUG   : uid: 1047
11-26 00:15:37.902 16507 16507 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
11-26 00:15:37.902 16507 16507 F DEBUG   : Cause: null pointer dereference
...
11-26 00:15:37.902 16507 16507 F DEBUG   : backtrace:
11-26 00:15:37.902 16507 16507 F DEBUG   :       #00 pc 0000145e  /vendor/lib/libqti-perfd-client.so (perf_lock_acq+6) (BuildId: b9021283b270fb111fd8dfa2403d21fe)

Signed-off-by: Azure-Helper <azurehelper219@gmail.com>
2023-01-22 23:57:50 +00:00
baalgx
75c4f78b08 cepheus: Remove dead build target
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-22 23:57:50 +00:00
LuK1337
1b380fa6be cepheus: RIP com.dsi.ant.antradio_library
No longer shipped by default with Android 12.

Change-Id: Iae740ef18505b7f2bb01fe54d45810e72fd521e9
2023-01-22 23:57:50 +00:00
Michael Bestas
84de562ef3 cepheus: Remove android.hardware.graphics.composer@2.4-impl
It no longer exists, the service is fully binderized

Change-Id: I06ee402b50216948e0e72a2797c2edfda1c4886a
2023-01-22 23:57:20 +00:00
chematelegram
8a2ca3de09 fixup! cepheus: Disable zram writeback 2023-01-19 08:36:42 +00:00
chematelegram
d7b81d8c40 cepheus: livedisplay: Remove Antiflicker
* since the ROM features DC Dimming now

This is a combination of 2 commits.

This is the 1st commit message:

Revert "cepheus: livedisplay: Fix the node for AntiFlicker"

This reverts commit 0fef7044f1.

This is the commit message #2:

Revert "cepheus: livedisplay: Implement IAntiFlicker interface"

This reverts commit 126df9f150.
2023-01-18 17:48:14 +00:00
chematelegram
69b9c96140 cepheus: overlay: Support automated DC dimming 2023-01-18 09:30:31 +00:00
chematelegram
bfd2a96c09 cepheus: overlay: Switch to charging_enabled for Smart Charging 2023-01-17 19:57:28 +00:00
chematelegram
e92e3eb27c Revert "[DNM] cepheus: overlay: Add dummy udfps sensor"
This reverts commit 579497da8a.
2023-01-17 01:51:22 +00:00
chematelegram
a563f54114 cepheus: overlay: Limit the screen recorder's framerate 2023-01-17 01:46:46 +00:00
chematelegram
ba5ee12493 cepheus: overlay: Fix misspelling in udfpsVendorCode 2023-01-17 01:36:13 +00:00
Sonal Singh
d8ac947579 cepheus: Add Dolby 2023-01-12 10:27:47 +00:00
chematelegram
2bbdc9299d cepheus: parts: Drop Dirac sound enhancer 2023-01-12 10:23:39 +00:00
Chenyang Zhong
ebeed85503 cepheus: update DPM, IMS, and RIL system blobs
from LA.QSSI.13.0.r1-05300-qssi.0

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
EcrosoftXiao
8f050bd917 cepheus: Update keymaster blobs from Xiaomi/nabu/nabu:12/RKQ1.200826.002/V13.1.22.9.5.DEV 2023-01-07 23:58:13 +00:00
chematelegram
69b4d4d0ff cepheus: overlay: Update Build Status info 2023-01-07 23:58:13 +00:00
chematelegram
a783107d3c cepheus: sepolicy: Adress denial for livedisplay sunlight enhancement 2023-01-07 23:58:13 +00:00
baalgx
7b8c9a0833 cepheus: Stop including the firmware 2023-01-07 23:58:13 +00:00
Chenyang Zhong
126e4f0d16 cepheus: sepolicy: allow vendor_init to change watermark_scale_factor
avc: denied { write } for comm="init" name="watermark_scale_factor" dev="proc" ino=56793 scontext=u:r:vendor_init:s0 tcontext=u:object_r:proc_watermark_scale_factor:s0 tclass=file permissive=1

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Jiyong Park
2736fe6325 cepheus: Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m
Change-Id: I14a1c57bd06f1f2aa52491f779c7030d4de03547
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
chematelegram
9626908367 cepheus: Make it official 2023-01-07 23:58:13 +00:00
chematelegram
48dfc8e4bf cepheus: overlay: Support screen off UDFPS 2023-01-07 23:58:13 +00:00
EcrosoftXiao
579497da8a [DNM] cepheus: overlay: Add dummy udfps sensor
Currently, udfps controller checks udfpsLongPressSensorType [1] to
determine state of screen off udfps. This causes issues on legacy
fod devices. Since we don't have any real udfps press sensor, But
we still uses vendor-code-style screen off udfps, so bypass these
checks by setting a dummy udfps sensor.

[1] https://github.com/PixelExperience/frameworks_base/blob/thirteen/core/java/android/hardware/display/AmbientDisplayConfiguration.java#L143
2023-01-07 23:58:13 +00:00
chematelegram
0fef7044f1 cepheus: livedisplay: Fix the node for AntiFlicker 2023-01-07 23:58:13 +00:00
chematelegram
694f9e6da2 cepheus: sepolicy: Cleanup sepolicy 2023-01-07 23:58:13 +00:00
chematelegram
63bf3084fa Revert "cepheus: Improve boot time and pull in bootanim display time"
This reverts commit 0939cab02d.
2023-01-07 23:58:13 +00:00
9ac2dbf6e7 cepheus: overlay: Enable Build status info 2023-01-07 23:58:13 +00:00
d44b0f5acf cepheus: overlay: Add maintainer info 2023-01-07 23:58:13 +00:00
Chenyang Zhong
f02ee97f52 cepheus: overlay: Enable aux camera for Aperture
Also block unwanted camera ids.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Bruno Martins
8c2f0d480b cepheus: Update aux camera package whitelist
LinageOS Snap camera is dead for good.

Change-Id: Ib190174585ee4f7a931b813547861051f754a477
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Bruno Martins
b34154375f cepheus: Expose aux cams to Aperture
Change-Id: I25cd180d9145b8b3da2385257c6e91e51c2032a2
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
chematelegram
1a7f1228e3 cepheus: overlay: Support Smart Pixels 2023-01-07 23:58:13 +00:00
chematelegram
c3afd12664 cepheus: Switch to sepolicy_vndr-legacy-um 2023-01-07 23:58:13 +00:00
chematelegram
038ad8881b cepheus: Get cepheus back to the Evolution 2023-01-07 23:58:13 +00:00
Bruno Martins
fad95382c1 cepheus: parts: Fix compilation after QPR1 merge
Change-Id: I71ad7db85592ca18e3f0f8155bba5a472bfadbaa
2023-01-07 23:58:13 +00:00
chematelegram
569bad1d98 Revert "cepheus: overlay: Drop config_setColorTransformAccelerated"
* Because no, it's not enabled by default in Spark

This reverts commit 763dc8ef437f504712a6fb88a16d2efd16c7199d.
2023-01-07 23:58:13 +00:00
chematelegram
87bdf12735 cepheus: powerhint: Tune frequencies for expensive rendering 2023-01-07 23:58:13 +00:00
UtsavBalar1231
c30597b0f1 cepheus: overlay: Update multiple vibration intensity levels config for T
Since commit: eaaf5331d6
multiple intensities configuration flag has been changed to an interger
reflect that change in here to allow multiple intensity vibration pattern in settings.

Change-Id: I13f9dbf6280623ad1c954ce96ceecbe363140062
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: anandhan07 <anandhasayanan007jb@gmail.com>
2023-01-07 23:58:13 +00:00
OnlyTomInSecond
2e0a262f74 cepheus: Set block_binder_thread_on_incoming_calls prop
In order to fix incoming calls.

Change-Id: Id474622f3e08b88f1d099e3d6507fd1d84de4d88
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Michael Bestas
0a436bc832 cepheus: Move qti_whitelist.xml to /system_ext
Change-Id: Id8617513cfd686b3f6888a89c1b1db196acfb476
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Michael Bestas
c1f159949a cepheus: Remove bdroid_buildcfg.h
As of I3c7aed1bdb45db728d319f7d757400e44d232283 the Bluetooth stack
defaults to reasonable defaults that should work for all devices.

Change-Id: I056d63c4c8a2727e384172e964dc0000b6773504
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Bruno Martins
82c3c37eea cepheus: Revise and update audio feature flags and props
So to match what is shipped with stock because prebuilt a-HAL
and extensions are being used.

Change-Id: I74d5bd1de5ea87984ace38076cb5a0bd54736ca6
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Bruno Martins
fb36fe0182 cepheus: Drop custom APM flag along with no-op audio flags
Custom audio policy manager is hard disabled by CAF
for 2 years now. Remove as well the audio feature flags
that were used to configure it.

Change-Id: Idd34d1cbbdb735d6cf0de3b159c2670bf7ddd1e3
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Mohammed Mirza Mandayappurath Manzoor
fe7bf2081c cepheus: ueventd: Set permissions for KGSL sysfs node
Some KGSL sysfs nodes need to be access controlled. Set proper
permissions for the same.

Change-Id: Idc7e2447d02742074873901c6539f2c6d9d25862
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Alexander Koskovich
7be9894cfc cepheus: Move Bluetooth power overlays to sysprops
* These were moved to sysprops in Android 13 [1] and while
   frameworks reads the values directly from power_profile.xml
   Bluetooth app reads from the properties.

 [1] 976d33062b%5E%21/#F0

Change-Id: I5bff67a15c537e8a47a19f30776fca6bf2c9fbe5
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Bruno Martins
9beeaea123 cepheus: Migrate to AIDL ClearKey DRM HAL
Change-Id: Iad5cc1176978137c647069197b33f49fb4d98ab2
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
LuK1337
fb8cf1356b cepheus: Pull appropriate USB props from vendor_product.mk
Change-Id: I93b25c5d0989c83d1c8d7b7946a083771febdddd
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Alexander Koskovich
d632a87814 cepheus: Move BT profiles props to vendor
* Makes it GSI compatible

Change-Id: I8f7caf241d508af59c16482e6185c42f23f8a460
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Woody Lin
d77c07339d cepheus: Enable zygote critical window
Bug: 141948707
Change-Id: I5dc57312118b0f6d95fc9fe164363ec7e15f1b51
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Alexander Koskovich
e6c8131434 cepheus: Set USB product string to 'Xiaomi Mi 9'
Change-Id: Idda062aaa38e16d7ba65356dbca8b467fbff14c1
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Sal Savage
c3510c1e21 cepheus: Replace BTM_DEF_LOCAL_NAME with a sysprop
Change-Id: I2c90efac01e61500eb1be23bb0ae6f96c2acdc53
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Glen Kuhne
2ee07a0d3c cepheus: Set default hotspot ssid
Added a device specific overlay that changes the default name
from "AndroidAp" to customized name

Test: Builds, manually verified name change
Bug: 36368950
Change-Id: I38a5f6fb950d6a45342080bae186a8ed276d94bf
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
LuK1337
88a58c710e cepheus: Set a default Settings.Global.DEVICE_NAME
Change-Id: I310c1ffc581b72653783d1093d9e7ebde544bb16
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
chematelegram
815f241e19 cepheus: thermal: Cleanup modules already defined in sources 2023-01-07 23:58:13 +00:00
Ali B
390d53e2e4 cepheus: move to ueventd to $(TARGET_OUT_VENDOR_ETC)
* https://android-review.googlesource.com/c/platform/system/core/+/1526382.

Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
Change-Id: I95e7aa2428c5c396bdd01e55b8fb7f8fb9bb5699
2023-01-07 23:58:13 +00:00
Ralf Luther
8a2052c96f cepheus: sepolicy: Silence denials by suspend wakeups
Grant wakeup38 and wakeup39 accress to the sysfs directory

Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
2023-01-07 23:58:13 +00:00
Pig
9b4cd2cc62 cepheus: sepolicy: Suppress system suspend denials spam
Change-Id: I4175b738819049cd351220ed6bd9be32101585f6
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-07 23:58:13 +00:00
EcrosoftXiao
4ebbf71120 Revert "cepheus: parts: Implement dc dimming"
This reverts commit d79388d581.
2023-01-07 23:58:13 +00:00
chematelegram
49afe076ab cepheus: sepolicy: Remove duplicated wakeup labels 2023-01-07 23:58:13 +00:00
penglezos
e86d24c653 overlay: overlay: Update power profile to match framework change
* Commit LineageOS/android_frameworks_base@3d422c3 renamed:
   cpu.idle -> cpu.suspend
   cpu.awake -> cpu.idle

Change-Id: Id6b289bf01b117d98a6c334fd36619505e0653ec
2023-01-07 23:58:13 +00:00
Andrzej Perczak
efc085180e cepheus: Disable 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.

Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Change-Id: I4d3d19b80bedd7410e638c78909a8a910bc10be8
2023-01-07 23:58:13 +00:00
Ziqi Chen
13ca10c5a4 cepheus: init.qcom.rc: Tuning UFS clkgate and ah8 during boot time
Disabling UFS clkgate and ah8 during boot time helps in reducing
IO delays, which helps in reducing the total boot time. This change
will disable UFS clkgate and ah8 during early-init and then enable
it back after boot completion.

Change-Id: I6a10cd57a30fe3bdc4fba72a0d84cdfa3b1fd513
Signed-off-by: Ahmed Harhash <email@lacentix.me>
2023-01-07 23:58:13 +00:00
SebaUbuntu
d1335acb25 cepheus: overlay: Drop MMS user agent overlays
* Current profile URL points to a 404 page

Change-Id: I92f3ded52dda04f6cec5709d51c84b32f39d8095
2023-01-07 23:58:13 +00:00
Georg Veichtlbauer
aac1932593 cepheus: overlay: Drop config_setColorTransformAccelerated
* It's now enabled by default
2023-01-07 23:58:13 +00:00
baalgx
7619d65a6f cepheus: sepolicy: Delete duplicated wakeup label
* ERROR 'duplicate entry for genfs entry (sysfs, /devices/platform/soc/a600000.ssusb/wakeup)'
2023-01-07 23:58:13 +00:00
kondors1995
926580df4e cepheus: sepolicy: Sync wakeup sources with sm8150-development
HEAD: xiaomi-sm8150-devs/android_device_xiaomi_sm8150-common@b25b10a
2023-01-07 23:58:13 +00:00
SamarV-121
4c3b73f759 cepheus: overlay: Remove config_gpsParameters
* 404

Change-Id: I8290597fa4938c3e93f81b5d013769f4ef6eaabe
2023-01-07 23:58:13 +00:00
LuK1337
126df9f150 cepheus: livedisplay: Implement IAntiFlicker interface
Change-Id: I1dbc6d8989a80fe7b06d4356aeb717417997a793
2023-01-07 23:58:13 +00:00
LuK1337
dada1de252 cepheus: livedisplay: Uprev to 2.1
Change-Id: I98b2ea16ed342339ee652d5cb79dcfd22f8c0a0d
2023-01-07 23:58:13 +00:00
Felix
0b663341a6 cepheus: Add interface info to .rc files
Signed-off-by: Felix <google@ix5.org>
Change-Id: I6d70bbdb66c3dce280bf6908c3750316a6f6cf70
2023-01-07 23:58:13 +00:00
LuK1337
24f6512bb4 cepheus: livedisplay: Drop unnecessary nullptr checks
* new operator would never return a nullptr.

Change-Id: I3a34770d70b2da53ba3099fb7647991e5bde33b8
2023-01-07 23:58:13 +00:00
dianlujitao
4c61eb6d97 cepheus: livedisplay: Use modules from common implementation
Change-Id: Iafb9f6a56187beb574ca2eb9a97fb9c7e72893ce
2023-01-07 23:58:13 +00:00
EcrosoftXiao
3ebf2f217d cepheus: Bring back LiveDisplay HAL
This reverts commit 5ebfa970a1d8ff131e0a3c0713d4a0cae3dcb224.
2023-01-07 23:58:13 +00:00
Lucas Dupin
798a1ac5be cepheus: Disable blurs during app launch 2023-01-07 23:58:13 +00:00
chematelegram
599611037c Revert "cepheus: Enable Smooth Display"
This reverts commit 5c8294178fd5f0d058dac91892474a7207545a02.
2023-01-07 23:58:13 +00:00
Alice Kuo
a7f90d805e cepheus: Disable LE audio related profiles
Bug: 231671426
Test: build
Change-Id: I85b7f023c03a7a2e603af94e88196c10a16fe4ec
Merged-In: I85b7f023c03a7a2e603af94e88196c10a16fe4ec
(cherry picked from commit 9b57be4d7f57e1d117c65fac1e2dc60dbc59cb4b)
2023-01-07 23:58:13 +00:00
Sal Savage
648577bdeb cepheus: Use the ?= operator so BT properties can be overridden
System properties set with the "=" operator cannot be overriden. This
device is used elsewhere in the system and some of the properties need
to be overridden. The "?=" operator will use the assigned value if no
other values are assigned elsewhere, allowing for overrides.

Bug: 230638462
Test: adb shell getprop | grep bluetooth
Change-Id: I12dfdf4830e041b2c4e50eb8136ac0fb7146cc8e
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Sal Savage
4ed30b0aed cepheus: Set default the Bluetooth class of device
The class of device is a string with a list of uint8t values:
90,2,12

The meaning is as follows:
{Service Field, Major class, Minor class}

Service Field: 0x5A -> 90
    Bit 17: Networking
    Bit 19: Capturing
    Bit 20: Object Transfer
    Bit 22: Telephony
MAJOR_CLASS: 0x02 -> 2 (Phone)
MINOR_CLASS: 0x0C -> 12 (Smart Phone)

Bug: 217452259
Test: make -j; -- check that bluetooth.device.class_of_device is
correct

Change-Id: I07e83ca352ff969be0e53a0f63b6c940b6c34dfb
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Sal Savage
5e7e8396ac cepheus: Update LE Audio profile properties to match spec and implementation
Bug: 217448211
Test: atest BluetoothInstrumentationTests
Change-Id: I1260e95d357bd86099f75b910e0d744f97513fbc
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Sal Savage
2faaec4587 cepheus: Enable bluetooth profiles with product.prop
Bug: 217448211
Test: make -j
Change-Id: I0d06b46910e42346653bea3484636f4129592ce3
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Kujou Yuko
1ca689482d cepheus: Enable Audio Support for Hearing Aids central support 2023-01-07 23:58:13 +00:00
Etienne Ruffieux
ea009d759c cepheus: Added new vendors for Bluetooth config migration
Tag: #feature
Test: manual
Bug: 211570675
Change-Id: Id74ec5e1b30f21c534c35b212a2fb297e9d591fb
2023-01-07 23:58:13 +00:00
Jiakai Zhang
38ec87acf1 cepheus: Add a system property for System UI compiler filter.
Bug: 227310505
Test: m
Change-Id: Ieaa417a5024fd367543ff9879e5d57f0eb41aa94
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 23:58:13 +00:00
Jun Wang
949a48f1f9 cepheus: props: Enable the pre-rendering feature
* Pre-rendering feature can improve FPS and reduce the janks in scrolling cases
2023-01-07 23:58:13 +00:00
johnmart19
84d62c5b1a cepheus: Set renderengine to SkiaGL Threaded 2023-01-07 23:58:13 +00:00
chematelegram
1346069694 cepheus: Build kernel with trb clang 2023-01-07 23:58:13 +00:00
Logan-Developer
ce03014533 Revert "Switch to QTI Bluetooth stack"
This reverts commit 0380db4a67c5f4eda48f6ad89029b4979866e241.
2023-01-07 23:58:13 +00:00
tribual
92d4603964 cepheus: Support Battery Health 2023-01-07 23:58:13 +00:00
chematelegram
85d4b86aeb cepheus: Specify path for kernel toolchain 2023-01-07 23:58:13 +00:00
tribual
f7056727d4 cepheus: nuke IFAA 2023-01-07 23:58:13 +00:00
adi8900
b63e0a1970 cepheus: Update Adreno stack from LA.UM.9.14.r1-20200-LAHAINA.QSSI13.0.
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-01-07 23:58:13 +00:00
Pranav
44ebee8d5f cepheus: Update adreno stack from from LA.UM.9.14.r1-19300.01-LAHAINA.QSSI12.0
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-01-07 23:58:13 +00:00
John Galt
9637365d00 cepheus: Update adreno blobs from LA.UM.9.14.r1-19300-LAHAINA.QSSI12.0 2023-01-07 23:58:13 +00:00
EcrosoftXiao
2b396f6430 cepheus: Support Smart Charching 2023-01-07 23:58:13 +00:00
Nauval Rizky
c8d7e64df0 cepheus: Update mi thermald patching method
* hotplug data will be parsed but not applied to the node.

Change-Id: I7f4d71e446c7230364b920d0d0af766e4329af8c
2023-01-07 23:58:13 +00:00
Nauval Rizky
372d6f70ae cepheus: Disable CPU hotplug data parsing on mi_thermald
Throttling the frequencies down is more than enough and will not cause
any issues like what hotplugging does.

Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: David Setiawan <fryevia@foxmail.com>
2023-01-07 23:58:13 +00:00
SamarV-121
33ff01c44e cepheus: Remove obsolete debug.sf.disable_backpressure property
* It has been removed in Android S
 * 2ec5391acf

Change-Id: I23a210a37ad257f0c8b7a3c5e1d59b2ac20cde9a
Signed-off-by: SamarV-121 <samarvispute121@pm.me>
2023-01-07 23:58:13 +00:00
TH779
605f15ad2f cepheus: Switch to prebuilt IFAAService
Change-Id: Ib1640e5cae6dcbb09e53af6037ddf966ed988d23
2023-01-07 23:58:13 +00:00
althafvly
05e95555fc cepheus: sepolicy: Remove debugfs related rules
- Removed from sepolicy_vndr

Change-Id: Ifd65abd0292577ec050904265310f17b86e10899
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 23:58:13 +00:00
tarsin
d96cda7b4c cepheus: Make shim for com.qti.node.watermark.so
Signed-off-by: Kujou Yuko <i@779.moe>
Change-Id: I47fea33432692a7a76d71db91676cb3a58ac19c7
2023-01-07 23:58:13 +00:00
tribual
5566e8e00e cepheus: Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m
Change-Id: I14a1c57bd06f1f2aa52491f779c7030d4de03547
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-01-07 14:00:11 +00:00
tribual
300f47b9e6 cepheus: Switch BtAudio to AIDL
Test: m
Bug: 203490261

Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
Change-Id: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
Merged-In: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
2023-01-07 14:00:11 +00:00
rds-007
192b567357 cepheus: Drop iorap_large_memory_config.mk 2023-01-07 14:00:10 +00:00
Pirama Arumuga Nainar
40de13af71 cepheus: gps: Fix Wbitwise-instead-of-logical introduced by clang-r445002
Bug: http://b/215753485

This warning is introduced in clang-r445002.  In code where the bitwise
operation was used to avoid short-ciruit evaluation, make that explicit
by introducing temporary variables.

Test: build with clang-r445002.
Change-Id: Ia7ccf1d48922d926313f691888d26c3e314c1056
2023-01-07 14:00:10 +00:00
88eb4e6a6f cepheus: Remove gsi_keys
* Removed in b30a23cca2.
2023-01-07 14:00:10 +00:00
2b5a02fda0 cepheus: Drop a2dp 2023-01-07 14:00:10 +00:00
tribual
d407527cd4 cepheus: switch to prelude clang 2023-01-07 14:00:10 +00:00
Thierry Strudel
5b3a3cbf41 cepheus: rootdir: Adjust charger state CPUs
Bug: 74771887
Change-Id: Ifd5d2ac499866ce897cfa99a655da592248e7bbd
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Wei Wang
6cd86183e9 cepheus: rootdir: Powersaving in charger mode
Bug: 72445880
Test: boot to charger
Change-Id: I154304deabf219a0428d68d0c59cb64c143b7de6
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Pranav Vashi
c8d3c8ee6b cepheus: Disable zram writeback
* Disabled on many devices with reports to lagginess in long term and random reboot in some instances.

Revert "raphael: rootdir: fstab.zram: Set max_comp_streams to 4"

This reverts commit 748a8ebe822b1daa23c9b7345be52e36242eb839.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I73985159766da08cd35b0288db29cfafc7db62b0
2023-01-07 14:00:10 +00:00
Jabiyeff
f508be78b0 cepheus: prop: Force disable iorapd
* Its eating more RAM and slow down device
* Thanks for CAFEBABE find this

Signed-off-by: Jabiyeff <cebiyevanar@gmail.com>
Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
2023-01-07 14:00:10 +00:00
d480beccc3 cepheus: wifi: Update config from sm8150-common tree
* https://github.com/crdroidandroid/android_device_xiaomi_sm8150-common/commits/12.1/wifi/WCNSS_qcom_cfg.ini
2023-01-07 14:00:10 +00:00
Andrzej Perczak
ab8d739a18 cepheus: rootdir: Don't tune sde partition on boot
It doesn't make sense to boost firmware partition during boot as not
much is being read from it. Google isn't doing it either.
2023-01-07 14:00:10 +00:00
Luca Stefani
fb9ec3b7c6 cepheus: overlay: Enable IWLAN assisted mode
Change-Id: I9bf9a4a2bc36867dd87ae43652bb5ebb84cc9bc3
2023-01-07 14:00:10 +00:00
kondors1995
1fe465f3a3 cepheus: Enable Smooth Display
72hz seams to pretty okei oc for now but lets limit max SF threshold tp 81hz
Since its seams to be oeki but more risky some users migth want to use it
2023-01-07 14:00:10 +00:00
Ujjwal Kirorimal
6dedbdd5bf cepheus: overlay: Disable Adaptive Connectivity preference
* We neither ship CTPM and nor have 5G
2023-01-07 14:00:10 +00:00
iusmac
815dff8049 cepheus: rootdir: fstab.zram: Set max_comp_streams to 4
* more results in battery drain and lags

[someone5678] adapt to fstab

Original commit:
[1] eca73828b9

Signed-off-by: iusmac <iusico.maxim@libero.it>
Signed-off-by: someone5678 <nemui3353@gmail.com>
Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
2023-01-07 14:00:10 +00:00
Dyneteve
4ab0f06464 cepheus: Don't build renderscript and move renderengine to threaded skia
* Also remove it from VINTF
2023-01-07 14:00:10 +00:00
Santiago Seifert
85cc613f01 cepheus: overlay: Unpin updatable-media from memory
Bug: 214499288
Change-Id: If523b95d295feba8f0de0ae85a1b3c2985dbbfbc
Test: Presubmit
2023-01-07 14:00:10 +00:00
Danny Lin
0a4f15df35 cepheus: overlay: Don't pin launcher app in memory
Similar to what we did for the camera app, unpin the launcher app from
memory as well. While the default launcher (Launcher3) isn't
particularly big, it doesn't make much sense to pin because the launcher
does not typically load new resources much. Most of its resources should
already be loaded in memory after it starts, so pinning the APK is
redundant.

Change-Id: I6b82f2facb1bf4aee393af3f0bc3e0bce2538222
2023-01-07 14:00:10 +00:00
Jaegeuk Kim
187f518e93 cepheus: rootdir: Set readahead to system, vendor and data
This can avoid memory pressure.

Bug: 181567573
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I654c4d3bf24fa741c3fb0255431a26d8dcf5f153
2023-01-07 14:00:10 +00:00
orges
ebdaa4a88e cepheus: overlay: fix deprecated power profile items
* PowerProfile: screen.on is deprecated! Use screen.on.display0 instead.
 * PowerProfile: screen.full is deprecated! Use screen.full.display0 instead.
2023-01-07 14:00:10 +00:00
KenHV
3d864c0de6 cepheus: Fix screen recorder lag
Former-commit-id: ed529f3c23b28a5e73c0e34ed659787767707bc3
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-07 14:00:10 +00:00
Yo Chiang
129b9fafd7 cepheus: Enable mainline artifact path enforcement
Bug: 138706293
Test: TH / Forrest build pass
Change-Id: Ife32e2308f54817e7fd0393a9e9c6e8b02ed8f92
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Jeongik Cha
11e4174e66 cepheus: Turn on PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE
After turning it on, every app and library cannot use hidden API anymore.

Bug: 143581698
Test: lunch coral && m
Test: flash and check if it can boot
Change-Id: I41c29b23beea75e0656fa449e4a0d91d0b23d110
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Justin Yun
a3218ea2d8 cepheus: Enforce native interfaces of product partition as VNDK
By setting PRODUCT_PRODUCT_VNDK_VERSION := current, native modules in
product partition are not allowed to use any libs in system partition
excepted VNDK.
Enforcing it for coral devices.

Bug: 145580164
Test: Build and check boot
Change-Id: Icb818c3c6e74a1211881671d87d205d949209b92
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Etan Cohen
94c8ede04c cepheus: Declare WiFi Aware support to WiFi HAL
* The Wi-Fi Aware feature added in Android 8.0 enables
   supporting devices to discover, connect, and range
   (added in Android 9) to one another directly using
   the Wi-Fi Aware protocol without internet or cellular
   network access.

 * This feature, built upon the Wi-Fi Alliance (WFA) Wi-Fi
   Aware specification (versions 2.0 and 3.0), allows easy
   sharing of high-throughput data among trusted devices
   and apps that are otherwise off-network.

   https://source.android.com/devices/tech/connect/wifi-aware

Change-Id: I18ff20e7466b8e8fd598381b730fb7db391e9ad4
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
chenpaul
38161a3ae3 cepheus: wifi: Extend gInterfaceChangeWait to 2 seconds for avoid crash when "adb reboot"
Bug: 131123423
Test: "adb reboot" test more than 4000 times and not hit crash as b/131123423
      Wifi work normally after the same test.
Change-Id: Ibbe1fce889e78f4685a02043c43793deb9e43e8f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Roger Wang
3a51f7d936 cepheus: wifi: set inactivity time
Wait for 1 second to let wifi driver do
complete clean reset of SW/HW.

Bug: 121391366
Test: perform watchdog recovery and success
Test: check value by iwpriv wlan0 getConfig
Change-Id: I84674970d4b3c16876c4ebaf71043062d1867c87
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-07 14:00:10 +00:00
Adithya R
2319e63458 cepheus: releasetools: Print a better message while flashing
Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-06 01:29:41 +00:00
ZVNexus
7d40407a93 cepheus: rootdir: Don't mount TraceFS twice.
* AOSP already mounts TraceFS in system init, so mounting it twice
   causes SEPolicy denials. See the comments in this change.

   https://android-review.googlesource.com/c/platform/system/sepolicy/+/1294195

Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-06 01:29:41 +00:00
naveenjohnsonv
09665e0ce0 cepheus: Support FPS info 2023-01-06 01:29:41 +00:00
Chris Fries
7fbfec88f4 cepheus: Set VENDOR_SECURITY_PATCH to platform
Set the VENDOR_SECURITY_PATCH level to match the platform
security patch level.  These are functionally the same.

Bug: 125914443
Change-Id: Ib77ab115d6faabd21958c34e2dae49ec96421fdd
Signed-off-by: Genkzsz11 <Genkzsz11@gmail.com>

Former-commit-id: 4a81d41415f1f6e7c87fca4d7eb7263b1d9bb711
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-06 01:29:41 +00:00
Bruno Martins
2775fe65b2 cepheus: Set UDFPS properties for IFAAService
Change-Id: Id013fe7d6d3d529a5d41f5d0eecd8178712fd651
2023-01-06 01:29:41 +00:00
SebaUbuntu
66866d5131 cepheus: Move to source built IFAAService 2023-01-06 01:29:41 +00:00
Lisa Liu
77cf259404 cepheus: Enable LZ4 compression for ramdisks
* This shortens the time to unpack initramfs.

Change-Id: Id23daba43ae7a6003cbde29480d2f433f344df73
2023-01-06 01:29:41 +00:00
tribual
c9b1d3661b cepheus: Switch to Proton clang 2023-01-06 01:29:41 +00:00
tribual
6685d59506 cepheus: Support Battery Health 2023-01-06 01:29:41 +00:00
Pranav
2b2be9d55d cepheus: Update graphics blobs from from LA.UM.9.14.r1-18900-LAHAINA.QSSI12.0 2023-01-06 01:29:41 +00:00
tribual
b5317697fe cepheus: Fit to stock launcher 2022-10-09 16:46:35 +00:00
EcrosoftXiao
1ba14ac444 cepheus: sepolicy: Cleanup deprecated rules 2022-10-09 16:46:35 +00:00
tribual
fc55a98d03 cepheus: overlay: Support mulptiple vibration intensities 2022-10-09 16:46:26 +00:00
Sungmin Choi
36f3b6e9de cepheus: overlay: Remove Manage Mobile Plan
Set config_show_mobile_plan false to remove "Manage mobile plan"

Bug: 14418915
Change-Id: I1ef4eb755937cffe7f556b96a5ee1a6ec7b7131c
2022-10-09 16:44:15 +00:00
dianlujitao
5045404382 cepheus: overlay: Fix status bar height for certain apps on 12L
* 12L introduced new API to fetch status bar height based on cutout, to
  handle multi-display devices. However, some apps directly read the
  height from overlay so the layout is broken for them.
* Since our device is not a multi-display one, set the expected height
  in overlay directly as the old way to make these apps look good.

Change-Id: I38fae2cdd20b947998766b35920d28bebcf547cf
2022-10-09 16:41:07 +00:00
TH779
b720f928da cepheus: overlay: Drop deprecated SystemUI overlays
Signed-off-by: TH779 <i@779.moe>
Change-Id: Ic66ffa74e6745db4c252a1fbef67d094ff7c9c90
2022-10-05 23:59:00 +00:00
Chenyang Zhong
5f51b1f7dc cepheus: sepolicy: allow apps to get aux camera prop
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-10-05 23:59:00 +00:00
tribual
e7c5a15ad2 cepheus: overlay: Update UDFPS overlays 2022-10-05 23:59:00 +00:00
tribual
7f31b9a5e3 cepheus: set correct size of system partition 2022-10-05 23:59:00 +00:00
tribual
01e40248d6 cepheus: overlay: Adjust UDFPS animation offset 2022-10-05 23:59:00 +00:00
Sven
1ad552e1ba cepheus: overlay: clean the house 2022-10-05 23:59:00 +00:00
tribual
fed73a7f79 cepheus: enable Quick tap 2022-10-05 23:59:00 +00:00
Akash Srivastava
54247d1f89 cepheus: sepolicy: Drop unused rules 2022-10-05 23:59:00 +00:00
tribual
057c199550 cepheus: fingerprint: Nuke onShow\HideUdfpsOverlay 2022-10-05 23:59:00 +00:00
Henrique Silva
046a8da3b9 cepheus: overlay: Don't warn user about FC in Google TTS
* This happens on almost all FDE devices, I don't see any workaround other than hiding these dialogs
2022-10-05 23:59:00 +00:00
Sven
12a97484d6 cepheus: go back home to evasion kernel 2022-10-05 23:59:00 +00:00
tribual
2c8570f2b6 cepheus: Nuke some hardcoded flags 2022-10-05 23:59:00 +00:00
tribual
54d395cabb cepheus: libperfmgr: Add back some frequencies 2022-10-05 23:59:00 +00:00
tribual
6c3022183a cepheus: Update dependencies 2022-10-05 23:59:00 +00:00
Giammarco Senatore
2e7bf12599 cepheus: overlay: Enable statusbar burn-in protection 2022-10-05 23:59:00 +00:00
UtsavBalar1231
f3497b4375 cepheus: wifi: Ignore tracking if any NUD failure occurs
Change-Id: I3031143fa634a0505045ccb00809fe4dd40f16c1
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
Venkata Sharath Chandra Manchala
4b1863f7ed cepheus: wifi: Enable nl broadcast logging and disable packet logging
In Display ON DTIM power experiment it was found
that we have power saving with gMulticastHostFwMsgs=0
and gEnablePacketLog=0.

CRs-Fixed: 2506878
Change-Id: Ia4ea66c85c6ea3fd84f8f651de9db2c26fc134ed
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
Akash Srivastava
21a10b317b cepheus: wifi: Update wifi config
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
Ecco Park
b6ebde1280 cepheus: wifi: add parameters for Hotspot 2.0
Those parameters need to set for Hotspot 2.0 network

hs20=1: Enable Hotspot 2.0
auto_interworking=0 : Do not automatically go through Interworking
                      network selection in wpa_supplicant

Bug: 118633353
Test: live test with Passpoint AP
Change-Id: I56f25f13b86f45cdb165f20d753703322df97813
Signed-off-by: Ecco Park <eccopark@google.com>
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
Panchajanya1999
53366cbfbe cepheus: wifi: Disable WLAN Firmware loggings
firmware loggings are not at all necessary for general development.

Change-Id: I111943a641670ea052f68148103e377771297d77
Signed-off-by: Sherif Rahim <sherifrahim2001@gmail.com>
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
kerneltoast
77161c34c8 cepheus: wifi: Relax WiFi re-association RSSI thresholds
Change-Id: I073f08eed69b2454e1fd2350c8f7e8bb8983641b
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
Alex Naidis
afbdec9bfc cepheus: wifi: smarter decisions on whether to use a 2- or 5Ghz AP
Implement a smarter system on whether to connect
to the provided 2Ghz or 5Ghz network.

Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
TheCrazyLex
c52ea4d89b cepheus: wifi: Enable QPower and Deep sleep at the same time
* This enables Deep Sleep mode, additionally to QPower
* With this configuration, QPower manages the new Deep sleep mode
 -> Leads to amazing power savings

Change-Id: Ic4c23583cb008a5cfb14af15236f5aeba32f0f80
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
Luk1337
baba637d8e cepheus: wifi: Disable RX wakelock feature
Change-Id: If79e1512a83f5162444683e1fa8f5560f98b6c9a
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-10-05 23:59:00 +00:00
EcrosoftXiao
6bbc4dd95e Revert "cepheus: drop updatable_apex.mk for now"
This reverts commit 0f20ed57e6.
2022-10-05 23:59:00 +00:00
Chenyang Zhong
85b1bee1c4 cepheus: Use Vulkan for UI rendering
Looks like the hwui renderthread with OpenGL is a little broken on
android 12. It triggers the following Scudo error when scrolling
quickly in certain apps:

F DEBUG   : Abort message: 'Scudo ERROR: corrupted chunk header at address 0x200006fc78920a0
F DEBUG   : '
F DEBUG   :     x0  0000000000000000  x1  00000000000025fd  x2  0000000000000006  x3  0000006df7c0b8b0
F DEBUG   :     x4  0080808080808080  x5  0080808080808080  x6  0080808080808080  x7  8080808080808080
F DEBUG   :     x8  00000000000000f0  x9  494ac435077451cb  x10 0000000000000000  x11 ffffff80fffffbdf
F DEBUG   :     x12 0000000000000001  x13 00000000dc94e9a5  x14 001176d2f9e6b000  x15 0000000000000010
F DEBUG   :     x16 000000713c299050  x17 000000713c2769b0  x18 0000006df5e2e000  x19 000000000000258b
F DEBUG   :     x20 00000000000025fd  x21 00000000ffffffff  x22 0000000000000000  x23 0000006eb78da910
F DEBUG   :     x24 000000713de01d88  x25 0000006ee7882a00  x26 0000000000000040  x27 0000000000000040
F DEBUG   :     x28 0000006df7b13000  x29 0000006df7c0b930
F DEBUG   :     lr  000000713c2297a4  sp  0000006df7c0b890  pc  000000713c2297d0  pst 0000000000000000
F DEBUG   : backtrace:
F DEBUG   :       #00 pc 000000000004f7d0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 75c8be16f616c1bbff9f4199f75a87af)
F DEBUG   :       #01 pc 0000000000040224  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::die()+8) (BuildId: 75c8be16f616c1bbff9f4199f75a87af)
F DEBUG   :       #02 pc 000000000004097c  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::ScopedErrorReport::~ScopedErrorReport()+32) (BuildId: 75c8be16f616c1bbff9f4199f75a87af)
F DEBUG   :       #03 pc 0000000000040a44  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::reportHeaderCorruption(void*)+60) (BuildId: 75c8be16f616c1bbff9f4199f75a87af)
F DEBUG   :       #04 pc 00000000000421a4  /apex/com.android.runtime/lib64/bionic/libc.so (scudo::Allocator<scudo::AndroidConfig, &(scudo_malloc_postinit)>::deallocate(void*, scudo::Chunk::Origin, unsigned long, unsigned long)+296) (BuildId: 75c8be16f616c1bbff9f4199f75a87af)
F DEBUG   :       #05 pc 000000000041535c  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::~CanvasContext()+1020) (BuildId: 196cd621979b48671bd0aab714b2c1bd)
F DEBUG   :       #06 pc 0000000000414f4c  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::~CanvasContext()+16) (BuildId: 196cd621979b48671bd0aab714b2c1bd)
F DEBUG   :       #07 pc 000000000020c690  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer9WorkQueue7runSyncIZNS3_12renderthread11RenderProxy14destroyContextEvE3$_1EEDTclfp_EEOT_EUlvE_NS_9allocatorISC_EEFvvEEclEv$34d70ca82a4a2946342a621a4c655d1c+88) (BuildId: 196cd621979b48671bd0aab714b2c1bd)
F DEBUG   :       #08 pc 00000000003c8ef4  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+156) (BuildId: 196cd621979b48671bd0aab714b2c1bd)
F DEBUG   :       #09 pc 00000000003c8c60  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+84) (BuildId: 196cd621979b48671bd0aab714b2c1bd)
F DEBUG   :       #10 pc 0000000000011f9c  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) (BuildId: d9d3222cb4e074a3a09934b924844959)

Meanwhile, Skia Vulkan is totally fine, so let's give Vulkan another
try.

Test: scrolling quickly through Twitter feed when images and videos
      are still loading
Test: scrolling quickly through a Spotify playlist with lots of
      album pictures

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-10-05 23:59:00 +00:00
Chenyang Zhong
c43dffcff1 cepheus: build kernel with Prelude Clang
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-10-05 23:59:00 +00:00
tribual
9d79df53d3 cepheus: add spark.dependencies 2022-10-05 23:59:00 +00:00
Minchan Kim
06ae14b16c cepheus: Enable Zram Writeback 2022-10-05 23:59:00 +00:00
EcrosoftXiao
2481767652 cepheus: rootdir: Tune ZRAM size 2022-10-05 23:59:00 +00:00
Volodymyr Zhdanov
a506c49a7e cepheus: rootdir: Don't configure zram in init.qcom.post_boot.sh 2022-10-05 23:59:00 +00:00
EcrosoftXiao
3e5be82e42 Revert "cepheus: parts: Enable doze_status on screen off"
This reverts commit 8d187f1424.
2022-10-05 23:59:00 +00:00
EcrosoftXiao
1897034d33 cepheus: Update graphic blobs from Xiaomi/nabu/nabu:11/RKQ1.200826.002/V13.0.3.0.RKXCNXM:user/release-keys 2022-10-05 23:59:00 +00:00
tribual
f69024db3d cepheus: overlay: Add Spark maintainer 2022-10-05 23:59:00 +00:00
tribual
b979062660 cepheus: Add and build Udfps Animation resources 2022-10-05 23:59:00 +00:00
tribual
ac1835a0ba cepheus: parts: Update Xiaomi parts 2022-10-05 23:59:00 +00:00
Dobsgw
55cbf0612a rootdir: Fix PowerHAL nodes
Fix for:
W/libperfmgr(  670): Failed to write to node: /dev/stune/top-app/schedtune.boost with value: 10, fd: -1
W libperfmgr: Failed to write to node: /dev/cpu_dma_latency with value: 61, fd: -1

Change-Id: Ieb385110f236ab12549aea198639708068fb6156
2022-10-05 23:59:00 +00:00
tribual
3ebcd10f37 cepheus: Spark bring up 2022-10-05 23:57:55 +00:00
tribual
35a123d246 cepheus: kill some more logspam
W/libperfmgr(  670): Failed to write to node: /dev/stune/top-app/schedtune.boost with value: 10, fd: -1
2022-10-05 22:56:02 +00:00
Dobsgw
fdd21ae797 cepheus: rootdir: Fix power hals nodes permission
* Fix for:
     W/libperfmgr(  670): Failed to write to node: /dev/stune/top-app/schedtune.boost with value: 10, fd: -1
     W libperfmgr: Failed to write to node: /dev/cpu_dma_latency with value: 61, fd: -1

Signed-off-by: Zinadin Zidan <zidan.roking@gmail.com>
Change-Id: I7117b2a0ce2f21de3a07dac366a0993eafcce47d
2022-10-05 22:56:02 +00:00
Sven
471bab5861 cepheus: Add spark props 2022-10-05 22:55:33 +00:00
Stephen Thomas-Dorin
0d6f8104ed cepheus: overlay: Update config_ims_rcs_package to use new ImsService
Change-Id: I77fcd2a3451c99df5fa47136fa0cd36a5abab9fe
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-10-05 22:54:28 +00:00
Chenyang Zhong
376d12ccac cepheus: update DPM, IMS, and RIL system blobs
* from Xiaomi/haydn/haydn:12/RKQ1.210810.001/V12.5.1.0.SKKMIXM:user/release-keys

Note that ims factory jars are added for the new ImsRcsService.apk.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-10-05 22:54:28 +00:00
EcrosoftXiao
de061f5aee cepheus: sepolicy: Label vendor_fp_prop as vendor_public_prop
* Mlipay needs to read it for fingerprint payment
2022-10-05 22:54:28 +00:00
Chenyang Zhong
e6d50ff751 cepheus: sepolicy: specify the owner of vendor props
vendor_fp_prop is public because apps like Alipay may access it
to enable biometrics payment authentication.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2021-12-25 13:19:38 +08:00
Chenyang Zhong
15f737380f cepheus: turn off compressed apex
Google introduced compressed apex on android 12 [1], and the flag is
enabled by default in updatable_apex.mk [2]. Cepheus cannot boot
compressed apex with encryption, so disable it.

ref:
[1] https://source.android.com/devices/tech/ota/apex#compressed-apex
[2] 4a1240de8a

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2021-12-23 14:14:09 +08:00
EcrosoftXiao
4721acef11 Revert "cepheus: drop updatable_apex.mk for now"
This reverts commit 0f20ed57e6.
2021-12-23 14:10:16 +08:00
544 changed files with 26618 additions and 24979 deletions

View File

@@ -1,7 +1,6 @@
soong_namespace {
imports: [
"hardware/google/interfaces",
"hardware/google/pixel",
"hardware/xiaomi",
],
}

58
Android.mk Normal file
View File

@@ -0,0 +1,58 @@
#
# Copyright (C) 2020 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.
#
LOCAL_PATH := $(call my-dir)
ifeq ($(TARGET_DEVICE),cepheus)
include $(call all-makefiles-under,$(LOCAL_PATH))
LPFLASH := $(HOST_OUT_EXECUTABLES)/lpflash$(HOST_EXECUTABLE_SUFFIX)
INSTALLED_SUPERIMAGE_DUMMY_TARGET := $(PRODUCT_OUT)/super_dummy.img
$(INSTALLED_SUPERIMAGE_DUMMY_TARGET): $(PRODUCT_OUT)/super_empty.img $(LPFLASH)
$(call pretty,"Target dummy super image: $@")
$(hide) touch $@
$(hide) echo $(CURDIR)
$(hide) $(LPFLASH) $@ $(PRODUCT_OUT)/super_empty.img
.PHONY: super_dummyimage
super_dummyimage: $(INSTALLED_SUPERIMAGE_DUMMY_TARGET)
INSTALLED_RADIOIMAGE_TARGET += $(INSTALLED_SUPERIMAGE_DUMMY_TARGET)
include $(CLEAR_VARS)
# A/B builds require us to create the mount points at compile time.
# Just creating it for all cases since it does not hurt.
FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt
$(FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
@echo "Creating $(FIRMWARE_MOUNT_POINT)"
@mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt
BT_FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/bt_firmware
$(BT_FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
@echo "Creating $(BT_FIRMWARE_MOUNT_POINT)"
@mkdir -p $(TARGET_OUT_VENDOR)/bt_firmware
DSP_MOUNT_POINT := $(TARGET_OUT_VENDOR)/dsp
$(DSP_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
@echo "Creating $(DSP_MOUNT_POINT)"
@mkdir -p $(TARGET_OUT_VENDOR)/dsp
ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT) $(BT_FIRMWARE_MOUNT_POINT) $(DSP_MOUNT_POINT)
endif

View File

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

View File

@@ -24,10 +24,14 @@ BUILD_BROKEN_PREBUILT_ELF_FILES := true
BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true
BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES := true
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
BUILD_BROKEN_ENFORCE_SYSPROP_OWNER := true
# Inherit from proprietary files
include vendor/xiaomi/cepheus/BoardConfigVendor.mk
# ANT+
BOARD_ANT_WIRELESS_DEVICE := "vfs-prerelease"
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-2a
@@ -47,23 +51,30 @@ TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a76
TARGET_OTA_ASSERT_DEVICE := cepheus
# Audio
AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
TARGET_PROVIDES_AUDIO_EXTNS := true
BOARD_USES_ALSA_AUDIO := true
# Bluetooth
BOARD_HAVE_BLUETOOTH_QCOM := true
# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := cepheus
TARGET_NO_BOOTLOADER := true
# Camera
$(call soong_config_set,libcameraservice,ext_lib,//$(DEVICE_PATH):libcameraservice_extension.cepheus)
# Compression
PRODUCT_FS_COMPRESSION := 1
USE_DEVICE_SPECIFIC_CAMERA := true
# Display
TARGET_GRALLOC_HANDLE_HAS_RESERVED_SIZE := true
TARGET_HAS_HDR_DISPLAY := true
TARGET_HAS_WIDE_COLOR_DISPLAY := true
TARGET_USES_COLOR_METADATA := true
TARGET_USES_DISPLAY_RENDER_INTENTS := true
TARGET_USES_DRM_PP := true
TARGET_USES_GRALLOC4 := true
TARGET_USES_HWC2 := true
USE_OPENGL_RENDERER := true
# Graphics
BOARD_USES_ADRENO := true
@@ -75,7 +86,7 @@ TARGET_ENABLE_MEDIADRM_64 := true
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/configs/config.fs
# FOD
$(call soong_config_set,surfaceflinger,udfps_lib,//$(DEVICE_PATH):libudfps_extension.cepheus)
TARGET_SURFACEFLINGER_UDFPS_LIB := //$(DEVICE_PATH):libudfps_extension.cepheus
TARGET_USES_FOD_ZPOS := true
# GPS
@@ -84,13 +95,15 @@ LOC_HIDL_VERSION := 4.0
# HIDL
DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/hidl/manifest.xml
DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/configs/hidl/c2_manifest.xml
DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
$(DEVICE_PATH)/configs/hidl/framework_compatibility_matrix.xml \
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
vendor/lineage/config/device_framework_matrix.xml
# Init
$(call soong_config_set,libinit,vendor_init_lib,//$(DEVICE_PATH):libinit_cepheus)
TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):libinit_cepheus
TARGET_RECOVERY_DEVICE_MODULES := libinit_cepheus
# Kernel
@@ -98,19 +111,24 @@ BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_IMAGE_NAME := Image-dtb
BOARD_KERNEL_PAGESIZE := 4096
BOARD_KERNEL_SEPARATED_DTBO := true
BOARD_RAMDISK_USE_LZ4 := true
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
BOARD_RAMDISK_OFFSET := 0x01000000
TARGET_KERNEL_CLANG_COMPILE := true
TARGET_KERNEL_CONFIG := cepheus_defconfig
TARGET_KERNEL_SOURCE := kernel/xiaomi/cepheus
TARGET_KERNEL_CONFIG := \
vendor/sm8150-perf_defconfig \
vendor/xiaomi/sm8150-common.config \
vendor/xiaomi/cepheus.config
TARGET_KERNEL_CLANG_VERSION := r530567
KERNEL_TOOLCHAIN := $(shell pwd)/prebuilts/clang/host/linux-x86/clang-r498229b/bin
KERNEL_SUPPORTS_LLVM_TOOLS := true
TARGET_KERNEL_ADDITIONAL_FLAGS := AS=llvm-as AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip LD=ld.lld
TARGET_KERNEL_ADDITIONAL_FLAGS += \
HOSTCFLAGS="-fuse-ld=lld -Wno-unused-command-line-argument"
BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xa90000
BOARD_KERNEL_CMDLINE += androidboot.hardware=qcom androidboot.console=ttyMSM0
BOARD_KERNEL_CMDLINE += androidboot.usbcontroller=a600000.dwc3
# BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
#BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
BOARD_KERNEL_CMDLINE += service_locator.enable=1
BOARD_KERNEL_CMDLINE += loop.max_part=7
BOARD_KERNEL_CMDLINE += androidboot.init_fatal_reboot_target=recovery
@@ -118,8 +136,8 @@ BOARD_KERNEL_CMDLINE += kpti=off
BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc
# Lineage Health
$(call soong_config_set_bool,lineage_health,charging_control_supports_bypass,false)
$(call soong_config_set,lineage_health,charging_control_charging_path,/sys/class/power_supply/battery/charging_enabled)
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH := /sys/class/power_supply/battery/charging_enabled
# Media
TARGET_USES_ION := true
@@ -133,50 +151,63 @@ BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864
BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712
BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64)
# BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3758096384
# BOARD_VENDORIMAGE_PARTITION_SIZE := 1610612736
BOARD_SUPER_PARTITION_GROUPS := cepheus_dynamic_partitions
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor system_ext odm product
BOARD_SUPER_PARTITION_SIZE := 6442450944
BOARD_SUPER_PARTITION_SIZE := 5368709120
BOARD_SUPER_PARTITION_METADATA_DEVICE := system
BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor cust
BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor
BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 3758096384
BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 1610612736
BOARD_SUPER_PARTITION_CUST_DEVICE_SIZE := 1073741824
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_SIZE := 6438256640 # BOARD_SUPER_PARTITION_SIZE - 4MB
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_SIZE := 5364514816 # BOARD_SUPER_PARTITION_SIZE - 4MB
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := f2fs
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
$(foreach p, $(call to-upper, $(BOARD_CEPHEUS_DYNAMIC_PARTITIONS_PARTITION_LIST)), \
$(eval BOARD_$(p)IMAGE_FILE_SYSTEM_TYPE := ext4))
# Reserve space for gapps install
ifneq ($(WITH_GMS),true)
BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := -1
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 424673280
BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 703718400
BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := -1
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 545259520
endif
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_USES_METADATA_PARTITION := true
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
# Disable sparse on all filesystem images
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
TARGET_COPY_OUT_ODM := odm
TARGET_COPY_OUT_PRODUCT := product
TARGET_COPY_OUT_SYSTEM_EXT := system_ext
TARGET_COPY_OUT_VENDOR := vendor
# Disable sparse for ext/f2fs images
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
TARGET_USERIMAGES_SPARSE_F2FS_DISABLED := true
# Platform
TARGET_BOARD_PLATFORM := msmnile
# Power
TARGET_POWER_LIBPERFMGR_MODE_EXTENSION_LIB := //$(DEVICE_PATH):libperfmgr-ext-xiaomi
# Properties
TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
# QCOM
BOARD_USES_QCOM_HARDWARE := true
# Recovery
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom
TARGET_RECOVERY_PIXEL_FORMAT := BGRA_8888
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)
@@ -189,13 +220,14 @@ VENDOR_SECURITY_PATCH := $(PLATFORM_SECURITY_PATCH)
# Sepolicy
TARGET_SEPOLICY_DIR := msmnile
include device/lineage/sepolicy/libperfmgr/sepolicy.mk
include device/qcom/sepolicy_vndr/SEPolicy.mk
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public
BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
#SELINUX_IGNORE_NEVERALLOWS := true
# USB
TARGET_QTI_USB_SUPPORTS_AUDIO_ACCESSORY := true
@@ -218,6 +250,7 @@ WIFI_DRIVER_DEFAULT := qca_cld3
WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"
WIFI_DRIVER_STATE_OFF := "OFF"
WIFI_DRIVER_STATE_ON := "ON"
WIFI_HIDL_FEATURE_AWARE := true
WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
WPA_SUPPLICANT_VERSION := VER_0_8_X

View File

@@ -2,10 +2,6 @@ Copyright &copy; 2020 DerpFest
Copyright &copy; 2020-2021 PixelExperience
Copyright &copy; 2025 PixelOS
Copyright &copy; 2025 Evolution X
Device configuration for Xiaomi Mi 9
=========================================
@@ -30,4 +26,4 @@ Camera | 48MP(Primary),12MP(Telephoto), 16MP(Ultrawide), dual-LED (dual tone) f
## Device picture
![Xiaomi Mi 9](https://fdn2.gsmarena.com/vv/pics/xiaomi/xiaomi-mi-9-2.jpg "Xiaomi Mi 9")
![Xiaomi Mi 9](https://xiaomi-mi.com/uploads/CatalogueImage/mi9%20(3)_17409_1550674081.jpg "Xiaomi Mi 9 in black")

View File

@@ -0,0 +1,15 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_RRO_THEME := DisplayCutoutSmoothCutout
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_PACKAGE_NAME := SmoothCutoutOverlay
LOCAL_SDK_VERSION := current
include $(BUILD_RRO_PACKAGE)

View File

@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2022 The Android Open Source Project
~ Copyright (C) 2020 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.
@@ -27,5 +27,8 @@
android:priority="0"
android:targetPackage="android"/>
<application android:label="@string/display_cutout_emulation_overlay" android:hasCode="false"/>
<application
android:extractNativeLibs="false"
android:hasCode="false"
android:label="@string/display_cutout_emulation_overlay"/>
</manifest>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2022 The Android Open Source Project
~ Copyright (C) 2020 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.

View File

@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2022 The Android Open Source Project
~ Copyright (C) 2020 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.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2022 The Android Open Source Project
~ Copyright (C) 2020 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.

View File

@@ -19,11 +19,3 @@ cc_library_shared {
proprietary: true,
srcs: ["megvii_shim.cpp"],
}
cc_library_static {
name: "libcameraservice_extension.cepheus",
srcs: ["CameraProviderExtension.cpp"],
include_dirs: [
"frameworks/av/services/camera/libcameraservice/common"
],
}

View File

@@ -1,78 +0,0 @@
/*
* 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-05/c440000.qcom,spmi:qcom,pm8150l@5:qcom,leds@d300/leds/led:switch_2/brightness"
static std::string kTorchLedPaths[] = {
"/sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-05/c440000.qcom,spmi:qcom,pm8150l@5:qcom,leds@d300/leds/led:torch_0",
"/sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-05/c440000.qcom,spmi:qcom,pm8150l@5:qcom,leds@d300/leds/led:torch_1",
};
/**
* 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() {
return 80;
}
int32_t getTorchMaxStrengthLevelExt() {
// 200 (out of 500) is a sane max brightness
return 200;
}
int32_t getTorchStrengthLevelExt() {
// We write same value in the both LEDs,
// so get from one.
auto node = kTorchLedPaths[0] + "/" + TORCH_BRIGHTNESS;
return get(node, 0);
}
void setTorchStrengthLevelExt(int32_t torchStrength, bool enabled) {
set(TOGGLE_SWITCH, 0);
for (auto& path : kTorchLedPaths) {
auto node = path + "/" + TORCH_BRIGHTNESS;
set(node, torchStrength);
}
if (enabled)
set(TOGGLE_SWITCH, 255);
}
void setTorchModeExt(bool enabled) {
int32_t strength = getTorchDefaultStrengthLevelExt();
setTorchStrengthLevelExt(enabled ? strength : 0, enabled);
}

View File

@@ -1,141 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--- Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. -->
<!--- -->
<!--- Redistribution and use in source and binary forms, with or without -->
<!--- modification, are permitted provided that the following conditions are -->
<!--- met: -->
<!--- * Redistributions of source code must retain the above copyright -->
<!--- notice, this list of conditions and the following disclaimer. -->
<!--- * Redistributions in binary form must reproduce the above -->
<!--- copyright notice, this list of conditions and the following -->
<!--- disclaimer in the documentation and/or other materials provided -->
<!--- with the distribution. -->
<!--- * Neither the name of The Linux Foundation nor the names of its -->
<!--- contributors may be used to endorse or promote products derived -->
<!--- from this software without specific prior written permission. -->
<!--- -->
<!--- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -->
<!--- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -->
<!--- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -->
<!--- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -->
<!--- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
<!--- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
<!--- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -->
<!--- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -->
<!--- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -->
<!--- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
<!--- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
<libraries>
<library name="bundle" path="libbundlewrapper.so"/>
<library name="reverb" path="libreverbwrapper.so"/>
<library name="qcbassboost" path="libqcbassboost.so"/>
<library name="qcvirt" path="libqcvirt.so"/>
<library name="qcreverb" path="libqcreverb.so"/>
<library name="visualizer_sw" path="libvisualizer.so"/>
<library name="visualizer_hw" path="libqcomvisualizer.so"/>
<library name="downmix" path="libdownmix.so"/>
<library name="loudness_enhancer" path="libldnhncr.so"/>
<library name="dynamics_processing" path="libdynproc.so"/>
<library name="proxy" path="libeffectproxy.so"/>
<library name="offload_bundle" path="libqcompostprocbundle.so"/>
<library name="audio_pre_processing" path="libqcomvoiceprocessing.so"/>
<library name="volume_listener" path="libvolumelistener.so"/>
<library name="audiosphere" path="libasphere.so"/>
<library name="shoebox" path="libshoebox.so"/>
<library name="dirac" path="libdirac.so"/>
<library name="misoundfx" path="libmisoundfx.so"/>
<!--DOLBY DAP-->
<library name="dap" path="libswdap.so"/>
<!--DOLBY END-->
<!--DOLBY GAME-->
<library name="gamedap" path="libswgamedap.so"/>
<!--DOLBY END-->
<!--DOLBY VQE-->
<library name="vqe" path="libswvqe.so"/>
<!--DOLBY END-->
</libraries>
<effects>
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
<libsw library="qcbassboost" uuid="23aca180-44bd-11e2-bcfd-0800200c9a66"/>
<libhw library="offload_bundle" uuid="2c4a8c24-1581-487f-94f6-0002a5d5c51b"/>
</effectProxy>
<effectProxy name="virtualizer" library="proxy" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b">
<libsw library="qcvirt" uuid="e6c98a16-22a3-11e2-b87b-f23c91aec05e"/>
<libhw library="offload_bundle" uuid="509a4498-561a-4bea-b3b1-0002a5d5c51b"/>
</effectProxy>
<effectProxy name="equalizer" library="proxy" uuid="c8e70ecd-48ca-456e-8a4f-0002a5d5c51b">
<libsw library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
<libhw library="offload_bundle" uuid="a0dac280-401c-11e3-9379-0002a5d5c51b"/>
</effectProxy>
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
<effectProxy name="reverb_env_aux" library="proxy" uuid="48404ac9-d202-4ccc-bf84-0002a5d5c51b">
<libsw library="qcreverb" uuid="a8c1e5f3-293d-43cd-95ec-d5e26c02e217"/>
<libhw library="offload_bundle" uuid="79a18026-18fd-4185-8233-0002a5d5c51b"/>
</effectProxy>
<effectProxy name="reverb_env_ins" library="proxy" uuid="b707403a-a1c1-4291-9573-0002a5d5c51b">
<libsw library="qcreverb" uuid="791fff8b-8129-4655-83a4-59bc61034c3a"/>
<libhw library="offload_bundle" uuid="eb64ea04-973b-43d2-8f5e-0002a5d5c51b"/>
</effectProxy>
<effectProxy name="reverb_pre_aux" library="proxy" uuid="1b78f587-6d1c-422e-8b84-0002a5d5c51b">
<libsw library="qcreverb" uuid="53ef1db5-c0c0-445b-b060-e34d20ebb70a"/>
<libhw library="offload_bundle" uuid="6987be09-b142-4b41-9056-0002a5d5c51b"/>
</effectProxy>
<effectProxy name="reverb_pre_ins" library="proxy" uuid="f3e178d2-ebcb-408e-8357-0002a5d5c51b">
<libsw library="qcreverb" uuid="b08a0e38-22a5-11e2-b87b-f23c91aec05e"/>
<libhw library="offload_bundle" uuid="aa2bebf6-47cf-4613-9bca-0002a5d5c51b"/>
</effectProxy>
<effectProxy name="visualizer" library="proxy" uuid="1d0a1a53-7d5d-48f2-8e71-27fbd10d842c">
<libsw library="visualizer_sw" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
<libhw library="visualizer_hw" uuid="7a8044a0-1a71-11e3-a184-0002a5d5c51b"/>
</effectProxy>
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
<effect name="hw_acc" library="offload_bundle" uuid="7d1580bd-297f-4683-9239-e475b6d1d69f"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
<effect name="aec" library="audio_pre_processing" uuid="0f8d0d2a-59e5-45fe-b6e4-248c8a799109"/>
<effect name="ns" library="audio_pre_processing" uuid="1d97bb0b-9e2f-4403-9ae3-58c2554306f8"/>
<effect name="music_helper" library="volume_listener" uuid="08b8b058-0590-11e5-ac71-0025b32654a0"/>
<effect name="ring_helper" library="volume_listener" uuid="0956df94-0590-11e5-bdbe-0025b32654a0"/>
<effect name="alarm_helper" library="volume_listener" uuid="09f303e2-0590-11e5-8fdb-0025b32654a0"/>
<effect name="voice_helper" library="volume_listener" uuid="0ace5c08-0590-11e5-ae9e-0025b32654a0"/>
<effect name="notification_helper" library="volume_listener" uuid="0b776dde-0590-11e5-81ba-0025b32654a0"/>
<effect name="audiosphere" library="audiosphere" uuid="184e62ab-2d19-4364-9d1b-c0a40733866c"/>
<effect name="shoebox" library="shoebox" uuid="1eab784c-1a36-4b2a-b7fc-e34c44cab89e"/>
<effect name="dirac" library="dirac" uuid="e069d9e0-8329-11df-9168-0002a5d5c51b"/>
<effect name="misoundfx" library="misoundfx" uuid="5b8e36a5-144a-4c38-b1d7-0002a5d5c51b"/>
<!--DOLBY DAP-->
<effect name="dap" library="dap" uuid="9d4921da-8225-4f29-aefa-39537a04bcaa"/>
<!--DOLBY END-->
<!--DOLBY GAME-->
<effect name="gamedap" library="gamedap" uuid="3783c334-d3a0-4d13-874f-0032e5fb80e2"/>
<!--DOLBY END-->
<!--DOLBY VQE-->
<effect name="vqe" library="vqe" uuid="64a0f614-7fa4-48b8-b081-d59dc954616f"/>
<!--DOLBY END-->
</effects>
<postprocess>
<stream type="music">
<apply effect="music_helper"/>
</stream>
<stream type="ring">
<apply effect="ring_helper"/>
</stream>
<stream type="alarm">
<apply effect="alarm_helper"/>
</stream>
<stream type="voice_call">
<apply effect="voice_helper"/>
</stream>
<stream type="notification">
<apply effect="notification_helper"/>
</stream>
</postprocess>
<preprocess>
<stream type="voice_communication">
<apply effect="aec"/>
<apply effect="ns"/>
</stream>
</preprocess>
</audio_effects_conf>

View File

@@ -1,149 +0,0 @@
# List of profiles for the output device session where stream is routed.A
# A stream opened with the inputs attributes which match the "flags" and
# "formats" as specified in the profile is routed to a device at
# sample rate specified under "sampling_rates" and bit width under
# "bit_width" and the topology extracted from the acdb data against
# the "app_type".
#
# the flags and formats are specified using the strings corresponding to
# enums in audio.h and audio_policy.h. They are concatenated with "|"
# without space or "\n".
# the flags and formats should match the ones in "audio_policy.conf"
outputs {
default {
flags AUDIO_OUTPUT_FLAG_PRIMARY
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 48000
bit_width 16
app_type 69937
}
default_24bit {
flags AUDIO_OUTPUT_FLAG_PRIMARY
formats AUDIO_FORMAT_PCM_24_BIT_PACKED
sampling_rates 48000
bit_width 24
app_type 69937
}
proaudio {
flags AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 48000
bit_width 16
app_type 69943
}
voip_rx {
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 8000|16000|32000|48000
bit_width 16
app_type 69946
}
deep_buffer {
flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 48000
bit_width 16
app_type 69936
}
deep_buffer_24 {
flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
formats AUDIO_FORMAT_PCM_24_BIT_PACKED
sampling_rates 48000
bit_width 24
app_type 69940
}
direct_pcm_16 {
flags AUDIO_OUTPUT_FLAG_DIRECT
formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
sampling_rates 44100|48000|88200|96000|176400|192000
bit_width 16
app_type 69936
}
direct_pcm_24 {
flags AUDIO_OUTPUT_FLAG_DIRECT
formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000
bit_width 24
app_type 69940
}
direct_pcm_32 {
flags AUDIO_OUTPUT_FLAG_DIRECT
formats AUDIO_FORMAT_PCM_32_BIT
sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000
bit_width 32
app_type 69942
}
compress_passthrough {
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH
formats AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_E_AC3_JOC|AUDIO_FORMAT_DTS|AUDIO_FORMAT_DTS_HD|AUDIO_FORMAT_DSD
sampling_rates 32000|44100|48000|88200|96000|176400|192000|352800
bit_width 16
app_type 69941
}
compress_offload_16 {
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD
formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_PCM_16_BIT_OFFLOAD|AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2
sampling_rates 44100|48000|88200|96000|176400|192000
bit_width 16
app_type 69940
}
compress_offload_24 {
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD
formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2
sampling_rates 44100|48000|88200|96000|176400|192000
bit_width 24
app_type 69940
}
}
inputs {
primary {
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 48000|16000|8000
bit_width 16
app_type 69938
}
record_unprocessed {
profile record_unprocessed
formats AUDIO_FORMAT_PCM_24_BIT_PACKED
sampling_rates 16000|48000
bit_width 24
app_type 69942
}
record_compress_16 {
flags AUDIO_INPUT_FLAG_COMPRESS
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 48000|96000
bit_width 16
app_type 69938
}
record_compress_24 {
flags AUDIO_INPUT_FLAG_COMPRESS
formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
sampling_rates 44100|48000|88200|96000|176400|192000
bit_width 24
app_type 69948
}
record_compress_32 {
flags AUDIO_INPUT_FLAG_COMPRESS
formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
sampling_rates 44100|48000|88200|96000|176400|192000
bit_width 32
app_type 69949
}
voip_tx {
flags AUDIO_INPUT_FLAG_VOIP_TX
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 8000|16000|32000|48000
bit_width 16
app_type 69946
}
low_latency_voip_tx {
flags AUDIO_INPUT_FLAG_VOIP_TX|AUDIO_INPUT_FLAG_FAST
formats AUDIO_FORMAT_PCM_16_BIT
sampling_rates 48000
bit_width 16
app_type 69946
}
}

View File

@@ -22,97 +22,46 @@ value:2907
[AID_VENDOR_FASTRPC]
value:2908
[AID_VENDOR_QTR]
value:2909
[dsp/]
mode: 0771
user: AID_MEDIA
group: AID_MEDIA
caps: 0
[persist/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[system/bin/cnss-daemon]
[vendor/bin/wcnss_filter]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_BIND_SERVICE
caps: BLOCK_SUSPEND
[system/bin/pd-mapper]
[system/vendor/bin/wcnss_filter]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
[system/bin/pm-service]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE SYS_BOOT
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_ADMIN BLOCK_SUSPEND
[vendor/bin/cnd]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE NET_ADMIN BLOCK_SUSPEND
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_ADMIN BLOCK_SUSPEND
caps: BLOCK_SUSPEND NET_ADMIN
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: BLOCK_SUSPEND NET_ADMIN
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_ADMIN BLOCK_SUSPEND
caps: BLOCK_SUSPEND NET_ADMIN
[vendor/bin/ims_rtp_daemon]
mode: 0755
user: AID_SYSTEM
group: AID_RADIO
caps: NET_BIND_SERVICE
[vendor/bin/imsdaemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE WAKE_ALARM BLOCK_SUSPEND
[vendor/bin/imsdatadaemon]
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
caps: BLOCK_SUSPEND NET_ADMIN
[vendor/bin/imsrcsd]
[system/bin/cnss-daemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE WAKE_ALARM BLOCK_SUSPEND
[vendor/bin/loc_launcher]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: SETGID SETUID
[vendor/bin/pd-mapper]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_BIND_SERVICE
[vendor/bin/pm-service]
@@ -121,29 +70,137 @@ user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE SYS_BOOT
[system/vendor/bin/pm-service]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE SYS_BOOT
[system/bin/pm-service]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE SYS_BOOT
[vendor/bin/pd-mapper]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
[system/vendor/bin/pd-mapper]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
[system/bin/pd-mapper]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
[vendor/bin/imsdatadaemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE
[system/vendor/bin/imsdatadaemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE
[vendor/bin/ims_rtp_daemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE
[system/vendor/bin/ims_rtp_daemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE
[vendor/bin/imsrcsd]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
[system/vendor/bin/imsrcsd]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
[vendor/bin/imsdaemon]
mode: 0755
user: AID_RADIO
group: AID_RADIO
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
[vendor/bin/cnd]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
[system/vendor/bin/cnd]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
[vendor/bin/slim_daemon]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE
[system/vendor/bin/slim_daemon]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE
[vendor/bin/loc_launcher]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: SETUID SETGID
[system/vendor/bin/loc_launcher]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: SETUID SETGID
[vendor/bin/xtwifi-client]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
[vendor/bin/sensors.qti]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
[vendor/bin/slim_daemon]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE
[firmware/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[vendor/bin/wcnss_filter]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND
[vendor/bin/xtwifi-client]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE WAKE_ALARM BLOCK_SUSPEND
[firmware/image/*]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[vendor/firmware_mnt/image/*]
mode: 0771
@@ -151,3 +208,20 @@ user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[bt_firmware/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[persist/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[dsp/]
mode: 0771
user: AID_MEDIA
group: AID_MEDIA
caps: 0

View File

@@ -1,4 +1,4 @@
<!-- Copyright (c) 2019, The Linux Foundation. All rights reserved.
<!-- Copyright (c) 2018, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -26,10 +26,14 @@ 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">
<!-- Codec2 HAl service -->
<hal format="hidl">
<name>android.hardware.gnss</name>
<name>android.hardware.media.c2</name>
<transport>hwbinder</transport>
<fqname>@1.1::IGnss/default</fqname>
<version>1.0</version>
<interface>
<name>IComponentStore</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -3,60 +3,6 @@
SPDX-License-Identifier: Apache-2.0
-->
<compatibility-matrix version="2.0" type="framework" target-level="5">
<hal format="hidl" optional="true">
<name>android.hardware.audio.effect</name>
<version>7.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.audio</name>
<version>7.0</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.biometrics.fingerprint</name>
<version>2.0-3</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.bluetooth.audio</name>
<version>4</version>
<interface>
<name>IBluetoothAudioProviderFactory</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.cas</name>
<version>1.0-2</version>
<interface>
<name>IMediaCasService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.cas</name>
<interface>
<name>IMediaCasService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.drm</name>
<interface>
<name>IDrmFactory</name>
<instance>clearkey</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.light</name>
<transport>hwbinder</transport>
@@ -66,54 +12,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.power</name>
<version>2</version>
<interface>
<name>IPower</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.usb</name>
<version>1.0-3</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.vibrator</name>
<version>2</version>
<interface>
<name>IVibrator</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.wifi</name>
<version>2</version>
<interface>
<name>IWifi</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.wifi.hostapd</name>
<version>2</version>
<interface>
<name>IHostapd</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.wifi.supplicant</name>
<version>3</version>
<interface>
<name>ISupplicant</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>com.qualcomm.qti.ant</name>
<transport>hwbinder</transport>
@@ -163,4 +61,12 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.lineage.fastcharge</name>
<version>1.0</version>
<interface>
<name>IFastCharge</name>
<instance>default</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@@ -39,6 +39,12 @@
</interface>
<fqname>@2.4::ICameraProvider/legacy/0</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.drm</name>
<transport>hwbinder</transport>
<fqname>@1.3::ICryptoFactory/wfdhdcp</fqname>
<fqname>@1.3::IDrmFactory/wfdhdcp</fqname>
</hal>
<hal format="hidl">
<name>vendor.qti.hardware.cacert</name>
<transport>hwbinder</transport>
@@ -90,13 +96,19 @@
<fqname>@2.0::ILight/default</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.media.c2</name>
<name>android.hardware.media.omx</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IComponentStore</name>
<name>IOmx</name>
<instance>default</instance>
</interface>
<interface>
<name>IOmxStore</name>
<instance>default</instance>
</interface>
<fqname>@1.0::IOmx/default</fqname>
<fqname>@1.0::IOmxStore/default</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.neuralnetworks</name>
@@ -163,12 +175,12 @@
<hal format="hidl">
<name>android.hardware.tetheroffload.control</name>
<transport>hwbinder</transport>
<version>1.1</version>
<version>1.0</version>
<interface>
<name>IOffloadControl</name>
<instance>default</instance>
</interface>
<fqname>@1.1::IOffloadControl/default</fqname>
<fqname>@1.0::IOffloadControl/default</fqname>
</hal>
<hal format="hidl">
<name>com.qualcomm.qti.ant</name>
@@ -192,7 +204,7 @@
<hal format="hidl">
<name>com.qualcomm.qti.uceservice</name>
<transport>hwbinder</transport>
<version>2.1</version>
<version>2.2</version>
<interface>
<name>IUceService</name>
<instance>com.qualcomm.qti.uceservice</instance>
@@ -515,6 +527,27 @@
</interface>
<fqname>@1.3::IHidlVppService/vppService</fqname>
</hal>
<hal format="hidl">
<name>vendor.qti.hardware.wifidisplaysession</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IWifiDisplaySession</name>
<instance>wifidisplaysession</instance>
</interface>
<interface>
<name>IWifiDisplaySessionAudioTrack</name>
<instance>wifidisplaysessionaudiotrack</instance>
</interface>
<interface>
<name>IWifiDisplaySessionImageTrack</name>
<instance>wifidisplaysessionimagetrack</instance>
</interface>
<interface>
<name>IWifiDisplaySessionVideoTrack</name>
<instance>wifidisplaysessionvideotrack</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.qti.ims.callinfo</name>
<transport>hwbinder</transport>
@@ -535,6 +568,16 @@
<instance>imsrtpservice</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.qti.power.pasrmanager</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IPasrManager</name>
<instance>default</instance>
</interface>
<fqname>@1.0::IPasrManager/default</fqname>
</hal>
<hal format="hidl">
<name>vendor.dolby.hardware.dms</name>
<transport>hwbinder</transport>

View File

@@ -0,0 +1,443 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
Not a contribution.
Copyright (C) 2012-2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
<!DOCTYPE MediaCodecs [
<!ELEMENT Include EMPTY>
<!ATTLIST Include href CDATA #REQUIRED>
<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
<!ELEMENT Decoders (MediaCodec|Include)*>
<!ELEMENT Encoders (MediaCodec|Include)*>
<!ELEMENT MediaCodec (Type|Quirk|Include)*>
<!ATTLIST MediaCodec name CDATA #REQUIRED>
<!ATTLIST MediaCodec type CDATA>
<!ELEMENT Type EMPTY>
<!ATTLIST Type name CDATA #REQUIRED>
<!ELEMENT Quirk EMPTY>
<!ATTLIST Quirk name CDATA #REQUIRED>
]>
There's a simple and a complex syntax to declare the availability of a
media codec:
A codec that properly follows the OpenMax spec and therefore doesn't have any
quirks and that only supports a single content type can be declared like so:
<MediaCodec name="OMX.foo.bar" type="something/interesting" />
If a codec has quirks OR supports multiple content types, the following syntax
can be used:
<MediaCodec name="OMX.foo.bar" >
<Type name="something/interesting" />
<Type name="something/else" />
...
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="output-buffers-are-unreadable" />
</MediaCodec>
Only the three quirks included above are recognized at this point:
"requires-allocate-on-input-ports"
must be advertised if the component does not properly support specification
of input buffers using the OMX_UseBuffer(...) API but instead requires
OMX_AllocateBuffer to be used.
"requires-allocate-on-output-ports"
must be advertised if the component does not properly support specification
of output buffers using the OMX_UseBuffer(...) API but instead requires
OMX_AllocateBuffer to be used.
"output-buffers-are-unreadable"
must be advertised if the emitted output buffers of a decoder component
are not readable, i.e. use a custom format even though abusing one of
the official OMX colorspace constants.
Clients of such decoders will not be able to access the decoded data,
naturally making the component much less useful. The only use for
a component with this quirk is to render the output to the screen.
Audio decoders MUST NOT advertise this quirk.
Video decoders that advertise this quirk must be accompanied by a
corresponding color space converter for thumbnail extraction,
matching surfaceflinger support that can render the custom format to
a texture and possibly other code, so just DON'T USE THIS QUIRK.
-->
<!--
Non-Secure decoder capabilities
(MB is defined as 16x16)
_____________________________________________________________________
| Codec | W H fps Mbps MB/s Max MB/s|
|_____________|_____________________________________________________|
| h264 | 1920 1088 480 220 3916800 3916800 |
| | 3820 2160 120 220 3888000 |
| | 4096 2160 96 220 3317760 |
| | 4096 2304 60 220 2211840 |
| | 7680 4320 30 220 3888000 |
| | 8192 4320 24 220 3317760 |
| hevc | 1920 1088 480 220 3916800 3916800 |
| | 3820 2160 120 220 3888000 |
| | 4096 2160 96 220 3317760 |
| | 4096 2304 60 220 2211840 |
| | 7680 4320 30 220 3888000 |
| | 8192 4320 24 220 3317760 |
| mpeg4-sw | 1920 1088 30 40 244800 244800 |
| vp8 | 1280 720 240 100 864000 1036800 |
| | 1920 1088 120 100 979200 |
| | 3840 2160 30 100 972000 |
| | 4096 2160 30 100 1036800 |
| | 4096 2304 24 100 884736 |
| vp9 | 1920 1088 480 220 3916800 3916800 |
| | 3820 2160 120 220 3888000 |
| | 4096 2160 96 220 3317760 |
| | 4096 2304 60 220 2211840 |
| | 7680 4320 30 220 3888000 |
| | 8192 4320 24 220 3317760 |
| h263-sw | 864 480 30 16 48600 48600 |
| mpeg2 | 1920 1088 30 40 244800 244800 |
|_____________|_____________________________________________________|
Secure decoder capabilities
(MB is defined as 16x16)
__________________________________________________________________
| Codec | W H fps Mbps MB/s Max MB/s|
|__________|_____________________________________________________|
| h264 | 1280 720 60 40 216000 2073600 |
| | 1920 1088 60 40 489600 |
| | 3840 2160 60 40 1944000 |
| | 4096 2160 60 40 2073600 |
| | 4096 2304 30 40 1105920 |
| hevc | 1280 720 60 40 216000 2073600 |
| | 1920 1088 60 40 489600 |
| | 3840 2160 60 40 1944000 |
| | 4096 2160 60 40 2073600 |
| | 4096 2304 30 40 1105920 |
| vp9 | 1280 720 60 40 216000 2073600 |
| | 1920 1088 60 40 489600 |
| | 3840 2160 60 40 1944000 |
| | 4096 2160 60 40 2073600 |
| | 4096 2304 30 40 1105920 |
| mpeg2 | 1920 1088 30 40 244800 244800 |
|__________|_____________________________________________________|
Non-Secure encoder capabilities (Secure not supported)
(MB is defined as 16x16)
__________________________________________________________________
| Codec | W H fps Mbps MB/s Max MB/s|
|__________|_____________________________________________________|
| h264 | 1280 720 480 160 1728000 1958400 |
| | 1920 1088 240 160 1958400 |
| | 3840 2160 60 160 1944000 |
| | 4096 2160 48 160 1658880 |
| | 4096 2304 30 160 1105920 |
| hevc | 1280 720 480 160 1728000 1958400 |
| | 1920 1088 240 160 1958400 |
| | 3840 2160 60 160 1944000 |
| | 4096 2160 48 160 1658880 |
| | 4096 2304 30 160 1105920 |
| mpeg4-sw | 1280 720 30 4 108000 108000 |
| vp8 | 1280 720 240 40 864000 1036800 |
| | 1920 1088 120 40 979200 |
| | 3840 2160 30 40 972000 |
| | 4096 2160 30 40 1036800 |
| | 4096 2304 24 40 884736 |
| h263-sw | 864 480 30 2 48600 48600 |
|__________|_____________________________________________________|
-->
<MediaCodecs>
<Include href="media_codecs_google_audio.xml" />
<Include href="media_codecs_dolby_audio.xml" />
<Include href="media_codecs_google_telephony.xml" />
<Settings>
<Setting name="max-video-encoder-input-buffers" value="11" />
</Settings>
<Encoders>
<!-- Video Hardware -->
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="requires-loaded-to-idle-after-allocation" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="1958400" />
<Limit name="bitrate" range="1-160000000" />
<Limit name="frame-rate" range="1-480" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-4096x2304" value="56" />
<Limit name="performance-point-4096x2160" value="60" />
<Limit name="performance-point-3840x2160" value="60" />
<Limit name="performance-point-1920x1080" value="240" />
<Limit name="performance-point-1280x720" value="480" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="requires-loaded-to-idle-after-allocation" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="1036800" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-240" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-4096x2304" value="24" />
<Limit name="performance-point-4096x2160" value="30" />
<Limit name="performance-point-3840x2160" value="30" />
<Limit name="performance-point-1920x1080" value="120" />
<Limit name="performance-point-1280x720" value="240" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="requires-loaded-to-idle-after-allocation" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="1958400" />
<Limit name="bitrate" range="1-160000000" />
<Limit name="frame-rate" range="1-480" />
<Limit name="concurrent-instances" max="16" />
<Limit name="quality" range="0-100" default="80" />
<Limit name="performance-point-4096x2304" value="56" />
<Limit name="performance-point-4096x2160" value="60" />
<Limit name="performance-point-3840x2160" value="60" />
<Limit name="performance-point-1920x1080" value="240" />
<Limit name="performance-point-1280x720" value="480" />
<Feature name="bitrate-modes" value="VBR,CBR" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="requires-loaded-to-idle-after-allocation" />
<Limit name="size" min="96x96" max="512x512" />
<Limit name="frame-rate" range="1-20" />
<Limit name="concurrent-instances" max="16" />
<Limit name="quality" range="0-100" default="80" />
<Limit name="performance-point-512x512" value="480" />
<Feature name="bitrate-modes" value="CQ" />
</MediaCodec>
<!-- Video Software -->
<MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="requires-loaded-to-idle-after-allocation" />
<Limit name="size" min="96x96" max="864x480" />
<Limit name="alignment" value="4x4" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="48600" />
<Limit name="bitrate" range="1-2000000" />
<Limit name="frame-rate" range="1-30" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-720x480" value="30" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Quirk name="requires-loaded-to-idle-after-allocation" />
<Limit name="size" min="96x96" max="1280x720" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="108000" />
<Limit name="bitrate" range="1-4000000" />
<Limit name="frame-rate" range="1-30" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-1280x720" value="30" />
</MediaCodec>
</Encoders>
<Decoders>
<!-- Video Hardware -->
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="8192x4320" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="3916800" />
<Limit name="bitrate" range="1-220000000" />
<Limit name="frame-rate" range="1-480" />
<Feature name="adaptive-playback" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-4096x2304" value="60" />
<Limit name="performance-point-4096x2160" value="96" />
<Limit name="performance-point-3840x2160" value="120" />
<Limit name="performance-point-1920x1088" range="480" />
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="2073600" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-60" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Limit name="concurrent-instances" max="3" />
<Limit name="performance-point-4096x2304" value="30" />
<Limit name="performance-point-4096x2160" value="60" />
<Limit name="performance-point-3840x2160" value="60" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="1920x1088" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="244800" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-30" />
<Feature name="adaptive-playback" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-1920x1080" value="30" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="1920x1088" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="244800" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-30" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Limit name="concurrent-instances" max="3" />
<Limit name="performance-point-1920x1080" value="30" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="1036800" />
<Limit name="bitrate" range="1-100000000" />
<Limit name="frame-rate" range="1-240" />
<Feature name="adaptive-playback" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-4096x2304" value="24" />
<Limit name="performance-point-4096x2160" value="30" />
<Limit name="performance-point-3840x2160" value="30" />
<Limit name="performance-point-1920x1080" value="120" />
<Limit name="performance-point-1280x720" value="240" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="8192x4320" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="3916800" />
<Limit name="bitrate" range="1-220000000" />
<Limit name="frame-rate" range="1-480" />
<Feature name="adaptive-playback" />
<Limit name="concurrent-instances" max="6" />
<Limit name="performance-point-4096x2304" value="60" />
<Limit name="performance-point-4096x2160" value="96" />
<Limit name="performance-point-3840x2160" value="120" />
<Limit name="performance-point-1920x1088" range="480" />
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="2073600" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-60" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Limit name="concurrent-instances" max="3" />
<Limit name="performance-point-4096x2304" value="30" />
<Limit name="performance-point-4096x2160" value="60" />
<Limit name="performance-point-3840x2160" value="60" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="8192x4320" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="3916800" />
<Limit name="bitrate" range="1-220000000" />
<Limit name="frame-rate" range="1-480" />
<Feature name="adaptive-playback" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-4096x2304" value="60" />
<Limit name="performance-point-4096x2160" value="96" />
<Limit name="performance-point-3840x2160" value="120" />
<Limit name="performance-point-1920x1088" range="480" />
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="4096x2304" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="2073600" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-60" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Limit name="concurrent-instances" max="3" />
<Limit name="performance-point-4096x2304" value="30" />
<Limit name="performance-point-4096x2160" value="60" />
<Limit name="performance-point-3840x2160" value="60" />
</MediaCodec>
<!-- Video Software -->
<MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="864x480" />
<Limit name="alignment" value="4x4" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="48600" />
<Limit name="bitrate" range="1-16000000" />
<Limit name="frame-rate" range="1-30" />
<Feature name="adaptive-playback" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-720x480" value="30" />
</MediaCodec>
<MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
<Limit name="size" min="96x96" max="1920x1088" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" min="36" max="244800" />
<Limit name="bitrate" range="1-40000000" />
<Limit name="frame-rate" range="1-30" />
<Limit name="concurrent-instances" max="16" />
<Limit name="performance-point-1920x1080" value="30" />
</MediaCodec>
<MediaCodec name="OMX.google.opus.decoder" type="audio/opus" update="true" rank="100"/>
</Decoders>
<Include href="media_codecs_google_video.xml" />
</MediaCodecs>

View File

@@ -104,7 +104,6 @@
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
<Feature name="adaptive-playback" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.avc.decoder.low_latency" type="video/avc">
<Alias name="OMX.qcom.video.decoder.avc.low_latency" />
@@ -124,7 +123,6 @@
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
<Feature name="adaptive-playback" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.avc.decoder.secure" type="video/avc" >
<Alias name="OMX.qcom.video.decoder.avc.secure" />
@@ -141,7 +139,6 @@
<Limit name="performance-point-3840x2160" value="60" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" >
<Alias name="OMX.qcom.video.decoder.hevc" />
@@ -160,7 +157,6 @@
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
<Feature name="adaptive-playback" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.hevc.decoder.secure" type="video/hevc" >
<Alias name="OMX.qcom.video.decoder.hevc.secure" />
@@ -177,7 +173,6 @@
<Limit name="performance-point-3840x2160" value="60" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.vp8.decoder" type="video/x-vnd.on2.vp8" >
<Alias name="OMX.qcom.video.decoder.vp8" />
@@ -195,7 +190,6 @@
<Limit name="performance-point-1920x1080" value="120" />
<Limit name="performance-point-1280x720" value="240" />
<Feature name="adaptive-playback" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" >
<Alias name="OMX.qcom.video.decoder.vp9" />
@@ -214,7 +208,6 @@
<Limit name="performance-point-1920x1088" range="240" />
<Limit name="performance-point-1280x720" value="480" />
<Feature name="adaptive-playback" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.vp9.decoder.secure" type="video/x-vnd.on2.vp9" >
<Alias name="OMX.qcom.video.decoder.vp9.secure" />
@@ -231,7 +224,6 @@
<Limit name="performance-point-3840x2160" value="60" />
<Feature name="adaptive-playback" />
<Feature name="secure-playback" required="true" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
</Decoders>
@@ -253,7 +245,6 @@
<Limit name="performance-point-1280x720" value="480" />
<Feature name="bitrate-modes" value="VBR,CBR" />
<Feature name="intra-refresh" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.hevc.encoder" type="video/hevc">
<Alias name="OMX.qcom.video.encoder.hevc" />
@@ -272,7 +263,6 @@
<Limit name="performance-point-1280x720" value="480" />
<Feature name="bitrate-modes" value="VBR,CBR" />
<Feature name="intra-refresh" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
<MediaCodec name="c2.qti.hevc.encoder.cq" type="video/hevc">
<Limit name="size" min="96x96" max="512x512" />
@@ -317,7 +307,6 @@
<Limit name="performance-point-1920x1080" value="120" />
<Limit name="performance-point-1280x720" value="240" />
<Feature name="intra-refresh" />
<Feature name="can-swap-width-height" value="1" />
</MediaCodec>
</Encoders>
</Included>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was modified by Dolby Laboratories, Inc. The portions of the
code that are surrounded by "DOLBY..." are copyrighted and
licensed separately, as follows:
(C) 2018 Dolby Laboratories, Inc.
All rights reserved.
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.
-->
<Included>
<Decoders>
<!-- DOLBY_UDC -->
<MediaCodec name="OMX.dolby.ac3.decoder" type="audio/ac3">
<Limit name="channel-count" max="6" />
<Limit name="sample-rate" ranges="32000,44100,48000" />
<Limit name="bitrate" range="32000-640000" />
</MediaCodec>
<MediaCodec name="OMX.dolby.eac3.decoder" type="audio/eac3">
<Limit name="channel-count" max="8" />
<Limit name="sample-rate" ranges="32000,44100,48000" />
<Limit name="bitrate" range="32000-6144000" />
</MediaCodec>
<MediaCodec name="OMX.dolby.eac3-joc.decoder" type="audio/eac3-joc">
<Limit name="channel-count" max="8" />
<Limit name="sample-rate" ranges="48000" />
<Limit name="bitrate" range="32000-6144000" />
</MediaCodec>
<!-- DOLBY_UDC END -->
<!-- DOLBY_AC4 -->
<MediaCodec name="OMX.dolby.ac4.decoder" type="audio/ac4">
<Limit name="channel-count" max="2" />
<Limit name="sample-rate" ranges="48000" />
<Limit name="bitrate" range="16000-2688000" />
</MediaCodec>
<!-- DOLBY_AC4 END -->
</Decoders>
</Included>

View File

@@ -1,100 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
Not a Contribution.
Copyright 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.
u may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<MediaCodecs>
<Encoders>
<MediaCodec name="c2.qti.avc.encoder" type="video/avc" update="true">
<Limit name="measured-frame-rate-320x240" range="106-234" />
<Limit name="measured-frame-rate-720x480" range="64-140" />
<Limit name="measured-frame-rate-1280x720" range="160-165" />
<Limit name="measured-frame-rate-1920x1080" range="100-130" />
</MediaCodec>
<MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
<Limit name="measured-frame-rate-320x240" range="22-35" />
</MediaCodec>
<MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
<Limit name="measured-frame-rate-176x144" range="287-459" />
</MediaCodec>
<MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
<Limit name="measured-frame-rate-320x240" range="151-208" />
<Limit name="measured-frame-rate-720x480" range="61-84" />
<Limit name="measured-frame-rate-1280x720" range="41-57" />
<Limit name="measured-frame-rate-1920x1080" range="28-39" />
</MediaCodec>
<MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
<Limit name="measured-frame-rate-176x144" range="251-350" />
</MediaCodec>
<MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
<Limit name="measured-frame-rate-320x180" range="228-318" />
<Limit name="measured-frame-rate-640x360" range="150-233" />
<Limit name="measured-frame-rate-1280x720" range="43-61" />
<Limit name="measured-frame-rate-1920x1080" range="19-27" />
</MediaCodec>
<MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
<Limit name="measured-frame-rate-320x180" range="109-109" />
<Limit name="measured-frame-rate-640x360" range="61-61" />
<Limit name="measured-frame-rate-1280x720" range="20-20" />
</MediaCodec>
</Encoders>
<Decoders>
<MediaCodec name="c2.qti.avc.decoder" type="video/avc" update="true">
<Limit name="measured-frame-rate-320x240" range="220-630" />
<Limit name="measured-frame-rate-720x480" range="250-513" />
<Limit name="measured-frame-rate-1280x720" range="200-420" />
<Limit name="measured-frame-rate-1920x1088" range="189-301" />
</MediaCodec>
<MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
<Limit name="measured-frame-rate-320x240" range="196-760" />
<Limit name="measured-frame-rate-720x480" range="56-77" />
<Limit name="measured-frame-rate-1280x720" range="21-33" />
<Limit name="measured-frame-rate-1920x1080" range="12-17" />
</MediaCodec>
<MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
<Limit name="measured-frame-rate-352x288" range="179-740" />
<Limit name="measured-frame-rate-640x360" range="120-164" />
<Limit name="measured-frame-rate-720x480" range="111-410" />
<Limit name="measured-frame-rate-1280x720" range="61-83" />
<Limit name="measured-frame-rate-1920x1080" range="36-49" />
</MediaCodec>
<MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
<Limit name="measured-frame-rate-320x180" range="1400-1500" />
<Limit name="measured-frame-rate-640x360" range="222-302" />
<Limit name="measured-frame-rate-1280x720" range="107-145" />
<Limit name="measured-frame-rate-1920x1080" range="31-43" />
</MediaCodec>
<MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
<Limit name="measured-frame-rate-320x180" range="415-575" />
<Limit name="measured-frame-rate-640x360" range="200-450" />
<Limit name="measured-frame-rate-1280x720" range="44-60" />
<Limit name="measured-frame-rate-1920x1080" range="28-38" />
</MediaCodec>
<MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
<Limit name="measured-frame-rate-176x144" range="1465-2105" />
<Limit name="measured-frame-rate-352x288" range="324-769" />
</MediaCodec>
<MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
<Limit name="measured-frame-rate-176x144" range="1360-2145" />
<Limit name="measured-frame-rate-480x360" range="800-1900" />
<Limit name="measured-frame-rate-1280x720" range="300-650" />
</MediaCodec>
</Decoders>
<Include href="media_codecs_dolby_audio.xml" />
</MediaCodecs>

View File

@@ -1,32 +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.
#
#
PRIO=1,1,1,1,0,0,0,0
#arch_timer, arm-pmu, arch_mem_timer, msm_drm, kgsl-3d0
IGNORED_IRQ=19,21,38,115,332

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="com.android.camera">
<permission name="android.permission.WRITE_SECURE_SETTINGS" />
<permission name="android.permission.LOG_COMPAT_CHANGE" />
<permission name="android.permission.INTERACT_ACROSS_USERS" />
<permission name="android.permission.READ_COMPAT_CHANGE_CONFIG" />
<permission name="android.permission.SYSTEM_CAMERA" />
<permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
</privapp-permissions>
<privapp-permissions package="com.xiaomi.scanner">
<permission name="android.permission.WRITE_MEDIA_STORAGE" />
<permission name="android.permission.CHANGE_CONFIGURATION" />
<permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
</privapp-permissions>
<privapp-permissions package="com.miui.extraphoto">
<permission name="android.permission.WRITE_MEDIA_STORAGE" />
</privapp-permissions>
</permissions>

View File

@@ -5,12 +5,12 @@
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"1113600",
"844800",
"1036800",
"1209600",
"1555200",
"1382400",
"1555200"
"1209600",
"1113600",
"1036800",
"844800"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -20,10 +20,10 @@
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"768000",
"1113600"
"1113600",
"1036800",
"768000"
],
"DefaultIndex": 1,
"ResetOnInit": true
},
{
@@ -31,13 +31,14 @@
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"2131200",
"2016000",
"1920000",
"1708800",
"1497600",
"1401600",
"1171200",
"1497600",
"1708800",
"1920000",
"2131200"
"1056000"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -49,10 +50,10 @@
"9999999",
"1497600",
"1401600",
"0",
"1286400"
"1286400",
"1056000",
"0"
],
"DefaultIndex": 3,
"ResetOnInit": true
},
{
@@ -60,12 +61,13 @@
"Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"2016000",
"1401600",
"1708800",
"2015999",
"2534400",
"2227200",
"2534400"
"2016000",
"1708800",
"1497600",
"1401600",
"825600"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -77,19 +79,23 @@
"9999999",
"1497600",
"1401600",
"0",
"1286400"
"1286400",
"1171200",
"825600",
"0"
],
"DefaultIndex": 3,
"ResetOnInit": true
},
{
"Name": "GPUMaxFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/devfreq/max_freq",
"Values": [
"999999999",
"810000000",
"765000000",
"675000000",
"585000000",
"427000000"
"427000000",
"257000000"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -98,6 +104,9 @@
"Name": "GPUMinFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/devfreq/min_freq",
"Values": [
"810000000",
"765000000",
"675000000",
"585000000",
"427000000",
"345000000",
@@ -139,7 +148,16 @@
"Path": "/sys/class/kgsl/kgsl-3d0/idle_timer",
"Values": [
"10000",
"58"
"80"
],
"ResetOnInit": true
},
{
"Name": "TASchedtuneBoost",
"Path": "/dev/stune/top-app/schedtune.boost",
"Values": [
"30",
"10"
],
"ResetOnInit": true
},
@@ -244,6 +262,15 @@
],
"ResetOnInit": true
},
{
"Name": "L3LittleClusterMinFreq",
"Path": "/sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/min_freq",
"Values": [
"1440000000",
"300000000"
],
"ResetOnInit": true
},
{
"Name": "L3BigClusterMinFreq",
"Path": "/sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/min_freq",
@@ -257,11 +284,62 @@
"Name": "PMQoSCpuDmaLatency",
"Path": "/dev/cpu_dma_latency",
"Values": [
"2c",
"64"
"44",
"100"
],
"HoldFd": true
},
{
"Name": "ForegroundCpuset",
"Path": "/dev/cpuset/foreground/cpus",
"Values": [
"0-5",
"0-5,7"
],
"ResetOnInit": true
},
{
"Name": "UfsClkGateEnable",
"Path": "/sys/devices/platform/soc/1d84000.ufshc/clkgate_enable",
"Values": [
"0",
"1"
],
"ResetOnInit": true
},
{
"Name": "EnergyAware",
"Path": "/proc/sys/kernel/sched_energy_aware",
"Values": [
"0",
"1"
],
"ResetOnInit": true
},
{
"Name": "DisplayWakeup",
"Path": "/sys/devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card0/sde-crtc-0/early_wakeup",
"Values": [
"1",
"0"
]
},
{
"Name": "UpMigrate",
"Path": "/proc/sys/kernel/sched_upmigrate",
"Values": [
"0x5F",
"0x32"
]
},
{
"Name": "DownMigrate",
"Path": "/proc/sys/kernel/sched_downmigrate",
"Values": [
"0x55",
"0x28"
]
},
{
"Name": "PowerHALMainState",
"Path": "vendor.powerhal.state",
@@ -288,16 +366,6 @@
""
],
"Type": "Property"
},
{
"Name": "DoubleTapToWake",
"Path": "/sys/touchpanel/double_tap",
"Values": [
"0",
"1"
],
"DefaultIndex": 0,
"ResetOnInit": true
}
],
"Actions": [
@@ -329,7 +397,7 @@
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "427000000"
"Value": "675000000"
},
{
"PowerHint": "INTERACTION",
@@ -349,6 +417,12 @@
"Duration": 0,
"Value": "1113600"
},
{
"PowerHint": "INTERACTION",
"Node": "TASchedtuneBoost",
"Duration": 0,
"Value": "30"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBWHystTriggerCount",
@@ -379,6 +453,24 @@
"Duration": 0,
"Value": "2597"
},
{
"PowerHint": "INTERACTION",
"Node": "UfsClkGateEnable",
"Duration": 200,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "ForegroundCpuset",
"Duration": 2000,
"Value": "0-5"
},
{
"PowerHint": "LAUNCH",
"Node": "EnergyAware",
"Duration": 5000,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBigClusterMaxFreq",
@@ -413,7 +505,7 @@
"PowerHint": "LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 5000,
"Value": "2c"
"Value": "44"
},
{
"PowerHint": "LAUNCH",
@@ -463,17 +555,41 @@
"Duration": 5000,
"Value": "6881"
},
{
"PowerHint": "LAUNCH",
"Node": "L3LittleClusterMinFreq",
"Duration": 2000,
"Value": "1440000000"
},
{
"PowerHint": "LAUNCH",
"Node": "L3BigClusterMinFreq",
"Duration": 5000,
"Value": "1440000000"
},
{
"PowerHint": "LAUNCH",
"Node": "UfsClkGateEnable",
"Duration": 5000,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "UpMigrate",
"Duration": 2000,
"Value": "0x32"
},
{
"PowerHint": "LAUNCH",
"Node": "DownMigrate",
"Duration": 2000,
"Value": "0x28"
},
{
"PowerHint": "AUDIO_LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 2000,
"Value": "2c"
"Value": "44"
},
{
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
@@ -485,7 +601,7 @@
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "2c"
"Value": "44"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
@@ -503,13 +619,19 @@
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "999999999"
"Value": "675000000"
},
{
"PowerHint": "ML_ACC",
"Node": "PMQoSCpuDmaLatency",
"Duration": 2000,
"Value": "2c"
"Value": "44"
},
{
"PowerHint": "DISPLAY_UPDATE_IMMINENT",
"Node": "DisplayWakeup",
"Duration": 60,
"Value": "1"
},
{
"PowerHint": "LOW_POWER_LITTLE_CLUSTER_50",
@@ -611,7 +733,7 @@
"PowerHint": "LOW_POWER_CPU_70",
"Node": "CPUBigPlusClusterMaxFreq",
"Duration": 3600000,
"Value": "2015999"
"Value": "2016000"
},
{
"PowerHint": "LOW_POWER_CPU_80",
@@ -638,10 +760,22 @@
"Value": "2534400"
},
{
"PowerHint": "DOUBLE_TAP_TO_WAKE",
"Node": "DoubleTapToWake",
"PowerHint": "Flipendo",
"Node": "CPULittleClusterMaxFreq",
"Duration": 0,
"Value": "1"
"Value": "1382400"
},
{
"PowerHint": "Flipendo",
"Node": "CPUBigPlusClusterMaxFreq",
"Duration": 0,
"Value": "1401600"
},
{
"PowerHint": "Flipendo",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "1497600"
}
]
}

333
configs/security/sec_config Normal file
View File

@@ -0,0 +1,333 @@
/* IPC Security Config */
/* <GPS QMI Service ID - 16>:<GPS QMI Instance ID - all instances>:<Client Group ID> */
16:4294967295:1000:1021:1026
/* <QDMA QMI Service ID - 75>:<QDMA QMI Instance ID - all instances>:<Client Group ID> */
75:4294967295:1000:1001:3006
/* <LOWI QMI Service ID - 38>:<LOWI QMI Instance ID - all instances>:<Client Group ID> */
56:4294967295:1021
/* Allow SS CTL service to be used by system and net_raw processes */
43:4294967295:1000:3004
/* <UIMHTTP QMI Service ID - 16>:<UIMHTTP QMI Instance ID - all instances>:<Client Group ID> */
71:4294967295:1001
/* <UIMRMT QMI Service ID - 16>:<UIMRMT QMI Instance ID - all instances>:<Client Group ID> */
50:4294967295:1001
/* QMI-SLIM service permitted to gps and net_raw */
55:4294967295:1021
/* Allow Sensor services to be used by sensor process */
256:4294967295:1000:1006:1013:1021:1047:3011
257:4294967295:1000:1006:1013:1021:1047:3011
258:4294967295:1000:1006:1013:1021:1047:3011
259:4294967295:1000:1006:1013:1021:1047:3011
260:4294967295:1000:1006:1013:1021:1047:3011
261:4294967295:1000:1006:1013:1021:1047:3011
262:4294967295:1000:1006:1013:1021:1047:3011
263:4294967295:1000:1006:1013:1021:1047:3011
264:4294967295:1000:1006:1013:1021:1047:3011
265:4294967295:1000:1006:1013:1021:1047:3011
266:4294967295:1000:1006:1013:1021:1047:3011
267:4294967295:1000:1006:1013:1021:1047:3011
268:4294967295:1000:1006:1013:1021:1047:3011
269:4294967295:1000:1006:1013:1021:1047:3011
270:4294967295:1000:1006:1013:1021:1047:3011
271:4294967295:1000:1006:1013:1021:1047:3011
272:4294967295:1000:1006:1013:1021:1047:3011
273:4294967295:1000:1006:1013:1021:1047:3011
274:4294967295:1000:1006:1013:1021:1047:3011
275:4294967295:1000:1006:1013:1021:1047:3011
276:4294967295:1000:1006:1013:1021:1047:3011
277:4294967295:1000:1006:1013:1021:1047:3011
278:4294967295:1000:1006:1013:1021:1047:3011
279:4294967295:1000:1006:1013:1021:1047:3011
280:4294967295:1000:1006:1013:1021:1047:3011
281:4294967295:1000:1006:1013:1021:1047:3011
282:4294967295:1000:1006:1013:1021:1047:3011
283:4294967295:1000:1006:1013:1021:1047:3011
284:4294967295:1000:1006:1013:1021:1047:3011
285:4294967295:1000:1006:1013:1021:1047:3011
286:4294967295:1000:1006:1013:1021:1047:3011
287:4294967295:1000:1006:1013:1021:1047:3011
288:4294967295:1000:1006:1013:1021:1047:3011
289:4294967295:1000:1006:1013:1021:1047:3011
290:4294967295:1000:1006:1013:1021:1047:3011
291:4294967295:1000:1006:1013:1021:1047:3011
292:4294967295:1000:1006:1013:1021:1047:3011
293:4294967295:1000:1006:1013:1021:1047:3011
294:4294967295:1000:1006:1013:1021:1047:3011
295:4294967295:1000:1006:1013:1021:1047:3011
296:4294967295:1000:1006:1013:1021:1047:3011
297:4294967295:1000:1006:1013:1021:1047:3011
298:4294967295:1000:1006:1013:1021:1047:3011
299:4294967295:1000:1006:1013:1021:1047:3011
300:4294967295:1000:1006:1013:1021:1047:3011
301:4294967295:1000:1006:1013:1021:1047:3011
302:4294967295:1000:1006:1013:1021:1047:3011
303:4294967295:1000:1006:1013:1021:1047:3011
304:4294967295:1000:1006:1013:1021:1047:3011
305:4294967295:1000:1006:1013:1021:1047:3011
306:4294967295:1000:1006:1013:1021:1047:3011
307:4294967295:1000:1006:1013:1021:1047:3011
308:4294967295:1000:1006:1013:1021:1047:3011
309:4294967295:1000:1006:1013:1021:1047:3011
310:4294967295:1000:1006:1013:1021:1047:3011
311:4294967295:1000:1006:1013:1021:1047:3011
312:4294967295:1000:1006:1013:1021:1047:3011
313:4294967295:1000:1006:1013:1021:1047:3011
314:4294967295:1000:1006:1013:1021:1047:3011
315:4294967295:1000:1006:1013:1021:1047:3011
316:4294967295:1000:1006:1013:1021:1047:3011
317:4294967295:1000:1006:1013:1021:1047:3011
318:4294967295:1000:1006:1013:1021:1047:3011
319:4294967295:1000:1006:1013:1021:1047:3011
320:4294967295:1000:1006:1013:1021:1047:3011
321:4294967295:1000:1006:1013:1021:1047:3011
322:4294967295:1000:1006:1013:1021:1047:3011
323:4294967295:1000:1006:1013:1021:1047:3011
324:4294967295:1000:1006:1013:1021:1047:3011
325:4294967295:1000:1006:1013:1021:1047:3011
326:4294967295:1000:1006:1013:1021:1047:3011
327:4294967295:1000:1006:1013:1021:1047:3011
328:4294967295:1000:1006:1013:1021:1047:3011
329:4294967295:1000:1006:1013:1021:1047:3011
330:4294967295:1000:1006:1013:1021:1047:3011
331:4294967295:1000:1006:1013:1021:1047:3011
332:4294967295:1000:1006:1013:1021:1047:3011
333:4294967295:1000:1006:1013:1021:1047:3011
334:4294967295:1000:1006:1013:1021:1047:3011
335:4294967295:1000:1006:1013:1021:1047:3011
336:4294967295:1000:1006:1013:1021:1047:3011
337:4294967295:1000:1006:1013:1021:1047:3011
338:4294967295:1000:1006:1013:1021:1047:3011
339:4294967295:1000:1006:1013:1021:1047:3011
340:4294967295:1000:1006:1013:1021:1047:3011
341:4294967295:1000:1006:1013:1021:1047:3011
342:4294967295:1000:1006:1013:1021:1047:3011
343:4294967295:1000:1006:1013:1021:1047:3011
344:4294967295:1000:1006:1013:1021:1047:3011
345:4294967295:1000:1006:1013:1021:1047:3011
346:4294967295:1000:1006:1013:1021:1047:3011
347:4294967295:1000:1006:1013:1021:1047:3011
348:4294967295:1000:1006:1013:1021:1047:3011
349:4294967295:1000:1006:1013:1021:1047:3011
350:4294967295:1000:1006:1013:1021:1047:3011
351:4294967295:1000:1006:1013:1021:1047:3011
352:4294967295:1000:1006:1013:1021:1047:3011
353:4294967295:1000:1006:1013:1021:1047:3011
354:4294967295:1000:1006:1013:1021:1047:3011
355:4294967295:1000:1006:1013:1021:1047:3011
356:4294967295:1000:1006:1013:1021:1047:3011
357:4294967295:1000:1006:1013:1021:1047:3011
358:4294967295:1000:1006:1013:1021:1047:3011
359:4294967295:1000:1006:1013:1021:1047:3011
360:4294967295:1000:1006:1013:1021:1047:3011
361:4294967295:1000:1006:1013:1021:1047:3011
362:4294967295:1000:1006:1013:1021:1047:3011
363:4294967295:1000:1006:1013:1021:1047:3011
364:4294967295:1000:1006:1013:1021:1047:3011
365:4294967295:1000:1006:1013:1021:1047:3011
366:4294967295:1000:1006:1013:1021:1047:3011
367:4294967295:1000:1006:1013:1021:1047:3011
368:4294967295:1000:1006:1013:1021:1047:3011
369:4294967295:1000:1006:1013:1021:1047:3011
370:4294967295:1000:1006:1013:1021:1047:3011
371:4294967295:1000:1006:1013:1021:1047:3011
372:4294967295:1000:1006:1013:1021:1047:3011
373:4294967295:1000:1006:1013:1021:1047:3011
374:4294967295:1000:1006:1013:1021:1047:3011
375:4294967295:1000:1006:1013:1021:1047:3011
376:4294967295:1000:1006:1013:1021:1047:3011
377:4294967295:1000:1006:1013:1021:1047:3011
378:4294967295:1000:1006:1013:1021:1047:3011
379:4294967295:1000:1006:1013:1021:1047:3011
380:4294967295:1000:1006:1013:1021:1047:3011
381:4294967295:1000:1006:1013:1021:1047:3011
382:4294967295:1000:1006:1013:1021:1047:3011
383:4294967295:1000:1006:1013:1021:1047:3011
384:4294967295:1000:1006:1013:1021:1047:3011
385:4294967295:1000:1006:1013:1021:1047:3011
386:4294967295:1000:1006:1013:1021:1047:3011
387:4294967295:1000:1006:1013:1021:1047:3011
388:4294967295:1000:1006:1013:1021:1047:3011
389:4294967295:1000:1006:1013:1021:1047:3011
390:4294967295:1000:1006:1013:1021:1047:3011
391:4294967295:1000:1006:1013:1021:1047:3011
392:4294967295:1000:1006:1013:1021:1047:3011
393:4294967295:1000:1006:1013:1021:1047:3011
394:4294967295:1000:1006:1013:1021:1047:3011
395:4294967295:1000:1006:1013:1021:1047:3011
396:4294967295:1000:1006:1013:1021:1047:3011
397:4294967295:1000:1006:1013:1021:1047:3011
398:4294967295:1000:1006:1013:1021:1047:3011
399:4294967295:1000:1006:1013:1021:1047:3011
400:4294967295:1000:1006:1013:1021:1047:3011
401:4294967295:1000:1006:1013:1021:1047:3011
402:4294967295:1000:1006:1013:1021:1047:3011
403:4294967295:1000:1006:1013:1021:1047:3011
404:4294967295:1000:1006:1013:1021:1047:3011
405:4294967295:1000:1006:1013:1021:1047:3011
406:4294967295:1000:1006:1013:1021:1047:3011
407:4294967295:1000:1006:1013:1021:1047:3011
408:4294967295:1000:1006:1013:1021:1047:3011
409:4294967295:1000:1006:1013:1021:1047:3011
410:4294967295:1000:1006:1013:1021:1047:3011
411:4294967295:1000:1006:1013:1021:1047:3011
412:4294967295:1000:1006:1013:1021:1047:3011
413:4294967295:1000:1006:1013:1021:1047:3011
414:4294967295:1000:1006:1013:1021:1047:3011
415:4294967295:1000:1006:1013:1021:1047:3011
416:4294967295:1000:1006:1013:1021:1047:3011
417:4294967295:1000:1006:1013:1021:1047:3011
418:4294967295:1000:1006:1013:1021:1047:3011
419:4294967295:1000:1006:1013:1021:1047:3011
420:4294967295:1000:1006:1013:1021:1047:3011
421:4294967295:1000:1006:1013:1021:1047:3011
422:4294967295:1000:1006:1013:1021:1047:3011
423:4294967295:1000:1006:1013:1021:1047:3011
424:4294967295:1000:1006:1013:1021:1047:3011
425:4294967295:1000:1006:1013:1021:1047:3011
426:4294967295:1000:1006:1013:1021:1047:3011
427:4294967295:1000:1006:1013:1021:1047:3011
428:4294967295:1000:1006:1013:1021:1047:3011
429:4294967295:1000:1006:1013:1021:1047:3011
430:4294967295:1000:1006:1013:1021:1047:3011
431:4294967295:1000:1006:1013:1021:1047:3011
432:4294967295:1000:1006:1013:1021:1047:3011
433:4294967295:1000:1006:1013:1021:1047:3011
434:4294967295:1000:1006:1013:1021:1047:3011
435:4294967295:1000:1006:1013:1021:1047:3011
436:4294967295:1000:1006:1013:1021:1047:3011
437:4294967295:1000:1006:1013:1021:1047:3011
438:4294967295:1000:1006:1013:1021:1047:3011
439:4294967295:1000:1006:1013:1021:1047:3011
440:4294967295:1000:1006:1013:1021:1047:3011
441:4294967295:1000:1006:1013:1021:1047:3011
442:4294967295:1000:1006:1013:1021:1047:3011
443:4294967295:1000:1006:1013:1021:1047:3011
444:4294967295:1000:1006:1013:1021:1047:3011
445:4294967295:1000:1006:1013:1021:1047:3011
446:4294967295:1000:1006:1013:1021:1047:3011
447:4294967295:1000:1006:1013:1021:1047:3011
448:4294967295:1000:1006:1013:1021:1047:3011
449:4294967295:1000:1006:1013:1021:1047:3011
450:4294967295:1000:1006:1013:1021:1047:3011
451:4294967295:1000:1006:1013:1021:1047:3011
452:4294967295:1000:1006:1013:1021:1047:3011
453:4294967295:1000:1006:1013:1021:1047:3011
454:4294967295:1000:1006:1013:1021:1047:3011
455:4294967295:1000:1006:1013:1021:1047:3011
456:4294967295:1000:1006:1013:1021:1047:3011
457:4294967295:1000:1006:1013:1021:1047:3011
458:4294967295:1000:1006:1013:1021:1047:3011
459:4294967295:1000:1006:1013:1021:1047:3011
460:4294967295:1000:1006:1013:1021:1047:3011
461:4294967295:1000:1006:1013:1021:1047:3011
462:4294967295:1000:1006:1013:1021:1047:3011
463:4294967295:1000:1006:1013:1021:1047:3011
464:4294967295:1000:1006:1013:1021:1047:3011
465:4294967295:1000:1006:1013:1021:1047:3011
466:4294967295:1000:1006:1013:1021:1047:3011
467:4294967295:1000:1006:1013:1021:1047:3011
468:4294967295:1000:1006:1013:1021:1047:3011
469:4294967295:1000:1006:1013:1021:1047:3011
470:4294967295:1000:1006:1013:1021:1047:3011
471:4294967295:1000:1006:1013:1021:1047:3011
472:4294967295:1000:1006:1013:1021:1047:3011
473:4294967295:1000:1006:1013:1021:1047:3011
474:4294967295:1000:1006:1013:1021:1047:3011
475:4294967295:1000:1006:1013:1021:1047:3011
476:4294967295:1000:1006:1013:1021:1047:3011
477:4294967295:1000:1006:1013:1021:1047:3011
478:4294967295:1000:1006:1013:1021:1047:3011
479:4294967295:1000:1006:1013:1021:1047:3011
480:4294967295:1000:1006:1013:1021:1047:3011
481:4294967295:1000:1006:1013:1021:1047:3011
482:4294967295:1000:1006:1013:1021:1047:3011
483:4294967295:1000:1006:1013:1021:1047:3011
484:4294967295:1000:1006:1013:1021:1047:3011
485:4294967295:1000:1006:1013:1021:1047:3011
486:4294967295:1000:1006:1013:1021:1047:3011
487:4294967295:1000:1006:1013:1021:1047:3011
488:4294967295:1000:1006:1013:1021:1047:3011
489:4294967295:1000:1006:1013:1021:1047:3011
490:4294967295:1000:1006:1013:1021:1047:3011
491:4294967295:1000:1006:1013:1021:1047:3011
492:4294967295:1000:1006:1013:1021:1047:3011
493:4294967295:1000:1006:1013:1021:1047:3011
494:4294967295:1000:1006:1013:1021:1047:3011
495:4294967295:1000:1006:1013:1021:1047:3011
496:4294967295:1000:1006:1013:1021:1047:3011
497:4294967295:1000:1006:1013:1021:1047:3011
498:4294967295:1000:1006:1013:1021:1047:3011
499:4294967295:1000:1006:1013:1021:1047:3011
500:4294967295:1000:1006:1013:1021:1047:3011
501:4294967295:1000:1006:1013:1021:1047:3011
502:4294967295:1000:1006:1013:1021:1047:3011
503:4294967295:1000:1006:1013:1021:1047:3011
504:4294967295:1000:1006:1013:1021:1047:3011
505:4294967295:1000:1006:1013:1021:1047:3011
506:4294967295:1000:1006:1013:1021:1047:3011
507:4294967295:1000:1006:1013:1021:1047:3011
508:4294967295:1000:1006:1013:1021:1047:3011
509:4294967295:1000:1006:1013:1021:1047:3011
510:4294967295:1000:1006:1013:1021:1047:3011
511:4294967295:1000:1006:1013:1021:1047:3011
/* Allow RCS service to aquire net_raw permission */
18:4294967295:1001:3004
/* Allow RCS service to communicate to IMS QMI Priv Svc*/
77:4294967295:1001:3003
/* Allow RCS service to access QMI-IMSS service */
18:4294967295:1001:3003
/* Allow SSGQMIGD to communicate to SSGCCS service*/
76:4294967295:1001
/* Allow cnd to accquire netbind */
18:4294967295:1000:3003
/* Allow QMID service to aquire net_raw permission */
3:4294967295:1001:1021:3004
2:4294967295:1000:1001:3004
42:4294967295:1001:3004
18:4294967295:1001:3004
9:4294967295:1001:3004
1:4294967295:1001:3004:1000
4:4294967295:1001:3004
7:4294967295:1001:3004
8:4294967295:1001:3004:1000
68:4294967295:1001:3004
/* DPM */
47:4294967295:1001:3004
/* Allow communication to some QMI services with radio privilages */
/* Format is <Service id>:<all instances>:<radio> */
/* PBM */
12:4294967295:1001
/* WMS */
5:4294967295:1001
/* IMS VT */
32:4294967295:1001
/* IMSP */
31:4294967295:1001
/* PDC */
36:4294967295:1001
/* SAR */
17:4294967295:1001
/* RFRPE */
41:4294967295:1001
/*UIM*/
11:4294967295:1001
/*CAT*/
10:4294967295:1001
/*IMSA*/
33:4294967295:1001
/* CSVT */
29:4294967295:1001
/*SERVREG_NOTIF*/
64:4294967295:1001
66:4294967295:1001
73:4294967295:1001
/*LTE*/
70:4294967295:1001
/* Allow Data dpmd to access QMI DFS */
48:4294967295:1000:3004
/* DIAG */
4097:4294967295:2002:2950:3009:2901
/* <WLFW QMI Service ID - 0x45>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
69:4294967295:1000
/* <WLPS QMI Service ID - 0x39>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
57:4294967295:1000

View File

@@ -1,5 +0,0 @@
sensors.ssc.so
sensors.elliptic.so
sensors.mius.proximity.so
sensors.touch.so
sensors.cepheus_udfps.so

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 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.
-->
<config>
<!-- Dolby -->
<install-in-user-type package="com.motorola.dolby.dolbyui">
<install-in user-type="FULL" />
<install-in user-type="PROFILE" />
<do-not-install-in user-type="android.os.usertype.profile.CLONE" />
</install-in-user-type>
</config>

View File

@@ -1,717 +0,0 @@
{
"Attributes": [
{
"Name": "LowCapacityCPUs",
"Controller": "cpuset",
"File": "background/cpus"
},
{
"Name": "HighCapacityCPUs",
"Controller": "cpuset",
"File": "foreground/cpus"
},
{
"Name": "MaxCapacityCPUs",
"Controller": "cpuset",
"File": "top-app/cpus"
},
{
"Name": "AudioAppCapacityCPUs",
"Controller": "cpuset",
"File": "audio-app/cpus"
},
{
"Name": "MemStats",
"Controller": "memory",
"File": "memory.stat"
},
{
"Name": "MemLimit",
"Controller": "memory",
"File": "memory.limit_in_bytes",
"FileV2": "memory.max"
},
{
"Name": "MemSoftLimit",
"Controller": "memory",
"File": "memory.soft_limit_in_bytes",
"FileV2": "memory.low"
},
{
"Name": "MemSwappiness",
"Controller": "memory",
"File": "memory.swappiness"
},
{
"Name": "MemUsage",
"Controller": "memory",
"File": "memory.usage_in_bytes"
},
{
"Name": "MemAndSwapUsage",
"Controller": "memory",
"File": "memory.memsw.usage_in_bytes"
},
{
"Name": "MemPressureLevel",
"Controller": "memory",
"File": "memory.pressure_level"
},
{
"Name": "MemCgroupEventControl",
"Controller": "memory",
"File": "cgroup.event_control"
},
{
"Name": "UClampMin",
"Controller": "cpu",
"File": "cpu.uclamp.min"
},
{
"Name": "UClampMax",
"Controller": "cpu",
"File": "cpu.uclamp.max"
},
{
"Name": "UClampLatencySensitive",
"Controller": "cpu",
"File": "cpu.uclamp.latency_sensitive"
}
],
"Profiles": [
{
"Name": "HighEnergySaving",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "background"
}
}
]
},
{
"Name": "NormalPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "system"
}
}
]
},
{
"Name": "ServicePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "system-background"
}
}
]
},
{
"Name": "HighPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "foreground"
}
}
]
},
{
"Name": "MaxPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "top-app"
}
}
]
},
{
"Name": "RealtimePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "rt"
}
}
]
},
{
"Name": "CameraServicePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "camera-daemon"
}
}
]
},
{
"Name": "AudioAppPerformance",
"Actions" : [
{
"Name" : "JoinCgroup",
"Params" :
{
"Controller": "schedtune",
"Path": "audio-app"
}
}
]
},
{
"Name": "NNApiHALPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "nnapi-hal"
}
}
]
},
{
"Name": "Dex2oatPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "dex2oat"
}
}
]
},
{
"Name": "CpuPolicySpread",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "UClampLatencySensitive",
"Value": "1"
}
}
]
},
{
"Name": "CpuPolicyPack",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "UClampLatencySensitive",
"Value": "0"
}
}
]
},
{
"Name": "VrKernelCapacity",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": ""
}
}
]
},
{
"Name": "VrServiceCapacityLow",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "system/background"
}
}
]
},
{
"Name": "VrServiceCapacityNormal",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "system"
}
}
]
},
{
"Name": "VrServiceCapacityHigh",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "system/performance"
}
}
]
},
{
"Name": "VrProcessCapacityLow",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "application/background"
}
}
]
},
{
"Name": "VrProcessCapacityNormal",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "application"
}
}
]
},
{
"Name": "VrProcessCapacityHigh",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "application/performance"
}
}
]
},
{
"Name": "ProcessCapacityLow",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "background"
}
}
]
},
{
"Name": "ProcessCapacityNormal",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": ""
}
}
]
},
{
"Name": "ProcessCapacityHigh",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "foreground"
}
}
]
},
{
"Name": "ProcessCapacityMax",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "top-app"
}
}
]
},
{
"Name": "ServiceCapacityLow",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "system-background"
}
}
]
},
{
"Name": "ServiceCapacityRestricted",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "restricted"
}
}
]
},
{
"Name": "CameraServiceCapacity",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "camera-daemon"
}
}
]
},
{
"Name": "AudioAppCapacity",
"Actions" : [
{
"Name" : "JoinCgroup",
"Params" :
{
"Controller": "cpuset",
"Path": "audio-app"
}
}
]
},
{
"Name": "BlkIOForeground",
"Actions" : [
{
"Name" : "JoinCgroup",
"Params" :
{
"Controller": "blkio",
"Path": ""
}
}
]
},
{
"Name": "BlkIOBackground",
"Actions" : [
{
"Name" : "JoinCgroup",
"Params" :
{
"Controller": "blkio",
"Path": "bg"
}
}
]
},
{
"Name": "LowIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": "background"
}
}
]
},
{
"Name": "NormalIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": ""
}
}
]
},
{
"Name": "HighIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": ""
}
}
]
},
{
"Name": "MaxIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": ""
}
}
]
},
{
"Name": "TimerSlackHigh",
"Actions": [
{
"Name": "SetTimerSlack",
"Params":
{
"Slack": "40000000"
}
}
]
},
{
"Name": "TimerSlackNormal",
"Actions": [
{
"Name": "SetTimerSlack",
"Params":
{
"Slack": "50000"
}
}
]
},
{
"Name": "SFMainPolicy",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "foreground"
}
}
]
},
{
"Name": "SFRenderEnginePolicy",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "foreground"
}
}
]
},
{
"Name": "PerfBoost",
"Actions": [
{
"Name": "SetClamps",
"Params":
{
"Boost": "50%",
"Clamp": "0"
}
}
]
},
{
"Name": "PerfClamp",
"Actions": [
{
"Name": "SetClamps",
"Params":
{
"Boost": "0",
"Clamp": "30%"
}
}
]
},
{
"Name": "LowMemoryUsage",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "MemSoftLimit",
"Value": "16MB"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "MemSwappiness",
"Value": "150"
}
}
]
},
{
"Name": "HighMemoryUsage",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "MemSoftLimit",
"Value": "512MB"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "MemSwappiness",
"Value": "100"
}
}
]
},
{
"Name": "SystemMemoryProcess",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "memory",
"Path": "system"
}
}
]
}
],
"AggregateProfiles": [
{
"Name": "SCHED_SP_DEFAULT",
"Profiles": [ "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_BACKGROUND",
"Profiles": [ "HighEnergySaving", "LowIoPriority", "TimerSlackHigh" ]
},
{
"Name": "SCHED_SP_FOREGROUND",
"Profiles": [ "HighPerformance", "HighIoPriority", "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_TOP_APP",
"Profiles": [ "MaxPerformance", "MaxIoPriority", "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_SYSTEM",
"Profiles": [ "ServicePerformance", "LowIoPriority", "TimerSlackNormal" ]
},
{
"Name": "VMCompilationPerformance",
"Profiles": [ "HighPerformance", "ProcessCapacityHigh", "LowIoPriority", "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_RT_APP",
"Profiles": [ "RealtimePerformance", "MaxIoPriority", "TimerSlackNormal" ]
},
{
"Name": "CPUSET_SP_DEFAULT",
"Profiles": [ "TimerSlackNormal" ]
},
{
"Name": "CPUSET_SP_BACKGROUND",
"Profiles": [ "HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", "TimerSlackHigh" ]
},
{
"Name": "CPUSET_SP_FOREGROUND",
"Profiles": [ "HighPerformance", "ProcessCapacityHigh", "HighIoPriority", "TimerSlackNormal" ]
},
{
"Name": "CPUSET_SP_TOP_APP",
"Profiles": [ "MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", "TimerSlackNormal" ]
},
{
"Name": "CPUSET_SP_SYSTEM",
"Profiles": [ "ServiceCapacityLow", "TimerSlackNormal" ]
},
{
"Name": "CPUSET_SP_RESTRICTED",
"Profiles": [ "ServiceCapacityRestricted", "TimerSlackNormal" ]
},
{
"Name": "Dex2OatBootComplete",
"Profiles": [ "Dex2oatPerformance", "LowIoPriority", "TimerSlackHigh" ]
},
{
"Name": "OtaProfiles",
"Profiles": [ "ServiceCapacityLow", "LowIoPriority", "HighEnergySaving" ]
}
]
}

View File

@@ -0,0 +1,191 @@
{
"Sensors":[
{
"Name":"cpu-0-0-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-0-1-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-0-2-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-0-3-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-1-0-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-1-1-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-1-2-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"cpu-1-3-usr",
"Type":"CPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"gpuss-0-usr",
"Type":"GPU",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
95.0,
"NAN",
"NAN",
125.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"battery",
"Type":"BATTERY",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
"NAN",
"NAN",
"NAN",
60.0
],
"VrThreshold":"NAN",
"Multiplier":0.001
},
{
"Name":"quiet_therm",
"Type":"SKIN",
"HotThreshold":[
"NAN",
"NAN",
"NAN",
"NAN",
"NAN",
"NAN",
"NAN"
],
"VrThreshold":"NAN",
"Multiplier":0.001
}
],
"CoolingDevices":[
{
"Name":"thermal-cpufreq-0",
"Type":"CPU"
},
{
"Name":"thermal-cpufreq-4",
"Type":"CPU"
},
{
"Name":"thermal-cpufreq-7",
"Type":"CPU"
},
{
"Name":"thermal-devfreq-0",
"Type":"GPU"
},
{
"Name":"battery",
"Type":"BATTERY"
}
]
}

View File

@@ -104,8 +104,12 @@ RoamRssiDiff=5
# To enable, set gRoamIntraBand=1 (Roaming within band)
# To disable, set gRoamIntraBand=0 (Roaming across band)
gRoamIntraBand=0
# Sets RSSI preference for 5GHz over 2.4GHz AP
gSelect5GHzMargin=5
# Prefer connecting to 5Ghz AP even if
# its RSSI is lower by 3dBm than the 2.4Ghz AP
gRoamPrefer5GHz=1
gSelect5GHzMargin=3
# Disable rx wakelock
rx_wakelock_timeout=0
@@ -277,10 +281,6 @@ gEnableMCCAdaptiveScheduler=1
#Enable or Disable p2p device address administered
isP2pDeviceAddrAdministrated=0
# Set Thermal Power limit
TxPower2g=10
TxPower5g=10
# Remove Overlap channel restriction
gEnableOverLapCh=0
@@ -465,7 +465,7 @@ maxMSDUsPerRxInd=8
# Enable NUD tracking feature
# 1 - enable 0 - disable(default) 3 - Driver will try to roam to a new AP but if roam fails, disconnect.
gEnableNUDTracking=0
gEnableNUDTracking=3
# Enable PEER UNMAP CONF SUPPORT
# 1 - enable 0 - disable(default)
@@ -494,6 +494,8 @@ adapt_dwell_lpf_weight=80
adapt_dwell_wifi_act_threshold=10
# Enable broadcast logging to the userspace entities
gMulticastHostFwMsgs=0
# Enable pkt log
# 1 - enable, 0 - disable
gEnablePacketLog=0
@@ -585,8 +587,6 @@ g_sta_sap_scc_on_lte_coex_chan=1
# enable/disable GCMP to fix throughput issue
gcmp_enabled=1
drop_bcn_on_chan_mismatch=0
# Enable/Disable rtt sta mac randomization
enable_rtt_mac_randomization=1
@@ -602,6 +602,9 @@ wlm_latency_enable=1
# WLM flags setting for ultralow level, bit9 for BMPS disabled
wlm_latency_flags_ultralow=0xe03
# Timer waiting for interface up from the upper layer
gInterfaceChangeWait=2000
#Enable ETSI SRD channels by Xiaomi. Qualcom default value is disable
etsi13_srd_chan_in_master_mode=1
@@ -609,7 +612,7 @@ etsi13_srd_chan_in_master_mode=1
gChannelBondingMode24GHz=0
# Allow STA+SAP SCC on DFS channel with master mode support disabled
g_sta_sap_scc_on_dfs_chan=2
g_sta_sap_scc_on_dfs_chan=1
# Enable wpa3 on 8150 device
sae_enabled=1
@@ -627,6 +630,9 @@ gEnableSARV1toSARV2=1
gStaPrefer80MHzOver160MHz=1
# Timer waiting for interface up from the upper layer
gInterfaceChangeWait=2000
# Reduce the expiry time for avoid list and black list in drv.
avoid_list_expiry_time=3
black_list_expiry_time=3
@@ -636,7 +642,6 @@ bad_bssid_counter_thresh=7
# Enable SoftAP on indoor channel, but Xiaomi's patch in driver only
# allow this when STA was connected on the same indoor channel.
gindoor_channel_support=1
END
# Note: Configuration parser would not read anything past the END marker

335
device.mk
View File

@@ -20,12 +20,6 @@ $(call inherit-product, hardware/qcom-caf/common/common.mk)
# Product launched with 9.0
$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk)
# Project ID Quota
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
# Installs gsi keys into ramdisk, to boot a developer GSI with verified boot.
$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
# Setup dalvik vm configs
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
@@ -40,6 +34,11 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
fs_config_files
# ANT+
PRODUCT_PACKAGES += \
AntHalService-Soong \
com.dsi.ant@1.0
# Audio
PRODUCT_PACKAGES += \
android.hardware.audio@7.0-impl \
@@ -62,15 +61,15 @@ PRODUCT_PACKAGES += \
libvolumelistener
PRODUCT_PACKAGES += \
libaudio-resampler \
libaudioroute.vendor
libaudio-resampler
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/audio/,$(TARGET_COPY_OUT_VENDOR)/etc) \
$(LOCAL_PATH)/configs/audio/dax-default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dolby/dax-default.xml
$(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
$(LOCAL_PATH)/configs/audio/bluetooth_hearing_aid_audio_policy_configuration.xml:/$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_hearing_aid_audio_policy_configuration.xml
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/a2dp_in_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration_7_0.xml \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:/$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml
@@ -87,16 +86,13 @@ PRODUCT_PACKAGES += \
# Bluetooth
PRODUCT_PACKAGES += \
vendor.qti.hardware.bluetooth_audio@2.0.vendor \
android.hardware.bluetooth@1.0.vendor \
vendor.qti.hardware.btconfigstore@1.0.vendor \
vendor.qti.hardware.btconfigstore@2.0.vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
frameworks/av/services/audiopolicy/config/a2dp_in_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml
# Boot animation
TARGET_SCREEN_HEIGHT := 2340
@@ -105,13 +101,13 @@ TARGET_SCREEN_WIDTH := 1080
# Camera
PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl \
android.hardware.camera.provider@2.4-service_64 \
libc29.vendor
android.hardware.camera.provider@2.4-service_64
PRODUCT_PACKAGES += \
libcamera2ndk_vendor \
libdng_sdk.vendor \
libgui_vendor \
libpiex \
libpng.vendor \
libstdc++_vendor \
vendor.qti.hardware.camera.device@1.0.vendor \
@@ -126,14 +122,16 @@ 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
# MiuiCamera
TARGET_CAMERA_PACKAGE_NAME := com.android.camera
$(call soong_config_set_bool,camera,override_format_from_reserved,true)
TARGET_USES_MIUI_CAMERA := true
$(call inherit-product-if-exists, vendor/xiaomi/miuicamera-cepheus/config.mk)
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/permissions/privapp-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-miuicamera.xml
prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-sp/libc++.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libc++.so
# Clone apps exemption
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/sysconfig/preinstalled-packages-platform-xiaomi-product.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/sysconfig/preinstalled-packages-platform-xiaomi-product.xml
# Device-specific settings
PRODUCT_PACKAGES += \
XiaomiParts
# Display
PRODUCT_PACKAGES += \
@@ -141,32 +139,35 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.graphics.composer@2.4-service \
vendor.qti.hardware.display.allocator-service \
vendor.qti.hardware.memtrack-service
PRODUCT_PACKAGES += \
android.hardware.graphics.mapper@3.0-impl-qti-display \
android.hardware.graphics.mapper@4.0-impl-qti-display
PRODUCT_PACKAGES += \
android.hardware.graphics.mapper@4.0-impl-qti-display \
gralloc.msmnile \
hwcomposer.msmnile \
libdisplayconfig.qti \
libdisplayconfig.system.qti \
libqdMetaData \
libqdMetaData.system \
libqdutils \
libtinyxml \
vendor.display.config@2.0 \
vendor.display.config@2.0.vendor \
vendor.qti.hardware.display.allocator-service \
vendor.qti.hardware.display.mapper@2.0.vendor \
vendor.qti.hardware.display.mapper@3.0.vendor \
vendor.qti.hardware.display.mapper@4.0.vendor \
vendor.qti.hardware.memtrack-service
PRODUCT_PACKAGES += \
vendor.display.config@2.0 \
vendor.display.config@2.0.vendor
PRODUCT_PACKAGES += \
gralloc.qcom \
hwcomposer.qcom \
vendor.qti.hardware.memtrack-service
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml
PRODUCT_PACKAGES += \
libtinyxml
# Dolby
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/dolby/dax-default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dolby/dax-default.xml \
$(LOCAL_PATH)/configs/media/media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_dolby_audio.xml
PRODUCT_COPY_FILES += \
prebuilts/vndk/v33/arm/arch-arm-armv7-a-neon/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib/libstagefright_foundation-v33.so \
prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libstagefright_foundation-v33.so
# DRM
PRODUCT_PACKAGES += \
@@ -174,17 +175,26 @@ PRODUCT_PACKAGES += \
android.hardware.drm@1.1.vendor \
android.hardware.drm@1.2.vendor \
android.hardware.drm@1.3.vendor \
android.hardware.drm-service.clearkey \
libcrypto-v33 \
libcrypto_shim.vendor
android.hardware.drm-service.clearkey
# Enable incremental FS feature
PRODUCT_PROPERTY_OVERRIDES += ro.incremental.enable=1
# Enable blurs, hidden under dev option
PRODUCT_PRODUCT_PROPERTIES += \
ro.launcher.blur.appLaunch=0 \
ro.surface_flinger.supports_background_blur=1 \
persist.sys.sf.disable_blurs=1 \
ro.sf.blurs_are_expensive=1
# Fastbootd
PRODUCT_PACKAGES += \
fastbootd
# Fastcharge
PRODUCT_PACKAGES += \
vendor.lineage.fastcharge@1.0-service.xiaomi_cepheus
# Fingerprint
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.3-service.cepheus \
@@ -200,21 +210,34 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/etc/fstab.qcom:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.qcom \
$(LOCAL_PATH)/rootdir/etc/fstab.qcom:$(TARGET_COPY_OUT_RAMDISK)/fstab.qcom
# FUSE passthrough
PRODUCT_PRODUCT_PROPERTIES += \
persist.sys.fuse.passthrough.enable=true
# Gatekeeper
PRODUCT_PACKAGES += \
android.hardware.gatekeeper@1.0.vendor
# GPS
LOC_HIDL_VERSION := 4.0
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
$(call inherit-product-if-exists, $(LOCAL_PATH)/gps/gps_vendor_product.mk)
PRODUCT_PACKAGES += \
android.hardware.gnss@2.1-impl-qti \
android.hardware.gnss@2.1-service-qti \
android.hardware.gnss@1.1.vendor \
android.hardware.gnss@2.1.vendor
PRODUCT_PACKAGES += \
libbatching \
libgeofencing \
libgnss \
libsensorndkbridge
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml
# Handheld hardware
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
# Health
PRODUCT_PACKAGES += \
android.hardware.health@2.1-impl \
@@ -230,22 +253,20 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/hotword-hiddenapi-package-allowlist.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysconfig/hotword-hiddenapi-package-allowlist.xml \
$(LOCAL_PATH)/configs/privapp-permissions-hotword.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-hotword.xml
# IFAA manager
PRODUCT_PACKAGES += \
IFAAService
# Init scripts
PRODUCT_COPY_FILES += \
$(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.recovery.qcom.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.qcom.rc \
$(LOCAL_PATH)/rootdir/etc/init.target.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.target.rc
$(LOCAL_PATH)/rootdir/etc/init.target.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.target.rc \
$(LOCAL_PATH)/rootdir/etc/init.xiaomi.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.xiaomi.rc
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/bin/init.qcom.post_boot.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.post_boot.sh \
$(LOCAL_PATH)/rootdir/bin/init.qcom.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.sh
PRODUCT_PACKAGES += \
init.power.rc
init.affinity.sh
# Input
PRODUCT_COPY_FILES += \
@@ -259,9 +280,9 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
# IRQ Balance
# IRSC
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/msm_irqbalance.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance.conf
$(LOCAL_PATH)/configs/security/sec_config:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config
# Keystore
PRODUCT_PACKAGES += \
@@ -269,7 +290,7 @@ PRODUCT_PACKAGES += \
# Lights
PRODUCT_PACKAGES += \
android.hardware.light-service.lineage
android.hardware.lights-service.cepheus
# Lineage Health
PRODUCT_PACKAGES += \
@@ -277,53 +298,40 @@ PRODUCT_PACKAGES += \
# LiveDisplay
PRODUCT_PACKAGES += \
vendor.lineage.livedisplay-service.sdm
$(call soong_config_set_bool,livedisplay_sdm,enable_dm,false)
# Logging
SPAMMY_LOG_TAGS := \
MiStcImpl \
SDM \
SDM-histogram \
SRE \
WifiHAL \
cnss-daemon \
libcitsensorservice@2.0-impl \
libsensor-displayalgo \
libsensor-parseRGB \
libsensor-ssccalapi \
sensors \
vendor.qti.hardware.display.composer-service \
vendor.xiaomi.sensor.citsensorservice@2.0-service
ifneq ($(TARGET_BUILD_VARIANT),eng)
PRODUCT_VENDOR_PROPERTIES += \
$(foreach tag,$(SPAMMY_LOG_TAGS),log.tag.$(tag)=E)
endif
vendor.lineage.livedisplay@2.0-service-sdm \
vendor.lineage.livedisplay@2.1-service.cepheus
# Media
PRODUCT_PACKAGES += \
libavservices_minijail \
libavservices_minijail.vendor \
libavservices_minijail_vendor \
libcodec2_hidl@1.0.vendor \
libcodec2_soft_common.vendor \
libcodec2_vndk.vendor \
libsfplugin_ccodec_utils.vendor \
libstagefright_foundation-v33 \
libOmxAacEnc \
libOmxAmrEnc \
libOmxCore \
libOmxEvrcEnc \
libOmxG711Enc \
libOmxQcelp13Enc \
libOmxVdec \
libOmxVenc \
libstagefrighthw \
vendor.qti.hardware.capabilityconfigstore@1.0.vendor
# Media
PRODUCT_PACKAGES += \
libcodec2_vndk.vendor \
libcodec2_hidl@1.0.vendor \
libavservices_minijail \
libavservices_minijail_32 \
libavservices_minijail.vendor \
libavservices_minijail_vendor
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
$(LOCAL_PATH)/configs/media/media_codecs_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_c2.xml \
$(LOCAL_PATH)/configs/media/media_codecs_performance_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_c2.xml \
$(LOCAL_PATH)/configs/media/media_profiles_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_vendor.xml
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/media/codec2.vendor.base.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/codec2.vendor.base.policy \
$(LOCAL_PATH)/configs/media/codec2.software.ext.policy:$(TARGET_COPY_OUT)/etc/seccomp_policy/codec2.software.ext.policy \
$(LOCAL_PATH)/configs/media/mediaextractor-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaextractor.policy
PRODUCT_COPY_FILES += \
hardware/qcom-caf/sm8150/media/conf_files/msmnile/codec2.vendor.ext.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/codec2.vendor.ext.policy \
@@ -332,10 +340,16 @@ PRODUCT_COPY_FILES += \
hardware/qcom-caf/sm8150/media/conf_files/msmnile/mediacodec-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
hardware/qcom-caf/sm8150/media/conf_files/msmnile/system_properties.xml:$(TARGET_COPY_OUT_VENDOR)/etc/system_properties.xml
# Mlipay
PRODUCT_PACKAGES += \
vendor.xiaomi.hardware.mlipay@1.1.vendor \
vendor.xiaomi.hardware.mtdservice@1.0.vendor
PRODUCT_COPY_FILES += \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml
# MiuiCamera
TARGET_CAMERA_PACKAGE_NAME := com.android.camera
TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED := true
TARGET_USES_MIUI_CAMERA := true
$(call inherit-product-if-exists, vendor/xiaomi/miuicamera-cepheus/config.mk)
# Network
PRODUCT_PACKAGES += \
@@ -346,8 +360,7 @@ PRODUCT_COPY_FILES += \
# Net
PRODUCT_PACKAGES += \
android.system.net.netd@1.1.vendor \
libnetutils.vendor
android.system.net.netd@1.1.vendor
# Neural Networks
PRODUCT_PACKAGES += \
@@ -357,6 +370,7 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.nfc@1.2-service \
android.hardware.secure_element@1.2.vendor \
NfcNci \
Tag
PRODUCT_PACKAGES += \
@@ -376,51 +390,52 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml
# Overlays
DEVICE_PACKAGE_OVERLAYS += \
$(LOCAL_PATH)/overlay \
$(LOCAL_PATH)/overlay-evolution
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += \
$(LOCAL_PATH)/overlay/frameworks/base/packages/overlays/NoCutoutOverlay
PRODUCT_ENFORCE_RRO_TARGETS := *
PRODUCT_PACKAGES += \
NoCutoutOverlay
# Parts
PRODUCT_PACKAGES += \
XiaomiDolby
# Partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_PACKAGES += \
vendor_bt_firmware_mountpoint \
vendor_dsp_mountpoint \
vendor_firmware_mnt_mountpoint
# Platform
TARGET_BOARD_PLATFORM := msmnile
ApertureOverlay \
BluetoothResCepheus \
CarrierConfigOverlay \
DialerConfigOverlay \
FrameworksResCepheus \
LineageSDKOverlay \
SettingsProviderOverlayCepheus \
SettingsResCepheus \
SimpleDeviceConfigResCepheus \
SystemUIResCepheus \
TelephonyResCommon \
TetheringConfigOverlay \
WifiOverlay
# Perf
PRODUCT_PACKAGES += \
libqti-perfd-client
# Partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/partitions/flash_super_dummy.sh:install/bin/flash_super_dummy.sh
# Power
PRODUCT_PACKAGES += \
android.hardware.power-service.lineage-libperfmgr
android.hardware.power-service.cepheus-libperfmgr \
android.hardware.power.stats@1.0-service.xiaomi
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/power-libperfmgr/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
# Product characteristics
PRODUCT_CHARACTERISTICS := nosdcard
# Protobuf
PRODUCT_PACKAGES += \
libprotobuf-cpp-full-3.9.1-vendorcompat \
libprotobuf-cpp-lite-3.9.1-vendorcompat
libprotobuf-cpp-full-3.9.1-vendorcompat
# QTI
PRODUCT_PACKAGES += \
libqti_vndfwk_detect.vendor \
libsqlite.vendor
libsqlite.vendor
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/permissions/qti_whitelist.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/sysconfig/qti_whitelist.xml \
@@ -437,10 +452,7 @@ PRODUCT_PACKAGES += \
android.hardware.radio@1.5.vendor \
android.hardware.radio.config@1.2.vendor \
android.hardware.radio.deprecated@1.0.vendor \
CarrierConfigOverlay \
libcurl.vendor \
libjson \
libjsoncpp.vendor \
libril \
librilutils \
librmnetctl \
@@ -451,24 +463,14 @@ PRODUCT_PACKAGES += \
libprotobuf-cpp-full-vendorcompat
# Screen density
PRODUCT_AAPT_CONFIG := normal
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
TARGET_SCREEN_DENSITY := 440
# Sensors
PRODUCT_PACKAGES += \
android.frameworks.sensorservice@1.0 \
android.frameworks.sensorservice@1.0.vendor \
android.hardware.sensors@1.0-impl-xiaomi \
android.hardware.sensors@1.0-impl \
android.hardware.sensors@1.0-service \
vendor.qti.hardware.display.mapper@1.1.vendor
PRODUCT_PACKAGES += \
sensors.cepheus_udfps
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
@@ -482,28 +484,16 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
SmoothCutoutOverlay
# Shims
# Shim
PRODUCT_PACKAGES += \
libpiex_shim \
libcrypto-v34
# Shipping API Level
PRODUCT_SHIPPING_API_LEVEL := 28
libwatermark_shim
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
bootable/deprecated-ota \
hardware/google/interfaces \
hardware/google/pixel \
hardware/lineage/interfaces/power-libperfmgr \
hardware/qcom-caf/common/libqti-perfd-client \
hardware/xiaomi \
# Task Profiles
PRODUCT_COPY_FILES += \
system/core/libprocessgroup/profiles/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json \
system/core/libprocessgroup/profiles/cgroups.json:$(TARGET_COPY_OUT_VENDOR)/etc/cgroups.json
hardware/xiaomi
# Telephony
PRODUCT_PACKAGES += \
@@ -514,12 +504,12 @@ PRODUCT_PACKAGES += \
ims-ext-common \
ims_ext_common.xml \
qti-telephony-hidl-wrapper \
qti-telephony-hidl-wrapper-prd \
qti_telephony_hidl_wrapper.xml \
qti-telephony-hidl-wrapper-prd \
qti_telephony_hidl_wrapper_prd.xml \
qti-telephony-utils \
qti-telephony-utils-prd \
qti_telephony_utils.xml \
qti-telephony-utils-prd \
qti_telephony_utils_prd.xml \
telephony-ext
@@ -532,6 +522,14 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml
# Thermal
PRODUCT_PACKAGES += \
android.hardware.thermal@2.0-service.cepheus \
thermal_logd
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/thermal/thermal_info_config.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json
# 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
@@ -540,9 +538,6 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/etc/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/etc/ueventd.rc
# Update
AB_OTA_UPDATER := false
# USB
PRODUCT_PACKAGES += \
android.hardware.usb@1.3-service.dual_role_usb
@@ -555,16 +550,6 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
vendor.qti.hardware.vibrator.service
# VNDK
PRODUCT_PACKAGES += \
libutilscallstack.vendor:64 \
libnetutils.vendor:64 \
libsqlite.vendor:64 \
libprocessgroup.vendor \
libjsoncpp.vendor \
libcurl.vendor \
libpng.vendor:32
# Vulkan
PRODUCT_PACKAGES += \
libvulkan
@@ -575,6 +560,11 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \
frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml
# VNDK
PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := strict
PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE := true
PRODUCT_PRODUCT_VNDK_VERSION := current
# WiFi
PRODUCT_PACKAGES += \
android.hardware.wifi-service \
@@ -584,8 +574,6 @@ PRODUCT_PACKAGES += \
libwifi-hal-ctrl \
libwifi-hal-qcom \
libwpa_client \
TetheringConfigOverlay \
WifiOverlay \
wpa_cli \
wpa_supplicant \
wpa_supplicant.conf
@@ -597,6 +585,7 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml \
frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \
frameworks/native/data/etc/android.hardware.wifi.rtt.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.rtt.xml \
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml
@@ -609,6 +598,16 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PACKAGES += \
wifi-mac-generator
# WiFi Display
PRODUCT_PACKAGES += \
android.media.audio.common.types-V2-cpp \
libnl \
libwfdaac_vendor \
vendor.qti.hardware.display.config-V5-ndk
PRODUCT_BOOT_JARS += \
WfdCommon
# WiFi firmware symlinks
PRODUCT_PACKAGES += \
firmware_wlan_mac.bin_symlink \

View File

@@ -5,15 +5,20 @@
},
{
"repository": "kernel_xiaomi_cepheus",
"target_path": "kernel/xiaomi/cepheus",
"branch": "bq1"
"target_path": "kernel/xiaomi/cepheus"
},
{
"repository": "hardware_xiaomi",
"target_path": "hardware/xiaomi"
},
{
"repository": "nhansp/android_vendor_xiaomi_miuicamera",
"repository": "crdroidandroid/android_prebuilts_clang_host_linux-x86_clang-r530567",
"target_path": "prebuilts/clang/host/linux-x86/clang-r530567",
"branch": "14.0",
"remote": "gitlab"
},
{
"repository": "chematelegram/android_vendor_xiaomi_miuicamera",
"target_path": "vendor/xiaomi/miuicamera-cepheus",
"branch": "leica-5.0-cepheus",
"remote": "gitlab"

View File

@@ -1,65 +0,0 @@
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.fixups_lib import (
lib_fixups,
lib_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
"device/xiaomi/cepheus",
"hardware/qcom-caf/sm8150",
"hardware/qcom-caf/wlan",
"hardware/xiaomi",
"vendor/qcom/opensource/dataservices",
"vendor/qcom/opensource/commonsys-intf/display",
"vendor/qcom/opensource/commonsys/display",
"vendor/qcom/opensource/display"
]
def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
return f'{lib}_{partition}' if partition == 'vendor' else None
lib_fixups: lib_fixups_user_type = {
**lib_fixups,
(
'vendor.qti.hardware.bluetooth_audio@2.0.so',
): lib_fixup_vendor_suffix,
}
blob_fixups: blob_fixups_user_type = {
'vendor/lib64/libwvhidl.so': blob_fixup()
.replace_needed('libcrypto.so', 'libcrypto-v34.so')
.add_needed('libcrypto_shim.so'),
'vendor/lib64/mediadrm/libwvdrmengine.so': blob_fixup()
.add_needed('libcrypto_shim.so'),
'vendor/lib64/camera/components/com.qti.node.watermark.so': blob_fixup()
.add_needed('libpiex_shim.so'),
'vendor/etc/init/init.batterysecret.rc': blob_fixup()
.regex_replace(' +seclabel u:r:batterysecret:s0\n', ''),
'vendor/lib/libaudioroute_ext.so': blob_fixup()
.replace_needed('libaudioroute.so', 'libaudioroute-v34.so'),
'vendor/lib/hw/audio.primary.msmnile.so': blob_fixup()
.replace_needed('libaudioroute.so', 'libaudioroute-v34.so'),
'vendor/lib64/hw/audio.primary.msmnile.so': blob_fixup()
.replace_needed('libaudioroute.so', 'libaudioroute-v34.so'),
} # fmt: skip
module = ExtractUtilsModule(
'cepheus',
'xiaomi',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()

95
extract-files.sh Executable file
View File

@@ -0,0 +1,95 @@
#!/bin/bash
#
# Copyright (C) 2018-2020 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.
#
set -e
DEVICE=cepheus
VENDOR=xiaomi
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT="${MY_DIR}"/../../..
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
while [ "${#}" -gt 0 ]; do
case "${1}" in
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
-k | --kang )
KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
esac
shift
done
if [ -z "${SRC}" ]; then
SRC="adb"
fi
function blob_fixup() {
case "${1}" in
system_ext/lib64/libwfdnative.so)
patchelf --remove-needed "android.hidl.base@1.0.so" "${2}"
;;
vendor/bin/mi_thermald)
sed -i 's/%d\/on/%d\/../g' "${2}"
;;
vendor/lib64/hw/camera.qcom.so)
patchelf --remove-needed "libMegviiFacepp-0.5.2.so" "${2}"
patchelf --remove-needed "libmegface.so" "${2}"
patchelf --add-needed "libshim_megvii.so" "${2}"
;;
vendor/lib64/camera/components/com.qti.node.watermark.so)
"${PATCHELF}" --add-needed "libwatermark_shim.so" "${2}"
;;
proprietary/vendor/bin/sensors.qti | proprietary/vendor/lib64/libsnsapi.so | proprietary/vendor/lib64/libsnsdiaglog.so | proprietary/vendor/lib64/libssc.so | proprietary/vendor/lib64/libwvhidl.so | proprietary/vendor/lib64/mediadrm/libwvdrmengine.so | proprietary/vendor/lib64/sensors.ssc.so )
"${PATCHELF}" --replace-needed "libprotobuf-cpp-lite-3.9.1.so" "libprotobuf-cpp-full-3.9.1.so" "${2}"
;;
vendor/lib/libstagefright_soft_ddpdec.so | vendor/lib/libstagefright_soft_ac4dec.so | \
vendor/lib/libstagefrightdolby.so | vendor/lib64/libstagefright_soft_ddpdec.so | \
vendor/lib64/libdlbdsservice.so | vendor/lib64/libstagefright_soft_ac4dec.so | vendor/lib64/libstagefrightdolby.so)
"${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}"
;;
esac
}
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
"${MY_DIR}/setup-makefiles.sh"

19
fastcharge/Android.bp Normal file
View File

@@ -0,0 +1,19 @@
cc_binary {
name: "vendor.lineage.fastcharge@1.0-service.xiaomi_cepheus",
relative_install_path: "hw",
init_rc: ["vendor.lineage.fastcharge@1.0-service.xiaomi_cepheus.rc"],
vintf_fragments: ["vendor.lineage.fastcharge@1.0-service.xiaomi_cepheus.xml"],
vendor: true,
shared_libs: [
"libbase",
"libbinder",
"libcutils",
"libhidlbase",
"libutils",
"vendor.lineage.fastcharge@1.0",
],
srcs: [
"FastCharge.cpp",
"service.cpp",
],
}

98
fastcharge/FastCharge.cpp Normal file
View File

@@ -0,0 +1,98 @@
/*
* Copyright (C) 2023 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.
*/
#define LOG_TAG "fastcharge@1.0-service.xiaomi_cepheus"
#define FASTCHARGE_DEFAULT_SETTING true
#define FASTCHARGE_PATH "/sys/class/qcom-battery/restrict_chg"
#include "FastCharge.h"
#include <android-base/logging.h>
#include <cutils/properties.h>
#include <fstream>
#include <iostream>
namespace vendor {
namespace lineage {
namespace fastcharge {
namespace V1_0 {
namespace implementation {
static constexpr const char *kFastChargingProp =
"persist.vendor.sec.fastchg_enabled";
/*
* Write value to path and close file.
*/
template <typename T> static void set(const std::string &path, const T &value) {
std::ofstream file(path);
if (!file) {
PLOG(ERROR) << "Failed to open: " << path;
return;
}
LOG(DEBUG) << "write: " << path << " value: " << value;
file << value << std::endl;
if (!file) {
PLOG(ERROR) << "Failed to write: " << path << " value: " << value;
}
}
template <typename T> static T get(const std::string &path, const T &def) {
std::ifstream file(path);
if (!file) {
PLOG(ERROR) << "Failed to open: " << path;
return def;
}
T result;
file >> result;
if (file.fail()) {
PLOG(ERROR) << "Failed to read: " << path;
return def;
} else {
LOG(DEBUG) << "read: " << path << " value: " << result;
return result;
}
}
FastCharge::FastCharge() {
setEnabled(property_get_bool(kFastChargingProp, FASTCHARGE_DEFAULT_SETTING));
}
Return<bool> FastCharge::isEnabled() { return get(FASTCHARGE_PATH, 0) < 1; }
Return<bool> FastCharge::setEnabled(bool enable) {
set(FASTCHARGE_PATH, enable ? 0 : 1);
bool enabled = isEnabled();
property_set(kFastChargingProp, enabled ? "true" : "false");
return enabled;
}
} // namespace implementation
} // namespace V1_0
} // namespace fastcharge
} // namespace lineage
} // namespace vendor

50
fastcharge/FastCharge.h Normal file
View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2023 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.
*/
#pragma once
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <vendor/lineage/fastcharge/1.0/IFastCharge.h>
namespace vendor {
namespace lineage {
namespace fastcharge {
namespace V1_0 {
namespace implementation {
using ::android::sp;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::vendor::lineage::fastcharge::V1_0::IFastCharge;
struct FastCharge : public IFastCharge {
FastCharge();
Return<bool> isEnabled() override;
Return<bool> setEnabled(bool enable) override;
};
} // namespace implementation
} // namespace V1_0
} // namespace fastcharge
} // namespace lineage
} // namespace vendor

50
fastcharge/service.cpp Normal file
View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2023 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.
*/
#define LOG_TAG "fastcharge@1.0-service.xiaomi_cepheus"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "FastCharge.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using vendor::lineage::fastcharge::V1_0::IFastCharge;
using vendor::lineage::fastcharge::V1_0::implementation::FastCharge;
using android::OK;
using android::status_t;
int main() {
android::sp<FastCharge> service = new FastCharge();
configureRpcThreadpool(1, true);
status_t status = service->registerAsService();
if (status != OK) {
LOG(ERROR) << "Cannot register FastCharge HAL service.";
return 1;
}
LOG(INFO) << "FastCharge HAL service ready.";
joinRpcThreadpool();
LOG(ERROR) << "FastCharge HAL service failed to join thread pool.";
return 1;
}

View File

@@ -0,0 +1,4 @@
service vendor.fastcharge-hal-1-0 /vendor/bin/hw/vendor.lineage.fastcharge@1.0-service.xiaomi_cepheus
class hal
user system
group system

View File

@@ -0,0 +1,11 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>vendor.lineage.fastcharge</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IFastCharge</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -115,8 +115,6 @@ BiometricsFingerprint::BiometricsFingerprint() : mClientCallback(nullptr), mDevi
}
mDevice->extCmd(mDevice, COMMAND_NIT, readBool(fd) ? PARAM_NIT_FOD : PARAM_NIT_NONE);
set(FOD_STATUS_PATH, readBool(fd) ? FOD_STATUS_ON : FOD_STATUS_OFF);
}
}).detach();
}
@@ -248,6 +246,7 @@ Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
onFingerUp();
return ErrorFilter(mDevice->post_enroll(mDevice));
}
@@ -256,8 +255,6 @@ Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
set(DIMLAYER_HBM_PATH, DIMLAYER_HBM_OFF);
return ErrorFilter(mDevice->cancel(mDevice));
}
@@ -399,19 +396,9 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) {
int32_t vendorCode = 0;
FingerprintAcquiredInfo result =
VendorAcquiredFilter(msg->data.acquired.acquired_info, &vendorCode);
ALOGD("onAcquired(result: %d, vendorCode: %d)", result, vendorCode);
// vendorCode 21 means waiting for fingerprint
// result 0 means fingerprint detected successfully
if (vendorCode == 21 || vendorCode == 22 || vendorCode == 23) {
set(FOD_STATUS_PATH, FOD_STATUS_ON);
} else if (static_cast<int32_t>(result) == 0 || static_cast<int32_t>(result) == 3 || vendorCode == 44 || vendorCode == 25) {
set(DIMLAYER_HBM_PATH, DIMLAYER_HBM_OFF);
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
}
if (result != FingerprintAcquiredInfo::ACQUIRED_VENDOR) {
if (!thisPtr->mClientCallback->onAcquired(devId, result, vendorCode).isOk()) {
ALOGE("failed to invoke fingerprint onAcquired callback");
}
ALOGD("onAcquired(%d)", result);
if (!thisPtr->mClientCallback->onAcquired(devId, result, vendorCode).isOk()) {
ALOGE("failed to invoke fingerprint onAcquired callback");
}
} break;
case FINGERPRINT_TEMPLATE_ENROLLING:
@@ -448,6 +435,7 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) {
.isOk()) {
ALOGE("failed to invoke fingerprint onAuthenticated callback");
}
getInstance()->onFingerUp();
} else {
// Not a recognized fingerprint
if (!thisPtr->mClientCallback

View File

@@ -2,9 +2,6 @@ service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.
class late_start
user system
group system input uhid
task_profiles ProcessCapacityHigh HighPerformance
priority -20
shutdown critical
on init
chmod 0666 /dev/goodix_fp
@@ -20,6 +17,8 @@ on boot
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_ui
chmod 0660 /sys/devices/virtual/touch/tp_dev/fod_status
write /sys/devices/virtual/touch/tp_dev/fod_status 1
chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq
chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq_enable
chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/wakeup_enable

View File

@@ -27,7 +27,6 @@ using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
// Generated HIDL files
using android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_3::implementation::BiometricsFingerprint;
using android::status_t;
@@ -56,17 +55,17 @@ fail:
}
int main() {
android::sp<IBiometricsFingerprint> service = BiometricsFingerprint::getInstance();
android::sp<BiometricsFingerprint> service = nullptr;
service = new BiometricsFingerprint();
if (service == nullptr) {
ALOGE("Instance of BiometricsFingerprint is null");
return 1;
}
android::hardware::setMinSchedulerPolicy(service, SCHED_RR, -20);
configureRpcThreadpool(1, true /*callerWillJoin*/);
status_t status = service->registerAsService();
status_t status = service->registerAsSystemService();
if (status != android::OK) {
ALOGE("Cannot register service for Fingerprint HAL(%d).", status);
return 1;

View File

@@ -1,4 +1,5 @@
GNSS_CFLAGS = [
"-Werror",
"-Wno-error=unused-parameter",
"-Wno-error=macro-redefined",
"-Wno-error=reorder",
@@ -9,12 +10,24 @@ GNSS_CFLAGS = [
"-Wno-error=null-arithmetic",
"-Wno-error=null-conversion",
"-Wno-error=parentheses-equality",
"-Wno-undefined-bool-conversion",
"-Wno-error=undefined-bool-conversion",
"-Wno-error=tautological-compare",
"-Wno-error=switch",
"-Wno-error=date-time",
]
/* Activate the following for regression testing */
GNSS_SANITIZE = {
/* address: true,*/
cfi: true,
misc_undefined: [
"bounds",
"null",
"unreachable",
"integer",
],
}
/* Activate the following for debug purposes only,
comment out for production */
GNSS_SANITIZE_DIAG = {

View File

@@ -2,6 +2,7 @@ ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
# Set required flags
GNSS_CFLAGS := \
-Werror \
-Wno-error=unused-parameter \
-Wno-error=macro-redefined \
-Wno-error=reorder \
@@ -12,29 +13,14 @@ GNSS_CFLAGS := \
-Wno-error=null-arithmetic \
-Wno-error=null-conversion \
-Wno-error=parentheses-equality \
-Wno-undefined-bool-conversion \
-Wno-error=undefined-bool-conversion \
-Wno-error=tautological-compare \
-Wno-error=switch \
-Wno-error=date-time
GNSS_HIDL_VERSION = 2.1
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8937
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845
GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660
ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM)))
GNSS_HIDL_LEGACY_MEASURMENTS = true
endif
LOCAL_PATH := $(call my-dir)
include $(call all-makefiles-under,$(LOCAL_PATH))
GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address
GNSS_SANITIZE := cfi bounds null unreachable integer
endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)

View File

@@ -1,10 +0,0 @@
# Makefile.am - Automake script for gps loc_api
#
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = gnss
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = loc-hal.pc
EXTRA_DIST = $(pkgconfig_DATA)

View File

@@ -1,203 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_AGnssInterface"
#include <log_util.h>
#include "Gnss.h"
#include "AGnss.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
static AGnss* spAGnss = nullptr;
AGnss::AGnss(Gnss* gnss) : mGnss(gnss) {
spAGnss = this;
}
AGnss::~AGnss() {
spAGnss = nullptr;
}
void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){
if (nullptr != spAGnss) {
spAGnss->statusIpV4Cb(status);
}
}
void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
IAGnssCallback::AGnssStatusIpV4 st = {};
switch (status.type) {
case LOC_AGPS_TYPE_SUPL:
st.type = IAGnssCallback::AGnssType::TYPE_SUPL;
break;
case LOC_AGPS_TYPE_C2K:
st.type = IAGnssCallback::AGnssType::TYPE_C2K;
break;
default:
LOC_LOGE("invalid type: %d", status.type);
return;
}
switch (status.status) {
case LOC_GPS_REQUEST_AGPS_DATA_CONN:
st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN;
break;
case LOC_GPS_RELEASE_AGPS_DATA_CONN:
st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN;
break;
case LOC_GPS_AGPS_DATA_CONNECTED:
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED;
break;
case LOC_GPS_AGPS_DATA_CONN_DONE:
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE;
break;
case LOC_GPS_AGPS_DATA_CONN_FAILED:
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED;
break;
default:
LOC_LOGE("invalid status: %d", status.status);
return;
}
st.ipV4Addr = status.ipV4Addr;
if (mAGnssCbIface != nullptr) {
auto r = mAGnssCbIface->agnssStatusIpV4Cb(st);
if (!r.isOk()) {
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
}
} else {
LOC_LOGw("setCallback has not been called yet");
}
}
Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return Void();
}
// Save the interface
mAGnssCbIface = callback;
AgpsCbInfo cbInfo = {};
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES;
mGnss->getGnssInterface()->agpsInit(cbInfo);
return Void();
}
Return<bool> AGnss::dataConnClosed() {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return false;
}
mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL);
return true;
}
Return<bool> AGnss::dataConnFailed() {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return false;
}
mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL);
return true;
}
Return<bool> AGnss::dataConnOpen(const hidl_string& apn,
IAGnss::ApnIpType apnIpType) {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return false;
}
/* Validate */
if(apn.empty()){
LOC_LOGE("Invalid APN");
return false;
}
LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str());
AGpsBearerType bearerType;
switch (apnIpType) {
case IAGnss::ApnIpType::IPV4:
bearerType = AGPS_APN_BEARER_IPV4;
break;
case IAGnss::ApnIpType::IPV6:
bearerType = AGPS_APN_BEARER_IPV6;
break;
case IAGnss::ApnIpType::IPV4V6:
bearerType = AGPS_APN_BEARER_IPV4V6;
break;
default:
bearerType = AGPS_APN_BEARER_IPV4;
break;
}
mGnss->getGnssInterface()->agpsDataConnOpen(
LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType);
return true;
}
Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
const hidl_string& hostname,
int32_t port) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
if (type == IAGnssCallback::AGnssType::TYPE_SUPL) {
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL;
} else if (type == IAGnssCallback::AGnssType::TYPE_C2K) {
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K;
} else {
LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast<int>(type));
return false;
}
config.assistanceServer.hostName = strdup(hostname.c_str());
config.assistanceServer.port = port;
return mGnss->updateConfiguration(config);
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,79 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
#include <android/hardware/gnss/1.0/IAGnss.h>
#include <hidl/Status.h>
#include <gps_extended_c.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IAGnss;
using ::android::hardware::gnss::V1_0::IAGnssCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
struct Gnss;
struct AGnss : public IAGnss {
AGnss(Gnss* gnss);
~AGnss();
/*
* Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow.
* These declarations were generated from IAGnss.hal.
*/
Return<void> setCallback(const sp<IAGnssCallback>& callback) override;
Return<bool> dataConnClosed() override;
Return<bool> dataConnFailed() override;
Return<bool> dataConnOpen(const hidl_string& apn,
IAGnss::ApnIpType apnIpType) override;
Return<bool> setServer(IAGnssCallback::AGnssType type,
const hidl_string& hostname, int32_t port) override;
void statusIpV4Cb(AGnssExtStatusIpV4 status);
/* Data call setup callback passed down to GNSS HAL implementation */
static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status);
private:
Gnss* mGnss = nullptr;
sp<IAGnssCallback> mAGnssCbIface = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H

View File

@@ -1,115 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc__AGnssRilInterface"
#include <log_util.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sstream>
#include <string>
#include "Gnss.h"
#include "AGnssRil.h"
#include <DataItemConcreteTypesBase.h>
typedef void* (getLocationInterface)();
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) {
ENTRY_LOG_CALLFLOW();
}
AGnssRil::~AGnssRil() {
ENTRY_LOG_CALLFLOW();
}
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
ENTRY_LOG_CALLFLOW();
// Extra NetworkTypes not available in IAgnssRil enums
const int NetworkType_BLUETOOTH = 7;
const int NetworkType_ETHERNET = 9;
const int NetworkType_PROXY = 16;
std::string apn("");
// for XTRA
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
switch(type)
{
case IAGnssRil::NetworkType::MOBILE:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
break;
case IAGnssRil::NetworkType::WIFI:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
break;
case IAGnssRil::NetworkType::MMS:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS;
break;
case IAGnssRil::NetworkType::SUPL:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL;
break;
case IAGnssRil::NetworkType::DUN:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN;
break;
case IAGnssRil::NetworkType::HIPRI:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI;
break;
case IAGnssRil::NetworkType::WIMAX:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
break;
default:
{
int networkType = (int) type;
// Handling network types not available in IAgnssRil
switch(networkType)
{
case NetworkType_BLUETOOTH:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
break;
case NetworkType_ETHERNET:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
break;
case NetworkType_PROXY:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
break;
default:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
}
}
break;
}
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout, false, 0, apn);
}
return true;
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,83 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
#include <android/hardware/gnss/1.0/IAGnssRil.h>
#include <hidl/Status.h>
#include <location_interface.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IAGnssRil;
using ::android::hardware::gnss::V1_0::IAGnssRilCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
struct Gnss;
/*
* Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface
* allows the GNSS chipset to request radio interface layer information from Android platform.
* Examples of such information are reference location, unique subscriber ID, phone number string
* and network availability changes. Also contains wrapper methods to allow methods from
* IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL.
*/
struct AGnssRil : public IAGnssRil {
AGnssRil(Gnss* gnss);
~AGnssRil();
/*
* Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
* These declarations were generated from IAGnssRil.hal.
*/
Return<void> setCallback(const sp<IAGnssRilCallback>& /*callback*/) override {
return Void();
}
Return<void> setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override {
return Void();
}
Return<bool> setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override {
return false;
}
Return<bool> updateNetworkAvailability(bool /*available*/,
const hidl_string& /*apn*/) override {
return false;
}
Return<bool> updateNetworkState(bool connected, NetworkType type, bool roaming) override;
private:
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_

View File

@@ -1,99 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
# activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
AGnss.cpp \
Gnss.cpp \
GnssBatching.cpp \
GnssGeofencing.cpp \
GnssMeasurement.cpp \
GnssNi.cpp \
GnssConfiguration.cpp \
GnssDebug.cpp \
AGnssRil.cpp
LOCAL_SRC_FILES += \
location_api/LocationUtil.cpp \
location_api/GnssAPIClient.cpp \
location_api/GeofenceAPIClient.cpp \
location_api/BatchingAPIClient.cpp \
location_api/MeasurementAPIClient.cpp \
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/location_api
LOCAL_HEADER_LIBRARIES := \
libgps.utils_headers \
libloc_core_headers \
libloc_pla_headers \
liblocation_api_headers \
liblocbatterylistener_headers
LOCAL_SHARED_LIBRARIES := \
liblog \
libhidlbase \
libcutils \
libutils \
android.hardware.gnss@1.0 \
android.hardware.health@1.0 \
android.hardware.health@2.0 \
android.hardware.power@1.2 \
libbase
LOCAL_SHARED_LIBRARIES += \
libloc_core \
libgps.utils \
libdl \
liblocation_api \
LOCAL_CFLAGS += $(GNSS_CFLAGS)
LOCAL_STATIC_LIBRARIES := liblocbatterylistener
LOCAL_STATIC_LIBRARIES += libhealthhalutils
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
# activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc
LOCAL_SRC_FILES := \
service.cpp \
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/location_api
LOCAL_HEADER_LIBRARIES := \
libgps.utils_headers \
libloc_core_headers \
libloc_pla_headers \
liblocation_api_headers
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libdl \
libbase \
libutils \
libgps.utils \
libqti_vndfwk_detect \
LOCAL_SHARED_LIBRARIES += \
libhidlbase \
android.hardware.gnss@1.0 \
LOCAL_CFLAGS += $(GNSS_CFLAGS)
ifneq ($(LOC_HIDL_VERSION),)
LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"'
endif
include $(BUILD_EXECUTABLE)

View File

@@ -1,346 +0,0 @@
/*
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssInterface"
#define LOG_NDEBUG 0
#include <fstream>
#include <log_util.h>
#include <dlfcn.h>
#include <cutils/properties.h>
#include "Gnss.h"
#include <LocationUtil.h>
#include "battery_listener.h"
#include "loc_misc_utils.h"
typedef const GnssInterface* (getLocationInterface)();
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
static sp<Gnss> sGnss;
void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnss != nullptr) {
mGnss->getGnssInterface()->resetNetworkInfo();
mGnss->stop();
mGnss->cleanup();
}
}
void location_on_battery_status_changed(bool charging) {
LOC_LOGd("battery status changed to %s charging", charging ? "" : "not ");
if (sGnss != nullptr) {
sGnss->getGnssInterface()->updateBatteryStatus(charging);
}
}
Gnss::Gnss() {
ENTRY_LOG_CALLFLOW();
sGnss = this;
// initilize gnss interface at first in case needing notify battery status
sGnss->getGnssInterface()->initialize();
// register health client to listen on battery change
loc_extn_battery_properties_listener_init(location_on_battery_status_changed);
// clear pending GnssConfig
memset(&mPendingConfig, 0, sizeof(GnssConfig));
mGnssDeathRecipient = new GnssDeathRecipient(this);
}
Gnss::~Gnss() {
ENTRY_LOG_CALLFLOW();
if (mApi != nullptr) {
mApi->destroy();
mApi = nullptr;
}
sGnss = nullptr;
}
GnssAPIClient* Gnss::getApi() {
if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) {
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);
if (mApi == nullptr) {
LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__);
return mApi;
}
if (mPendingConfig.size == sizeof(GnssConfig)) {
// we have pending GnssConfig
mApi->gnssConfigurationUpdate(mPendingConfig);
// clear size to invalid mPendingConfig
mPendingConfig.size = 0;
if (mPendingConfig.assistanceServer.hostName != nullptr) {
free((void*)mPendingConfig.assistanceServer.hostName);
}
}
}
if (mApi == nullptr) {
LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__);
}
return mApi;
}
const GnssInterface* Gnss::getGnssInterface() {
static bool getGnssInterfaceFailed = false;
if (nullptr == mGnssInterface && !getGnssInterfaceFailed) {
void * libHandle = nullptr;
getLocationInterface* getter = (getLocationInterface*)
dlGetSymFromLib(libHandle, "libgnss.so", "getGnssInterface");
if (nullptr == getter) {
getGnssInterfaceFailed = true;
} else {
mGnssInterface = (const GnssInterface*)(*getter)();
}
}
return mGnssInterface;
}
Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>& callback) {
ENTRY_LOG_CALLFLOW();
if (mGnssCbIface != nullptr) {
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
}
mGnssCbIface = callback;
if (mGnssCbIface != nullptr) {
mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
}
GnssAPIClient* api = getApi();
if (api != nullptr) {
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
api->requestCapabilities();
}
return true;
}
Return<bool> Gnss::setGnssNiCb(const sp<IGnssNiCallback>& callback) {
ENTRY_LOG_CALLFLOW();
mGnssNiCbIface = callback;
GnssAPIClient* api = getApi();
if (api != nullptr) {
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
}
return true;
}
Return<bool> Gnss::updateConfiguration(GnssConfig& gnssConfig) {
ENTRY_LOG_CALLFLOW();
GnssAPIClient* api = getApi();
if (api) {
api->gnssConfigurationUpdate(gnssConfig);
} else if (gnssConfig.flags != 0) {
// api is not ready yet, update mPendingConfig with gnssConfig
mPendingConfig.size = sizeof(GnssConfig);
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
mPendingConfig.gpsLock = gnssConfig.gpsLock;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
mPendingConfig.suplVersion = gnssConfig.suplVersion;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type;
if (mPendingConfig.assistanceServer.hostName != nullptr) {
free((void*)mPendingConfig.assistanceServer.hostName);
mPendingConfig.assistanceServer.hostName =
strdup(gnssConfig.assistanceServer.hostName);
}
mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
mPendingConfig.lppProfileMask = gnssConfig.lppProfileMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT;
mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT;
mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
mPendingConfig.suplModeMask = gnssConfig.suplModeMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds;
}
}
return true;
}
Return<bool> Gnss::start() {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
retVal = api->gnssStart();
}
return retVal;
}
Return<bool> Gnss::stop() {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
retVal = api->gnssStop();
}
return retVal;
}
Return<void> Gnss::cleanup() {
ENTRY_LOG_CALLFLOW();
if (mApi != nullptr) {
mApi->gnssDisable();
}
return Void();
}
Return<bool> Gnss::injectLocation(double latitudeDegrees,
double longitudeDegrees,
float accuracyMeters) {
ENTRY_LOG_CALLFLOW();
const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters);
return true;
} else {
return false;
}
}
Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
int32_t uncertaintyMs) {
return true;
}
Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) {
ENTRY_LOG_CALLFLOW();
GnssAPIClient* api = getApi();
if (api) {
api->gnssDeleteAidingData(aidingDataFlags);
}
return Void();
}
Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs) {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
preferredAccuracyMeters, preferredTimeMs);
}
return retVal;
}
Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() {
ENTRY_LOG_CALLFLOW();
mAGnssIface = new AGnss(this);
return mAGnssIface;
}
Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() {
ENTRY_LOG_CALLFLOW();
mGnssNi = new GnssNi(this);
return mGnssNi;
}
Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
ENTRY_LOG_CALLFLOW();
if (mGnssMeasurement == nullptr)
mGnssMeasurement = new GnssMeasurement();
return mGnssMeasurement;
}
Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
ENTRY_LOG_CALLFLOW();
mGnssConfig = new GnssConfiguration(this);
return mGnssConfig;
}
Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
ENTRY_LOG_CALLFLOW();
mGnssGeofencingIface = new GnssGeofencing();
return mGnssGeofencingIface;
}
Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() {
mGnssBatching = new GnssBatching();
return mGnssBatching;
}
Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() {
ENTRY_LOG_CALLFLOW();
mGnssDebug = new GnssDebug(this);
return mGnssDebug;
}
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
mGnssRil = new AGnssRil(this);
return mGnssRil;
}
IGnss* HIDL_FETCH_IGnss(const char* hal) {
ENTRY_LOG_CALLFLOW();
IGnss* iface = nullptr;
iface = new Gnss();
if (iface == nullptr) {
LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal);
}
return iface;
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,143 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
#include <AGnss.h>
#include <AGnssRil.h>
#include <GnssBatching.h>
#include <GnssConfiguration.h>
#include <GnssGeofencing.h>
#include <GnssMeasurement.h>
#include <GnssNi.h>
#include <GnssDebug.h>
#include <android/hardware/gnss/1.0/IGnss.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <GnssAPIClient.h>
#include <location_interface.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
using ::android::hardware::gnss::V1_0::GnssLocation;
struct Gnss : public IGnss {
Gnss();
~Gnss();
/*
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
* These declarations were generated from Gnss.hal.
*/
Return<bool> setCallback(const sp<V1_0::IGnssCallback>& callback) override;
Return<bool> start() override;
Return<bool> stop() override;
Return<void> cleanup() override;
Return<bool> injectLocation(double latitudeDegrees,
double longitudeDegrees,
float accuracyMeters) override;
Return<bool> injectTime(int64_t timeMs,
int64_t timeReferenceMs,
int32_t uncertaintyMs) override;
Return<void> deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
Return<bool> setPositionMode(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs) override;
Return<sp<V1_0::IAGnss>> getExtensionAGnss() override;
Return<sp<V1_0::IGnssNi>> getExtensionGnssNi() override;
Return<sp<V1_0::IGnssMeasurement>> getExtensionGnssMeasurement() override;
Return<sp<V1_0::IGnssConfiguration>> getExtensionGnssConfiguration() override;
Return<sp<V1_0::IGnssGeofencing>> getExtensionGnssGeofencing() override;
Return<sp<V1_0::IGnssBatching>> getExtensionGnssBatching() override;
Return<sp<V1_0::IAGnssRil>> getExtensionAGnssRil() override;
inline Return<sp<V1_0::IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override {
return nullptr;
}
inline Return<sp<V1_0::IGnssXtra>> getExtensionXtra() override {
return nullptr;
}
Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
// These methods are not part of the IGnss base class.
GnssAPIClient* getApi();
Return<bool> setGnssNiCb(const sp<IGnssNiCallback>& niCb);
Return<bool> updateConfiguration(GnssConfig& gnssConfig);
const GnssInterface* getGnssInterface();
// Callback for ODCPI request
void odcpiRequestCb(const OdcpiRequestInfo& request);
private:
struct GnssDeathRecipient : hidl_death_recipient {
GnssDeathRecipient(sp<Gnss> gnss) : mGnss(gnss) {
}
~GnssDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<Gnss> mGnss;
};
private:
sp<GnssDeathRecipient> mGnssDeathRecipient = nullptr;
sp<AGnss> mAGnssIface = nullptr;
sp<GnssNi> mGnssNi = nullptr;
sp<GnssMeasurement> mGnssMeasurement = nullptr;
sp<GnssConfiguration> mGnssConfig = nullptr;
sp<GnssGeofencing> mGnssGeofencingIface = nullptr;
sp<GnssBatching> mGnssBatching = nullptr;
sp<IGnssDebug> mGnssDebug = nullptr;
sp<AGnssRil> mGnssRil = nullptr;
GnssAPIClient* mApi = nullptr;
sp<V1_0::IGnssCallback> mGnssCbIface = nullptr;
sp<V1_0::IGnssNiCallback> mGnssNiCbIface = nullptr;
GnssConfig mPendingConfig;
const GnssInterface* mGnssInterface = nullptr;
};
extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H

View File

@@ -1,130 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssBatchingInterface"
#include <log_util.h>
#include <BatchingAPIClient.h>
#include "GnssBatching.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnssBatching != nullptr) {
mGnssBatching->stop();
mGnssBatching->cleanup();
}
}
GnssBatching::GnssBatching() : mApi(nullptr) {
mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this);
}
GnssBatching::~GnssBatching() {
if (mApi != nullptr) {
mApi->destroy();
mApi = nullptr;
}
}
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
if (mApi != nullptr) {
LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__);
mApi->destroy();
mApi = nullptr;
}
mApi = new BatchingAPIClient(callback);
if (mApi == nullptr) {
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
return false;
}
if (mGnssBatchingCbIface != nullptr) {
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
}
mGnssBatchingCbIface = callback;
if (mGnssBatchingCbIface != nullptr) {
mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/);
}
return true;
}
Return<uint16_t> GnssBatching::getBatchSize() {
uint16_t ret = 0;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
ret = mApi->getBatchSize();
}
return ret;
}
Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
bool ret = false;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
ret = mApi->startSession(options);
}
return ret;
}
Return<void> GnssBatching::flush() {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->flushBatchedLocations();
}
return Void();
}
Return<bool> GnssBatching::stop() {
bool ret = false;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
ret = mApi->stopSession();
}
return ret;
}
Return<void> GnssBatching::cleanup() {
if (mGnssBatchingCbIface != nullptr) {
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
}
return Void();
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,80 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
#include <android/hardware/gnss/1.0/IGnssBatching.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssBatching;
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
using ::android::hidl::base::V1_0::IBase;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
class BatchingAPIClient;
struct GnssBatching : public IGnssBatching {
GnssBatching();
~GnssBatching();
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
Return<uint16_t> getBatchSize() override;
Return<bool> start(const IGnssBatching::Options& options ) override;
Return<void> flush() override;
Return<bool> stop() override;
Return<void> cleanup() override;
private:
struct GnssBatchingDeathRecipient : hidl_death_recipient {
GnssBatchingDeathRecipient(sp<GnssBatching> gnssBatching) :
mGnssBatching(gnssBatching) {
}
~GnssBatchingDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssBatching> mGnssBatching;
};
private:
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
BatchingAPIClient* mApi = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H

View File

@@ -1,225 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssConfigurationInterface"
#include <log_util.h>
#include "Gnss.h"
#include "GnssConfiguration.h"
#include <android/hardware/gnss/1.0/types.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::GnssConstellationType;
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
}
// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow.
Return<bool> GnssConfiguration::setSuplEs(bool enabled) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
config.suplEmergencyServices = (enabled ?
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES :
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO);
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setSuplVersion(uint32_t version) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
switch (version) {
case 0x00020004:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4;
break;
case 0x00020002:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2;
break;
case 0x00020000:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0;
break;
case 0x00010000:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0;
break;
default:
LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version);
return false;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setSuplMode(uint8_t mode) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
switch (mode) {
case 0:
config.suplModeMask = 0; // STANDALONE ONLY
break;
case 1:
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT;
break;
case 2:
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT;
break;
case 3:
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT;
break;
default:
LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode);
return false;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setLppProfile(uint8_t lppProfileMask) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config = {};
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
config.lppProfileMask = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; //default
if (lppProfileMask & (1<<0)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_BIT;
}
if (lppProfileMask & (1<<1)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_BIT;
}
if (lppProfileMask & (1<<2)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_OVER_NR5G_SA_BIT;
}
if (lppProfileMask & (1<<3)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_OVER_NR5G_SA_BIT;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
if (protocol & (1<<0)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT;
}
if (protocol & (1<<1)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT;
}
if (protocol & (1<<2)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT;
}
if (protocol & (1<<3)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setGpsLock(uint8_t lock) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
switch (lock) {
case 0:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
break;
case 1:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO;
break;
case 2:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI;
break;
case 3:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
break;
default:
LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock);
return false;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
config.emergencyPdnForEmergencySupl = (enabled ?
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES :
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO);
return mGnss->updateConfiguration(config);
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,71 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
#include <android/hardware/gnss/1.0/IGnssConfiguration.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssConfiguration;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
/*
* Interface for passing GNSS configuration info from platform to HAL.
*/
struct Gnss;
struct GnssConfiguration : public IGnssConfiguration {
GnssConfiguration(Gnss* gnss);
~GnssConfiguration() = default;
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow.
* These declarations were generated from IGnssConfiguration.hal.
*/
Return<bool> setSuplVersion(uint32_t version) override;
Return<bool> setSuplMode(uint8_t mode) override;
Return<bool> setSuplEs(bool enabled) override;
Return<bool> setLppProfile(uint8_t lppProfileMask) override;
Return<bool> setGlonassPositioningProtocol(uint8_t protocol) override;
Return<bool> setEmergencySuplPdn(bool enable) override;
Return<bool> setGpsLock(uint8_t lock) override;
private:
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H

View File

@@ -1,173 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssDebugInterface"
#include <log/log.h>
#include <log_util.h>
#include "Gnss.h"
#include "GnssDebug.h"
#include "LocationUtil.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::hidl_vec;
#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000)
#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000)
#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500)
#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180)
#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns
#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
{
}
/*
* This methods requests position, time and satellite ephemeris debug information
* from the HAL.
*
* @return void
*/
Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
{
LOC_LOGD("%s]: ", __func__);
DebugData data = { };
if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){
LOC_LOGE("GnssDebug - Null GNSS interface");
_hidl_cb(data);
return Void();
}
// get debug report snapshot via hal interface
GnssDebugReport reports = { };
mGnss->getGnssInterface()->getDebugReport(reports);
// location block
if (reports.mLocation.mValid) {
data.position.valid = true;
data.position.latitudeDegrees = reports.mLocation.mLocation.latitude;
data.position.longitudeDegrees = reports.mLocation.mLocation.longitude;
data.position.altitudeMeters = reports.mLocation.mLocation.altitude;
data.position.speedMetersPerSec =
(double)(reports.mLocation.mLocation.speed);
data.position.bearingDegrees =
(double)(reports.mLocation.mLocation.bearing);
data.position.horizontalAccuracyMeters =
(double)(reports.mLocation.mLocation.accuracy);
data.position.verticalAccuracyMeters =
reports.mLocation.verticalAccuracyMeters;
data.position.speedAccuracyMetersPerSecond =
reports.mLocation.speedAccuracyMetersPerSecond;
data.position.bearingAccuracyDegrees =
reports.mLocation.bearingAccuracyDegrees;
timeval tv_now, tv_report;
tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec;
tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL;
gettimeofday(&tv_now, NULL);
data.position.ageSeconds =
(tv_now.tv_sec - tv_report.tv_sec) +
(float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000;
}
else {
data.position.valid = false;
}
if (data.position.horizontalAccuracyMeters <= 0 ||
data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) {
data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS;
}
if (data.position.verticalAccuracyMeters <= 0 ||
data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) {
data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS;
}
if (data.position.speedAccuracyMetersPerSecond <= 0 ||
data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) {
data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC;
}
if (data.position.bearingAccuracyDegrees <= 0 ||
data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) {
data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG;
}
// time block
if (reports.mTime.mValid) {
data.time.timeEstimate = reports.mTime.timeEstimate;
data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs;
data.time.frequencyUncertaintyNsPerSec =
reports.mTime.frequencyUncertaintyNsPerSec;
}
if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
}
if (data.time.timeUncertaintyNs <= 0 ||
data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) {
data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC;
}
if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {
data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC;
}
// satellite data block
SatelliteData s = { };
std::vector<SatelliteData> s_array = { };
for (uint32_t i=0; i<reports.mSatelliteInfo.size(); i++) {
memset(&s, 0, sizeof(s));
s.svid = reports.mSatelliteInfo[i].svid;
convertGnssConstellationType(
reports.mSatelliteInfo[i].constellation, s.constellation);
convertGnssEphemerisType(
reports.mSatelliteInfo[i].mEphemerisType, s.ephemerisType);
convertGnssEphemerisSource(
reports.mSatelliteInfo[i].mEphemerisSource, s.ephemerisSource);
convertGnssEphemerisHealth(
reports.mSatelliteInfo[i].mEphemerisHealth, s.ephemerisHealth);
s.ephemerisAgeSeconds =
reports.mSatelliteInfo[i].ephemerisAgeSeconds;
s.serverPredictionIsAvailable =
reports.mSatelliteInfo[i].serverPredictionIsAvailable;
s.serverPredictionAgeSeconds =
reports.mSatelliteInfo[i].serverPredictionAgeSeconds;
s_array.push_back(s);
}
data.satelliteDataArray = s_array;
// callback HIDL with collected debug data
_hidl_cb(data);
return Void();
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,59 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
#include <android/hardware/gnss/1.0/IGnssDebug.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssDebug;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
/* Interface for GNSS Debug support. */
struct Gnss;
struct GnssDebug : public IGnssDebug {
GnssDebug(Gnss* gnss);
~GnssDebug() {};
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
* These declarations were generated from IGnssDebug.hal.
*/
Return<void> getDebugData(getDebugData_cb _hidl_cb) override;
private:
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H

View File

@@ -1,141 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "GnssHal_GnssGeofencing"
#include <log_util.h>
#include <GeofenceAPIClient.h>
#include "GnssGeofencing.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnssGeofencing != nullptr) {
mGnssGeofencing->removeAllGeofences();
}
}
GnssGeofencing::GnssGeofencing() : mApi(nullptr) {
mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this);
}
GnssGeofencing::~GnssGeofencing() {
if (mApi != nullptr) {
mApi->destroy();
mApi = nullptr;
}
}
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
if (mApi != nullptr) {
LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__);
return Void();
}
mApi = new GeofenceAPIClient(callback);
if (mApi == nullptr) {
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
}
if (mGnssGeofencingCbIface != nullptr) {
mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient);
}
mGnssGeofencingCbIface = callback;
if (mGnssGeofencingCbIface != nullptr) {
mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/);
}
return Void();
}
Return<void> GnssGeofencing::addGeofence(
int32_t geofenceId,
double latitudeDegrees,
double longitudeDegrees,
double radiusMeters,
IGnssGeofenceCallback::GeofenceTransition lastTransition,
int32_t monitorTransitions,
uint32_t notificationResponsivenessMs,
uint32_t unknownTimerMs) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofenceAdd(
geofenceId,
latitudeDegrees,
longitudeDegrees,
radiusMeters,
static_cast<int32_t>(lastTransition),
monitorTransitions,
notificationResponsivenessMs,
unknownTimerMs);
}
return Void();
}
Return<void> GnssGeofencing::pauseGeofence(int32_t geofenceId) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofencePause(geofenceId);
}
return Void();
}
Return<void> GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofenceResume(geofenceId, monitorTransitions);
}
return Void();
}
Return<void> GnssGeofencing::removeGeofence(int32_t geofenceId) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofenceRemove(geofenceId);
}
return Void();
}
Return<void> GnssGeofencing::removeAllGeofences() {
if (mApi == nullptr) {
LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__);
} else {
mApi->geofenceRemoveAll();
}
return Void();
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,91 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
using ::android::hardware::gnss::V1_0::IGnssGeofencing;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
class GeofenceAPIClient;
struct GnssGeofencing : public IGnssGeofencing {
GnssGeofencing();
~GnssGeofencing();
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
* These declarations were generated from IGnssGeofencing.hal.
*/
Return<void> setCallback(const sp<IGnssGeofenceCallback>& callback) override;
Return<void> addGeofence(int32_t geofenceId,
double latitudeDegrees,
double longitudeDegrees,
double radiusMeters,
IGnssGeofenceCallback::GeofenceTransition lastTransition,
int32_t monitorTransitions,
uint32_t notificationResponsivenessMs,
uint32_t unknownTimerMs) override;
Return<void> pauseGeofence(int32_t geofenceId) override;
Return<void> resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override;
Return<void> removeGeofence(int32_t geofenceId) override;
private:
// This method is not part of the IGnss base class.
// It is called by GnssGeofencingDeathRecipient to remove all geofences added so far.
Return<void> removeAllGeofences();
private:
struct GnssGeofencingDeathRecipient : hidl_death_recipient {
GnssGeofencingDeathRecipient(sp<GnssGeofencing> gnssGeofencing) :
mGnssGeofencing(gnssGeofencing) {
}
~GnssGeofencingDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssGeofencing> mGnssGeofencing;
};
private:
sp<GnssGeofencingDeathRecipient> mGnssGeofencingDeathRecipient = nullptr;
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface = nullptr;
GeofenceAPIClient* mApi = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H

View File

@@ -1,101 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
#include <log_util.h>
#include <MeasurementAPIClient.h>
#include "GnssMeasurement.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnssMeasurement != nullptr) {
mGnssMeasurement->close();
}
}
GnssMeasurement::GnssMeasurement() {
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this);
mApi = new MeasurementAPIClient();
}
GnssMeasurement::~GnssMeasurement() {
if (mApi) {
mApi->destroy();
mApi = nullptr;
}
}
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
const sp<V1_0::IGnssMeasurementCallback>& callback) {
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
if (mGnssMeasurementCbIface != nullptr) {
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
}
if (callback == nullptr) {
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
return ret;
}
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
return ret;
}
mGnssMeasurementCbIface = callback;
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
return mApi->measurementSetCallback(callback);
}
Return<void> GnssMeasurement::close() {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
return Void();
}
if (mGnssMeasurementCbIface != nullptr) {
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
mGnssMeasurementCbIface = nullptr;
}
mApi->measurementClose();
return Void();
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,77 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
class MeasurementAPIClient;
struct GnssMeasurement : public IGnssMeasurement {
GnssMeasurement();
~GnssMeasurement();
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
* These declarations were generated from IGnssMeasurement.hal.
*/
Return<GnssMeasurement::GnssMeasurementStatus> setCallback(
const sp<V1_0::IGnssMeasurementCallback>& callback) override;
Return<void> close() override;
private:
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
GnssMeasurementDeathRecipient(sp<GnssMeasurement> gnssMeasurement) :
mGnssMeasurement(gnssMeasurement) {
}
~GnssMeasurementDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssMeasurement> mGnssMeasurement;
};
private:
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
MeasurementAPIClient* mApi;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H

View File

@@ -1,85 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssNiInterface"
#include <log_util.h>
#include "Gnss.h"
#include "GnssNi.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
// we do nothing here
// Gnss::GnssDeathRecipient will stop the session
}
GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) {
mGnssNiDeathRecipient = new GnssNiDeathRecipient(this);
}
// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
Return<void> GnssNi::setCallback(const sp<IGnssNiCallback>& callback) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return Void();
}
mGnss->setGnssNiCb(callback);
if (mGnssNiCbIface != nullptr) {
mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient);
}
mGnssNiCbIface = callback;
if (mGnssNiCbIface != nullptr) {
mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/);
}
return Void();
}
Return<void> GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return Void();
}
GnssAPIClient* api = mGnss->getApi();
if (api == nullptr) {
LOC_LOGE("%s]: api is nullptr", __FUNCTION__);
return Void();
}
api->gnssNiRespond(notifId, userResponse);
return Void();
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,75 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
#include <android/hardware/gnss/1.0/IGnssNi.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssNi;
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
struct Gnss;
struct GnssNi : public IGnssNi {
GnssNi(Gnss* gnss);
~GnssNi() = default;
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
* These declarations were generated from IGnssNi.hal.
*/
Return<void> setCallback(const sp<IGnssNiCallback>& callback) override;
Return<void> respond(int32_t notifId,
IGnssNiCallback::GnssUserResponseType userResponse) override;
private:
struct GnssNiDeathRecipient : hidl_death_recipient {
GnssNiDeathRecipient(sp<GnssNi> gnssNi) : mGnssNi(gnssNi) {
}
~GnssNiDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssNi> mGnssNi;
};
private:
sp<GnssNiDeathRecipient> mGnssNiDeathRecipient = nullptr;
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H

View File

@@ -1,4 +0,0 @@
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti
class hal
user gps
group system gps radio vendor_qti_diag

View File

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

View File

@@ -1,197 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_BatchingAPIClient"
#include <inttypes.h>
#include <log_util.h>
#include <loc_cfg.h>
#include "LocationUtil.h"
#include "BatchingAPIClient.h"
#include "limits.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssBatching;
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
using ::android::hardware::gnss::V1_0::GnssLocation;
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
LocationCapabilitiesMask mask);
BatchingAPIClient::BatchingAPIClient(const sp<IGnssBatchingCallback>& callback) :
LocationAPIClientBase(),
mGnssBatchingCbIface(callback),
mDefaultId(UINT_MAX),
mLocationCapabilitiesMask(0)
{
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
locationCallbacks.trackingCb = nullptr;
locationCallbacks.batchingCb = nullptr;
if (mGnssBatchingCbIface != nullptr) {
locationCallbacks.batchingCb = [this](size_t count, Location* location,
BatchingOptions batchOptions) {
onBatchingCb(count, location, batchOptions);
};
}
locationCallbacks.geofenceBreachCb = nullptr;
locationCallbacks.geofenceStatusCb = nullptr;
locationCallbacks.gnssLocationInfoCb = nullptr;
locationCallbacks.gnssNiCb = nullptr;
locationCallbacks.gnssSvCb = nullptr;
locationCallbacks.gnssNmeaCb = nullptr;
locationCallbacks.gnssMeasurementsCb = nullptr;
locAPISetCallbacks(locationCallbacks);
}
BatchingAPIClient::~BatchingAPIClient()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
}
int BatchingAPIClient::getBatchSize()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
return locAPIGetBatchSize();
}
int BatchingAPIClient::startSession(const IGnssBatching::Options& opts)
{
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
int retVal = -1;
LocationOptions options;
convertBatchOption(opts, options, mLocationCapabilitiesMask);
uint32_t mode = 0;
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
mode = SESSION_MODE_ON_FULL;
}
if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
retVal = 1;
}
return retVal;
}
int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts)
{
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
int retVal = -1;
LocationOptions options;
convertBatchOption(opts, options, mLocationCapabilitiesMask);
uint32_t mode = 0;
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
mode = SESSION_MODE_ON_FULL;
}
if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
retVal = 1;
}
return retVal;
}
int BatchingAPIClient::stopSession()
{
LOC_LOGD("%s]: ", __FUNCTION__);
int retVal = -1;
if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) {
retVal = 1;
}
return retVal;
}
void BatchingAPIClient::getBatchedLocation(int last_n_locations)
{
LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations);
locAPIGetBatchedLocations(mDefaultId, last_n_locations);
}
void BatchingAPIClient::flushBatchedLocations()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
locAPIGetBatchedLocations(mDefaultId, SIZE_MAX);
}
void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
{
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
mLocationCapabilitiesMask = capabilitiesMask;
}
void BatchingAPIClient::onBatchingCb(size_t count, Location* location,
BatchingOptions /*batchOptions*/)
{
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
if (mGnssBatchingCbIface != nullptr && count > 0) {
hidl_vec<GnssLocation> locationVec;
locationVec.resize(count);
for (size_t i = 0; i < count; i++) {
convertGnssLocation(location[i], locationVec[i]);
}
auto r = mGnssBatchingCbIface->gnssLocationBatchCb(locationVec);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s",
__func__, r.description().c_str());
}
}
}
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
LocationCapabilitiesMask mask)
{
memset(&out, 0, sizeof(LocationOptions));
out.size = sizeof(LocationOptions);
out.minInterval = (uint32_t)(in.periodNanos / 1000000L);
out.minDistance = 0;
out.mode = GNSS_SUPL_MODE_STANDALONE;
if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
out.mode = GNSS_SUPL_MODE_MSA;
if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
out.mode = GNSS_SUPL_MODE_MSB;
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,75 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef BATCHING_API_CLINET_H
#define BATCHING_API_CLINET_H
#include <android/hardware/gnss/1.0/IGnssBatching.h>
#include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
#include <pthread.h>
#include <LocationAPIClientBase.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
class BatchingAPIClient : public LocationAPIClientBase
{
public:
BatchingAPIClient(const sp<V1_0::IGnssBatchingCallback>& callback);
int getBatchSize();
int startSession(const V1_0::IGnssBatching::Options& options);
int updateSessionOptions(const V1_0::IGnssBatching::Options& options);
int stopSession();
void getBatchedLocation(int last_n_locations);
void flushBatchedLocations();
inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; }
// callbacks
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final;
private:
~BatchingAPIClient();
sp<V1_0::IGnssBatchingCallback> mGnssBatchingCbIface;
uint32_t mDefaultId;
LocationCapabilitiesMask mLocationCapabilitiesMask;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // BATCHING_API_CLINET_H

View File

@@ -1,275 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_GeofenceApiClient"
#include <log_util.h>
#include <loc_cfg.h>
#include "LocationUtil.h"
#include "GeofenceAPIClient.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
using ::android::hardware::gnss::V1_0::GnssLocation;
GeofenceAPIClient::GeofenceAPIClient(const sp<IGnssGeofenceCallback>& callback) :
LocationAPIClientBase(),
mGnssGeofencingCbIface(callback)
{
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
locationCallbacks.trackingCb = nullptr;
locationCallbacks.batchingCb = nullptr;
locationCallbacks.geofenceBreachCb = nullptr;
if (mGnssGeofencingCbIface != nullptr) {
locationCallbacks.geofenceBreachCb =
[this](GeofenceBreachNotification geofenceBreachNotification) {
onGeofenceBreachCb(geofenceBreachNotification);
};
locationCallbacks.geofenceStatusCb =
[this](GeofenceStatusNotification geofenceStatusNotification) {
onGeofenceStatusCb(geofenceStatusNotification);
};
}
locationCallbacks.gnssLocationInfoCb = nullptr;
locationCallbacks.gnssNiCb = nullptr;
locationCallbacks.gnssSvCb = nullptr;
locationCallbacks.gnssNmeaCb = nullptr;
locationCallbacks.gnssMeasurementsCb = nullptr;
locAPISetCallbacks(locationCallbacks);
}
void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms)
{
LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__,
geofence_id, latitude, longitude, radius_meters,
last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms);
GeofenceOption options;
memset(&options, 0, sizeof(GeofenceOption));
options.size = sizeof(GeofenceOption);
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT;
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT;
options.responsiveness = notification_responsiveness_ms;
GeofenceInfo data;
data.size = sizeof(GeofenceInfo);
data.latitude = latitude;
data.longitude = longitude;
data.radius = radius_meters;
LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data);
if (LOCATION_ERROR_SUCCESS != err) {
onAddGeofencesCb(1, &err, &geofence_id);
}
}
void GeofenceAPIClient::geofencePause(uint32_t geofence_id)
{
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
locAPIPauseGeofences(1, &geofence_id);
}
void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions)
{
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions);
GeofenceBreachTypeMask mask = 0;
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
mask |= GEOFENCE_BREACH_ENTER_BIT;
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
mask |= GEOFENCE_BREACH_EXIT_BIT;
locAPIResumeGeofences(1, &geofence_id, &mask);
}
void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id)
{
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
locAPIRemoveGeofences(1, &geofence_id);
}
void GeofenceAPIClient::geofenceRemoveAll()
{
LOC_LOGD("%s]", __FUNCTION__);
// TODO locAPIRemoveAllGeofences();
}
// callbacks
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
{
LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count);
if (mGnssGeofencingCbIface != nullptr) {
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
GnssLocation gnssLocation;
convertGnssLocation(geofenceBreachNotification.location, gnssLocation);
IGnssGeofenceCallback::GeofenceTransition transition;
if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER)
transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED;
else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT)
transition = IGnssGeofenceCallback::GeofenceTransition::EXITED;
else {
// continue with other breach if transition is
// nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED
continue;
}
auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb(
geofenceBreachNotification.ids[i], gnssLocation, transition,
static_cast<V1_0::GnssUtcTime>(geofenceBreachNotification.timestamp));
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s",
__func__, r.description().c_str());
}
}
}
}
void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification)
{
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available);
if (mGnssGeofencingCbIface != nullptr) {
IGnssGeofenceCallback::GeofenceAvailability status =
IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE;
if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) {
status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE;
}
GnssLocation gnssLocation;
memset(&gnssLocation, 0, sizeof(GnssLocation));
auto r = mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s",
__func__, r.description().c_str());
}
}
}
void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
{
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
if (mGnssGeofencingCbIface != nullptr) {
for (size_t i = 0; i < count; i++) {
IGnssGeofenceCallback::GeofenceStatus status =
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
if (errors[i] == LOCATION_ERROR_SUCCESS)
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
else if (errors[i] == LOCATION_ERROR_ID_EXISTS)
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS;
auto r = mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s",
__func__, r.description().c_str());
}
}
}
}
void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
{
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
if (mGnssGeofencingCbIface != nullptr) {
for (size_t i = 0; i < count; i++) {
IGnssGeofenceCallback::GeofenceStatus status =
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
if (errors[i] == LOCATION_ERROR_SUCCESS)
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
auto r = mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s",
__func__, r.description().c_str());
}
}
}
}
void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
{
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
if (mGnssGeofencingCbIface != nullptr) {
for (size_t i = 0; i < count; i++) {
IGnssGeofenceCallback::GeofenceStatus status =
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
if (errors[i] == LOCATION_ERROR_SUCCESS)
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
auto r = mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s",
__func__, r.description().c_str());
}
}
}
}
void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
{
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
if (mGnssGeofencingCbIface != nullptr) {
for (size_t i = 0; i < count; i++) {
IGnssGeofenceCallback::GeofenceStatus status =
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
if (errors[i] == LOCATION_ERROR_SUCCESS)
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
auto r = mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s",
__func__, r.description().c_str());
}
}
}
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,77 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GEOFENCE_API_CLINET_H
#define GEOFENCE_API_CLINET_H
#include <android/hardware/gnss/1.0/IGnssGeofenceCallback.h>
#include <LocationAPIClientBase.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::sp;
class GeofenceAPIClient : public LocationAPIClientBase
{
public:
GeofenceAPIClient(const sp<V1_0::IGnssGeofenceCallback>& callback);
void geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms);
void geofencePause(uint32_t geofence_id);
void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions);
void geofenceRemove(uint32_t geofence_id);
void geofenceRemoveAll();
// callbacks
void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final;
void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final;
void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
private:
virtual ~GeofenceAPIClient() = default;
sp<V1_0::IGnssGeofenceCallback> mGnssGeofencingCbIface;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // GEOFENCE_API_CLINET_H

View File

@@ -1,565 +0,0 @@
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_GnssAPIClient"
#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours
#include <inttypes.h>
#include <log_util.h>
#include <loc_cfg.h>
#include "LocationUtil.h"
#include "GnssAPIClient.h"
#include <LocContext.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnss;
using ::android::hardware::gnss::V1_0::IGnssCallback;
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
using ::android::hardware::gnss::V1_0::GnssLocation;
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out);
GnssAPIClient::GnssAPIClient(const sp<IGnssCallback>& gpsCb,
const sp<IGnssNiCallback>& niCb) :
LocationAPIClientBase(),
mGnssCbIface(nullptr),
mGnssNiCbIface(nullptr),
mControlClient(new LocationAPIControlClient()),
mLocationCapabilitiesMask(0),
mLocationCapabilitiesCached(false)
{
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
// set default LocationOptions.
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
mTrackingOptions.size = sizeof(TrackingOptions);
mTrackingOptions.minInterval = 1000;
mTrackingOptions.minDistance = 0;
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
gnssUpdateCallbacks(gpsCb, niCb);
}
GnssAPIClient::~GnssAPIClient()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
if (mControlClient) {
delete mControlClient;
mControlClient = nullptr;
}
}
// for GpsInterface
void GnssAPIClient::gnssUpdateCallbacks(const sp<IGnssCallback>& gpsCb,
const sp<IGnssNiCallback>& niCb)
{
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
mMutex.lock();
mGnssCbIface = gpsCb;
mGnssNiCbIface = niCb;
mMutex.unlock();
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
locationCallbacks.trackingCb = nullptr;
if (mGnssCbIface != nullptr) {
locationCallbacks.trackingCb = [this](Location location) {
onTrackingCb(location);
};
}
locationCallbacks.batchingCb = nullptr;
locationCallbacks.geofenceBreachCb = nullptr;
locationCallbacks.geofenceStatusCb = nullptr;
locationCallbacks.gnssLocationInfoCb = nullptr;
locationCallbacks.gnssNiCb = nullptr;
loc_core::ContextBase* context =
loc_core::LocContext::getLocContext(loc_core::LocContext::mLocationHalName);
if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) {
LOC_LOGD("Registering NI CB");
locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) {
onGnssNiCb(id, gnssNiNotification);
};
}
locationCallbacks.gnssSvCb = nullptr;
if (mGnssCbIface != nullptr) {
locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) {
onGnssSvCb(gnssSvNotification);
};
}
locationCallbacks.gnssNmeaCb = nullptr;
if (mGnssCbIface != nullptr) {
locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) {
onGnssNmeaCb(gnssNmeaNotification);
};
}
locationCallbacks.gnssMeasurementsCb = nullptr;
locAPISetCallbacks(locationCallbacks);
}
bool GnssAPIClient::gnssStart()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
bool retVal = true;
locAPIStartTracking(mTrackingOptions);
return retVal;
}
bool GnssAPIClient::gnssStop()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
bool retVal = true;
locAPIStopTracking();
return retVal;
}
bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs,
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
{
LOC_LOGD("%s]: (%d %d %d %d %d %d %d)", __FUNCTION__,
(int)mode, recurrence, minIntervalMs, preferredAccuracyMeters,
preferredTimeMs, (int)powerMode, timeBetweenMeasurement);
bool retVal = true;
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
mTrackingOptions.size = sizeof(TrackingOptions);
mTrackingOptions.minInterval = minIntervalMs;
if (IGnss::GnssPositionMode::MS_ASSISTED == mode ||
IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) {
// We set a very large interval to simulate SINGLE mode. Once we report a fix,
// the caller should take the responsibility to stop the session.
// For MSA, we always treat it as SINGLE mode.
mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC;
}
if (mode == IGnss::GnssPositionMode::STANDALONE)
mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE;
else if (mode == IGnss::GnssPositionMode::MS_BASED)
mTrackingOptions.mode = GNSS_SUPL_MODE_MSB;
else if (mode == IGnss::GnssPositionMode::MS_ASSISTED)
mTrackingOptions.mode = GNSS_SUPL_MODE_MSA;
else {
LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode);
retVal = false;
}
if (GNSS_POWER_MODE_INVALID != powerMode) {
mTrackingOptions.powerMode = powerMode;
mTrackingOptions.tbm = timeBetweenMeasurement;
}
locAPIUpdateTrackingOptions(mTrackingOptions);
return retVal;
}
// for GpsNiInterface
void GnssAPIClient::gnssNiRespond(int32_t notifId,
IGnssNiCallback::GnssUserResponseType userResponse)
{
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast<int>(userResponse));
GnssNiResponse data;
switch (userResponse) {
case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT:
data = GNSS_NI_RESPONSE_ACCEPT;
break;
case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY:
data = GNSS_NI_RESPONSE_DENY;
break;
case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP:
data = GNSS_NI_RESPONSE_NO_RESPONSE;
break;
default:
data = GNSS_NI_RESPONSE_IGNORE;
break;
}
locAPIGnssNiResponse(notifId, data);
}
// these apis using LocationAPIControlClient
void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags)
{
LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags);
if (mControlClient == nullptr) {
return;
}
GnssAidingData data;
memset(&data, 0, sizeof (GnssAidingData));
data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT |
GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT |
GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT |
GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT |
GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT;
data.posEngineMask = STANDARD_POSITIONING_ENGINE;
if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL)
data.deleteAll = true;
else {
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS)
data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC)
data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION)
data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME)
data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO)
data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC)
data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH)
data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR)
data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER)
data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA)
data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI)
data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT;
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO)
data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT;
}
mControlClient->locAPIGnssDeleteAidingData(data);
}
void GnssAPIClient::gnssEnable(LocationTechnologyType techType)
{
LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType);
if (mControlClient == nullptr) {
return;
}
mControlClient->locAPIEnable(techType);
}
void GnssAPIClient::gnssDisable()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
if (mControlClient == nullptr) {
return;
}
mControlClient->locAPIDisable();
}
void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig)
{
LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags);
if (mControlClient == nullptr) {
return;
}
mControlClient->locAPIGnssUpdateConfig(gnssConfig);
}
void GnssAPIClient::requestCapabilities() {
// only send capablities if it's already cached, otherwise the first time LocationAPI
// is initialized, capabilities will be sent by LocationAPI
if (mLocationCapabilitiesCached) {
onCapabilitiesCb(mLocationCapabilitiesMask);
}
}
// callbacks
void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
{
LOC_LOGD("%s]: (%" PRIu64 ")", __FUNCTION__, capabilitiesMask);
mLocationCapabilitiesMask = capabilitiesMask;
mLocationCapabilitiesCached = true;
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
mMutex.unlock();
if (gnssCbIface != nullptr) {
uint32_t data = 0;
if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) ||
(capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) ||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) ||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT))
data |= IGnssCallback::Capabilities::SCHEDULING;
if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT)
data |= IGnssCallback::Capabilities::GEOFENCING;
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT)
data |= IGnssCallback::Capabilities::MEASUREMENTS;
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
data |= IGnssCallback::Capabilities::MSB;
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
data |= IGnssCallback::Capabilities::MSA;
auto r = gnssCbIface->gnssSetCapabilitesCb(data);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s",
__func__, r.description().c_str());
}
}
if (gnssCbIface != nullptr) {
IGnssCallback::GnssSystemInfo gnssInfo = { .yearOfHw = 2015 };
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) {
gnssInfo.yearOfHw++; // 2016
if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) {
gnssInfo.yearOfHw++; // 2017
if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT ||
capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) {
gnssInfo.yearOfHw++; // 2018
}
}
}
LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw);
auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s",
__func__, r.description().c_str());
}
}
}
void GnssAPIClient::onTrackingCb(Location location)
{
LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags);
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
mMutex.unlock();
if (gnssCbIface != nullptr) {
GnssLocation gnssLocation;
convertGnssLocation(location, gnssLocation);
auto r = gnssCbIface->gnssLocationCb(gnssLocation);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssLocationCb description=%s",
__func__, r.description().c_str());
}
}
}
void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification)
{
LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id);
mMutex.lock();
auto gnssNiCbIface(mGnssNiCbIface);
mMutex.unlock();
if (gnssNiCbIface == nullptr) {
LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__);
return;
}
IGnssNiCallback::GnssNiNotification notificationGnss = {};
notificationGnss.notificationId = id;
if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE)
notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE;
else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL)
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL;
else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE)
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE;
else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL)
notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL;
if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT)
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY;
if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT)
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY;
if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT)
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE;
notificationGnss.timeoutSec = gnssNiNotification.timeout;
if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT)
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT;
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY)
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY;
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE ||
gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE)
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP;
notificationGnss.requestorId = gnssNiNotification.requestor;
notificationGnss.notificationMessage = gnssNiNotification.message;
if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE)
notificationGnss.requestorIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
notificationGnss.requestorIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
notificationGnss.requestorIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
notificationGnss.requestorIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE)
notificationGnss.notificationIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
notificationGnss.notificationIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
notificationGnss.notificationIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
notificationGnss.notificationIdEncoding =
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
gnssNiCbIface->niNotifyCb(notificationGnss);
}
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
{
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count);
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
mMutex.unlock();
if (gnssCbIface != nullptr) {
IGnssCallback::GnssSvStatus svStatus;
convertGnssSvStatus(gnssSvNotification, svStatus);
auto r = gnssCbIface->gnssSvStatusCb(svStatus);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssSvStatusCb description=%s",
__func__, r.description().c_str());
}
}
}
void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
{
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
mMutex.unlock();
if (gnssCbIface != nullptr) {
const std::string s(gnssNmeaNotification.nmea);
std::stringstream ss(s);
std::string each;
while(std::getline(ss, each, '\n')) {
each += '\n';
android::hardware::hidl_string nmeaString;
nmeaString.setToExternal(each.c_str(), each.length());
auto r = gnssCbIface->gnssNmeaCb(
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__,
gnssNmeaNotification.nmea, gnssNmeaNotification.length,
r.description().c_str());
}
}
}
}
void GnssAPIClient::onStartTrackingCb(LocationError error)
{
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
mMutex.unlock();
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s",
__func__, r.description().c_str());
}
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s",
__func__, r.description().c_str());
}
}
}
void GnssAPIClient::onStopTrackingCb(LocationError error)
{
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
mMutex.unlock();
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s",
__func__, r.description().c_str());
}
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s",
__func__, r.description().c_str());
}
}
}
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out)
{
memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus));
out.numSvs = in.count;
if (out.numSvs > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) {
LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.",
__FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT);
out.numSvs = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT);
}
for (size_t i = 0; i < out.numSvs; i++) {
IGnssCallback::GnssSvInfo& info = out.gnssSvList[i];
convertGnssSvid(in.gnssSvs[i], info.svid);
convertGnssConstellationType(in.gnssSvs[i].type, info.constellation);
info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
info.elevationDegrees = in.gnssSvs[i].elevation;
info.azimuthDegrees = in.gnssSvs[i].azimuth;
info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz;
info.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT)
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY;
}
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,110 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GNSS_API_CLINET_H
#define GNSS_API_CLINET_H
#include <mutex>
#include <android/hardware/gnss/1.0/IGnss.h>
#include <android/hardware/gnss/1.0/IGnssCallback.h>
#include <android/hardware/gnss/1.0/IGnssNiCallback.h>
#include <LocationAPIClientBase.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::sp;
class GnssAPIClient : public LocationAPIClientBase
{
public:
GnssAPIClient(const sp<V1_0::IGnssCallback>& gpsCb,
const sp<V1_0::IGnssNiCallback>& niCb);
GnssAPIClient(const GnssAPIClient&) = delete;
GnssAPIClient& operator=(const GnssAPIClient&) = delete;
// for GpsInterface
void gnssUpdateCallbacks(const sp<V1_0::IGnssCallback>& gpsCb,
const sp<V1_0::IGnssNiCallback>& niCb);
bool gnssStart();
bool gnssStop();
bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs,
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
uint32_t timeBetweenMeasurement = 0);
// for GpsNiInterface
void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse);
// these apis using LocationAPIControlClient
void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags);
void gnssEnable(LocationTechnologyType techType);
void gnssDisable();
void gnssConfigurationUpdate(const GnssConfig& gnssConfig);
inline LocationCapabilitiesMask gnssGetCapabilities() const {
return mLocationCapabilitiesMask;
}
void requestCapabilities();
// callbacks we are interested in
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
void onTrackingCb(Location location) final;
void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final;
void onGnssSvCb(GnssSvNotification gnssSvNotification) final;
void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final;
void onStartTrackingCb(LocationError error) final;
void onStopTrackingCb(LocationError error) final;
private:
virtual ~GnssAPIClient();
sp<V1_0::IGnssCallback> mGnssCbIface;
sp<V1_0::IGnssNiCallback> mGnssNiCbIface;
std::mutex mMutex;
LocationAPIControlClient* mControlClient;
LocationCapabilitiesMask mLocationCapabilitiesMask;
bool mLocationCapabilitiesCached;
TrackingOptions mTrackingOptions;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // GNSS_API_CLINET_H

View File

@@ -1,274 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <LocationUtil.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::GnssLocation;
using ::android::hardware::gnss::V1_0::GnssConstellationType;
using ::android::hardware::gnss::V1_0::GnssLocationFlags;
void convertGnssLocation(Location& in, GnssLocation& out)
{
memset(&out, 0, sizeof(GnssLocation));
if (in.flags & LOCATION_HAS_LAT_LONG_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG;
out.latitudeDegrees = in.latitude;
out.longitudeDegrees = in.longitude;
}
if (in.flags & LOCATION_HAS_ALTITUDE_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE;
out.altitudeMeters = in.altitude;
}
if (in.flags & LOCATION_HAS_SPEED_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED;
out.speedMetersPerSec = in.speed;
}
if (in.flags & LOCATION_HAS_BEARING_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING;
out.bearingDegrees = in.bearing;
}
if (in.flags & LOCATION_HAS_ACCURACY_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY;
out.horizontalAccuracyMeters = in.accuracy;
}
if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY;
out.verticalAccuracyMeters = in.verticalAccuracy;
}
if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY;
out.speedAccuracyMetersPerSecond = in.speedAccuracy;
}
if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) {
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY;
out.bearingAccuracyDegrees = in.bearingAccuracy;
}
out.timestamp = static_cast<V1_0::GnssUtcTime>(in.timestamp);
}
void convertGnssLocation(const GnssLocation& in, Location& out)
{
memset(&out, 0, sizeof(out));
if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) {
out.flags |= LOCATION_HAS_LAT_LONG_BIT;
out.latitude = in.latitudeDegrees;
out.longitude = in.longitudeDegrees;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) {
out.flags |= LOCATION_HAS_ALTITUDE_BIT;
out.altitude = in.altitudeMeters;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) {
out.flags |= LOCATION_HAS_SPEED_BIT;
out.speed = in.speedMetersPerSec;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
out.flags |= LOCATION_HAS_BEARING_BIT;
out.bearing = in.bearingDegrees;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) {
out.flags |= LOCATION_HAS_ACCURACY_BIT;
out.accuracy = in.horizontalAccuracyMeters;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT;
out.verticalAccuracy = in.verticalAccuracyMeters;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT;
out.speedAccuracy = in.speedAccuracyMetersPerSecond;
}
if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT;
out.bearingAccuracy = in.bearingAccuracyDegrees;
}
out.timestamp = static_cast<uint64_t>(in.timestamp);
}
void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out)
{
switch(in) {
case GNSS_SV_TYPE_GPS:
out = GnssConstellationType::GPS;
break;
case GNSS_SV_TYPE_SBAS:
out = GnssConstellationType::SBAS;
break;
case GNSS_SV_TYPE_GLONASS:
out = GnssConstellationType::GLONASS;
break;
case GNSS_SV_TYPE_QZSS:
out = GnssConstellationType::QZSS;
break;
case GNSS_SV_TYPE_BEIDOU:
out = GnssConstellationType::BEIDOU;
break;
case GNSS_SV_TYPE_GALILEO:
out = GnssConstellationType::GALILEO;
break;
case GNSS_SV_TYPE_UNKNOWN:
default:
out = GnssConstellationType::UNKNOWN;
break;
}
}
void convertGnssSvid(GnssSv& in, int16_t& out)
{
switch(in.type){
case GNSS_SV_TYPE_GPS:
out = in.svId;
break;
case GNSS_SV_TYPE_SBAS:
out = in.svId;
break;
case GNSS_SV_TYPE_GLONASS:
if (!isGloSlotUnknown(in.svId)) { // OSN is known
out = in.svId - GLO_SV_PRN_MIN + 1;
} else { // OSN is not known, report FCN
out = in.gloFrequency + 92;
}
break;
case GNSS_SV_TYPE_QZSS:
out = in.svId;
break;
case GNSS_SV_TYPE_BEIDOU:
out = in.svId - BDS_SV_PRN_MIN + 1;
break;
case GNSS_SV_TYPE_GALILEO:
out = in.svId - GAL_SV_PRN_MIN + 1;
break;
case GNSS_SV_TYPE_NAVIC:
out = in.svId - NAVIC_SV_PRN_MIN + 1;
break;
default:
out = in.svId;
break;
}
}
void convertGnssSvid(GnssMeasurementsData& in, int16_t& out)
{
switch (in.svType) {
case GNSS_SV_TYPE_GPS:
out = in.svId;
break;
case GNSS_SV_TYPE_SBAS:
out = in.svId;
break;
case GNSS_SV_TYPE_GLONASS:
if (!isGloSlotUnknown(in.svId)) { // OSN is known
out = in.svId - GLO_SV_PRN_MIN + 1;
} else { // OSN is not known, report FCN
out = in.gloFrequency + 92;
}
break;
case GNSS_SV_TYPE_QZSS:
out = in.svId;
break;
case GNSS_SV_TYPE_BEIDOU:
out = in.svId - BDS_SV_PRN_MIN + 1;
break;
case GNSS_SV_TYPE_GALILEO:
out = in.svId - GAL_SV_PRN_MIN + 1;
break;
case GNSS_SV_TYPE_NAVIC:
out = in.svId - NAVIC_SV_PRN_MIN + 1;
break;
default:
out = in.svId;
break;
}
}
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out)
{
switch(in) {
case GNSS_EPH_TYPE_EPHEMERIS:
out = GnssDebug::SatelliteEphemerisType::EPHEMERIS;
break;
case GNSS_EPH_TYPE_ALMANAC:
out = GnssDebug::SatelliteEphemerisType::ALMANAC_ONLY;
break;
case GNSS_EPH_TYPE_UNKNOWN:
default:
out = GnssDebug::SatelliteEphemerisType::NOT_AVAILABLE;
break;
}
}
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out)
{
switch(in) {
case GNSS_EPH_SOURCE_DEMODULATED:
out = GnssDebug::SatelliteEphemerisSource::DEMODULATED;
break;
case GNSS_EPH_SOURCE_SUPL_PROVIDED:
out = GnssDebug::SatelliteEphemerisSource::SUPL_PROVIDED;
break;
case GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED:
out = GnssDebug::SatelliteEphemerisSource::OTHER_SERVER_PROVIDED;
break;
case GNSS_EPH_SOURCE_LOCAL:
case GNSS_EPH_SOURCE_UNKNOWN:
default:
out = GnssDebug::SatelliteEphemerisSource::OTHER;
break;
}
}
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out)
{
switch(in) {
case GNSS_EPH_HEALTH_GOOD:
out = GnssDebug::SatelliteEphemerisHealth::GOOD;
break;
case GNSS_EPH_HEALTH_BAD:
out = GnssDebug::SatelliteEphemerisHealth::BAD;
break;
case GNSS_EPH_HEALTH_UNKNOWN:
default:
out = GnssDebug::SatelliteEphemerisHealth::UNKNOWN;
break;
}
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,57 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef LOCATION_UTIL_H
#define LOCATION_UTIL_H
#include <android/hardware/gnss/1.0/types.h>
#include <LocationAPI.h>
#include <GnssDebug.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
void convertGnssLocation(Location& in, V1_0::GnssLocation& out);
void convertGnssLocation(const V1_0::GnssLocation& in, Location& out);
void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out);
void convertGnssSvid(GnssSv& in, int16_t& out);
void convertGnssSvid(GnssMeasurementsData& in, int16_t& out);
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out);
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out);
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out);
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // LOCATION_UTIL_H

View File

@@ -1,276 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_MeasurementAPIClient"
#include <log_util.h>
#include <loc_cfg.h>
#include "LocationUtil.h"
#include "MeasurementAPIClient.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
static void convertGnssData(GnssMeasurementsNotification& in,
V1_0::IGnssMeasurementCallback::GnssData& out);
static void convertGnssMeasurement(GnssMeasurementsData& in,
V1_0::IGnssMeasurementCallback::GnssMeasurement& out);
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
MeasurementAPIClient::MeasurementAPIClient() :
mGnssMeasurementCbIface(nullptr),
mTracking(false)
{
LOC_LOGD("%s]: ()", __FUNCTION__);
}
MeasurementAPIClient::~MeasurementAPIClient()
{
LOC_LOGD("%s]: ()", __FUNCTION__);
}
// for GpsInterface
Return<IGnssMeasurement::GnssMeasurementStatus>
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
{
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
mMutex.lock();
mGnssMeasurementCbIface = callback;
mMutex.unlock();
return startTracking();
}
Return<IGnssMeasurement::GnssMeasurementStatus>
MeasurementAPIClient::startTracking()
{
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
locationCallbacks.trackingCb = nullptr;
locationCallbacks.batchingCb = nullptr;
locationCallbacks.geofenceBreachCb = nullptr;
locationCallbacks.geofenceStatusCb = nullptr;
locationCallbacks.gnssLocationInfoCb = nullptr;
locationCallbacks.gnssNiCb = nullptr;
locationCallbacks.gnssSvCb = nullptr;
locationCallbacks.gnssNmeaCb = nullptr;
locationCallbacks.gnssMeasurementsCb = nullptr;
if (mGnssMeasurementCbIface != nullptr) {
locationCallbacks.gnssMeasurementsCb =
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
onGnssMeasurementsCb(gnssMeasurementsNotification);
};
}
locAPISetCallbacks(locationCallbacks);
TrackingOptions options = {};
memset(&options, 0, sizeof(TrackingOptions));
options.size = sizeof(TrackingOptions);
options.minInterval = 1000;
options.mode = GNSS_SUPL_MODE_STANDALONE;
mTracking = true;
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
locAPIStartTracking(options);
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
}
// for GpsMeasurementInterface
void MeasurementAPIClient::measurementClose() {
LOC_LOGD("%s]: ()", __FUNCTION__);
mTracking = false;
locAPIStopTracking();
}
// callbacks
void MeasurementAPIClient::onGnssMeasurementsCb(
GnssMeasurementsNotification gnssMeasurementsNotification)
{
LOC_LOGD("%s]: (count: %zu active: %d)",
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
if (mTracking) {
mMutex.lock();
sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr;
if (mGnssMeasurementCbIface != nullptr) {
gnssMeasurementCbIface = mGnssMeasurementCbIface;
}
mMutex.unlock();
if (gnssMeasurementCbIface != nullptr) {
V1_0::IGnssMeasurementCallback::GnssData gnssData;
convertGnssData(gnssMeasurementsNotification, gnssData);
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
if (!r.isOk()) {
LOC_LOGE("%s] Error from GnssMeasurementCb description=%s",
__func__, r.description().c_str());
}
}
}
}
static void convertGnssMeasurement(GnssMeasurementsData& in,
V1_0::IGnssMeasurementCallback::GnssMeasurement& out)
{
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement));
if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT)
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR;
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT)
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY;
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT)
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES;
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT)
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE;
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT)
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY;
if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT)
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL;
convertGnssSvid(in, out.svid);
convertGnssConstellationType(in.svType, out.constellation);
out.timeOffsetNs = in.timeOffsetNs;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC;
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT)
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC;
out.receivedSvTimeInNs = in.receivedSvTimeNs;
out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs;
out.cN0DbHz = in.carrierToNoiseDbHz;
out.pseudorangeRateMps = in.pseudorangeRateMps;
out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps;
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT)
out.accumulatedDeltaRangeState |=
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID;
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT)
out.accumulatedDeltaRangeState |=
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET;
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT)
out.accumulatedDeltaRangeState |=
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP;
out.accumulatedDeltaRangeM = in.adrMeters;
out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters;
out.carrierFrequencyHz = in.carrierFrequencyHz;
out.carrierCycles = in.carrierCycles;
out.carrierPhase = in.carrierPhase;
out.carrierPhaseUncertainty = in.carrierPhaseUncertainty;
uint8_t indicator =
static_cast<uint8_t>(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN);
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT)
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT;
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT)
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT;
out.multipathIndicator =
static_cast<IGnssMeasurementCallback::GnssMultipathIndicator>(indicator);
out.snrDb = in.signalToNoiseRatioDb;
out.agcLevelDb = in.agcLevelDb;
}
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out)
{
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock));
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND;
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY;
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS;
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS;
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY;
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT;
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT)
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY;
out.leapSecond = in.leapSecond;
out.timeNs = in.timeNs;
out.timeUncertaintyNs = in.timeUncertaintyNs;
out.fullBiasNs = in.fullBiasNs;
out.biasNs = in.biasNs;
out.biasUncertaintyNs = in.biasUncertaintyNs;
out.driftNsps = in.driftNsps;
out.driftUncertaintyNsps = in.driftUncertaintyNsps;
out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount;
}
static void convertGnssData(GnssMeasurementsNotification& in,
V1_0::IGnssMeasurementCallback::GnssData& out)
{
out.measurementCount = in.count;
if (out.measurementCount > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) {
LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.",
__FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT);
out.measurementCount = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT);
}
for (size_t i = 0; i < out.measurementCount; i++) {
convertGnssMeasurement(in.measurements[i], out.measurements[i]);
}
convertGnssClock(in.clock, out.clock);
}
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,78 +0,0 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef MEASUREMENT_API_CLINET_H
#define MEASUREMENT_API_CLINET_H
#include <mutex>
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
#include <android/hardware/gnss/1.0/IGnssMeasurementCallback.h>
#include <LocationAPIClientBase.h>
#include <hidl/Status.h>
#include <gps_extended_c.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_0 {
namespace implementation {
using ::android::sp;
class MeasurementAPIClient : public LocationAPIClientBase
{
public:
MeasurementAPIClient();
MeasurementAPIClient(const MeasurementAPIClient&) = delete;
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
// for GpsMeasurementInterface
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
const sp<V1_0::IGnssMeasurementCallback>& callback);
void measurementClose();
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking();
// callbacks we are interested in
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
private:
virtual ~MeasurementAPIClient();
std::mutex mMutex;
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface;
bool mTracking;
};
} // namespace implementation
} // namespace V1_0
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // MEASUREMENT_API_CLINET_H

View File

@@ -1,85 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.gnss@1.0-service-qti"
#include <android/hardware/gnss/1.0/IGnss.h>
#include <hidl/LegacySupport.h>
#include "loc_cfg.h"
#include "loc_misc_utils.h"
extern "C" {
#include "vndfwk-detect.h"
}
#ifdef ARCH_ARM_32
#define DEFAULT_HW_BINDER_MEM_SIZE 65536
#endif
using android::hardware::gnss::V1_0::IGnss;
using android::hardware::configureRpcThreadpool;
using android::hardware::registerPassthroughServiceImplementation;
using android::hardware::joinRpcThreadpool;
using android::status_t;
using android::OK;
typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []);
int main() {
ALOGI("%s", __FUNCTION__);
int vendorInfo = getVendorEnhancedInfo();
bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo );
setVendorEnhanced(vendorEnhanced);
#ifdef ARCH_ARM_32
android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE));
#endif
configureRpcThreadpool(1, true);
status_t status;
status = registerPassthroughServiceImplementation<IGnss>();
if (status == OK) {
if (vendorEnhanced) {
#ifdef LOC_HIDL_VERSION
#define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so"
void* libHandle = NULL;
vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*)
dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main");
if (NULL != vendorEnhancedMainMethod) {
(*vendorEnhancedMainMethod)(0, NULL);
}
#else
ALOGE("LOC_HIDL_VERSION not defined.");
#endif
}
joinRpcThreadpool();
} else {
ALOGE("Error while registering IGnss 1.0 service: %d", status);
}
return 0;
}

View File

@@ -1,203 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_AGnssInterface"
#include <log_util.h>
#include "Gnss.h"
#include "AGnss.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
static AGnss* spAGnss = nullptr;
AGnss::AGnss(Gnss* gnss) : mGnss(gnss) {
spAGnss = this;
}
AGnss::~AGnss() {
spAGnss = nullptr;
}
void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){
if (nullptr != spAGnss) {
spAGnss->statusIpV4Cb(status);
}
}
void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
IAGnssCallback::AGnssStatusIpV4 st = {};
switch (status.type) {
case LOC_AGPS_TYPE_SUPL:
st.type = IAGnssCallback::AGnssType::TYPE_SUPL;
break;
case LOC_AGPS_TYPE_C2K:
st.type = IAGnssCallback::AGnssType::TYPE_C2K;
break;
default:
LOC_LOGE("invalid type: %d", status.type);
return;
}
switch (status.status) {
case LOC_GPS_REQUEST_AGPS_DATA_CONN:
st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN;
break;
case LOC_GPS_RELEASE_AGPS_DATA_CONN:
st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN;
break;
case LOC_GPS_AGPS_DATA_CONNECTED:
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED;
break;
case LOC_GPS_AGPS_DATA_CONN_DONE:
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE;
break;
case LOC_GPS_AGPS_DATA_CONN_FAILED:
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED;
break;
default:
LOC_LOGE("invalid status: %d", status.status);
return;
}
st.ipV4Addr = status.ipV4Addr;
if (mAGnssCbIface != nullptr) {
auto r = mAGnssCbIface->agnssStatusIpV4Cb(st);
if (!r.isOk()) {
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
}
} else {
LOC_LOGw("setCallback has not been called yet");
}
}
Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return Void();
}
// Save the interface
mAGnssCbIface = callback;
AgpsCbInfo cbInfo = {};
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES;
mGnss->getGnssInterface()->agpsInit(cbInfo);
return Void();
}
Return<bool> AGnss::dataConnClosed() {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return false;
}
mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL);
return true;
}
Return<bool> AGnss::dataConnFailed() {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return false;
}
mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL);
return true;
}
Return<bool> AGnss::dataConnOpen(const hidl_string& apn,
IAGnss::ApnIpType apnIpType) {
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface");
return false;
}
/* Validate */
if(apn.empty()){
LOC_LOGE("Invalid APN");
return false;
}
LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str());
AGpsBearerType bearerType;
switch (apnIpType) {
case IAGnss::ApnIpType::IPV4:
bearerType = AGPS_APN_BEARER_IPV4;
break;
case IAGnss::ApnIpType::IPV6:
bearerType = AGPS_APN_BEARER_IPV6;
break;
case IAGnss::ApnIpType::IPV4V6:
bearerType = AGPS_APN_BEARER_IPV4V6;
break;
default:
bearerType = AGPS_APN_BEARER_IPV4;
break;
}
mGnss->getGnssInterface()->agpsDataConnOpen(
LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType);
return true;
}
Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
const hidl_string& hostname,
int32_t port) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
if (type == IAGnssCallback::AGnssType::TYPE_SUPL) {
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL;
} else if (type == IAGnssCallback::AGnssType::TYPE_C2K) {
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K;
} else {
LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast<int>(type));
return false;
}
config.assistanceServer.hostName = strdup(hostname.c_str());
config.assistanceServer.port = port;
return mGnss->updateConfiguration(config);
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,79 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
#include <android/hardware/gnss/1.0/IAGnss.h>
#include <hidl/Status.h>
#include <gps_extended_c.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IAGnss;
using ::android::hardware::gnss::V1_0::IAGnssCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
struct Gnss;
struct AGnss : public IAGnss {
AGnss(Gnss* gnss);
~AGnss();
/*
* Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow.
* These declarations were generated from IAGnss.hal.
*/
Return<void> setCallback(const sp<IAGnssCallback>& callback) override;
Return<bool> dataConnClosed() override;
Return<bool> dataConnFailed() override;
Return<bool> dataConnOpen(const hidl_string& apn,
IAGnss::ApnIpType apnIpType) override;
Return<bool> setServer(IAGnssCallback::AGnssType type,
const hidl_string& hostname, int32_t port) override;
void statusIpV4Cb(AGnssExtStatusIpV4 status);
/* Data call setup callback passed down to GNSS HAL implementation */
static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status);
private:
Gnss* mGnss = nullptr;
sp<IAGnssCallback> mAGnssCbIface = nullptr;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H

View File

@@ -1,115 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc__AGnssRilInterface"
#include <log_util.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sstream>
#include <string>
#include "Gnss.h"
#include "AGnssRil.h"
#include <DataItemConcreteTypesBase.h>
typedef void* (getLocationInterface)();
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) {
ENTRY_LOG_CALLFLOW();
}
AGnssRil::~AGnssRil() {
ENTRY_LOG_CALLFLOW();
}
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
ENTRY_LOG_CALLFLOW();
// Extra NetworkTypes not available in IAgnssRil enums
const int NetworkType_BLUETOOTH = 7;
const int NetworkType_ETHERNET = 9;
const int NetworkType_PROXY = 16;
std::string apn("");
// for XTRA
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
switch(type)
{
case IAGnssRil::NetworkType::MOBILE:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
break;
case IAGnssRil::NetworkType::WIFI:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
break;
case IAGnssRil::NetworkType::MMS:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS;
break;
case IAGnssRil::NetworkType::SUPL:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL;
break;
case IAGnssRil::NetworkType::DUN:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN;
break;
case IAGnssRil::NetworkType::HIPRI:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI;
break;
case IAGnssRil::NetworkType::WIMAX:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
break;
default:
{
int networkType = (int) type;
// Handling network types not available in IAgnssRil
switch(networkType)
{
case NetworkType_BLUETOOTH:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
break;
case NetworkType_ETHERNET:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
break;
case NetworkType_PROXY:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
break;
default:
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
}
}
break;
}
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout, false, 0, apn);
}
return true;
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,83 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
#include <android/hardware/gnss/1.0/IAGnssRil.h>
#include <hidl/Status.h>
#include <location_interface.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IAGnssRil;
using ::android::hardware::gnss::V1_0::IAGnssRilCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
struct Gnss;
/*
* Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface
* allows the GNSS chipset to request radio interface layer information from Android platform.
* Examples of such information are reference location, unique subscriber ID, phone number string
* and network availability changes. Also contains wrapper methods to allow methods from
* IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL.
*/
struct AGnssRil : public IAGnssRil {
AGnssRil(Gnss* gnss);
~AGnssRil();
/*
* Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
* These declarations were generated from IAGnssRil.hal.
*/
Return<void> setCallback(const sp<IAGnssRilCallback>& /*callback*/) override {
return Void();
}
Return<void> setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override {
return Void();
}
Return<bool> setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override {
return false;
}
Return<bool> updateNetworkAvailability(bool /*available*/,
const hidl_string& /*apn*/) override {
return false;
}
Return<bool> updateNetworkState(bool connected, NetworkType type, bool roaming) override;
private:
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_

View File

@@ -1,101 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti
# activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
AGnss.cpp \
Gnss.cpp \
GnssBatching.cpp \
GnssGeofencing.cpp \
GnssMeasurement.cpp \
GnssNi.cpp \
GnssConfiguration.cpp \
GnssDebug.cpp \
AGnssRil.cpp
LOCAL_SRC_FILES += \
location_api/LocationUtil.cpp \
location_api/GnssAPIClient.cpp \
location_api/GeofenceAPIClient.cpp \
location_api/BatchingAPIClient.cpp \
location_api/MeasurementAPIClient.cpp \
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/location_api
LOCAL_HEADER_LIBRARIES := \
libgps.utils_headers \
libloc_core_headers \
libloc_pla_headers \
liblocation_api_headers \
liblocbatterylistener_headers
LOCAL_SHARED_LIBRARIES := \
liblog \
libhidlbase \
libcutils \
libutils \
android.hardware.gnss@1.0 \
android.hardware.gnss@1.1 \
android.hardware.health@1.0 \
android.hardware.health@2.0 \
android.hardware.power@1.2 \
libbase
LOCAL_SHARED_LIBRARIES += \
libloc_core \
libgps.utils \
libdl \
liblocation_api \
LOCAL_CFLAGS += $(GNSS_CFLAGS)
LOCAL_STATIC_LIBRARIES := liblocbatterylistener
LOCAL_STATIC_LIBRARIES += libhealthhalutils
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti
# activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc
LOCAL_SRC_FILES := \
service.cpp \
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/location_api
LOCAL_HEADER_LIBRARIES := \
libgps.utils_headers \
libloc_core_headers \
libloc_pla_headers \
liblocation_api_headers
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libdl \
libbase \
libutils \
libgps.utils \
libqti_vndfwk_detect \
LOCAL_SHARED_LIBRARIES += \
libhidlbase \
android.hardware.gnss@1.0 \
android.hardware.gnss@1.1 \
LOCAL_CFLAGS += $(GNSS_CFLAGS)
ifneq ($(LOC_HIDL_VERSION),)
LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"'
endif
include $(BUILD_EXECUTABLE)

View File

@@ -1,466 +0,0 @@
/*
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssInterface"
#define LOG_NDEBUG 0
#include <fstream>
#include <log_util.h>
#include <dlfcn.h>
#include <cutils/properties.h>
#include "Gnss.h"
#include <LocationUtil.h>
#include "battery_listener.h"
#include "loc_misc_utils.h"
typedef const GnssInterface* (getLocationInterface)();
#define IMAGES_INFO_FILE "/sys/devices/soc0/images"
#define DELIMITER ";"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
static sp<Gnss> sGnss;
static std::string getVersionString() {
static std::string version;
if (!version.empty())
return version;
char value[PROPERTY_VALUE_MAX] = {0};
property_get("ro.hardware", value, "unknown");
version.append(value).append(DELIMITER);
std::ifstream in(IMAGES_INFO_FILE);
std::string s;
while(getline(in, s)) {
std::size_t found = s.find("CRM:");
if (std::string::npos == found) {
continue;
}
// skip over space characters after "CRM:"
const char* substr = s.c_str();
found += 4;
while (0 != substr[found] && isspace(substr[found])) {
found++;
}
if (s.find("11:") != found) {
continue;
}
s.erase(0, found + 3);
found = s.find_first_of("\r\n");
if (std::string::npos != found) {
s.erase(s.begin() + found, s.end());
}
version.append(s).append(DELIMITER);
}
return version;
}
void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnss != nullptr) {
mGnss->getGnssInterface()->resetNetworkInfo();
mGnss->stop();
mGnss->cleanup();
}
}
void location_on_battery_status_changed(bool charging) {
LOC_LOGd("battery status changed to %s charging", charging ? "" : "not");
if (sGnss != nullptr) {
sGnss->getGnssInterface()->updateBatteryStatus(charging);
}
}
Gnss::Gnss() {
ENTRY_LOG_CALLFLOW();
sGnss = this;
// initilize gnss interface at first in case needing notify battery status
sGnss->getGnssInterface()->initialize();
// register health client to listen on battery change
loc_extn_battery_properties_listener_init(location_on_battery_status_changed);
// clear pending GnssConfig
memset(&mPendingConfig, 0, sizeof(GnssConfig));
mGnssDeathRecipient = new GnssDeathRecipient(this);
}
Gnss::~Gnss() {
ENTRY_LOG_CALLFLOW();
if (mApi != nullptr) {
mApi->destroy();
mApi = nullptr;
}
sGnss = nullptr;
}
GnssAPIClient* Gnss::getApi() {
if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) {
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);
if (mApi == nullptr) {
LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__);
return mApi;
}
if (mPendingConfig.size == sizeof(GnssConfig)) {
// we have pending GnssConfig
mApi->gnssConfigurationUpdate(mPendingConfig);
// clear size to invalid mPendingConfig
mPendingConfig.size = 0;
if (mPendingConfig.assistanceServer.hostName != nullptr) {
free((void*)mPendingConfig.assistanceServer.hostName);
}
}
}
if (mApi == nullptr) {
LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__);
}
return mApi;
}
const GnssInterface* Gnss::getGnssInterface() {
static bool getGnssInterfaceFailed = false;
if (nullptr == mGnssInterface && !getGnssInterfaceFailed) {
void * libHandle = nullptr;
getLocationInterface* getter = (getLocationInterface*)
dlGetSymFromLib(libHandle, "libgnss.so", "getGnssInterface");
if (nullptr == getter) {
getGnssInterfaceFailed = true;
} else {
mGnssInterface = (const GnssInterface*)(*getter)();
}
}
return mGnssInterface;
}
Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>& callback) {
ENTRY_LOG_CALLFLOW();
if (mGnssCbIface != nullptr) {
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
}
mGnssCbIface = callback;
if (mGnssCbIface != nullptr) {
mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
}
GnssAPIClient* api = getApi();
if (api != nullptr) {
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
api->requestCapabilities();
}
return true;
}
Return<bool> Gnss::setGnssNiCb(const sp<IGnssNiCallback>& callback) {
ENTRY_LOG_CALLFLOW();
mGnssNiCbIface = callback;
GnssAPIClient* api = getApi();
if (api != nullptr) {
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
}
return true;
}
Return<bool> Gnss::updateConfiguration(GnssConfig& gnssConfig) {
ENTRY_LOG_CALLFLOW();
GnssAPIClient* api = getApi();
if (api) {
api->gnssConfigurationUpdate(gnssConfig);
} else if (gnssConfig.flags != 0) {
// api is not ready yet, update mPendingConfig with gnssConfig
mPendingConfig.size = sizeof(GnssConfig);
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
mPendingConfig.gpsLock = gnssConfig.gpsLock;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
mPendingConfig.suplVersion = gnssConfig.suplVersion;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type;
if (mPendingConfig.assistanceServer.hostName != nullptr) {
free((void*)mPendingConfig.assistanceServer.hostName);
mPendingConfig.assistanceServer.hostName =
strdup(gnssConfig.assistanceServer.hostName);
}
mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
mPendingConfig.lppProfileMask = gnssConfig.lppProfileMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT;
mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT;
mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
mPendingConfig.suplModeMask = gnssConfig.suplModeMask;
}
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) {
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds;
}
}
return true;
}
Return<bool> Gnss::start() {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
retVal = api->gnssStart();
}
return retVal;
}
Return<bool> Gnss::stop() {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
retVal = api->gnssStop();
}
return retVal;
}
Return<void> Gnss::cleanup() {
ENTRY_LOG_CALLFLOW();
if (mApi != nullptr) {
mApi->gnssDisable();
}
return Void();
}
Return<bool> Gnss::injectLocation(double latitudeDegrees,
double longitudeDegrees,
float accuracyMeters) {
ENTRY_LOG_CALLFLOW();
const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters);
return true;
} else {
return false;
}
}
Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
int32_t uncertaintyMs) {
return true;
}
Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) {
ENTRY_LOG_CALLFLOW();
GnssAPIClient* api = getApi();
if (api) {
api->gnssDeleteAidingData(aidingDataFlags);
}
return Void();
}
Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs) {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
preferredAccuracyMeters, preferredTimeMs);
}
return retVal;
}
Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() {
ENTRY_LOG_CALLFLOW();
mAGnssIface = new AGnss(this);
return mAGnssIface;
}
Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() {
ENTRY_LOG_CALLFLOW();
mGnssNi = new GnssNi(this);
return mGnssNi;
}
Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
ENTRY_LOG_CALLFLOW();
if (mGnssMeasurement == nullptr)
mGnssMeasurement = new GnssMeasurement();
return mGnssMeasurement;
}
Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
ENTRY_LOG_CALLFLOW();
mGnssConfig = new GnssConfiguration(this);
return mGnssConfig;
}
Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
ENTRY_LOG_CALLFLOW();
mGnssGeofencingIface = new GnssGeofencing();
return mGnssGeofencingIface;
}
Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() {
mGnssBatching = new GnssBatching();
return mGnssBatching;
}
Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() {
ENTRY_LOG_CALLFLOW();
mGnssDebug = new GnssDebug(this);
return mGnssDebug;
}
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
mGnssRil = new AGnssRil(this);
return mGnssRil;
}
// Methods from ::android::hardware::gnss::V1_1::IGnss follow.
Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
ENTRY_LOG_CALLFLOW();
callback->gnssNameCb(getVersionString());
mGnssCbIface_1_1 = callback;
const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
}
return setCallback(callback);
}
Return<bool> Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs,
bool lowPowerMode) {
ENTRY_LOG_CALLFLOW();
bool retVal = false;
GnssAPIClient* api = getApi();
if (api) {
GnssPowerMode powerMode = lowPowerMode?
GNSS_POWER_MODE_M4 : GNSS_POWER_MODE_M2;
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
preferredAccuracyMeters, preferredTimeMs, powerMode, minIntervalMs);
}
return retVal;
}
Return<sp<V1_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_1_1() {
ENTRY_LOG_CALLFLOW();
if (mGnssMeasurement == nullptr)
mGnssMeasurement = new GnssMeasurement();
return mGnssMeasurement;
}
Return<sp<V1_1::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration_1_1() {
ENTRY_LOG_CALLFLOW();
if (mGnssConfig == nullptr)
mGnssConfig = new GnssConfiguration(this);
return mGnssConfig;
}
Return<bool> Gnss::injectBestLocation(const GnssLocation& gnssLocation) {
ENTRY_LOG_CALLFLOW();
const GnssInterface* gnssInterface = getGnssInterface();
if (nullptr != gnssInterface) {
Location location = {};
convertGnssLocation(gnssLocation, location);
gnssInterface->odcpiInject(location);
}
return true;
}
void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) {
ENTRY_LOG_CALLFLOW();
if (ODCPI_REQUEST_TYPE_STOP == request.type) {
return;
}
if (mGnssCbIface_1_1 != nullptr) {
// For emergency mode, request DBH (Device based hybrid) location
// Mark Independent from GNSS flag to false.
if (ODCPI_REQUEST_TYPE_START == request.type) {
auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode);
if (!r.isOk()) {
LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str());
}
} else {
LOC_LOGv("Unsupported ODCPI request type: %d", request.type);
}
} else {
LOC_LOGe("ODCPI request not supported.");
}
}
V1_0::IGnss* HIDL_FETCH_IGnss(const char* hal) {
ENTRY_LOG_CALLFLOW();
V1_0::IGnss* iface = nullptr;
iface = new Gnss();
if (iface == nullptr) {
LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal);
}
return iface;
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,154 +0,0 @@
/*
* Copyright (c) 2017-2018-2018-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
#include <AGnss.h>
#include <AGnssRil.h>
#include <GnssBatching.h>
#include <GnssConfiguration.h>
#include <GnssGeofencing.h>
#include <GnssMeasurement.h>
#include <GnssNi.h>
#include <GnssDebug.h>
#include <android/hardware/gnss/1.1/IGnss.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <GnssAPIClient.h>
#include <location_interface.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
using ::android::hardware::gnss::V1_0::GnssLocation;
struct Gnss : public IGnss {
Gnss();
~Gnss();
/*
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
* These declarations were generated from Gnss.hal.
*/
Return<bool> setCallback(const sp<V1_0::IGnssCallback>& callback) override;
Return<bool> start() override;
Return<bool> stop() override;
Return<void> cleanup() override;
Return<bool> injectLocation(double latitudeDegrees,
double longitudeDegrees,
float accuracyMeters) override;
Return<bool> injectTime(int64_t timeMs,
int64_t timeReferenceMs,
int32_t uncertaintyMs) override;
Return<void> deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
Return<bool> setPositionMode(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs) override;
Return<sp<V1_0::IAGnss>> getExtensionAGnss() override;
Return<sp<V1_0::IGnssNi>> getExtensionGnssNi() override;
Return<sp<V1_0::IGnssMeasurement>> getExtensionGnssMeasurement() override;
Return<sp<V1_0::IGnssConfiguration>> getExtensionGnssConfiguration() override;
Return<sp<V1_0::IGnssGeofencing>> getExtensionGnssGeofencing() override;
Return<sp<V1_0::IGnssBatching>> getExtensionGnssBatching() override;
Return<sp<V1_0::IAGnssRil>> getExtensionAGnssRil() override;
inline Return<sp<V1_0::IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override {
return nullptr;
}
inline Return<sp<V1_0::IGnssXtra>> getExtensionXtra() override {
return nullptr;
}
Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
// Methods from ::android::hardware::gnss::V1_1::IGnss follow.
Return<bool> setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) override;
Return<bool> setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs, bool lowPowerMode) override;
Return<sp<V1_1::IGnssMeasurement>> getExtensionGnssMeasurement_1_1() override;
Return<sp<V1_1::IGnssConfiguration>> getExtensionGnssConfiguration_1_1() override;
Return<bool> injectBestLocation(const GnssLocation& location) override;
// These methods are not part of the IGnss base class.
GnssAPIClient* getApi();
Return<bool> setGnssNiCb(const sp<IGnssNiCallback>& niCb);
Return<bool> updateConfiguration(GnssConfig& gnssConfig);
const GnssInterface* getGnssInterface();
// Callback for ODCPI request
void odcpiRequestCb(const OdcpiRequestInfo& request);
private:
struct GnssDeathRecipient : hidl_death_recipient {
GnssDeathRecipient(sp<Gnss> gnss) : mGnss(gnss) {
}
~GnssDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<Gnss> mGnss;
};
private:
sp<GnssDeathRecipient> mGnssDeathRecipient = nullptr;
sp<AGnss> mAGnssIface = nullptr;
sp<GnssNi> mGnssNi = nullptr;
sp<GnssMeasurement> mGnssMeasurement = nullptr;
sp<GnssConfiguration> mGnssConfig = nullptr;
sp<GnssGeofencing> mGnssGeofencingIface = nullptr;
sp<GnssBatching> mGnssBatching = nullptr;
sp<IGnssDebug> mGnssDebug = nullptr;
sp<AGnssRil> mGnssRil = nullptr;
GnssAPIClient* mApi = nullptr;
sp<V1_0::IGnssCallback> mGnssCbIface = nullptr;
sp<V1_1::IGnssCallback> mGnssCbIface_1_1 = nullptr;
sp<V1_0::IGnssNiCallback> mGnssNiCbIface = nullptr;
GnssConfig mPendingConfig;
const GnssInterface* mGnssInterface = nullptr;
};
extern "C" V1_0::IGnss* HIDL_FETCH_IGnss(const char* name);
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H

View File

@@ -1,130 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssBatchingInterface"
#include <log_util.h>
#include <BatchingAPIClient.h>
#include "GnssBatching.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnssBatching != nullptr) {
mGnssBatching->stop();
mGnssBatching->cleanup();
}
}
GnssBatching::GnssBatching() : mApi(nullptr) {
mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this);
}
GnssBatching::~GnssBatching() {
if (mApi != nullptr) {
mApi->destroy();
mApi = nullptr;
}
}
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
if (mApi != nullptr) {
LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__);
mApi->destroy();
mApi = nullptr;
}
mApi = new BatchingAPIClient(callback);
if (mApi == nullptr) {
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
return false;
}
if (mGnssBatchingCbIface != nullptr) {
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
}
mGnssBatchingCbIface = callback;
if (mGnssBatchingCbIface != nullptr) {
mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/);
}
return true;
}
Return<uint16_t> GnssBatching::getBatchSize() {
uint16_t ret = 0;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
ret = mApi->getBatchSize();
}
return ret;
}
Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
bool ret = false;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
ret = mApi->startSession(options);
}
return ret;
}
Return<void> GnssBatching::flush() {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->flushBatchedLocations();
}
return Void();
}
Return<bool> GnssBatching::stop() {
bool ret = false;
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
ret = mApi->stopSession();
}
return ret;
}
Return<void> GnssBatching::cleanup() {
if (mGnssBatchingCbIface != nullptr) {
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
}
return Void();
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,80 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
#include <android/hardware/gnss/1.0/IGnssBatching.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssBatching;
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
using ::android::hidl::base::V1_0::IBase;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
class BatchingAPIClient;
struct GnssBatching : public IGnssBatching {
GnssBatching();
~GnssBatching();
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
Return<uint16_t> getBatchSize() override;
Return<bool> start(const IGnssBatching::Options& options ) override;
Return<void> flush() override;
Return<bool> stop() override;
Return<void> cleanup() override;
private:
struct GnssBatchingDeathRecipient : hidl_death_recipient {
GnssBatchingDeathRecipient(sp<GnssBatching> gnssBatching) :
mGnssBatching(gnssBatching) {
}
~GnssBatchingDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssBatching> mGnssBatching;
};
private:
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
BatchingAPIClient* mApi = nullptr;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H

View File

@@ -1,308 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssConfigurationInterface"
#include <log_util.h>
#include "Gnss.h"
#include "GnssConfiguration.h"
#include <android/hardware/gnss/1.0/types.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::GnssConstellationType;
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
}
// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow.
Return<bool> GnssConfiguration::setSuplEs(bool enabled) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
config.suplEmergencyServices = (enabled ?
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES :
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO);
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setSuplVersion(uint32_t version) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
switch (version) {
case 0x00020004:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4;
break;
case 0x00020002:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2;
break;
case 0x00020000:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0;
break;
case 0x00010000:
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0;
break;
default:
LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version);
return false;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setSuplMode(uint8_t mode) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
switch (mode) {
case 0:
config.suplModeMask = 0; // STANDALONE ONLY
break;
case 1:
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT;
break;
case 2:
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT;
break;
case 3:
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT;
break;
default:
LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode);
return false;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setLppProfile(uint8_t lppProfileMask) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config = {};
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
config.lppProfileMask = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; //default
if (lppProfileMask & (1<<0)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_BIT;
}
if (lppProfileMask & (1<<1)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_BIT;
}
if (lppProfileMask & (1<<2)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_USER_PLANE_OVER_NR5G_SA_BIT;
}
if (lppProfileMask & (1<<3)) {
config.lppProfileMask |= GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE_OVER_NR5G_SA_BIT;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
if (protocol & (1<<0)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT;
}
if (protocol & (1<<1)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT;
}
if (protocol & (1<<2)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT;
}
if (protocol & (1<<3)) {
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setGpsLock(uint8_t lock) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
switch (lock) {
case 0:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
break;
case 1:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO;
break;
case 2:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI;
break;
case 3:
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
break;
default:
LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock);
return false;
}
return mGnss->updateConfiguration(config);
}
Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return false;
}
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
config.emergencyPdnForEmergencySupl = (enabled ?
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES :
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO);
return mGnss->updateConfiguration(config);
}
// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
Return<bool> GnssConfiguration::setBlacklist(
const hidl_vec<GnssConfiguration::BlacklistedSource>& blacklist) {
ENTRY_LOG_CALLFLOW();
if (nullptr == mGnss) {
LOC_LOGe("mGnss is null");
return false;
}
// blValid is true if blacklist is empty, i.e. clearing the BL;
// if blacklist is not empty, blValid is initialied to false, and later
// updated in the for loop to become true only if there is at least
// one {constellation, svid} in the list that is valid.
bool blValid = (0 == blacklist.size());
GnssConfig config;
memset(&config, 0, sizeof(GnssConfig));
config.size = sizeof(GnssConfig);
config.flags = GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
config.blacklistedSvIds.clear();
GnssSvIdSource source = {};
for (int idx = 0; idx < (int)blacklist.size(); idx++) {
// Set blValid true if any one source is valid
blValid = setBlacklistedSource(source, blacklist[idx]) || blValid;
config.blacklistedSvIds.push_back(source);
}
// Update configuration only if blValid is true
// i.e. only if atleast one source is valid for blacklisting
return (blValid && mGnss->updateConfiguration(config));
}
bool GnssConfiguration::setBlacklistedSource(
GnssSvIdSource& copyToSource,
const GnssConfiguration::BlacklistedSource& copyFromSource) {
bool retVal = true;
uint16_t svIdOffset = 0;
copyToSource.size = sizeof(GnssSvIdSource);
copyToSource.svId = copyFromSource.svid;
switch(copyFromSource.constellation) {
case GnssConstellationType::GPS:
copyToSource.constellation = GNSS_SV_TYPE_GPS;
LOC_LOGe("GPS SVs can't be blacklisted.");
retVal = false;
break;
case GnssConstellationType::SBAS:
copyToSource.constellation = GNSS_SV_TYPE_SBAS;
LOC_LOGe("SBAS SVs can't be blacklisted.");
retVal = false;
break;
case GnssConstellationType::GLONASS:
copyToSource.constellation = GNSS_SV_TYPE_GLONASS;
svIdOffset = GNSS_SV_CONFIG_GLO_INITIAL_SV_ID - 1;
break;
case GnssConstellationType::QZSS:
copyToSource.constellation = GNSS_SV_TYPE_QZSS;
svIdOffset = 0;
break;
case GnssConstellationType::BEIDOU:
copyToSource.constellation = GNSS_SV_TYPE_BEIDOU;
svIdOffset = GNSS_SV_CONFIG_BDS_INITIAL_SV_ID - 1;
break;
case GnssConstellationType::GALILEO:
copyToSource.constellation = GNSS_SV_TYPE_GALILEO;
svIdOffset = GNSS_SV_CONFIG_GAL_INITIAL_SV_ID - 1;
break;
default:
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
LOC_LOGe("Invalid constellation %d", copyFromSource.constellation);
retVal = false;
break;
}
if (copyToSource.svId > 0 && svIdOffset > 0) {
copyToSource.svId += svIdOffset;
}
return retVal;
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,78 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
#include <android/hardware/gnss/1.1/IGnssConfiguration.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_1::IGnssConfiguration;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
/*
* Interface for passing GNSS configuration info from platform to HAL.
*/
struct Gnss;
struct GnssConfiguration : public IGnssConfiguration {
GnssConfiguration(Gnss* gnss);
~GnssConfiguration() = default;
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow.
* These declarations were generated from IGnssConfiguration.hal.
*/
Return<bool> setSuplVersion(uint32_t version) override;
Return<bool> setSuplMode(uint8_t mode) override;
Return<bool> setSuplEs(bool enabled) override;
Return<bool> setLppProfile(uint8_t lppProfileMask) override;
Return<bool> setGlonassPositioningProtocol(uint8_t protocol) override;
Return<bool> setEmergencySuplPdn(bool enable) override;
Return<bool> setGpsLock(uint8_t lock) override;
// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
Return<bool> setBlacklist(
const hidl_vec<GnssConfiguration::BlacklistedSource>& blacklist) override;
private:
Gnss* mGnss = nullptr;
bool setBlacklistedSource(
GnssSvIdSource& copyToSource,
const GnssConfiguration::BlacklistedSource& copyFromSource);
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H

View File

@@ -1,175 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssDebugInterface"
#include <log/log.h>
#include <log_util.h>
#include "Gnss.h"
#include "GnssDebug.h"
#include "LocationUtil.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::hidl_vec;
#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000)
#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000)
#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500)
#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180)
#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN (999) // 999 ns
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX (1.57783680E17) // 5 years in ns
#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
{
}
/*
* This methods requests position, time and satellite ephemeris debug information
* from the HAL.
*
* @return void
*/
Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
{
LOC_LOGD("%s]: ", __func__);
DebugData data = { };
if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){
LOC_LOGE("GnssDebug - Null GNSS interface");
_hidl_cb(data);
return Void();
}
// get debug report snapshot via hal interface
GnssDebugReport reports = { };
mGnss->getGnssInterface()->getDebugReport(reports);
// location block
if (reports.mLocation.mValid) {
data.position.valid = true;
data.position.latitudeDegrees = reports.mLocation.mLocation.latitude;
data.position.longitudeDegrees = reports.mLocation.mLocation.longitude;
data.position.altitudeMeters = reports.mLocation.mLocation.altitude;
data.position.speedMetersPerSec =
(double)(reports.mLocation.mLocation.speed);
data.position.bearingDegrees =
(double)(reports.mLocation.mLocation.bearing);
data.position.horizontalAccuracyMeters =
(double)(reports.mLocation.mLocation.accuracy);
data.position.verticalAccuracyMeters =
reports.mLocation.verticalAccuracyMeters;
data.position.speedAccuracyMetersPerSecond =
reports.mLocation.speedAccuracyMetersPerSecond;
data.position.bearingAccuracyDegrees =
reports.mLocation.bearingAccuracyDegrees;
timeval tv_now, tv_report;
tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec;
tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL;
gettimeofday(&tv_now, NULL);
data.position.ageSeconds =
(tv_now.tv_sec - tv_report.tv_sec) +
(float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000;
}
else {
data.position.valid = false;
}
if (data.position.horizontalAccuracyMeters <= 0 ||
data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) {
data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS;
}
if (data.position.verticalAccuracyMeters <= 0 ||
data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) {
data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS;
}
if (data.position.speedAccuracyMetersPerSecond <= 0 ||
data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) {
data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC;
}
if (data.position.bearingAccuracyDegrees <= 0 ||
data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) {
data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG;
}
// time block
if (reports.mTime.mValid) {
data.time.timeEstimate = reports.mTime.timeEstimate;
data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs;
data.time.frequencyUncertaintyNsPerSec =
reports.mTime.frequencyUncertaintyNsPerSec;
}
if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
}
if (data.time.timeUncertaintyNs <= 0) {
data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN;
} else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) {
data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX;
}
if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {
data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC;
}
// satellite data block
SatelliteData s = { };
std::vector<SatelliteData> s_array = { };
for (uint32_t i=0; i<reports.mSatelliteInfo.size(); i++) {
memset(&s, 0, sizeof(s));
s.svid = reports.mSatelliteInfo[i].svid;
convertGnssConstellationType(
reports.mSatelliteInfo[i].constellation, s.constellation);
convertGnssEphemerisType(
reports.mSatelliteInfo[i].mEphemerisType, s.ephemerisType);
convertGnssEphemerisSource(
reports.mSatelliteInfo[i].mEphemerisSource, s.ephemerisSource);
convertGnssEphemerisHealth(
reports.mSatelliteInfo[i].mEphemerisHealth, s.ephemerisHealth);
s.ephemerisAgeSeconds =
reports.mSatelliteInfo[i].ephemerisAgeSeconds;
s.serverPredictionIsAvailable =
reports.mSatelliteInfo[i].serverPredictionIsAvailable;
s.serverPredictionAgeSeconds =
reports.mSatelliteInfo[i].serverPredictionAgeSeconds;
s_array.push_back(s);
}
data.satelliteDataArray = s_array;
// callback HIDL with collected debug data
_hidl_cb(data);
return Void();
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,59 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
#include <android/hardware/gnss/1.0/IGnssDebug.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssDebug;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
/* Interface for GNSS Debug support. */
struct Gnss;
struct GnssDebug : public IGnssDebug {
GnssDebug(Gnss* gnss);
~GnssDebug() {};
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
* These declarations were generated from IGnssDebug.hal.
*/
Return<void> getDebugData(getDebugData_cb _hidl_cb) override;
private:
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H

View File

@@ -1,141 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "GnssHal_GnssGeofencing"
#include <log_util.h>
#include <GeofenceAPIClient.h>
#include "GnssGeofencing.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnssGeofencing != nullptr) {
mGnssGeofencing->removeAllGeofences();
}
}
GnssGeofencing::GnssGeofencing() : mApi(nullptr) {
mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this);
}
GnssGeofencing::~GnssGeofencing() {
if (mApi != nullptr) {
mApi->destroy();
mApi = nullptr;
}
}
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
if (mApi != nullptr) {
LOC_LOGd("mApi is NOT nullptr");
return Void();
}
mApi = new GeofenceAPIClient(callback);
if (mApi == nullptr) {
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
}
if (mGnssGeofencingCbIface != nullptr) {
mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient);
}
mGnssGeofencingCbIface = callback;
if (mGnssGeofencingCbIface != nullptr) {
mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/);
}
return Void();
}
Return<void> GnssGeofencing::addGeofence(
int32_t geofenceId,
double latitudeDegrees,
double longitudeDegrees,
double radiusMeters,
IGnssGeofenceCallback::GeofenceTransition lastTransition,
int32_t monitorTransitions,
uint32_t notificationResponsivenessMs,
uint32_t unknownTimerMs) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofenceAdd(
geofenceId,
latitudeDegrees,
longitudeDegrees,
radiusMeters,
static_cast<int32_t>(lastTransition),
monitorTransitions,
notificationResponsivenessMs,
unknownTimerMs);
}
return Void();
}
Return<void> GnssGeofencing::pauseGeofence(int32_t geofenceId) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofencePause(geofenceId);
}
return Void();
}
Return<void> GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofenceResume(geofenceId, monitorTransitions);
}
return Void();
}
Return<void> GnssGeofencing::removeGeofence(int32_t geofenceId) {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
} else {
mApi->geofenceRemove(geofenceId);
}
return Void();
}
Return<void> GnssGeofencing::removeAllGeofences() {
if (mApi == nullptr) {
LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__);
} else {
mApi->geofenceRemoveAll();
}
return Void();
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,91 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
using ::android::hardware::gnss::V1_0::IGnssGeofencing;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
class GeofenceAPIClient;
struct GnssGeofencing : public IGnssGeofencing {
GnssGeofencing();
~GnssGeofencing();
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
* These declarations were generated from IGnssGeofencing.hal.
*/
Return<void> setCallback(const sp<IGnssGeofenceCallback>& callback) override;
Return<void> addGeofence(int32_t geofenceId,
double latitudeDegrees,
double longitudeDegrees,
double radiusMeters,
IGnssGeofenceCallback::GeofenceTransition lastTransition,
int32_t monitorTransitions,
uint32_t notificationResponsivenessMs,
uint32_t unknownTimerMs) override;
Return<void> pauseGeofence(int32_t geofenceId) override;
Return<void> resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override;
Return<void> removeGeofence(int32_t geofenceId) override;
private:
// This method is not part of the IGnss base class.
// It is called by GnssGeofencingDeathRecipient to remove all geofences added so far.
Return<void> removeAllGeofences();
private:
struct GnssGeofencingDeathRecipient : hidl_death_recipient {
GnssGeofencingDeathRecipient(sp<GnssGeofencing> gnssGeofencing) :
mGnssGeofencing(gnssGeofencing) {
}
~GnssGeofencingDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssGeofencing> mGnssGeofencing;
};
private:
sp<GnssGeofencingDeathRecipient> mGnssGeofencingDeathRecipient = nullptr;
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface = nullptr;
GeofenceAPIClient* mApi = nullptr;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H

View File

@@ -1,134 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
#include <log_util.h>
#include <MeasurementAPIClient.h>
#include "GnssMeasurement.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
if (mGnssMeasurement != nullptr) {
mGnssMeasurement->close();
}
}
GnssMeasurement::GnssMeasurement() {
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this);
mApi = new MeasurementAPIClient();
}
GnssMeasurement::~GnssMeasurement() {
if (mApi) {
mApi->destroy();
mApi = nullptr;
}
}
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
const sp<V1_0::IGnssMeasurementCallback>& callback) {
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
if (mGnssMeasurementCbIface != nullptr) {
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
}
if (callback == nullptr) {
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
return ret;
}
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
return ret;
}
mGnssMeasurementCbIface = callback;
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
return mApi->measurementSetCallback(callback);
}
Return<void> GnssMeasurement::close() {
if (mApi == nullptr) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
return Void();
}
if (mGnssMeasurementCbIface != nullptr) {
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
mGnssMeasurementCbIface = nullptr;
}
if (mGnssMeasurementCbIface_1_1 != nullptr) {
mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
mGnssMeasurementCbIface_1_1 = nullptr;
}
mApi->measurementClose();
return Void();
}
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
const sp<IGnssMeasurementCallback>& callback, bool enableFullTracking) {
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
if (mGnssMeasurementCbIface_1_1 != nullptr) {
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
}
if (callback == nullptr) {
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
return ret;
}
if (nullptr == mApi) {
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
return ret;
}
mGnssMeasurementCbIface_1_1 = callback;
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
GnssPowerMode powerMode = enableFullTracking?
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
return mApi->measurementSetCallback_1_1(callback, powerMode);
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,83 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_1::IGnssMeasurement;
using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
class MeasurementAPIClient;
struct GnssMeasurement : public IGnssMeasurement {
GnssMeasurement();
~GnssMeasurement();
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
* These declarations were generated from IGnssMeasurement.hal.
*/
Return<GnssMeasurement::GnssMeasurementStatus> setCallback(
const sp<V1_0::IGnssMeasurementCallback>& callback) override;
Return<void> close() override;
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
Return<GnssMeasurement::GnssMeasurementStatus> setCallback_1_1(
const sp<IGnssMeasurementCallback>& callback,
bool enableFullTracking) override;
private:
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
GnssMeasurementDeathRecipient(sp<GnssMeasurement> gnssMeasurement) :
mGnssMeasurement(gnssMeasurement) {
}
~GnssMeasurementDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssMeasurement> mGnssMeasurement;
};
private:
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
MeasurementAPIClient* mApi;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H

View File

@@ -1,85 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc_GnssNiInterface"
#include <log_util.h>
#include "Gnss.h"
#include "GnssNi.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
// we do nothing here
// Gnss::GnssDeathRecipient will stop the session
}
GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) {
mGnssNiDeathRecipient = new GnssNiDeathRecipient(this);
}
// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
Return<void> GnssNi::setCallback(const sp<IGnssNiCallback>& callback) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return Void();
}
mGnss->setGnssNiCb(callback);
if (mGnssNiCbIface != nullptr) {
mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient);
}
mGnssNiCbIface = callback;
if (mGnssNiCbIface != nullptr) {
mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/);
}
return Void();
}
Return<void> GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) {
if (mGnss == nullptr) {
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
return Void();
}
GnssAPIClient* api = mGnss->getApi();
if (api == nullptr) {
LOC_LOGE("%s]: api is nullptr", __FUNCTION__);
return Void();
}
api->gnssNiRespond(notifId, userResponse);
return Void();
}
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -1,75 +0,0 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
#include <android/hardware/gnss/1.0/IGnssNi.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssNi;
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
struct Gnss;
struct GnssNi : public IGnssNi {
GnssNi(Gnss* gnss);
~GnssNi() = default;
/*
* Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
* These declarations were generated from IGnssNi.hal.
*/
Return<void> setCallback(const sp<IGnssNiCallback>& callback) override;
Return<void> respond(int32_t notifId,
IGnssNiCallback::GnssUserResponseType userResponse) override;
private:
struct GnssNiDeathRecipient : hidl_death_recipient {
GnssNiDeathRecipient(sp<GnssNi> gnssNi) : mGnssNi(gnssNi) {
}
~GnssNiDeathRecipient() = default;
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
sp<GnssNi> mGnssNi;
};
private:
sp<GnssNiDeathRecipient> mGnssNiDeathRecipient = nullptr;
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
Gnss* mGnss = nullptr;
};
} // namespace implementation
} // namespace V1_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H

View File

@@ -1,4 +0,0 @@
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti
class hal
user gps
group system gps radio vendor_qti_diag

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