#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)
{
+ AppControl::StopAppControlResponseListener(this);
__pTelephonyMgr = null;
__pSettingsPresentor = null;
__pAppControlMgr =null;
__pAppControlMgr = CallAppControlRequestMgr::GetInstance();
__pNetworkManager = new (std::nothrow)NetworkManager();
__pNetworkManager->Construct(null);
+ __pNotificationManager = new (std::nothrow) Tizen::Shell::NotificationManager;
+ __pNotificationManager->Construct();
GetSimInfo();
return E_SUCCESS;
}
numberEndsWithHash = IfNumberEndsWithHash(contactNumber);
if(numberEndsWithHash == true)
{
- __pTelEventListener->HandleTelephonyError(ERROR_GPRS_NUMBER);
+ __pTelEventListener->HandleTelephonyError(ERROR_USSD_NUMBER);
return ;
}
bool
CallPresentationModel::RejectCall(int callHandle, bool sendMsg, const String& contactNumber)
{
- AppLogDebug("Enter");
+ AppLogDebug("Enter %d",callHandle);
if (sendMsg == true && __pAppControlMgr != null)
{
//launch compose message AppControl
{
nextScene = IDSCN_SCENE_OUT_EMERGENCYCALL;
}
- pSceneManager->GoForward( ForwardSceneTransition( nextScene), pLaunchArgs);
+ pSceneManager->GoForward( ForwardSceneTransition( nextScene,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pLaunchArgs);
}
}
}
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)
{
}
if(__pSettingsPresentor != null)
{
- __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
+ if(IsIncomingorDialingCallPresent() == false)
+ {
+ __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
+ }
+ }
+}
+
+void
+CallPresentationModel::HandleCallActive(bool isActive)
+{
+ if (__pTelEventListener != null)
+ {
+ __pTelEventListener->HandleCallActive(isActive);
+ }
+}
+
+void
+CallPresentationModel::HandleCallHeld(bool isHeld)
+{
+ if (__pTelEventListener != null)
+ {
+ __pTelEventListener->HandleCallHeld(isHeld);
}
}
SetMuteStatus(false);
if(__pSettingsPresentor != null)
{
- __pSettingsPresentor->SetCallState(CALL_STATE_CALL_OFF);
+ //Check if there is a incoming call or dialing call present before setting the status
+ if(IsIncomingorDialingCallPresent() == false)
+ {
+ __pSettingsPresentor->SetCallState(CALL_STATE_CALL_OFF);
+ }
}
}
else
{
if(__pSettingsPresentor != null)
{
- __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
+ if(IsIncomingorDialingCallPresent() == false)
+ {
+ __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
+ }
}
}
//1) Defer from sending call disconnected event to form, in case Msg AppControl is running,
}
void
+CallPresentationModel::HandleConfCallHoldOccured(bool success)
+{
+ if (__pTelEventListener != null)
+ {
+ __pTelEventListener->HandleConfCallHoldOccured(success);
+ }
+}
+
+void
+CallPresentationModel::HandleConfCallActiveOccured(bool success)
+{
+ if (__pTelEventListener != null)
+ {
+ __pTelEventListener->HandleConfCallActiveOccured(success);
+ }
+}
+
+void
CallPresentationModel::HandleCallSwapOccured(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList)
{
if (__pTelEventListener != null)
CallPresentationModel::SendMessage(String& strMsg,String& recpientNum)
{
AppLogDebug("Enter");
+ result r;
if(__pSmsManager == null)
{
__pSmsManager = new (std::nothrow) SmsManager();
+ result r = __pSmsManager->Construct(*this);
+ if (IsFailed(r) == true)
+ {
+ delete __pSmsManager;
+ __pSmsManager = null;
+ return;
+ }
+
}
- result r = __pSmsManager->Construct(*this);
+ RecipientList recipient;
+ recipient.Add(RECIPIENT_TYPE_TO,recpientNum);
+ SmsMessage smsMessage;
+ r = smsMessage.SetText(strMsg);
if (IsFailed(r) == false)
{
- RecipientList recipient;
- recipient.Add(RECIPIENT_TYPE_TO,recpientNum);
- SmsMessage smsMessage;
- r = smsMessage.SetText(strMsg);
+ r = __pSmsManager->Send(smsMessage,recipient,true);
if (IsFailed(r) == false)
{
- r = __pSmsManager->Send(smsMessage,recipient,true);
- if (IsFailed(r) == true)
- {
- //todo: error message
- }
- else
- {
- __isMessageSendInProgress = true;
- }
+ __isMessageSendInProgress = true;
}
else
{
- //todo: error message
+ AppLogDebug("%s",GetErrorMessage(r));
+ ShowSMSErrorNotification();
}
+
}
- else
+
+}
+
+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)
{
- //todo: error message
+ badgeNumber = 1;
}
+ request.SetBadgeNumber(badgeNumber);
+ __pNotificationManager->Notify(request);
+ __pNotificationManager->RemoveNotification();
}
bool