#include <FApp.h>
#include <FTelephony.h>
+#include <FMessaging.h>
#include "CallAppControlRequestMgr.h"
#include "CallTypes.h"
#include "CallITelephonyEventListener.h"
, public Tizen::App::IAppControlResponseListener
, public Tizen::Telephony::ITelephonyNetworkEventListener
, public Tizen::Telephony::ITelephonySimEventListener
+ , public Tizen::Messaging::ISmsListener
{
public:
//create a singleton instance
void AbortAppControlRequest(void);
//Used to complete any running AppControl request.
void AppControlRequestCompleted(void);
+ //Used to send message
+ void SendMessage(Tizen::Base::String& strMsg,Tizen::Base::String& recpientNum);
+ //Checks if message sending is in progress
+ bool IsMessageSendingInProgress(void);
//Event Listener methods from ITelephonyEventListener
virtual void HandleCallConnected(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
virtual void OnAppForeground(void);
virtual void OnTelephonyNetworkStatusChanged(const Tizen::Telephony::NetworkStatus& networkStatus);
virtual void OnTelephonySimStateChanged(Tizen::Telephony::SimState state);
+ virtual void OnSmsMessageSent(result r);
private:
static CallPresentationModel* __pInstance;
// incoming call is rejected with "Reject With message" by opening Msg AppControl.
bool __isMessageAppControlRunning;
bool __isDialAppControlRunning;
+ bool __isMessageSendInProgress;
//Used to manage AppControl requests.
CallAppControlRequestMgr* __pAppControlMgr;
Tizen::Telephony::NetworkManager* __pNetworkManager;
Tizen::Telephony::SimStateManager* __psimStateManager;
Tizen::Telephony::SimInfo* __psimInfo;
+ Tizen::Messaging::SmsManager* __pSmsManager;
};
#endif // _PHN_CALL_PRESENTATION_MODEL_H_
const int Y_PHOTO_LBL = 232;
const int W_PHOTO_LBL = 388;
const int H_PHOTO_LBL = 388;
+const int END_CALL_TIMER_VAL = 2000;
+const int END_CALL_WAIT_TIMER_VAL = 500;
static const wchar_t* IDL_END_CALL_FORM = L"IDL_END_CALL_FORM";
static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
static const wchar_t* IDC_MSG_BUTTON = L"IDC_MSG_BUTTON";
+
EndCallForm::EndCallForm(void)
: BaseForm(FORMTYPE_ENDCALL)
{
void
EndCallForm::HandleLastCallCompletion(void)
{
- CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
- pPhoneApp->Terminate();
+ //Check if message sending is in progress if yes
+ //wait for it to complete by restarting the timer
+ AppLogDebug("Enter");
+ if(__pCallPresentor->IsMessageSendingInProgress() == true)
+ {
+ __pEndCallEventTimer->Start(END_CALL_WAIT_TIMER_VAL);
+ }
+ else
+ {
+ CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
+ pPhoneApp->Terminate();
+ }
}
void
{
if(__pEndCallEventTimer != null)
{
- __pEndCallEventTimer->Start(2000);
+ __pEndCallEventTimer->Start(END_CALL_TIMER_VAL);
}
if (__pContactNumber != null && __pContactNumber->IsEmpty() == false)
{
* @brief Incoming Call form implementation
*/
#include <FBaseColIList.h>
-#include <FMessaging.h>
#include "CallIncomingCallForm.h"
#include "CallAppUtility.h"
#include "CallSettingsManager.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-using namespace Tizen::Messaging;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
using namespace Tizen::Ui::Controls;
const wchar_t* IDI_REJECT_FINAL_VISUAL_ELE_NAME = L"RejectFinalVisEle";
const wchar_t* IDI_ACCEPT_FINAL_VISUAL_ELE_NAME = L"AcceptFinalVisEle";
-class SmsListener
- : public Object
- , public ISmsListener
-{
-public:
- void OnSmsMessageSent(result r)
- {
- }
-};
-
IncomingCallForm::IncomingCallForm(void)
: BaseForm(FORMTYPE_INCOMINGCALL)
{
case IDA_SEND_REJECT_MSG6:
{
__pCallPresentor->RejectCall(__incomingCallHandle, false,*__pActiveContactNo);
- SmsListener* pSmsListener = new (std::nothrow) SmsListener();
- SmsManager* pSmsManager = new (std::nothrow) SmsManager();
- result r = pSmsManager->Construct(*pSmsListener);
- if (IsFailed(r) == false)
- {
- RecipientList recipient;
- recipient.Add(RECIPIENT_TYPE_TO,*__pActiveContactNo);
- SmsMessage smsMessage;
- String textToBeSent;
- //calculate msgIndex
- int msgIndex = IDA_SEND_REJECT_MSG1;
- msgIndex = actionId - msgIndex;
- __pRejectMessageList->GetAt(msgIndex, textToBeSent);
- r = smsMessage.SetText(textToBeSent);
- if (IsFailed(r) == false)
- {
- r = pSmsManager->Send(smsMessage,recipient,true);
- if (IsFailed(r) == true)
- {
- //todo: error message
- }
- }
- else
- {
- //todo: error message
- }
- }
- else
- {
- //todo: error message
- }
- delete pSmsListener;
- delete pSmsManager;
- /*ArrayListT<CallInfo>* pCallList = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
- __pCallPresentor->HandleCallConnected(*pCallList);
- pCallList = null;*/
+ String textToBeSent;
+ //calculate msgIndex
+ int msgIndex = IDA_SEND_REJECT_MSG1;
+ msgIndex = actionId - msgIndex;
+ __pRejectMessageList->GetAt(msgIndex, textToBeSent);
+ __pCallPresentor->SendMessage(textToBeSent,*__pActiveContactNo);
}
break;
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Telephony;
using namespace Tizen::Base::Utility;
+using namespace Tizen::Messaging;
CallPresentationModel* CallPresentationModel::__pInstance = null;
__pNetworkManager = null;
__psimStateManager = null;
__psimInfo = null;
+ __pSmsManager = null;
+ __isMessageSendInProgress = false;
}
CallPresentationModel::~CallPresentationModel(void)
delete __psimInfo;
__psimInfo = null;
}
+ if(__pSmsManager != null)
+ {
+ delete __pSmsManager;
+ __pSmsManager = null;
+ }
}
void
}
+void
+CallPresentationModel::SendMessage(String& strMsg,String& recpientNum)
+{
+ AppLogDebug("Enter");
+ if(__pSmsManager == null)
+ {
+ __pSmsManager = new (std::nothrow) SmsManager();
+ }
+ result r = __pSmsManager->Construct(*this);
+ if (IsFailed(r) == false)
+ {
+ RecipientList recipient;
+ recipient.Add(RECIPIENT_TYPE_TO,recpientNum);
+ SmsMessage smsMessage;
+ r = smsMessage.SetText(strMsg);
+ if (IsFailed(r) == false)
+ {
+ r = __pSmsManager->Send(smsMessage,recipient,true);
+ if (IsFailed(r) == true)
+ {
+ //todo: error message
+ }
+ else
+ {
+ __isMessageSendInProgress = true;
+ }
+ }
+ else
+ {
+ //todo: error message
+ }
+ }
+ else
+ {
+ //todo: error message
+ }
+
+}
+
+bool
+CallPresentationModel::IsMessageSendingInProgress(void)
+{
+ AppLogDebug("Enter %d",__isMessageSendInProgress);
+ return __isMessageSendInProgress;
+}
+
+void
+CallPresentationModel::OnSmsMessageSent(result r)
+{
+ AppLogDebug("Enter");
+ __isMessageSendInProgress = false;
+
+}
using namespace Tizen::App;
using namespace Tizen::Social;
-static const wchar_t* REJECT_DATABASE_PATH = L"/opt/usr/apps/zktdpemtmw/";
+static const wchar_t* REJECT_DATABASE_PATH = L"/opt/apps/zktdpemtmw/shared/";
CallSettingDataService* CallSettingDataService::__pCallSettingDataService = null;
Database* CallSettingDataService::__pDatabase = null;
return E_OBJ_ALREADY_EXIST;
}
__pDatabase = new (std::nothrow) Database();
- r = __pDatabase->Construct(__strDbName, true);
+ r = __pDatabase->Construct(__strDbName, "r");
TryCatch(r == E_SUCCESS, , "CallSettingDataService::OpenDatabase() database construct failed");
r = CreateCallRejectTableDatabase();