bool CheckSimInitializationIsCompleted();
//This function returns true, if contact number is emergency no.
bool IsEmergencyNumber(const Tizen::Base::String& phoneNumber, bool isSimInitialized);
+ //Resume the alert when there is an incoming call and the already active call is disconnected
+ void ResumeAlert(AppCallInfo& incomingCallInfo);
//Start the alert in case of incoming call
void StartAlert(AppCallInfo& incomingCallInfo);
//Stop the alert in case of incoming call
void StopAlert(void);
+ //returns the incoming call handle
+ AppCallInfo* GetIncomingCallHandle();
//Gets the contact for the given phonenumber.returns null if not present.
Tizen::Social::Contact* GetContactN(const Tizen::Base::String& phoneNumber);
//Fetch the incoming call details.
void AppControlRequestCompleted(void);
//Used to send message
void SendMessage(Tizen::Base::String& strMsg,Tizen::Base::String& recpientNum);
+ //Used to show sms error
+ void ShowSMSErrorNotification(void);
//Checks if message sending is in progress
bool IsMessageSendingInProgress(void);
Tizen::Telephony::SimStateManager* __psimStateManager;
Tizen::Telephony::SimInfo* __psimInfo;
Tizen::Messaging::SmsManager* __pSmsManager;
+ Tizen::Shell::NotificationManager* __pNotificationManager;
};
#endif // _PHN_CALL_PRESENTATION_MODEL_H_
//Set the sound mode for the call
result SetSoundMode(SoundMode soundMode);
void StartAlert(Tizen::Base::String& contactRingTone);
+ void ResumeAlert(Tizen::Base::String& contactRingTone);
void StopAlert(void);
//set connect tone
void SetConnectTone(void);
int GetCurrentCallCount(void);
//Start the alert in case of incoming call
void StartAlert(AppCallInfo& incomingCallInfo);
+ //Resume the alert when there is an incoming call and the already active call is disconnected
+ void ResumeAlert(AppCallInfo& incomingCallInfo);
+ //returns the incoming call handle
+ AppCallInfo* GetIncomingCallHandle();
//Stop the alert in case of incoming call
void StopAlert(void);
//Main Callback function used while registering to TAPI
extern const wchar_t* IDS_CONFERENCE_CALL_STRING;
extern const wchar_t* IDS_CALL_REJECT_FROM_STRING;
extern const wchar_t* IDS_CALL_REJECTED_TITLE_STRING;
+extern const wchar_t* IDS_MESSAGE_SENDING_FAILED;
//Panel
extern const wchar_t* PANEL_DIALER;
extern const wchar_t* PANEL_LOGS;
<Privileges>
<Privilege>http://tizen.org/privilege/uimanager</Privilege>
<Privilege>http://tizen.org/privilege/application.launch</Privilege>
+ <Privilege>http://tizen.org/privilege/notification</Privilege>
<Privilege>http://tizen.org/privilege/power</Privilege>
<Privilege>http://tizen.org/privilege/appusage</Privilege>
<Privilege>http://tizen.org/privilege/lockmanager</Privilege>
- <Privilege>http://tizen.org/privilege/telephony</Privilege>
<Privilege>http://tizen.org/privilege/messaging.write</Privilege>
+ <Privilege>http://tizen.org/privilege/telephony</Privilege>
<Privilege>http://tizen.org/privilege/vibrator</Privilege>
<Privilege>http://tizen.org/privilege/contact.read</Privilege>
</Privileges>
<text id="IDS_END_CONFCALL_BUTTON">End Call</text>
<text id="IDS_CALL_REJECT_FROM_STRING">Call Rejected From</text>
<text id="IDS_CALL_REJECTED_TITLE_STRING">Call Rejected</text>
+ <text id="IDS_MESSAGE_SENDING_FAILED">Message Sending failed</text>
</string_table>
void
ActiveCallForm::ShowDTMFKeypad(void)
{
+ if(__pDTMFKeypad == null)
+ {
+ Rectangle rect(0, 0, 0, 0);
+ if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+ {
+ rect.width = GetClientAreaBounds().width;
+ rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
+ }
+ else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ {
+ rect.height = GetClientAreaBounds().height;
+ rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
+ }
+
+ AppLog("DTMF Keypad rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
+ __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
+ __pDTMFKeypad->Initialize(this, rect);
+ //set layout relation w.r.t call buttons panel
+ RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
+ if (pRelativeLayout != null)
+ {
+ pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+ pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
+ }
+ AddControl(__pDTMFKeypad);
+ }
EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
__pDTMFKeypad->SetShowState(true);
__pDTMFKeypad->Draw(true);
//Initialize keypad and buttons
InitializeCallButtonsPanel();
- if(__pDTMFKeypad == null)
- {
- Rectangle rect(0, 0, 0, 0);
- if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
- {
- rect.width = GetClientAreaBounds().width;
- rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
- }
- else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- rect.height = GetClientAreaBounds().height;
- rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
- }
-
- AppLog("DTMF Keypad rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
- __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
- __pDTMFKeypad->Initialize(this, rect);
- //set layout relation w.r.t call buttons panel
- RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
- if (pRelativeLayout != null)
- {
- pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
- pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
- }
- AddControl(__pDTMFKeypad);
- }
-
AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
__pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
if(__pAddressbook != null)
CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
pCallApp->SetTopMostWindow(false);
+ __pCallPresentor->OnAppForeground();
}
void
void
CallApp::OnForeground(void)
{
+ AppLogDebug("Enter");
+ // We should not treat foreground when autorejected pop-up as actually foreground
+ //when appcontrol is running as appcontrol is still not completed
+ if(__pCallRejectedIonPopup != null && CallPresentationModel::GetInstance()->IsAppControlRunning() == true)
+ {
+ return;
+ }
IEnumerator* pEnum = __listenerList.GetEnumeratorN();
while (pEnum->MoveNext() == E_SUCCESS)
{
}
else
{
+
ShowAutoRejectPopup(contactNumber);
+
}
}
//set success message
extraData.Construct();
extraData.Add(new (std::nothrow) String(PARAM_PHONE_NUMBER), new (std::nothrow) String(L""));
- __pOpenedAppControl = AppManager::FindAppControlN(PROVIDER_ID_PHONE, OPERATION_ID_DIAL);
+ __pOpenedAppControl = AppManager::FindAppControlN(PROVIDER_ID_PHONE, OPERATION_ID_CONFIGURE);
if (__pOpenedAppControl != null)
{
r = __pOpenedAppControl->Start(null, null, &extraData, pListener);
{
//goto multiple active call form
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
}
break;
pCallInfoList->Add(pCaller);
//single active call - goto active call form
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVE_EMERGENCYCALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
}
break;
if (1)
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ENDCALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
else
{
if (callInfo.IsConferenceCall() == true)
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
else
{
//goto Single Active Call form
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVECALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
}
}
{
//multiple active calls are present.
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
}
else
pCallInfoList->Add(pCaller);
//multiple active calls are present.
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ENDCALL,
- SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
else
pButtonReject->AddActionEventListener(*this);
pButtonReject->SetEnabled(true);
//pButtonReject->SetFocus();
+ FloatRectangle originalrect = pButtonReject->GetBoundsF();
+ FloatRectangle allignedrect = CoordinateSystem::AlignToDevice(pButtonReject->GetBoundsF());
+ pButtonReject->SetBounds(allignedrect);
+ pButtonReject->Invalidate(true);
ShowRejectMessageFooter();
if (pButtonRejectMessage)
{
pButtonRejectMessage->SetShowState(true);
+ FloatRectangle originalrect = pButtonRejectMessage->GetBoundsF();
+ FloatRectangle allignedrect = CoordinateSystem::AlignToDevice(pButtonRejectMessage->GetBoundsF());
+ pButtonRejectMessage->SetBounds(allignedrect);
+ pButtonRejectMessage->Invalidate(true);
RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
if (pRelativeLayout != null)
{
void
IncomingCallForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
{
+
+ Layout* pLayout = GetLayoutN();
+ if (pLayout != null)
+ {
+ pLayout->Update();
+ }
+
Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_REJECT_PANEL));
if(pKeysPanel->GetShowState() == true)
{
void
IncomingCallForm::CallDisconnected(void)
{
+
//check if no call option popup is shown, then remain on incoming call screen.
//As user has neither accepted nor rejected incoming call.
if ((__pOptionPopup == null) || (__pOptionPopup->GetShowState() == false))
{
+ //Resume the alert when there is an incoming call and the already active call is disconnected
+ //Here we start playing the ringtone again
+ AppCallInfo* pIncomingCall = __pCallPresentor->GetIncomingCallHandle();
+ if(pIncomingCall != null)
+ {
+ __pCallPresentor->ResumeAlert(*pIncomingCall);
+ }
return;
}
__pOptionPopup->SetShowState(true);
__pOptionPopup->Draw();
__pOptionPopup->Show();
+ AppCallInfo* pIncomingCall = __pCallPresentor->GetIncomingCallHandle();
+ if(pIncomingCall != null)
+ {
+ //Resume the alert when there is an incoming call and the already active call is disconnected
+ //Here we start playing the ringtone again
+ __pCallPresentor->ResumeAlert(*pIncomingCall);
+ }
}
pCallList->RemoveAll();
}
#include <FApp.h>
#include <FUi.h>
#include <FMedia.h>
+#include <FShell.h>
#include "CallApp.h"
#include "CallAppControlRequestMgr.h"
#include "CallActiveCallForm.h"
+#include "CallAppUtility.h"
#include "CallInfo.h"
#include "CallPresentationModel.h"
#include "CallSettingsPresentationModel.h"
using namespace Tizen::Telephony;
using namespace Tizen::Base::Utility;
using namespace Tizen::Messaging;
+using namespace Tizen::Shell;
CallPresentationModel* CallPresentationModel::__pInstance = null;
__psimInfo = null;
__pSmsManager = null;
__isMessageSendInProgress = false;
+ __pNotificationManager = null;
}
CallPresentationModel::~CallPresentationModel(void)
__pAppControlMgr = CallAppControlRequestMgr::GetInstance();
__pNetworkManager = new (std::nothrow)NetworkManager();
__pNetworkManager->Construct(null);
+ __pNotificationManager = new (std::nothrow) Tizen::Shell::NotificationManager;
+ __pNotificationManager->Construct();
GetSimInfo();
return E_SUCCESS;
}
}
void
+CallPresentationModel::ResumeAlert(AppCallInfo& incomingCallInfo)
+{
+ //Adding incoming call sate setting here
+ if(__pSettingsPresentor != null)
+ {
+ __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_CONNECTING);
+ }
+ __pTelephonyMgr->ResumeAlert(incomingCallInfo);
+}
+
+void
CallPresentationModel::StartAlert(AppCallInfo& incomingCallInfo)
{
//Adding incoming call sate setting here
__pTelephonyMgr->StartAlert(incomingCallInfo);
}
+AppCallInfo*
+CallPresentationModel::GetIncomingCallHandle()
+{
+ return __pTelephonyMgr->GetIncomingCallHandle();
+}
+
void
CallPresentationModel::StopAlert(void)
{
{
__isMessageSendInProgress = true;
}
+ else
+ {
+ AppLogDebug("%s",GetErrorMessage(r));
+ ShowSMSErrorNotification();
+ }
+
+ }
+}
+
+void
+CallPresentationModel::ShowSMSErrorNotification(void)
+{
+ NotificationRequest request;
+ String alertString = AppUtility::GetResourceString(IDS_MESSAGE_SENDING_FAILED);
+ request.SetAlertText(L" ");
+ request.SetTitleText(L"\n"+alertString);
+ request.SetNotificationStyle(NOTIFICATION_STYLE_NORMAL);
+ request.SetNotificationCountText(alertString.GetLength());
+
+
+ String resourcePath = App::GetInstance()->GetAppSharedPath() + L"res/";
+
+ String iconPath = resourcePath + L"messages.png";
+ request.SetIconFilePath(iconPath);
+
+ int badgeNumber = __pNotificationManager->GetBadgeNumber();
+ ++badgeNumber;
+ if (badgeNumber <= 0)
+ {
+ badgeNumber = 1;
}
+ request.SetBadgeNumber(badgeNumber);
+ __pNotificationManager->Notify(request);
+ __pNotificationManager->RemoveNotification();
}
bool
: __pSoundCallSession(null)
, __pVibrator(null)
, __pPlayer(null)
- , __lastEndedConferenceCall(false)
- , __pConnectPlayer(null)
, __pDisconnectPlayer(null)
+ , __pConnectPlayer(null)
, __pReminderPlayer(null)
, __pWaitingTonePlayer(null)
+ , __lastEndedConferenceCall(false)
{
__timer.Construct(*this);
__isSoundStatusOn = false;
}
void
+SoundManager::ResumeAlert(String& contactRingTone)
+{
+ result res = E_FAILURE;
+ IntensityDurationVibrationPattern vibration;
+ vibration.duration = 3000;
+ vibration.intensity = -1;
+ AppLogDebug("Enter");
+ /* if(__pWaitingTonePlayer != null)
+ {
+ if(__pWaitingTonePlayer->GetState() == PLAYER_STATE_PLAYING)
+ {
+ __pWaitingTonePlayer->Stop();
+ }
+ }*/
+ StopAlert();
+ if(__pSoundCallSession == null)
+ {
+ StartSession();
+ }
+ if(__pVibrator == null)
+ {
+ __pVibrator = new (std::nothrow) Vibrator();
+ res = __pVibrator->Construct();
+ if(res != E_SUCCESS)
+ {
+ AppLogDebug("__pVibrator Construct failed with %d",res);
+ return;
+ }
+ }
+ if(__pPlayer == null)
+ {
+ __pPlayer = new (std::nothrow) Player();
+ res = __pPlayer->Construct(*this);
+ if(res != E_SUCCESS)
+ {
+ AppLogDebug("__pPlayer Construct failed with %d",res);
+ delete __pPlayer;
+ __pPlayer = null;
+ return;
+ }
+ }
+ int retVal = -1;
+ vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &retVal);
+ __isSoundStatusOn = retVal;
+ vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &retVal);
+ __isVibrateStatusOn = retVal;
+ //todo: do only if call alert mode is set
+ if (__isSoundStatusOn == true)
+ {
+ String ringTonePath;
+ //Check if contact has any custom ringtone, else play defautl ringtone.
+ if(contactRingTone.IsEmpty() == true)
+ {
+ char* pRingTonePtr = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR);
+ AppLog("Ringtone Path : %s",pRingTonePtr);
+ ringTonePath.Append(pRingTonePtr);
+ }
+ else
+ {
+ AppLog("Ringtone Path : %ls",contactRingTone.GetPointer());
+ ringTonePath.Append(contactRingTone);
+ }
+
+ //Check if file is present
+ File file;
+ res = file.Construct(ringTonePath, "r");
+ if(res != E_SUCCESS )
+ {
+ ringTonePath.Clear();
+ ringTonePath.Append(RINGTONE_PATH);
+ }
+
+ res = __pPlayer->OpenFile(ringTonePath,false);
+ if(res != E_SUCCESS)
+ {
+ AppLogDebug("__pPlayer OpenFile failed with %d",res);
+ return;
+ }
+ res = __pPlayer->SetLooping(true);
+ if(res != E_SUCCESS)
+ {
+ AppLogDebug("__pPlayer SetLooping failed with %d",res);
+ return;
+ }
+ res = __pPlayer->SetVolume(80);
+ if(res != E_SUCCESS)
+ {
+ AppLogDebug("__pPlayer SetVolume failed with %d",res);
+ return;
+ }
+ res = SetSoundMode(SOUND_MODE_RINGTONE);
+ res = __pPlayer->Play();
+ if(res != E_SUCCESS)
+ {
+ AppLogDebug("__pPlayer Play failed with %d",res);
+ return;
+ }
+ }
+ if (__isVibrateStatusOn == true)
+ {
+ //todo: Get the level from settings
+ __pVibrator->Start(&vibration, 1, 1000);
+ }
+ AppLogDebug("Exit");
+ return;
+}
+
+void
SoundManager::StartAlert(String& contactRingTone)
{
result res = E_FAILURE;
TelephonyManager::~TelephonyManager(void)
{
+ AppLogDebug("Enter");
if (__pActiveCallList != null)
{
delete __pActiveCallList;
{
__pCalllogMgr = null;
}
+ AppLogDebug("Exit");
}
TelephonyManager*
TelephonyManager::GetInstance(ITelephonyEventListener* pEventListener)
{
+ AppLogDebug("Enter");
if (__pManager == null)
{
CreateInstance(pEventListener);
}
return __pManager;
+ AppLogDebug("Exit");
}
void
TelephonyManager::CreateInstance(ITelephonyEventListener* pEventListener)
{
+ AppLogDebug("Enter");
__pManager = new (std::nothrow) TelephonyManager(pEventListener);
result r = __pManager->Initialize();
if (IsFailed(r))
__pManager = null;
}
atexit(&(TelephonyManager::DestroyInstance));
+ AppLogDebug("Exit");
}
void
TelephonyManager::DestroyInstance(void)
{
+ AppLogDebug("Enter");
if (__pManager != null)
{
__pManager->EndAllCalls();
delete __pManager;
__pManager = null;
}
+ AppLogDebug("Exit");
}
result
TelephonyManager::Initialize(void)
{
+ AppLogDebug("Enter");
//Initialize telephony library
result r = InitializeTelephonyLibrary();
if (IsFailed(r))
{
__pNetworkManager->Construct(this);
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::InitializeTelephonyLibrary(void)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
__pTapiHandle = tel_init(null);
}
}
//TAPI Library is initialized and events registered successfully
+ AppLogDebug("Exit");
return r;
}
int
TelephonyManager::RegisterEvents(void)
{
+ AppLogDebug("Enter");
int errCode = -1;
int eventCount = sizeof(callEventList) / sizeof(char *);
for (int index = 0; index < eventCount; index++)
return errCode;
}
}
+ AppLogDebug("Exit");
return errCode;
}
void
TelephonyManager::UnregisterEvents(void)
{
+ AppLogDebug("Enter");
int eventCount = sizeof(callEventList) / sizeof(char *);
for (int index = 0; index < eventCount; index++)
{
tel_deregister_noti_event(__pTapiHandle, callEventList[index]);
}
+ AppLogDebug("Exit");
}
ErrorCodes
res = CheckValidTelePhoneNumber(contactNumber);
if (IsFailed(res))
{
+ AppLogDebug("ERROR_INVALID_NUMBER");
return ERROR_INVALID_NUMBER;
}
pCallList = null;
//release all active or held calls
+ AppLogDebug("TAPI_CALL_END_ALL");
int tapiRes = tel_end_call(__pTapiHandle, callHandle, TAPI_CALL_END_ALL, &HandleCallbackResponse, this);
if (tapiRes == TAPI_CAUSE_SUCCESS)
{
//is successfully put on hold or is already on hold.
else
{
+ AppLogDebug("DialOutgoingCall");
res = DialOutgoingCall(contactNumber, isEmergency);
}
{
return ERROR_TAPI_ERROR;
}
+ AppLogDebug("Exit");
}
void
TelephonyManager::EndAllCalls(void)
{
+ AppLogDebug("Enter");
if(__pDialedCall != null)
{
if(__pDialedCall->GetCallHandle() != null)
//end all active calls before terminating application
tel_end_call(__pTapiHandle, -1, TAPI_CALL_END_ALL, &HandleCallbackResponse, this);
__pSettingsManager->SetCallState(CALL_STATE_CALL_OFF);
+ AppLogDebug("Exit");
}
result
TelephonyManager::EndActiveCall(Long callHandle)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
//fetch ended callInfo from active call list
AppCallInfo endCall;
{
r = EndCall(endCall);
}
-
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::EndDialingCall(String& contactNumber)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
//This is because for a dialing call, call handle is updated with some delay in telephony manager.
//And it is not available with outgoing call screen.
endCall = *__pDialedCall;
r = EndCall(endCall);
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::EndCall(AppCallInfo& endCallInfo)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
if (endCallInfo.GetCallHandle() != null)
{
unsigned int callHandle = endCallInfo.GetCallHandle()->ToLong();
//end "dialed but unconnected" call or active call - processing to be handled in HandleIdleCallback().
+ AppLogDebug("TAPI_CALL_END");
int res = tel_end_call(__pTapiHandle, callHandle, TAPI_CALL_END, &HandleCallbackResponse, this);
if (res == TAPI_CAUSE_SUCCESS)
{
r = E_SUCCESS;
}
}
+ AppLogDebug("Exit");
return r;
}
{
r = E_FAILURE;
}
+ AppLogDebug("Exit");
return r;
}
{
r = E_FAILURE;
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::AcceptCall(CallAnsweringOptions answerOptions,int callHandle)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
__pSoundManager->StopAlert();
__pSoundManager->SetSoundMode(SOUND_MODE_VOICE);
default:
break;
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::AcceptSecondCall(CallAnsweringOptions answerOptions, const int incomingCallHandle)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
switch (answerOptions)
default:
break;
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::AcceptMultipleCall(CallAnsweringOptions answerOptions, const int incomingCallHandle)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
switch (answerOptions)
default:
break;
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::HoldCall(Tizen::Base::Long callHandle, bool holdCall)
{
+ AppLogDebug("Enter");
result r = E_SUCCESS;
//Check if there are any existing active calls
if (__pActiveCallList->GetCount())
pCallList = null;
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::EndConferenceCall(void)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
//fetch conference callInfo to end
AppCallInfo confCallToEnd;
r = E_SUCCESS;
}
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::HoldConferenceCall(bool holdCall)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
int confCallIndex = -1;
AppCallInfo confCallToHold;
delete pCallList;
pCallList = null;
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::JoinCall(void)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
int res = -1;
AppCallInfo activeCall;
{
r = E_FAILURE;
}
+ AppLogDebug("Exit");
return r;
}
TelephonyManager::HoldActiveCall(AppCallInfo* pActiveCallInfo, bool holdCall)
{
+ AppLogDebug("Enter");
unsigned int callHandle = pActiveCallInfo->GetCallHandle()->ToLong();
AppLogDebug("Enter %d",callHandle);
if (retStatus == TAPI_CAUSE_SUCCESS)
{
+ AppLogDebug("Exit");
return E_SUCCESS;
}
else
{
__pDialedCall->SetContactInfo(*__pCachedContact);
}
+ AppLogDebug("Exit");
return E_SUCCESS;
}
else
{
result r = E_FAILURE;
+ AppLogDebug("Enter");
//check if there are atleast 2 active calls
if (__pActiveCallList->GetCount() == IDI_MAX_ACTIVE_CALLS)
{
pCallHandleList = null;
}
+ AppLogDebug("Exit");
return r;
}
TelephonyManager::SendCallDTMF(String& textToBeSent)
{
result r = E_FAILURE;
+ AppLogDebug("Enter");
//check if there is an active Call
if (__pActiveCallList->GetCount() > 0)
{
r = E_SUCCESS;
}
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::EndFromConference(int callHandle)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
int confCallIndex = -1;
AppCallInfo endConfCall;
}
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::SplitFromConference(int callHandle)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
int confCallIndex = -1;
AppCallInfo endConfCall;
break;
}
}
+ AppLogDebug("Exit");
return r;
}
result
TelephonyManager::SetMuteStatus(bool setMute)
{
+ AppLogDebug("Enter");
TelSoundMuteStatus_t muteStatus;
result r = E_FAILURE;
if (setMute == true)
{
r = E_FAILURE;
}
+ AppLogDebug("Exit");
return r;
}
bool
TelephonyManager::IsCallMuted(void)
{
+ AppLogDebug("Enter");
return __isMuted;
}
result
TelephonyManager::SetSpeakerStatus(bool setSpeaker)
{
+ AppLogDebug("Enter");
result r = E_FAILURE;
TelCallSoundPathInfo_t callSoundPathInfo;
__pSoundManager->SetSpeakerStatus(setSpeaker);
{
r = E_FAILURE;
}
+ AppLogDebug("Exit");
return r;
}
bool
TelephonyManager::IsSpeakerOn(void)
{
+ AppLogDebug("Enter");
return __isSpeakerOn;
+ AppLogDebug("Exit");
}
bool
{
// Split functionality is allowed only if a one call is present.
// The call can be a single call or a conference call
+ AppLogDebug("Enter");
if (__pActiveCallList->GetCount() == 1)
{
return true;
}
+ AppLogDebug("Exit");
return false;
}
void
TelephonyManager::HandleActiveConferenceCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData)
{
+ AppLogDebug("Enter");
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
AppCallInfo confCallToHold;
IListT<AppCallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
delete pCallList;
pCallList = null;
}
+ AppLogDebug("Exit");
}
void
TelephonyManager::HandleHoldConferenceCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData)
{
+ AppLogDebug("Enter");
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
AppCallInfo confCallToHold;
- bool isConferenceCallFound = false;
IListT<AppCallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
int confCallCount = pCallList->GetCount();
delete pCallList;
pCallList = null;
}
+ AppLogDebug("Exit");
}
}
}
pTelManager->CheckPendingDialCalls(callBackResult);
+ AppLogDebug("Exit");
}
void
pTelManager->__pEventListener->HandleCallActive(true);
}
}
+ AppLogDebug("Exit");
}
void
void
TelephonyManager::HandleDialCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData)
{
+ AppLogDebug("Enter");
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
if (callBackResult != TAPI_CAUSE_SUCCESS)
{
pTelManager->__pEventListener->HandleTelephonyError(ERROR_DIAL_FAILED);
}
+ AppLogDebug("Exit");
}
void
void
TelephonyManager::HandleJoinCallbackResponse(TapiHandle* pHandle, int callBackResult, void* pData, void* pUserData)
{
+ AppLogDebug("Enter");
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
if (callBackResult == TAPI_API_SUCCESS && pData != null)
{
{
pTelManager->__pEventListener->HandleTelephonyError(ERROR_JOIN_FAILED);
}
+ AppLogDebug("Exit");
}
void
void
TelephonyManager::HandleCallback(TapiHandle* pHandle, const char* pNotiId, void* pData, void* pUserData)
{
- AppLogDebug("Enter");
+ AppLogDebug("Enter %s",pNotiId);
unsigned int tempHandle = 0;
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
if (pTelManager->__pSoundManager == null)
return 0;
}
+AppCallInfo*
+TelephonyManager::GetIncomingCallHandle()
+{
+ if(__pIncomingCall != null)
+ {
+ return __pIncomingCall;
+ }
+ else
+ {
+ return null;
+ }
+}
+
+void
+TelephonyManager::ResumeAlert(AppCallInfo& incomingCallInfo)
+{
+ String contactRingTone(L"");
+ String contactNumber = incomingCallInfo.GetContactNumber();
+ //check if not hidden call
+ if(contactNumber.IsEmpty() == false)
+ {
+ //fetch contact info from Db
+ Contact* foundContact = GetContactN(contactNumber);
+ if(foundContact != null)
+ {
+ //fetch custom ringtone for contact
+ result r = foundContact->GetValue(CONTACT_PROPERTY_ID_RINGTONE, contactRingTone);
+ //Now check if there is a group ring tone
+ if(contactRingTone.IsEmpty() == true)
+ {
+ IList* pCategoryList = __pAddressBook->GetCategoriesByContactN(foundContact->GetRecordId());
+ if(pCategoryList != null && pCategoryList->GetCount() > 0)
+ {
+ Category* pCategory = static_cast<Category*>(pCategoryList->GetAt(0));
+ contactRingTone = pCategory->GetRingtonePath();
+ }
+ }
+ AppLog("ringtone fetched - r = %d", r);
+ delete foundContact;
+ foundContact = null;
+ }
+ }
+ __pSoundManager->ResumeAlert(contactRingTone);
+}
+
void
TelephonyManager::StartAlert(AppCallInfo& incomingCallInfo)
{
const wchar_t* IDS_CONFERENCE_CALL_STRING = L"IDS_CONFERENCE_CALL_STRING";
const wchar_t* IDS_CALL_REJECT_FROM_STRING = L"IDS_CALL_REJECT_FROM_STRING";
const wchar_t* IDS_CALL_REJECTED_TITLE_STRING = L"IDS_CALL_REJECTED_TITLE_STRING";
+const wchar_t* IDS_MESSAGE_SENDING_FAILED = L"IDS_MESSAGE_SENDING_FAILED";
//Panel
const wchar_t* PANEL_DIALER = L"PanelDialer";
const wchar_t* PANEL_LOGS = L"PanelLogs";