Merge "[BugFix][T106BUG-3] Resolve ril issue service exceptions"
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp
index 2dc75d1..001a320 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/common.cpp
@@ -565,8 +565,14 @@
             cur_CardS_Status[slot]->applications[i].pin1            = card_status->applications[i].pin1;
             cur_CardS_Status[slot]->applications[i].pin1_replaced   = card_status->applications[i].pin1_replaced;
             cur_CardS_Status[slot]->applications[i].pin2            = card_status->applications[i].pin2;
-            cur_CardS_Status[slot]->applications[i].aid_ptr = strdup(card_status->applications[i].aid_ptr);
-            cur_CardS_Status[slot]->applications[i].app_label_ptr = strdup(card_status->applications[i].app_label_ptr);
+            if(card_status->applications[i].aid_ptr != NULL
+                 && card_status->applications[i].app_label_ptr != NULL)
+            {
+                cur_CardS_Status[slot]->applications[i].aid_ptr 
+                     = strdup(card_status->applications[i].aid_ptr);
+                cur_CardS_Status[slot]->applications[i].app_label_ptr 
+                    = strdup(card_status->applications[i].app_label_ptr);
+            }
         }
     } else {
         RLOGD("[slot%d]updateCardStatusV6: sim card message is null", slot);
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/makefile b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/makefile
index b0c76d3..1bc3a6b 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/makefile
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/makefile
@@ -27,11 +27,13 @@
     LOCAL_CFLAGS += -DC2K_SUPPORT
 endif
 
+ifeq ($(strip $(TARGET_PLATFORM)), T800)
 ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
     LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
                      -DANDROID_MULTI_SIM \
                      -DMODE_DSDS
 endif
+endif
 
 ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
     LOCAL_CFLAGS += -DMODE_DSSS
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp
index 8394830..5165be1 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/ril.cpp
@@ -4087,7 +4087,10 @@
     }
 #endif
 
+#if defined(ANDROID_MULTI_SIM) 
     socket_id = pRI->socket_id;
+#endif 
+
 #if 0
 #if (SIM_COUNT >= 2)
     if (socket_id == RIL_SOCKET_2) {