From 9a9121b070b70a39184da54f13711127b9f6dd66 Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Thu, 19 Oct 2017 02:26:41 +0200 Subject: [PATCH] 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 --- ril/include/samsung_ril.h | 19 +++++++++++++++++++ ril/include/telephony/ril.h | 14 +++++++++++--- ril/libril/ril.cpp | 4 ++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 ril/include/samsung_ril.h diff --git a/ril/include/samsung_ril.h b/ril/include/samsung_ril.h new file mode 100644 index 0000000..952dbf0 --- /dev/null +++ b/ril/include/samsung_ril.h @@ -0,0 +1,19 @@ +/* +** +** Copyright 2018, 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. +*/ + +static inline void remapUnsol(int *unsol __unused) { +} diff --git a/ril/include/telephony/ril.h b/ril/include/telephony/ril.h index 0512f52..15a88b6 100644 --- a/ril/include/telephony/ril.h +++ b/ril/include/telephony/ril.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2006 The Android Open Source Project + * Copyright (C) 2018 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. @@ -150,7 +151,7 @@ typedef enum { RIL_E_ILLEGAL_SIM_OR_ME = 15, /* network selection failed due to illegal SIM or ME */ RIL_E_MISSING_RESOURCE = 16, /* no logical channel available */ - RIL_E_NO_SUCH_ELEMENT = 17, /* application not found on SIM */ + RIL_E_NO_SUCH_ELEMENT = 17, /* application not found on SIM */ RIL_E_DIAL_MODIFIED_TO_USSD = 18, /* DIAL request modified to USSD */ RIL_E_DIAL_MODIFIED_TO_SS = 19, /* DIAL request modified to SS */ RIL_E_DIAL_MODIFIED_TO_DIAL = 20, /* DIAL request modified to DIAL with different @@ -358,7 +359,7 @@ typedef enum { PREF_NET_TYPE_LTE_GSM_WCDMA = 9, /* LTE, GSM/WCDMA */ PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */ PREF_NET_TYPE_LTE_ONLY = 11, /* LTE only */ - PREF_NET_TYPE_LTE_WCDMA = 12, /* LTE/WCDMA */ + PREF_NET_TYPE_LTE_WCDMA = 12, /* LTE/WCDMA */ PREF_NET_TYPE_TD_SCDMA_ONLY = 13, /* TD-SCDMA only */ PREF_NET_TYPE_TD_SCDMA_WCDMA = 14, /* TD-SCDMA and WCDMA */ PREF_NET_TYPE_TD_SCDMA_LTE = 15, /* TD-SCDMA and LTE */ @@ -432,6 +433,7 @@ typedef struct { int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ char * name; /* Remote party name */ int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ + long call_details; /* Samsung call detail additions. Just padding, do not use */ RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */ } RIL_Call; @@ -733,7 +735,7 @@ typedef struct { const char * mcc; const char * mnc; RIL_CarrierMatchType match_type; /* Specify match type for the carrier. - * If it’s RIL_MATCH_ALL, match_data is null; + * If it's RIL_MATCH_ALL, match_data is null; * otherwise, match_data is the value for the match type. */ const char * match_data; @@ -1111,6 +1113,12 @@ typedef struct int pin1_replaced; /* applicable to USIM, CSIM & ISIM */ RIL_PinState pin1; RIL_PinState pin2; + /* Samsung SIM PIN/Unlock fields */ + int pin1_num_retries; + int puk1_num_retries; + int pin2_num_retries; + int puk2_num_retries; + int perso_unblock_retries; } RIL_AppStatus; /* Deprecated, use RIL_CardStatus_v6 */ diff --git a/ril/libril/ril.cpp b/ril/libril/ril.cpp index 6d375ca..337b355 100644 --- a/ril/libril/ril.cpp +++ b/ril/libril/ril.cpp @@ -1,6 +1,7 @@ /* //device/libs/telephony/ril.cpp ** ** Copyright 2006, The Android Open Source Project +** Copyright 2018, 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. @@ -48,6 +49,7 @@ #include #include #include +#include extern "C" void RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen); @@ -740,6 +742,8 @@ void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, return; } + remapUnsol(&unsolResponse); + unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE; if ((unsolResponseIndex < 0)