Browse Source

Merge commit 'refs/changes/68/226768/4' of https://github.com/LineageOS/android_device_samsung_msm8976-common into lineage-16.0

lineage-16.0
Peter Wickenberg 5 months ago
parent
commit
7ea0bd07d9
  1. 7
      BoardConfigCommon.mk
  2. 26
      include/samsung_ril.h
  3. 7380
      include/telephony/ril.h
  4. 17
      ril/Android.mk
  5. 49
      ril/include/libril/ril_ex.h
  6. 19
      ril/include/samsung_ril.h
  7. 38
      ril/include/telephony/librilutils.h
  8. 43
      ril/include/telephony/record_stream.h
  9. 7380
      ril/include/telephony/ril.h
  10. 806
      ril/include/telephony/ril_cdma_sms.h
  11. 48
      ril/include/telephony/ril_msim.h
  12. 88
      ril/include/telephony/ril_nv_items.h
  13. 54
      ril/libril/Android.mk
  14. 0
      ril/libril/MODULE_LICENSE_APACHE2
  15. 190
      ril/libril/NOTICE
  16. 295
      ril/libril/RilSapSocket.cpp
  17. 200
      ril/libril/RilSapSocket.h
  18. 70
      ril/libril/RilSocket.h
  19. 1265
      ril/libril/ril.cpp
  20. 167
      ril/libril/rilSocketQueue.h
  21. 162
      ril/libril/ril_commands.h
  22. 384
      ril/libril/ril_event.cpp
  23. 52
      ril/libril/ril_event.h
  24. 98
      ril/libril/ril_internal.h
  25. 8716
      ril/libril/ril_service.cpp
  26. 750
      ril/libril/ril_service.h
  27. 66
      ril/libril/ril_unsol_commands.h
  28. 966
      ril/libril/sap_service.cpp
  29. 33
      ril/libril/sap_service.h

7
BoardConfigCommon.mk

@ -169,6 +169,9 @@ TARGET_PLATFORM_DEVICE_BASE := /devices/soc.0/ @@ -169,6 +169,9 @@ TARGET_PLATFORM_DEVICE_BASE := /devices/soc.0/
# Keymaster
TARGET_PROVIDES_KEYMASTER := true
# Network Routing
TARGET_NEEDS_NETD_DIRECT_CONNECT_RULE := true
# Peripheral manager
TARGET_PER_MGR_ENABLED := true
@ -183,6 +186,10 @@ TARGET_SYSTEM_PROP += $(VENDOR_PATH)/system.prop @@ -183,6 +186,10 @@ TARGET_SYSTEM_PROP += $(VENDOR_PATH)/system.prop
BOARD_USES_QCOM_HARDWARE := true
BOARD_USES_QC_TIME_SERVICES := true
# Radio
BOARD_PROVIDES_LIBRIL := true
TARGET_RIL_VARIANT := caf
# Ramdisk
BOARD_ROOT_EXTRA_FOLDERS := dsp efs firmware firmware-modem persist
BOARD_ROOT_EXTRA_SYMLINKS := /system/etc/firmware/btfw32.tlv:/bt_firmware/image/btfw32.tlv

26
include/samsung_ril.h

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
/*
**
** 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.
*/
#define RIL_UNSOL_SIM_SWAP_STATE_CHANGED 11057
static inline void remapUnsol(int *unsol) {
switch(*unsol) {
case RIL_UNSOL_SIM_SWAP_STATE_CHANGED:
*unsol = RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED;
return;
}
}

7380
include/telephony/ril.h

File diff suppressed because it is too large Load Diff

17
ril/Android.mk

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
#
# 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.
# 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.
#
include $(call first-makefiles-under,$(call my-dir))

49
ril/include/libril/ril_ex.h

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
/*
* Copyright (C) 2014 The Android Open Source 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.
*/
#ifndef RIL_EX_H_INCLUDED
#define RIL_EX_H_INCLUDED
#include <telephony/ril.h>
#include <telephony/record_stream.h>
#define NUM_ELEMS_SOCKET(a) (sizeof (a) / sizeof (a)[0])
struct ril_event;
void rilEventAddWakeup_helper(struct ril_event *ev);
int blockingWrite_helper(int fd, void* data, size_t len);
enum SocketWakeType {DONT_WAKE, WAKE_PARTIAL};
typedef enum {
RIL_TELEPHONY_SOCKET,
RIL_SAP_SOCKET
} RIL_SOCKET_TYPE;
typedef struct SocketListenParam {
RIL_SOCKET_ID socket_id;
int fdListen;
int fdCommand;
const char* processName;
struct ril_event* commands_event;
struct ril_event* listen_event;
void (*processCommandsCallback)(int fd, short flags, void *param);
RecordStream *p_rs;
RIL_SOCKET_TYPE type;
} SocketListenParam;
#endif

19
ril/include/samsung_ril.h

@ -0,0 +1,19 @@ @@ -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) {
}

38
ril/include/telephony/librilutils.h

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
/*
* Copyright (C) 2013 The Android Open Source 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.
*/
#ifndef LIBRILUTILS_H
#define LIBRILUTILS_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Return system time in nanos.
*
* This is a monotonicly increasing clock and
* return the same value as System.nanoTime in java.
*/
uint64_t ril_nano_time();
#ifdef __cplusplus
}
#endif
#endif // LIBRILUTILS_H

43
ril/include/telephony/record_stream.h

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
/*
* Copyright (C) 2006 The Android Open Source 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.
*/
/*
* A simple utility for reading fixed records out of a stream fd
*/
#ifndef _LIBRIL_RECORD_STREAM_H
#define _LIBRIL_RECORD_STREAM_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct RecordStream RecordStream;
extern RecordStream *record_stream_new(int fd, size_t maxRecordLen);
extern void record_stream_free(RecordStream *p_rs);
extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord,
size_t *p_outRecordLen);
#ifdef __cplusplus
}
#endif
#endif /*_LIBRIL_RECORD_STREAM_H*/

7380
ril/include/telephony/ril.h

File diff suppressed because it is too large Load Diff

806
ril/include/telephony/ril_cdma_sms.h

