#include <FBase.h>
#include <FSystem.h>
#include <FMedia.h>
+#include "ITapiCall.h"
#include "sound_manager.h"
#include "vconf.h"
#include "vconf-keys.h"
Timer* GetTimer();
bool GetLastConferenceCall();
void SetlastEndedConferenceCall();
+ result SetSoundPath(bool bSpeaker=false);
+ static void HandleCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData){}
protected:
virtual void OnPlayerOpened(result r);
static void HandleSplitFromConferenceCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData);
//callback function for Ending conference call
static void HandleEndConferenceCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData);
+ //Called when bluetooth connection state changes
+ static void OnBluetoothStateChange(keynode_t *node, void *user_data);
//Check if MOCall is emergency number and returns true. Otherwise, false.
bool CheckIfMOCallIsEmergency(const Tizen::Base::String& contactNumber, bool isSimInitialized);
//Check is modem and sim are initialised successfully and MO call can be made.
bool IsIncomingorDialingCallPresent(void);
//Function to make out going call when hold is succesful on the active call
void CheckPendingDialCalls(int callBackResult);
+ TapiHandle* GetTapiHandle(void);
+ void SetSoundPath(void);
protected:
//function to handle the idle callback(received when call is ended)
case FORMTYPE_ACTIVECALL:
{
String pContactNumber;
- pContactNumber.Append(__pActiveCallInfo->GetContactNumber());
- Contact* pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
- if(pContact == null)
+ if(__pActiveCallInfo->GetContactNumber().IsEmpty() == false)
{
- __pActiveCallInfo->ResetContactNumber(null);
- __pActiveCallInfo->ResetContactInfo(null);
+ pContactNumber.Append(__pActiveCallInfo->GetContactNumber());
+ Contact* pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
+ if(pContact == null)
+ {
+ __pActiveCallInfo->ResetContactNumber(null);
+ __pActiveCallInfo->ResetContactInfo(null);
+ }
+ else
+ {
+ __pActiveCallInfo->SetContactNumber(pContactNumber);
+ __pActiveCallInfo->SetContactInfo(*pContact);
+ }
+ if(pContact != null)
+ {
+ delete pContact;
+ pContact = null;
+ }
+ ShowPersonDetails(pContactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
}
- else
- {
- __pActiveCallInfo->SetContactNumber(pContactNumber);
- __pActiveCallInfo->SetContactInfo(*pContact);
- }
- if(pContact != null)
- {
- delete pContact;
- pContact = null;
- }
- ShowPersonDetails(pContactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
}
break;
}
*__pActiveCallInfo = callInfo;
String contactNumber;
- contactNumber.Append(__pActiveCallInfo->GetContactNumber());
- pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
- if(pContact == null)
+ if(__pActiveCallInfo->GetContactNumber().IsEmpty() == false)
{
- __pActiveCallInfo->ResetContactNumber(null);
- __pActiveCallInfo->ResetContactInfo(null);
+ contactNumber.Append(__pActiveCallInfo->GetContactNumber());
+ pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
+ if(pContact == null)
+ {
+ __pActiveCallInfo->ResetContactNumber(null);
+ __pActiveCallInfo->ResetContactInfo(null);
- }
- else
- {
- __pActiveCallInfo->SetContactNumber(contactNumber);
- __pActiveCallInfo->SetContactInfo(*pContact);
- }
- if(pContact != null)
- {
- delete pContact;
- pContact = null;
- }
- if(callInfo.IsConferenceCall() == true)
- {
- continue;
- }
- if(callInfo.IsOnHold() == false)
- {
- ShowPersonDetails(contactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
- }
- else
- {
- ShowPersonDetails(contactNumber, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pActiveCallInfo);
+ }
+ else
+ {
+ __pActiveCallInfo->SetContactNumber(contactNumber);
+ __pActiveCallInfo->SetContactInfo(*pContact);
+ }
+ if(pContact != null)
+ {
+ delete pContact;
+ pContact = null;
+ }
+ if(callInfo.IsConferenceCall() == true)
+ {
+ continue;
+ }
+ if(callInfo.IsOnHold() == false)
+ {
+ ShowPersonDetails(contactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
+ }
+ else
+ {
+ ShowPersonDetails(contactNumber, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pActiveCallInfo);
+ }
}
}
BaseForm::~BaseForm(void)
{
+ AppLogDebug("Enter");
+ if(__pErrorMsgPopup != null)
+ {
+ delete __pErrorMsgPopup;
+ __pErrorMsgPopup = null;
+ }
}
result
* @brief Sound manager class
*/
#include "CallSoundManager.h"
+#include "CallTelephonyManager.h"
+#include "vconf.h"
using namespace Tizen::Base;
using namespace Tizen::Graphics;
sound_manager_set_active_route((sound_route_e)SOUND_ROUTE_IN_MIC_OUT_RECEIVER);
//todo start listening for volume key and set the volume
sound_manager_set_volume((sound_type_e)SOUND_TYPE_CALL,5);
+ //
+ SetSoundPath();
return E_SUCCESS;
}
result
+SoundManager::SetSoundPath(bool bSpeaker)
+{
+ AppLogDebug("Enter");
+ int btStatus;
+ TelCallSoundPathInfo_t callSoundPathInfo;
+ sound_route_e soundRoute;
+ bool isEarJackPresent = IsEarJackConnected();
+ vconf_get_int(VCONFKEY_BT_HEADSET_SCO,&btStatus);
+ if(btStatus == VCONFKEY_BT_SCO_CONNECT)
+ {
+ AppLogDebug("Routing audio input and output to bluetooth SCO");
+ callSoundPathInfo.path = TAPI_SOUND_PATH_BLUETOOTH;
+ soundRoute = SOUND_ROUTE_INOUT_BLUETOOTH;
+ }
+ else
+ {
+ if(bSpeaker == false)
+ {
+ if (isEarJackPresent == true)
+ {
+ AppLogDebug("Routing audio input to device builtin mic and routing audio output to headphone");
+ soundRoute = SOUND_ROUTE_IN_MIC_OUT_HEADPHONE;
+ callSoundPathInfo.path = TAPI_SOUND_PATH_HEADSET;
+ }
+ else
+ {
+ AppLogDebug("Routing audio input to device builtin mic and routing audio output to builtin receiver");
+ soundRoute = SOUND_ROUTE_IN_MIC_OUT_RECEIVER;
+ callSoundPathInfo.path = TAPI_SOUND_PATH_HANDSET;
+ }
+ }
+ else
+ {
+ AppLogDebug("Routing audio input to device builtin mic and routing audio output to builtin speaker");
+ soundRoute = SOUND_ROUTE_IN_MIC_OUT_SPEAKER;
+ callSoundPathInfo.path = TAPI_SOUND_PATH_SPK_PHONE;
+ }
+
+ }
+ callSoundPathInfo.ex_volume = TelCallSoundPathInfo_t::TAPI_SOUND_EX_VOLUME_ON;
+
+ int res = tel_set_call_sound_path(TelephonyManager::GetInstance(null)->GetTapiHandle(), &callSoundPathInfo, &HandleCallbackResponse, this);
+ TryReturn(res == TAPI_CAUSE_SUCCESS,E_FAILURE, "[%d] tel_set_call_sound_path failed",res );
+
+ res = sound_manager_set_active_route(soundRoute);
+ TryReturn(res == SOUND_MANAGER_ERROR_NONE,E_FAILURE, "[%d] sound_manager_set_active_route failed",res );
+
+ return E_SUCCESS;
+ AppLogDebug("Exit");
+}
+
+result
SoundManager::SetSpeakerStatus(bool setSpeaker)
{
result r = E_FAILURE;
delete __pManager;
__pManager = null;
}
+ vconf_ignore_key_changed(VCONFKEY_BT_HEADSET_SCO,TelephonyManager::OnBluetoothStateChange);
AppLogDebug("Exit");
}
{
__pNetworkManager->Construct(this);
}
+ vconf_notify_key_changed(VCONFKEY_BT_HEADSET_SCO,TelephonyManager::OnBluetoothStateChange,this);
AppLogDebug("Exit");
return r;
}
TelephonyManager::SetSpeakerStatus(bool setSpeaker)
{
AppLogDebug("Enter");
- result r = E_FAILURE;
+
+ result res = __pSoundManager->SetSoundPath(setSpeaker);
+ TryReturn(res==E_SUCCESS,E_FAILURE,"SetSoundPath failed");
+ __isSpeakerOn = setSpeaker;
+ return E_SUCCESS;
+ /*result r = E_FAILURE;
TelCallSoundPathInfo_t callSoundPathInfo;
__pSoundManager->SetSpeakerStatus(setSpeaker);
if (setSpeaker == true)
r = E_FAILURE;
}
AppLogDebug("Exit");
- return r;
+ return r;*/
}
bool
}
}
+
+TapiHandle*
+TelephonyManager::GetTapiHandle(void)
+{
+ return __pTapiHandle;
+}
+
+void
+TelephonyManager::SetSoundPath(void)
+{
+ if(GetCurrentCallCount() > 0 && IsIncomingorDialingCallPresent() == true)
+ {
+ __pSoundManager->SetSoundPath();
+ }
+
+}
+
+void
+TelephonyManager::OnBluetoothStateChange(keynode_t *node, void *user_data)
+{
+ AppLogDebug("Enter");
+ TelephonyManager* pTelMgr = (TelephonyManager*)user_data;
+ pTelMgr->SetSoundPath();
+}