forked from Grouper-AOSP/platform_manifest
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathhardware_ril.patch
70 lines (65 loc) · 2.89 KB
/
hardware_ril.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
diff --git a/libril/ril.cpp b/libril/ril.cpp
index d7744c0..bba8e0c 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -3698,6 +3698,7 @@ static int responseSSData(Parcel &p, void *response, size_t responselen) {
p.writeInt32(p_cur->teleserviceType);
p.writeInt32(p_cur->serviceClass);
p.writeInt32(p_cur->result);
+ p.writeInt32(-1);
if (isServiceTypeCfQuery(p_cur->serviceType, p_cur->requestType)) {
RLOGD("responseSSData CF type, num of Cf elements %d", p_cur->cfData.numValidIndexes);
@@ -3804,6 +3805,7 @@ static void responseSimStatusV5(Parcel &p, void *response) {
p.writeInt32(p_cur->universal_pin_state);
p.writeInt32(p_cur->gsm_umts_subscription_app_index);
p.writeInt32(p_cur->cdma_subscription_app_index);
+ p.writeInt32(-1);
sendSimStatusAppInfo(p, p_cur->num_applications, p_cur->applications);
}
@@ -4419,12 +4421,12 @@ static void debugCallback (int fd, short flags, void *param) {
int data;
unsigned int qxdm_data[6];
const char *deactData[1] = {"1"};
- char *actData[1];
RIL_Dial dialData;
int hangupData[1] = {1};
int number;
char **args;
RIL_SOCKET_ID socket_id = RIL_SOCKET_1;
+ int MAX_DIAL_ADDRESS = 128;
int sim_id = 0;
RLOGI("debugCallback for socket %s", rilSocketIdToString(socket_id));
@@ -4571,12 +4573,6 @@ static void debugCallback (int fd, short flags, void *param) {
// Set network selection automatic.
issueLocalRequest(RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC, NULL, 0, socket_id);
break;
- case 6:
- RLOGI("Debug port: Setup Data Call, Apn :%s\n", args[1]);
- actData[0] = args[1];
- issueLocalRequest(RIL_REQUEST_SETUP_DATA_CALL, &actData,
- sizeof(actData), socket_id);
- break;
case 7:
RLOGI("Debug port: Deactivate Data Call");
issueLocalRequest(RIL_REQUEST_DEACTIVATE_DATA_CALL, &deactData,
@@ -4585,6 +4581,12 @@ static void debugCallback (int fd, short flags, void *param) {
case 8:
RLOGI("Debug port: Dial Call");
dialData.clir = 0;
+ if (strlen(args[1]) > MAX_DIAL_ADDRESS) {
+ RLOGE("Debug port: Error calling Dial");
+ freeDebugCallbackArgs(number, args);
+ close(acceptFD);
+ return;
+ }
dialData.address = args[1];
issueLocalRequest(RIL_REQUEST_DIAL, &dialData, sizeof(dialData), socket_id);
break;
@@ -5401,6 +5403,9 @@ void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
p.writeInt32(newState);
appendPrintBuf("%s {%s}", printBuf,
radioStateToString(CALL_ONSTATEREQUEST(soc_id)));
+ if (newState == RADIO_STATE_UNAVAILABLE) {
+ abort(); // kill rild process
+ }
break;