Fixed nabi issues 36791 36868 36881 36879 36280 36808 36332
[apps/osp/Call.git] / src / CallTelephonyManager.cpp
index f3d821b..8e0d355 100644 (file)
@@ -1281,6 +1281,21 @@ TelephonyManager::HandleDialCallbackResponse(TapiHandle* pHandle, int callBackRe
                        delete pTelManager->__pDialedCall;
                        pTelManager->__pDialedCall = null;
                }
+
+               //Check if there are no active connected calls and no incoming call.
+               if (pTelManager->__pIncomingCall != null)
+               {
+                       pTelManager->__pSettingsManager->SetCallState(CALL_STATE_CALL_VOICE_CONNECTING);
+               }
+               else if (pTelManager->GetCurrentCallCount() >= 1)
+               {
+                       pTelManager->__pSettingsManager->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
+               }
+               else
+               {
+                       pTelManager->__pSettingsManager->SetCallState(CALL_STATE_CALL_OFF);
+               }
+
                pTelManager->__pEventListener->HandleTelephonyError(ERROR_DIAL_FAILED);
        }
 }
@@ -2182,11 +2197,14 @@ TelephonyManager::CheckIncomingCallToBeRejected(AppCallInfo* pIncomingCallInfo)
        contactNumber.Append(pIncomingCallInfo->GetContactNumber());
        //Check if "reject unknown calls" is set and contact number is not present in AddressBook
        //or if contact number is blacklisted
-       if (((__pSettingsManager->GetUnknownRejectStatus() == true) && (pIncomingCallInfo->GetContactInfo() == null))
-                       || (__pSettingsManager->IsCallToBeRejected(contactNumber) == true))
+       if(__pSettingsManager != null)
        {
-               AnswerAutoRejectCall(callHandle);
-               return true;
+               if (((__pSettingsManager->GetUnknownRejectStatus() == true) && (pIncomingCallInfo->GetContactInfo() == null))
+                               || (__pSettingsManager->IsCallToBeRejected(contactNumber) == true))
+               {
+                       AnswerAutoRejectCall(callHandle);
+                       return true;
+               }
        }
        return false;
 }