Compare commits
610 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67ad5315d6 | |||
| 88d0c30fc6 | |||
| 3b6898bfc1 | |||
| 4e27a0a101 | |||
| a45beaad9a | |||
| 8736074c9c | |||
| e56ffb6aad | |||
| fe2c29b19d | |||
| 3fc41a6e7f | |||
| 369778b139 | |||
| af9aee7482 | |||
| 53c401d687 | |||
| ba25bc6f8a | |||
|
|
339d2e7cef | ||
| 48f82ad004 | |||
| 7baf16fb92 | |||
| 5de9f5b7c5 | |||
| b5730ac501 | |||
| 20abf20601 | |||
| b112942ca4 | |||
| b6913d31e9 | |||
| a470f5bfb4 | |||
| 3ab3f4a24f | |||
| 723f713933 | |||
|
|
5302e19636 | ||
|
|
5e80d0c468 | ||
|
|
96d3341aa0 | ||
|
|
1e684643d0 | ||
|
|
28d25c97d1 | ||
|
|
5446035656 | ||
|
|
ebdb1c8b97 | ||
|
|
78ffc12b3e | ||
|
|
728ee1353f | ||
|
|
ada63c1e35 | ||
|
|
fd71765cc0 | ||
|
|
c7684338f4 | ||
|
|
4c20c50602 | ||
|
|
07a1b0c022 | ||
|
|
276cf39e77 | ||
|
|
ac8df90397 | ||
|
|
2027814128 | ||
|
|
da562aa2de | ||
|
|
bad061d7a8 | ||
|
|
bbdf12aff6 | ||
|
|
289d2844e5 | ||
|
|
b6991dcc3b | ||
|
|
b362d65c4b | ||
|
|
bba3efffe1 | ||
|
|
1baa582634 | ||
|
|
ef402553be | ||
|
|
92386a10e8 | ||
|
|
b52fb48cfc | ||
|
|
7c78c8f0e0 | ||
|
|
bcef96ca00 | ||
|
|
f5f6d8c858 | ||
|
|
859e3e47e0 | ||
|
|
b88bd306dc | ||
|
|
46a7975eea | ||
|
|
a889cc2ed9 | ||
|
|
693917a032 | ||
|
|
58e069f13d | ||
|
|
ab128af935 | ||
|
|
fd81eb9735 | ||
|
|
e6788c804d | ||
|
|
4300befdd8 | ||
|
|
bd350c52b9 | ||
|
|
17357898c6 | ||
|
|
609315d4e6 | ||
|
|
347383493e | ||
|
|
bb60b97acf | ||
|
|
e0e949f413 | ||
|
|
ebf2c8de33 | ||
|
|
adea84e63d | ||
|
|
bb8423f6aa | ||
|
|
c8c2a4670c | ||
|
|
b80b0971a9 | ||
|
|
a856044401 | ||
|
|
9fedf32108 | ||
|
|
3c9bd06708 | ||
|
|
11c4107749 | ||
|
|
956fea4394 | ||
|
|
d31479264f | ||
|
|
07a76d2d5f | ||
|
|
9ad12c967a | ||
|
|
3ed6380147 | ||
|
|
707697f469 | ||
|
|
74b1818ab7 | ||
|
|
d2a2a1aefa | ||
|
|
978001d5c3 | ||
|
|
b6aa721beb | ||
|
|
19ff52b202 | ||
|
|
3c4b4ebc53 | ||
|
|
1166700443 | ||
|
|
08638b9d2f | ||
|
|
8be20b8b6f | ||
|
|
5c486d60e0 | ||
|
|
a7c8a40fe6 | ||
|
|
6f0ecc6c93 | ||
|
|
b2c8d01735 | ||
|
|
63fcd20b6f | ||
|
|
e95498d904 | ||
|
|
966b2d2cb2 | ||
|
|
084d1c6ca9 | ||
|
|
d478cee1f2 | ||
|
|
8e81b5bb58 | ||
|
|
d3a6511072 | ||
|
|
ea6e7d7c8e | ||
|
|
39f6a554c5 | ||
|
|
614422ea5f | ||
|
|
20feb92ec5 | ||
|
|
e7e3c1dd72 | ||
|
|
50e2e73b25 | ||
|
|
2801762b64 | ||
|
|
1b509c3a06 | ||
|
|
63c07c9e6d | ||
|
|
8b0c4f58d6 | ||
|
|
536d2093d6 | ||
|
|
c02e70478d | ||
|
|
8ae220a15a | ||
|
|
22ab4f8562 | ||
|
|
ec089ead85 | ||
|
|
09af3b81e5 | ||
|
|
f7ea37346f | ||
|
|
28242a63f7 | ||
|
|
269065081f | ||
|
|
e558efa6c7 | ||
|
|
9adbd79171 | ||
|
|
52ae534855 | ||
|
|
8d4aec48b4 | ||
|
|
88f3904b3d | ||
|
|
a76f7efb1f | ||
|
|
8c43c8c732 | ||
|
|
c3de00f108 | ||
|
|
fa17a3c2cb | ||
|
|
3c11306e03 | ||
|
|
97fe8b7d98 | ||
|
|
9cd0085cd1 | ||
|
|
e9f0a214ac | ||
|
|
e5127e5fb5 | ||
|
|
7771746c28 | ||
|
|
b8fd8b6944 | ||
|
|
90437518e2 | ||
|
|
465f89e02a | ||
|
|
217f318363 | ||
|
|
030800da0d | ||
|
|
5e6b3da610 | ||
|
|
422e095c92 | ||
|
|
4e4bfed8b7 | ||
|
|
991d84a29c | ||
|
|
b4514a8ef9 | ||
|
|
1d985ebe92 | ||
|
|
d035ec4454 | ||
|
|
97c7358ea8 | ||
|
|
14575f5881 | ||
|
|
4a282ff2c2 | ||
|
|
88ceb7053d | ||
|
|
ea2bd6ee10 | ||
|
|
d4d09cb3c0 | ||
|
|
044784581c | ||
|
|
e81237b3db | ||
|
|
6b8a1acbd4 | ||
|
|
72430925ae | ||
|
|
d82e89b10b | ||
|
|
95ccff7a0d | ||
|
|
287d8c4480 | ||
|
|
4697edaf8e | ||
|
|
a2b6366507 | ||
|
|
0d7f300444 | ||
|
|
20567c5afa | ||
|
|
5ab75db242 | ||
|
|
0837c60960 | ||
|
|
885bd12834 | ||
|
|
f3424a6c14 | ||
|
|
50a88f3754 | ||
|
|
7b0a2d2656 | ||
|
|
5d99a9d68d | ||
|
|
bc48a966d3 | ||
|
|
a945c5b3db | ||
|
|
260054a411 | ||
|
|
a3fa23382a | ||
|
|
150387d181 | ||
|
|
42e08c5931 | ||
|
|
dd0232d56f | ||
|
|
19cf7d3a66 | ||
|
|
1a29113704 | ||
|
|
d998b7b30d | ||
|
|
b536b236ef | ||
|
|
62aab7ee73 | ||
|
|
e34cb03b2e | ||
|
|
b91f3ac9b4 | ||
|
|
0c19dfc067 | ||
|
|
4b76bf362d | ||
|
|
0cc7550b38 | ||
|
|
59cb2daaae | ||
|
|
8c8a811d45 | ||
|
|
12b2b0a9b1 | ||
|
|
d34f83f2f4 | ||
|
|
7bf6cdb6e2 | ||
|
|
d1db579402 | ||
|
|
516e46e63f | ||
|
|
79da60417a | ||
|
|
7ad864afbb | ||
|
|
af07e76487 | ||
|
|
0e9a7611c8 | ||
|
|
d534f93bdd | ||
|
|
ec35aaaeb9 | ||
|
|
f577012c43 | ||
|
|
1f2973c64b | ||
|
|
4b9195c350 | ||
|
|
cdfb55e524 | ||
|
|
a27abbaf98 | ||
|
|
1da42b7de9 | ||
|
|
a8111156a8 | ||
|
|
e8fa6ec48a | ||
|
|
4fd19cb47b | ||
|
|
bc0b9b8b08 | ||
|
|
a817954c8f | ||
|
|
27a90593ad | ||
|
|
004c389b94 | ||
|
|
78d3a0ae78 | ||
|
|
de33be9dab | ||
|
|
432f0c69e7 | ||
|
|
3f46f13d47 | ||
|
|
06f71ca955 | ||
|
|
080c3e26df | ||
|
|
9f391baab4 | ||
|
|
cb00aa8a0d | ||
|
|
e256984388 | ||
|
|
c6673d71d8 | ||
|
|
52935a7012 | ||
|
|
d1f9ec1c31 | ||
|
|
e95f64f4a9 | ||
|
|
1711fe2bbc | ||
|
|
e5a425968c | ||
|
|
cf0ae8795d | ||
|
|
b674376e1f | ||
|
|
4bdcf75ae7 | ||
|
|
23384f480f | ||
|
|
ddde68a999 | ||
|
|
fb7aa972bc | ||
|
|
2398964cd1 | ||
|
|
c9fd60682d | ||
|
|
890ce3d951 | ||
|
|
74be7f2370 | ||
|
|
2adcf1e9e3 | ||
|
|
8b54136343 | ||
|
|
049215e5ca | ||
|
|
0acdef56a0 | ||
|
|
16d31a1018 | ||
|
|
edaa106cbe | ||
|
|
11b9544b64 | ||
|
|
1f175778ce | ||
|
|
2f209c0288 | ||
|
|
913adca7d4 | ||
|
|
d551e9b863 | ||
|
|
7d32600bbb | ||
|
|
c26a3a647f | ||
|
|
121d5599b8 | ||
|
|
a6abecbfaa | ||
|
|
a7260866c5 | ||
|
|
2715beb6dd | ||
|
|
abd2241c89 | ||
|
|
e2fcdcd699 | ||
|
|
9cf265e74f | ||
|
|
7ef76bf2a5 | ||
|
|
4689895309 | ||
|
|
e0f0797cfc | ||
|
|
5ed63e6a03 | ||
|
|
f58d907831 | ||
|
|
cf7794bb03 | ||
|
|
aeb91a2716 | ||
|
|
4fdada3ad7 | ||
|
|
e789ea7686 | ||
|
|
7900bbeefe | ||
|
|
1d85ca8512 | ||
|
|
1d2627ba8e | ||
|
|
e9d121e8c0 | ||
|
|
00c9797f0c | ||
|
|
2dfe7d6dc6 | ||
|
|
dd20f0720c | ||
|
|
e06cde02a0 | ||
|
|
bfba36ff0c | ||
|
|
9ff8f58dc5 | ||
|
|
4f7ee37fa8 | ||
|
|
98f43d4570 | ||
|
|
ff05c63f3d | ||
|
|
89b538520f | ||
|
|
045c45cd2c | ||
|
|
3e3e0d025b | ||
|
|
7e971b9a2e | ||
|
|
7e06c00e7b | ||
|
|
98884fd63d | ||
|
|
fc50c0068f | ||
|
|
a3876cffba | ||
|
|
8e1198cfae | ||
|
|
547b9d49de | ||
|
|
948e3de067 | ||
|
|
b956fddead | ||
|
|
1865c7bc31 | ||
|
|
946b1bbd8c | ||
|
|
a2c2f48875 | ||
|
|
9a2c176036 | ||
|
|
4f8989a57d | ||
|
|
374d144e99 | ||
|
|
7ee6cd4fa6 | ||
|
|
d6a5ab5cc3 | ||
|
|
98249c989c | ||
|
|
3505d0610f | ||
|
|
9e79c01941 | ||
|
|
e203df42d4 | ||
|
|
1e55055f3b | ||
|
|
b2190e6ed4 | ||
|
|
5cfc343eab | ||
|
|
c281f3d8e8 | ||
|
|
594dfa243b | ||
|
|
cea62dc868 | ||
|
|
782e59335a | ||
|
|
2ddfd79aed | ||
|
|
96c93cd924 | ||
|
|
2a3a6d27ae | ||
|
|
7c7a57b8ee | ||
|
|
022e034e41 | ||
|
|
dedb412984 | ||
|
|
a553d4831f | ||
|
|
04817bab2d | ||
|
|
508809fd4f | ||
|
|
237a49921e | ||
|
|
b231d74f0d | ||
|
|
39ba909749 | ||
|
|
b1b17f366a | ||
|
|
9ad08a924f | ||
|
|
6ac2c4433f | ||
|
|
09dc6dc60c | ||
|
|
80033e13af | ||
|
|
395353b55b | ||
|
|
149382ac86 | ||
|
|
fdb8d1cd49 | ||
|
|
aa84cbf8e7 | ||
|
|
088e1c0f41 | ||
|
|
e206ffbc64 | ||
|
|
82dededd45 | ||
|
|
f91fb2693a | ||
|
|
4a864efaea | ||
|
|
7567274a8b | ||
|
|
ba3506d370 | ||
|
|
d01471ef69 | ||
|
|
0685c5d9d4 | ||
|
|
d556f36262 | ||
|
|
0745279f77 | ||
|
|
187a7f5cb9 | ||
|
|
86eae417a2 | ||
|
|
a8a02175a4 | ||
|
|
a3a7659b1c | ||
|
|
407ae2161d | ||
|
|
2d5e8c979d | ||
|
|
83fd6f3075 | ||
|
|
923a1322e0 | ||
|
|
293a73c330 | ||
|
|
b5e08bdfe1 | ||
|
|
8b3d61691f | ||
|
|
ad0b3770a6 | ||
|
|
20c1ad21f2 | ||
|
|
7e4cf12659 | ||
|
|
010fda55c0 | ||
|
|
0fc52f85fb | ||
|
|
004a154ac0 | ||
|
|
50682b8c85 | ||
|
|
fe5e29836e | ||
|
|
8106feb9ec | ||
|
|
1ae4fb433d | ||
|
|
fdc86c9539 | ||
|
|
f50e47ee72 | ||
|
|
87e5b7a399 | ||
|
|
018b4b7843 | ||
|
|
2c9221b4d9 | ||
|
|
28e54bf5a2 | ||
|
|
98da4867df | ||
|
|
c073fab083 | ||
|
|
4797bff9cb | ||
|
|
55aa44dd69 | ||
|
|
ed4a61cc8e | ||
|
|
449d748e08 | ||
|
|
7615819b87 | ||
|
|
56189fa774 | ||
|
|
975644d8c5 | ||
|
|
9ac7efffab | ||
|
|
9e422d583c | ||
|
|
c880f310af | ||
|
|
36db35bca7 | ||
|
|
e89457f4d5 | ||
|
|
622103b067 | ||
|
|
fe891774d7 | ||
|
|
baf6e20ee5 | ||
|
|
b1775e1d5c | ||
|
|
8d03d426aa | ||
|
|
5c0a3e2fa6 | ||
|
|
a2f1622399 | ||
|
|
518018549c | ||
|
|
2ae33e1e44 | ||
|
|
2351386ef4 | ||
|
|
a56001b137 | ||
|
|
a10bff650f | ||
|
|
f929038ae6 | ||
|
|
df9c974b5f | ||
|
|
59eb1d90db | ||
|
|
985e4cf9f8 | ||
|
|
fdfaca5a95 | ||
|
|
626a9a2c1d | ||
|
|
12eb1f48e1 | ||
|
|
bb9208b34c | ||
|
|
7088452895 | ||
|
|
214e14f25d | ||
|
|
448978610e | ||
|
|
d3e138299c | ||
|
|
bf736ef4a9 | ||
|
|
a9735a458e | ||
|
|
b43a5b53f5 | ||
|
|
1b2dd0e7d6 | ||
|
|
f2a28962c4 | ||
|
|
3a5bc793cc | ||
|
|
896ab86f48 | ||
|
|
1e1d960414 | ||
|
|
396cc2fbd0 | ||
|
|
09fc6cacea | ||
|
|
85ad9bb9a9 | ||
|
|
3c92e0660a | ||
|
|
3c3cf4bdc9 | ||
|
|
cb4dcd6692 | ||
|
|
05f03c4959 | ||
|
|
89c6e30aea | ||
|
|
65c5d275d3 | ||
|
|
814e5f6b2a | ||
|
|
5130da8b6e | ||
|
|
f86a4217ad | ||
|
|
d453d43f6e | ||
|
|
c667ae92d9 | ||
|
|
edbae219f5 | ||
|
|
267c5a8242 | ||
|
|
83eb12f960 | ||
|
|
d0a8ba654d | ||
|
|
cf65b9c956 | ||
|
|
da637d9594 | ||
|
|
8fff1eafae | ||
|
|
f13bc4669e | ||
|
|
988af27f20 | ||
|
|
bfd1586627 | ||
|
|
9e8ca750a7 | ||
|
|
90e4e90db0 | ||
|
|
3f6ea0f788 | ||
|
|
2a71d01872 | ||
|
|
9704fdd8e5 | ||
|
|
e18963a53e | ||
|
|
bbbf731c09 | ||
|
|
4a46cf8a21 | ||
|
|
0f7d54e7e2 | ||
|
|
02c885f397 | ||
|
|
8f748dd3fc | ||
|
|
b9fad0a868 | ||
|
|
3225e1f032 | ||
|
|
4a73405713 | ||
|
|
740e401842 | ||
|
|
5f22ead13c | ||
|
|
4f5ac01526 | ||
|
|
8c9f95229a | ||
|
|
d951f4c1fc | ||
|
|
7b1cdb102f | ||
|
|
07912cc87a | ||
|
|
cf8da2268b | ||
|
|
c230ade269 | ||
|
|
0777b98527 | ||
|
|
0c162c26df | ||
|
|
a0594ed1be | ||
|
|
cb711b4bc9 | ||
|
|
6c71d0db11 | ||
|
|
1de560b5dc | ||
|
|
402c2c6c5a | ||
|
|
736afc304a | ||
|
|
840527c8c9 | ||
|
|
2bae041fb9 | ||
|
|
abc65dd29a | ||
|
|
25a904b97b | ||
|
|
d51d55362f | ||
|
|
8c1be90fec | ||
|
|
bfa3c136fb | ||
|
|
08c51829b3 | ||
|
|
d1bc25f919 | ||
|
|
34e2330754 | ||
|
|
5606c395b9 | ||
|
|
ca21f02976 | ||
|
|
4b783fce7c | ||
|
|
06eaca087e | ||
|
|
74c72238f3 | ||
|
|
fca541cc0e | ||
|
|
9694652d8a | ||
|
|
79b769d6dd | ||
|
|
5b9697b5ec | ||
|
|
fbea4b6531 | ||
|
|
0c87d5d01c | ||
|
|
4aba87d662 | ||
|
|
28290ad89b | ||
|
|
0ff53cdc4b | ||
|
|
2e4d6582b6 | ||
|
|
3806c0a018 | ||
|
|
c61d81d19d | ||
|
|
d4d0cd4203 | ||
|
|
4c1f71fd00 | ||
|
|
78e009c31a | ||
|
|
dc9514b562 | ||
|
|
4eb1333bd9 | ||
|
|
f9c363be33 | ||
|
|
b193704a21 | ||
|
|
3a30eac242 | ||
|
|
703ce6185f | ||
|
|
f7202d945a | ||
|
|
bb1c459b6c | ||
|
|
7fd729f892 | ||
|
|
268a4a616b | ||
|
|
d69e09afc0 | ||
|
|
785a4549b5 | ||
|
|
bfdd7f34b7 | ||
|
|
3762c3a27a | ||
|
|
95789fb978 | ||
|
|
bdb72ccdda | ||
|
|
628e5bb792 | ||
|
|
a009da566f | ||
|
|
78ecb0486d | ||
|
|
d24959344b | ||
|
|
ed7fb42400 | ||
|
|
f2c6d70d33 | ||
|
|
b118b506b0 | ||
|
|
83d2c67c0f | ||
|
|
0023782a75 | ||
|
|
66f9924a24 | ||
|
|
fdd561154a | ||
|
|
a5fc9e5116 | ||
|
|
5b0c66da89 | ||
|
|
a568a6975a | ||
|
|
f03435cfa0 | ||
|
|
1230d1697a | ||
|
|
a7c075d92e | ||
|
|
a3219a8620 | ||
|
|
e6f023e863 | ||
|
|
17f75da2a2 | ||
|
|
ff107da3ac | ||
|
|
f9a302c46d | ||
|
|
7b72e12642 | ||
|
|
d892af7d2c | ||
|
|
70513be9d3 | ||
|
|
e2743dd587 | ||
|
|
6ee7b8e4b9 | ||
|
|
c14d8d3c76 | ||
|
|
b569d74115 | ||
|
|
67ee384719 | ||
|
|
799cba18d5 | ||
|
|
4dec642e4b | ||
|
|
3c3059ce4f | ||
|
|
4938a68e66 | ||
|
|
63dbd6d58c | ||
|
|
448ace0778 | ||
|
|
2b07d9622e | ||
|
|
a788d63ada | ||
|
|
51f9a0b32c | ||
|
|
83e2085c5a | ||
|
|
0c0575bc4a | ||
|
|
d11ba00fca | ||
|
|
4a5953a970 | ||
|
|
7081b25195 | ||
|
|
78b46dc6de | ||
|
|
e591c44220 | ||
|
|
f275a6899b | ||
|
|
a74fdde075 | ||
|
|
f0ec108ca1 | ||
|
|
1af68cbed4 | ||
|
|
ea5d5c4dff | ||
|
|
ff8fbc7076 | ||
|
|
666ee95081 | ||
|
|
923f1f2a95 | ||
|
|
dcc70cd9f9 | ||
|
|
2e607f9b56 | ||
|
|
97eb07a4ed | ||
|
|
b512b876cb | ||
|
|
b5a932474f | ||
|
|
b647d4c755 | ||
|
|
ae2da4b525 | ||
|
|
93b2ed3d47 | ||
|
|
d991cced58 | ||
|
|
25d5301a0f | ||
|
|
26e3843991 | ||
|
|
9d981f72dd | ||
|
|
3735a73f3a | ||
|
|
8c4bae1ef4 | ||
|
|
67e0c9cca3 | ||
|
|
326069e03c | ||
|
|
30ec3bd602 | ||
|
|
7f6a3d082a | ||
|
|
ad0d861b68 | ||
|
|
abf862a4a2 | ||
|
|
1d487bf408 | ||
|
|
cf8a770633 | ||
|
|
603150a624 | ||
|
|
ecf768b139 | ||
|
|
085c46db76 | ||
|
|
eb6851cf32 | ||
|
|
48b5b0c075 | ||
|
|
b0b27867b3 | ||
|
|
2305a91133 | ||
|
|
9bf7423fdf | ||
|
|
5784310aed | ||
|
|
3c29984ae7 | ||
|
|
958a8a544c |
12
.github/FUNDING.yml
vendored
12
.github/FUNDING.yml
vendored
@@ -1,12 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: https://www.paypal.me/Evasi0nXiao
|
||||
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Build via SSH
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Sync
|
||||
run: zsh ~/sync.sh
|
||||
|
||||
- name: Clean
|
||||
run: |
|
||||
cd /Android/rr
|
||||
make clobber
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
zsh ~/build.sh
|
||||
|
||||
- name: Release
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
prerelease: false
|
||||
files: |
|
||||
/Android/rr/out/target/product/cepheus/RROS*
|
||||
|
||||
15
Android.bp
15
Android.bp
@@ -1,6 +1,21 @@
|
||||
soong_namespace {
|
||||
imports: [
|
||||
"hardware/google/interfaces",
|
||||
"hardware/google/pixel",
|
||||
"hardware/xiaomi",
|
||||
],
|
||||
}
|
||||
|
||||
install_symlink {
|
||||
name: "firmware_wlan_mac.bin_symlink",
|
||||
vendor: true,
|
||||
installed_location: "firmware/wlan/qca_cld/wlan_mac.bin",
|
||||
symlink_target: "/mnt/vendor/persist/wlan_mac.bin",
|
||||
}
|
||||
|
||||
install_symlink {
|
||||
name: "firmware_WCNSS_qcom_cfg.ini_symlink",
|
||||
vendor: true,
|
||||
installed_location: "firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini",
|
||||
symlink_target: "/vendor/etc/wifi/WCNSS_qcom_cfg.ini",
|
||||
}
|
||||
|
||||
137
Android.mk
137
Android.mk
@@ -1,137 +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))
|
||||
|
||||
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)
|
||||
|
||||
IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so
|
||||
IMS_SYMLINKS := $(addprefix $(TARGET_OUT_SYSTEM_EXT_APPS_PRIVILEGED)/ims/lib/arm64/,$(notdir $(IMS_LIBS)))
|
||||
$(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "IMS lib link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /system/system_ext/lib64/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
|
||||
|
||||
RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/adsp/
|
||||
$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM ADSP folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/adsp $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_CDSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/cdsp/
|
||||
$(RFS_MSM_CDSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM CDSP folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/cdsp $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/cdsp $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/mpss/
|
||||
$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM MPSS folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/mpss $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/slpi/
|
||||
$(RFS_MSM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM SLPI folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/slpi $@/ramdumps
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/slpi $@/readwrite
|
||||
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(RFS_MSM_ADSP_SYMLINKS) $(RFS_MSM_CDSP_SYMLINKS) $(RFS_MSM_MPSS_SYMLINKS) $(RFS_MSM_SLPI_SYMLINKS)
|
||||
|
||||
WIFI_FIRMWARE_SYMLINKS := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/
|
||||
$(WIFI_FIRMWARE_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating wifi firmware symlinks: $@"
|
||||
mkdir -p $@
|
||||
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_cfg.ini $@/WCNSS_qcom_cfg.ini
|
||||
$(hide) ln -sf /mnt/vendor/persist/wlan_mac.bin $@/wlan_mac.bin
|
||||
|
||||
WCNSS_MAC_SYMLINK := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/wlan_mac.bin
|
||||
$(WCNSS_MAC_SYMLINK): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "WCNSS MAC bin link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /mnt/vendor/persist/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(WIFI_FIRMWARE_SYMLINKS)
|
||||
|
||||
EGL_LIBS := libEGL_adreno.so libGLESv2_adreno.so libq3dtools_adreno.so
|
||||
EGL_32_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/lib/,$(notdir $(EGL_LIBS)))
|
||||
$(EGL_32_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "EGL 32 lib link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf egl/$(notdir $@) $@
|
||||
|
||||
EGL_64_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/lib64/,$(notdir $(EGL_LIBS)))
|
||||
$(EGL_64_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "EGL lib link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf egl/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(EGL_32_SYMLINKS) $(EGL_64_SYMLINKS)
|
||||
|
||||
endif
|
||||
@@ -15,9 +15,4 @@
|
||||
#
|
||||
|
||||
PRODUCT_MAKEFILES := \
|
||||
$(LOCAL_DIR)/aosp_cepheus.mk
|
||||
|
||||
COMMON_LUNCH_CHOICES := \
|
||||
aosp_cepheus-user \
|
||||
aosp_cepheus-userdebug \
|
||||
aosp_cepheus-eng
|
||||
$(LOCAL_DIR)/lineage_cepheus.mk
|
||||
|
||||
@@ -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,41 +47,23 @@ TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a76
|
||||
TARGET_OTA_ASSERT_DEVICE := cepheus
|
||||
|
||||
# Audio
|
||||
AUDIO_FEATURE_ENABLED_CON_THREAD := true
|
||||
AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
|
||||
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
|
||||
AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
|
||||
AUDIO_FEATURE_ENABLED_HDMI_SPK := true
|
||||
AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
|
||||
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
|
||||
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
|
||||
AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
|
||||
|
||||
USE_CUSTOM_AUDIO_POLICY := 1
|
||||
USE_XML_AUDIO_POLICY_CONF := 1
|
||||
BOARD_SUPPORTS_SOUND_TRIGGER := true
|
||||
|
||||
# Bluetooth
|
||||
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth/include
|
||||
TARGET_FWK_SUPPORTS_FULL_VALUEADDS := true
|
||||
TARGET_USE_QTI_BT_STACK := true
|
||||
TARGET_PROVIDES_AUDIO_EXTNS := true
|
||||
|
||||
# Bootloader
|
||||
TARGET_BOOTLOADER_BOARD_NAME := cepheus
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
|
||||
# Camera
|
||||
TARGET_USES_QTI_CAMERA_DEVICE := true
|
||||
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
|
||||
|
||||
# Graphics
|
||||
BOARD_USES_ADRENO := true
|
||||
@@ -97,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
|
||||
@@ -106,11 +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 := $(DEVICE_PATH)/configs/hidl/compatibility_matrix.xml
|
||||
DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
|
||||
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \
|
||||
$(DEVICE_PATH)/configs/hidl/framework_compatibility_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
|
||||
@@ -121,18 +101,25 @@ BOARD_KERNEL_SEPARATED_DTBO := true
|
||||
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
|
||||
BOARD_RAMDISK_OFFSET := 0x01000000
|
||||
|
||||
TARGET_KERNEL_CLANG_COMPILE := true
|
||||
TARGET_KERNEL_CONFIG := cepheus_defconfig
|
||||
TARGET_KERNEL_SOURCE := kernel/xiaomi/cepheus
|
||||
TARGET_KERNEL_CONFIG := \
|
||||
vendor/sm8150-perf_defconfig \
|
||||
vendor/xiaomi/sm8150-common.config \
|
||||
vendor/xiaomi/cepheus.config
|
||||
|
||||
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
|
||||
BOARD_KERNEL_CMDLINE += kpti=off
|
||||
BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc
|
||||
|
||||
# Lineage Health
|
||||
$(call soong_config_set_bool,lineage_health,charging_control_supports_bypass,false)
|
||||
$(call soong_config_set,lineage_health,charging_control_charging_path,/sys/class/power_supply/battery/charging_enabled)
|
||||
|
||||
# Media
|
||||
TARGET_USES_ION := true
|
||||
@@ -143,23 +130,42 @@ BOARD_BOOTIMAGE_PARTITION_SIZE := 134217728
|
||||
BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
|
||||
BOARD_DTBOIMG_PARTITION_SIZE := 33554432
|
||||
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864
|
||||
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472
|
||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712
|
||||
BOARD_VENDORIMAGE_PARTITION_SIZE := 1610612736
|
||||
BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64)
|
||||
|
||||
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
|
||||
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_SUPER_PARTITION_GROUPS := cepheus_dynamic_partitions
|
||||
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor system_ext odm product
|
||||
BOARD_SUPER_PARTITION_SIZE := 6442450944
|
||||
BOARD_SUPER_PARTITION_METADATA_DEVICE := system
|
||||
BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor cust
|
||||
BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 3758096384
|
||||
BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 1610612736
|
||||
BOARD_SUPER_PARTITION_CUST_DEVICE_SIZE := 1073741824
|
||||
BOARD_CEPHEUS_DYNAMIC_PARTITIONS_SIZE := 6438256640 # BOARD_SUPER_PARTITION_SIZE - 4MB
|
||||
|
||||
BOARD_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
|
||||
|
||||
# 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
|
||||
@@ -170,7 +176,7 @@ 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)
|
||||
@@ -179,10 +185,11 @@ TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)
|
||||
ENABLE_VENDOR_RIL_SERVICE := true
|
||||
|
||||
# Security patch level
|
||||
VENDOR_SECURITY_PATCH := 2021-10-01
|
||||
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
|
||||
|
||||
@@ -2,6 +2,10 @@ Copyright © 2020 DerpFest
|
||||
|
||||
Copyright © 2020-2021 PixelExperience
|
||||
|
||||
Copyright © 2025 PixelOS
|
||||
|
||||
Copyright © 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
|
||||
|
||||
|
||||
_17409_1550674081.jpg "Xiaomi Mi 9 in black")
|
||||

