Commit Graph

36 Commits

Author SHA1 Message Date
Danny Wood
d851283fe6
msm8974-common: libril: initialise RIL_CallForwardInfo to 0 when requesting status
Some devices have extra pointers in this structure that if non-zero
causes libsec-ril.so to segfault

Change-Id: I9fd07a4747ef0fb1388ebbec472f2dda8dea4003
2021-09-10 11:36:15 -06:00
Sarah Chin
bb7c1788d1
msm8974-common: libril: Fix OOB vulnerability in setGsm/CdmaSmsBroadcastConfigInfo
Error if length > 25

Test: lunch cf_x86_phone-userdebug && mm
Bug: 144046782
Change-Id: I18f9745174762a52fc20bfc7273c6b3fd2118da5
2020-11-27 17:14:35 -07:00
terrycrhuang
725f9e8f33
msm8974-common: libril: Encode MCC with 3 digit in CellIdentity
Bug: 145809537
Test: ril::util::mcc::test

Change-Id: Ie0b9d0a56530cc7a2146e9955d392867634d2b8b
2020-11-27 17:14:35 -07:00
Taesu Lee
4f09b93962
msm8974-common: libril: Fix typo
Test: build

Change-Id: I729888834881386d52f072e0444d50b480f85928
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-11-27 17:14:35 -07:00
Elliott Hughes
8a32750c24
msm8974-common: libril: Remove unused includes.
Test: treehugger
Change-Id: Id6ee53aa0e2a83ef40ce9219092f8a0f519b3471
2020-11-27 17:14:34 -07:00
Steven Moreland
72fb75e332
msm8974-common: Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iba2cd20b8b20fac3e7564de6b853b475fd4ebd2a
2020-10-29 15:43:06 -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
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