610 Commits
udc ... bka

Author SHA1 Message Date
67ad5315d6 fixup! cepheus: Switch to LineageOS-based kernel 2026-01-20 18:27:26 +00:00
88d0c30fc6 cepheus: fix broken .clang-format symlink
Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-12-22 00:13:15 +07:00
3b6898bfc1 cepheus: Change touch panel nodes for new kernel
Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-12-08 06:13:38 +07:00
4e27a0a101 cepheus: Switch to LineageOS-based kernel
Original commits for Xiaomi SM8150 platform are from: https://github.com/LineageOS/android_kernel_xiaomi_sm8150

Rebased on latest LineageOS 4.14 qcom kernel: https://github.com/LineageOS/android_kernel_qcom_sm8150

Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-12-08 06:06:42 +07:00
a45beaad9a cepheus: remove hal_power_service.te
The binder_call's are now neverallowed in 25Q3.

Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-12-03 04:05:21 +07:00
8736074c9c cepheus: Set kernel BPF version override to 5.4.299
Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-12-03 04:02:59 +07:00
e56ffb6aad cepheus: Update some soong config variables to bool type
Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-12-03 04:02:20 +07:00
fe2c29b19d cepheus: hidl: downgrade IUceService to 2.1
Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-09-30 18:34:36 +07:00
3fc41a6e7f cepheus: Nuke lbm doze config 2025-09-30 18:27:14 +07:00
369778b139 Revert "cepheus: overlay: Enable AOD wallpaper"
This reverts commit b112942ca4.
2025-09-30 18:27:14 +07:00
af9aee7482 cepheus: hello AIDL LiveDisplay 2025-09-30 18:27:14 +07:00
53c401d687 cepheus: powerhint: Allow GPU to be overclocked
go kaboom
2025-08-25 04:01:18 +07:00
ba25bc6f8a cepheus: powerhint: Enable DT2W 2025-08-25 04:01:13 +07:00
nhansp
339d2e7cef cepheus: README: Add more copyright information to respect the authors 2025-08-25 04:01:09 +07:00
48f82ad004 cepheus: Use mini gapps to reduce size and fixup 2025-08-25 04:01:02 +07:00
7baf16fb92 cepheus: Nuke ximiparts and always use low brightness for AOD
Parts couldn't detect whether we're in a dark/bright env, and defaults to highest brightness for AOD.
Together with AOD wallpaper, this will drain our battery like hell. Disabled for your own good...

Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-08-25 04:00:57 +07:00
5de9f5b7c5 cepheus: ximiparts
from LineageOS/android_device_xiaomi_sm6150-common
2025-08-25 04:00:49 +07:00
b5730ac501 cepheus: ximidolby
Signed-off-by: nhansp <nhan.094.vn@gmail.com>
2025-08-25 04:00:44 +07:00
20abf20601 cepheus: Fixups for miuicamera 2025-08-25 04:00:41 +07:00
b112942ca4 cepheus: overlay: Enable AOD wallpaper 2025-08-25 04:00:35 +07:00
b6913d31e9 cepheus: Update dependencies 2025-08-25 04:00:29 +07:00
a470f5bfb4 cepheus: overlay: Status bar refines 2025-08-25 04:00:19 +07:00
3ab3f4a24f cepheus: proprietary-files: Revert CNE, DMS, DPM, RIL kang, add back telephony stack and missing libs 2025-08-25 03:59:34 +07:00
723f713933 cepheus: Initialize for Evolution 11.X
- aosp -> lineage
- Nuke Android.mk: Migrate mount point creation and nuke flash_super_dummy
- Adapt vendor to 25Q2: Replace libaudioroute with vndk v34 for audio stack, use vendor_qcom_common from yaap
- Nuke livedisplay
- Remove fastcharge lefovers from fcm
- Remove duplicate sepolicies
- Add MiuiCamera
- Deduplicate erofs declares with foreach
- Remove deprecated ANT+ stuff
- Migrate to soong_config_set
- Delete vendor/lineage fcm as it's already included
- Add cust to retrofit device so we can use full gapps
2025-08-25 03:59:28 +07:00
kondors1995
5302e19636 cepheus: Switch to py extract utils 2025-06-25 16:07:50 -05:00
Cosmin Tanislav
5e80d0c468 cepheus: skip dependencies which aren't defined in .bp
Change-Id: I01a653661856495788c05b720c0577dac44998a4
2025-05-26 01:17:54 -05:00
Nolen Johnson
96d3341aa0 cepheus: fix libmmosal ELF checks
Change-Id: I4f016772a486d5fe894e0c13aece6a49bada38f5
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-05-26 01:17:24 -05:00
Michael Bestas
1e684643d0 cepheus: Disable ELF checks for certain libraries
Change-Id: I61dbc3559b43becc22f69ae2c1c3e8edf95e2483
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-05-26 00:14:22 -05:00
Cosmin Tanislav
28d25c97d1 cepheus: Fix com.qualcomm.qti.dpm.api@1.0 ELF checks
Change-Id: I759752ccc133d7047d415eb83c5d3c55820437a4
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-05-26 00:08:43 -05:00
Cosmin Tanislav
5446035656 cepheus: Fix vendor.qti.imsrtpservice@3.0 ELF checks
Change-Id: Ia1995d0a3360317843685082e3226ab30f124d09
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-05-26 00:07:13 -05:00
Aaron Kling
ebdb1c8b97 cepheus: Add vendor soong imports to extract
Change-Id: Ib19e69dc35af6b04519eeb695228af65f3d01d2a
2025-05-26 00:03:50 -05:00
inferno0230
78ffc12b3e cepheus: Bump android.hardware.power to V6-ndk
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-04-05 16:47:33 -05:00
balgxmr
728ee1353f Revert "cepheus: Inherit several Android Go configurations"
This reverts commit a3a7659b1c.
2025-04-05 16:31:51 -05:00
Georg Veichtlbauer
ada63c1e35 cepheus: Remove unneeded NFC packages
* NfcNci is built by handheld_system.mk
2025-04-01 19:03:51 -05:00
Tyler Wear
fd71765cc0 cepheus: tetheroffload: Version 1.1
Update tetheroffload to version 1.1.
2025-03-20 22:25:14 -05:00
balgxmr
c7684338f4 cepheus: Switch to AOSP clang 2025-02-20 17:17:28 -05:00
John Galt
4c20c50602 cepheus: CameraProvider: set saner values
500 is WAAAAY too high on op7 series. Set max to a saner of 200.

Also prior to this change, 80 was default for torch, so set 80 as
default.
2025-02-07 21:21:14 -05:00
Cyber Knight
07a1b0c022 cepheus: rootdir: Label brightness node correctly
- We only utilize switch_2/brightness as a toggle switch so explicitly label it.
2025-02-07 19:21:07 -05:00
Cyber Knight
276cf39e77 cepheus: sepolicy: Allow cameraserver to search directories in sysfs_leds
- This fixes a SEPolicy denial.
2025-02-07 19:20:59 -05:00
John Galt
ac8df90397 cepheus: camera: add enabled bool for finished workarounds 2025-02-07 19:20:50 -05:00
bengris32
2027814128 cepheus: camera: Implement setTorchModeExt
Change-Id: Id61420be75b7efd1d13a4b0ee1d103ebd3835516
Signed-off-by: electimon <electimon@gmail.com>
2025-02-07 19:20:28 -05:00
bengris32
da562aa2de cepheus: camera: Implement supportsSetTorchModeExt
Change-Id: I2ec2f4a30723763e6123a1b742468752f38e3d2f
Signed-off-by: bengris32 <bengris32@protonmail.ch>
2025-02-07 19:20:28 -05:00
Dhina17
bad061d7a8 cepheus: Impl torch light control
Change-Id: Icd32d1f6aedb55462c9df4d7cc63a2a4c4e4263e

[RealJohnGalt:] modify for oneplus usage, add toggle switch
2025-02-07 19:20:28 -05:00
Sungtak Lee
bbdf12aff6 cepheus: Disable OMX
Bug: 222649162
Test: make
Change-Id: Iaf1046c610804c5bdb3b0f591e9907539534ea06
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-02-06 13:05:49 -05:00
wenchangliu
289d2844e5 cepheus: Add "can-swap-width-height" for video codecs
[VSR-4.2-004.002] MUST support identical size ranges horizontally
as vertically (for example, support portrait videos of the same size
if they support a landscape video size.)

Bug: 322453106
Test: atest android.mediav2.cts.CodecInfoTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:aa514b3779b94a7dc40dab302c84ab8ae97becfa)
Merged-In: I6918bc926964c8dd398d686ee3e7713d4f023ff2
Change-Id: I6918bc926964c8dd398d686ee3e7713d4f023ff2
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-02-06 13:05:20 -05:00
Jerry Huang
b6991dcc3b cepheus: media: Advertise ro.odm.build.media_performance_class as 30
Bug: 196881264
Test: adb shell getprop ro.odm.build.media_performance_class
Change-Id: I50e4e9bc4cfffa4109776218ae2c4d222b4348af
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-02-06 13:05:16 -05:00
Pawin Vongmasa
b362d65c4b cepheus: Move input surface to CCodec
Test: atest CtsMediaTestCases -- \
--module-arg CtsMediaTestCases:size:small
Bug: 131800183
Change-Id: I8783a7de4a4fdf7ff2eac6697c71f6592c9a9e06
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-02-06 13:05:09 -05:00
dianlujitao
bba3efffe1 cepheus: Remove OMX
* OMX HW video codecs are no longer used after enabling Codec2
 * OMX HW audio codecs won't work without QCOM A/V enhancements, which
   we don't have on Lineage.

Change-Id: I65852151c8fb6387add5fc4402ba3f13c97b5f64
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-02-06 13:03:35 -05:00
chematelegram
1baa582634 cepheus: Move c2_manifest to manifest 2025-02-06 13:00:20 -05:00
balgxmr
ef402553be cepheus: Update sha1sum for vendor.qti.ims.rcsconfig@2.1 2025-01-30 12:50:25 -05:00
balgxmr
92386a10e8 cepheus: Sort proprietary-files 2025-01-30 12:48:58 -05:00
LuK1337
b52fb48cfc cepheus: Build gralloc.qcom
Camera HAL wants it and crashes if it loads default gralloc
implementation instead.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8059
Change-Id: I47965713c822cfdfc369975f8975f21f70133608
2025-01-13 17:32:17 -05:00
Michael Bestas
7c78c8f0e0 cepheus: Update display flags & packages
Required after display HAL blueprint conversion

Change-Id: Ifc4e10703d3424607b9dc8bcc8e417d1c88cc2f3
2025-01-13 17:32:11 -05:00
chematelegram
bcef96ca00 cepheus: Drop updatable GPU drivers 2025-01-07 01:38:39 -05:00
chematelegram
f5f6d8c858 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
2025-01-07 01:29:37 -05:00
balgxmr
859e3e47e0 cepheus: powerhint: Update little cluster min freq
Signed-off-by: balgxmr <jose@pixelos.net>
2025-01-07 01:21:22 -05:00
balgxmr
b88bd306dc cepheus: powerhint: Update GPU frequencies
Signed-off-by: balgxmr <jose@pixelos.net>
2025-01-07 01:21:22 -05:00
balgxmr
46a7975eea cepheus: powerhint: Update GPU idle timeout from 80ms to 58ms
* As per kernel change in: b92e350fe8

Signed-off-by: balgxmr <jose@pixelos.net>
2025-01-07 01:21:15 -05:00
Sebastiano Barezzi
a889cc2ed9 cepheus: powerhint: Drop display early_wakeup node
Change-Id: I32707afebc486c17f41efceb0f8b95a0eae9f2e4
2025-01-06 15:44:19 -05:00
Bruno Martins
693917a032 cepheus: powerhint: Remove Google-specific camera hints
Change-Id: I06a83be233490f0b23cebd83bb71172b7044727b
2025-01-06 15:43:53 -05:00
Sebastiano Barezzi
58e069f13d cepheus: powerhint: Drop EnergyAware node
Change-Id: I42adc40264df0b9c0b03c6862bb0c5703710254d
2025-01-06 15:43:53 -05:00
Sebastiano Barezzi
ab128af935 cepheus: powerhint: Remove schedtune related stuff
Change-Id: I65c84723943e54eaabdc52571c86a66a71a78fb8
2025-01-06 15:43:53 -05:00
Sebastiano Barezzi
fd81eb9735 cepheus: powerhint: Don't mess with UFS clkgate
* They cause UFS panics on vayu

Change-Id: Ifad2383bfb92260f97f6140cadae34b6ed60a4d4
2025-01-06 15:43:53 -05:00
Luca Stefani
e6788c804d cepheus: powerhint: Adjust powerhint for QOS interface
Currently all writes to the dev interface are done
by WriteStringToFd that uses char internally.

The current values seem to expect to be written as s32,
this sadly won't happen and triggers a special case in
the write handling of pm_qos_power_write:
it expects char buffers to be encoded as base16 and
decodes them.
This means the current 44 is actually 0x44 -> 68 seen by
the kernel.

Luckily it seems like both accepted values for this node
don't hit the threshold to enter C2, so it was never
noticed in real usage and didn't effect the device
C-States handling during hints.

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: Ic544d4dcaa1edc3de913aed737baf1af88a45360
2025-01-06 15:43:47 -05:00
Sebastiano Barezzi
4300befdd8 cepheus: Import powerhint.json
* From: https://android.googlesource.com/device/google/coral/+/android-11.0.0_r40/powerhint.json

Change-Id: Ie6946252fc832c37034d733756a7680459d191e2
2025-01-06 15:43:29 -05:00
Bruno Martins
bd350c52b9 cepheus: libperfmgr-ext: Bump to android.hardware.power-V5-ndk
Change-Id: Ia3dd24ff5f8d396d3db3b061db2df53f7bb4ff81
2025-01-04 20:55:39 -05:00
Arian
17357898c6 cepheus: Provide a static lib for power mode extension
Change-Id: I3e2cf17bf1e733838e9e18afdf3f888e814593dc
2025-01-04 20:55:39 -05:00
balgxmr
609315d4e6 Revert "cepheus: Switch to power-libperfmgr AIDL DT2W"
This reverts commit 1e55055f3b.
2025-01-04 20:55:39 -05:00
balgxmr
347383493e cepheus: configs: powerhint: Remove F2fsRecessModeEnable 2025-01-04 20:47:41 -05:00
chematelegram
bb60b97acf cepheus: Build libwifi-hal-ctrl 2025-01-04 19:27:37 -05:00
adi8900
e0e949f413 cepheus: Update IMS and RIL from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-01-04 19:27:37 -05:00
adi8900
ebf2c8de33 cepheus: Update DPM from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-01-04 19:27:37 -05:00
adi8900
adea84e63d cepheus: Update CNE from qssi-user-14-UKQ1.230804.001-2309192131-release-keys
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2025-01-04 19:27:37 -05:00
Pranav Vashi
bb8423f6aa cepheus: Update netmgr props
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-01-04 19:27:37 -05:00
Michael Bestas
c8c2a4670c cepheus: Shim widevine with libcrypto_shim
The following change
google/boringssl@e202e51
removed symbols that our libs require.

Change-Id: I1325c34ecec3d339dd68c665010ecb36fa2e6a29
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-01-04 19:27:37 -05:00
balgxmr
b80b0971a9 cepheus: sepolicy: Remove duplicate wakeup nodes
* Since: 423b19556a
2025-01-04 19:27:36 -05:00
AdarshGrewal
a856044401 cepheus: sepolicy: Allow ueventd to read vendor_persist_wcnss_service_file
Change-Id: I13ee1da817b74e7c39af6831cc5628b404ca1c99
2025-01-04 19:27:36 -05:00
anonymix007
9fedf32108 cepheus: fingerprint: Fix UDFPS enrollment and authentication
- Without this screen would light up for just a few seconds, matching would be unreliable and often error out with GF_ERROR_ACQUIRED_IMAGER_DIRTY or GF_ERROR_TOO_FAST

Change-Id: Ibc02d111224dc0921bf91c7b69330dcda2c7dc8f
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
Signed-off-by: Skyblueborb <tomaszborbely0710@gmail.com>
2025-01-04 19:27:36 -05:00
balgxmr
3c9bd06708 cepheus: sepolicy: Bring back some PowerHal sepolicy stuff 2025-01-04 19:27:36 -05:00
Aaron Kling
11c4107749 cepheus: Remove software omx codec references
These are no longer available as of Android 14 QPR3. The C2 codecs
available by default in the swcodec apex will be used instead
2024-11-19 19:49:54 -05:00
Bruno Martins
956fea4394 cepheus: Remove software OMX blobs
Default to C2 codecs from swcodec apex.
2024-11-19 19:48:10 -05:00
Michael Bestas
d31479264f cepheus: Use AOSP default Codec2/OMX ranks
debug.stagefright.ccodec=4
is the default value in frameworks.

debug.stagefright.omx_default_rank=0
was used to rank OMX SW codecs lower than OMX HW codecs
but we have removed all OMX SW codecs now.
2024-11-19 19:46:29 -05:00
Sebastiano Barezzi
07a76d2d5f cepheus: Drop libril-qcril-hook-oem.so
Requires libril, we disabled that target, safe to assume only non-qcrild
uses this
2024-11-19 19:45:37 -05:00
pjgowtham
9ad12c967a cepheus: fingerprint: Set dim layer zOrder 2024-11-19 19:45:24 -05:00
balgxmr
3ed6380147 Revert "cepheus: Switch to xiaomi vibrator aidl"
This reverts commit 7bf6cdb6e2.
2024-11-19 19:43:41 -05:00
Bruno Martins
707697f469 cepheus: Use common libqti-perfd-client and power-libperfmgr
Change-Id: I22d6b35c72629553817005deaefcae60abc72cfd
2024-11-19 19:43:40 -05:00
kondors1995
74b1818ab7 cepheus: Add pixel_pitch 2024-11-13 16:57:38 -05:00
clarencelol
d2a2a1aefa cepheus: Fix delimiter error
* Error parsing JSON in file: out/soong/soong.lineage_cepheus.extra.variables. Reason: Expecting ',' delimiter: line 41 column 30 (char 5831)
2024-10-28 10:53:15 -05:00
tribual
978001d5c3 cepheus: update fingerprint service 2024-10-28 10:52:37 -05:00
LuK1337
b6aa721beb cepheus: Build libprotobuf-cpp-lite-3.9.1-vendorcompat 2024-10-28 10:51:49 -05:00
¨raystef66¨
19ff52b202 cepheus: build libcrypto-33
* CANNOT LINK EXECUTABLE "/odm/bin/hw/android.hardware.drm@1.3-service.widevine": cannot locate symbol "CBS_init" referenced by "/vendor/lib64/libwvhidl.so"
2024-10-28 10:51:45 -05:00
ArianK16a
3c4b4ebc53 cepheus: Import vndk29 libc++ and provide a module for it
Change-Id: I110257858ab3004b6768fe8a8f0a759cafa4a995
2024-10-28 10:51:28 -05:00
Kelvin Zhang
1166700443 cepheus: Explicitly set as an non-AB target
We will be changing AB to be the default, existing non-AB targets
need to explicitly set AB_OTA_UPDATER to false

Test: th
Change-Id: I86a76296937a6abab1b4495cd66a35144348aafd
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2024-10-28 10:49:09 -05:00
Kelvin Zhang
08638b9d2f cepheus: Allow to access bootable/deprecated-ota targets
sm8150-common is still using non-AB update.
non-AB code will be moved to a separated namespace, add
deprecated-ota to sm8150-common namespace list ahead of time to avoid
breakage.

Test: th
Bug: 324360816
Change-Id: I909064be36e8febe80492cf010eb6eac3d6bc33d
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2024-10-28 10:49:05 -05:00
Pranav Vashi
8be20b8b6f cepheus: Provide libcrypto-v34 vndk
Change-Id: I3e943238b49666fafbc88c842ea1c25c05ea4a67
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2024-10-28 10:48:56 -05:00
basamaryan
5c486d60e0 cepheus: Shim widevine service with libcrypto-v34.so
Change-Id: I72fe794bbdefd1ec8120ab5286b4b756e403c1f3
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2024-10-28 10:48:41 -05:00
balgxmr
a7c8a40fe6 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

Revert "cepheus: Update adreno stack to 530.54"

This reverts commit d478cee1f2.

Revert "cepheus: update adreno to LA.UM.9.14.r1-21000-LAHAINA"

This reverts commit e06cde02a0.

Revert "cepheus: Update Adreno stack from LA.UM.9.14.r1-20200-LAHAINA.QSSI13.0."

This reverts commit 1de560b5dc.

Revert "cepheus: Update adreno stack from from LA.UM.9.14.r1-19300.01-LAHAINA.QSSI12.0"

This reverts commit 402c2c6c5a.

Revert "cepheus: Update adreno blobs from LA.UM.9.14.r1-19300-LAHAINA.QSSI12.0"

This reverts commit 736afc304a.

Revert "cepheus: Update graphics blobs from from LA.UM.9.14.r1-18900-LAHAINA.QSSI12.0"

This reverts commit 840527c8c9.
2024-08-25 12:35:26 -05:00
Dmitry
6f0ecc6c93 cepheus: Fix EGL lib symlink 2024-08-19 07:26:27 -05:00
Yumi Yukimura
b2c8d01735 cepheus: Switch to QTI Memtrack AIDL HAL
Change-Id: Ibcbaff02fd56fbccc3a88c01a5f46a89cb212ef5
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-08-18 18:57:08 -05:00
balgxmr
63fcd20b6f Revert "cepheus: sepolicy: Address telephony denials"
This reverts commit d3a6511072.
2024-08-18 18:54:32 -05:00
balgxmr
e95498d904 cepheus: Sort proprietary-files 2024-08-09 15:34:25 -05:00
RealJohnGalt
966b2d2cb2 cepheus: Explicitly build some vndk vendor libraries 2024-08-09 15:34:25 -05:00
balgxmr
084d1c6ca9 Revert "cepheus: Fix audio on QPR3 with alsa audio"
This reverts commit a76f7efb1f.
2024-08-09 15:34:25 -05:00
Sourajit Karmakar
d478cee1f2 cepheus: Update adreno stack to 530.54
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2024-08-09 15:34:25 -05:00
balgxmr
8e81b5bb58 cepheus: configs: media: Revert to LA.UM.9.1.r1-07500-SMxxx0.0
Revert "cepheus: configs: media: Update from LA.UM.9.1.r1-13000-SMxxx0.QSSI13.0"

This reverts commit 449d748e08.

Revert "cepheus: media: Checkout media from LA.UM.9.1.r1-11500.02-SMxxx0.QSSI12.0"

