Commit Graph

23 Commits

Author SHA1 Message Date
Ruthwar Ambeer
f7449aa3b0
msm8974-common: libril: FR51015: Tuning of Binder buffer for rild.
Tuned the Binder buffer to 500KB as it is not
going to use the default allocated 1MB which
saves RAM for 32 bit processors.

Change-Id: Ifea2720f8e853643a37912c3459e923168677b1e
CRs-Fixed: 2283052
[haggertk: This is just the libril side up the upstream change]
2018-10-09 06:25:58 -06:00
Gohulan Balachandran
76992cefda
msm8974-common: libril: Replace strncpy with strlcpy.
Use strlcpy instead of strncpy when copying strings to make sure
the copy is always null-terminated.

Change-Id: I12d4883c22a180e2136dc8c85bc0394ddcdcb706
2018-10-09 06:25:57 -06:00
Sanket Padawe
92a361dc59
msm8974-common: libril: Add SIM_ABSENT error
Bug: b/62926561
Test: N/A
Change-Id: I27e86be7ee4a0b8a23c99fe28636f26b289c51b5
2018-10-09 06:25:56 -06:00
terrycrhuang
ab269b9cd4
msm8974-common: libril: Change rild initial sequence to guarantee non-null function pointer before rild register its hidl service
Test: Build and local test
Bug: 78886552
Change-Id: I1137cc0f4f09f0304662a2227b84c2b5b228d45d
2018-10-09 06:25:55 -06:00
Steven Moreland
7e86bb0923
msm8974-common: libril: Add DISABLE_RILD_OEM_HOOK.
OEM hook is deprecated, so adding a way to disable it to
this radio implementation.

Bug: 75322118
Test: boot device w/ DISABLE_RILD_OEM_HOOK works, lshal
Change-Id: Ie7ade48476d2c330df608e9cc8dab805f84dd81d
2018-10-09 06:25:55 -06:00
Amit Mahajan
6762d13586
msm8974-common: libril: Store the system time when NITZ is received.
If cached value for NITZ is used, the time at which it was
received needs to be cached too.

Test: Basic telephony sanity
Bug: 72283604
Change-Id: I8f443171c4583e3eab9be7973d7714ae6c7ab6af
2018-10-09 06:25:54 -06:00
Gohulan Balachandran
7113220c88
msm8974-common: libril: Fix double freeing of memory in SAP service and add null-checks.
The payload of a SAP request could be freed twice in certain scenarios.
Also, add null-checks to prevent dereferencing of null pointers.

Bug: 64729356
Test: Manually run the fuzz tests and ensure that there is no crash in
      rild

Change-Id: Ib7ae269fa5297d6acea267337b220b8858c82bae
2018-10-09 06:25:53 -06:00
Pengquan Meng
7d4e0308a2
msm8974-common: libril: Remove unused code
Bug: 62249769
Test: manually

Change-Id: Ibeae8537ee87dc9c3481538df0fcdb4f3d50f50c
2018-10-09 06:25:52 -06:00
Nathan Harold
f174e36781
msm8974-common: libril: Fix Const-Correctness for RIL_RadioFunctions
Re-add constant for function pointer table to
RIL_RadioFunctions. Const was accidentally removed
during a warnings cleanup.

Bug: 64231560
Test: compilation
Change-Id: I93675980c51d9162f624495d12fe3c97f1da8031
2018-10-09 06:25:51 -06:00
Lennart Wieboldt
900794d8b2
msm8974-common: libril: Remove LOCAL_CLANG
clang is the default compiler since Android nougat

Change-Id: I0555fa8067352fd43b47aabe80be1224597da17e
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2018-10-09 06:25:44 -06:00
D. Andrei Măceș
289c1006ef libril: Protect against NULL unsolicited response function
Upstream change I732234a22328a1bfcb603bb020547f543b6fd766 makes
RIL_UNSOL_DC_RT_INFO_CHANGED's responseFunction() NULL, without
protecting against it in RIL_onUnsolicitedResponse(), thus crash-
ing at least hammerhead's RIL stack upon mobile data connection.

https://android-review.googlesource.com/#/c/platform/hardware/ril/+/345950/

Change-Id: I6567019cb6daf6492a29e04cc9872e69b2ba456d
Signed-off-by: D. Andrei Măceș <Andrei.Maces@alumni.nd.edu>
(cherry picked from commit e73eafff8695ab28201acbc03a362d5b177047aa)
2018-07-24 06:17:08 -06:00
Paul Keith
86e492652d msm8974-common: libril: Use libril way of freeing strings for nitz hack
Change-Id: I7addc27abb3730873799518ea2ac6ec51a280bd9
2018-07-02 18:32:28 -06:00
Kevin F. Haggerty
8f6082f460 msm8974-common: libril: Build non-inlined android_atomic methods
* All of the libsec-ril*.so libraries reference these symbols, but
  Google finally dropped the non-inlined versions from libcutils with
  Android 8.0. This could be handled with shims in numerous device
  trees, but shim semantics and implementation aren't exactly stable
  and we can handle it more cleanly here in one place.
