From: Amith Kumar Mahale Date: Sun, 7 Apr 2013 15:02:10 +0000 (+0530) Subject: 1.Changed appcontrol parameters of contacts 2.GUI changes 3.Changes to alert tone... X-Git-Tag: accepted/tizen_2.1/20130425.023544~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09d56b2439506159bd80c63e2a19be25fcaf310e;hp=29213e4295ec2684cd073bb20ee45339bc0e9613;p=apps%2Fosp%2FCall.git 1.Changed appcontrol parameters of contacts 2.GUI changes 3.Changes to alert tone playing Change-Id: Id61a9e349df45e0a78c0c6e5ffadbbc9c727b8ec Signed-off-by: Amith Kumar Mahale --- diff --git a/inc/CallIncomingCallForm.h b/inc/CallIncomingCallForm.h index 1d64224..3d1d0c2 100644 --- a/inc/CallIncomingCallForm.h +++ b/inc/CallIncomingCallForm.h @@ -30,6 +30,7 @@ #include "CallTypes.h" #include "CallIPopupItemSelectListener.h" #include "CallOptionPopup.h" +#include "CallIAppStateChangeListner.h" /** * @class IncomingCallForm @@ -38,6 +39,7 @@ */ class IncomingCallForm : public BaseForm + , public IAppStateChangeListener , public Tizen::Ui::Controls::IFormBackEventListener , public Tizen::Ui::Controls::ITableViewItemEventListener , public Tizen::Ui::Controls::ITableViewItemProvider @@ -100,6 +102,9 @@ public: //From IPopupEventListener void OnItemSelected(int itemIndex); + //From IAppStateChangeListener + virtual void OnForeground(void); + virtual void OnBackground(void){}; private: // Method to fetch person details using phone number. void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, AppCallInfo* pCallInfo); diff --git a/inc/CallPresentationModel.h b/inc/CallPresentationModel.h index 14eadd2..58b7aec 100644 --- a/inc/CallPresentationModel.h +++ b/inc/CallPresentationModel.h @@ -142,6 +142,7 @@ public: virtual void HandleTelephonyError(int errorCode); //From IAppControlResponseListener virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData); + virtual void OnAppForeground(void); private: static CallPresentationModel* __pInstance; diff --git a/inc/CallSoundManager.h b/inc/CallSoundManager.h index 9fd2e9b..b379a3d 100644 --- a/inc/CallSoundManager.h +++ b/inc/CallSoundManager.h @@ -37,6 +37,12 @@ using namespace Tizen::Base::Runtime; * @brief This class presents sound related functionality required in call module. * */ +enum CallAlertStatus +{ + CALL_ALERT_OFF = 0, + CALL_ALERT_SOUND, + CALL_ALERT_VIBRATE +}; class SoundManager : public Tizen::Media::IPlayerEventListener , public Tizen::Base::Runtime::ITimerEventListener diff --git a/manifest.xml b/manifest.xml index 69c6dbd..b4b2951 100644 --- a/manifest.xml +++ b/manifest.xml @@ -14,9 +14,8 @@ http://tizen.org/privilege/application.launch http://tizen.org/privilege/power http://tizen.org/privilege/setting - http://tizen.org/privilege/lockmanager - http://tizen.org/privilege/messaging.sms http://tizen.org/privilege/telephony + http://tizen.org/privilege/messaging.sms http://tizen.org/privilege/vibrator http://tizen.org/privilege/contact.read diff --git a/res/screen-size-normal/IDL_CALL_FORM.xml b/res/screen-size-normal/IDL_CALL_FORM.xml index 72e5a8c..6a7cf1e 100644 --- a/res/screen-size-normal/IDL_CALL_FORM.xml +++ b/res/screen-size-normal/IDL_CALL_FORM.xml @@ -3,7 +3,8 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + + 720
@@ -41,7 +42,7 @@ diff --git a/res/screen-size-normal/IDL_CONFCALL_FORM.xml b/res/screen-size-normal/IDL_CONFCALL_FORM.xml index 25b1950..84677f9 100644 --- a/res/screen-size-normal/IDL_CONFCALL_FORM.xml +++ b/res/screen-size-normal/IDL_CONFCALL_FORM.xml @@ -3,7 +3,8 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + + 720 @@ -21,7 +22,7 @@ @@ -41,7 +42,7 @@ diff --git a/res/screen-size-normal/IDL_MULTIPLE_CALL_FORM.xml b/res/screen-size-normal/IDL_MULTIPLE_CALL_FORM.xml index 46d51cb..86ca93e 100644 --- a/res/screen-size-normal/IDL_MULTIPLE_CALL_FORM.xml +++ b/res/screen-size-normal/IDL_MULTIPLE_CALL_FORM.xml @@ -3,7 +3,8 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + + 720 @@ -71,7 +72,7 @@ diff --git a/src/CallApp.cpp b/src/CallApp.cpp index 4c57277..093c423 100644 --- a/src/CallApp.cpp +++ b/src/CallApp.cpp @@ -23,7 +23,6 @@ using namespace Tizen::Ui::Scenes; using namespace Tizen::Base::Utility; using namespace Tizen::Base::Collection; using namespace Tizen::Base::Utility; -using namespace Tizen::Shell; CallApp::CallApp(void):__initialSceneId(L""), __pLaunchArgs(null) @@ -531,9 +530,9 @@ CallApp::SetTopMostWindow(bool bTopMost) PowerManager::KeepScreenOnState(false); } //Unlock the phone if its locked - if(LockManager::GetInstance()->IsLocked()) +/* if(LockManager::GetInstance()->IsLocked()) { LockManager::GetInstance()->Unlock(); - } + }*/ } diff --git a/src/CallButtonsPanel.cpp b/src/CallButtonsPanel.cpp index ec50816..11be7c8 100644 --- a/src/CallButtonsPanel.cpp +++ b/src/CallButtonsPanel.cpp @@ -442,7 +442,7 @@ CallButtonsPanel::SetBitmapsToButton(const String& buttonId, const String& butto //Create a new canvas Canvas* pCanvas = new (std::nothrow) Canvas; - pCanvas->Construct(Rectangle(0, 0, W_KEYPAD_BTN, H_KEYPAD_BTN)); + pCanvas->Construct(Rectangle(0, 0, pButton->GetWidth(), pButton->GetHeight())); //Set Text to Canvas Point bitmapPos(0, 0); diff --git a/src/CallEndCallForm.cpp b/src/CallEndCallForm.cpp index 1da349e..785e929 100644 --- a/src/CallEndCallForm.cpp +++ b/src/CallEndCallForm.cpp @@ -572,6 +572,7 @@ EndCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer) void EndCallForm::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData) { + AppLogDebug("Enter"); if (__isMsgAppControlLaunched == true) { //Message AppControl request completed. @@ -603,6 +604,14 @@ EndCallForm::OnForeground(void) pPhoneApp->Terminate(); } __isContactAppControlLaunched = false; + + if (__isMsgAppControlLaunched == true) + { + //Message AppControl request completed. + CallApp* pPhoneApp = (static_cast(UiApp::GetInstance())); + pPhoneApp->Terminate(); + __isMsgAppControlLaunched = false; + } AppLogDebug("Exit"); } diff --git a/src/CallIncomingCallForm.cpp b/src/CallIncomingCallForm.cpp index f4ec54e..85b0e36 100644 --- a/src/CallIncomingCallForm.cpp +++ b/src/CallIncomingCallForm.cpp @@ -732,6 +732,9 @@ void IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs) { AddOrientationEventListener(*this); + //listen to Foreground events + CallApp* pPhoneApp = static_cast(CallApp::GetInstance()); + pPhoneApp->AddAppStateChangeListener(*this); if(__pCallPresentor == null) { __pCallPresentor = CallPresentationModel::GetInstance(); @@ -868,6 +871,7 @@ IncomingCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneI } CallApp* pCallApp = static_cast(CallApp::GetInstance()); pCallApp->SetTopMostWindow(false); + pCallApp->RemoveAppStateChangeListener(*this); } result @@ -1311,9 +1315,10 @@ IncomingCallForm::OnTouchPressed(const Control& source, const Point& currentPosi void IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo) { + AppLogDebug("%d",currentPosition.x); if (__isAnswerCallStarted == true) { - if (currentPosition.x > REJECT_LABEL_X_OFFSET) + if (currentPosition.x > __pRejectLabel->GetBounds().x) { //Right reject icon if(__pRejectFinalVisElem == null) @@ -1388,7 +1393,7 @@ IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPos } else if (__isRejectCallStarted == true) { - if (currentPosition.x < ACCEPT_LABEL_RELATIVE_POS) + if (currentPosition.x < ((__pAcceptLabel->GetBounds().x + __pAcceptLabel->GetWidth())- __pRejectLabel->GetBounds().x)) { //left dial icon if(__pAcceptFinalVisElem == null) @@ -1581,3 +1586,9 @@ IncomingCallForm::OnOrientationChanged(const Control& source, OrientationStatus } } + +void +IncomingCallForm::OnForeground(void) +{ + __pCallPresentor->OnAppForeground(); +} diff --git a/src/CallPresentationModel.cpp b/src/CallPresentationModel.cpp index a0b98a1..baff300 100644 --- a/src/CallPresentationModel.cpp +++ b/src/CallPresentationModel.cpp @@ -411,6 +411,22 @@ CallPresentationModel::RejectCall(int callHandle, bool sendMsg, const String& co return true; } +void CallPresentationModel::OnAppForeground(void) +{ + if (__isMessageAppControlRunning == true) + { + //This comes here, when Message AppControl is finished working. + __isMessageAppControlRunning = false; + //Check if this was the last call, then terminate application. + //And if any calls are active, then those cases are already handled from Other places. + if( GetCurrentCallCount() == 0) + { + CallApp* pPhoneApp = static_cast(UiApp::GetInstance()); + pPhoneApp->Terminate(); + } + } +} + void CallPresentationModel::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData) { diff --git a/src/CallSoundManager.cpp b/src/CallSoundManager.cpp index efbc144..3e52598 100644 --- a/src/CallSoundManager.cpp +++ b/src/CallSoundManager.cpp @@ -235,29 +235,39 @@ void SoundManager::SetDisconnectTone(void) { + AppLogDebug("Enter"); int unknownRejectStatus = -1; - String disconnectTonePath; + String disconnectTonePath=L""; vconf_get_bool(VCONFKEY_CISSAPPL_CALL_END_TONE_BOOL, &unknownRejectStatus); bool disconnectToneSetStatus = unknownRejectStatus; if(disconnectToneSetStatus == true) { + AppLogDebug("disconnectToneSetStatus == true"); disconnectTonePath.Append(CALLDISCONNECTTONE_PATH); if(__pPlayer == null) { + AppLogDebug("__pPlayer == null"); + __pPlayer = new (std::nothrow) Player(); __pPlayer->Construct(*this); + AppLogDebug("__pPlayer Construct"); } if(disconnectTonePath.IsEmpty() == false) { - __pPlayer->Close(); + AppLogDebug("__pPlayer OpenFile %ls",disconnectTonePath.GetPointer()); __pPlayer->OpenFile(disconnectTonePath,false); + AppLogDebug("__pPlayer OpenFile"); __pPlayer->SetLooping(false); + AppLogDebug("__pPlayer SetLooping"); __pPlayer->SetVolume(80); + AppLogDebug("__pPlayer SetVolume"); SetSoundMode(SOUND_MODE_MEDIA); + AppLogDebug("__pPlayer SetVolume"); __pPlayer->Play(); } } + AppLogDebug("Exit"); } @@ -315,22 +325,33 @@ SoundManager::StartAlert(String& contactRingTone) AppLogDebug("Enter"); if(__pSoundCallSession != null) { - AppLogDebug("No Alert already in call"); - String waitingTonePath; - waitingTonePath.Append(CALLWAITINGTONE_PATH); - if(__pPlayer == null) + CallAlertStatus status= CALL_ALERT_SOUND; + int alertStatus = -1; + int retVal = vconf_get_int(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, &alertStatus); + if (retVal == 0) { - __pPlayer = new (std::nothrow) Player(); - __pPlayer->Construct(*this); + status = (CallAlertStatus) alertStatus; } - if (waitingTonePath.IsEmpty() == false) + AppLogDebug("No Alert already in call"); + if(status == CALL_ALERT_SOUND) { - __pPlayer->Close(); - __pPlayer->OpenFile(waitingTonePath,false); - __pPlayer->SetLooping(true); - __pPlayer->SetVolume(80); - SetSoundMode(SOUND_MODE_MEDIA); - __pPlayer->Play(); + AppLogDebug("Playing alert tone"); + String waitingTonePath; + waitingTonePath.Append(CALLWAITINGTONE_PATH); + if(__pPlayer == null) + { + __pPlayer = new (std::nothrow) Player(); + __pPlayer->Construct(*this); + } + if (waitingTonePath.IsEmpty() == false) + { + __pPlayer->Close(); + __pPlayer->OpenFile(waitingTonePath,false); + __pPlayer->SetLooping(true); + __pPlayer->SetVolume(80); + SetSoundMode(SOUND_MODE_MEDIA); + __pPlayer->Play(); + } } return; }