This reverts commit 59eb1d90db.
2024-08-09 15:29:30 -05:00
Pranav Vashi
d3a6511072 cepheus: sepolicy: Address telephony denials
Change-Id: Id92a86f62e15efe44a20683b6663e7d97c4b3c0f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-08-02 17:51:42 -05:00
althafvly
ea6e7d7c8e cepheus: Update CarrierConfig from munch V816.0.2.0.ULMMIXM
Change-Id: I4df6ab6ac380b3eeed1ab6ed64f64bc0e0d0ed3f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-08-02 17:51:42 -05:00
Chirayu Desai
39f6a554c5 cepheus: rro_overlays: Move CarrierConfig to RRO
Change-Id: Ia57acd244608848f70fdcc30d5694c919db60671
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-08-02 17:51:42 -05:00
Josh Wu
614422ea5f cepheus: Switch BtAudio to AIDL
Test: m
Bug: 203490261
Change-Id: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
Merged-In: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
2024-08-02 17:51:42 -05:00
Michael Bestas
20feb92ec5 cepheus: Drop COMMON_LUNCH_CHOICES
As of 14 QPR2 this is broken, let's remove it instead of updating it
every 3 months. breakfast is the way to go.

Change-Id: I097bd54b894d9a49c7ce8b1ab6f343349e268fd8
2024-08-02 17:51:42 -05:00
kondors1995
e7e3c1dd72 cepheus: Update vendor.audio-hal service configuration 2024-08-02 17:51:42 -05:00
kondors1995
50e2e73b25 cepheus: Create symlink for vendor mount points 2024-08-02 17:51:24 -05:00
Bruno Martins
2801762b64 cepheus: Mark CNE symlink target as required package
Change-Id: I0bfe65ba61b6aa9916fe6459be2a84d772939a2f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-18 20:12:17 -05:00
Sebastiano Barezzi
1b509c3a06 cepheus: Treat retrofit devices as launching with dynamic
* RuntimeError: Device with retrofit dynamic partitions must use regular (non-Virtual) A/B
2024-07-16 19:59:35 -05:00
José M.
63c07c9e6d cepheus: Adapt FCM source to PixelOS 2024-07-16 19:57:14 -05:00
¨raystef66¨
8b0c4f58d6 cepheus: Declare missing AIDL HALs entries
* The following HALs in device manifest are not declared in FCM <= level 5
2024-07-16 15:54:24 -05:00
Michael Bestas
536d2093d6 cepheus: Include lineage FCM 2024-07-16 15:35:38 -05:00
Bruno Martins
c02e70478d cepheus: Inherit from QTI FCM 2024-07-16 15:35:34 -05:00
Bruno Martins
8ae220a15a cepheus: Use the common device compatibility matrix from QCOM
Change-Id: I6b58cd68542f5b8b4d66433c0264919100eebde4
2024-07-16 15:33:49 -05:00
¨raystef66¨
22ab4f8562 cepheus: add FCM 2024-07-16 15:32:57 -05:00
x0x00044
ec089ead85 cepheus: overlay: Remove config_cellBroadcastAppLinks
- This is true by default.
2024-07-16 15:32:57 -05:00
=?UTF-8?q?=C2=A8raystef66=C2=A8?=
09af3b81e5 cepheus: sepolicy: rm app_data_file
* The following types on /data/ /odm/ /product/ /vendor/ must not be associated
with the "app_data_file_type" attribute: "app_data_file"

Change-Id: I6ffb33d4f94a9bd20d68fd320320dcea19fa57ab
2024-07-16 14:11:41 -05:00
balgxmr
f7ea37346f cepheus: sepolicy: isolated_app -> isolated_app_all
* Found prohibited permission granted for isolated like types.
  Please replace your allow statements that involve "-isolated_app"
  with "-isolated_app_all".
2024-07-16 13:40:09 -05:00
balgxmr
28242a63f7 cepheus: sepolicy: Remove duplicate genfs entries
* These wakeup nodes are now on Lineage sepolicy.
2024-07-15 18:16:49 -05:00
balgxmr
269065081f fixup! cepheus: Drop XiaomiParts
* Missed in de33be9dab
2024-07-15 16:31:06 -05:00
Paul Crowley
e558efa6c7 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-15 15:56:02 -05:00
Bruno Martins
9adbd79171 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-15 15:56:02 -05:00
Bruno Martins
52ae534855 cepheus: Declare EGL libs as symlinks during extraction
Change-Id: I4b2f3e79b5e518889d9771bf8990e27babca8b61
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-15 15:56:02 -05:00
Bruno Martins
8d4aec48b4 cepheus: Declare IMS libs as symlinks during extraction
Change-Id: Ia1b8097d28dd4888232fe383b830515b1b9bafaa
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-15 15:56:02 -05:00
Bruno Martins
88f3904b3d cepheus: Move to new RFS install_symlink targets
Change-Id: I9560fd0da00958d9349a0881b5a5f64a2c02e495
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-07-15 15:56:01 -05:00
Marc Bourgoin
a76f7efb1f 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-15 15:56:01 -05:00
dataoutputstream
8c43c8c732 cepheus: Build audio.primary.default
* Without these modules, logcat gets spammed with:
  AudioSystem-JNI: AudioSystem::listAudioPorts error -19
2024-07-15 15:56:01 -05:00
Michael Bestas
c3de00f108 cepheus: Build missing libraries for 14 QPR3 2024-07-15 15:55:02 -05:00
José M
fa17a3c2cb cepheus: sepolicy: Remove duplicate type entries 2024-07-01 20:20:02 -05:00
Adithya R
3c11306e03 cepheus: Silence some spammy logging
HWC and cit sensor logspam is so intense it bumps up logd's idle CPU
usage up to over 3%. With this change, logs are much cleaner and logd
idle CPU usage is reduced to under 1%, while still allowing error logs
to pass through.
- Do this only in user/debug builds (except eng).
- Add wifi and cnss too while we're at it, they can get noisy at times.
2024-07-01 20:19:19 -05:00
LuK1337
97fe8b7d98 cepheus: libqti-perfd-client: Clean up
* Run clang-format
* Add newlines between functions
* Use elvis operator `?:` for return value

Change-Id: I920044df12c99d32ddd2ef3fb5edf24bcd0c7360
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-04-10 07:59:10 -05:00
Michael Bestas
9cd0085cd1 cepheus: Switch to android.hardware.usb@1.3-service.dual_role_usb
Change-Id: Ibd14f7d31dfaf41e040302eda3bc49f351deb618
2024-04-10 07:54:53 -05:00
balgxmr
e9f0a214ac Revert "cepheus: sepolicy: Make recovery permissive"
This reverts commit 004a154ac0.
2024-04-07 14:30:06 -05:00
basamaryan
e5127e5fb5 cepheus: Don't explicitly include updatable_apex.mk
It is inherited by base_system.mk as of QPR2

Change-Id: I020a05b233f61ea28d03199cbc76051e6e97e1dc
2024-04-07 12:15:22 -05:00
Tomasz Wasilczyk
7771746c28 cepheus: gps: Don't include cutils/threads.h
Bug: 289414897
Test: buildserver
Change-Id: I14b99f42feaae7af00cbd17cfe482eb2e5da71e8
2024-04-07 12:10:18 -05:00
balgxmr
b8fd8b6944 cepheus: powerhint: Drop LAUNCH UclampTAMin 2024-01-29 16:34:00 -05:00
balgxmr
90437518e2 Revert "cepheus: audio: Use AOSP USB v2 audio HAL"
* Fixes reboot when receiving a call with USB-C Type Headphones connected. Also
  causes instability with some dacs connected. Reported by @ SanctumSaturn and others on TG.

This reverts commit 96c93cd924.
2024-01-29 16:34:00 -05:00
Fabian Leutenegger
465f89e02a cepheus: overlay: Move FaceUnlock indication above UDFPS icon
Change-Id: Ia304a1d7f8ba976c111cce54ba76d78cade93c01
2024-01-29 16:34:00 -05:00
Pc1598
217f318363 cepheus: overlay: Import carrier config from MIUI
Taken base qcom configuration from device/qcom/common
and appended carrier configs from MIUI 14.0.1.0 TJUMIXM:
vendor_miui.xml, vendor_device.xml, default_qcom_v2.8.4.xml

Co-authored-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Change-Id: I5e9c4157cb4f3f1ca5b41da6f15b53f173dd995e
Co-authored-by: raghavt20 <raghavt20@aospa.co>
2023-12-23 11:51:25 -05:00
Jake Weinstein
030800da0d 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-18 21:11:39 -05:00
Edwin Moquete
5e6b3da610 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-18 21:10:18 -05:00
Sugakesshaa
422e095c92 [DNM] cepheus: Copy task_profiles from system/core
Change-Id: I438ab5109998f739a73f37271c085a1a21d36c0f
2023-12-18 20:58:54 -05:00
Alex Sarraf
4e4bfed8b7 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
behavior.

Change-Id: I3856caaf0a68e7e720819f25338d1eb9196f56b0
2023-12-18 20:52:17 -05:00
balgxmr
991d84a29c Revert "cepheus: Drop debug.sf.latch_unsignaled property"
This reverts commit 78d3a0ae78.
2023-12-18 20:51:14 -05:00
Arian
b4514a8ef9 cepheus: Enable camera override format from reserved
This enables qcom additions for high framerate videos.

Change-Id: I572d35c6454711e838b2d0dba31551627d10f6e6
2023-12-18 20:38:05 -05:00
balgxmr
1d985ebe92 Revert "cepheus: keylayout: Import joystick keylayouts from 1Controller v1.5.2"
This reverts commit f3424a6c14.
2023-12-17 21:49:47 -05:00
balgxmr
d035ec4454 Revert "cepheus: Add keylayout mapping for Xbox360 compatible controllers"
This reverts commit 885bd12834.
2023-12-17 21:49:47 -05:00
balgxmr
97c7358ea8 cepheus: Partially revert 20567c5afa 2023-12-17 21:49:46 -05:00
balgxmr
14575f5881 Revert "cepheus: Update adreno from Moto G84 (bangkk)"
This reverts commit 5d99a9d68d.
2023-12-17 21:49:46 -05:00
baalgx
4a282ff2c2 cepheus: Bring back LiveDisplay HAL
This reverts commit ae959b675aab8613fae24e82b11e2cde5af25ea0.

- Keep changes of sepolicy/vendor/hal_lineage_livedisplay_qti.te from 89c6e30 too.
2023-12-17 21:49:21 -05:00
José M
88ceb7053d README: Update device picture 2023-11-21 13:41:59 -05:00
Omkar Chandorkar
ea2bd6ee10 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-11-14 16:18:29 -05:00
Bruno Martins
d4d09cb3c0 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.

Change-Id: I4ed1a06af779909d64172da294c4a99a3ae9ba0d
2023-11-13 09:16:22 -05:00
balgxmr
044784581c cepheus: Build android.frameworks.sensorservice@1.0
F/linker  ( 1548): CANNOT LINK EXECUTABLE "slim_daemon": library "android.frameworks.sensorservice@1.0.so" not found: needed by main executable
2023-11-13 09:16:19 -05:00
balgxmr
e81237b3db Revert "cepheus: gps: Update from LA.UM.9.1.r1-13900-SMxxx0.QSSI13.0"
This reverts commit bc48a966d3.
2023-11-02 14:42:24 -05:00
Master
6b8a1acbd4 cepheus: Disable sparse image build on Erofs file system
We use ext4 type. Sparse image cause mounting issue
Signed-off-by: Master <mhmdeveloperofficial@gmail.com>
2023-10-23 15:44:08 -05:00
Master
72430925ae cepheus: Disable sparse for ext 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: Simão Gomes Viana <devel@superboring.dev>
2023-10-23 15:44:08 -05:00
balgxmr
d82e89b10b cepheus: Remove dexpreopt SysUIGoogle 2023-10-23 15:44:08 -05:00
kaderbava
95ccff7a0d cepheus: Rename libstdc++.vendor to libstdc++_vendor
* Ref: SkylineUI/bionic@a05a8c7

* Fixes:

F (6)[617:linkerconfig]: duplicate: libstdc++.so is
provided by default and system in [vendor] 08-04
05:31:23.337 1 1 I (5)[1:init]linkerconfig: libc:
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid
617 (linkerconfig), pid 617 (linkerconfig) 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
*** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** *** 08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: Build fingerprint:
'realme/derp_RMX1921/RMX1921:14/UP1A.231005.007/1696917183:eng/test-keys'
08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: Revision: '0' 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
ABI: 'arm64' 08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: Timestamp: 1971-08-04
05:31:23.357687685+0000 08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: Process uptime: 1s 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
Cmdline: /apex/com.android.runtime/bin/linkerconfig
--target /linkerconfig 08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: pid: 617, tid: 617,
name: linkerconfig >>>
/apex/com.android.runtime/bin/linkerconfig <<< 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
uid: 0 08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: signal 6 (SIGABRT), code
-1 (SI_QUEUE), fault addr -------- 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
Abort message: 'duplicate: libstdc++.so is provided
by default and system in [vendor]' 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x0 0000000000000000 x1 0000000000000269 x2
0000000000000006 x3 0000007fd2385000 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x4 000000000000000a x5 000000000000000a x6
000000000000000a x7 7f7f7f7f7f7f7f7f 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x8 00000000000000f0 x9 0000007f866700a0 x10
0000000000000001 x11 0000007f866b9afc 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x12 000000000000015f x13 0000000000000000 x14
0000000000000000 x15 0000000000000050 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x16 0000007f86724d28 x17 0000007f86700590 x18
0000007f88ecc000 x19 0000000000000269 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x20 0000000000000269 x21 00000000ffffffff x22
0000007f889db000 x23 0000007d841324b0 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x24 0000005578c0203f x25 0000007d84132598 x26
0000007e24134a40 x27 0000007e241322b0 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
x28 0000007fd2385279 x29 0000007fd2385080 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
lr 0000007f866a9f7c sp 0000007fd2384fe0 pc
0000007f866a9fa8 pst 0000000000000000 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
10 total frames 08-04 05:31:23.367 620 620 E
(6)[620:crash_dump64]DEBUG: backtrace: 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
/apex/com.android.runtime/lib64/bionic/libc.so
(abort+164) (BuildId:
c10bee742de5116242eed0af3f77a198) 08-04 05:31:23.367
620 620 E (6)[620:crash_dump64]DEBUG: #01 pc
000000000001757c /system/lib64/libbase.so
(android::base::DefaultAborter(char const*)+12)
(BuildId: 109eab6ff699cb8685ae3b0429a0e65d) 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
(android::base::SetAborter(std::__1::function<void
(char const*)>&&)::$_0::__invoke(char const*)+80)
(BuildId: 109eab6ff699cb8685ae3b0429a0e65d) 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
(android::base::LogMessage::~LogMessage()+352)
(BuildId: 109eab6ff699cb8685ae3b0429a0e65d) 08-04
05:31:23.367 620 620 E (6)[620:crash_dump64]DEBUG:
/apex/com.android.runtime/bin/linkerconfig
(android::linkerconfig::modules::Section::Resolve(android::linkerconfig::modules::BaseContext
const&,
std::__1::unordered_map<std::__1::basic_string<char,
std::__1::char_traits<char>,
std::__1::allocator<char> >,
std::__1::vector<android::linkerconfig::modules::LibProvider,
std::__1::allocator<android::linkerconfig::modules::LibProvider>
>, std::__1::hash<std::__1::basic_string<char,
std::__1::char_traits<char>,
std::__1::allocator<char> > >,
std::__1::equal_to<std::__1::basic_string<char,
std::__1::char_traits<char>,
std::__1::allocator<char> > >,
std::__1::allocator<std::__1::pair<std::__1::basic_string<char,
std::__1::char_traits<char>,
std::__1::allocator<char> > const,
std::__1::vector<android::linkerconfig::modules::LibProvider,
std::__1::allocator<android::linkerconfig::modules::LibProvider>
> > > > const&)+656) (BuildId:
95a1d589e95847aa5458898df3abbbaf) 08-04 05:31:23.368
620 620 E (6)[620:crash_dump64]DEBUG: #06 pc
000000000002366c
/apex/com.android.runtime/bin/linkerconfig
(android::linkerconfig::contents::BuildVendorSection(android::linkerconfig::contents::Context&)+1028)
(BuildId: 95a1d589e95847aa5458898df3abbbaf) 08-04
05:31:23.368 620 620 E (6)[620:crash_dump64]DEBUG:
/apex/com.android.runtime/bin/linkerconfig
(android::linkerconfig::contents::CreateBaseConfiguration(android::linkerconfig::contents::Context&)+2248)
(BuildId: 95a1d589e95847aa5458898df3abbbaf) 08-04
05:31:23.368 620 620 E (6)[620:crash_dump64]DEBUG:
/apex/com.android.runtime/bin/linkerconfig
(main+4176) (BuildId:
95a1d589e95847aa5458898df3abbbaf) 08-04 05:31:23.368
620 620 E (6)[620:crash_dump64]DEBUG: #09 pc
0000000000054698
/apex/com.android.runtime/lib64/bionic/libc.so
(__libc_init+104) (BuildId:
c10bee742de5116242eed0af3f77a198)
08-04 05:31:23.372     1     1 I (5)[1:init]linkerconfig: linkerconfig terminated by signal 6

Signed-off-by: kaderbava <ksbava7325@gmail.com>
2023-10-23 15:44:02 -05:00
kaderbava
287d8c4480 cepheus: Downrev audio hal to v7.0
* Crashing in A14 and stuck at boot logo.

* Fixes:

F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

08-04 11:57:56.158  1969  1969 F DEBUG   : Build fingerprint: 'realme/derp_RMX1921/RMX1921:14/UP1A.231005.007/1696944583:eng/test-keys'

08-04 11:57:56.158  1969  1969 F DEBUG   : Revision: '0'

08-04 11:57:56.158  1969  1969 F DEBUG   : ABI: 'arm'

08-04 11:57:56.158  1969  1969 F DEBUG   : Timestamp: 1971-08-04 11:57:56.091611748+0000

08-04 11:57:56.158  1969  1969 F DEBUG   : Process uptime: 0s

08-04 11:57:56.158  1969  1969 F DEBUG   : Cmdline: /vendor/bin/hw/android.hardware.audio.service

08-04 11:57:56.158  1969  1969 F DEBUG   : pid: 1941, tid: 1947, name: HwBinder:1941_2  >>> /vendor/bin/hw/android.hardware.audio.service <<<

08-04 11:57:56.158  1969  1969 F DEBUG   : uid: 1041

08-04 11:57:56.158  1969  1969 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x00000004

08-04 11:57:56.158  1969  1969 F DEBUG   : Cause: null pointer dereference

08-04 11:57:56.158  1969  1969 F DEBUG   :     r0  ebf00010  r1  ed96979d  r2  ee041810  r3  00000004

08-04 11:57:56.158  1969  1969 F DEBUG   :     r4  ed6baa98  r5  ed6baa98  r6  ed6baabc  r7  ee041810

08-04 11:57:56.158  1969  1969 F DEBUG   :     r8  ed6baab8  r9  ed6bafe8  r10 ed6bab20  r11 ed6bafe8

08-04 11:57:56.158  1969  1969 F DEBUG   :     ip  ec06d3f0  sp  ed6baa50  lr  ed96991b  pc  00000004

08-04 11:57:56.158  1969  1969 F DEBUG   : 12 total frames

08-04 11:57:56.158  1969  1969 F DEBUG   : backtrace:

08-04 11:57:56.158  1969  1969 F DEBUG   :       #00 pc 00000004  <unknown>

08-04 11:57:56.158  1969  1969 F DEBUG   :       #01 pc 00025919  /vendor/lib/hw/android.hardware.audio@7.1-impl.so (android::hardware::audio::V7_1::implementation::StreamOut::setLatencyModeCallback(android::sp<android::hardware::audio::V7_1::IStreamOutLatencyModeCallback> const&)+36) (BuildId: ee2d2567d750e350ee151312594fc459)

08-04 11:57:56.158  1969  1969 F DEBUG   :       #02 pc 0004323f  /vendor/lib/android.hardware.audio@7.1.so (android::hardware::audio::V7_1::BnHwStreamOut::_hidl_setLatencyModeCallback(android::hidl::base::V1_0::BnHwBase*, android::hardware::Parcel const&, android::hardware::Parcel*, std::__1::function<void (android::hardware::Parcel&)>)+198) (BuildId: ab7471a04c158cabb93e266f5d0b2b97)

08-04 11:57:56.158  1969  1969 F DEBUG   :       #03 pc 000443b5  /vendor/lib/android.hardware.audio@7.1.so (android::hardware::audio::V7_1::BnHwStreamOut::onTransact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+3588) (BuildId: ab7471a04c158cabb93e266f5d0b2b97)

08-04 11:57:56.158  1969  1969 F DEBUG   :       #04 pc 000632d3  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::BHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+98) (BuildId: b5429b8e2e2f0046767c663e80e007a8)

08-04 11:57:56.158  1969  1969 F DEBUG   :       #05 pc 00066957  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::IPCThreadState::executeCommand(int)+2254) (BuildId: b5429b8e2e2f0046767c663e80e007a8)

08-04 11:57:56.159  1969  1969 F DEBUG   :       #06 pc 00065f55  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::IPCThreadState::getAndExecuteCommand()+124) (BuildId: b5429b8e2e2f0046767c663e80e007a8)

08-04 11:57:56.159  1969  1969 F DEBUG   :       #07 pc 00066d41  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::IPCThreadState::joinThreadPool(bool)+156) (BuildId: b5429b8e2e2f0046767c663e80e007a8)

08-04 11:57:56.159  1969  1969 F DEBUG   :       #08 pc 0006e401  /apex/com.android.vndk.v34/lib/libhidlbase.so (android::hardware::PoolThread::threadLoop()+12) (BuildId: b5429b8e2e2f0046767c663e80e007a8)

08-04 11:57:56.159  1969  1969 F DEBUG   :       #09 pc 0000d9df  /apex/com.android.vndk.v34/lib/libutils.so (android::Thread::_threadLoop(void*)+410) (BuildId: 5d3886ad27216c67511162ebdb2fe012)

08-04 11:57:56.159  1969  1969 F DEBUG   :       #10 pc 0008a743  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) (BuildId: 766da2cbfcecab02eabeae58aa5b20b7)

08-04 11:57:56.159  1969  1969 F DEBUG   :       #11 pc 0003c6e7  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: 766da2cbfcecab02eabeae58aa5b20b7)

