Commit Graph

425 Commits

Author SHA1 Message Date
Katz Yamada
b3094b1fb9
msm8974-common: gps: Fix for buffer overrun crash at copying nmea string
Add zero clearing of allocated nmea buffer to ensure
the nmea string is null terminated.

Change-Id: Ie36010a7d3eca16dabb3067ae891a94e4b63b10c
CRs-Fixed: 2041933
2020-06-26 18:45:34 -06:00
Vijay Venkatraman
98f5543b46
msm8974-common: gps: Replacing copy headers with header libraries
Bug: 33241851
Test: Build target and pass CTS location tests
Change-Id: I75db5e6de3c4194a6a46e0d37fcd899ea1d1db04
2020-06-26 18:33:09 -06:00
Jiyong Park
2d0c543adb
msm8974-common: gps: Don't rely on transitively included headers
One must explicitly include what it need.
time.h for struct tm.

Bug: 37629934
Test: build

Merged-In: Iacd5317d958f61df062fca40fbf2e8992c7fbb44
Change-Id: I19e1043f23dbe85836b73714a4f1440159ebe419
2020-06-26 18:33:09 -06:00
Dante Russo
1647e1d120
msm8974-common: gps: Remove nmea log
Nmea log print is removed, as it can be
excessive during gps tracking.

Bugs: 29499503 29272976
Change-Id: Ia60295207b6bbbcb24bbede4f1802c0c7a2f2544
2020-06-26 18:33:09 -06:00
Dante Russo
9af0ec4c51
msm8974-common: gps: Return the correct length of nmea sentence
Return the correct length of nmea sentence in the
function loc_eng_nmea_put_checksum(). The correct
length is length of NMEA string including ‘$’
character alongwith length of checksum.

CRs-Fixed: 1020044
Change-Id: I50d80b9c4492de4664bb3ccb7295b0eb4fee15a9
2020-06-26 18:33:09 -06:00
Dante Russo
8483bcb6c9
msm8974-common: gps: Default apn ip type to ipv4
If a apn ip type is not found for a agps
data connection, default to using ipv4
instead of invalid.

CRs-fixed: 1007417

Bug: 28986221

Change-Id: Icc71de1fab3fd5967901c39a5c11eaea17b7766c
Signed-off-by: D. Andrei Măceș <Andrei.Maces@alumni.nd.edu>
2020-06-26 18:33:09 -06:00
Aurimas Liutikas
9f30bd7912
msm8974-common: gps: Suppress unused-parameter warnings
Bug: 26936282
Change-Id: I7fdf58d232a59c0ba0d5f52c0f958f6eab0c4514
2020-06-26 18:33:09 -06:00
Dante Russo
0830f02f9e
msm8974-common: gps: Remove owner of gps hal modules
Owner does not need to be specified for
this project.

Change-Id: I918a767ed3b83e134c5e63ded5b25070b3399ac8
2020-06-26 18:23:52 -06:00
Gary Jian
1f78746f18
msm8974-common: libril: Add RIL_UNSOL_KEEPALIVE_STATUS in ril_unsol_commands.h
Bug: 134048171
Test: 1. Build Pass
      2. Running atest android.net.cts.ConnectivityManagerTest
         #testSocketKeepaliveLimitTelephony and make sure the
         Telephony FWK can receive RIL_UNSOL_KEEPALIVE_STATUS.

Change-Id: I98f8d4a95a6c9c3c078a02aa9fd8722779623f12
2020-06-26 18:11:46 -06:00
Yu Shan
5c0cc31e7c
msm8974-common: libril: Use 32BIT nanopb library.
Test: None
Bug: 122292884
[haggertk: This is only the libril side of this change. We quite
 obviously do not carry our own librilutils]

Change-Id: Idb0d56749e41aa97a760dfed5246330041c3da3a
2020-06-26 18:11:46 -06:00
Gohulan Balachandran
672b247a16
msm8974-common: libril: Handle MCC/MNC in data registration state provided by legacy vendor RILs
Include MCC/MNC provided by legacy (versions 14 and older) vendor RIL
implementations as part of data registration state, in data registration
state reported to clients of the radio HAL service.

Bug: 119904357
Test: local build and did the local test on Marlin device,
      the mcc/mnc value are correct (not -1 and empty string value).

[haggertk: This purposely omits updating the numStrings check in
 getDataRegistrationStateResponse(), given that we purposely changed
 that check in our libril]

