Commit Graph

13 Commits

Author SHA1 Message Date
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