[BugFix][T106BUG-3] Resolve ril issue service exceptions

Change-Id: Ib5a593a2f73840d18373c6aee4021449d4153915
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..e63b046 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,12 @@
             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..1ad54c8 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/makefile
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/makefile
@@ -27,9 +27,13 @@
     LOCAL_CFLAGS += -DC2K_SUPPORT
 endif
 
+ifeq ($(strip $(TARGET_PLATFORM)), T800)
+LOCAL_CFLAGS += -DANDROID_MULTI_SIM
+endif 
+
+
 ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
     LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
-                     -DANDROID_MULTI_SIM \
                      -DMODE_DSDS
 endif
 
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..6c1c84a 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,11 @@
     }
 #endif
 
+#if defined(ANDROID_MULTI_SIM) 
+
     socket_id = pRI->socket_id;
+#endif
+
 #if 0
 #if (SIM_COUNT >= 2)
     if (socket_id == RIL_SOCKET_2) {