Signed-off-by: kaderbava <ksbava7325@gmail.com>
2023-10-23 14:16:58 -05:00
basamaryan
4697edaf8e cepheus: Build protobuf vendorcompat
Change-Id: I724e933e046cbf631c078321d55550b96ca998da
2023-10-23 14:10:44 -05:00
adi8900
a2b6366507 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-23 14:09:49 -05:00
balgxmr
0d7f300444 cepheus: Remove duplicate genfs entries 2023-10-23 14:09:46 -05:00
balgxmr
20567c5afa cepheus: Cleanup for U 2023-10-23 14:09:41 -05:00
clhex ftw
5ab75db242 cepheus: gps: Drop -werror
Change-Id: If7fd24e942104c54eb48019954832027f3666636
2023-10-11 12:01:06 -05:00
Gabriel Biren
0837c60960 cepheus: Use the AIDL WiFi service
Bug: 205044134
Test: Presubmit tests
Change-Id: Icdaa448e2ed59b638056593adb4bcd769f34220d
2023-10-11 12:01:06 -05:00
tingting.jiang
885bd12834 cepheus: Add keylayout mapping for Xbox360 compatible controllers
Fix issue of Connecting XBOX 360 Controller by USB and play Destiny 2 on Stadia,while some button doesn't work

Bug: 215096348
Test: playing Destiny 2 on Stadia, all button works

Signed-off-by: 7Soldier <reg.fm4@gmail.com>
Signed-off-by: MrErenK <akbaseren4751@gmail.com>
2023-10-06 10:05:56 -05:00
Electric
f3424a6c14 cepheus: keylayout: Import joystick keylayouts from 1Controller v1.5.2
Reference: https://github.com/Electric1447/1Controller

It adds .kl files to fix keybindings on many game controllers.

Compatibility:
 - DualShock 2
 - DualShock 3
 - DualShock 4
 - DualSense
 - Xbox 360
 - Xbox One
 - Xbox One S
 - Xbox Series X|S
 - Switch Pro Controller
 - Nacon REVOLUTION PRO CONTROLLER
 - Zeemote SteelSeries FREE

Credits:
 - JaqFb for providing DS4 keylayouts.
 - KeiranGinge for helping with DS4 mappings.
 - djsmax for many many fixes and changes.
 - Black-Seraph for Pro Controller Keylayout from CleanRom (GPD XD+).
 - MattMasc for DualShock 2 Keylayout.
 - RuiGuilherme for Xbox Series X|S.

Co-authored-by: TogoFire <italomellopereira@gmail.com>
Signed-off-by: 7Soldier <reg.fm4@gmail.com>
Signed-off-by: MrErenK <akbaseren4751@gmail.com>
2023-10-06 10:00:35 -05:00
chematelegram
50a88f3754 cepheus: Build lineage health HAL
* Support for Charging Control
2023-09-28 18:01:38 -05:00
balgxmr
7b0a2d2656 cepheus: Update sha1sums 2023-09-28 17:56:10 -05:00
timocapa
5d99a9d68d cepheus: Update adreno from Moto G84 (bangkk)
Change-Id: I85a06561cfbe714d60a8d5f2dcd8b03783e7999b
2023-09-28 17:44:46 -05:00
basamaryan
bc48a966d3 cepheus: gps: Update from LA.UM.9.1.r1-13900-SMxxx0.QSSI13.0
Change-Id: I042ffc1f85150e427eb1c212436d8a28516890a9
2023-09-14 18:13:33 -05:00
balgxmr
a945c5b3db cepheus: overlay: Move doze_proximity_sensor_supported from custom_config.xml to config.xml 2023-08-18 19:27:15 -05:00
me-cafebabe
260054a411 cepheus: Add system_ext product odm partitions 2023-08-02 16:08:05 -05:00
Sugakesshaa
a3fa23382a cepheus: Update task_profiles.json from AOSPA
Change-Id: Ieb9196fa1a6669207c1862df12d088f3d634c29a
2023-07-28 13:40:14 -05:00
balgxmr
150387d181 cepheus: Update WCNSS_qcom_cfg.ini from vayu V14.0.3.0.TJUMIXM
Signed-off-by: balgxmr <jose@pixelos.net>
2023-07-28 13:36:57 -05:00
adi8900
42e08c5931 cepheus: Update ueventd from LA.UM.9.1.r1-11500.02-SMxxx0.QSSI12.0
* reapply current changes over pure caf one
* keep c61d81d19d

[balgxmr: Keep 5522f89a8b and 134dd0bbf4 too]
2023-07-24 23:15:43 -05:00
Ziqi Chen
dd0232d56f cepheus: rootdir: 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-07-24 22:27:16 -05:00
Andrzej Perczak
19cf7d3a66 cepheus: rootdir: Import userdata tuning from oriole
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
2023-07-24 22:27:16 -05:00
Jaegeuk Kim
1a29113704 cepheus: rootdir: Get back to default from long-standing VM tweaks
This patch removed the old writeout policy tune which was never touched since
2009. In the meantime, most of Android devices are equipped with over 4GB DRAM
and very fast flash storages like UFS, which becomes more like desktop or
servers in 2009. So, it'd be worth to go back to use the default kernel configs.

Bug: 136483670
Bug: 137190999
Change-Id: I1ebbf9f1f27a921103db51e96a50aadd6ec0dde8
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-07-24 22:27:16 -05:00
Arian
d998b7b30d cepheus: rootdir: Start power setup after boot completed
Change-Id: I0a00388bfe11fe7f89d20254dfc9ad8f0d0d6faf
2023-07-24 22:27:15 -05:00
Arian
b536b236ef cepheus: rootdir: Move remaining writes from qcom post boot script to init.target.rc
In previsions commits we imported all needed changes from post.boost.sh in rest of scripts so this is no longer needed

Change-Id: I4a8b4e3922433d9276617bed6177ce3ae7271ada
2023-07-24 22:27:15 -05:00
Midas Chien
62aab7ee73 cepheus: rootdir: Enable display idle_state mechanism
Allows us to check the idle state of the display in order to use perf
hints to improve system performance.

Bug: 124470767
Test: Booted and cated the affected files
Change-Id: Ib22b5209c57725c50f3545c578af7b72e7f08322
2023-07-24 22:27:15 -05:00
Arian
e34cb03b2e cepheus: rootdir: Enable PowerHAL hint processing
Change-Id: I4de6ec81eaf002c094df53ff26ed24db02972dfe
2023-07-24 22:27:14 -05:00
Rick Yiu
b91f3ac9b4 cepheus: rootdir: Boost performance by skipping EAS
Previously we found that the effect of using sched_boost is very
similar to skipping EAS. Since sched_boost is not used because of
CONFIG_SCHED_WALT not enabled, we can boost performance this way.

Bug: 119932121
Test: launch time and app launch time are better than EAS
Change-Id: Idf8026c258b6c36417c9be9b5c87f7b4bfa3f50d
2023-07-24 22:27:14 -05:00
Arian
0c19dfc067 cepheus: rootdir: Move bus-dcvs, mem_latency and powersaving configuration to init.power.rc
* skip init.qcom.post_boot.sh edit since it will be removed in later changes

Change-Id: I41ed6397e73f77627ad9da36e9c6c4c144d545d2
2023-07-24 22:26:54 -05:00
Sugakesshaa
4b76bf362d cepheus: configs: powerhint: Setup uclamp boosting
- Implement uclamp boosting for top-app and foreground
  based on newer pixels

Change-Id: I70c4262230841b3c7bf84b4165916a22312f829f

[balgxmr: Update paths to cepheus]
2023-07-22 15:30:19 -05:00
Adithya R
0cc7550b38 cepheus: releasetools: Print a better message while flashing 2023-07-22 16:59:56 -05:00
Jake Weinstein
59cb2daaae cepheus: Use foreground cpuset/uclamp for gralloc
Makes sure rendering has enough capacity.

Change-Id: I7ad051248353485a8090bec578b2c4325ea06024
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2023-07-22 16:47:28 -05:00
Jake Weinstein
8c8a811d45 cepheus: Use foreground uclamp for hwcomposer
Matches SF, makes sure rendering always
has enough capacity.

Also switches to task_profiles.

Change-Id: I2a2de504be7d3f4f66f31445f44fbbf9376bd927
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2023-07-22 16:47:28 -05:00
Adithya R
12b2b0a9b1 cepheus: Disable backpressure propagation in SF
Avoids jank in the event that frame deadlines are not hit.

Change-Id: Ifafc20314cab81877c59aa70067e1f2f9293d9b4
2023-07-22 16:47:23 -05:00
balgxmr
d34f83f2f4 Revert "cepheus: overlay: Enable proximity sensor check on doze"
This reverts commit 432f0c69e7.
2023-07-14 15:34:18 -05:00
Arian
7bf6cdb6e2 cepheus: Switch to xiaomi vibrator aidl
Change-Id: I5b2c3109035d9553071d874e431891dc14b0ca9d
2023-07-14 15:34:18 -05:00
Srinivas Ramana
d1db579402 cepheus: msm_irqbalance: Correct the arch_mem_timer interrupt
correct the arch_mem_timer interrupt to 38.

Change-Id: Ie5fe976eef084231beb5e32abf88a35a5c4bc70d
2023-07-14 15:34:18 -05:00
balgxmr
516e46e63f cepheus: qcom.post_boot: Enable PowerHal hint processing 2023-07-14 15:34:17 -05:00
Nauval Rizky
79da60417a cepheus: qcom.post_boot: Remove cpuset config
This conflicts with init.qcom.power.rc from previous libperfmgr setup

Signed-off-by: clhex <clhexftw@protonmail.com>
Signed-off-by: balgxmr <jose@pixelos.net>
2023-07-14 15:34:17 -05:00
Nauval Rizky
7ad864afbb cepheus: qcom.post_boot: Remove schedutil ratelimit setup
This conflicts with init.qcom.power.rc from previous libperfmgr setup

Signed-off-by: balgxmr <jose@pixelos.net>
2023-07-14 15:34:08 -05:00
Volodymyr Zhdanov
af07e76487 cepheus: rootdir: Override hwcomposer service
* CAF ¯\_(ツ)_/¯
* See https://source.codeaurora.org/quic/la/platform/hardware/interfaces/commit/?id=73a427f95e231a46c2274d51abfec21bd2d316f1

Change-Id: Iae755d16e5d5f70d372112bcbbac8e71d8df1124
2023-07-11 14:20:24 -05:00
Carter Hsu
0e9a7611c8 cepheus: Update Audio HIDL to 7.1
Bug: 205235270
Test: build pass
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: Ie1d8b20b001936e6c72ffe3644475c4fb8dad604
2023-07-08 11:29:42 -05:00
Alessio Balsini
d534f93bdd cepheus: Use FUSE passthrough by default
Enable the persist.sys.fuse.passthrough.enable flag in the
system configuration to enable the FUSE passthrough feature.
This feature has been enabled on Cuttlefish devices for about two months
and no issues have been detected yet.

Bug: 168023149
Test: 'adb shell getprop | grep persist.sys.fuse.passthrough.enable',
    ScopedStorageTest
Signed-off-by: Alessio Balsini <balsini@google.com>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Change-Id: Id93be77565a50116bd82853d18e22b03e72e718e
2023-07-08 11:29:34 -05:00
Sebastiano Barezzi
ec35aaaeb9 cepheus: configs: powerhint: Don't mess with UFS clkgate
Change-Id: Ifad2383bfb92260f97f6140cadae34b6ed60a4d4
2023-07-06 17:04:41 -05:00
Subhajeet Muhuri
f577012c43 cepheus: configs: powerhint: Drop PM QoS boosting
Signed-off-by: Subhajeet Muhuri <subhajeet.muhuri@aosip.dev>
Change-Id: Idfec50a2877ed5db2191002e287d1a41cd8f38af
2023-07-06 17:04:36 -05:00
balgxmr
1f2973c64b Revert "cepheus: SystemUIGoogle -> SystemUI"
This reverts commit dd20f0720c.
2023-07-04 15:06:02 -05:00
pwnrazr
4b9195c350 cepheus: fingerprint: use getInstance() instead 2023-07-01 12:35:09 -05:00
Nauval Rizky
cdfb55e524 cepheus: fingerprint: Set thread to high CFS priority
Change-Id: I83eab988551892b9229640f601e17f7235d133ed
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: AnierinB <anierin@evolution-x.org>
Signed-off-by: Pranav <npv12@iitbbs.ac.in>

[YAAP]: forward port to 12, set to RR instead of NORMAL or FIFO, since
RR now runs at 1 jiffy timeslices. We want fingerprint service side to
be low latency.

[pwnrazr]: adapt for raphael. Original commit: 121cd2d2ee
2023-07-01 12:35:08 -05:00
John Galt
a27abbaf98 cepheus: fingerprint: Use foreground cpuset/uclamp
Matches SurfaceFlinger and Display Allocator
2023-07-01 12:35:05 -05:00
Andrzej Perczak
1da42b7de9 cepheus: Tune Adaptive Suspend parameters
Import tuning from gs101.

Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: NotZeetaa <rodrigo2005contente@gmail.com>
2023-07-01 12:35:00 -05:00
balgxmr
a8111156a8 cepheus: overlay: Fix deprecated power item
ambient.on -> ambient.on.display0

Signed-off-by: balgxmr <jose@pixelos.net>
2023-06-25 19:12:37 -05:00
Sergey
e8fa6ec48a cepheus: Switch to white FOD icon with red center
* Icon taken from realme X2 (cbc8a7e57e)

Signed-off-by: firebird11 <hbgassel@gmail.com>
2023-06-17 14:28:26 -05:00
balgxmr
4fd19cb47b Revert "Revert "cepheus: overlay-aosp: Change default FOD pressed color to cyan""
This reverts commit 8b54136343.
2023-06-17 14:27:56 -05:00
Nauval Rizky
bc0b9b8b08 cepheus: rootdir: Remove UnityMain from sched_lib_name
sched_lib_name does the job by traversing executable VMA that map a file
and checking the accessor path with `strnstr()`, so task comm like
UnityMain will not going to appear anyway.
2023-06-12 17:55:24 -05:00
Nauval Rizky
a817954c8f cepheus: rootdir: Register framebuffer lib to cached freq reporting
Based on latest libqti-perfd at qssi-user-11-RKQ1.200826.002-V12.5.6.0.RJUIDXM
2023-06-12 17:55:23 -05:00
alanndz
27a90593ad cepheus: rootdir: Report max frequency to miHoYo games
* Reference: 016179b5c5

Signed-off-by: alanndz <alanndz@qmail.id>
2023-06-12 17:55:23 -05:00
Jimmy Shiu
004c389b94 cepheus: rootdir: Always report max cpu freq to unity tasks
Unity app incorrectly sets cpu affinity to max capacity cores.
Setup the library name and mask to always report the same max
cpu freq to the tasks.

Bug: 165524141
Bug: 161324271
Test: build and test the 'HearthStone' game.
Change-Id: I3382ea8361f1825a81553f032557ad1f40664dcf
2023-06-12 17:55:23 -05:00
Georg Veichtlbauer
78d3a0ae78 cepheus: Drop debug.sf.latch_unsignaled property
latch_unsignaled defaults to auto single layer in Android 13.

Change-Id: I8d38f3257b5f6b56c0f6b79cf4fb406a47d64af8
2023-06-12 17:55:15 -05:00
balgxmr
de33be9dab cepheus: Remove parts/
- Since I've removed Doze to build proper impl on previous
  commits, let's also remove entire parts folder.
- This removes Clear Speaker.

Signed-off-by: balgxmr <jose@pixelos.net>
2023-06-10 16:41:14 -05:00
balgxmr
432f0c69e7 cepheus: overlay: Enable proximity sensor check on doze
- Enabled since I don't want AOD enabled while the device
  is in my pocket. I may revert this, let's first test
  how the battery usage goes.

Signed-off-by: balgxmr <jose@pixelos.net>
2023-06-10 16:33:55 -05:00
balgxmr
3f46f13d47 cepheus: overlay: Enable pulse pickup on doze
Signed-off-by: balgxmr <jose@pixelos.net>
2023-06-10 16:33:55 -05:00
Sebastiano Barezzi
06f71ca955 cepheus: Build Xiaomi sensors impl
Change-Id: Ib477ac016c312ce02e9f71df2a7d1d0fcca717e8
2023-06-10 16:33:48 -05:00
balgxmr
080c3e26df cepheus: parts: Remove Doze
- I'll be switching to proper xiaomi sensor impl.

