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
This commit is contained in:
Paul Keith 2017-10-19 02:26:41 +02:00 committed by Kevin F. Haggerty
parent 47a0f43fd5
commit 9a9121b070
3 changed files with 34 additions and 3 deletions

19
ril/include/samsung_ril.h Normal file
View File

@ -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) {
}

View File

@ -1,5 +1,6 @@
/* /*
* Copyright (C) 2006 The Android Open Source Project * Copyright (C) 2006 The Android Open Source Project
* Copyright (C) 2018 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 RIL_E_ILLEGAL_SIM_OR_ME = 15, /* network selection failed due to
illegal SIM or ME */ illegal SIM or ME */
RIL_E_MISSING_RESOURCE = 16, /* no logical channel available */ 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_USSD = 18, /* DIAL request modified to USSD */
RIL_E_DIAL_MODIFIED_TO_SS = 19, /* DIAL request modified to SS */ 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 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_GSM_WCDMA = 9, /* LTE, GSM/WCDMA */
PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA = 10, /* LTE, CDMA, EvDo, 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_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_ONLY = 13, /* TD-SCDMA only */
PREF_NET_TYPE_TD_SCDMA_WCDMA = 14, /* TD-SCDMA and WCDMA */ PREF_NET_TYPE_TD_SCDMA_WCDMA = 14, /* TD-SCDMA and WCDMA */
PREF_NET_TYPE_TD_SCDMA_LTE = 15, /* TD-SCDMA and LTE */ 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 */ int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
char * name; /* Remote party name */ char * name; /* Remote party name */
int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ 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_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */
} RIL_Call; } RIL_Call;
@ -733,7 +735,7 @@ typedef struct {
const char * mcc; const char * mcc;
const char * mnc; const char * mnc;
RIL_CarrierMatchType match_type; /* Specify match type for the carrier. RIL_CarrierMatchType match_type; /* Specify match type for the carrier.
* If its 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. * otherwise, match_data is the value for the match type.
*/ */
const char * match_data; const char * match_data;
@ -1111,6 +1113,12 @@ typedef struct
int pin1_replaced; /* applicable to USIM, CSIM & ISIM */ int pin1_replaced; /* applicable to USIM, CSIM & ISIM */
RIL_PinState pin1; RIL_PinState pin1;
RIL_PinState pin2; 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; } RIL_AppStatus;
/* Deprecated, use RIL_CardStatus_v6 */ /* Deprecated, use RIL_CardStatus_v6 */

View File

@ -1,6 +1,7 @@
/* //device/libs/telephony/ril.cpp /* //device/libs/telephony/ril.cpp
** **
** Copyright 2006, The Android Open Source Project ** Copyright 2006, The Android Open Source Project
** Copyright 2018, The LineageOS Project
** **
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License. ** you may not use this file except in compliance with the License.
@ -48,6 +49,7 @@
#include <RilSapSocket.h> #include <RilSapSocket.h>
#include <ril_service.h> #include <ril_service.h>
#include <sap_service.h> #include <sap_service.h>
#include <samsung_ril.h>
extern "C" void extern "C" void
RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen); 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; return;
} }
remapUnsol(&unsolResponse);
unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE; unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE;
if ((unsolResponseIndex < 0) if ((unsolResponseIndex < 0)