@ -0,0 +1,806 @@ @@ -0,0 +1,806 @@
/*
* Copyright (C) 2006 The Android Open Source 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.
*/
/*
* ISSUES:
*
*/
/**
* TODO
*
*
*/
#ifndef ANDROID_RIL_CDMA_SMS_H
#define ANDROID_RIL_CDMA_SMS_H 1
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Used by RIL_REQUEST_CDMA_SEND_SMS and RIL_UNSOL_RESPONSE_CDMA_NEW_SMS */
#define RIL_CDMA_SMS_ADDRESS_MAX 36
#define RIL_CDMA_SMS_SUBADDRESS_MAX 36
#define RIL_CDMA_SMS_BEARER_DATA_MAX 255
typedef enum {
RIL_CDMA_SMS_DIGIT_MODE_4_BIT = 0, /* DTMF digits */
RIL_CDMA_SMS_DIGIT_MODE_8_BIT = 1,
RIL_CDMA_SMS_DIGIT_MODE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_DigitMode;
typedef enum {
RIL_CDMA_SMS_NUMBER_MODE_NOT_DATA_NETWORK = 0,
RIL_CDMA_SMS_NUMBER_MODE_DATA_NETWORK = 1,
RIL_CDMA_SMS_NUMBER_MODE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_NumberMode;
typedef enum {
RIL_CDMA_SMS_NUMBER_TYPE_UNKNOWN = 0,
RIL_CDMA_SMS_NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1,
/* INTERNATIONAL is used when number mode is not data network address.
* DATA_IP is used when the number mode is data network address
*/
RIL_CDMA_SMS_NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2,
/* NATIONAL is used when the number mode is not data network address.
* INTERNET_MAIL is used when the number mode is data network address.
* For INTERNET_MAIL, in the address data "digits", each byte contains
* an ASCII character. Examples are "x@y.com,a@b.com - ref TIA/EIA-637A 3.4.3.3
*/
RIL_CDMA_SMS_NUMBER_TYPE_NETWORK = 3,
RIL_CDMA_SMS_NUMBER_TYPE_SUBSCRIBER = 4,
RIL_CDMA_SMS_NUMBER_TYPE_ALPHANUMERIC = 5,
/* GSM SMS: address value is GSM 7-bit chars */
RIL_CDMA_SMS_NUMBER_TYPE_ABBREVIATED = 6,
RIL_CDMA_SMS_NUMBER_TYPE_RESERVED_7 = 7,
RIL_CDMA_SMS_NUMBER_TYPE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_NumberType;
typedef enum {
RIL_CDMA_SMS_NUMBER_PLAN_UNKNOWN = 0,
RIL_CDMA_SMS_NUMBER_PLAN_TELEPHONY = 1, /* CCITT E.164 and E.163, including ISDN plan */
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_2 = 2,
RIL_CDMA_SMS_NUMBER_PLAN_DATA = 3, /* CCITT X.121 */
RIL_CDMA_SMS_NUMBER_PLAN_TELEX = 4, /* CCITT F.69 */
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_5 = 5,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_6 = 6,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_7 = 7,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_8 = 8,
RIL_CDMA_SMS_NUMBER_PLAN_PRIVATE = 9,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_10 = 10,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_11 = 11,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_12 = 12,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_13 = 13,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_14 = 14,
RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_15 = 15,
RIL_CDMA_SMS_NUMBER_PLAN_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_NumberPlan;
typedef struct {
RIL_CDMA_SMS_DigitMode digit_mode;
/* Indicates 4-bit or 8-bit */
RIL_CDMA_SMS_NumberMode number_mode;
/* Used only when digitMode is 8-bit */
RIL_CDMA_SMS_NumberType number_type;
/* Used only when digitMode is 8-bit.
* To specify an international address, use the following:
* digitMode = RIL_CDMA_SMS_DIGIT_MODE_8_BIT
* numberMode = RIL_CDMA_SMS_NOT_DATA_NETWORK
* numberType = RIL_CDMA_SMS_NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP
* numberPlan = RIL_CDMA_SMS_NUMBER_PLAN_TELEPHONY
* numberOfDigits = number of digits
* digits = ASCII digits, e.g. '1', '2', '3'3, '4', and '5'
*/
RIL_CDMA_SMS_NumberPlan number_plan;
/* Used only when digitMode is 8-bit */
unsigned char number_of_digits;
unsigned char digits[ RIL_CDMA_SMS_ADDRESS_MAX ];
/* Each byte in this array represnts a 40bit or 8-bit digit of address data */
} RIL_CDMA_SMS_Address;
typedef enum {
RIL_CDMA_SMS_SUBADDRESS_TYPE_NSAP = 0, /* CCITT X.213 or ISO 8348 AD2 */
RIL_CDMA_SMS_SUBADDRESS_TYPE_USER_SPECIFIED = 1, /* e.g. X.25 */
RIL_CDMA_SMS_SUBADDRESS_TYPE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_SubaddressType;
typedef struct {
RIL_CDMA_SMS_SubaddressType subaddressType;
/* 1 means the last byte's lower 4 bits should be ignored */
unsigned char odd;
unsigned char number_of_digits;
/* Each byte respresents a 8-bit digit of subaddress data */
unsigned char digits[ RIL_CDMA_SMS_SUBADDRESS_MAX ];
} RIL_CDMA_SMS_Subaddress;
typedef struct {
int uTeleserviceID;
unsigned char bIsServicePresent;
int uServicecategory;
RIL_CDMA_SMS_Address sAddress;
RIL_CDMA_SMS_Subaddress sSubAddress;
int uBearerDataLen;
unsigned char aBearerData[ RIL_CDMA_SMS_BEARER_DATA_MAX ];
} RIL_CDMA_SMS_Message;
/* Used by RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE */
typedef enum {
RIL_CDMA_SMS_NO_ERROR = 0,
RIL_CDMA_SMS_ERROR = 1,
RIL_CDMA_SMS_ERROR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_ErrorClass;
typedef struct {
RIL_CDMA_SMS_ErrorClass uErrorClass;
int uSMSCauseCode; /* As defined in N.S00005, 6.5.2.125.
Currently, only 35 (resource shortage) and
39 (other terminal problem) are reported. */
} RIL_CDMA_SMS_Ack;
/* Used by RIL_REQUEST_CDMA_SMS_GET_BROADCAST_CONFIG and
RIL_REQUEST_CDMA_SMS_SET_BROADCAST_CONFIG */
typedef struct {
int service_category;
int language;
unsigned char selected;
} RIL_CDMA_BroadcastSmsConfigInfo;
/* Used by RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM */
typedef struct {
int status; /* Status of message. See TS 27.005 3.1, "<stat>": */
/* 0 = "REC UNREAD" */
/* 1 = "REC READ" */
/* 2 = "STO UNSENT" */
/* 3 = "STO SENT" */
RIL_CDMA_SMS_Message message;
} RIL_CDMA_SMS_WriteArgs;
/* Used by RIL_REQUEST_ENCODE_CDMA_SMS and RIL_REQUEST_DECODE_CDMA_SMS*/
#define RIL_CDMA_SMS_UDH_MAX_SND_SIZE 128
#define RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX 131 /* 140 - 3 - 6 */
#define RIL_CDMA_SMS_MAX_UD_HEADERS 7
#define RIL_CDMA_SMS_USER_DATA_MAX 229
#define RIL_CDMA_SMS_ADDRESS_MAX 36
#define RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE 128
#define RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE 32
#define RIL_CDMA_SMS_UDH_VAR_PIC_SIZE 134
#define RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS 4
#define RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE 32
#define RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE 8
#define RIL_CDMA_SMS_UDH_OTHER_SIZE 226
#define RIL_CDMA_SMS_IP_ADDRESS_SIZE 4
/* ------------------- */
/* ---- User Data ---- */
/* ------------------- */
typedef enum {
RIL_CDMA_SMS_UDH_CONCAT_8 = 0x00,
RIL_CDMA_SMS_UDH_SPECIAL_SM,
/* 02 - 03 Reserved */
RIL_CDMA_SMS_UDH_PORT_8 = 0x04,
RIL_CDMA_SMS_UDH_PORT_16,
RIL_CDMA_SMS_UDH_SMSC_CONTROL,
RIL_CDMA_SMS_UDH_SOURCE,
RIL_CDMA_SMS_UDH_CONCAT_16,
RIL_CDMA_SMS_UDH_WCMP,
RIL_CDMA_SMS_UDH_TEXT_FORMATING,
RIL_CDMA_SMS_UDH_PRE_DEF_SOUND,
RIL_CDMA_SMS_UDH_USER_DEF_SOUND,
RIL_CDMA_SMS_UDH_PRE_DEF_ANIM,
RIL_CDMA_SMS_UDH_LARGE_ANIM,
RIL_CDMA_SMS_UDH_SMALL_ANIM,
RIL_CDMA_SMS_UDH_LARGE_PICTURE,
RIL_CDMA_SMS_UDH_SMALL_PICTURE,
RIL_CDMA_SMS_UDH_VAR_PICTURE,
RIL_CDMA_SMS_UDH_USER_PROMPT = 0x13,
RIL_CDMA_SMS_UDH_EXTENDED_OBJECT = 0x14,
/* 15 - 1F Reserved for future EMS */
RIL_CDMA_SMS_UDH_RFC822 = 0x20,
/* 21 - 6F Reserved for future use */
/* 70 - 7f Reserved for (U)SIM Toolkit Security Headers */
/* 80 - 9F SME to SME specific use */
/* A0 - BF Reserved for future use */
/* C0 - DF SC specific use */
/* E0 - FF Reserved for future use */
RIL_CDMA_SMS_UDH_OTHER = 0xFFFF, /* For unsupported or proprietary headers */
RIL_CDMA_SMS_UDH_ID_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_UdhId;
typedef struct {
/*indicates the reference number for a particular concatenated short message. */
/*it is constant for every short message which makes up a particular concatenated short message*/
unsigned char msg_ref;
/*indicates the total number of short messages within the concatenated short message.
The value shall start at 1 and remain constant for every
short message which makes up the concatenated short message.
if it is 0 then the receiving entity shall ignore the whole Information Element*/
unsigned char total_sm;
/*
* it indicates the sequence number of a particular short message within the concatenated short
* message. The value shall start at 1 and increment by one for every short message sent
* within the concatenated short message. If the value is zero or the value is
* greater than the value in octet 2 then the receiving
* entity shall ignore the whole Information Element.
*/
unsigned char seq_num;
} RIL_CDMA_SMS_UdhConcat8;
/* GW message waiting actions
*/
typedef enum {
RIL_CDMA_SMS_GW_MSG_WAITING_NONE,
RIL_CDMA_SMS_GW_MSG_WAITING_DISCARD,
RIL_CDMA_SMS_GW_MSG_WAITING_STORE,
RIL_CDMA_SMS_GW_MSG_WAITING_NONE_1111,
RIL_CDMA_SMS_GW_MSG_WAITING_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_GWMsgWaiting;
/* GW message waiting types
*/
typedef enum {
RIL_CDMA_SMS_GW_MSG_WAITING_VOICEMAIL,
RIL_CDMA_SMS_GW_MSG_WAITING_FAX,
RIL_CDMA_SMS_GW_MSG_WAITING_EMAIL,
RIL_CDMA_SMS_GW_MSG_WAITING_OTHER,
RIL_CDMA_SMS_GW_MSG_WAITING_KIND_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_GWMsgWaitingKind;
typedef struct {
RIL_CDMA_SMS_GWMsgWaiting msg_waiting;
RIL_CDMA_SMS_GWMsgWaitingKind msg_waiting_kind;
/*it indicates the number of messages of the type specified in Octet 1 waiting.*/
unsigned char message_count;
} RIL_CDMA_SMS_UdhSpecialSM;
typedef struct {
unsigned char dest_port;
unsigned char orig_port;
} RIL_CDMA_SMS_UdhWap8;
typedef struct {
unsigned short dest_port;
unsigned short orig_port;
} RIL_CDMA_SMS_UdhWap16;
typedef struct {
unsigned short msg_ref;
unsigned char total_sm;
unsigned char seq_num;
} RIL_CDMA_SMS_UdhConcat16;
typedef enum {
RIL_CDMA_SMS_UDH_LEFT_ALIGNMENT = 0,
RIL_CDMA_SMS_UDH_CENTER_ALIGNMENT,
RIL_CDMA_SMS_UDH_RIGHT_ALIGNMENT,
RIL_CDMA_SMS_UDH_DEFAULT_ALIGNMENT,
RIL_CDMA_SMS_UDH_MAX_ALIGNMENT,
RIL_CDMA_SMS_UDH_ALIGNMENT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_UdhAlignment;
typedef enum {
RIL_CDMA_SMS_UDH_FONT_NORMAL = 0,
RIL_CDMA_SMS_UDH_FONT_LARGE,
RIL_CDMA_SMS_UDH_FONT_SMALL,
RIL_CDMA_SMS_UDH_FONT_RESERVED,
RIL_CDMA_SMS_UDH_FONT_MAX,
RIL_CDMA_SMS_UDH_FONT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_UdhFontSize;
typedef enum {
RIL_CDMA_SMS_UDH_TEXT_COLOR_BLACK = 0x0,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREY = 0x1,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_RED = 0x2,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_YELLOW = 0x3,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREEN = 0x4,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_CYAN = 0x5,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_BLUE = 0x6,
RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_MAGENTA = 0x7,
RIL_CDMA_SMS_UDH_TEXT_COLOR_GREY = 0x8,
RIL_CDMA_SMS_UDH_TEXT_COLOR_WHITE = 0x9,
RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_RED = 0xA,
RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_YELLOW = 0xB,
RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_GREEN = 0xC,
RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_CYAN = 0xD,
RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_BLUE = 0xE,
RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_MAGENTA = 0xF,
RIL_CDMA_SMS_UDH_TEXT_COLOR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_UdhTextColor;
typedef struct {
unsigned char start_position;
unsigned char text_formatting_length;
RIL_CDMA_SMS_UdhAlignment alignment_type ; /*bit 0 and bit 1*/
RIL_CDMA_SMS_UdhFontSize font_size ; /*bit 3 and bit 2*/
unsigned char style_bold; /*bit 4 */
unsigned char style_italic; /*bit 5 */
unsigned char style_underlined; /*bit 6 */
unsigned char style_strikethrough; /*bit 7 */
/* if FALSE, ignore the following color information */
unsigned char is_color_present;
RIL_CDMA_SMS_UdhTextColor text_color_foreground;
RIL_CDMA_SMS_UdhTextColor text_color_background;
} RIL_CDMA_SMS_UdhTextFormating;
/* Predefined sound
*/
typedef struct {
unsigned char position;
unsigned char snd_number;
} RIL_CDMA_SMS_UdhPreDefSound;
/* User Defined sound
*/
typedef struct {
unsigned char data_length;
unsigned char position;
unsigned char user_def_sound[RIL_CDMA_SMS_UDH_MAX_SND_SIZE];
} RIL_CDMA_SMS_UdhUserDefSound;
/* Large picture
*/
typedef struct {
unsigned char position;
unsigned char data[RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE];
} RIL_CDMA_SMS_UdhLargePictureData;
/* Small picture
*/
typedef struct {
unsigned char position;
unsigned char data[RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE];
} RIL_CDMA_SMS_UdhSmallPictureData;
/* Variable length picture
*/
typedef struct {
unsigned char position;
unsigned char width; /* Number of pixels - Should be a mutliple of 8 */
unsigned char height;
unsigned char data[RIL_CDMA_SMS_UDH_VAR_PIC_SIZE];
} RIL_CDMA_SMS_UdhVarPicture;
/* Predefined animation
*/
typedef struct {
unsigned char position;
unsigned char animation_number;
} RIL_CDMA_SMS_UdhPreDefAnim;
/* Large animation
*/
typedef struct {
unsigned char position;
unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE];
} RIL_CDMA_SMS_UdhLargeAnim;
/* Small animation
*/
typedef struct {
unsigned char position;
unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE];
} RIL_CDMA_SMS_UdhSmallAnim;
/* User Prompt Indicator UDH
*/
typedef struct {
unsigned char number_of_objects;
/* Number of objects of the same kind that follow this header which will
** be stitched together by the applications. For example, 5 small pictures
** are to be stitched together horizontally, or 6 iMelody tones are to be
** connected together with intermediate iMelody header and footer ignored.
** Allowed objects to be stitched:
** - Images (small, large, variable)
** - User defined sounds
*/
} RIL_CDMA_SMS_UdhUserPrompt;
typedef struct {
unsigned char length;
unsigned char data[RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX];
/* RIL_CDMA_SMS_UDH_EO_VCARD: See http://www.imc.org/pdi/vcard-21.doc for payload */
/* RIL_CDMA_SMS_UDH_EO_VCALENDAR: See http://www.imc.org/pdi/vcal-10.doc */
/* Or: Unsupported/proprietary extended objects */
} RIL_CDMA_SMS_UdhEoContent;
/* Extended Object UDH
*/
/* Extended Object IDs/types
*/
typedef enum {
RIL_CDMA_SMS_UDH_EO_VCARD = 0x09,
RIL_CDMA_SMS_UDH_EO_VCALENDAR = 0x0A,
RIL_CDMA_SMS_UDH_EO_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
} RIL_CDMA_SMS_UdhEoId;
typedef struct {
/* Extended objects are to be used together with 16-bit concatenation
** UDH. The max number of segments supported for E.O. is 8 at least.
*/
RIL_CDMA_SMS_UdhEoContent content;
unsigned char first_segment;
/* The following fields are only present in the first segment of a
** concatenated SMS message.
*/
unsigned char reference;
/* Identify those extended object segments which should be linked together
*/
unsigned short length;
/* Length of the whole extended object data
*/
unsigned char control;
RIL_CDMA_SMS_UdhEoId type;
unsigned short position;
/* Absolute position of the E.O. in the whole text after concatenation,
** starting from 1.
*/
} RIL_CDMA_SMS_UdhEo;
typedef struct {
RIL_CDMA_SMS_UdhId header_id;
unsigned char header_length;
unsigned char data[RIL_CDMA_SMS_UDH_OTHER_SIZE];
} RIL_CDMA_SMS_UdhOther;
typedef struct {
unsigned char header_length;
} RIL_CDMA_SMS_UdhRfc822;
typedef struct {
RIL_CDMA_SMS_UdhId header_id;
union {
RIL_CDMA_SMS_UdhConcat8 concat_8; // 00
RIL_CDMA_SMS_UdhSpecialSM special_sm; // 01
RIL_CDMA_SMS_UdhWap8 wap_8; // 04
RIL_CDMA_SMS_UdhWap16 wap_16; // 05
RIL_CDMA_SMS_UdhConcat16 concat_16; // 08
RIL_CDMA_SMS_UdhTextFormating text_formating; // 0a
RIL_CDMA_SMS_UdhPreDefSound pre_def_sound; // 0b
RIL_CDMA_SMS_UdhUserDefSound user_def_sound; // 0c
RIL_CDMA_SMS_UdhPreDefAnim pre_def_anim; // 0d
RIL_CDMA_SMS_UdhLargeAnim large_anim; // 0e
RIL_CDMA_SMS_UdhSmallAnim small_anim; // 0f
RIL_CDMA_SMS_UdhLargePictureData large_picture; // 10
RIL_CDMA_SMS_UdhSmallPictureData small_picture; // 11
RIL_CDMA_SMS_UdhVarPicture var_picture; // 12
RIL_CDMA_SMS_UdhUserPrompt user_prompt; // 13
RIL_CDMA_SMS_UdhEo eo; // 14
RIL_CDMA_SMS_UdhRfc822 rfc822; // 20
RIL_CDMA_SMS_UdhOther other;
}u;
} RIL_CDMA_SMS_Udh;
/* ----------------------------- */
/* -- User data encoding type -- */
/* ----------------------------- */
typedef enum {
RIL_CDMA_SMS_ENCODING_OCTET = 0, /* 8-bit */
RIL_CDMA_SMS_ENCODING_IS91EP, /* varies */
RIL_CDMA_SMS_ENCODING_ASCII, /* 7-bit */
RIL_CDMA_SMS_ENCODING_IA5, /* 7-bit */
RIL_CDMA_SMS_ENCODING_UNICODE, /* 16-bit */
RIL_CDMA_SMS_ENCODING_SHIFT_JIS, /* 8 or 16-bit */
RIL_CDMA_SMS_ENCODING_KOREAN, /* 8 or 16-bit */
RIL_CDMA_SMS_ENCODING_LATIN_HEBREW, /* 8-bit */
RIL_CDMA_SMS_ENCODING_LATIN, /* 8-bit */
RIL_CDMA_SMS_ENCODING_GSM_7_BIT_DEFAULT, /* 7-bit */
RIL_CDMA_SMS_ENCODING_MAX32 = 0x10000000
} RIL_CDMA_SMS_UserDataEncoding;
/* ------------------------ */
/* -- IS-91 EP data type -- */
/* ------------------------ */
typedef enum {
RIL_CDMA_SMS_IS91EP_VOICE_MAIL = 0x82,
RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE_FULL = 0x83,
RIL_CDMA_SMS_IS91EP_CLI_ORDER = 0x84,
RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE = 0x85,
RIL_CDMA_SMS_IS91EP_MAX32 = 0x10000000
} RIL_CDMA_SMS_IS91EPType;
typedef struct {
/* NOTE: If message_id.udh_present == TRUE:
** 'num_headers' is the number of User Data Headers (UDHs),
** and 'headers' include all those headers.
*/
unsigned char num_headers;
RIL_CDMA_SMS_Udh headers[RIL_CDMA_SMS_MAX_UD_HEADERS];
RIL_CDMA_SMS_UserDataEncoding encoding;
RIL_CDMA_SMS_IS91EPType is91ep_type;
/*----------------------------------------------------------------------
'data_len' indicates the valid number of bytes in the 'data' array.
'padding_bits' (0-7) indicates how many bits in the last byte of 'data'
are invalid bits. This parameter is only used for Mobile-Originated
messages. There is no way for the API to tell how many padding bits
exist in the received message. Instead, the application can find out how
many padding bits exist in the user data when decoding the user data.
'data' has the raw bits of the user data field of the SMS message.
The client software should decode the raw user data according to its
supported encoding types and languages.
EXCEPTION 1: CMT-91 user data raw bits are first translated into BD fields
(e.g. num_messages, callback, etc.) The translated user data field in
VMN and Short Message is in the form of ASCII characters, each occupying
a byte in the resulted 'data'.
EXCEPTION 2: GSM 7-bit Default characters are decoded so that each byte
has one 7-bit GSM character.
'number_of_digits' is the number of digits/characters (7, 8, 16, or
whatever bits) in the raw user data, which can be used by the client
when decoding the user data according to the encoding type and language.
-------------------------------------------------------------------------*/
unsigned char data_len;
unsigned char padding_bits;
unsigned char data[ RIL_CDMA_SMS_USER_DATA_MAX ];
unsigned char number_of_digits;
} RIL_CDMA_SMS_CdmaUserData;
/* -------------------- */
/* ---- Message Id ---- */
/* -------------------- */
typedef enum {
RIL_CDMA_SMS_BD_TYPE_RESERVED_0 = 0,
RIL_CDMA_SMS_BD_TYPE_DELIVER, /* MT only */
RIL_CDMA_SMS_BD_TYPE_SUBMIT, /* MO only */
RIL_CDMA_SMS_BD_TYPE_CANCELLATION, /* MO only */
RIL_CDMA_SMS_BD_TYPE_DELIVERY_ACK, /* MT only */
RIL_CDMA_SMS_BD_TYPE_USER_ACK, /* MT & MO */
RIL_CDMA_SMS_BD_TYPE_READ_ACK, /* MT & MO */
RIL_CDMA_SMS_BD_TYPE_MAX32 = 0x10000000
} RIL_CDMA_SMS_BdMessageType;
typedef unsigned int RIL_CDMA_SMS_MessageNumber;
typedef struct {
RIL_CDMA_SMS_BdMessageType type;
RIL_CDMA_SMS_MessageNumber id_number;
unsigned char udh_present;
/* NOTE: if FEATURE_SMS_UDH is not defined,
** udh_present should be ignored.
*/
} RIL_CDMA_SMS_MessageId;
typedef unsigned char RIL_CDMA_SMS_UserResponse;
/* ------------------- */
/* ---- Timestamp ---- */
/* ------------------- */
typedef struct {
/* If 'year' is between 96 and 99, the actual year is 1900 + 'year';
if 'year' is between 00 and 95, the actual year is 2000 + 'year'.
NOTE: Each field has two BCD digits and byte arrangement is <MSB, ... ,LSB>
*/
unsigned char year; /* 0x00-0x99 */
unsigned char month; /* 0x01-0x12 */
unsigned char day; /* 0x01-0x31 */
unsigned char hour; /* 0x00-0x23 */
unsigned char minute; /* 0x00-0x59 */
unsigned char second; /* 0x00-0x59 */
signed char timezone; /* +/-, [-48,+48] number of 15 minutes - GW only */
} RIL_CDMA_SMS_Timestamp;
/* ------------------ */
/* ---- Priority ---- */
/* ------------------ */
typedef enum {
RIL_CDMA_SMS_PRIORITY_NORMAL = 0,
RIL_CDMA_SMS_PRIORITY_INTERACTIVE,
RIL_CDMA_SMS_PRIORITY_URGENT,
RIL_CDMA_SMS_PRIORITY_EMERGENCY,
RIL_CDMA_SMS_PRIORITY_MAX32 = 0x10000000
} RIL_CDMA_SMS_Priority;
/* ----------------- */
/* ---- Privacy ---- */
/* ----------------- */
typedef enum {
RIL_CDMA_SMS_PRIVACY_NORMAL = 0,
RIL_CDMA_SMS_PRIVACY_RESTRICTED,
RIL_CDMA_SMS_PRIVACY_CONFIDENTIAL,
RIL_CDMA_SMS_PRIVACY_SECRET,
RIL_CDMA_SMS_PRIVACY_MAX32 = 0x10000000
} RIL_CDMA_SMS_Privacy;
/* ---------------------- */
/* ---- Reply option ---- */
/* ---------------------- */
typedef struct {
/* whether user ack is requested
*/
unsigned char user_ack_requested;
/* whether delivery ack is requested.
Should be FALSE for incoming messages.
*/
unsigned char delivery_ack_requested;
/* Message originator requests the receiving phone to send back a READ_ACK
** message automatically when the user reads the received message.
*/
unsigned char read_ack_requested;
} RIL_CDMA_SMS_ReplyOption;
typedef enum {
RIL_CDMA_SMS_ALERT_MODE_DEFAULT = 0,
RIL_CDMA_SMS_ALERT_MODE_LOW_PRIORITY = 1,
RIL_CDMA_SMS_ALERT_MODE_MEDIUM_PRIORITY = 2,
RIL_CDMA_SMS_ALERT_MODE_HIGH_PRIORITY = 3,
/* For pre-IS637A implementations, alert_mode only has values of True/False:
*/
RIL_CDMA_SMS_ALERT_MODE_OFF = 0,
RIL_CDMA_SMS_ALERT_MODE_ON = 1
} RIL_CDMA_SMS_AlertMode;
/* ------------------ */
/* ---- Language ---- */
/* ------------------ */
typedef enum {
RIL_CDMA_SMS_LANGUAGE_UNSPECIFIED = 0,
RIL_CDMA_SMS_LANGUAGE_ENGLISH,
RIL_CDMA_SMS_LANGUAGE_FRENCH,
RIL_CDMA_SMS_LANGUAGE_SPANISH,
RIL_CDMA_SMS_LANGUAGE_JAPANESE,
RIL_CDMA_SMS_LANGUAGE_KOREAN,
RIL_CDMA_SMS_LANGUAGE_CHINESE,
RIL_CDMA_SMS_LANGUAGE_HEBREW,
RIL_CDMA_SMS_LANGUAGE_MAX32 = 0x10000000
} RIL_CDMA_SMS_Language;
/* ---------------------------------- */
/* ---------- Display Mode ---------- */
/* ---------------------------------- */
typedef enum {
RIL_CDMA_SMS_DISPLAY_MODE_IMMEDIATE = 0,
RIL_CDMA_SMS_DISPLAY_MODE_DEFAULT = 1,
RIL_CDMA_SMS_DISPLAY_MODE_USER_INVOKE = 2,
RIL_CDMA_SMS_DISPLAY_MODE_RESERVED = 3
} RIL_CDMA_SMS_DisplayMode;
/* IS-637B parameters/fields
*/
/* ---------------------------------- */
/* ---------- Delivery Status ------- */
/* ---------------------------------- */
typedef enum {
RIL_CDMA_SMS_DELIVERY_STATUS_ACCEPTED = 0, /* ERROR_CLASS_NONE */
RIL_CDMA_SMS_DELIVERY_STATUS_DEPOSITED_TO_INTERNET = 1, /* ERROR_CLASS_NONE */
RIL_CDMA_SMS_DELIVERY_STATUS_DELIVERED = 2, /* ERROR_CLASS_NONE */
RIL_CDMA_SMS_DELIVERY_STATUS_CANCELLED = 3, /* ERROR_CLASS_NONE */
RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_CONGESTION = 4, /* ERROR_CLASS_TEMP & PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_ERROR = 5, /* ERROR_CLASS_TEMP & PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_CANCEL_FAILED = 6, /* ERROR_CLASS_PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_BLOCKED_DESTINATION = 7, /* ERROR_CLASS_PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_TEXT_TOO_LONG = 8, /* ERROR_CLASS_PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_DUPLICATE_MESSAGE = 9, /* ERROR_CLASS_PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_INVALID_DESTINATION = 10, /* ERROR_CLASS_PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_MESSAGE_EXPIRED = 13, /* ERROR_CLASS_PERM */
RIL_CDMA_SMS_DELIVERY_STATUS_UNKNOWN_ERROR = 0x1F /* ERROR_CLASS_PERM */
/* All the other values are reserved */
} RIL_CDMA_SMS_DeliveryStatusE;
typedef struct {
RIL_CDMA_SMS_ErrorClass error_class;
RIL_CDMA_SMS_DeliveryStatusE status;
} RIL_CDMA_SMS_DeliveryStatus;
typedef struct {
unsigned char address[RIL_CDMA_SMS_IP_ADDRESS_SIZE];
unsigned char is_valid;
} RIL_CDMA_SMS_IpAddress;
/* This special parameter captures any unrecognized/proprietary parameters
*/
typedef struct {
unsigned char input_other_len;
unsigned char desired_other_len; /* used during decoding */
unsigned char * other_data;
} RIL_CDMA_SMS_OtherParm;
typedef struct {
/* the mask indicates which fields are present in this message */
unsigned int mask;
RIL_CDMA_SMS_MessageId message_id;
RIL_CDMA_SMS_CdmaUserData user_data;
RIL_CDMA_SMS_UserResponse user_response;
RIL_CDMA_SMS_Timestamp mc_time;
RIL_CDMA_SMS_Timestamp validity_absolute;
RIL_CDMA_SMS_Timestamp validity_relative;
RIL_CDMA_SMS_Timestamp deferred_absolute;
RIL_CDMA_SMS_Timestamp deferred_relative;
RIL_CDMA_SMS_Priority priority;
RIL_CDMA_SMS_Privacy privacy;
RIL_CDMA_SMS_ReplyOption reply_option;
unsigned char num_messages; /* the actual value; not BCDs */
RIL_CDMA_SMS_AlertMode alert_mode;
/* For pre-IS-637A implementations, alert_mode is either Off or On. */
RIL_CDMA_SMS_Language language;
RIL_CDMA_SMS_Address callback;
RIL_CDMA_SMS_DisplayMode display_mode;
RIL_CDMA_SMS_DeliveryStatus delivery_status;
unsigned int deposit_index;
RIL_CDMA_SMS_IpAddress ip_address;
unsigned char rsn_no_notify;
/* See function comments of wms_ts_decode() and
** wms_ts_decode_cdma_bd_with_other() for details regarding 'other' parameters
*/
RIL_CDMA_SMS_OtherParm other;
} RIL_CDMA_SMS_ClientBd;
typedef struct {
unsigned char length; /* length, in bytes, of the encoded SMS message */
unsigned char * data; /* the encoded SMS message (max 255 bytes) */
} RIL_CDMA_Encoded_SMS;
#ifdef __cplusplus
}
#endif
#endif /*ANDROID_RIL_CDMA_SMS_H*/

48
ril/include/telephony/ril_msim.h

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
/*
* Copyright (C) 2014 The Android Open Source 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.
*/
#ifndef ANDROID_RIL_MSIM_H
#define ANDROID_RIL_MSIM_H 1
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
RIL_UICC_SUBSCRIPTION_DEACTIVATE = 0,
RIL_UICC_SUBSCRIPTION_ACTIVATE = 1
} RIL_UiccSubActStatus;
typedef enum {
RIL_SUBSCRIPTION_1 = 0,
RIL_SUBSCRIPTION_2 = 1,
RIL_SUBSCRIPTION_3 = 2
} RIL_SubscriptionType;
typedef struct {
int slot; /* 0, 1, ... etc. */
int app_index; /* array subscriptor from applications[RIL_CARD_MAX_APPS] in
RIL_REQUEST_GET_SIM_STATUS */
RIL_SubscriptionType sub_type; /* Indicates subscription 1 or subscription 2 */
RIL_UiccSubActStatus act_status;
} RIL_SelectUiccSub;
#ifdef __cplusplus
}
#endif
#endif /*ANDROID_RIL_MSIM_H*/

88
ril/include/telephony/ril_nv_items.h

@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
/*
* Copyright (C) 2014 The Android Open Source 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.
*/
#ifndef ANDROID_RIL_NV_ITEMS_H
#define ANDROID_RIL_NV_ITEMS_H 1
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Must match the values in RadioNVItems.java in frameworks/opt/telephony. */
typedef enum {
// CDMA radio and account information (items 1-10)
RIL_NV_CDMA_MEID = 1, // CDMA MEID (hex)
RIL_NV_CDMA_MIN = 2, // CDMA MIN (MSID)
RIL_NV_CDMA_MDN = 3, // CDMA MDN
RIL_NV_CDMA_ACCOLC = 4, // CDMA access overload control
// Carrier device provisioning (items 11-30)
RIL_NV_DEVICE_MSL = 11, // device MSL
RIL_NV_RTN_RECONDITIONED_STATUS = 12, // RTN reconditioned status
RIL_NV_RTN_ACTIVATION_DATE = 13, // RTN activation date
RIL_NV_RTN_LIFE_TIMER = 14, // RTN life timer
RIL_NV_RTN_LIFE_CALLS = 15, // RTN life calls
RIL_NV_RTN_LIFE_DATA_TX = 16, // RTN life data TX
RIL_NV_RTN_LIFE_DATA_RX = 17, // RTN life data RX
RIL_NV_OMADM_HFA_LEVEL = 18, // HFA in progress
// Mobile IP profile information (items 31-50)
RIL_NV_MIP_PROFILE_NAI = 31, // NAI realm
RIL_NV_MIP_PROFILE_HOME_ADDRESS = 32, // MIP home address
RIL_NV_MIP_PROFILE_AAA_AUTH = 33, // AAA auth
RIL_NV_MIP_PROFILE_HA_AUTH = 34, // HA auth
RIL_NV_MIP_PROFILE_PRI_HA_ADDR = 35, // primary HA address
RIL_NV_MIP_PROFILE_SEC_HA_ADDR = 36, // secondary HA address
RIL_NV_MIP_PROFILE_REV_TUN_PREF = 37, // reverse TUN preference
RIL_NV_MIP_PROFILE_HA_SPI = 38, // HA SPI
RIL_NV_MIP_PROFILE_AAA_SPI = 39, // AAA SPI
RIL_NV_MIP_PROFILE_MN_HA_SS = 40, // HA shared secret
RIL_NV_MIP_PROFILE_MN_AAA_SS = 41, // AAA shared secret
// CDMA network and band config (items 51-70)
RIL_NV_CDMA_PRL_VERSION = 51, // CDMA PRL version
RIL_NV_CDMA_BC10 = 52, // CDMA band class 10
RIL_NV_CDMA_BC14 = 53, // CDMA band class 14
RIL_NV_CDMA_SO68 = 54, // CDMA SO68
RIL_NV_CDMA_SO73_COP0 = 55, // CDMA SO73 COP0
RIL_NV_CDMA_SO73_COP1TO7 = 56, // CDMA SO73 COP1-7
RIL_NV_CDMA_1X_ADVANCED_ENABLED = 57, // CDMA 1X Advanced enabled
RIL_NV_CDMA_EHRPD_ENABLED = 58, // CDMA eHRPD enabled
RIL_NV_CDMA_EHRPD_FORCED = 59, // CDMA eHRPD forced
// LTE network and band config (items 71-90)
RIL_NV_LTE_BAND_ENABLE_25 = 71, // LTE band 25 enable
RIL_NV_LTE_BAND_ENABLE_26 = 72, // LTE band 26 enable
RIL_NV_LTE_BAND_ENABLE_41 = 73, // LTE band 41 enable
RIL_NV_LTE_SCAN_PRIORITY_25 = 74, // LTE band 25 scan priority
RIL_NV_LTE_SCAN_PRIORITY_26 = 75, // LTE band 26 scan priority
RIL_NV_LTE_SCAN_PRIORITY_41 = 76, // LTE band 41 scan priority
RIL_NV_LTE_HIDDEN_BAND_PRIORITY_25 = 77, // LTE hidden band 25 priority
RIL_NV_LTE_HIDDEN_BAND_PRIORITY_26 = 78, // LTE hidden band 26 priority
RIL_NV_LTE_HIDDEN_BAND_PRIORITY_41 = 79, // LTE hidden band 41 priority
} RIL_NV_Item;
#ifdef __cplusplus
}
#endif
#endif /* ANDROID_RIL_NV_ITEMS_H */

54
ril/libril/Android.mk

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
# Copyright 2006 The Android Open Source Project
# Copyright 2018 The LineageOS Project
ifeq ($(BOARD_PROVIDES_LIBRIL),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES:= \
ril.cpp \
ril_event.cpp\
RilSapSocket.cpp \
ril_service.cpp \
sap_service.cpp
LOCAL_SHARED_LIBRARIES := \
liblog \
libutils \
libcutils \
libhardware_legacy \
librilutils \
android.hardware.radio@1.0 \
android.hardware.radio@1.1 \
android.hardware.radio.deprecated@1.0 \
libhidlbase \
libhidltransport \
libhwbinder
LOCAL_STATIC_LIBRARIES := \
libprotobuf-c-nano-enable_malloc \
LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-parameter -Werror
ifeq ($(SIM_COUNT), 2)
LOCAL_CFLAGS += -DANDROID_MULTI_SIM -DDSDA_RILD1
LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2
endif
ifneq ($(DISABLE_RILD_OEM_HOOK),)
LOCAL_CFLAGS += -DOEM_HOOK_DISABLED
endif
LOCAL_C_INCLUDES += external/nanopb-c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include
LOCAL_MODULE:= libril
LOCAL_SANITIZE := integer
include $(BUILD_SHARED_LIBRARY)
endif # BOARD_PROVIDES_LIBRIL

0
ril/libril/MODULE_LICENSE_APACHE2

190
ril/libril/NOTICE

@ -0,0 +1,190 @@ @@ -0,0 +1,190 @@
Copyright (c) 2005-2008, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

295
ril/libril/RilSapSocket.cpp

@ -0,0 +1,295 @@ @@ -0,0 +1,295 @@
/*
* Copyright (C) 2014 The Android Open Source 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.
*/
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#define RIL_SHLIB
#include "telephony/ril.h"
#include "RilSapSocket.h"
#include "pb_decode.h"
#include "pb_encode.h"
#undef LOG_TAG
#define LOG_TAG "RIL_UIM_SOCKET"
#include <utils/Log.h>
#include <arpa/inet.h>
#include <errno.h>
#include <sap_service.h>
static RilSapSocket::RilSapSocketList *head = NULL;
extern "C" void
RIL_requestTimedCallback (RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime);
struct RIL_Env RilSapSocket::uimRilEnv = {
.OnRequestComplete = RilSapSocket::sOnRequestComplete,
.OnUnsolicitedResponse = RilSapSocket::sOnUnsolicitedResponse,
.RequestTimedCallback = RIL_requestTimedCallback
};
void RilSapSocket::sOnRequestComplete (RIL_Token t,
RIL_Errno e,
void *response,
size_t responselen) {
RilSapSocket *sap_socket;
SapSocketRequest *request = (SapSocketRequest*) t;
RLOGD("Socket id:%d", request->socketId);
sap_socket = getSocketById(request->socketId);
if (sap_socket) {
sap_socket->onRequestComplete(t,e,response,responselen);
} else {
RLOGE("Invalid socket id");
if (request->curr) {
free(request->curr);
}
free(request);
}
}
#if defined(ANDROID_MULTI_SIM)
void RilSapSocket::sOnUnsolicitedResponse(int unsolResponse,
const void *data,
size_t datalen,
RIL_SOCKET_ID socketId) {
RilSapSocket *sap_socket = getSocketById(socketId);
if (sap_socket) {
sap_socket->onUnsolicitedResponse(unsolResponse, (void *)data, datalen);
}
}
#else
void RilSapSocket::sOnUnsolicitedResponse(int unsolResponse,
const void *data,
size_t datalen) {
RilSapSocket *sap_socket = getSocketById(RIL_SOCKET_1);
if(sap_socket){
sap_socket->onUnsolicitedResponse(unsolResponse, (void *)data, datalen);
}
}
#endif
void RilSapSocket::printList() {
RilSapSocketList *current = head;
RLOGD("Printing socket list");
while(NULL != current) {
RLOGD("SocketName:%s",current->socket->name);
RLOGD("Socket id:%d",current->socket->id);
current = current->next;
}
}
RilSapSocket *RilSapSocket::getSocketById(RIL_SOCKET_ID socketId) {
RilSapSocket *sap_socket;
RilSapSocketList *current = head;
RLOGD("Entered getSocketById");
printList();
while(NULL != current) {
if(socketId == current->socket->id) {
sap_socket = current->socket;
return sap_socket;
}
current = current->next;
}
return NULL;
}
void RilSapSocket::initSapSocket(const char *socketName,
const RIL_RadioFunctions *uimFuncs) {
if (strcmp(socketName, RIL1_SERVICE_NAME) == 0) {
if(!SocketExists(socketName)) {
addSocketToList(socketName, RIL_SOCKET_1, uimFuncs);
}
}
#if (SIM_COUNT >= 2)
if (strcmp(socketName, RIL2_SERVICE_NAME) == 0) {
if(!SocketExists(socketName)) {
addSocketToList(socketName, RIL_SOCKET_2, uimFuncs);
}
}
#endif
#if (SIM_COUNT >= 3)
if (strcmp(socketName, RIL3_SERVICE_NAME) == 0) {
if(!SocketExists(socketName)) {
addSocketToList(socketName, RIL_SOCKET_3, uimFuncs);
}
}
#endif
#if (SIM_COUNT >= 4)
if (strcmp(socketName, RIL4_SERVICE_NAME) == 0) {
if(!SocketExists(socketName)) {
addSocketToList(socketName, RIL_SOCKET_4, uimFuncs);
}
}