Change-Id: I5a26939402b86d889133e16f3508ab76b8bedddc
2020-06-26 18:11:46 -06:00
Tim Lin
1878e1f3b3
msm8974-common: libril: set initial value to GW timingAdvance
RIL_SignalStrength_v10 not support gw.timingAdvance. But default 0 will
be taken as valid value. Set to INT_MAX as invalid value.

Bug: 123096279
Test: Build pass. Correct value for GW timingAdvance in radio log.
01-22 16:22:41.150  1779  1910 V RILJ    : [UNSL]< UNSOL_SIGNAL_STRENGTH
SignalStrength:{ mGsm=CellSignalStrengthGsm: rssi=2147483647 ber=99 mTa=2147483647

[haggertk: Upstream commit updated to patch both
 convertRilSignalStrengthToHalV8 and convertRilSignalStrengthToHalV10,
 as the upstream libril only has a single convertRilSignalStrengthToHal]

Change-Id: I37cc2c246d045a07ffad863fb0cc852d8184c3ca
2020-06-26 18:11:46 -06:00
Ryuto Sawada
1dbd1b2145
msm8974-common: libril: The index value shall be -1 if there is no relevant application
The index value for GSM/CDMA/IMS application shall be -1 if there is no
relevant application according to the comment written for CardStatus
structure in radio/types.hal, so it shall be initialized to -1.

Bug: 63967442
Test: Confirm that the index values are correctly initialized.

Change-Id: I692e9049145d0f0c3c57879c25d0697879c76b39
2020-06-26 18:11:46 -06:00
Ashit Sood
0902dcd5a7
msm8974-common: libril: Replace strncpy with strlcpy.
Use strlcpy instead of strncpy when copying strings to make sure
the copy is always null-terminated.

Bug:73436938

[haggertk: Our original CAF base had the actual "replace strncpy
 with strlcpy" part of this change already. This just adds the
 expected sendErrorResponse()]

Change-Id: I12d4883c22a180e2136dc8c85bc0394ddcdcb706
2020-06-26 18:11:45 -06:00
Nathan Harold
e11fb2c255
msm8974-common: libril: Encode the Number of MNC Digits in CellIdentity
Legacy RIL uses an integer to encode the number of
MNC digits. Because the size is not fixed, leading
zeroes result in ambiguity in the length of the mnc.

This change adds support for passing the number of
encoded digits in the most-significant nibble of the
mnc integer (which is only 10 bits). Thus, on any
implementation that is 16-bits or wider, the mnc info
will be properly encoded and decoded with the
correctly-sized string.

Bug: 111971808
Test: ril::util::mnc::test
Change-Id: I24aeba5328a63f80b0d6b25b068bd19160191dff
2020-06-26 18:11:45 -06:00
Arne Coucheron
7f220cbdb2
msm8974-common: Build common legacy gnss hal
Change-Id: I56095b9c3bba065779c90b6aeb61ebfed6af7e77
2020-06-26 18:07:43 -06:00
Kevin F. Haggerty
7cae0f93e6
Merge branch 'lineage-16.0' of http://www.github.com/LineageOS/android_device_samsung_msm8974-common into lineage-17.1
* 'lineage-16.0' of http://www.github.com/LineageOS/android_device_samsung_msm8974-common:
  msm8974-common: gps: Correct week rollover timestamps
  msm8974-common: gps: Fix race condition when GPS app is closed around an SSR event
  msm8974-common: gps: Adding fix for KW warning
  msm8974-common: gps: Assure event mask is set properly to get positions
  msm8974-common: gps: Fix unable to clear existing event bitmasks
  msm8974-common: gps: Add tech_mask in UlpLocation to support report
  msm8974-common: gps: NMEA report indication to ULP
  msm8974-common: gps: Making SUPL ES run time configurable
  msm8974-common: gps: Fixes SUPL_MODE
  msm8974-common: gps: Consider nsec while ranking the timer objects
  msm8974-common: gps: Adding a new NMEA sentence : $GNGSA.
  msm8974-common: gps: Set correct target for msm baseband
  msm8974-common: gps: Add Cleanstep.mk

Change-Id: Ibfdb99e86d3bc3829b565ee8732a7a399ff27915
2020-06-26 18:06:01 -06:00
jlask
b5d2115316
msm8974-common: gps: Correct week rollover timestamps
This adjustment will help with applications checking the time coming from gps.
Some applictions will consider times in the far past as an error.

Change-Id: I69d6971249c4898ac3895f725e46f268cdb2b00d
2020-06-26 09:50:03 -06:00
Harikrishnan Hariharan
2a42d86692
msm8974-common: gps: Fix race condition when GPS app is closed around an SSR event
Fix race condition to get avoid stuck in modem if GPS application
is closed right around a SSR event.This fix will prevent resume the
session once HAL loc_stop has been called.

Change-Id: I4e5c3f09c097b835d8a685a8b465eb86dd06cd7a
CRs-Fixed: 1058559
2020-06-26 09:50:03 -06:00
Saurabh Srivastava
6b9221934a
msm8974-common: gps: Adding fix for KW warning
Fix for buffer overflow possibility for the thread name passed in to
pthread_setname_np() method.

Change-Id: Id323dd058eddcf50d6fd9ec8908e9997b30c561b
CRs-Fixed: 999457
2020-06-26 09:50:03 -06:00
Dante Russo
e2e1b9d26a
msm8974-common: gps: Assure event mask is set properly to get positions
The event mask can be retrieved in the context of
client thread as zero and then queued up to go to
msg task thread. By the time the msg is actually
handled in msg task thread, the actual event
mask at LOC API layer may have already changed, but
this mask would then be overridden by zero. This
can cause no modem events to ever come, including
position reports.

The fix is to not retrieve the event mask in the
client thread, but instead wait for msg to be
handled in msg task thread before retrieving it.

Change-Id: I48562d028bbfa187732686c060b5cdd62c6d5a89
CRs-fixed: 2219519
2020-06-26 09:50:03 -06:00
Katz Yamada
23fc0afe5a
msm8974-common: gps: Fix unable to clear existing event bitmasks
Fix for an issue updateEvtMask call chain is
unable to clear existing event bitmasks stored
in LocApiV02.

Change-Id: Id34e2d92a506e7300f3d9b3ec74a80a1f6822787
CRs-Fixed: 2085379
2020-06-26 09:50:03 -06:00
haohuang
a48754615a
msm8974-common: gps: Add tech_mask in UlpLocation to support report
NLP position source to Android Framework.

Change-Id: I3811e03dddb721b64b5fa4330996087f6c17efec
2020-06-26 09:50:03 -06:00
Naresh Munagala
98b9fa2f33
msm8974-common: gps: NMEA report indication to ULP
Enabled NMEA report indication to ulp

Change-Id: Ia27fe0d805f53bf17c86f7c27eaaedd960101370
CRs-Fixed: 1055201
2020-06-26 09:50:03 -06:00
Kevin Tang
09c85861d6
msm8974-common: gps: Making SUPL ES run time configurable
SUPL ES gets updated as part of the sim specific
AGPS config hot swap update. We keep that lastest
SUPL ES and send that as part of the NI request,
to let NI handler to know the config status.

Change-Id: I566725d5db9b3abdbd9a423b86c10b819217f4f6
CRs-Fixed: 1024879
2020-06-26 09:50:02 -06:00
Kevin Tang
7379550ef9
msm8974-common: gps: Fixes SUPL_MODE
Carrier specific SUPL_MODE is not updated upon sim card insert.
gpc_conf must be updated with the new value for config to be
updated.

Change-Id: I2a5f10fa7d27be9253e9ca6f34c0c886285d1b11
CRs-Fixed: 953942
2020-06-26 09:50:02 -06:00
Madhanraj Chelladurai
9886edc317
msm8974-common: gps: Consider nsec while ranking the timer objects
We need to consider nsec as well while ranking timer objects

Change-Id: Ieaad5dfa80b26b90e998618b3cbe1e590fc00839
CRs-Fixed: 991345
2020-06-26 09:50:02 -06:00
Saurabh Srivastava
ee76952f5e
msm8974-common: gps: Adding a new NMEA sentence : $GNGSA.
Currently only $GPGSA was being generated for GPS satellites.
This change adds $GNGSA for GLONASS satellites as well.

Change-Id: I7ab0e92c7ed4ce73be11909eefe0d570a1a0fc1e
CRs-Fixed: 978745
2020-06-26 09:50:02 -06:00
Arne Coucheron
62261a55b5
msm8974-common: gps: Set correct target for msm baseband
Change-Id: Ie52feed022db511abb6813f20418d23c0f5b3ba9
2020-06-26 09:50:02 -06:00
Arne Coucheron
8441090408
msm8974-common: gps: Add Cleanstep.mk
Change-Id: I1af155718ae4f48c15317b0d05303d22ec458084
2020-06-26 09:50:02 -06:00
Akash Mondal
630d6b5ca4
msm8974-common: add libashmemd_client to platform shared libraries.
E : ashmem  : Failed to dlopen() libashmemd_client.so: dlopen failed:
library "libashmemd_client.so" not found.

Change-Id: I5ea7f1686d4ad5b67ec5e37b91742f907d71075e
2020-05-29 12:14:16 -06:00
Bruno Martins
eac9496d05
msm8974-common: Binderize them all
* Switch to binderized HAL services as possible and update
   HIDL manifest accordingly.

Change-Id: Id50291488d655187aa013c51bdd6890dca010564
2020-05-29 12:14:16 -06:00
Elektroschmock
e9a18e2d9e
msm8974-common: sepolicy: label /dev/stune(/.*) as cgroup
* avc: denied { write } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:adbroot:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { open } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:adbroot:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { write } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:installd:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { open } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:installd:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { write } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:netd:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { open } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:netd:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { write } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:storaged:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { open } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:storaged:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1
* avc: denied { write } for name="tasks" dev="tmpfs" ino=7795
  scontext=u:r:gsid:s0 tcontext=u:object_r:device:s0 tclass=file
  permissive=1

Change-Id: Idc69978328640ff40ad5efe2f0abd79304e75893
2020-05-29 12:14:16 -06:00
Kevin F. Haggerty
f3cd79f3ae
msm8974-common: sepolicy: Resurrect alarm_device
* Both our ril_daemon, via libsec-ril*.so, and our time_daemon
  need access to this device node

Change-Id: Ib787f45596bb6aa606bab102a5bd1cb93eb645a4
2020-05-26 15:09:19 -06:00
Kevin F. Haggerty
d6b1712058
Revert "msm8974-common: libshims: Import libshim_cutils_atomic"
* This served a purpose for a period of time, but we decided to embed
  the relevant symbols directly into libril.so with 8f6082f

This reverts commit 61a18ade33.

Change-Id: Ifb92a32be007fd0f842af38cf652edffde0604e5
2020-05-26 15:09:19 -06:00
Alessandro Astone
6d7945ef44
msm8974-common: libshims: Import libshim_binder
* LineageOS/android_frameworks_native@f1cf11f1a finally removed
  these binder calls, marked as deprecated in 2014

Change-Id: I489c0ce5d324f1a3c911fe60e6217f1e8405f23f
2020-05-26 15:09:19 -06:00
Sean Callanan
05bc27344c
msm8974-common: Switch to IMapper 2.1
Test: display CTS
Bug: 62535446
Change-Id: I2d6d0d118014eb2b99a6832b4c900ae21c062517
2020-05-15 10:43:56 -06:00
Roshan Pius
8e08805f3d
msm8974-common: hostapd(hidl): Uprev to 1.1
Bug: 112705137
Test: Compiles
Change-Id: I8111523b013cf36570d9e1e26f11838e79ec8901
2020-05-15 10:43:56 -06:00
Arne Coucheron
86804b4771
msm8974-common: Remove config_disable_TelephonyManager_network_scan
Not needed in Q, as scanning works without it, and the feature
hasn't been forward ported.

This reverts commit 881a6b9fff.

Change-Id: Ida4d2ef429cef47178c9858082dbaae8c1207716
2020-05-15 10:43:56 -06:00
Kevin F. Haggerty
8b07abf736
msm8974-common: sepolicy: Put fastbootd.te in correct place
Change-Id: I7e65f7835e1ee37aee90aa84dfc431fc0d434231
2020-05-15 10:43:56 -06:00
Alessandro Astone
53fd5b0828 msm8974-common: Build and enable fastbootd
Change-Id: I0b20600fe7203a7aec19cbea8f6849052585c6ab
2020-04-27 18:49:42 -04:00
Peter Collingbourne
fc16d6b483
msm8974-common: Add /apex/com.android.runtime/${LIB} to runtime search path.
The canonical location of the HWASAN runtime, an LL-NDK library, is being moved
to the runtime APEX. It is apparently the first LL-NDK library in the runtime
APEX that does not require a legacy symlink in /system/${LIB}. Therefore we
need to add the runtime APEX's ${LIB} directory to the various search paths
used by the linker so that the library can be loaded from the default and
sphal namespaces.

Bug: http://b/134459232
Test: Builds

Change-Id: I1f63e1a2a61e1717d00736ef431f3ec2a9334193
Merged-In: I1f63e1a2a61e1717d00736ef431f3ec2a9334193
(cherry picked from commit 61f5fdf5c907f83f777395b7ebd45432855b5e7b)
2020-04-25 14:27:01 -06:00
Wang Han
f518f75f1f
msm8974-common: Extend sphal search paths for media swcodec
* Legacy devices do not have vndk-sp, so we have to add
   /system/{LIB} to sphal search paths to make sure linker
   can find the according libraries successfully.

Change-Id: I95b4b4cc9b187ce2b3a50e4e4d1e4940f36e087d
2020-04-25 14:27:01 -06:00
Wang Han
853a30dffe
msm8974-common: Import loader config for media swcodec
* This config needs to be modified for legacy devices. As
   there is no easy way to split it, import it into device
   tree and bind mount it instead.

 * Head at android-10.0.0_r2
   (3ac371484399da6efbd0c835aa461d3326263ab1).

Change-Id: I8d5003d7cd3a471c569844aede4b5ea4c68ae36b
2020-04-25 14:27:00 -06:00
Arne Coucheron
e15cdea68f
msm8974-common: manifest: Remove widevine instance
In Q, this looks like it's making the system wait for a
specific widevine service, which we don't have.
Removing this appears to make L3 start working again.

Change-Id: Ib410029519e1d3cb0f0f3a5aa553976b36bca8c3
2020-04-25 14:27:00 -06:00
Kevin F. Haggerty
64ed0d4ffc
msm8974-common: sepolicy: Resolve hal_lineage_touch_default denials
* avc: denied { search } for name="sec_epen" dev="sysfs" ino=23534
  scontext=u:r:hal_lineage_touch_default:s0
  tcontext=u:object_r:sysfs_sec_epen:s0 tclass=dir permissive=1
* avc: denied { search } for name="sec_touchkey" dev="sysfs" ino=23413
  scontext=u:r:hal_lineage_touch_default:s0
  tcontext=u:object_r:sysfs_sec_touchkey:s0 tclass=dir permissive=1

* avc: denied { read } for name="epen_gestures" dev="sysfs" ino=23559
  scontext=u:r:hal_lineage_touch_default:s0
  tcontext=u:object_r:sysfs_sec_epen:s0 tclass=file permissive=1
* avc: denied { open } for name="epen_gestures" dev="sysfs" ino=23559
  scontext=u:r:hal_lineage_touch_default:s0
  tcontext=u:object_r:sysfs_sec_epen:s0 tclass=file permissive=1
* avc: denied { read write } for name="epen_gestures" dev="sysfs"
  ino=23559 scontext=u:r:hal_lineage_touch_default:s0
  tcontext=u:object_r:sysfs_sec_epen:s0 tclass=file permissive=1

Change-Id: Ie62004f9ca8e93cb8e1dfe45fcff0a9e74f3c44d
2020-04-25 14:27:00 -06:00
Shinru Han
200effb649
msm8974-common: Migrate gps overlay to CarrierConfig
Test: build
Bug: 122431542
Change-Id: I9bb4150522fd367a6a6895bba008eba24e238e4d
2020-04-25 14:27:00 -06:00
Lucas Dupin
a6915d5485
msm8974-common: Disable window rounded corner animations
For graphics performance reasons

Bug: 122347746
Test: visual; swipe up on overview
Change-Id: Iadc765aa72e2777f5307659a6138e9dcef1a9659
2020-04-25 09:55:57 -06:00
Kevin F. Haggerty
eb088711d4
Revert "msm8974-common: Move XTRA_SERVER entries to overlays"
* Even though the stock gps_debug.conf says that you put
  customization in fw/b overlays, Q doesn't look to those anymore.
* With XTRA_SERVERs in those overlays you get:
  GpsPsdsDownloader: No PSDS servers were specified in the GPS configuration

This reverts commit 399e9af90a.

Change-Id: Id392cf4a9b91a63a4400e546bc9ba4c32b656ef4
2020-04-25 09:55:35 -06:00
Michael Bestas
5fd2d661c8
msm8974-common: Update to power HAL 1.2
Change-Id: Ic8c5f7e9c77a95befff5661e1634683ec6c25ac4
2020-04-24 18:56:19 -06:00