void ShowViewContactButton(void);
// Used to set the AddToContact is present or not
void ShowAddContactButton(void);
-
//set the buttons in the panel as the top controls. Chk if its needed in RC2
void SetButtonPosition(void);
+ void ShowOrHideAddtoContactsButton(bool isEnabled);
protected:
// Construct the panel to be shown in "End Call" form
result Construct(void);
static void CreateInstance(void);
static void DestroyInstance(void);
+ //gets the sim info
+ result GetSimInfo(void);
public:
//set the telephony event listener
<Privilege>http://tizen.org/privilege/power</Privilege>
<Privilege>http://tizen.org/privilege/appusage</Privilege>
<Privilege>http://tizen.org/privilege/setting</Privilege>
- <Privilege>http://tizen.org/privilege/messaging.write</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/vibrator</Privilege>
<Privilege>http://tizen.org/privilege/contact.read</Privilege>
</Privileges>
#include <FUi.h>
#include <FMedia.h>
#include <FSystem.h>
+#include <FShell.h>
#include "CallActiveCallForm.h"
#include "CallButtonsPanel.h"
#include "CallInfo.h"
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Shell;
//constants
const int IDI_MAX_SECONDS = 60;
break;
}
+ if(__formType == FORMTYPE_ACTIVECALL || __formType == FORMTYPE_EMERGENCYACTIVECALL ||
+ __formType == FORMTYPE_MULTIPLECALLS || __formType == FORMTYPE_ACTIVECONFCALL)
+ {
+ //Unlock the phone if its locked
+ if(LockManager::GetInstance()->IsLocked())
+ {
+ AppLogDebug("Phone Locked");
+ LockManager::GetInstance()->Unlock();
+ }
+ }
+
//Hide DTMFKeypad, if visible and show caller info
HideDTMFKeypad();
SetShowStateOnKeypad(true);
PowerManager::KeepScreenOnState(false);
AppManager::GetInstance()->RemoveActiveAppEventListener(*this);
}
- //Unlock the phone if its locked
-/* if(LockManager::GetInstance()->IsLocked())
- {
- AppLogDebug("Phone Locked");
- LockManager::GetInstance()->Unlock();
- }*/
+
}
void
}
void
+CallButtonsPanel::ShowOrHideAddtoContactsButton(bool isEnabled)
+{
+ Button* pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON));
+ pButton->SetShowState(isEnabled);
+}
+
+void
CallButtonsPanel::SetEndCallPanelState(bool isEnabled)
{
//Voice Call
{
__pCallButtonsPanel->SetEndCallPanelState(true);
}
+
+ //check if we reached the end call form of an outgoing call then don't show add to contacts
+ if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_OUTGOING)
+ {
+ __pCallButtonsPanel->ShowOrHideAddtoContactsButton(false);
+ }
+ else if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
+ {
+ __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true);
+ }
+
}
break;
break;
}
- if (__pEndCallEventTimer)
+ //Before starting end call timer check if messaging appcontrol was launched during incoming call
+ if (__pEndCallEventTimer && __pCallPresentor->IsAppControlRunning() == false)
{
__pEndCallEventTimer->Start(IDI_APP_END_TIMER);
}
__isContactAppControlLaunched = false;
__pCallPresentor->AppControlRequestCompleted();
}
-
- if (__isMsgAppControlLaunched == true)
+ else if (__isMsgAppControlLaunched == true)
{
//Message AppControl request completed.
if(__pEndCallEventTimer != null)
__isMsgAppControlLaunched = false;
__pCallPresentor->AppControlRequestCompleted();
}
+ else if(__pCallPresentor->IsAppControlRunning() == true)
+ {
+ if(__pEndCallEventTimer != null)
+ {
+ __pEndCallEventTimer->Start(2000);
+ }
+ __pCallPresentor->AppControlRequestCompleted();
+ }
AppLogDebug("Exit");
}
using namespace Tizen::Media;
using namespace Tizen::Social;
using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Telephony;
CallPresentationModel* CallPresentationModel::__pInstance = null;
CallPresentationModel::DialCall(String& contactNumber, bool isEmergency)
{
int errorCode = ERROR_NONE;
+ bool isCallServiceAvailable = false;
+ NetworkStatus networkStatus;
+ NetworkManager* pNetworkManager = new NetworkManager();
+ result r;
//Check if Telephony Manager is initialized
TryCatch(__pTelephonyMgr != null, (errorCode = ERROR_TAPI_INIT_FAILED), "TAPI initialization failed");
__pTelEventListener->HandleTelephonyError(ERROR_FLIGHT_MODE_SET);
return;
}
+ //Check if dialing a call is possible - Check if sim is available
+ if (GetSimInfo() == E_FAILURE)
+ {
+ __pTelEventListener->HandleTelephonyError(ERROR_CODE_SIM_INITIALIZATION_FAILED);
+ return ;
+ }
+
+ //fetch call service status
+ r = pNetworkManager->Construct(null);
+ if (r == E_SUCCESS)
+ {
+ r = pNetworkManager->GetNetworkStatus(networkStatus);
+ if (r == E_SUCCESS)
+ {
+ isCallServiceAvailable = networkStatus.IsCallServiceAvailable();
+ }
+ }
+ delete pNetworkManager;
+
+ if (isCallServiceAvailable == false)
+ {
+ __pTelEventListener->HandleTelephonyError(ERROR_DIAL_FAILED);
+ return ;
+ }
//setup outgoing call
errorCode = __pTelephonyMgr->SetupMoCall(contactNumber, isEmergency);
TryCatch(errorCode == ERROR_NONE,,"Error occurred while setup MO call");
CallPresentationModel::RejectCall(int callHandle, bool sendMsg, const String& contactNumber)
{
AppLogDebug("Enter");
+ if (sendMsg == true && __pAppControlMgr != null)
+ {
+ //launch compose message AppControl
+ __isMessageAppControlRunning = __pAppControlMgr->LaunchComposeMessageAppControl(*(const_cast<String*>(&contactNumber)), this);
+ }
result r = __pTelephonyMgr->AnswerCall(callHandle, false);
if (IsFailed(r))
{
return false;
}
- if (sendMsg == true && __pAppControlMgr != null)
- {
- //launch compose message AppControl
- __isMessageAppControlRunning = __pAppControlMgr->LaunchComposeMessageAppControl(*(const_cast<String*>(&contactNumber)), this);
- }
+
AppLogDebug("Exit");
return true;
}
ArrayList* pLaunchArgs = null;
SceneManager* pSceneManager = SceneManager::GetInstance();
int currentActiveCallCount = GetCurrentCallCount();
- if(currentActiveCallCount <= 1)
+ if(currentActiveCallCount <= 1 && IsIncomingorDialingCallPresent() == false)
{
//make an outgoing call with given number
String* contactTxt = new (std::nothrow) String(phoneNumber);
//1) Defer from sending call disconnected event to form, in case Msg AppControl is running,
//to avoid PhoneApp from going to EndCall form, where it shows for 3 sec. and automatically closes.
//2) Do not send call disconnected event to any form, in case an incoming call or dialing call is present.
- if (__pTelEventListener != null && __isMessageAppControlRunning == false )
+ if (__pTelEventListener != null /*&& __isMessageAppControlRunning == false*/ )
{
__pTelEventListener->HandleCallDisconnected(isLastCall, pCallList);
}
__pAppControlMgr->AppControlRequestCompleted();
}
}
+
+result
+CallPresentationModel::GetSimInfo(void)
+{
+ int mnc;
+ int mcc;
+ bool isAvailable;
+ String spn;
+ String iccId;
+ String operatorName;
+
+ SimStateManager simStateManager;
+ SimInfo simInfo;
+
+ result r = simStateManager.Construct();
+ if (IsFailed(r))
+ {
+ return E_FAILURE;
+ }
+
+ r = simStateManager.GetSimInfo(simInfo);
+ if (IsFailed(r))
+ {
+ return E_FAILURE;
+ }
+
+ mnc = simInfo.GetMnc();
+ mcc = simInfo.GetMcc();
+ spn = simInfo.GetSpn();
+ iccId = simInfo.GetIccId();
+ operatorName = simInfo.GetOperatorName();
+ //Checks whether a SIM card is present in the device or not
+ isAvailable = simInfo.IsAvailable();
+ if(isAvailable == true)
+ {
+ return E_SUCCESS;
+ }
+ else
+ {
+ return E_FAILURE;
+ }
+}
bool
SettingsManager::IsCallToBeRejected(String& phoneNumber)
{
+ if(__pCallSettingDataService != null)
+ {
return __pCallSettingDataService->IsCallToBeRejected(phoneNumber);
}
+ else
+ {
+ return false;
+ }
+}
bool
SettingsManager::GetUnknownRejectStatus(void)
{
//Construct Settings Manager
__pSettingsMgr = SettingsManager::GetInstance();
+ if(__pSettingsMgr != null)
+ {
__pSettingsMgr->AddSettingEventListener(this);
+ }
return E_SUCCESS;
}
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);
}
}
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;
}