Signed-off-by: balgxmr <jose@pixelos.net>
2023-06-10 16:27:26 -05:00
balgxmr
9f391baab4 cepheus: Build more media packages
Signed-off-by: balgxmr <jose@pixelos.net>
2023-06-10 16:27:25 -05:00
balgxmr
cb00aa8a0d Revert "cepheus: Include support for NGA"
This reverts commit 049215e5ca.
2023-06-10 16:27:25 -05:00
balgxmr
e256984388 Revert "cepheus: powerhint: Set to powersave governor when device is idle"
This reverts commit 2398964cd1.
2023-05-23 14:10:43 -05:00
balgxmr
c6673d71d8 Revert "cepheus: Enable ro.hwui.render_ahead and set it to 20 frames"
This reverts commit 2f209c0288.
2023-05-23 14:10:28 -05:00
balgxmr
52935a7012 Revert "cepheus: 3 frame render ahead"
This reverts commit 1f175778ce.
2023-05-23 14:10:20 -05:00
Bart Van Assche
d1f9ec1c31 cepheus: task_profiles: Convert tabs into spaces
Commit 9c0fcbb0f710 ("libprocessgroup: Add I/O scheduler attributes to
task_profiles.json") accidentally introduced tabs in task_profiles.json.
Convert these tabs into spaces.

Bug: 213617178
Change-Id: I7ac59dbd40aa3da295646792e35b8275fbb97991
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Signed-off-by: DennySPb <dennyspb@gmail.com>
2023-05-09 17:06:08 -05:00
balgxmr
e95f64f4a9 cepheus: Import task_profiles.json from YAAP and use cgroups.json 2023-05-09 17:06:08 -05:00
kondors1995
1711fe2bbc cepheus: overlay: sync brightness overlays with coral 2023-05-09 17:06:08 -05:00
baalgx
e5a425968c cepheus: overlay: Fix "policy" typo in power_profile
Signed-off-by: baalgx <jose@pixelos.net>
2023-05-09 17:06:07 -05:00
Georg Veichtlbauer
cf0ae8795d cepheus: overlay: Update deprecated screen power items
* screen.on -> screen.on.display0
* screen.full -> screen.full.display0

AOSP frameworks/base: 8ac63071a4e6da7e0740f5eb6c6753218efcfd3a

Change-Id: Iad50e6cb63368e2d71e6fa1dbb6997c0f95d321e
2023-05-09 17:06:07 -05:00
baalgx
b674376e1f cepheus: overlay: Update power_profile from coral
- Adapt battery capacity to cepheus.
- Dropped inefficient frequencies

Signed-off-by: balgxmr <jose@pixelos.net>
2023-05-09 17:05:57 -05:00
balgxmr
4bdcf75ae7 cepheus: powerhint: Tune flipendo powerhints
Signed-off-by: balgxmr <jose@pixelos.net>
2023-05-07 10:59:04 -05:00
Subhajeet Muhuri
23384f480f cepheus: powerhint: Remove audio hints
Signed-off-by: Subhajeet Muhuri <subhajeet.muhuri@aosip.dev>
Change-Id: Ife1cb1e356e62283f3c4d353931458adaf84e975
2023-05-07 10:58:49 -05:00
Nauval Rizky
ddde68a999 cepheus: powerhint: Remove hints for Adaptive Battery CPU Throttling
Change-Id: I3dd740f80535d2c6b782f00e473833caf6f39bc5
2023-05-07 10:58:48 -05:00
balgxmr
fb7aa972bc cepheus: powerhint: Bring back some hints
- And remove DefaultIndex from little, big, big+ clusters' min freq

Signed-off-by: balgxmr <jose@pixelos.net>
2023-05-07 10:58:43 -05:00
Sugakesshaa
2398964cd1 cepheus: powerhint: Set to powersave governor when device is idle
* This should help improve drains while device on idle

Change-Id: Idb36c4274382401a4e3c10105cfca0431997f87b
2023-05-07 00:21:12 -05:00
Georg Veichtlbauer
c9fd60682d cepheus: Remove max ZRAM compression streams setting
Kernels >4.7 will create a comp stream for each online CPU
and ignore /sys/block/max_compression_streams. This has been
backported to many 4.4 kernels as well.

Any device running a kernel with the upstream commit can safely remove
the parameter.

Upstream commit: 43209ea2d1

Change-Id: Ibb29b54a31f0fb5bd941d7709d15d571dd77ebf5
2023-05-07 00:21:12 -05:00
balgxmr
890ce3d951 Revert "cepheus: rootdir: zram -> vbswap"
This reverts commit 121d5599b8.
2023-05-07 00:21:12 -05:00
balgxmr
74be7f2370 Revert "cepheus: Treat vbswap as zram"
This reverts commit c26a3a647f.
2023-05-07 00:21:06 -05:00
José M
2adcf1e9e3 cepheus: Enable zygote preforking 2023-04-23 16:15:55 -05:00
balgxmr
8b54136343 Revert "cepheus: overlay-aosp: Change default FOD pressed color to cyan"
This reverts commit 4a864efaea.
2023-04-23 15:01:48 -05:00
balgxmr
049215e5ca cepheus: Include support for NGA
* Next Generation Assistant
2023-04-23 15:01:44 -05:00
balgxmr
0acdef56a0 cepheus: Update vendor.qti.ims.rcsservice.xml sha1sum 2023-04-23 15:01:39 -05:00
balgxmr
16d31a1018 cepheus: Set shipping API level 2023-04-23 15:01:37 -05:00
Sultanxda
edaa106cbe cepheus: Disable vendor.audio.feature.kpi_optimize.enable
We're not using perfd so this is useless.

Change-Id: I862d8bf175c8a99e525f50250ef900cc84da89d9
Signed-off-by: NotZeetaa <rodrigo2005contente@gmail.com>
2023-04-23 15:01:34 -05:00
Sebastiano Barezzi
11b9544b64 cepheus: Correct SoC manufacturer name
Change-Id: Id17eb30edab6c0343d6676d2e3d299cdc6f3977b
2023-04-23 15:01:25 -05:00
John Galt
1f175778ce cepheus: 3 frame render ahead
Stock 60hz is 0, >60hz is 1. The extra 2-3 frames benefit jank without
adding much input latency.
2023-04-23 15:01:19 -05:00
ExactExampl
2f209c0288 cepheus: Enable ro.hwui.render_ahead and set it to 20 frames
* Rendering ahead makes some animations handling better (especially qs pulldown on a13 qpr2)

Change-Id: I3e732cfbd22d30df9843d3b7d2762ec59cf0f6a7
2023-04-23 15:01:14 -05:00
balgxmr
913adca7d4 cepheus: Cleanup 2023-04-23 15:01:08 -05:00
balgxmr
d551e9b863 cepheus: sepolicy: Remove duplicate extcon labels
* Needed after: 04b5abe092

Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 15:01:06 -05:00
AngeloGioacchino Del Regno
7d32600bbb cepheus: Enable Video Distribution Profile (VDP) on IMS
Enable support for the Video Distribution Profile (VDP) on the
IP Multimedia Subsystem (IMS) to enable operator video-calling
functionality on 4G IMS if the carrier supports it.

Signed-off-by: shield44 <shield44@pixelexperience.org>
Change-Id: Iba23e5fb308a7b7868e910bc17634800c10e0a13
2023-04-23 15:01:02 -05:00
Park Ju Hyung
c26a3a647f cepheus: Treat vbswap as zram
- To reduce complications in terms of sepolicies.

Change-Id: I3a3ee486063518ddc1f3b63efd2525e99ee0d7f0
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Alex Winkowski <dereference23@outlook.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2023-04-23 15:00:58 -05:00
balgxmr
121d5599b8 cepheus: rootdir: zram -> vbswap 2023-04-23 15:00:56 -05:00
chematelegram
a6abecbfaa Revert "cepheus: Improve boot time and pull in bootanim display time"
This reverts commit 0939cab.
2023-04-23 15:00:53 -05:00
Adithya R
a7260866c5 Revert "cepheus: overlay: Configure SQLite to operate in MEMORY mode"
These optimizations are unsafe and unnecessary.

This reverts commit a61cd33bca20d348026bf6f903cf0b3e2d694a02.

Change-Id: I4a6c3ad58c832cecd1765fa45b866e786aa4259e
Signed-off-by: NotZeetaa <rodrigo2005contente@gmail.com>
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 15:00:49 -05:00
Bruno Martins
2715beb6dd cepheus: Deduplicate handheld_core_hardware.xml copy rule
Since Android 10 that this is already done while inheriting from
full_base_telephony.mk.

Change-Id: If533fbf95a9cf9798ddba24955a624d26f550d62
2023-04-23 15:00:45 -05:00
baalgx
abd2241c89 cepheus: SmoothCutoutOverlay: Add spanish translation
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 15:00:42 -05:00
baalgx
e2fcdcd699 cepheus: Move SmoothCutoutOverlay into RRO
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 15:00:40 -05:00
balgxmr
9cf265e74f cepheus: configs: powerhint: Update little cluster min freq
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 15:00:36 -05:00
balgxmr
7ef76bf2a5 cepheus: configs: powerhint: Update GPU frequencies
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 15:00:33 -05:00
balgxmr
4689895309 Remove actions and funding 2023-04-23 15:00:30 -05:00
Pranav Vashi
e0f0797cfc cepheus: audio: Update supported sampling rates
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-04-23 15:00:06 -05:00
Dragos Sabau
5ed63e6a03 cepheus: audio: Fix low mic volume on VoIP
- low volume mic for some social apps like snapchat , telegram, instagram etc
2023-04-23 15:00:05 -05:00
Giovanni Ricca
f58d907831 cepheus: audio: Don't advertise vorbis offloading support
* AUDIO_FORMAT_VORBIS is long gone

Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
Change-Id: Ie87c589bb1ee0aafa72c75fe06819402d3e78130
2023-04-23 15:00:05 -05:00
Dobsgw
cf7794bb03 cepheus: audio: fixup audio io policy voip_rx flags
Flags for VOIP were mixed up as we move to CAF policy configuration. Amend the flags to get things working again.

https://gitlab.com/LineageOS/issues/android/-/issues/4285

Co-authored-by: Ramii Ahmed <ramy@ahmedramy.com>
Change-Id: I2a2b202e2a58db9a26f571c091b1fa0b8f2949f6
Signed-off-by: Joey Huab <joey@evolution-x.org>
Signed-off-by: Pranav Temkar <pranavtemkar@gmail.com>
2023-04-23 15:00:05 -05:00
llololo
aeb91a2716 cepheus: audio: Add new flag name to compress offload case
Add AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD to compress offload case.

Bug: 188113788
Test: Play compress offload music and check app type from logcat
Change-Id: If31a50ffafb43cb350c84fcc60774af116f30ff8
2023-04-23 15:00:04 -05:00
Weiyin Jiang
4fdada3ad7 cepheus: audio: add compress recording configurations
Add compress recording configurations

CRs-Fixed: 2764160
Change-Id: I8e8b1f89d7f28d997342c5946d0a35111e941ec1
2023-04-23 15:00:04 -05:00
justinweng
e789ea7686 cepheus: audio: enforce 24-bit audio for offload playback
Test: Audio Playback

Change-Id: Ia581e65a0e5e8dcbfae188fe36ca9d07bd9eb4e2
Signed-off-by: justinweng <justinweng@google.com>
2023-04-23 15:00:04 -05:00
justinweng
7900bbeefe cepheus: audio: update audio_io_policy for VoIP
Add VoIP Tx app type config for pcm and low-latency captures.

Bug: 133297310
Test: make a voip call

Change-Id: I5dd67167b7568fd08a7ae979b50417f2627dc7d9
Signed-off-by: justinweng <justinweng@google.com>
2023-04-23 15:00:03 -05:00
justinweng
1d85ca8512 cepheus: audio: offload 24 bits playback supports aac format
compress_offload_24 supports aac format

Change-Id: I5742db45908f9d600cab0fef62badf447fc5c585
Signed-off-by: justinweng <justinweng@google.com>
2023-04-23 15:00:03 -05:00
balgxmr
1d2627ba8e cepheus: audio: Move audio_io_policy.conf into device tree 2023-04-23 14:59:59 -05:00
balgxmr
e9d121e8c0 cepheus: Refactor audio configuration copying to use find-copy-subdir-files
* Ref: aa475ee1a7 (diff-a9b707be450acdc01d52515e6b84fb8eed8a8cfb468e684a7128271ae6d5c22bR163)

Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 14:59:48 -05:00
ANUSH MADATHUMKARA
00c9797f0c cepheus: configs: audio: Use QCOM implementation for audio effects
- AOSP effects doesn't give as thicc'n'sicc bass boost as the QC effects do.

Co-authored-by: johnmart19 <johnivan19999@gmail.com>
Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com>
2023-04-23 14:59:45 -05:00
balgxmr
2dfe7d6dc6 cepheus: configs: audio: Move audio_effects.xml into device tree
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-23 14:59:42 -05:00
balgxmr
dd20f0720c cepheus: SystemUIGoogle -> SystemUI 2023-04-23 14:59:37 -05:00
John Galt
e06cde02a0 cepheus: update adreno to LA.UM.9.14.r1-21000-LAHAINA
V@0530.47 (GIT@eaa701cd06, I183f6321f0, 166871261) (Date:10/27/22)

TEST: a PIP glitch is resolved, grid autosport still launches
2023-04-12 18:36:18 -05:00
balgxmr
bfba36ff0c cepheus: rootdir: Move Utilization Clamp Assist tunings to kernel 2023-04-12 18:36:18 -05:00
balgxmr
9ff8f58dc5 Revert "cepheus: rootdir: Switch to s2idle"
This reverts commit cea62dc868
2023-04-12 18:36:17 -05:00
Bruno Martins
4f7ee37fa8 cepheus: overlay: Set BT controller voltage in the power profile
This was usually set in frameworks/base, but the overlay has been
deprecated in Android 13.

Change-Id: Ie1dc66c34e562179003e6294241bd5900859248a
2023-04-12 18:36:17 -05:00
balgxmr
98f43d4570 cepheus: rootdir: Drop allocstall threshold and swappiness values from post boot script 2023-04-12 18:36:11 -05:00
kdrag0n
ff05c63f3d cepheus: overlay: Offload WM shell to another thread
Android 12 added this config to offload some window management to a
dedicated thread. Enable it to improve performance when the main System
UI thread is busy.

Change-Id: I9eef4cdbc26d0880f3a9aaf875d5e36ebd693238
2023-04-12 18:36:02 -05:00
rds-007
89b538520f cepheus: Remove Pasrmanager 2023-04-12 18:36:01 -05:00
Sebastiano Barezzi
045c45cd2c cepheus: sepolicy: Reorder wakeup nodes labels
* LC_ALL=C sort -u

Change-Id: Idd8e36dcade8154ebcb519e74af0cb0cdbc05b12
Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-12 18:36:01 -05:00
balgxmr
3e3e0d025b cepheus: sepolicy: Fix wakeup denial
E/android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup15 (../../devices/platform/soc/890000.i2c/i2c-0/0-003b/power_supply/idt/wakeup15): Permission denied

Signed-off-by: balgxmr <jose@pixelos.net>
2023-04-12 18:36:01 -05:00
Andrzej Perczak
7e971b9a2e cepheus: Update surfaceflinger props
This change is based on sm8350 configuration in display hal [1].
Additionally, I removed old nonexistent props.

Please note that debug.sf.disable_backpressure is present in R (however removed in S) but
is not enabled on google devices nor newest qcom SOCs.

This change made UI much more fluent.

[1] https://source.codeaurora.org/quic/la/platform/hardware/qcom/display/tree/config/display-product.mk?h=LA.UM.9.16.r2-02800-MANNAR.0

Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Change-Id: I3e9118ae48e145ff102be6f3ecac898fbf098843

[balgxmr: Original commit -> 45a517d875]
2023-04-12 18:35:57 -05:00
Dyneteve
7e06c00e7b cepheus: overlay: Configure default light sensor type
Fixes adaptive brightness after r35 merge
2023-03-28 15:04:48 -05:00
dianlujitao
98884fd63d cepheus: Fix non-ASCII character in gps.conf
:caf:

Change-Id: Iea9c44c0fbad574cbc077feea3d9f1de83d7d99a
2023-03-28 15:04:48 -05:00
balgxmr
fc50c0068f cepheus: Remove dead build targets 2023-03-28 15:04:47 -05:00
balgxmr
a3876cffba cepheus: overlay: Set DISPLAY_P3 for adaptive color mode 2023-03-28 15:04:47 -05:00
balgxmr
8e1198cfae cepheus: overlay: Stop pinning non-existent 32-bit libCB.so
- Fixes:

E/PinnerService( 1746): Could not pin file /vendor/lib/libCB.so
E/PinnerService( 1746): android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/PinnerService( 1746): 	at libcore.io.Linux.open(Native Method)
E/PinnerService( 1746): 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
E/PinnerService( 1746): 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
E/PinnerService( 1746): 	at android.system.Os.open(Os.java:494)
E/PinnerService( 1746): 	at com.android.server.PinnerService.pinFileRanges(PinnerService.java:975)
E/PinnerService( 1746): 	at com.android.server.PinnerService.pinFile(PinnerService.java:850)
E/PinnerService( 1746): 	at com.android.server.PinnerService.handlePinOnStart(PinnerService.java:305)
E/PinnerService( 1746): 	at com.android.server.PinnerService.-$$Nest$mhandlePinOnStart(Unknown Source:0)
E/PinnerService( 1746): 	at com.android.server.PinnerService$PinnerHandler.handleMessage(PinnerService.java:1219)
E/PinnerService( 1746): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/PinnerService( 1746): 	at android.os.Looper.loopOnce(Looper.java:201)
E/PinnerService( 1746): 	at android.os.Looper.loop(Looper.java:288)
E/PinnerService( 1746): 	at android.os.HandlerThread.run(HandlerThread.java:67)
E/PinnerService( 1746): Failed to pin file = /vendor/lib/libCB.so

Signed-off-by: balgxmr <jose@pixelos.net>
2023-03-28 15:04:31 -05:00
Alexander Koskovich
547b9d49de cepheus: Move ueventd.qcom.rc to /vendor/etc.
* This is the preferred location as of Android 12.

Change-Id: I8c7d2230281b6d8da802bf10f88461289849acaf
2023-03-12 12:53:23 -05:00
Jake Weinstein
948e3de067 cepheus: CarrierConfig: Enable VoWiFI and VoLTE by default.
Change-Id: If4fbb608f8628cb9288aac8e5cc0c25506c9bde2
Signed-off-by: Gagan Malvi <malvigagan@gmail.com>
2023-03-12 12:53:23 -05:00
Gagan Malvi
b956fddead cepheus: CarrierConfig: Update overlay from LA.QSSI.13.0.r1-07400-qssi.0
Change-Id: I59806e16f51d30fa7b352ba1e6fb7c38e980e299
Signed-off-by: Gagan Malvi <malvigagan@gmail.com>
2023-03-12 12:53:23 -05:00
Dyneteve
1865c7bc31 cepheus: CarrierConfig: disable HD Logo
* sed -i 's|<boolean name=\"config_update_service_status\" value=\"true\"/>|<boolean name=\"config_update_service_status\" value=\"false\"/>|g' overlay/packages/apps/CarrierConfig/res/xml/vendor.xml

Change-Id: I38015fb6062325d185d67a710308aff56c32c139
2023-03-12 12:53:23 -05:00
Jake Weinstein
946b1bbd8c cepheus: CarrierConfig: Disable global mode and CDMA choices
Cleans up mobile network settings

Change-Id: Ib331062fa77a18661bbfcd1a49f62ddf9144228c
2023-03-12 12:53:15 -05:00
UtsavBalar1231
a2c2f48875 cepheus: CarrierConfig: Update overlays from LA.QSSI.11.0.r1-09400-qssi.0
Change-Id: I05006c12949f097165367e06d582c00eccca7dc1
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2023-03-12 12:52:36 -05:00
balgxmr
9a2c176036 Revert "cepheus: Configure display composition colors"
This reverts commit 2a3a6d27ae.

* With this some users are having difficulties
  to register fingerprint.
2023-03-06 16:00:26 -05:00
balgxmr
4f8989a57d Revert "cepheus: Switch BtAudio to AIDL"
This reverts commit f03435cfa0.
2023-03-05 15:25:56 -05:00
José M
374d144e99 cepheus: Set latch unsignaled prop to 1 2023-03-04 01:16:28 -05:00
EcrosoftXiao
7ee6cd4fa6 fixup! cepheus: fingerprint: Refactor for udfps sensor 2023-03-02 19:20:06 -05:00
EcrosoftXiao
d6a5ab5cc3 cepheus: sensors: udfps: Rename to avoid naming conflict 2023-03-02 19:20:06 -05:00
EcrosoftXiao
98249c989c cepheus: fingerprint: Refactor for udfps sensor 2023-03-02 19:20:06 -05:00
EcrosoftXiao
3505d0610f cepheus: Switch to udfps sensor impl 2023-03-02 19:20:00 -05:00
Ivan Vecera
9e79c01941 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-03-02 19:19:44 -05:00
balgxmr
e203df42d4 cepheus: sepolicy: Allow PowerHal to access touchpanel node for DT2W 2023-03-01 15:07:35 -05:00
balgxmr
1e55055f3b cepheus: Switch to power-libperfmgr AIDL DT2W
* Using /proc/touchpanel/wake_gesture node

Signed-off-by: balgxmr <jose@pixelos.net>
2023-03-01 15:07:34 -05:00
balgxmr
b2190e6ed4 cepheus: Import deviceInfoServiceModule.so from stock
- Fixes: E/RILD: deviceInfoServiceModule dlopen failed ERROR:dlopen failed: library "/vendor/lib64/deviceInfoServiceModule.so" not found

Signed-off-by: balgxmr <jose@pixelos.net>
2023-03-01 15:07:26 -05:00
Edwin Moquete
5cfc343eab cepheus: Restore vendor bluetooth props
These are read by the BT audio blobs, even without the
QTI BT stack.

Change-Id: Ia2335bedfd7e19899c2cb32c23fcc664f2cfe8ce
2023-02-24 19:23:34 -05:00
Chenyang Zhong
c281f3d8e8 cepheus: add the missing vendor.qti.imsrtpservice@3.1
Otherwise, carrier video calling is broken.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2023-02-22 20:46:17 -05:00
balgxmr
594dfa243b cepheus: Remove unneeded camera flag 2023-02-22 20:44:01 -05:00
balgxmr
cea62dc868 cepheus: rootdir: Switch to s2idle 2023-02-22 20:44:01 -05:00
balgxmr
782e59335a cepheus: Include Live Wallpapers 2023-02-22 20:44:01 -05:00
trpsl
2ddfd79aed cepheus: Tone down CamX and CHIUSECASE logging
Signed-off-by: penglezos <panagiotisegl@gmail.com>
Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-22 20:44:01 -05:00
Sebastiano Barezzi
96c93cd924 cepheus: audio: Use AOSP USB v2 audio HAL
Change-Id: I579e442a8c41ec62acc1e5be7478889bf5bc24b8
2023-02-22 20:44:00 -05:00
penglezos
2a3a6d27ae cepheus: Configure display composition colors
- Enable WGC mode
- Enable QDCM combined mode

Signed-off-by: penglezos <panagiotisegl@gmail.com>
2023-02-22 20:44:00 -05:00
José M
7c7a57b8ee cepheus: overlay: Remove 4K video support from (2.0x) telephoto
- Not supported, camera goes black.

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-22 20:44:00 -05:00
balgxmr
022e034e41 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-22 20:44:00 -05:00
Chenyang Zhong
dedb412984 cepheus: sepolicy: Allow system_server to get app_zygote pgid
E system_server: Cannot read thread CPU times for PID 1484
2023-02-22 20:44:00 -05:00
GhostMaster69-dev
a553d4831f cepheus: sepolicy: Add /proc/last_kmsg rules
Fixes:
W BootReceiver: cannot read last msg
W BootReceiver: java.io.FileNotFoundException: /proc/last_kmsg: open failed: EACCES (Permission denied)
W BootReceiver: 	at libcore.io.IoBridge.open(IoBridge.java:574)
W BootReceiver: 	at java.io.FileInputStream.<init>(FileInputStream.java:160)
W BootReceiver: 	at android.os.FileUtils.readTextFile(FileUtils.java:637)
W BootReceiver: 	at com.android.server.BootReceiver.logFsShutdownTime(BootReceiver.java:649)
W BootReceiver: 	at com.android.server.BootReceiver.logBootEvents(BootReceiver.java:305)
W BootReceiver: 	at com.android.server.BootReceiver.-$$Nest$mlogBootEvents(Unknown Source:0)
W BootReceiver: 	at com.android.server.BootReceiver$1.run(BootReceiver.java:139)
W BootReceiver: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
W BootReceiver: 	at libcore.io.Linux.open(Native Method)
W BootReceiver: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W BootReceiver: 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
W BootReceiver: 	at libcore.io.IoBridge.open(IoBridge.java:560)
2023-02-22 20:44:00 -05:00
balgxmr
04817bab2d Revert "cepheus: fingerprint: update for new implementation"
This reverts commit ed4a61cc8e.
2023-02-22 20:44:00 -05:00
balgxmr
508809fd4f Revert "cepheus: overlay-aosp: Disable color inversion preference"
This reverts commit 55aa44dd69.
2023-02-22 20:43:59 -05:00
balgxmr
237a49921e Revert "cepheus: LiveDisplay/AntiFlicker: Switch to new interface"
This reverts commit 010fda55c0.
2023-02-22 20:43:59 -05:00
penglezos
b231d74f0d cepheus: Move nosdcard product characteristic into correct make file 2023-02-22 20:43:59 -05:00
balgxmr
39ba909749 cepheus: Reorder blobs list
Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:33:48 -05:00
balgxmr
b1b17f366a cepheus: powerhint: Checkout powerhint to raphael
From (SyberiaOS) kondors1995's raphael tree: https://github.com/SOVIET-ANDROID/device_xiaomi_raphael/blob/13.0/configs/etc/powerhint.json
- Reworked and added back some hints according to coral.
- GPU idle timeout from 80ms to 58ms as per kernel change in [1].
- Added Flipendo hints.
- Set launch boost to 3s instead of 5s.

[1]: b92e350fe8

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:33:48 -05:00
balgxmr
9ad08a924f cepheus: Switch to playground clang 2023-02-11 23:33:48 -05:00
UtsavBalar1231
6ac2c4433f cepheus: sepolicy: Label qcom extcon sysfs
This fixes:
W android.ui: type=1400 audit(0.0:37): avc: denied { read } for name="name" dev="sysfs" ino=60802 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,usb-pdphy@1700/extcon/extcon4/cable.1/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: java.io.FileNotFoundException: /sys/class/extcon/extcon4/cable.1/name: open failed: EACCES (Permission denied)
W ExtconUEventObserver: 	at libcore.io.IoBridge.open(IoBridge.java:574)
W ExtconUEventObserver: 	at java.io.FileInputStream.<init>(FileInputStream.java:160)
W ExtconUEventObserver: 	at android.os.FileUtils.readTextFile(FileUtils.java:637)
W ExtconUEventObserver: 	at com.android.server.ExtconUEventObserver$ExtconInfo.<init>(ExtconUEventObserver.java:222)
W ExtconUEventObserver: 	at com.android.server.ExtconUEventObserver$ExtconInfo.initExtconInfos(ExtconUEventObserver.java:173)
W ExtconUEventObserver: 	at com.android.server.ExtconUEventObserver$ExtconInfo.getExtconInfoForTypes(ExtconUEventObserver.java:185)
W ExtconUEventObserver: 	at com.android.server.policy.PhoneWindowManager.initializeHdmiStateInternal(PhoneWindowManager.java:3709)
W ExtconUEventObserver: 	at com.android.server.policy.PhoneWindowManager.initializeHdmiState(PhoneWindowManager.java:3672)
W ExtconUEventObserver: 	at com.android.server.policy.PhoneWindowManager.init(PhoneWindowManager.java:2121)
W ExtconUEventObserver: 	at com.android.server.wm.WindowManagerService$5.run(WindowManagerService.java:1186)
W ExtconUEventObserver: 	at android.os.Handler$BlockingRunnable.run(Handler.java:965)
W ExtconUEventObserver: 	at android.os.Handler.handleCallback(Handler.java:942)
W ExtconUEventObserver: 	at android.os.Handler.dispatchMessage(Handler.java:99)
W ExtconUEventObserver: 	at android.os.Looper.loopOnce(Looper.java:201)
W ExtconUEventObserver: 	at android.os.Looper.loop(Looper.java:288)
W ExtconUEventObserver: 	at android.os.HandlerThread.run(HandlerThread.java:67)
W ExtconUEventObserver: 	at com.android.server.ServiceThread.run(ServiceThread.java:44)
W ExtconUEventObserver: 	at com.android.server.UiThread.run(UiThread.java:45)
W ExtconUEventObserver: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
W ExtconUEventObserver: 	at libcore.io.Linux.open(Native Method)
W ExtconUEventObserver: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W ExtconUEventObserver: 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
W ExtconUEventObserver: 	at libcore.io.IoBridge.open(IoBridge.java:560)
W ExtconUEventObserver: 	... 17 more

Similarily
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/88e0000.qcom,msm-eud/extcon/extcon2/cable.1/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,qpnp-smb5/extcon/extcon3/cable.1/name. This probably means the selinux policies need to be changed.

Test: Label these sysfs and boot into system

Change-Id: I94f2407d404e7dd33975b6d825d207c0b6208714
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:33:48 -05:00
Cyber Knight
09dc6dc60c 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-11 23:33:48 -05:00
Georg Veichtlbauer
80033e13af cepheus: Fix PowerOffAlarm
* The APK is prepared to not run as system user
* Adjust /persist/alarm/data permissions accordingly

Change-Id: Ie24ccb3749d1dda2deb670cdb531e35d153034ed
2023-02-11 23:33:47 -05:00
Qimeng Pan
395353b55b 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-11 23:33:47 -05:00
Mao Jinlong
149382ac86 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-11 23:33:47 -05:00
Mao Jinlong
fdb8d1cd49 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-11 23:33:47 -05:00
balgxmr
aa84cbf8e7 cepheus: Switch to OSS mtdservice 2023-02-11 23:26:43 -05:00
balgxmr
088e1c0f41 cepheus: Switch to OSS Mlipay 2023-02-11 23:26:43 -05:00
balgxmr
e206ffbc64 cepheus: Add back AAPT config
This reverts commit 66af840a62

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:26:42 -05:00
balgxmr
82dededd45 cepheus: Remove unneeded TARGET_SUPPORTS_QUICK_TAP flag 2023-02-11 23:26:42 -05:00
balgxmr
f91fb2693a cepheus: overlay: Remove unneded 5G configs in CarrierConfig
* Mi 9 nor any of the SM8150 devices have 5G support

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:26:12 -05:00
PIPIPIG233666
4a864efaea cepheus: overlay-aosp: Change default FOD pressed color to cyan
* https://developers.google.com/speed/webp.

Change-Id: I98c71ca00efdd25a99c463d518f07522821f6e95
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-02-11 23:21:51 -05:00
Alexander Martinz
7567274a8b cepheus: Drop aptx blobs
They live within the bluetooth apex now.

Change-Id: I01ef1d665ce05b7ce5b1ee03129ccf3ce6058634
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2023-02-11 23:21:51 -05:00
Alexander Koskovich
ba3506d370 cepheus: Update telephony package list to LA.QSSI.12.0.r1-05600-qssi.0
Change-Id: Id6fdabd9d5e0df6d23a982e0e39e06a8acff67ef
2023-02-11 23:21:51 -05:00
Georg Veichtlbauer
d01471ef69 cepheus: Drop config_setColorTransformAccelerated
It's now enabled by default

Change-Id: I57f059c872fc2ad2fd15e788b1391eeebaff9bde
2023-02-11 23:21:50 -05:00
Edwin Moquete
0685c5d9d4 cepheus: Remove unused persist.bluetooth.a2dp_offload.cap property
This prop has no effect as of T QPR1.

See: LineageOS/android_packages_modules_Bluetooth@cf25e33

Change-Id: Ic762812dd59429d344ccc55c01bf96b0ffd6dbab
2023-02-11 23:21:50 -05:00
balgxmr
d556f36262 cepheus: config.fs: Checkout to UtsavBalar's raphael tree
* https://github.com/UtsavBalar1231/android_device_xiaomi_raphael/blob/ruby/configs/config.fs
2023-02-11 23:21:50 -05:00
balgxmr
0745279f77 cepheus: configs: Remove security config
* It's now in vendor

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:21:50 -05:00
Arian
187a7f5cb9 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-02-11 23:21:50 -05:00
balgxmr
86eae417a2 cepheus: overlay: Decrease status_bar_padding_start
*  When the status bar is full, icons are
   slightly getting displayed over the dot.

Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:21:50 -05:00
balgxmr
a8a02175a4 Revert "cepheus: rootdir: Import task cpu affinity script from RenderBroken"
This reverts commit 2f7efb9f43.
2023-02-11 23:21:49 -05:00
Albert I
a3a7659b1c cepheus: Inherit several Android Go configurations
Beneficial for everyone, even on non-Go devices.

Change-Id: I088fd00500ce10df5f413cb762aaed2ec00f5dfc
2023-02-11 23:21:49 -05:00
Alec Mouri
407ae2161d cepheus: Force device to treat 170M as sRGB in SF
Bug: 229442032
Test: builds, boots
Change-Id: I2910f9d025ca6a6f3e73544e8f14346cfb0bc177
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2023-02-11 23:21:49 -05:00
Arian
2d5e8c979d cepheus: rootdir: Enable qcrild and data services instead of starting them
* Enabling the services allows them to start at their proper stage (class main)
* Enable them on boot to ensure they are enabled before class main starts

Change-Id: I71c3fcb72b38d247d304fda2fa6b2cc76baa0db2
2023-02-11 23:21:49 -05:00
balgxmr
83fd6f3075 cepheus: Remove iorapd prop 2023-02-11 23:21:49 -05:00
balgxmr
923a1322e0 cepheus: overlay-aosp: Use AOSP default ripple animation duration
Signed-off-by: balgxmr <jose@pixelos.net>
2023-02-11 23:21:44 -05:00
Bruno Martins
293a73c330 cepheus: overlay: Unlock additional camera framerates
Signed-off-by: balgxmr <jose@pixelos.net>
2023-01-30 15:53:56 -05:00
balgxmr
b5e08bdfe1 cepheus: Move flash dummy super image script into configs
Signed-off-by: balgxmr <jose@pixelos.net>
2023-01-30 15:53:55 -05:00
basamaryan
8b3d61691f cepheus: overlay-aosp: Disable Pocket Lock
Change-Id: I28ecec5521e4301ed952d95bc8a8075395cc9393
2023-01-30 15:53:55 -05:00
Pullakavi Srinivas
ad0b3770a6 cepheus: Disable SF composition prediction model
CRs-Fixed: 3243885
Change-Id: I64f82a25768b561bb343fdb7686b7d6c020d024a
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Sarthak Roy <sarthak@pixelos.net>
2023-01-30 15:53:55 -05:00
Alex Sarraf
20c1ad21f2 cepheus: display: Disable SF client composition cache
Disable SF client composition cache. Helps with framework
client target fence management.

Change-Id: I73e03e76f51d00fafad38479be00f4005be50665
2023-01-30 15:53:50 -05:00
balgxmr
7e4cf12659 cepheus: sepolicy: Remove duplicate wakeup nodes
* These are now labeled in: 2a10510846

Signed-off-by: balgxmr <jose@pixelos.net>
2023-01-22 20:16:31 -05:00
John Galt
010fda55c0 cepheus: LiveDisplay/AntiFlicker: Switch to new interface
Use new CSC implementation of DC Dimming.
2023-01-20 22:35:43 -05:00
balgxmr
0fc52f85fb cepheus: overlay: Improve status bar padding 2023-01-20 22:35:43 -05:00
Peter Cai
004a154ac0 cepheus: sepolicy: Make recovery permissive
* I don't want to accomodate for every case of custom mods.
2023-01-20 11:09:06 -05:00
balgxmr
50682b8c85 cepheus: parts: Use some strings from LOS resources
* And also add clear speaker strings in Spanish language.
2023-01-20 11:08:45 -05:00
balgxmr
fe5e29836e cepheus: parts: Cleanup Dirac, thermal and DC dimming leftovers
* Was part of: d1bc25f919 and 34e2330754
2023-01-20 11:08:45 -05:00
Bruno Martins
8106feb9ec cepheus: parts: Fix compilation for QPR1 merge
Change-Id: I71ad7db85592ca18e3f0f8155bba5a472bfadbaa
2023-01-20 11:08:44 -05:00
Adithya R
1ae4fb433d cepheus: rootdir: Lower down rate limit for prime CPU
Since the big and prime clusters consume more power,
they should not be prevented from lowering frequencies
for longer periods. Instead it should be for the little
cluster, that consumes lesser power and has higher load.
2023-01-20 11:08:44 -05:00
John Galt
fdc86c9539 cepheus: rootdir: Adapt to UClamp 2023-01-20 11:08:44 -05:00
Bruno Martins
f50e47ee72 cepheus: powerhint: Remove Google-specific camera hints
Change-Id: I06a83be233490f0b23cebd83bb71172b7044727b
2023-01-20 11:08:43 -05:00
Sebastiano Barezzi
87e5b7a399 cepheus: powerhint: Drop EnergyAware node
Change-Id: I42adc40264df0b9c0b03c6862bb0c5703710254d
2023-01-20 11:08:43 -05:00
Sebastiano Barezzi
018b4b7843 cepheus: powerhint: Remove schedtune related stuff
Change-Id: I65c84723943e54eaabdc52571c86a66a71a78fb8
2023-01-20 11:08:43 -05:00
Sebastiano Barezzi
2c9221b4d9 cepheus: powerhint: Don't mess with UFS clkgate
* They cause UFS panics on vayu

Change-Id: Ifad2383bfb92260f97f6140cadae34b6ed60a4d4
2023-01-20 11:08:42 -05:00
Luca Stefani
28e54bf5a2 cepheus: powerhint: Adjust powerhint for QOS interface
Currently all writes to the dev interface are done
by WriteStringToFd that uses char internally.

The current values seem to expect to be written as s32,
this sadly won't happen and triggers a special case in
the write handling of pm_qos_power_write:
it expects char buffers to be encoded as base16 and
decodes them.
This means the current 44 is actually 0x44 -> 68 seen by
the kernel.

Luckily it seems like both accepted values for this node
don't hit the threshold to enter C2, so it was never
noticed in real usage and didn't effect the device
C-States handling during hints.

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: Ic544d4dcaa1edc3de913aed737baf1af88a45360
2023-01-20 11:08:34 -05:00
Sebastiano Barezzi
98da4867df cepheus: Import powerhint.json
* From: https://android.googlesource.com/device/google/coral/+/android-11.0.0_r40/powerhint.json

Change-Id: Ie6946252fc832c37034d733756a7680459d191e2
2023-01-20 11:08:15 -05:00
madmax7896
c073fab083 cepheus: overlay: Update CarrierConfig from LA.QSSI.13.0.r1-07400-qssi.0
* Imported miui CarrierConfig changes from munch V13.0.5.0.SLMMIXM.
* Also organized it a bit.
2023-01-18 22:10:46 -05:00
baalgx
4797bff9cb cepheus: overlay: Drop Display P3 for Adaptive color mode
- This isn't supposed to be used since latest changes on dt and kernel, and is messing around with Night Light.
2023-01-18 22:10:46 -05:00
Ido Ben-Hur
55aa44dd69 cepheus: overlay-aosp: Disable color inversion preference
kernel will no longer support that
2023-01-18 22:10:45 -05:00
RealJohnGalt
ed4a61cc8e cepheus: fingerprint: update for new implementation
[pwnrazr: original commit 4b12b9c878]
2023-01-18 22:10:45 -05:00
baalgx
449d748e08 cepheus: configs: media: Update from LA.UM.9.1.r1-13000-SMxxx0.QSSI13.0
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 22:10:45 -05:00
Jake Weinstein
7615819b87 cepheus: msm_irqbalance: Do not balance msm_drm and kgsl-3d0 IRQs
These are critical for display performance and should not be balanced
in order to improve latency and responsiveness.

Change-Id: I0248e26a7154c689c0d3f11dabe14a1b149353f9
2023-01-18 22:10:44 -05:00
baalgx
56189fa774 cepheus: Move msm_irqbalance.conf into device tree
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 22:10:44 -05:00
AdarshGrewal
975644d8c5 cepheus: Include MiuiCamera if exists 2023-01-18 22:10:44 -05:00
EcrosoftXiao
9ac7efffab cepheus: sepolicy: Label vendor.xiaomi.hardware.campostproc service
Change-Id: If9fe7e6131fff272d6311ca2ea30c3c61ecfee36
2023-01-18 22:10:43 -05:00
AndroidHQ254
9e422d583c 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-18 22:10:43 -05:00
baalgx
c880f310af 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-01-18 22:10:43 -05:00
baalgx
36db35bca7 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-01-18 22:10:42 -05:00
Adithya R
e89457f4d5 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-18 22:10:42 -05:00
Nolen Johnson
622103b067 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-18 22:10:42 -05:00
Albert I
fe891774d7 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-18 22:10:41 -05:00
Sebastiano Barezzi
baf6e20ee5 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-18 22:10:41 -05:00
Chenyang Zhong
b1775e1d5c 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-18 22:10:41 -05:00
Bruno Martins
8d03d426aa cepheus: libqti-perfd-client: Remove namespace declaration
It's pointless when using extern "C".

Change-Id: Ibdf9f06a70aa3a75687b33781c78cf2172bb334d
2023-01-18 22:10:40 -05:00
Lucchetto
5c0a3e2fa6 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-18 22:10:40 -05:00
Weikai Kong
a2f1622399 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-18 22:10:40 -05:00
Wei Wang
518018549c cepheus: Remove QTI perfd
Bug: 69270928
Test: Build and boot device and test camera
Change-Id: I87b283206f462fb5c8ec9cdd303ae2934fe9bfc4
2023-01-18 22:10:39 -05:00
ghostrider-reborn
2ae33e1e44 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-18 22:10:39 -05:00
John Galt
2351386ef4 cepheus: inline erofs pcluster size with flash block size
Previous value was from cuttlefish. There's now a reference[1].

[1]: https://source.android.com/docs/core/architecture/kernel/erofs
2023-01-18 22:10:39 -05:00
Omkar Chandorkar
a56001b137 cepheus: move to lz4 for EROFS
- while lz4hc,9 provides better compression ratio, it has the cost of
  tremendous compression time and potential hit while decompressing
- internal tests on aarch64 seem to suggest the decompression hit
  is larger than x86_64

Change-Id: I5c102c03f95ace982b85a6ffa5c33aa9ce4637a4
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
Signed-off-by: itsurboimasarou <medicspam6@gmail.com>
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 22:10:38 -05:00
Gagan Malvi
a10bff650f cepheus: gps: Show errors only
Signed-off-by: Gagan Malvi <malvigagan@gmail.com>
Change-Id: I7a8a2a1a519978721404631fb612c2005accdc70
2023-01-18 22:10:38 -05:00
baalgx
f929038ae6 cepheus: sepolicy: Remove neverallows
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 22:10:38 -05:00
baalgx
df9c974b5f cepheus: Disable Zygote preforking 2023-01-18 22:10:37 -05:00
baalgx
59eb1d90db cepheus: media: Checkout media from LA.UM.9.1.r1-11500.02-SMxxx0.QSSI12.0
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 22:10:37 -05:00
Adithya R
985e4cf9f8 cepheus: properties: Kill off IMS logspam with fire
Change-Id: Iab5bb0c4dec64262d3e636b20f5ec828d933d570
2023-01-18 22:10:37 -05:00
baalgx
fdfaca5a95 cepheus: Build libsensorndkbridge from source
* Dependency of GPS stack

Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 22:10:36 -05:00
chrisw444
626a9a2c1d cepheus: Update GPS blobs from LA.UM.9.1.r1-11500.02-SMxxx0.QSSI12.0
- Taken from 4d2278a7aa
2023-01-18 22:10:36 -05:00
baalgx
12eb1f48e1 cepheus: set TARGET_BOARD_PLATFORM to msmnile 2023-01-18 22:10:36 -05:00
Pirama Arumuga Nainar
bb9208b34c cepheus: Fix -Wbitwise-instead-of-logical
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-18 22:10:35 -05:00
chrisw444
7088452895 cepheus: gps: Update gps hal from LA.UM.9.1.r1-11700-SMxxx0.0
Signed-off-by: chrisw444 <wandersonrodriguesf1@gmail.com>
2023-01-18 22:10:35 -05:00
Albert I
214e14f25d cepheus: gps: Implement list empty error code for msg_q
This fixes enum-conversion warning due to implicit type enum casting
between linked_list and msg_q which happens only for status -6.

Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: I27ba74c4d840b7ba0cb1017d69a30fc25b80d6b9
2023-01-18 22:10:35 -05:00
Albert I
448978610e cepheus: gps: Address logical-op-parentheses warning
Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: I45d621a2b995afeb7757df3f89614a0d95552f33
2023-01-18 22:10:34 -05:00
Albert I
d3e138299c cepheus: gps: Reorder initializations list to satisfy warnings
-Wreorder-ctor is a compile-time, Clang-only flag which is enabled by default
since Clang 12, which will warn whenever a specified field will be initialized
right after field specified below it. However, since it doesn't sweep through
all fields, compiler may miss some of them.

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

Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: Id24cbb7277dc8d6c02767f8f365818ab6c017683
2023-01-18 22:10:34 -05:00
Albert I
bf736ef4a9 cepheus: gps: Resolve unused parameter warnings
Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: Id1383415f05c47c0ddc6d0ff911a46b9763e85f1
2023-01-18 22:10:33 -05:00
Albert I
a9735a458e cepheus: gps: Fully disable undefined-bool-conversion
Meaningless for HALs.

Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: If70b870c456802cd09a5a95732a2a5b231906603
2023-01-18 22:10:33 -05:00
Gareth Kitchen
b43a5b53f5 cepheus: gps: Localise NTP to improve GPS TTFF
Testing response times to time.android.com from around the globe reveals
in ms:-

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

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

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

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

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

Change-Id: I144af45757efa35b32daf034eece6e046d2bde79
Signed-off-by: chrisw444 <wandersonrodriguesf1@gmail.com>
2023-01-18 22:10:33 -05:00
Michael Bestas
1b2dd0e7d6 cepheus: gps: Resolve unused parameter warnings
Change-Id: I0acef3da2c3567a28edd0a71dac89a5828f7725d
Signed-off-by: chrisw444 <wandersonrodriguesf1@gmail.com>
2023-01-18 22:10:32 -05:00
Michael Bestas
f2a28962c4 cepheus: gps: Lower debug level
* Kill logcat spam

Change-Id: I20d1f698d3c2d1b56e79f6eb6c5c17069e43c60f
Signed-off-by: chrisw444 <wandersonrodriguesf1@gmail.com>
2023-01-18 22:10:32 -05:00
Ethan Chen
3a5bc793cc cepheus: gps: Increase batch size to max
* Hardware supports 40

Change-Id: I075fff615814fa105ec1493c5bdde60b8abccf0e
Signed-off-by: chrisw444 <wandersonrodriguesf1@gmail.com>
2023-01-18 22:10:32 -05:00
chrisw444
896ab86f48 cepheus: gps: Update gps configs hals from LA.UM.9.1.r1-11500-SMxxx0.0
[1] - https://source.codeaurora.org/quic/la/platform/hardware/qcom/gps/tag/?h=LA.UM.9.1.r1-11500-SMxxx0.0

Signed-off-by: chrisw444 <wandersonrodriguesf1@gmail.com>
Change-Id: I13ec9fad16d94c50bd37ec5873a888077301eb64
2023-01-18 22:10:31 -05:00
Adithya R
1e1d960414 cepheus: Import and inherit GPS HAL from CAF
https://source.codeaurora.org/quic/la/platform/hardware/qcom/gps/tree/?h=LA.UM.9.1.r1-10900-SMxxx0.0
2023-01-18 22:10:31 -05:00
daniml3
396cc2fbd0 cepheus: build the GPS/GNSS stack from source 2023-01-18 22:10:31 -05:00
adi8900
09fc6cacea cepheus: overlay: Don't pin renderscript
* renderscript is deprecated on android 12
* causes probably rs to trying boot
12-29 01:29:26.909 I/hwservicemanager(537): getTransport: Cannot find entry android.hardware.renderscript@1.0::IDevice/default in either framework or device VINTF manifest.

Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
Change-Id: Ice8ca7e2fbd71161897efa573298d191aeb001ba
2023-01-18 22:10:30 -05:00
Ivan Vecera
85ad9bb9a9 cepheus: sepolicy: Allow all context to resolve kgsl symlinks
All context are allowed to read /sys/class/kgsl/kgsl-3d0/gpu_model
kgsl sysfs node. Currently /sys/class/kgsl and kgsl-3d0 are symlinks
so the context need also permission to resolve them.

Resolves bunch of denials like:
avc: denied { read } for comm="android.hardwar" name="kgsl-3d0" dev="sysfs" ino=45704 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:sysfs_kgsl:s0 tclass=lnk_file permissive=0

Signed-off-by: Ivan Vecera <ivan@cera.cz>
Change-Id: Ibf166a823da51a89cfa9e0b84a9335a658fd8fb7
2023-01-18 22:10:30 -05:00
baalgx
3c92e0660a cepheus: sepolicy: label sysfs_kgsl 2023-01-18 22:10:30 -05:00
Pig
3c3cf4bdc9 cepheus: sepolicy: Suppress sysfs wakeup denials spam 2023-01-18 22:10:29 -05:00
Ralf Luther
cb4dcd6692 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-18 22:10:29 -05:00
Pig
05f03c4959 cepheus: sepolicy: Suppress system suspend denials spam
Change-Id: I4175b738819049cd351220ed6bd9be32101585f6
Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-18 22:10:29 -05:00
baalgx
89c6e30aea cepheus: sepolicy: Checkout LiveDisplay related sepolicy from raphael
- From: https://github.com/SOVIET-ANDROID/device_xiaomi_raphael/
2023-01-18 22:10:28 -05:00
Adithya R
65c5d275d3 cepheus: sepolicy: Allow vendor_init to set ssr prop
08-11 02:35:12.999     0     0 E init    : Do not have permissions to set 'persist.vendor.ssr.restart_level' to 'ALL_ENABLE' in property file '/vendor/build.prop': SELinux permission check failed

Signed-off-by: chrisw444 <chrisw444@pixelexperience.org>
2023-01-18 22:10:28 -05:00
Ivan Vecera
814e5f6b2a cepheus: sepolicy: Allow power stats HAL to access IIO sysfs nodes
Resolves:
W android.hardwar: type=1400 audit(0.0:6): avc: denied { read } for name=devices dev=sysfs ino=39277 scontext=u:r:hal_power_stats_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
E android.hardware.power.stats@1.0-service-mock: Error opening directory: /sys/bus/iio/devices/

Signed-off-by: Joey Huab <joey@evolution-x.org>
2023-01-18 22:10:28 -05:00
kondors1995
5130da8b6e cepheus: sepolicy: Allow PowerHal to access SDE early_wakeup node 2023-01-18 22:10:27 -05:00
Ratoriku
f86a4217ad cepheus: sepolicy: Address some denials for libperfmgr
* Partially picked from 3ab9be8a8f

Signed-off-by: Ratoriku <a1063021545@gmail.com>
2023-01-18 22:10:27 -05:00
K A R T H I K
d453d43f6e cepheus: sepolicy: Fix up libperfmgr crash on logs
W/libperfmgr(798): Failed to write to node: /dev/stune/camera-daemon/schedtune.boost with value: 0, fd: -1
W/libperfmgr(798): Failed to write to node: /dev/stune/camera-daemon/schedtune.prefer_high_cap with value: 0, fd: -1
W/libperfmgr(798): Failed to write to node: /proc/sys/kernel/sched_energy_aware with value: 1, fd: -1
W/libperfmgr(798): Failed to write to node: /dev/stune/camera-daemon/schedtune.boost with value: 0, fd: -1
W/libperfmgr(798): Failed to write to node: /dev/stune/camera-daemon/schedtune.prefer_high_cap with value: 0, fd: -1
W/libperfmgr(798): Failed to write to node: /sys/class/devfreq/soc:qcom,cpu6-cpu-l3-lat/min_freq with value: 1516200000, fd: 10
W/libperfmgr(798): Failed to write to node: /proc/sys/kernel/sched_energy_aware with value: 0, fd: -1

Change-Id: I55c65018f1635353ebd6082e1a45c363424f881c
2023-01-18 22:10:27 -05:00
Daeho Jeong
c667ae92d9 cepheus: sepolicy: Add F2FS sysfs permission
Bug: 144277579
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: Ia3ef51a3b22b50ecf38aa944514cfd15dfc670bf
2023-01-18 22:10:26 -05:00
Alexander Winkowski
edbae219f5 cepheus: Pull SELinux policy from Xiaomi SM8250 tree 2023-01-18 22:10:26 -05:00
baalgx
267c5a8242 cepheus: sepolicy: Remove debugfs labels as all access are removed
Removed in legacy sepolicy_vndr.
2023-01-18 22:10:26 -05:00
baalgx
83eb12f960 cepheus: sepolicy: Remove duplicated wakeup genfs entries
- These are now added in legacy sepolicy_vndr source: 0d41c50380
2023-01-18 22:10:25 -05:00
Edwin Moquete
d0a8ba654d cepheus: Switch to legacy sepolicy_vndr
Signed-off-by: anuragbhaumik <bhaumik463@gmail.com>
2023-01-18 22:10:25 -05:00
kondors1995
cf65b9c956 cepheus: sepolicy: Fixup hal_power_service denial 2023-01-18 18:02:58 -05:00
kondors1995
da637d9594 cepheus: sepolicy: Fix hal_power_service denial
10-09 21:47:24.459 E/SELinux (582): avc:  denied  { find } for pid=739 uid=1000 name=android.hardware.power.IPower/default scontext=u:r:hal_graphics_composer_default:s0 tcontext=u:object_r:hal_power_service:s0 tclass=service_manager permissive=0
2023-01-18 18:02:58 -05:00
Sebastiano Barezzi
8fff1eafae cepheus: Import genfs_contexts entries from sm8150-common tree
* From https://github.com/LineageOS/android_device_xiaomi_sm8150-common/blob/lineage-19.1/sepolicy/vendor/genfs_contexts
2023-01-18 18:02:32 -05:00
Daniel Jacob Chittoor
f13bc4669e cepheus: rootdir: Enable suspend to RAM
Improves idle drain considerably.

Change-Id: Iacef170a0f58ec74e6d82b89b3ae5ef60026ed07
2023-01-18 18:00:21 -05:00
Andrzej Perczak
988af27f20 cepheus: rootdir: Import oriole cpuctl tuning
This is done in preparation for uclamp migration and FAIR_GROUP_SCHED
enablement in kernel.

Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
2023-01-18 17:59:59 -05:00
Arian
bfd1586627 cepheus: rootdir: Import governor settings from coral
Change-Id: I421b961f87e2373a06fbd67070a895886479b8f7
2023-01-18 17:59:46 -05:00
timocapa
9e8ca750a7 cepheus: Fix fsmgr flag for F2FS Compression
- Without this, F2FS Compression would not work as this flag will be passed to recovery at format-time.
2023-01-18 17:57:02 -05:00
markakash
90e4e90db0 cepheus: Change cache partition to f2fs 2023-01-18 17:57:01 -05:00
Panchajanya1999
3f6ea0f788 cepheus: Support F2FS compressions and garbage collector
Partially based on Pixel 6 fstab[1] and personal
recommendations.
F2FS Compression requires kernel support too.

Note: even though we already have atgc and gc merge force enabled in
kernel, this does no harm and is nice for other testing. Also switch to
lz4 since it will be exclusively used upstream

[1]: https://android.googlesource.com/device/google/gs101/+/refs/heads/android12-d1-s4-release/conf/fstab.gs101#20
2023-01-18 17:57:01 -05:00
Alexander Winkowski
2a71d01872 cepheus: fstab: Add UFS sysfs path 2023-01-18 17:57:01 -05:00
Martin Liu
9704fdd8e5 cepheus: fstab: Set readahead_size_kb=128 2023-01-18 17:57:00 -05:00
TH779
e18963a53e cepheus: fstab: Enable UDC for userdata 2023-01-18 17:57:00 -05:00
Randall Huang
bbbf731c09 cepheus: fstab: fstab: data=journal,commit=1 for /metadata 2023-01-18 17:57:00 -05:00
Albert I
4a46cf8a21 cepheus: fstab: Set reserved f2fs blocks for userdata 2023-01-18 17:56:59 -05:00
kondors1995
0f7d54e7e2 cepheus: Drop ext4 for data 2023-01-18 17:54:56 -05:00
baalgx
02c885f397 cepheus: Adapt AntiFlicker nodes
* According to kernel, I'm not using dimlayer implementation.
2023-01-18 17:54:53 -05:00
baalgx
8f748dd3fc cepheus: Set correct powerhint path 2023-01-18 17:54:48 -05:00
baalgx
b9fad0a868 cepheus: Drop thermal hal
* Since baalgx/kernel_xiaomi_cepheus@4867fdf
* After 2 weeks of testing with/without thermal hal (1 week with, 1 without), I noticed way better temps without it. Hence, let's drop support for it.
2023-01-18 17:54:35 -05:00
Terminator-J
3225e1f032 cepheus: Implement NoCutOutOverlay
Based on enchilada, in order to allow for hiding
the notch in Developer Options.

Includes changes from the following commits/change-ids:

  enchilada: Add overlay for masking the notch
  Change-Id: I66684d8254fd3c1ee6851e67c0b09d176d4c02af

  enchilada: Leverage hide string for display_cutout_emulation_overlay
  Change-Id: Ibcefa4b50713c451a398409c1bc941cd833921f2

  enchilada: Install NoCutoutOverlay to system
  Change-Id: I26b6277e89ff9a26daa7d2ae16c50e873eddecfa

  enchilada: Build NoCutoutOverlay
  Change-Id: I45edeb3ae20f374cd4510bad83b3a51059a7e743

  enchilada: Adapt NoCutOutOverlay to S
  Change-Id: I45b381c7e45f92e60a8608b3c201c5e48892b0ae

  enchilada: Remove resource overlays for system bar heights
  Change-Id: I36d869866ed03d3996b7b0d8cc6d3f6bb6ab624d

and

  enchilada: Make NoCutoutOverlay overlay non-RRO
  Change-Id: Ic03bac31922a57f548accd3c16417fa683565530

[baalgx]: Adapt rounded_corner_radius_top to cepheus

Co-authored by: Adrian Roos <roosa@google.com>
Co-authored by: Luca Stefani <luca.stefani.ge1@gmail.com>
Co-authored by: Ratoriku <a1063021545@gmail.com>
Co-authored by: shawnlin <shawnlin@google.com>
Co-authored by: LuK1337 <priv.luk@gmail.com>
2023-01-18 14:40:23 -05:00
ragy365
4a73405713 cepheus: Switch SystemUI to SystemUIGoogle 2023-01-18 14:40:20 -05:00
SebaUbuntu
740e401842 cepheus: Switch to common Xiaomi light AIDL 2023-01-18 14:40:17 -05:00
TH779
5f22ead13c cepheus: sepolicy: Address Pixel power libperfmgr HAL denials
Co-authored-by: Arian <arian.kulmer@web.de>
Signed-off-by: TH779 <i@779.moe>
Change-Id: Ia18ca270b79513d509dd4427c24fbd04372d561c
2023-01-18 14:40:14 -05:00
Bruno Martins
4f5ac01526 cepheus: Migrate to Xiaomi power HAL AIDL
Change-Id: I42170d51a517170b58d532addd9c38496e43457c
2023-01-18 14:40:11 -05:00
Savsir
8c9f95229a cepheus: sepolicy: Fix powerhal 1.3 adress 2023-01-18 14:40:08 -05:00
Carlos Ayrton Lopez Arroyo
d951f4c1fc cepheus: power: Scan available DT2W devices for cepheus
Preserve the previous input devices defined and define the screen drivers
present on the xiaomi-sm8250 kernel in order to be scanned depending on the
device that is running (tested on lmi/lmipro).

Change-Id: I8e9410ee0c1b70d8d84ea4c711d0947f4163f4d4
2023-01-18 14:40:05 -05:00
Bruno Martins
7b1cdb102f cepheus: Import power AIDL extension for DT2W
This is a squash of the following commits:

	From: Bruno Martins <bgcngm@gmail.com>
	Date: Fri, 31 Jan 2020 23:10:19 +0000
	Subject: sm8250-common: power: Scan input devices for eligible DT2W node

		It is no longer a surprise for anyone to see Xiaomi shipping the same
		device with different displays and different displays usually mean
		different touchscreen drivers.

		The current double tap handling in the power HAL only takes into
		account one specific node, meant to be set in the device tree.
		However, if the touchscreen was registered as a different input device
		it would cause the feature to be broken. Address the issue by iterating
		through the input devices in order to find one supported touchscreen
		input to be used.

		Co-authored-by: LuK1337 <priv.luk@gmail.com>
		Change-Id: I2f7fb4a8b0c9cd1a16d6c2b93602d285a191f170

	From: Bruno Martins <bgcngm@gmail.com>
	Date: Fri, 9 Oct 2020 12:19:37 +0100
	Subject: sm8250-common: power: Adapt extension to new aidl power HAL

		Change-Id: I58ac49957d8d28ad904912986d89ac8db4820ff9

Change-Id: If30eaca900f0a046f7740c681e8707b5dce8e1a9
2023-01-18 14:40:01 -05:00
Savsir
07912cc87a cepheus: Drop pixel powerhal & powerstats 2023-01-18 14:39:55 -05:00
baalgx
cf8da2268b cepheus: reorder-libs: Reorder blobs list 2023-01-18 14:39:16 -05:00
Jyotiraditya Panda
c230ade269 cepheus: reorder-libs: Add support for below 3.9 python versions.
Signed-off-by: Jyotiraditya Panda <jyotiraditya@aospa.co>
Signed-off-by: BladeRunner-A2C <prisoner56898@protonmail.com>
Change-Id: If50456fa2d0bfd8cddb3831b64a25ebc324a104a
2023-01-18 14:39:02 -05:00
Sebastiano Barezzi
0777b98527 cepheus: Add a script to reorder blobs list
Change-Id: I76e85e07f5a562b7e2a3683da264ccebff5c3613
2023-01-18 14:38:59 -05:00
kondors1995
0c162c26df cepheus: remove Renderscript
* This has been deprecated in A12 [1].

[1]: https://developer.android.com/guide/topics/renderscript/migrate
2023-01-18 14:38:54 -05:00
kondors1995
a0594ed1be cepheus: sepolicy: Sync wakeup sources with sm8150-development
HEAD: xiaomi-sm8150-devs/android_device_xiaomi_sm8150-common@b25b10a
2023-01-18 14:38:31 -05:00
SamarV-121
cb711b4bc9 cepheus: overlay: Remove config_gpsParameters
* 404

Change-Id: I8290597fa4938c3e93f81b5d013769f4ef6eaabe
2023-01-18 14:37:03 -05:00
SebaUbuntu
6c71d0db11 cepheus: overlay: Drop MMS user agent overlays
* Current profile URL points to a 404 page

Change-Id: I92f3ded52dda04f6cec5709d51c84b32f39d8095
2023-01-18 14:36:59 -05:00
adi8900
1de560b5dc cepheus: Update Adreno stack from LA.UM.9.14.r1-20200-LAHAINA.QSSI13.0.
Signed-off-by: adi8900 <adrianszymanski242@gmail.com>
2023-01-18 14:36:21 -05:00
Pranav
402c2c6c5a 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-18 14:36:18 -05:00
John Galt
736afc304a cepheus: Update adreno blobs from LA.UM.9.14.r1-19300-LAHAINA.QSSI12.0 2023-01-18 14:36:14 -05:00
Pranav
840527c8c9 cepheus: Update graphics blobs from from LA.UM.9.14.r1-18900-LAHAINA.QSSI12.0 2023-01-18 14:36:07 -05:00
Ujjwal Kirorimal
2bae041fb9 cepheus: overlay: Disable Adaptive Connectivity preference
* We neither ship CTPM and nor have 5G
2023-01-18 14:34:33 -05:00
althafvly
abc65dd29a cepheus: sepolicy: Remove debugfs related rules
- Removed from sepolicy_vndr

Change-Id: Ifd65abd0292577ec050904265310f17b86e10899
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2023-01-18 14:34:25 -05:00
John Galt
25a904b97b cepheus: Set EROFS pcluster size
- Used on cuttlefish as part of erofs switch. Benefits performance considerably..

- Pre big cluster vendor size: 311M
- Post vendor size: 268M
2023-01-18 14:34:16 -05:00
Cyber Knight
d51d55362f cepheus: Switch to EROFS
- EROFS offers much more compressed partition sizes compared to the likes of ext4 albeit being read-only.
- We have switched to EROFS for /system and /vendor.
- This patch was inspired by [1].

[1]: 2b52a00408
2023-01-18 14:34:12 -05:00
baalgx
8c1be90fec cepheus: Disable Zram Writeback
This reverts commit 1d487bf408.
2023-01-18 14:33:56 -05:00
Kshitij Gupta
bfa3c136fb cepheus: sepolicy: dontaudit untrusted_app to open ashmem_device
- Fixes scroll lag in many apps, such as Twitter:
    W RenderThread: type=1400 audit(0.0:12371): avc: denied { open } for path=/dev/ashmem dev=tmpfs ino=10848 scontext=u:r:untrusted_app:s0:c123,c256,c512,c768 tcontext=u:object_r:ashmem_device:s0 tclass=chr_file permissive=0 app=com.twitter.android

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

- 8b12ff5f21

Change-Id: I6405786fea05891642d8437acafcd8c891d75912
2023-01-18 14:31:34 -05:00
UtsavBalar1231
08c51829b3 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>
2023-01-18 14:31:27 -05:00
baalgx
d1bc25f919 cepheus: parts: Remove Dirac
* To be honest it's not that good, sound is already good enough without Dirac, plus i consider it as useless bloat.
2023-01-18 14:31:06 -05:00
balgxmr
34e2330754 Revert "cepheus: parts: Move to new combined device settings resources"
This reverts commit 475d419339.
2023-01-18 14:29:58 -05:00
Nauval Rizky
5606c395b9 cepheus: Update mi thermald patching method
* hotplug data will be parsed but not applied to the node.

Change-Id: I7f4d71e446c7230364b920d0d0af766e4329af8c
2023-01-18 14:25:21 -05:00
Nauval Rizky
ca21f02976 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-18 14:25:16 -05:00
SamarV-121
4b783fce7c 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-18 14:24:40 -05:00
baalgx
06eaca087e cepheus: Bring back LiveDisplay HAL
This reverts commit ae959b675aab8613fae24e82b11e2cde5af25ea0.
2023-01-18 14:24:19 -05:00
Bowgo Tsai
74c72238f3 cepheus: Adding developer GSI keys
Bug: 144399552
Test: tree-hugger

Change-Id: I0cf78bfc80c24bb217bb88831faa5a29ba04d194
2023-01-18 14:24:06 -05:00
balgxmr
fca541cc0e cepheus: Partially revert 78ecb0486d 2023-01-18 14:22:23 -05:00
balgxmr
9694652d8a cepheus: Switch to azure clang 2023-01-18 14:21:18 -05:00
balgxmr
79b769d6dd Revert "cepheus: Boardconfig: Reserve spaces for each logical partiton"
* I'll be using EROFS.

This reverts commit d69e09afc0.
2023-01-18 14:20:04 -05:00
baalgx
5b9697b5ec cepheus: releasetools: Kill firmware inclusion
Signed-off-by: baalgx <jose@pixelos.net>
2023-01-18 14:18:18 -05:00
balgxmr
fbea4b6531 cepheus: Stop including firmware 2023-01-18 14:18:17 -05:00
balgxmr
0c87d5d01c cepheus: PixelOS bringup! 2023-01-18 14:18:17 -05:00
OnlyTomInSecond
4aba87d662 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>
2022-11-22 19:42:53 +08:00
Michael Bestas
28290ad89b cepheus: Move qti_whitelist.xml to /system_ext
Change-Id: Id8617513cfd686b3f6888a89c1b1db196acfb476
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 19:42:51 +08:00
Michael Bestas
0ff53cdc4b 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>
2022-11-22 19:27:02 +08:00
Bruno Martins
2e4d6582b6 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>
2022-11-22 19:27:02 +08:00
Bruno Martins
3806c0a018 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>
2022-11-22 19:27:02 +08:00
Mohammed Mirza Mandayappurath Manzoor
c61d81d19d 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>
2022-11-22 19:27:02 +08:00
Alexander Koskovich
d4d0cd4203 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>
2022-11-22 19:27:02 +08:00
Bruno Martins
4c1f71fd00 cepheus: Migrate to AIDL ClearKey DRM HAL
Change-Id: Iad5cc1176978137c647069197b33f49fb4d98ab2
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 19:27:02 +08:00
LuK1337
78e009c31a cepheus: Pull appropriate USB props from vendor_product.mk
Change-Id: I93b25c5d0989c83d1c8d7b7946a083771febdddd
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 19:27:02 +08:00
Alexander Koskovich
dc9514b562 cepheus: Move BT profiles props to vendor
* Makes it GSI compatible

Change-Id: I8f7caf241d508af59c16482e6185c42f23f8a460
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 19:27:01 +08:00
Woody Lin
4eb1333bd9 cepheus: Enable zygote critical window
Bug: 141948707
Change-Id: I5dc57312118b0f6d95fc9fe164363ec7e15f1b51
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 19:26:56 +08:00
Chenyang Zhong
f9c363be33 cepheus: overlay: enable aux camera for Aperture
Also block unwanted camera ids.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 18:46:50 +08:00
Bruno Martins
b193704a21 cepheus: Update aux camera package whitelist
LinageOS Snap camera is dead for good.

Change-Id: Ib190174585ee4f7a931b813547861051f754a477
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 18:39:20 +08:00
Bruno Martins
3a30eac242 cepheus: Expose aux cams to Aperture
Change-Id: I25cd180d9145b8b3da2385257c6e91e51c2032a2
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-22 18:37:58 +08:00
Alexander Koskovich
703ce6185f cepheus: Set USB product string to 'Xiaomi Mi 9'
Change-Id: Idda062aaa38e16d7ba65356dbca8b467fbff14c1
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-21 19:28:05 +08:00
Sal Savage
f7202d945a cepheus: Replace BTM_DEF_LOCAL_NAME with a sysprop
Change-Id: I2c90efac01e61500eb1be23bb0ae6f96c2acdc53
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-20 23:39:43 +08:00
Glen Kuhne
bb1c459b6c 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>
2022-11-20 23:28:08 +08:00
LuK1337
7fd729f892 cepheus: Set a default Settings.Global.DEVICE_NAME
Change-Id: I310c1ffc581b72653783d1093d9e7ebde544bb16
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-20 23:28:08 +08:00
EcrosoftXiao
268a4a616b [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
2022-11-20 23:07:26 +08:00
EcrosoftXiao
d69e09afc0 cepheus: Boardconfig: Reserve spaces for each logical partiton 2022-11-20 23:04:11 +08:00
EcrosoftXiao
785a4549b5 Revert "[Squash] cepheus: Switch to QTI BT"
This reverts commit 21e1e387cd.
2022-11-20 23:04:11 +08:00
chrisl7
bfdd7f34b7 cepheus: camera: Move camera libpiex_shim to custom_compat
Signed-off-by: chrisl7 <wandersonrodriguesf1@gmail.com>
2022-11-10 13:26:37 +08:00
EcrosoftXiao
3762c3a27a cepheus: Switch to OSS IFAAService 2022-11-04 08:01:36 +08:00
Chenyang Zhong
95789fb978 cepheus: Hardcode LD and AR for custom clang
The LD and AR were hard-coded to CLANG_PREBUILTS, which is
clang-r450784d as of writing. If a device builds kernel with a
newer version of LLVM/Clang, the hard-coded LLD may encounter
unsupported features such as

ld.lld: error: built-in.o(init/main.o): Opaque pointers are only
supported in -opaque-pointers mode (Producer: 'LLVM15.0.0git'
Reader: 'LLVM 14.0.6git')

Therefore, only hard-code LD and AR when KERNEL_TOOLCHAIN is not set.

Change-Id: Ic707afc3ddf8101a734ccbd9f7a924952a20f6e3
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-11-04 08:01:09 +08:00
EcrosoftXiao
bdb72ccdda Revert "cepheus: Move to azure clang"
This reverts commit f275a6899b.
2022-10-23 21:27:41 +08:00
EcrosoftXiao
628e5bb792 cepheus: sepolicy: Drop duplicated entries 2022-10-21 20:34:23 +08:00
EcrosoftXiao
a009da566f fixup! cepheus: shim the GetPreviewImageData symbol on libpiex 2022-09-21 09:34:53 +08:00
EcrosoftXiao
78ecb0486d fixup! cepheus: Flash dummy super image if needed 2022-09-21 09:34:53 +08:00
Chenyang Zhong
d24959344b cepheus: overlay-pe: enable screen-off udfps by default
It has been changed to false on the PE side recently.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-21 09:34:53 +08:00
EcrosoftXiao
ed7fb42400 cepheus: dependencies: Track thirteen branch 2022-09-21 09:34:53 +08:00
Tim Zimmermann
f2c6d70d33 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
2022-09-21 09:34:53 +08:00
EcrosoftXiao
b118b506b0 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>
2022-09-21 09:34:53 +08:00
Alice Kuo
83d2c67c0f cepheus: Disable LE audio related profiles
Bug: 231671426
Test: build
Change-Id: I85b7f023c03a7a2e603af94e88196c10a16fe4ec
Merged-In: I85b7f023c03a7a2e603af94e88196c10a16fe4ec
(cherry picked from commit 9b57be4d7f57e1d117c65fac1e2dc60dbc59cb4b)
2022-09-21 09:34:50 +08:00
Sal Savage
0023782a75 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>
2022-09-17 14:41:04 +08:00
Sal Savage
66f9924a24 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>
2022-09-17 14:41:04 +08:00
Sal Savage
fdd561154a 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>
2022-09-17 14:41:04 +08:00
Sal Savage
a5fc9e5116 cepheus: Enable bluetooth profiles with product.prop
Bug: 217448211
Test: make -j
Change-Id: I0d06b46910e42346653bea3484636f4129592ce3
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:03 +08:00
weichinweng
5b0c66da89 cepheus: Align ASHA prop with BluetoothProperties
* Modify bluetooth.profile.asha.central to
  bluetooth.profile.asha.central.enabled

Tag: #feature
Test: manual
Bug: 211570675
Bug: 218454632
Change-Id: I8e1f49034e5a675b29fba747e634c9f7c6c29c50
2022-09-17 14:41:03 +08:00
Etienne Ruffieux
a568a6975a cepheus: Added new vendors for Bluetooth config migration
Tag: #feature
Test: manual
Bug: 211570675
Change-Id: Id74ec5e1b30f21c534c35b212a2fb297e9d591fb
2022-09-17 14:41:03 +08:00
Josh Wu
f03435cfa0 cepheus: Switch BtAudio to AIDL
Test: m
Bug: 203490261
Change-Id: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
Merged-In: I4b8ac40d5ad410b89eb6a0573d740d86471ecfc7
2022-09-17 14:41:03 +08:00
Chenyang Zhong
1230d1697a 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>
2022-09-17 14:41:03 +08:00
Chenyang Zhong
a7c075d92e 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>
2022-09-17 14:41:03 +08:00
EcrosoftXiao
a3219a8620 [SQUASH]cepheus: Nuke LiveDisplay HAL 2022-09-17 14:41:03 +08:00
daniml3
e6f023e863 cepheus: gps: remove incorrect bitwise OR usage
Signed-off-by: daniml3 <daniel@danielml.dev>
2022-09-17 14:41:03 +08:00
Yohei Yukawa
17f75da2a2 cepheus: Migrate "rounded_corner_content_padding"
With my previous CL [1], we can override

   rounded_corner_content_padding

at the Framework resource layer rather than the SysUI resource layer.

No matter whether

  persist.sys.ime.can_render_gestural_nav_buttons

is enabled or not, there should be no observable behavior change in
this CL.

 [1]: I0c3717c0bdfc928167c6eba06247b37caabf33b9
      24d6b891f572f7be419d3acc9793ca68d062cf35

Bug: 215554582
Test: Manually verified as follows.
  1. Build aosp_coral-userdebug and flash it
  2. adb shell cmd overlay lookup android \
       android:dimen/rounded_corner_content_padding
     -> 70.0px
  3. adb shell cmd overlay lookup com.android.systemui \
       com.android.systemui:dimen/rounded_corner_content_padding
     -> 70.0px
Change-Id: I391a504482f25c17f9b67f7eb8f56f362da71ae0
2022-09-17 14:41:03 +08:00
shawnlin
ff107da3ac cepheus: overlay: Fixed status bar glitch for apps that access internal resource dimen
Bring back old usage of status_bar_height, status_bar_height_portrait,
and status_bar_height_landscape by set the size containing cutout size.

Bug: 216782082
Test: make
Change-Id: I05142c120f05bdb5fa0543e61a6f50f46f6b0d82
[jjpprrrr: status_bar_height and status_bar_height_landscape are both
linked to @dimen/status_bar_height_portrait, so setting the _default
and _portrait should be enough.]
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:03 +08:00
Georg Veichtlbauer
f9a302c46d cepheus: overlay: Update deprecated screen power items
* screen.on -> screen.on.display0
* screen.full -> screen.full.display0

AOSP frameworks/base: 8ac63071a4e6da7e0740f5eb6c6753218efcfd3a

Change-Id: Iad50e6cb63368e2d71e6fa1dbb6997c0f95d321e
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:03 +08:00
daniml3
7b72e12642 cepheus: shim the GetPreviewImageData symbol on libpiex
Signed-off-by: daniml3 <daniel@danielml.dev>
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:03 +08:00
Bowgo Tsai
d892af7d2c cepheus: removing gsi_keys.mk
It's no longer required to install the compliance GSI
public keys into the ramdisk. Those public keys just need
to be included in the VTS test suite for GSI verification.

Bug: 176869478
Test: TreeHugger
Change-Id: I3714de75b94be43a1364b89b92d893b336aa014b
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:03 +08:00
Hajime Morrita
70513be9d3 cepheus: Stop including iorap_large_memory_config.mk
Test: Presubmit.
Bug: 195415601
Change-Id: Ic49fcadb8bb33db262295a8b11eaca9c59362ae7
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:02 +08:00
Jiyong Park
e2743dd587 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>
2022-09-17 14:41:02 +08:00
Santiago Seifert
6ee7b8e4b9 cepheus: overlay: Unpin updatable-media from memory on coral
Bug: 214499288
Change-Id: I83757ae6a053ec6b10b08322c4e76d988f1a4a48
Test: Presubmit
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:02 +08:00
Jaegeuk Kim
c14d8d3c76 cepheus: rootdir: Remove discard command tuning
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I2e6e50947d9aa1213910875cf7e6e5c714c1b255
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:02 +08:00
Etienne Ruffieux
b569d74115 cepheus: Removed audio A2dp and Hearing Aid from device.mk
Bug: 220306859
Test: atest
Tag: #feature
Change-Id: I300369d36399ffb558b98bafc2478b872d09faba
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:02 +08:00
Jiakai Zhang
67ee384719 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>
2022-09-17 14:41:02 +08:00
Jiakai Zhang
799cba18d5 cepheus: Preopt SystemUI for AOSP builds.
Bug: 232860596
Test: See no dex2oat invocation on the first boot.
Change-Id: I21b99fac3934060d27fad7323979cbb5f0ed28e8
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-17 14:41:02 +08:00
EcrosoftXiao
4dec642e4b cepheus: Update keymaster blobs from Xiaomi/nabu/nabu:12/RKQ1.200826.002/V13.1.22.9.5.DEV 2022-09-17 14:41:00 +08:00
Jaegeuk Kim
3c3059ce4f 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
2022-09-15 15:25:40 +08:00
Daniel Rosenberg
4938a68e66 cepheus: Enable Project ID Quota support on userdata.
* These features enable wide inodes on userdata, which
   is required for project ID quotas. Wide inodes can
   only be set at MKFS time.

 * This also enables casefolding, which is required for the
   removal of SDCardFS.

Bug: 138321217
Test: Examine filesystem features for project quota and wide inodes.
Change-Id: I9c17cda2af34c6fbd73c2d90eb6b465f4939df67
Signed-off-by: Ahmed Harhash <Lacentix@tutanota.com>
2022-09-14 12:28:16 +08:00
David Ng
63dbd6d58c cepheus: rootdir: Mount metadata fs during first stage init per UDC spec
Mount metadata at first stage init.

Change-Id: I51408b0c6b5edb4434d32be803daf3a21beb91e1
2022-09-14 12:26:55 +08:00
Alessandro Astone
448ace0778 cepheus: Build and enable fastbootd mode
Change-Id: I7f4246f3f583dcae7b3bfc0d3ae1cf4d577632cb
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-14 12:26:55 +08:00
Chenyang Zhong
2b07d9622e cepheus: specify androidboot.boot_devices
so that /dev/block/by-name/ symlinks are created.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-14 12:26:55 +08:00
Chenyang Zhong
a788d63ada cepheus: move super_dummy build to Android.mk
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-14 12:26:31 +08:00
Tim Zimmermann
51f9a0b32c 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>
2022-09-14 12:24:38 +08:00
Joshua Blanchard
83e2085c5a cepheus: sepolicy: Label system|vendor as super_block_device_type
Change-Id: Ifbea7386abcf5a5a7ac8499d4abc363ae7f6d9c5
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-14 12:21:43 +08:00
Chenyang Zhong
0c0575bc4a cepheus: rootdir: Copy fstab to ramdisk as well
Needed by dynamic partitioning [1].

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

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-14 12:21:43 +08:00
Chenyang Zhong
d11ba00fca 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>
2022-09-14 12:21:43 +08:00
Chenyang Zhong
4a5953a970 cepheus: switch to retrofit dynamic partitioning
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-09-14 12:21:40 +08:00
Andrzej Perczak
7081b25195 cepheus: Disable redir_party_num
Caused incoming caller number not being parsed correctly by Phone app on
VoLTE and VoWiFi. No idea why Lenovo enabled this ancient prop.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-05-26 23:30:24 +08:00
EcrosoftXiao
78b46dc6de Revert "cepheus: Use Vulkan for UI rendering"
This reverts commit ad0d861b68.
2022-05-16 20:19:57 +00:00
EcrosoftXiao
e591c44220 Revert "cepheus: Track xiaomi sdm 845 common vendor and move to common IFAA impl"
This reverts commit ccabbc9042.
2022-05-16 20:19:56 +00:00
EcrosoftXiao
f275a6899b cepheus: Move to azure clang 2022-04-14 07:57:20 +08:00
EcrosoftXiao
a74fdde075 Revert "cepheus: parts: Implement dc dimming"
This reverts commit d79388d581.
2022-04-10 13:22:56 +08:00
LuK1337
f0ec108ca1 cepheus: livedisplay: Implement IAntiFlicker interface
Change-Id: I1dbc6d8989a80fe7b06d4356aeb717417997a793
2022-04-10 13:22:56 +08:00
LuK1337
1af68cbed4 cepheus: livedisplay: Uprev to 2.1
Change-Id: I98b2ea16ed342339ee652d5cb79dcfd22f8c0a0d
2022-04-10 13:22:56 +08:00
Felix
ea5d5c4dff cepheus: Add interface info to .rc files
Signed-off-by: Felix <google@ix5.org>
Change-Id: I6d70bbdb66c3dce280bf6908c3750316a6f6cf70
2022-04-10 11:13:27 +08:00
LuK1337
ff8fbc7076 cepheus: livedisplay: Drop unnecessary nullptr checks
* new operator would never return a nullptr.

Change-Id: I3a34770d70b2da53ba3099fb7647991e5bde33b8
2022-04-10 11:13:27 +08:00
dianlujitao
666ee95081 cepheus: livedisplay: Use modules from common implementation
Change-Id: Iafb9f6a56187beb574ca2eb9a97fb9c7e72893ce
2022-04-10 11:13:26 +08:00
EcrosoftXiao
923f1f2a95 cepheus: Bring back LiveDisplay HAL
This reverts commit 5ebfa970a1d8ff131e0a3c0713d4a0cae3dcb224.
2022-04-10 11:13:22 +08:00
EcrosoftXiao
dcc70cd9f9 cepheus: sepolicy: Cleanup deprecated rules 2022-04-04 04:16:58 +08:00
Chenyang Zhong
2e607f9b56 Revert "cepheus: update qcom sepolicy include path"
This reverts commit 9bf7423fdf.
2022-04-04 03:39:40 +08:00
Sungmin Choi
97eb07a4ed cepheus: Remove Manage Mobile Plan
Set config_show_mobile_plan false to remove "Manage mobile plan"

Bug: 14418915
Change-Id: I1ef4eb755937cffe7f556b96a5ee1a6ec7b7131c
2022-04-04 03:11:38 +08:00
dianlujitao
b512b876cb cepheus: 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-04-04 00:22:52 +08:00
TH779
b5a932474f cepheus: overlay: Drop deprecated SystemUI overlays
Signed-off-by: TH779 <i@779.moe>
Change-Id: Ic66ffa74e6745db4c252a1fbef67d094ff7c9c90
2022-04-04 00:19:14 +08:00
Chenyang Zhong
b647d4c755 cepheus: sepolicy: allow apps to get aux camera prop
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-04-04 00:17:32 +08:00
EcrosoftXiao
ae2da4b525 cepheus: Set proper system partition size 2022-02-16 22:05:49 +08:00
Giammarco Senatore
93b2ed3d47 cepheus: Enable statusbar burn-in protection 2022-01-23 21:34:31 +08:00
UtsavBalar1231
d991cced58 cepheus: wifi: Ignore tracking if any NUD failure occurs
Change-Id: I3031143fa634a0505045ccb00809fe4dd40f16c1
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-01-23 01:04:41 +08:00
Venkata Sharath Chandra Manchala
25d5301a0f 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-01-23 01:04:41 +08:00
Akash Srivastava
26e3843991 cepheus: Update Wifi config
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-01-23 01:04:41 +08:00
Ecco Park
9d981f72dd 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-01-23 01:04:41 +08:00
Panchajanya1999
3735a73f3a 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-01-23 01:04:40 +08:00
kerneltoast
8c4bae1ef4 cepheus: wifi: Relax WiFi re-association RSSI thresholds
Change-Id: I073f08eed69b2454e1fd2350c8f7e8bb8983641b
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-01-23 01:04:40 +08:00
Alex Naidis
67e0c9cca3 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-01-23 01:04:40 +08:00
TheCrazyLex
326069e03c 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-01-23 01:04:40 +08:00
Luk1337
30ec3bd602 cepheus: wifi: Disable RX wakelock feature
Change-Id: If79e1512a83f5162444683e1fa8f5560f98b6c9a
Signed-off-by: Joey Huab <joey@evolution-x.org>
2022-01-23 01:04:40 +08:00
EcrosoftXiao
7f6a3d082a Revert "cepheus: drop updatable_apex.mk for now"
This reverts commit 0f20ed57e6.
2022-01-22 11:38:07 +08:00
Chenyang Zhong
ad0d861b68 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-01-21 15:33:34 +08:00
Chenyang Zhong
abf862a4a2 cepheus: build kernel with Prelude Clang
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-01-21 02:18:32 +08:00
Minchan Kim
1d487bf408 cepheus: Enable Zram Writeback 2022-01-14 10:57:35 +08:00
EcrosoftXiao
cf8a770633 cepheus: rootdir: Tune ZRAM size 2022-01-14 10:57:35 +08:00
Volodymyr Zhdanov
603150a624 cepheus: rootdir: Don't configure zram in init.qcom.post_boot.sh 2022-01-14 10:57:34 +08:00
jhenrique09
ecf768b139 cepheus: Enable quick tap
Change-Id: I86135ea3c4fb9063f5158f4f7ddd2d7e0f6b8062
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2022-01-11 12:35:24 +08:00
EcrosoftXiao
085c46db76 Revert "cepheus: parts: Enable doze_status on screen off"
This reverts commit 8d187f1424.
2022-01-11 12:32:18 +08:00
EcrosoftXiao
eb6851cf32 cepheus: Update graphic blobs from Xiaomi/nabu/nabu:11/RKQ1.200826.002/V13.0.3.0.RKXCNXM:user/release-keys 2022-01-11 01:36:41 +08:00
Stephen Thomas-Dorin
48b5b0c075 cepheus: overlay: Update config_ims_rcs_package to use new ImsService
Change-Id: I77fcd2a3451c99df5fa47136fa0cd36a5abab9fe
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2021-12-28 12:19:34 +08:00
Chenyang Zhong
b0b27867b3 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>
2021-12-28 12:19:33 +08:00
EcrosoftXiao
2305a91133 cepheus: sepolicy: Label vendor_fp_prop as vendor_public_prop
* Mlipay needs to read it for fingerprint payment
2021-12-28 12:19:33 +08:00
Chenyang Zhong
9bf7423fdf cepheus: update qcom sepolicy include path
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2021-12-28 12:19:33 +08:00
EcrosoftXiao
5784310aed Revert "cepheus: relax sysprop owner enforcement"
This reverts commit 1eacf6d958.
2021-12-28 12:19:33 +08:00
EcrosoftXiao
3c29984ae7 Revert "[TMP] cepheus: sepolicy: Temporary workaround for unspecified property owners"
This reverts commit c46d7a8325.
2021-12-28 12:19:33 +08:00
Chenyang Zhong
958a8a544c 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-28 12:19:25 +08:00
544 changed files with 25091 additions and 26730 deletions

View File

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

View File

@@ -1,58 +0,0 @@
#
# 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,8 +16,3 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage_cepheus.mk
COMMON_LUNCH_CHOICES := \
lineage_cepheus-user \
lineage_cepheus-userdebug \
lineage_cepheus-eng

View File

@@ -24,14 +24,10 @@ 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
@@ -51,30 +47,23 @@ 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
USE_DEVICE_SPECIFIC_CAMERA := true
$(call soong_config_set,libcameraservice,ext_lib,//$(DEVICE_PATH):libcameraservice_extension.cepheus)
# Compression
PRODUCT_FS_COMPRESSION := 1
# 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
@@ -86,7 +75,7 @@ TARGET_ENABLE_MEDIADRM_64 := true
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/configs/config.fs
# FOD
TARGET_SURFACEFLINGER_UDFPS_LIB := //$(DEVICE_PATH):libudfps_extension.cepheus
$(call soong_config_set,surfaceflinger,udfps_lib,//$(DEVICE_PATH):libudfps_extension.cepheus)
TARGET_USES_FOD_ZPOS := true
# GPS
@@ -95,15 +84,13 @@ 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 \
vendor/lineage/config/device_framework_matrix.xml
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml
# Init
TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):libinit_cepheus
$(call soong_config_set,libinit,vendor_init_lib,//$(DEVICE_PATH):libinit_cepheus)
TARGET_RECOVERY_DEVICE_MODULES := libinit_cepheus
# Kernel
@@ -111,24 +98,19 @@ 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_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"
TARGET_KERNEL_CONFIG := \
vendor/sm8150-perf_defconfig \
vendor/xiaomi/sm8150-common.config \
vendor/xiaomi/cepheus.config
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
@@ -136,8 +118,8 @@ BOARD_KERNEL_CMDLINE += kpti=off
BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc
# Lineage Health
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH := /sys/class/power_supply/battery/charging_enabled
$(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)
# Media
TARGET_USES_ION := true
@@ -151,63 +133,50 @@ 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 := 5368709120
BOARD_SUPER_PARTITION_SIZE := 6442450944
BOARD_SUPER_PARTITION_METADATA_DEVICE := system
BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor
BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor cust
BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 3758096384
BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 1610612736
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_SIZE := 5364514816 # BOARD_SUPER_PARTITION_SIZE - 4MB
BOARD_SUPER_PARTITION_CUST_DEVICE_SIZE := 1073741824
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_SIZE := 6438256640 # BOARD_SUPER_PARTITION_SIZE - 4MB
# 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_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))
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)
@@ -220,14 +189,13 @@ 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
@@ -250,7 +218,6 @@ 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,6 +2,10 @@ Copyright &copy; 2020 DerpFest
Copyright &copy; 2020-2021 PixelExperience
Copyright &copy; 2025 PixelOS
Copyright &copy; 2025 Evolution X
Device configuration for Xiaomi Mi 9
=========================================
@@ -26,4 +30,4 @@ Camera | 48MP(Primary),12MP(Telephoto), 16MP(Ultrawide), dual-LED (dual tone) f
## Device picture
![Xiaomi Mi 9](https://xiaomi-mi.com/uploads/CatalogueImage/mi9%20(3)_17409_1550674081.jpg "Xiaomi Mi 9 in black")
![Xiaomi Mi 9](https://fdn2.gsmarena.com/vv/pics/xiaomi/xiaomi-mi-9-2.jpg "Xiaomi Mi 9")

View File

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

@@ -19,3 +19,11 @@ 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

@@ -0,0 +1,78 @@
/*
* 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

@@ -0,0 +1,141 @@
<?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

@@ -0,0 +1,149 @@
# 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,196 +22,13 @@ value:2907
[AID_VENDOR_FASTRPC]
value:2908
[vendor/bin/wcnss_filter]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND
[AID_VENDOR_QTR]
value:2909
[system/vendor/bin/wcnss_filter]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND NET_ADMIN
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: BLOCK_SUSPEND NET_ADMIN
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND NET_ADMIN
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: BLOCK_SUSPEND NET_ADMIN
[system/bin/cnss-daemon]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_BIND_SERVICE
[vendor/bin/pm-service]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE 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
[firmware/]
[dsp/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[firmware/image/*]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[vendor/firmware_mnt/image/*]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[bt_firmware/]
mode: 0771
user: AID_SYSTEM
group: AID_SYSTEM
user: AID_MEDIA
group: AID_MEDIA
caps: 0
[persist/]
@@ -220,8 +37,117 @@ user: AID_SYSTEM
group: AID_SYSTEM
caps: 0
[dsp/]
[system/bin/cnss-daemon]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_BIND_SERVICE
[system/bin/pd-mapper]
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
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_ADMIN BLOCK_SUSPEND
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: NET_ADMIN BLOCK_SUSPEND
[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]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
[vendor/bin/imsrcsd]
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
caps: NET_BIND_SERVICE
[vendor/bin/pm-service]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE SYS_BOOT
[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
[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
[vendor/firmware_mnt/image/*]
mode: 0771
user: AID_MEDIA
group: AID_MEDIA
user: AID_SYSTEM
group: AID_SYSTEM
caps: 0

View File

@@ -3,6 +3,60 @@
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>
@@ -12,6 +66,54 @@
<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>
@@ -61,12 +163,4 @@
<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,12 +39,6 @@
</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>
@@ -96,19 +90,13 @@
<fqname>@2.0::ILight/default</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.media.omx</name>
<name>android.hardware.media.c2</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IOmx</name>
<name>IComponentStore</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>
@@ -175,12 +163,12 @@
<hal format="hidl">
<name>android.hardware.tetheroffload.control</name>
<transport>hwbinder</transport>
<version>1.0</version>
<version>1.1</version>
<interface>
<name>IOffloadControl</name>
<instance>default</instance>
</interface>
<fqname>@1.0::IOffloadControl/default</fqname>
<fqname>@1.1::IOffloadControl/default</fqname>
</hal>
<hal format="hidl">
<name>com.qualcomm.qti.ant</name>
@@ -204,7 +192,7 @@
<hal format="hidl">
<name>com.qualcomm.qti.uceservice</name>
<transport>hwbinder</transport>
<version>2.2</version>
<version>2.1</version>
<interface>
<name>IUceService</name>
<instance>com.qualcomm.qti.uceservice</instance>
@@ -527,27 +515,6 @@
</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>
@@ -568,16 +535,6 @@
<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

@@ -1,443 +0,0 @@
<?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,6 +104,7 @@
<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" />
@@ -123,6 +124,7 @@
<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" />
@@ -139,6 +141,7 @@
<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" />
@@ -157,6 +160,7 @@
<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" />
@@ -173,6 +177,7 @@
<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" />
@@ -190,6 +195,7 @@
<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" />
@@ -208,6 +214,7 @@
<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" />
@@ -224,6 +231,7 @@
<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>
@@ -245,6 +253,7 @@
<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" />
@@ -263,6 +272,7 @@
<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" />
@@ -307,6 +317,7 @@
<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

@@ -1,51 +0,0 @@
<?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

@@ -0,0 +1,100 @@
<?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

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

@@ -0,0 +1,21 @@
<?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",
"1555200",
"1382400",
"1209600",
"1113600",
"844800",
"1036800",
"844800"
"1209600",
"1382400",
"1555200"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -20,10 +20,10 @@
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"1113600",
"1036800",
"768000"
"768000",
"1113600"
],
"DefaultIndex": 1,
"ResetOnInit": true
},
{
@@ -31,14 +31,13 @@
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"2131200",
"2016000",
"1920000",
"1708800",
"1497600",
"1401600",
"1171200",
"1056000"
"1497600",
"1708800",
"1920000",
"2131200"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -50,10 +49,10 @@
"9999999",
"1497600",
"1401600",
"1286400",
"1056000",
"0"
"0",
"1286400"
],
"DefaultIndex": 3,
"ResetOnInit": true
},
{
@@ -61,13 +60,12 @@
"Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"2534400",
"2227200",
"2016000",
"1708800",
"1497600",
"1401600",
"825600"
"1708800",
"2015999",
"2227200",
"2534400"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -79,23 +77,19 @@
"9999999",
"1497600",
"1401600",
"1286400",
"1171200",
"825600",
"0"
"0",
"1286400"
],
"DefaultIndex": 3,
"ResetOnInit": true
},
{
"Name": "GPUMaxFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/devfreq/max_freq",
"Values": [
"810000000",
"765000000",
"675000000",
"999999999",
"585000000",
"427000000",
"257000000"
"427000000"
],
"DefaultIndex": 0,
"ResetOnInit": true
@@ -104,9 +98,6 @@
"Name": "GPUMinFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/devfreq/min_freq",
"Values": [
"810000000",
"765000000",
"675000000",
"585000000",
"427000000",
"345000000",
@@ -148,16 +139,7 @@
"Path": "/sys/class/kgsl/kgsl-3d0/idle_timer",
"Values": [
"10000",
"80"
],
"ResetOnInit": true
},
{
"Name": "TASchedtuneBoost",
"Path": "/dev/stune/top-app/schedtune.boost",
"Values": [
"30",
"10"
"58"
],
"ResetOnInit": true
},
@@ -262,15 +244,6 @@
],
"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",
@@ -284,62 +257,11 @@
"Name": "PMQoSCpuDmaLatency",
"Path": "/dev/cpu_dma_latency",
"Values": [
"44",
"100"
"2c",
"64"
],
"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",
@@ -366,6 +288,16 @@
""
],
"Type": "Property"
},
{
"Name": "DoubleTapToWake",
"Path": "/sys/touchpanel/double_tap",
"Values": [
"0",
"1"
],
"DefaultIndex": 0,
"ResetOnInit": true
}
],
"Actions": [
@@ -397,7 +329,7 @@
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "675000000"
"Value": "427000000"
},
{
"PowerHint": "INTERACTION",
@@ -417,12 +349,6 @@
"Duration": 0,
"Value": "1113600"
},
{
"PowerHint": "INTERACTION",
"Node": "TASchedtuneBoost",
"Duration": 0,
"Value": "30"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBWHystTriggerCount",
@@ -453,24 +379,6 @@
"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",
@@ -505,7 +413,7 @@
"PowerHint": "LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 5000,
"Value": "44"
"Value": "2c"
},
{
"PowerHint": "LAUNCH",
@@ -555,41 +463,17 @@
"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": "44"
"Value": "2c"
},
{
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
@@ -601,7 +485,7 @@
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "44"
"Value": "2c"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
@@ -619,19 +503,13 @@
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "675000000"
"Value": "999999999"
},
{
"PowerHint": "ML_ACC",
"Node": "PMQoSCpuDmaLatency",
"Duration": 2000,
"Value": "44"
},
{
"PowerHint": "DISPLAY_UPDATE_IMMINENT",
"Node": "DisplayWakeup",
"Duration": 60,
"Value": "1"
"Value": "2c"
},
{
"PowerHint": "LOW_POWER_LITTLE_CLUSTER_50",
@@ -733,7 +611,7 @@
"PowerHint": "LOW_POWER_CPU_70",
"Node": "CPUBigPlusClusterMaxFreq",
"Duration": 3600000,
"Value": "2016000"
"Value": "2015999"
},
{
"PowerHint": "LOW_POWER_CPU_80",
@@ -760,22 +638,10 @@
"Value": "2534400"
},
{
"PowerHint": "Flipendo",
"Node": "CPULittleClusterMaxFreq",
"PowerHint": "DOUBLE_TAP_TO_WAKE",
"Node": "DoubleTapToWake",
"Duration": 0,
"Value": "1382400"
},
{
"PowerHint": "Flipendo",
"Node": "CPUBigPlusClusterMaxFreq",
"Duration": 0,
"Value": "1401600"
},
{
"PowerHint": "Flipendo",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "1497600"
"Value": "1"
}
]
}

View File

@@ -1,333 +0,0 @@
/* 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

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

View File

@@ -1,25 +0,0 @@
<?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>

717
configs/task_profiles.json Normal file
View File

@@ -0,0 +1,717 @@
{
"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

@@ -1,191 +0,0 @@
{
"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,12 +104,8 @@ 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
# Prefer connecting to 5Ghz AP even if
# its RSSI is lower by 3dBm than the 2.4Ghz AP
gRoamPrefer5GHz=1
gSelect5GHzMargin=3
gSelect5GHzMargin=5
# Disable rx wakelock
rx_wakelock_timeout=0
@@ -281,6 +277,10 @@ 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=3
gEnableNUDTracking=0
# Enable PEER UNMAP CONF SUPPORT
# 1 - enable 0 - disable(default)
@@ -494,8 +494,6 @@ 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
@@ -587,6 +585,8 @@ 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,9 +602,6 @@ 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
@@ -612,7 +609,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=1
g_sta_sap_scc_on_dfs_chan=2
# Enable wpa3 on 8150 device
sae_enabled=1
@@ -630,9 +627,6 @@ 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
@@ -642,6 +636,7 @@ 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

333
device.mk
View File

@@ -20,6 +20,12 @@ $(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)
@@ -34,11 +40,6 @@ 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 \
@@ -61,15 +62,15 @@ PRODUCT_PACKAGES += \
libvolumelistener
PRODUCT_PACKAGES += \
libaudio-resampler
libaudio-resampler \
libaudioroute.vendor
PRODUCT_COPY_FILES += \
$(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
$(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
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
@@ -86,13 +87,16 @@ 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/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
# Boot animation
TARGET_SCREEN_HEIGHT := 2340
@@ -101,13 +105,13 @@ TARGET_SCREEN_WIDTH := 1080
# Camera
PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl \
android.hardware.camera.provider@2.4-service_64
android.hardware.camera.provider@2.4-service_64 \
libc29.vendor
PRODUCT_PACKAGES += \
libcamera2ndk_vendor \
libdng_sdk.vendor \
libgui_vendor \
libpiex \
libpng.vendor \
libstdc++_vendor \
vendor.qti.hardware.camera.device@1.0.vendor \
@@ -122,16 +126,14 @@ 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
PRODUCT_COPY_FILES += \
prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-sp/libc++.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libc++.so
# 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)
# 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
$(LOCAL_PATH)/configs/permissions/privapp-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-miuicamera.xml
# Display
PRODUCT_PACKAGES += \
@@ -139,35 +141,32 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.graphics.composer@2.4-service \
android.hardware.graphics.mapper@3.0-impl-qti-display \
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.memtrack-service
PRODUCT_PACKAGES += \
android.hardware.graphics.mapper@3.0-impl-qti-display \
android.hardware.graphics.mapper@4.0-impl-qti-display
PRODUCT_PACKAGES += \
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
vendor.qti.hardware.memtrack-service
PRODUCT_PACKAGES += \
vendor.display.config@2.0 \
vendor.display.config@2.0.vendor
PRODUCT_PACKAGES += \
gralloc.qcom \
hwcomposer.qcom \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml
# 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
PRODUCT_PACKAGES += \
libtinyxml
# DRM
PRODUCT_PACKAGES += \
@@ -175,26 +174,17 @@ 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
android.hardware.drm-service.clearkey \
libcrypto-v33 \
libcrypto_shim.vendor
# 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 \
@@ -210,34 +200,21 @@ 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
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
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 += \
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 \
@@ -253,20 +230,22 @@ 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.xiaomi.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.xiaomi.rc
$(LOCAL_PATH)/rootdir/etc/init.target.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.target.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.affinity.sh
init.power.rc
# Input
PRODUCT_COPY_FILES += \
@@ -280,9 +259,9 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
# IRSC
# IRQ Balance
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/security/sec_config:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config
$(LOCAL_PATH)/configs/msm_irqbalance.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance.conf
# Keystore
PRODUCT_PACKAGES += \
@@ -290,7 +269,7 @@ PRODUCT_PACKAGES += \
# Lights
PRODUCT_PACKAGES += \
android.hardware.lights-service.cepheus
android.hardware.light-service.lineage
# Lineage Health
PRODUCT_PACKAGES += \
@@ -298,40 +277,53 @@ PRODUCT_PACKAGES += \
# LiveDisplay
PRODUCT_PACKAGES += \
vendor.lineage.livedisplay@2.0-service-sdm \
vendor.lineage.livedisplay@2.1-service.cepheus
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
# Media
PRODUCT_PACKAGES += \
libOmxAacEnc \
libOmxAmrEnc \
libOmxCore \
libOmxEvrcEnc \
libOmxG711Enc \
libOmxQcelp13Enc \
libOmxVdec \
libOmxVenc \
libstagefrighthw \
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 \
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 \
@@ -340,16 +332,10 @@ 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
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)
# Mlipay
PRODUCT_PACKAGES += \
vendor.xiaomi.hardware.mlipay@1.1.vendor \
vendor.xiaomi.hardware.mtdservice@1.0.vendor
# Network
PRODUCT_PACKAGES += \
@@ -360,7 +346,8 @@ PRODUCT_COPY_FILES += \
# Net
PRODUCT_PACKAGES += \
android.system.net.netd@1.1.vendor
android.system.net.netd@1.1.vendor \
libnetutils.vendor
# Neural Networks
PRODUCT_PACKAGES += \
@@ -370,7 +357,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.nfc@1.2-service \
android.hardware.secure_element@1.2.vendor \
NfcNci \
Tag
PRODUCT_PACKAGES += \
@@ -390,52 +376,51 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml
# Overlays
PRODUCT_ENFORCE_RRO_TARGETS := *
DEVICE_PACKAGE_OVERLAYS += \
$(LOCAL_PATH)/overlay \
$(LOCAL_PATH)/overlay-evolution
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += \
$(LOCAL_PATH)/overlay/frameworks/base/packages/overlays/NoCutoutOverlay
PRODUCT_PACKAGES += \
ApertureOverlay \
BluetoothResCepheus \
CarrierConfigOverlay \
DialerConfigOverlay \
FrameworksResCepheus \
LineageSDKOverlay \
SettingsProviderOverlayCepheus \
SettingsResCepheus \
SimpleDeviceConfigResCepheus \
SystemUIResCepheus \
TelephonyResCommon \
TetheringConfigOverlay \
WifiOverlay
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
# 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.cepheus-libperfmgr \
android.hardware.power.stats@1.0-service.xiaomi
android.hardware.power-service.lineage-libperfmgr
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-full-3.9.1-vendorcompat \
libprotobuf-cpp-lite-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 \
@@ -452,7 +437,10 @@ 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 \
@@ -463,14 +451,24 @@ 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.hardware.sensors@1.0-impl \
android.frameworks.sensorservice@1.0 \
android.frameworks.sensorservice@1.0.vendor \
android.hardware.sensors@1.0-impl-xiaomi \
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 \
@@ -484,16 +482,28 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
SmoothCutoutOverlay
# Shim
# Shims
PRODUCT_PACKAGES += \
libpiex_shim \
libwatermark_shim
libcrypto-v34
# Shipping API Level
PRODUCT_SHIPPING_API_LEVEL := 28
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
bootable/deprecated-ota \
hardware/google/interfaces \
hardware/xiaomi
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
# Telephony
PRODUCT_PACKAGES += \
@@ -504,12 +514,12 @@ PRODUCT_PACKAGES += \
ims-ext-common \
ims_ext_common.xml \
qti-telephony-hidl-wrapper \
qti_telephony_hidl_wrapper.xml \
qti-telephony-hidl-wrapper-prd \
qti_telephony_hidl_wrapper.xml \
qti_telephony_hidl_wrapper_prd.xml \
qti-telephony-utils \
qti_telephony_utils.xml \
qti-telephony-utils-prd \
qti_telephony_utils.xml \
qti_telephony_utils_prd.xml \
telephony-ext
@@ -522,14 +532,6 @@ 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
@@ -538,6 +540,9 @@ 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
@@ -550,6 +555,16 @@ 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
@@ -560,11 +575,6 @@ 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 \
@@ -574,6 +584,8 @@ PRODUCT_PACKAGES += \
libwifi-hal-ctrl \
libwifi-hal-qcom \
libwpa_client \
TetheringConfigOverlay \
WifiOverlay \
wpa_cli \
wpa_supplicant \
wpa_supplicant.conf
@@ -585,7 +597,6 @@ 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
@@ -598,16 +609,6 @@ 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,20 +5,15 @@
},
{
"repository": "kernel_xiaomi_cepheus",
"target_path": "kernel/xiaomi/cepheus"
"target_path": "kernel/xiaomi/cepheus",
"branch": "bq1"
},
{
"repository": "hardware_xiaomi",
"target_path": "hardware/xiaomi"
},
{
"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",
"repository": "nhansp/android_vendor_xiaomi_miuicamera",
"target_path": "vendor/xiaomi/miuicamera-cepheus",
"branch": "leica-5.0-cepheus",
"remote": "gitlab"

65
extract-files.py Executable file
View File

@@ -0,0 +1,65 @@
#!/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()

View File

@@ -1,95 +0,0 @@
#!/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"

View File

@@ -1,19 +0,0 @@
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",
],
}

View File

@@ -1,98 +0,0 @@
/*
* 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

View File

@@ -1,50 +0,0 @@
/*
* 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

View File

@@ -1,50 +0,0 @@
/*
* 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

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

@@ -1,11 +0,0 @@
<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,6 +115,8 @@ 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();
}
@@ -246,7 +248,6 @@ Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
onFingerUp();
return ErrorFilter(mDevice->post_enroll(mDevice));
}
@@ -255,6 +256,8 @@ 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));
}
@@ -396,9 +399,19 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) {
int32_t vendorCode = 0;
FingerprintAcquiredInfo result =
VendorAcquiredFilter(msg->data.acquired.acquired_info, &vendorCode);
ALOGD("onAcquired(%d)", result);
if (!thisPtr->mClientCallback->onAcquired(devId, result, vendorCode).isOk()) {
ALOGE("failed to invoke fingerprint onAcquired callback");
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");
}
}
} break;
case FINGERPRINT_TEMPLATE_ENROLLING:
@@ -435,7 +448,6 @@ 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,6 +2,9 @@ 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
@@ -17,8 +20,6 @@ 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,6 +27,7 @@ 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;
@@ -55,17 +56,17 @@ fail:
}
int main() {
android::sp<BiometricsFingerprint> service = nullptr;
android::sp<IBiometricsFingerprint> service = BiometricsFingerprint::getInstance();
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->registerAsSystemService();
status_t status = service->registerAsService();
if (status != android::OK) {
ALOGE("Cannot register service for Fingerprint HAL(%d).", status);
return 1;

View File

@@ -1,5 +1,4 @@
GNSS_CFLAGS = [
"-Werror",
"-Wno-error=unused-parameter",
"-Wno-error=macro-redefined",
"-Wno-error=reorder",
@@ -10,24 +9,12 @@ GNSS_CFLAGS = [
"-Wno-error=null-arithmetic",
"-Wno-error=null-conversion",
"-Wno-error=parentheses-equality",
"-Wno-error=undefined-bool-conversion",
"-Wno-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,7 +2,6 @@ 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 \
@@ -13,14 +12,29 @@ GNSS_CFLAGS := \
-Wno-error=null-arithmetic \
-Wno-error=null-conversion \
-Wno-error=parentheses-equality \
-Wno-error=undefined-bool-conversion \
-Wno-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 := cfi bounds null unreachable integer
GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address
endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)

10
gps/Makefile.am Normal file
View File

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

203
gps/android/1.0/AGnss.cpp Normal file
View File

@@ -0,0 +1,203 @@
/*
* 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

79
gps/android/1.0/AGnss.h Normal file
View File

@@ -0,0 +1,79 @@
/*
* 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

@@ -0,0 +1,115 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc__AGnssRilInterface"
#include <log_util.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sstream>
#include <string>
#include "Gnss.h"
#include "AGnssRil.h"
#include <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

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

View File

@@ -0,0 +1,99 @@
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)

346
gps/android/1.0/Gnss.cpp Normal file
View File

@@ -0,0 +1,346 @@
/*
* 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

143
gps/android/1.0/Gnss.h Normal file
View File

@@ -0,0 +1,143 @@
/*
* 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

@@ -0,0 +1,130 @@
/*
* 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

@@ -0,0 +1,80 @@
/*
* 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

@@ -0,0 +1,225 @@
/*
* 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

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

View File

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

View File

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

View File

@@ -0,0 +1,141 @@
/*
* 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

@@ -0,0 +1,91 @@
/*
* 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

@@ -0,0 +1,101 @@
/*
* 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

@@ -0,0 +1,77 @@
/*
* 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

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#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

75
gps/android/1.0/GnssNi.h Normal file
View File

@@ -0,0 +1,75 @@
/*
* 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

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

View File

@@ -1,4 +1,4 @@
<!-- Copyright (c) 2018, The Linux Foundation. All rights reserved.
<!-- 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
@@ -26,14 +26,10 @@ 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.media.c2</name>
<name>android.hardware.gnss</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IComponentStore</name>
<instance>default</instance>
</interface>
<fqname>@1.0::IGnss/default</fqname>
</hal>
</manifest>

View File

@@ -0,0 +1,197 @@
/* 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

@@ -0,0 +1,75 @@
/* 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

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

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

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

View File

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

View File

@@ -0,0 +1,274 @@
/* 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

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

View File

@@ -0,0 +1,276 @@
/* 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

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

View File

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#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;
}

203
gps/android/1.1/AGnss.cpp Normal file
View File

@@ -0,0 +1,203 @@
/*
* 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

79
gps/android/1.1/AGnss.h Normal file
View File

@@ -0,0 +1,79 @@
/*
* 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

@@ -0,0 +1,115 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LocSvc__AGnssRilInterface"
#include <log_util.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sstream>
#include <string>
#include "Gnss.h"
#include "AGnssRil.h"
#include <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

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

101
gps/android/1.1/Android.mk Normal file
View File

@@ -0,0 +1,101 @@
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)

466
gps/android/1.1/Gnss.cpp Normal file
View File

@@ -0,0 +1,466 @@
/*
* 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

154
gps/android/1.1/Gnss.h Normal file
View File

@@ -0,0 +1,154 @@
/*
* 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

@@ -0,0 +1,130 @@
/*
* 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

@@ -0,0 +1,80 @@
/*
* 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

@@ -0,0 +1,308 @@
/*
* 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

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

View File

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

View File

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

View File

@@ -0,0 +1,141 @@
/*
* 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

@@ -0,0 +1,91 @@
/*
* 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

@@ -0,0 +1,134 @@
/*
* 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

@@ -0,0 +1,83 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_GNSS_V1_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

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#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

75
gps/android/1.1/GnssNi.h Normal file
View File

@@ -0,0 +1,75 @@
/*
* 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

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

View File

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

View File

@@ -0,0 +1,197 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_BatchingAPIClient"
#include <inttypes.h>
#include <log_util.h>
#include <loc_cfg.h>
#include "LocationUtil.h"
#include "BatchingAPIClient.h"
#include "limits.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssBatching;
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
using ::android::hardware::gnss::V1_0::GnssLocation;
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
LocationCapabilitiesMask mask);
BatchingAPIClient::BatchingAPIClient(const sp<IGnssBatchingCallback>& callback) :
LocationAPIClientBase(),
mGnssBatchingCbIface(callback),
mDefaultId(UINT_MAX),
mLocationCapabilitiesMask(0)
{
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
locationCallbacks.trackingCb = nullptr;
locationCallbacks.batchingCb = nullptr;
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_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

@@ -0,0 +1,75 @@
/* 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_1 {
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_1
} // namespace gnss
} // namespace hardware
} // namespace android
#endif // BATCHING_API_CLINET_H

View File

@@ -0,0 +1,275 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_GeofenceApiClient"
#include <log_util.h>
#include <loc_cfg.h>
#include "LocationUtil.h"
#include "GeofenceAPIClient.h"
namespace android {
namespace hardware {
namespace gnss {
namespace V1_1 {
namespace implementation {
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
using ::android::hardware::gnss::V1_0::GnssLocation;
GeofenceAPIClient::GeofenceAPIClient(const sp<IGnssGeofenceCallback>& callback) :
LocationAPIClientBase(),
mGnssGeofencingCbIface(callback)
{
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
locationCallbacks.trackingCb = nullptr;
locationCallbacks.batchingCb = nullptr;
locationCallbacks.geofenceBreachCb = nullptr;
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_1
} // namespace gnss
} // namespace hardware
} // namespace android

View File

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

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