|
||||
|
||||
@@ -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)
|
||||
@@ -1,31 +0,0 @@
|
||||
[
|
||||
{
|
||||
"repository" : "vendor_xiaomi_cepheus",
|
||||
"target_path": "vendor/xiaomi/cepheus",
|
||||
"remote" : "pixel-devices-blobs",
|
||||
"branch" : "twelve"
|
||||
},
|
||||
{
|
||||
"repository" : "vendor_xiaomi_sdm845-common-extra",
|
||||
"target_path": "vendor/xiaomi/sdm845-common-extra",
|
||||
"branch" : "twelve",
|
||||
"remote" : "pixel-devices-blobs"
|
||||
},
|
||||
{
|
||||
"repository" : "kernel_xiaomi_cepheus",
|
||||
"target_path": "kernel/xiaomi/cepheus",
|
||||
"branch" : "twelve"
|
||||
},
|
||||
{
|
||||
"repository" : "PixelExperience/hardware_xiaomi",
|
||||
"target_path": "hardware/xiaomi",
|
||||
"branch" : "twelve"
|
||||
},
|
||||
{
|
||||
"repository" : "vendor_xiaomi-firmware",
|
||||
"target_path": "vendor/xiaomi-firmware",
|
||||
"remote" : "pixel-devices-blobs",
|
||||
"clone-depth": "1",
|
||||
"branch" : "twelve"
|
||||
}
|
||||
]
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright (C) 2012 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 _BDROID_BUILDCFG_H
|
||||
#define _BDROID_BUILDCFG_H
|
||||
|
||||
// Disables read remote device feature
|
||||
#define MAX_ACL_CONNECTIONS 16
|
||||
#define MAX_L2CAP_CHANNELS 32
|
||||
#define BLE_VND_INCLUDED TRUE
|
||||
#define GATT_MAX_PHY_CHANNEL 10
|
||||
|
||||
#define AVDT_NUM_SEPS 35
|
||||
#endif
|
||||
@@ -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"
|
||||
],
|
||||
}
|
||||
|
||||
78
camera/CameraProviderExtension.cpp
Normal file
78
camera/CameraProviderExtension.cpp
Normal 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);
|
||||
}
|
||||
141
configs/audio/audio_effects.xml
Normal file
141
configs/audio/audio_effects.xml
Normal 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>
|
||||
149
configs/audio/audio_io_policy.conf
Normal file
149
configs/audio/audio_io_policy.conf
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,15 @@
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
|
||||
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AC3"
|
||||
samplingRates="32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_E_AC3"
|
||||
samplingRates="32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
<profile name="" format="AUDIO_FORMAT_E_AC3_JOC"
|
||||
samplingRates="32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||
</mixPort>
|
||||
<mixPort name="dsd_compress_passthrough" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD AUDIO_OUTPUT_FLAG_NON_BLOCKING">
|
||||
@@ -268,21 +277,6 @@
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink"
|
||||
encodedFormats="AUDIO_FORMAT_SBC AUDIO_FORMAT_AAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_LDAC AUDIO_FORMAT_CELT AUDIO_FORMAT_APTX_ADAPTIVE AUDIO_FORMAT_APTX_TWSP">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink"
|
||||
encodedFormats="AUDIO_FORMAT_SBC AUDIO_FORMAT_AAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_LDAC AUDIO_FORMAT_CELT AUDIO_FORMAT_APTX_ADAPTIVE AUDIO_FORMAT_APTX_TWSP">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink"
|
||||
encodedFormats="AUDIO_FORMAT_SBC AUDIO_FORMAT_AAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_LDAC AUDIO_FORMAT_CELT AUDIO_FORMAT_APTX_ADAPTIVE AUDIO_FORMAT_APTX_TWSP">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100 48000 64000 88200 96000 128000 176400 192000" channelMasks="dynamic"/>
|
||||
@@ -371,12 +365,6 @@
|
||||
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,USB Device In,USB Headset In"/>
|
||||
<route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" />
|
||||
<route type="mix" sink="voip record" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
|
||||
<route type="mix" sink="BT A2DP Out"
|
||||
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
<route type="mix" sink="BT A2DP Headphones"
|
||||
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
<route type="mix" sink="BT A2DP Speaker"
|
||||
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
</routes>
|
||||
|
||||
</module>
|
||||
@@ -410,6 +398,9 @@
|
||||
<!-- Bluetooth Audio HAL for Hearing aid -->
|
||||
<xi:include href="/vendor/etc/bluetooth_hearing_aid_audio_policy_configuration.xml"/>
|
||||
|
||||
<!-- Bluetooth Audio HAL -->
|
||||
<xi:include href="/vendor/etc/bluetooth_audio_policy_configuration.xml"/>
|
||||
|
||||
</modules>
|
||||
<!-- End of Modules section -->
|
||||
|
||||
|
||||
1857
configs/audio/dax-default.xml
Normal file
1857
configs/audio/dax-default.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<compatibility-matrix version="1.0" type="device">
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.schedulerservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISchedulingPolicyService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.sensorservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensorManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.allocator</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.manager</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IServiceManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.memory</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.token</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ITokenManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.system.wifi.keystore</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IKeystore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
||||
166
configs/hidl/framework_compatibility_matrix.xml
Normal file
166
configs/hidl/framework_compatibility_matrix.xml
Normal file
@@ -0,0 +1,166 @@
|
||||
<!--
|
||||
Copyright (C) 2024 The LineageOS Project
|
||||
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>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>ILight</name>
|
||||
<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>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAntHci</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.dolby.hardware.dms</name>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.goodix.hardware.biometrics.fingerprint</name>
|
||||
<version>2.0-1</version>
|
||||
<interface>
|
||||
<name>IGoodixFingerprintDaemon</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.nxp.nxpnfc</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>INxpNfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.fingerprintextension</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IXiaomiFingerprint</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>vendor.xiaomi.hardware.mlipay</name>
|
||||
<version>1.0-1</version>
|
||||
<interface>
|
||||
<name>IMlipayService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
||||
@@ -1,4 +1,4 @@
|
||||
<manifest version="1.0" type="device" target-level="4">
|
||||
<manifest version="1.0" type="device" target-level="5">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -29,16 +29,6 @@
|
||||
</interface>
|
||||
<fqname>@1.0::IBluetoothHci/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.bluetooth.audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IBluetoothAudioProvidersFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.0::IBluetoothAudioProvidersFactory/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.camera.provider</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -82,12 +72,12 @@
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.keymaster</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>4.0</version>
|
||||
<version>4.1</version>
|
||||
<interface>
|
||||
<name>IKeymasterDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@4.0::IKeymasterDevice/default</fqname>
|
||||
<fqname>@4.1::IKeymasterDevice/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.light</name>
|
||||
@@ -100,29 +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.memtrack</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMemtrack</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IMemtrack/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.neuralnetworks</name>
|
||||
@@ -167,16 +141,6 @@
|
||||
</interface>
|
||||
<fqname>@1.1::IRadioConfig/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.renderscript</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IDevice/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.sensors</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -199,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>
|
||||
@@ -228,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>
|
||||
@@ -387,16 +351,6 @@
|
||||
</interface>
|
||||
<fqname>@2.0::IIop/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.perf</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IPerf</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@2.0::IPerf/default</fqname>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.am</name>
|
||||
<transport>hwbinder</transport>
|
||||
@@ -582,13 +536,13 @@
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.power.pasrmanager</name>
|
||||
<name>vendor.dolby.hardware.dms</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IPasrManager</name>
|
||||
<name>IDms</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<fqname>@1.0::IPasrManager/default</fqname>
|
||||
<fqname>@2.0::IDms/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#############################################
|
||||
# init.insmod.cfg #
|
||||
# This file contains kernel modules to load #
|
||||
# at init time by init.insmod.sh script #
|
||||
#############################################
|
||||
|
||||
# Load kernel modules
|
||||
modprobe|adsp_loader_dlkm apr_dlkm cs35l41_dlkm hdmi_dlkm machine_dlkm mbhc_dlkm native_dlkm pinctrl_wcd_dlkm platform_dlkm q6_dlkm q6_notifier_dlkm q6_pdr_dlkm stub_dlkm swr_ctrl_dlkm swr_dlkm tas2557_dlkm usf_dlkm wcd934x_dlkm wcd9360_dlkm wcd9xxx_dlkm wcd_core_dlkm wcd_cpe_dlkm wcd_spi_dlkm wglink_dlkm wsa881x_dlkm
|
||||
|
||||
# All modules loaded
|
||||
setprop|vendor.all.modules.ready
|
||||
|
||||
# Boot devices
|
||||
enable|/sys/kernel/boot_adsp/boot
|
||||
enable|/sys/kernel/boot_cdsp/boot
|
||||
enable|/sys/kernel/boot_slpi/boot
|
||||
|
||||
# All devices enabled
|
||||
setprop|vendor.all.devices.ready
|
||||
@@ -1,442 +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_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>
|
||||
@@ -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>
|
||||
|
||||
100
configs/media/media_codecs_performance_c2.xml
Normal file
100
configs/media/media_codecs_performance_c2.xml
Normal 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>
|
||||
32
configs/msm_irqbalance.conf
Normal file
32
configs/msm_irqbalance.conf
Normal 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
|
||||
21
configs/permissions/privapp-permissions-miuicamera.xml
Normal file
21
configs/permissions/privapp-permissions-miuicamera.xml
Normal 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>
|
||||
@@ -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,20 +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": [
|
||||
"999999999",
|
||||
"585000000",
|
||||
"427000000",
|
||||
"257000000"
|
||||
"427000000"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
@@ -142,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
|
||||
},
|
||||
@@ -256,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",
|
||||
@@ -278,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",
|
||||
@@ -360,6 +288,16 @@
|
||||
""
|
||||
],
|
||||
"Type": "Property"
|
||||
},
|
||||
{
|
||||
"Name": "DoubleTapToWake",
|
||||
"Path": "/sys/touchpanel/double_tap",
|
||||
"Values": [
|
||||
"0",
|
||||
"1"
|
||||
],
|
||||
"DefaultIndex": 0,
|
||||
"ResetOnInit": true
|
||||
}
|
||||
],
|
||||
"Actions": [
|
||||
@@ -411,12 +349,6 @@
|
||||
"Duration": 0,
|
||||
"Value": "1113600"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "TASchedtuneBoost",
|
||||
"Duration": 0,
|
||||
"Value": "30"
|
||||
},
|
||||
{
|
||||
"PowerHint": "INTERACTION",
|
||||
"Node": "CPUBWHystTriggerCount",
|
||||
@@ -447,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",
|
||||
@@ -499,7 +413,7 @@
|
||||
"PowerHint": "LAUNCH",
|
||||
"Node": "PMQoSCpuDmaLatency",
|
||||
"Duration": 5000,
|
||||
"Value": "44"
|
||||
"Value": "2c"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LAUNCH",
|
||||
@@ -549,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",
|
||||
@@ -595,7 +485,7 @@
|
||||
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
|
||||
"Node": "PMQoSCpuDmaLatency",
|
||||
"Duration": 0,
|
||||
"Value": "44"
|
||||
"Value": "2c"
|
||||
},
|
||||
{
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
@@ -613,19 +503,13 @@
|
||||
"PowerHint": "EXPENSIVE_RENDERING",
|
||||
"Node": "GPUMaxFreq",
|
||||
"Duration": 0,
|
||||
"Value": "585000000"
|
||||
"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",
|
||||
@@ -727,7 +611,7 @@
|
||||
"PowerHint": "LOW_POWER_CPU_70",
|
||||
"Node": "CPUBigPlusClusterMaxFreq",
|
||||
"Duration": 3600000,
|
||||
"Value": "2016000"
|
||||
"Value": "2015999"
|
||||
},
|
||||
{
|
||||
"PowerHint": "LOW_POWER_CPU_80",
|
||||
@@ -754,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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
libqti-perfd-client.so
|
||||
libadsprpc.so
|
||||
libcdsprpc.so
|
||||
libsdsprpc.so
|
||||
|
||||
@@ -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
|
||||
5
configs/sensors/hals.conf
Normal file
5
configs/sensors/hals.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
sensors.ssc.so
|
||||
sensors.elliptic.so
|
||||
sensors.mius.proximity.so
|
||||
sensors.touch.so
|
||||
sensors.cepheus_udfps.so
|
||||
717
configs/task_profiles.json
Normal file
717
configs/task_profiles.json
Normal 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" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -85,7 +85,7 @@ EseEnabled=0
|
||||
ImplicitQosIsEnabled=0
|
||||
|
||||
gNeighborScanTimerPeriod=200
|
||||
gNeighborLookupThreshold=76
|
||||
gNeighborLookupThreshold=85
|
||||
gNeighborScanChannelMinTime=20
|
||||
gNeighborScanChannelMaxTime=30
|
||||
gMaxNeighborReqTries=3
|
||||
@@ -107,6 +107,9 @@ gRoamIntraBand=0
|
||||
# Sets RSSI preference for 5GHz over 2.4GHz AP
|
||||
gSelect5GHzMargin=5
|
||||
|
||||
# Disable rx wakelock
|
||||
rx_wakelock_timeout=0
|
||||
|
||||
# RSSI threshold offset for 2G to 5G roam
|
||||
roam_bad_rssi_thresh_offset_2g=0
|
||||
|
||||
@@ -238,7 +241,7 @@ gMaxMediumTime = 6000
|
||||
gRrmEnable=1
|
||||
|
||||
#Enable Power Save offload
|
||||
gEnablePowerSaveOffload=1
|
||||
gEnablePowerSaveOffload=4
|
||||
|
||||
#Enable firmware uart print
|
||||
gEnablefwprint=0
|
||||
@@ -246,7 +249,7 @@ gEnablefwprint=0
|
||||
# Firmware log mode
|
||||
# Valid values are 0,1,2
|
||||
# 0=Disable, 1=WMI, 2=DIAG
|
||||
gEnablefwlog=1
|
||||
gEnablefwlog=0
|
||||
|
||||
# Maximum Receive AMPDU size (VHT only. Valid values:
|
||||
# 0->8k 1->16k 2->32k 3->64k 4->128k)
|
||||
@@ -274,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
|
||||
|
||||
@@ -340,6 +347,19 @@ gSapSccChanAvoidance=0
|
||||
# Inactivity time (in ms) to end TX Service Period while in IBSS power save mode
|
||||
gIbssTxSpEndInactivityTime=10
|
||||
|
||||
# Enable support for TDLS
|
||||
# 0 - disable
|
||||
# 1 - enable
|
||||
gEnableTDLSSupport=1
|
||||
|
||||
# Enable support for Implicit Trigger of TDLS. That is, wlan driver shall
|
||||
# initiate TDLS Discovery towards a peer whenever setup criteria (throughput
|
||||
# and RSSI) is met and then will initiate teardown when teardown criteria
|
||||
# (idle packet count and RSSI) is met.
|
||||
# 0 - disable
|
||||
# 1 - enable
|
||||
gEnableTDLSImplicitTrigger=1
|
||||
|
||||
# Enable TDLS External Control. That is, user space application has to
|
||||
# first configure a peer MAC in wlan driver towards which TDLS is desired.
|
||||
# Device will establish TDLS only towards those configured peers whenever
|
||||
@@ -444,8 +464,8 @@ ce_service_max_rx_ind_flush=1
|
||||
maxMSDUsPerRxInd=8
|
||||
|
||||
# Enable NUD tracking feature
|
||||
# 1 - enable 0 - disable(default)
|
||||
gEnableNUDTracking=1
|
||||
# 1 - enable 0 - disable(default) 3 - Driver will try to roam to a new AP but if roam fails, disconnect.
|
||||
gEnableNUDTracking=0
|
||||
|
||||
# Enable PEER UNMAP CONF SUPPORT
|
||||
# 1 - enable 0 - disable(default)
|
||||
@@ -476,7 +496,7 @@ adapt_dwell_wifi_act_threshold=10
|
||||
|
||||
# Enable pkt log
|
||||
# 1 - enable, 0 - disable
|
||||
gEnablePacketLog=1
|
||||
gEnablePacketLog=0
|
||||
|
||||
# Force 1x1 for 2.4g SAP, P2P-GC/GO, 2x2 for STA
|
||||
# gVdevTypeNss_2g=21846
|
||||
@@ -565,9 +585,14 @@ 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
|
||||
|
||||
# Create another interface during driver load
|
||||
gEnableConcurrentSTA=wlan1
|
||||
|
||||
#Enable/Disable SNR monitoring
|
||||
gEnableSNRMonitoring=1
|
||||
|
||||
@@ -584,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
|
||||
@@ -598,6 +623,20 @@ gIPAHighBandwidthMbps=800
|
||||
gIPAForceVotingEnable=1
|
||||
spectral_disable=1
|
||||
|
||||
gEnableSARV1toSARV2=1
|
||||
|
||||
gStaPrefer80MHzOver160MHz=1
|
||||
|
||||
# Reduce the expiry time for avoid list and black list in drv.
|
||||
avoid_list_expiry_time=3
|
||||
black_list_expiry_time=3
|
||||
# Improve threshold to move the Ap from avoid to blacklist
|
||||
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
|
||||
|
||||
@@ -5,4 +5,6 @@ wowlan_triggers=magic_pkt
|
||||
bss_max_count=400
|
||||
interworking=1
|
||||
config_methods=virtual_display virtual_push_button keypad
|
||||
driver_param="no_rrm=1"
|
||||
driver_param="no_rrm=1 use_p2p_group_interface=1"
|
||||
hs20=1
|
||||
auto_interworking=0
|
||||
|
||||
315
device.mk
315
device.mk
@@ -14,20 +14,24 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# Installs gsi keys into ramdisk, to boot a GSI with verified boot.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_keys.mk)
|
||||
# Add common definitions for Qualcomm
|
||||
$(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)
|
||||
|
||||
# Call the proprietary setup
|
||||
$(call inherit-product, vendor/xiaomi/cepheus/cepheus-vendor.mk)
|
||||
|
||||
include build/make/target/product/iorap_large_memory_config.mk
|
||||
|
||||
# Additional native libraries
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/public.libraries.txt:$(TARGET_COPY_OUT_VENDOR)/etc/public.libraries.txt
|
||||
@@ -36,24 +40,18 @@ PRODUCT_COPY_FILES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
fs_config_files
|
||||
|
||||
# ANT+
|
||||
PRODUCT_PACKAGES += \
|
||||
AntHalService-Soong \
|
||||
com.dsi.ant.antradio_library \
|
||||
com.dsi.ant@1.0
|
||||
|
||||
# Audio
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.audio@7.0-impl \
|
||||
android.hardware.audio.effect@7.0-impl \
|
||||
android.hardware.audio.service \
|
||||
android.hardware.bluetooth.audio@2.0-impl \
|
||||
android.hardware.bluetooth.audio-impl \
|
||||
android.hardware.soundtrigger@2.2-impl \
|
||||
android.hardware.soundtrigger@2.3-impl
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
audio.a2dp.default \
|
||||
audio.bluetooth.default \
|
||||
audio.primary.default \
|
||||
audio.usb.default \
|
||||
audio.r_submix.default
|
||||
|
||||
@@ -61,15 +59,15 @@ PRODUCT_PACKAGES += \
|
||||
libqcompostprocbundle \
|
||||
libqcomvisualizer \
|
||||
libqcomvoiceprocessing \
|
||||
libqcomvoiceprocessingdescriptors \
|
||||
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 \
|
||||
@@ -89,8 +87,6 @@ PRODUCT_PACKAGES += \
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
BluetoothQti \
|
||||
libbthost_if \
|
||||
vendor.qti.hardware.bluetooth_audio@2.0.vendor \
|
||||
android.hardware.bluetooth@1.0.vendor \
|
||||
vendor.qti.hardware.btconfigstore@1.0.vendor \
|
||||
@@ -98,7 +94,9 @@ PRODUCT_PACKAGES += \
|
||||
|
||||
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
|
||||
@@ -106,7 +104,18 @@ TARGET_SCREEN_WIDTH := 1080
|
||||
|
||||
# Camera
|
||||
PRODUCT_PACKAGES += \
|
||||
libdng_sdk.vendor
|
||||
android.hardware.camera.provider@2.4-impl \
|
||||
android.hardware.camera.provider@2.4-service_64 \
|
||||
libc29.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libcamera2ndk_vendor \
|
||||
libdng_sdk.vendor \
|
||||
libgui_vendor \
|
||||
libpng.vendor \
|
||||
libstdc++_vendor \
|
||||
vendor.qti.hardware.camera.device@1.0.vendor \
|
||||
vendor.qti.hardware.camera.postproc@1.0.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libshim_megvii
|
||||
@@ -117,23 +126,23 @@ 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)
|
||||
|
||||
# Device-specific settings
|
||||
PRODUCT_PACKAGES += \
|
||||
XiaomiParts
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/permissions/privapp-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-miuicamera.xml
|
||||
|
||||
# Display
|
||||
PRODUCT_PACKAGES += \
|
||||
disable_configstore
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.graphics.composer@2.4-impl \
|
||||
android.hardware.graphics.composer@2.4-service \
|
||||
android.hardware.memtrack@1.0-impl \
|
||||
android.hardware.memtrack@1.0-service \
|
||||
vendor.qti.hardware.display.allocator-service
|
||||
vendor.qti.hardware.display.allocator-service \
|
||||
vendor.qti.hardware.memtrack-service
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.graphics.mapper@3.0-impl-qti-display \
|
||||
@@ -142,16 +151,16 @@ PRODUCT_PACKAGES += \
|
||||
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.display.mapper@4.0.vendor \
|
||||
vendor.qti.hardware.memtrack-service
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.display.config@2.0 \
|
||||
vendor.display.config@2.0.vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
gralloc.msmnile \
|
||||
hwcomposer.msmnile \
|
||||
memtrack.msmnile
|
||||
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
|
||||
@@ -165,16 +174,16 @@ PRODUCT_PACKAGES += \
|
||||
android.hardware.drm@1.1.vendor \
|
||||
android.hardware.drm@1.2.vendor \
|
||||
android.hardware.drm@1.3.vendor \
|
||||
android.hardware.drm@1.4-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.surface_flinger.supports_background_blur=1 \
|
||||
persist.sys.sf.disable_blurs=1 \
|
||||
ro.sf.blurs_are_expensive=1
|
||||
# Fastbootd
|
||||
PRODUCT_PACKAGES += \
|
||||
fastbootd
|
||||
|
||||
# Fingerprint
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -188,32 +197,24 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# Fstab
|
||||
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_VENDOR)/etc/fstab.qcom \
|
||||
$(LOCAL_PATH)/rootdir/etc/fstab.qcom:$(TARGET_COPY_OUT_RAMDISK)/fstab.qcom
|
||||
|
||||
# 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 \
|
||||
@@ -224,17 +225,14 @@ PRODUCT_PACKAGES += \
|
||||
libhidltransport \
|
||||
libhidltransport.vendor
|
||||
|
||||
# Insmod files
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/init.insmod.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/init.insmod.cfg
|
||||
|
||||
# HotwordEnrollment
|
||||
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
|
||||
include vendor/xiaomi/sdm845-common-extra/ifaa.mk
|
||||
PRODUCT_PACKAGES += \
|
||||
IFAAService
|
||||
|
||||
# Init scripts
|
||||
PRODUCT_COPY_FILES += \
|
||||
@@ -244,12 +242,10 @@ PRODUCT_COPY_FILES += \
|
||||
$(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.insmod.sh
|
||||
init.power.rc
|
||||
|
||||
# Input
|
||||
PRODUCT_COPY_FILES += \
|
||||
@@ -263,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 += \
|
||||
@@ -273,33 +269,54 @@ PRODUCT_PACKAGES += \
|
||||
|
||||
# Lights
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.lights-service.cepheus
|
||||
android.hardware.light-service.lineage
|
||||
|
||||
# Lineage Health
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.health-service.default
|
||||
|
||||
# LiveDisplay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.livedisplay-service.sdm
|
||||
|
||||
$(call soong_config_set_bool,livedisplay_sdm,enable_dm,false)
|
||||
|
||||
# Logging
|
||||
SPAMMY_LOG_TAGS := \
|
||||
MiStcImpl \
|
||||
SDM \
|
||||
SDM-histogram \
|
||||
SRE \
|
||||
WifiHAL \
|
||||
cnss-daemon \
|
||||
libcitsensorservice@2.0-impl \
|
||||
libsensor-displayalgo \
|
||||
libsensor-parseRGB \
|
||||
libsensor-ssccalapi \
|
||||
sensors \
|
||||
vendor.qti.hardware.display.composer-service \
|
||||
vendor.xiaomi.sensor.citsensorservice@2.0-service
|
||||
|
||||
ifneq ($(TARGET_BUILD_VARIANT),eng)
|
||||
PRODUCT_VENDOR_PROPERTIES += \
|
||||
$(foreach tag,$(SPAMMY_LOG_TAGS),log.tag.$(tag)=E)
|
||||
endif
|
||||
|
||||
# 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 += \
|
||||
@@ -315,10 +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
|
||||
# Mlipay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.xiaomi.hardware.mlipay@1.1.vendor \
|
||||
vendor.xiaomi.hardware.mtdservice@1.0.vendor
|
||||
|
||||
# Network
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -329,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 += \
|
||||
@@ -339,7 +357,6 @@ PRODUCT_PACKAGES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.nfc@1.2-service \
|
||||
android.hardware.secure_element@1.2.vendor \
|
||||
NfcNci \
|
||||
Tag
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -358,28 +375,55 @@ PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.android.nfc_extras.xml \
|
||||
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml
|
||||
|
||||
# Overlay
|
||||
# Overlays
|
||||
DEVICE_PACKAGE_OVERLAYS += \
|
||||
$(LOCAL_PATH)/overlay \
|
||||
$(LOCAL_PATH)/overlay-pe
|
||||
$(LOCAL_PATH)/overlay-evolution
|
||||
|
||||
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += \
|
||||
$(LOCAL_PATH)/overlay/frameworks/base/packages/overlays/NoCutoutOverlay
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
NoCutoutOverlay
|
||||
|
||||
# Parts
|
||||
PRODUCT_PACKAGES += \
|
||||
XiaomiDolby
|
||||
|
||||
# Partitions
|
||||
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor_bt_firmware_mountpoint \
|
||||
vendor_dsp_mountpoint \
|
||||
vendor_firmware_mnt_mountpoint
|
||||
|
||||
# Platform
|
||||
TARGET_BOARD_PLATFORM := msmnile
|
||||
|
||||
# Perf
|
||||
PRODUCT_PACKAGES += \
|
||||
libqti-perfd-client
|
||||
|
||||
# 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-lite-3.9.1-vendorcompat
|
||||
|
||||
# QTI
|
||||
PRODUCT_PACKAGES += \
|
||||
libqti_vndfwk_detect.vendor
|
||||
libqti_vndfwk_detect.vendor \
|
||||
libsqlite.vendor
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/permissions/qti_whitelist.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysconfig/qti_whitelist.xml \
|
||||
$(LOCAL_PATH)/configs/permissions/qti_whitelist.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/sysconfig/qti_whitelist.xml \
|
||||
$(LOCAL_PATH)/configs/permissions/system_ext-privapp-permissions-qti.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/privapp-permissions-qti.xml \
|
||||
|
||||
# RCS
|
||||
@@ -388,16 +432,15 @@ PRODUCT_PACKAGES += \
|
||||
PresencePolling \
|
||||
RcsService
|
||||
|
||||
# RenderScript
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.renderscript@1.0-impl
|
||||
|
||||
# RIL
|
||||
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 \
|
||||
@@ -408,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 \
|
||||
@@ -429,20 +482,45 @@ PRODUCT_COPY_FILES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
SmoothCutoutOverlay
|
||||
|
||||
# Shims
|
||||
PRODUCT_PACKAGES += \
|
||||
libpiex_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 += \
|
||||
extphonelib \
|
||||
extphonelib-product \
|
||||
extphonelib.xml \
|
||||
extphonelib_product.xml \
|
||||
ims-ext-common \
|
||||
ims_ext_common.xml \
|
||||
qti-telephony-hidl-wrapper \
|
||||
qti-telephony-hidl-wrapper-prd \
|
||||
qti_telephony_hidl_wrapper.xml \
|
||||
qti_telephony_hidl_wrapper_prd.xml \
|
||||
qti-telephony-utils \
|
||||
qti-telephony-utils-prd \
|
||||
qti_telephony_utils.xml \
|
||||
qti_telephony_utils_prd.xml \
|
||||
telephony-ext
|
||||
|
||||
PRODUCT_BOOT_JARS += \
|
||||
@@ -454,25 +532,20 @@ 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
|
||||
|
||||
# Uevent
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/rootdir/etc/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc
|
||||
$(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.0-service
|
||||
android.hardware.usb@1.3-service.dual_role_usb
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
|
||||
@@ -482,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
|
||||
@@ -494,10 +577,11 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# WiFi
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi@1.0-service \
|
||||
android.hardware.wifi-service \
|
||||
hostapd \
|
||||
ipacm \
|
||||
IPACM_cfg.xml \
|
||||
libwifi-hal-ctrl \
|
||||
libwifi-hal-qcom \
|
||||
libwpa_client \
|
||||
TetheringConfigOverlay \
|
||||
@@ -524,3 +608,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
|
||||
# Mac Address Generator
|
||||
PRODUCT_PACKAGES += \
|
||||
wifi-mac-generator
|
||||
|
||||
# WiFi firmware symlinks
|
||||
PRODUCT_PACKAGES += \
|
||||
firmware_wlan_mac.bin_symlink \
|
||||
firmware_WCNSS_qcom_cfg.ini_symlink
|
||||
|
||||
21
evolution.dependencies
Normal file
21
evolution.dependencies
Normal file
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"repository": "vendor_xiaomi_cepheus",
|
||||
"target_path": "vendor/xiaomi/cepheus"
|
||||
},
|
||||
{
|
||||
"repository": "kernel_xiaomi_cepheus",
|
||||
"target_path": "kernel/xiaomi/cepheus",
|
||||
"branch": "bq1"
|
||||
},
|
||||
{
|
||||
"repository": "hardware_xiaomi",
|
||||
"target_path": "hardware/xiaomi"
|
||||
},
|
||||
{
|
||||
"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
65
extract-files.py
Executable 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()
|
||||
@@ -1,81 +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/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}"
|
||||
;;
|
||||
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"
|
||||
@@ -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
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
#include <drm/sde_drm.h>
|
||||
#include <compositionengine/UdfpsExtension.h>
|
||||
|
||||
uint32_t getUdfpsDimZOrder(uint32_t z) {
|
||||
return z;
|
||||
}
|
||||
|
||||
uint32_t getUdfpsZOrder(uint32_t z, bool touched) {
|
||||
if (touched) {
|
||||
z |= FOD_PRESSED_LAYER_ZORDER;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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
10
gps/Makefile.am
Normal 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
203
gps/android/1.0/AGnss.cpp
Normal 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
79
gps/android/1.0/AGnss.h
Normal 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
|
||||
115
gps/android/1.0/AGnssRil.cpp
Normal file
115
gps/android/1.0/AGnssRil.cpp
Normal 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
|
||||
83
gps/android/1.0/AGnssRil.h
Normal file
83
gps/android/1.0/AGnssRil.h
Normal 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_
|
||||
99
gps/android/1.0/Android.mk
Normal file
99
gps/android/1.0/Android.mk
Normal 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
346
gps/android/1.0/Gnss.cpp
Normal 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
143
gps/android/1.0/Gnss.h
Normal 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
|
||||
130
gps/android/1.0/GnssBatching.cpp
Normal file
130
gps/android/1.0/GnssBatching.cpp
Normal 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
|
||||
80
gps/android/1.0/GnssBatching.h
Normal file
80
gps/android/1.0/GnssBatching.h
Normal 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
|
||||
225
gps/android/1.0/GnssConfiguration.cpp
Normal file
225
gps/android/1.0/GnssConfiguration.cpp
Normal 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
|
||||
71
gps/android/1.0/GnssConfiguration.h
Normal file
71
gps/android/1.0/GnssConfiguration.h
Normal 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
|
||||
173
gps/android/1.0/GnssDebug.cpp
Normal file
173
gps/android/1.0/GnssDebug.cpp
Normal 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
|
||||
59
gps/android/1.0/GnssDebug.h
Normal file
59
gps/android/1.0/GnssDebug.h
Normal 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
|
||||
141
gps/android/1.0/GnssGeofencing.cpp
Normal file
141
gps/android/1.0/GnssGeofencing.cpp
Normal 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
|
||||
91
gps/android/1.0/GnssGeofencing.h
Normal file
91
gps/android/1.0/GnssGeofencing.h
Normal 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
|
||||
101
gps/android/1.0/GnssMeasurement.cpp
Normal file
101
gps/android/1.0/GnssMeasurement.cpp
Normal 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
|
||||
77
gps/android/1.0/GnssMeasurement.h
Normal file
77
gps/android/1.0/GnssMeasurement.h
Normal 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
|
||||
85
gps/android/1.0/GnssNi.cpp
Normal file
85
gps/android/1.0/GnssNi.cpp
Normal 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
75
gps/android/1.0/GnssNi.h
Normal 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
|
||||
4
gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc
Normal file
4
gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc
Normal 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
|
||||
@@ -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>
|
||||
|
||||
197
gps/android/1.0/location_api/BatchingAPIClient.cpp
Normal file
197
gps/android/1.0/location_api/BatchingAPIClient.cpp
Normal 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
|
||||
75
gps/android/1.0/location_api/BatchingAPIClient.h
Normal file
75
gps/android/1.0/location_api/BatchingAPIClient.h
Normal 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
|
||||
275
gps/android/1.0/location_api/GeofenceAPIClient.cpp
Normal file
275
gps/android/1.0/location_api/GeofenceAPIClient.cpp
Normal 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
|
||||
77
gps/android/1.0/location_api/GeofenceAPIClient.h
Normal file
77
gps/android/1.0/location_api/GeofenceAPIClient.h
Normal 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
|
||||
565
gps/android/1.0/location_api/GnssAPIClient.cpp
Normal file
565
gps/android/1.0/location_api/GnssAPIClient.cpp
Normal 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
|
||||
110
gps/android/1.0/location_api/GnssAPIClient.h
Normal file
110
gps/android/1.0/location_api/GnssAPIClient.h
Normal 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
|
||||
274
gps/android/1.0/location_api/LocationUtil.cpp
Normal file
274
gps/android/1.0/location_api/LocationUtil.cpp
Normal 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
|
||||
57
gps/android/1.0/location_api/LocationUtil.h
Normal file
57
gps/android/1.0/location_api/LocationUtil.h
Normal 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
|
||||
276
gps/android/1.0/location_api/MeasurementAPIClient.cpp
Normal file
276
gps/android/1.0/location_api/MeasurementAPIClient.cpp
Normal 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
|
||||
78
gps/android/1.0/location_api/MeasurementAPIClient.h
Normal file
78
gps/android/1.0/location_api/MeasurementAPIClient.h
Normal 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
|
||||
85
gps/android/1.0/service.cpp
Normal file
85
gps/android/1.0/service.cpp
Normal 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
203
gps/android/1.1/AGnss.cpp
Normal 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
79
gps/android/1.1/AGnss.h
Normal 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
|
||||
115
gps/android/1.1/AGnssRil.cpp
Normal file
115
gps/android/1.1/AGnssRil.cpp
Normal 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
|
||||
83
gps/android/1.1/AGnssRil.h
Normal file
83
gps/android/1.1/AGnssRil.h
Normal 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
101
gps/android/1.1/Android.mk
Normal 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
466
gps/android/1.1/Gnss.cpp
Normal 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
154
gps/android/1.1/Gnss.h
Normal 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
|
||||
130
gps/android/1.1/GnssBatching.cpp
Normal file
130
gps/android/1.1/GnssBatching.cpp
Normal 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
|
||||
80
gps/android/1.1/GnssBatching.h
Normal file
80
gps/android/1.1/GnssBatching.h
Normal 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
|
||||
308
gps/android/1.1/GnssConfiguration.cpp
Normal file
308
gps/android/1.1/GnssConfiguration.cpp
Normal 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
|
||||
78
gps/android/1.1/GnssConfiguration.h
Normal file
78
gps/android/1.1/GnssConfiguration.h
Normal 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
|
||||
175
gps/android/1.1/GnssDebug.cpp
Normal file
175
gps/android/1.1/GnssDebug.cpp
Normal 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
|
||||
59
gps/android/1.1/GnssDebug.h
Normal file
59
gps/android/1.1/GnssDebug.h
Normal 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
|
||||
141
gps/android/1.1/GnssGeofencing.cpp
Normal file
141
gps/android/1.1/GnssGeofencing.cpp
Normal 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
|
||||
91
gps/android/1.1/GnssGeofencing.h
Normal file
91
gps/android/1.1/GnssGeofencing.h
Normal 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
|
||||
134
gps/android/1.1/GnssMeasurement.cpp
Normal file
134
gps/android/1.1/GnssMeasurement.cpp
Normal 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
|
||||
83
gps/android/1.1/GnssMeasurement.h
Normal file
83
gps/android/1.1/GnssMeasurement.h
Normal 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
|
||||
85
gps/android/1.1/GnssNi.cpp
Normal file
85
gps/android/1.1/GnssNi.cpp
Normal 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
75
gps/android/1.1/GnssNi.h
Normal 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
|
||||
4
gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc
Normal file
4
gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc
Normal 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
|
||||
35
gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml
Normal file
35
gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml
Normal 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>
|
||||
|
||||
197
gps/android/1.1/location_api/BatchingAPIClient.cpp
Normal file
197
gps/android/1.1/location_api/BatchingAPIClient.cpp
Normal 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
|
||||
75
gps/android/1.1/location_api/BatchingAPIClient.h
Normal file
75
gps/android/1.1/location_api/BatchingAPIClient.h
Normal 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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user