* See LineageOS/android_system_core@103e8f560

Change-Id: I787372b739f3ace0d9cbbc33e4bffafa6876665e
2018-06-15 15:03:03 -06:00
Paul Keith
da14a8d88a msm8974-common: libril: Fix RIL_Call struct for 64-bit platforms
* While msm8974 is not 64 bit, certain users of this libril will be
* A previous revision of this libril had 16 bytes of padding in this
  struct for 64-bit platforms (due to word size and struct alignment),
  but a change by me to use a long instead of a pointer and an int
  broke this padding for 64-bit platforms because a long is still
  just 8 bytes on 64-bit platforms, where 16 bytes is necessary
* Use two pointers as padding instead to make 64-bit great again

Change-Id: If599bdb625f7a45e083f5b30df512d12810be79b
2018-03-01 19:48:48 +00:00
Paul Keith
71900d444e msm8974-common: libril: Add hacks for spliting of index
* This is based on how it was done in cm-14.1, but redone
  because the old code completely ignored signedness
* Samsung, in their stock RIL.java, reads index as an int,
  sets the first 8 bits to index, the next 8 bits to call_id,
  and ignores the upper 16 bytes of the int parcelled up
* This emulates that behavior here, except it only sends the
  first 8 bits so that AOSP's RIL.java doesn't get confused

Change-Id: I5c78447fdef7d5fd7fc39addb970300ee1188cd1
2018-02-08 03:48:38 +01:00
Paul Keith
dc5d57cf0a msm8974-common: libril: Fix RIL_UNSOL_NITZ_TIME_RECEIVED Parcel
* Sometimes, the modem is sending 1-2 extra fields with
  the country mcc, which confuses ServiceStateTracker
* Drop the extra data here, instead of in our RIL class

[haggertk]: Forward port to ril-caf on lineage-15.

Change-Id: Ifbec67bb0dac271226bd8b5471deaf6a2ef33f2b
2018-02-06 04:29:30 +00:00
Paul Keith
6f2f2902ee msm8974-common: libril: Get off my back
* Checking numInts and numStrings for strict equality when
  we're not looping is dumb, because Samsung is notorious
  for sending extra information in their RIL
* Check if there's *enough* data rather than the *exact amount*
  to fix a bunch of invalid response errors

Change-Id: I14bc37240e5760b4629fcb74b64f25ad95d4fdfc
2018-02-06 04:26:37 +00:00
Paul Keith
2d9467684d msm8974-common: libril: Add workaround for "ring of death" bug
[javelinanddart]: Forward port to ril-caf on lineage-15.1

Change-Id: Ifeeee11ee83deddb8eff565847641c45a105378f
2018-02-06 04:25:39 +00:00
Martin Bouchet
e384dfb0f8 msm8974-common: libril: Fix network operator search
* For search, the number of strings returned for
  RIL_REQUEST_QUERY_AVAILABLE_NETWORKS should be defined in the system
  prop ro.ril.telephony.qan_resp_strings

Change-Id: Ie5bb8ba80c5ac93b7502da3b1bb3d2b4404ecd5e
2018-02-06 04:25:17 +00:00
Kevin F. Haggerty
8c30fb5d12 msm8974-common: libril: Fix SMS on certain variants
* Samsung added an int to the end of the RIL_SMS_Response
  struct in some of the variants (like vzw) but not all
* The presence of this field was discovered by examining
  the stock RIL.java, which conditionally read an extra
  int from the parcel, based on the device specific
  CscFeature_RIL_SmsErrorClassRetry feature
* This causes SMS messages to show as "failed to send"
  in the app, when they actually suceeded in sending
* Allow Samsung's custom struct and AOSP's to fix it

* Forward port to ril-caf on lineage-15.1

Change-Id: I6b3e545c2c42ab2de2ac11e93dfdf9546248080a
2018-02-06 04:24:32 +00:00
Paul Keith
9a9121b070 msm8974-common: libril: Add Samsung changes
***** SIGNAL STRENGTH HACKS NOT PORTED YET *****

[javelinanddart]: Redo this code from 14.1 to include
  the proper RIL_Call fixes, no Samsung unsol/request
  handling as it was unnecessary, and a extensible way
  to remap RIL unsols if necessary for the device

Change-Id: I59bad9925d141e6cefbc24d4eefdc0c79017852a
2018-02-06 04:24:06 +00:00
Kevin F. Haggerty
47a0f43fd5 msm8974-common: ril: Makefile maintenance
* Add top-level Android.mk
* Invert libril/Android.mk build guard (build if BOARD_PROVIDES_LIBRIL
  is true)

Change-Id: I4eb6c2316d268c2f8045dbb909322b731df47d8c
2018-02-06 04:22:25 +00:00
Kevin F. Haggerty
54fdadc48b msm8974-common: ril: Import libril from hardware/ril-caf
* LineageOS/android_hardware_ril@1375242 (staging/lineage-15.1-caf)

Change-Id: Id1b4abe64f6b8f65cc88555ff4799f71f3264f6b
2018-02-06 04:22:04 +00:00