private:
//Start time for Active call
long long __activeCallStartTime;
+ long long __referenceticks;
//Timer used to show call time
Tizen::Base::Runtime::Timer* __pActiveCallTimer;
//Custom Buttons Panel
virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData);
//Called when incoming call has to be handled
void SetTopMostWindow(bool bTopMost);
+ //Gets the time duration since appplication has been launched
+ long long GetCallAppTicks(void);
private:
//internal function to process AppControl request.
Tizen::Base::Collection::ArrayList __listenerList;
Tizen::Ui::Controls::Popup* __pCallRejectedIonPopup;
Tizen::Base::Runtime::Timer __callRejectedIontimer;
+ long long __callTicks;
+ Tizen::Base::Runtime::Timer* __pCallAppTimer;
};
#endif // _CALLAPP_H_
long long GetCallConnectTime(void);
//Sets the connected time when call started
void SetCallConnectTime(long long connectTime);
+ //Set the duration time wrt to call app time
+ void SetDurationTime(long long durationTime);
//get the notified / dialed time when call started
long long GetCallNotificationTime(void);
+ //Gets the duration wrt to callapp time
+ long long GetDurationTime(void);
//Sets the notified / dialed time when call started
void SetCallNotificationTime(long long callNotificationTime);
//gets the end call cause
//system time when call connected
long long __callConnectTime;
+ long long __durationTime;
+
//system time when the call was notified / dialed
long long __callNotificationTime;
activeContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
}
ShowPersonDetails(activeContactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
-
//show call active time using Timer
- __activeCallStartTime = pCall->GetCallConnectTime();
+ //__activeCallStartTime = pCall->GetCallConnectTime();
+ __activeCallStartTime = pCall->GetDurationTime();
ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
}
break;
*__pActiveCallInfo = *pCall;
//show call active time using Timer
- __activeCallStartTime = pCall->GetCallConnectTime();
+ //__activeCallStartTime = pCall->GetCallConnectTime();
+ __activeCallStartTime = pCall->GetDurationTime();
ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
}
break;
//show call active time using Timer
- __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+ //__activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+ __activeCallStartTime = __pActiveCallInfo->GetDurationTime();
ShowTimerInfo(IDC_CALLER1_TIME_LABEL, __pActiveCallInfo->IsOnHold(),__activeCallStartTime);
}
break;
}
}
//show call active time using Timer
- __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+ //__activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+ __activeCallStartTime = __pActiveCallInfo->GetDurationTime();
ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
}
else
SetHoldButtonStatus(true);
//current system time
long long currTime = 0;
- SystemTime::GetTicks(currTime);
+ //SystemTime::GetTicks(currTime);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ currTime = pPhoneApp->GetCallAppTicks();
//Set call duration
TimeSpan diffSpan(abs(startTime - currTime));
{
__listenerList.Construct();
__pCallRejectedIonPopup = null;
+ __pCallAppTimer = null;
+ __callTicks = 0;
}
CallApp::~CallApp(void)
return false;
}
+ if (__pCallAppTimer == null)
+ {
+ __pCallAppTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
+ __pCallAppTimer->Construct(*this);
+ long long currTime = 0;
+ SystemTime::GetTicks(currTime);
+ __callTicks = currTime;
+ __pCallAppTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
+ }
+
+
return true;
}
// Deallocate resources allocated by this App for termination.
// The App's permanent data and context can be saved via appRegistry.
PowerManager::RemoveScreenEventListener(*this);
+ if (__pCallAppTimer != null)
+ {
+ __pCallAppTimer->Cancel();
+ delete __pCallAppTimer;
+ }
+
return true;
}
void
CallApp::OnTimerExpired(Tizen::Base::Runtime::Timer &timer)
{
- if(__pCallRejectedIonPopup != null)
+ if (__callRejectedIontimer.Equals(timer))
{
- delete __pCallRejectedIonPopup;
- __pCallRejectedIonPopup = null;
+ if(__pCallRejectedIonPopup != null)
+ {
+ delete __pCallRejectedIonPopup;
+ __pCallRejectedIonPopup = null;
+ }
+ }
+
+ if(__pCallAppTimer->Equals(timer))
+ {
+ __callTicks += 1000;
}
}
}
}
+
+long long
+CallApp::GetCallAppTicks(void)
+{
+ return __callTicks;
+}
* @brief Conference caller list form
*/
#include <FSystem.h>
+#include "CallApp.h"
#include "CallConfCallerListForm.h"
#include "CallAppUtility.h"
#include "CallPresentationModel.h"
}
//show active call timer
- ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
+// ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
+ ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetDurationTime());
//Set the correct bitmap to the "hold" button based on the current state of the call
SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
{
//current system time
long long currTime = 0;
- SystemTime::GetTicks(currTime);
+ //SystemTime::GetTicks(currTime);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ currTime = pPhoneApp->GetCallAppTicks();
//Set call duration
TimeSpan diffSpan(abs(startTime - currTime));
__callType = VOICE_CALL;
__isOnHold = false;
__callConnectTime = 0;
+ __durationTime = 0;
__callNotificationTime = 0;
__pCallHandle = null;
__pEndCallCause = null;
__callConnectTime = connectTime;
}
+void
+AppCallInfo::SetDurationTime(long long durationTime)
+{
+ __durationTime = durationTime;
+}
+
long long
AppCallInfo::GetCallNotificationTime(void)
{
return __callNotificationTime;
}
+long long
+AppCallInfo::GetDurationTime(void)
+{
+ return __durationTime;
+}
+
void
AppCallInfo::SetCallNotificationTime(long long callNotificationTime)
{
this->__isOnHold = rhs.__isOnHold;
//call connected time
this->__callConnectTime = rhs.__callConnectTime;
+ this->__durationTime = rhs.__durationTime;
//call notification time
this->__callNotificationTime = rhs.__callNotificationTime;
this->__calllogType = rhs.__calllogType;
#include <FTelephony.h>
#include "ITapiModem.h"
#include "ITapiSim.h"
+#include "CallApp.h"
#include "CallInfo.h"
#include "CallTelephonyManager.h"
#include "CallSettingsManager.h"
pConfCallInfo->AddCallToCallerList(heldCall);
pConfCallInfo->SetCallHandle(activeCallHandle);
//Set call start time
- if (pConfCallInfo->GetCallConnectTime() > heldCall.GetCallConnectTime())
+ //if (pConfCallInfo->GetCallConnectTime() > heldCall.GetCallConnectTime())
+ if (pConfCallInfo->GetDurationTime() > heldCall.GetDurationTime())
{
pConfCallInfo->SetCallConnectTime(heldCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(heldCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(heldCall.GetCallNotificationTime());
}
}
pConfCallInfo->AddCallToCallerList(activeCall);
pConfCallInfo->SetCallHandle(heldCallHandle);
//Set call start time
- if (pConfCallInfo->GetCallConnectTime() > activeCall.GetCallConnectTime())
+ //if (pConfCallInfo->GetCallConnectTime() > activeCall.GetCallConnectTime())
+ if (pConfCallInfo->GetDurationTime() > activeCall.GetDurationTime())
{
pConfCallInfo->SetCallConnectTime(activeCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(activeCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(activeCall.GetCallNotificationTime());
}
}
pConfCallInfo->AddCallToCallerList(heldCall);
pConfCallInfo->SetCallHandle(activeCallHandle);
//Set call start time
- if (activeCall.GetCallConnectTime() > heldCall.GetCallConnectTime())
+ //if (activeCall.GetCallConnectTime() > heldCall.GetCallConnectTime())
+ if (activeCall.GetDurationTime() > heldCall.GetDurationTime())
{
pConfCallInfo->SetCallConnectTime(heldCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(heldCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(heldCall.GetCallNotificationTime());
}
else
{
pConfCallInfo->SetCallConnectTime(activeCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(activeCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(activeCall.GetCallNotificationTime());
}
}
long long startTime = 0;
SystemTime::GetTicks(startTime);
pConnectedCall->SetCallConnectTime(startTime);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ pConnectedCall->SetDurationTime(pPhoneApp->GetCallAppTicks());
if(GetCurrentCallCount() == 0)
{
__pSoundManager->SetMinuteReminderTone();
* @file CalllogManager.cpp
* @brief This class provides call log APIs
*/
-#include "CalllogManager.h"
#include <FLocales.h>
+#include "CallApp.h"
+#include "CalllogManager.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
else
{
//start time is in miliseconds . so convert to seconds and set it to time_t format.
- long long connectTime = calllogInfo->GetCallConnectTime();
+ long long connectTime = calllogInfo->GetDurationTime();
if(connectTime == 0 || connectTime < 0)
{
- connectTime = time(null);
+ //connectTime = time(null);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ connectTime = pPhoneApp->GetCallAppTicks();
+ connectTime /=1000;
}
else
{
- connectTime = calllogInfo->GetCallConnectTime()/ 1000;
+ connectTime = calllogInfo->GetDurationTime()/ 1000;
}
duration = (int)GetDuration(connectTime);
}
unsigned long
CallLogManager::GetDuration(long long start_time)
{
- time_t curr_time;
+ long long curr_time;
unsigned long call_duration_in_sec = 50;
- curr_time = time(0);
+// curr_time = time(0);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ curr_time = pPhoneApp->GetCallAppTicks();
+ curr_time /=1000;
/*if(start_time != 0)
{
start_time /= 1000;