Fix for N_SE-28854 N_SE-29290 N_SE-27358 N_SE-25429 N_SE-25498 N_SE-25689 N_SE-27155...
authorAmith Kumar Mahale <amith.m@samsung.com>
Tue, 19 Mar 2013 13:15:24 +0000 (18:45 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Tue, 19 Mar 2013 13:15:54 +0000 (18:45 +0530)
Change-Id: I732fdc951c1de7e5a8df2877bbd4e661c95d9318
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
inc/AppResourceId.h [new file with mode: 0644]
inc/CallApp.h
manifest.xml
res/screen-size-normal/IDL_DTMF_KEYPAD_PANEL.xml
src/AppResourceId.cpp [new file with mode: 0644]
src/CallApp.cpp
src/CallIncomingCallForm.cpp
src/CallSoundManager.cpp
src/CallTelephonyManager.cpp

diff --git a/inc/AppResourceId.h b/inc/AppResourceId.h
new file mode 100644 (file)
index 0000000..9e259f8
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _APPRESOURCEID_H_
+#define _APPRESOURCEID_H_
+
+extern const wchar_t* IDF_FORM;
+
+#endif // _APPRESOURCEID_H_
index 7be1215..3e55fcb 100644 (file)
@@ -69,6 +69,8 @@ public:
 
        // Called when the application control request is received from the caller application.
        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);
 
 private:
        //internal function to process AppControl request.
index 8278c48..5609a0c 100644 (file)
@@ -10,7 +10,9 @@
     <Apps>
         <ApiVersion>2.0</ApiVersion>
         <Privileges>
+            <Privilege>http://tizen.org/privilege/uimanager</Privilege>
             <Privilege>http://tizen.org/privilege/application.launch</Privilege>
+            <Privilege>http://tizen.org/privilege/power</Privilege>
             <Privilege>http://tizen.org/privilege/setting</Privilege>
             <Privilege>http://tizen.org/privilege/messaging.sms</Privilege>
             <Privilege>http://tizen.org/privilege/vibrator</Privilege>
index 4c14ba7..4b24d62 100644 (file)
@@ -4,14 +4,14 @@
 -->
 <!DOCTYPE ScenePanel SYSTEM "UIForm.dtd">
 
-<ScenePanel Bversion="2.0.0.201302250946" Dversion="20120315">
+<ScenePanel Bversion="2.0.0.201303111438" Dversion="20120315">
     <Panel id="IDL_DTMF_KEYPAD_PANEL">
         <property backgroundColor="#000000" backgroundColorOpacity="50" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
         <layout height="720" mode="Portrait" type="LAYOUT_RELATIVE" width="720" x="0" y="0"/>
         <layout height="660" mode="Landscape" type="LAYOUT_RELATIVE" width="560" x="0" y="0"/>
     </Panel>
     <TextBox id="IDC_TEXTBOX" parent="IDL_DTMF_KEYPAD_PANEL">
-        <property disabledBackgroundBitmapPath="" disabledColor="#FFFFFF" disabledColorOpacity="0" disabledTextColor="" highlightedBackgroundBitmapPath="" highlightedColor="#FFFFFF" highlightedColorOpacity="0" highlightedTextColor="" lineSpacingExtra="1" lineSpacingMultiplier="1" normalBackgroundBitmapPath="" normalColor="#FFFFFF" normalColorOpacity="0" normalTextColor="#FFFFFF" text="" textAlignment="ALIGNMENT_LEFT" textSize="94" textboxBorder="TEXT_BOX_BORDER_NONE"/>
+        <property disabledBackgroundBitmapPath="" disabledColor="#FFFFFF" disabledColorOpacity="0" disabledTextColor="" highlightedBackgroundBitmapPath="" highlightedColor="#FFFFFF" highlightedColorOpacity="0" highlightedTextColor="#FFFFFF" lineSpacingExtra="1" lineSpacingMultiplier="1" normalBackgroundBitmapPath="" normalColor="#FFFFFF" normalColorOpacity="0" normalTextColor="#FFFFFF" text="" textAlignment="ALIGNMENT_LEFT" textSize="94" textboxBorder="TEXT_BOX_BORDER_NONE"/>
         <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="114" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DTMF_KEYPAD_PANEL" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="35" marginRight="35" marginTop="10" mode="Portrait" rightRelation="IDL_DTMF_KEYPAD_PANEL" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_DTMF_KEYPAD_PANEL" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="650" x="35" y="10"/>
         <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="114" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DTMF_KEYPAD_PANEL" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="35" marginRight="35" marginTop="10" mode="Landscape" rightRelation="IDL_DTMF_KEYPAD_PANEL" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_DTMF_KEYPAD_PANEL" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="490" x="35" y="10"/>
     </TextBox>
diff --git a/src/AppResourceId.cpp b/src/AppResourceId.cpp
new file mode 100644 (file)
index 0000000..f563fb2
--- /dev/null
@@ -0,0 +1,3 @@
+#include "AppResourceId.h"
+
+const wchar_t* IDF_FORM = L"IDF_FORM";
index 4a1db2e..be2b3f3 100644 (file)
@@ -348,7 +348,9 @@ CallApp::HandleDialCallAppControlRequest(RequestId reqId,const IMap* pArgsMap)
                        {
                                //KEEP "__initialSceneId" as empty and return false from "OnAppInitialized()"
                                AppLog("Terminate Phone Application");
+                               AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, appControlResult, null);
                                Terminate();
+                               return;
                        }
 
                }
@@ -405,6 +407,7 @@ CallApp::HandleDialCallAppControlRequest(RequestId reqId,const IMap* pArgsMap)
                                }
                                else
                                {
+                                       AppLog("Outgoing call");
                                        pSceneManager->GoForward( ForwardSceneTransition( nextScene), __pLaunchArgs);
                                }
                                appControlResult = APP_CTRL_RESULT_SUCCEEDED;
@@ -428,7 +431,7 @@ bool
 CallApp::CheckNumberIsValid(String phoneNumber)
 {
        //Pattern to compare all characters except 0-9 * # P ; , +
-       String phoneNumberPattern(L"[^0-9*#P;,+]");
+       String phoneNumberPattern(L"[^0-9*#P,+]");
        RegularExpression checkPhoneNumber;
        checkPhoneNumber.Construct(phoneNumberPattern);
        //If there is any character other than these listed above then display invalid number
@@ -437,3 +440,28 @@ CallApp::CheckNumberIsValid(String phoneNumber)
        return !resultMatch;
 
 }
+
+void
+CallApp::SetTopMostWindow(bool bTopMost)
+{
+       AppLogDebug("bTopMost = %d",bTopMost);
+       result res = E_FAILURE;
+       //ToDO: Need to see if there is better way to handle
+       //this case
+       if(bTopMost == true)
+       {
+               GetAppFrame()->GetFrame()->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_HIGH);
+               if(PowerManager::IsScreenOn() == false)
+               {
+                       res = PowerManager::TurnScreenOn();
+               }
+               res = PowerManager::KeepScreenOnState(true,false);
+
+       }
+       else
+       {
+               GetAppFrame()->GetFrame()->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_NORMAL);
+               PowerManager::KeepScreenOnState(false);
+       }
+
+}
index b731b03..ad4175f 100644 (file)
@@ -26,6 +26,7 @@
 #include "CallPresentationModel.h"
 #include "CallSceneRegister.h"
 #include "CallTypes.h"
+#include "CallApp.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
@@ -814,6 +815,10 @@ IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,        const SceneI
                delete pArgs;
                pArgs = null;
        }
+       CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
+       pCallApp->SetTopMostWindow(true);
+
+
 }
 
 void
@@ -854,6 +859,8 @@ IncomingCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneI
                }
 
        }
+       CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
+       pCallApp->SetTopMostWindow(false);
 }
 
 result
index d724bd1..cd3d870 100644 (file)
@@ -30,6 +30,11 @@ using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Runtime;
 
 static const wchar_t* RINGTONE_PATH = L"/opt/usr/apps/zktdpemtmw/shared/data/ringtone_sdk.mp3";
+static const wchar_t* CALLCONNECTTONE_PATH = L"/opt/usr/apps/zktdpemtmw/shared/data/Call_Connect.ogg";
+static const wchar_t* CALLDISCONNECTTONE_PATH = L"/opt/usr/apps/zktdpemtmw/shared/data/Call_Disconnect.ogg";
+static const wchar_t* MINUTEREMINDERTONE_PATH = L"/opt/usr/apps/zktdpemtmw/shared/data/Call_RecordStart.wav";
+static const wchar_t* CALLWAITINGTONE_PATH = L"/opt/usr/apps/zktdpemtmw/shared/data/Call_WaitingTone.wav";
+
 
 SoundManager::SoundManager(void)
        : __pSoundCallSession(null)
@@ -205,13 +210,17 @@ SoundManager::OnTimerExpired(Timer& timer)
                        __pPlayer->Construct(*this);
                }
 
-               reminderTonePath.Append(RINGTONE_PATH);
-               __pPlayer->OpenFile(reminderTonePath,false);
-               __pPlayer->SetLooping(false);
-               __pPlayer->SetVolume(80);
-               SetSoundMode(SOUND_MODE_MEDIA);
-               __pPlayer->Play();
-               SetSoundMode(SOUND_MODE_VOICE);
+               reminderTonePath.Append(MINUTEREMINDERTONE_PATH);
+               if(reminderTonePath.IsEmpty() == false)
+               {
+                       __pPlayer->Close();
+                       __pPlayer->OpenFile(reminderTonePath,false);
+                       __pPlayer->SetLooping(false);
+                       __pPlayer->SetVolume(80);
+                       SetSoundMode(SOUND_MODE_MEDIA);
+                       __pPlayer->Play();
+                       SetSoundMode(SOUND_MODE_VOICE);
+               }
        }
        /*else if(ReminderToneSetStatus == false)
        {
@@ -233,23 +242,21 @@ SoundManager::SetDisconnectTone(void)
 
        if(disconnectToneSetStatus == true)
        {
-               disconnectTonePath.Append(RINGTONE_PATH);
-
+               disconnectTonePath.Append(CALLDISCONNECTTONE_PATH);
                if(__pPlayer == null)
                {
                        __pPlayer =  new (std::nothrow) Player();
                        __pPlayer->Construct(*this);
                }
-
                if(disconnectTonePath.IsEmpty() == false)
                {
+                       __pPlayer->Close();
                        __pPlayer->OpenFile(disconnectTonePath,false);
                        __pPlayer->SetLooping(false);
                        __pPlayer->SetVolume(80);
                        SetSoundMode(SOUND_MODE_MEDIA);
                        __pPlayer->Play();
                }
-
        }
 
 }
@@ -264,7 +271,7 @@ SoundManager::SetMinuteReminderTone()
 
        if(reminderToneSetStatus == true)
        {
-               __timer.StartAsRepeatable(20000);
+               __timer.StartAsRepeatable(60000);
        }
 
 }
@@ -280,18 +287,19 @@ SoundManager::SetConnectTone()
        vconf_get_bool(VCONFKEY_CISSAPPL_CALL_CONNECT_TONE_BOOL, &unknownRejectStatus);
        bool connectToneSetStatus = unknownRejectStatus;
 
-       connectTonePath.Append(RINGTONE_PATH);
+       connectTonePath.Append(CALLCONNECTTONE_PATH);
 
        if(connectToneSetStatus == true)
        {
+
                if(__pPlayer == null)
                {
                        __pPlayer =  new (std::nothrow) Player();
                        r = __pPlayer->Construct(*this);
                }
-
-               if(connectTonePath.IsEmpty() == false)
+               if (connectTonePath.IsEmpty() == false)
                {
+
                        r = __pPlayer->OpenFile(connectTonePath,false);
                        r = __pPlayer->SetLooping(false);
                        r = __pPlayer->SetVolume(80);
@@ -308,6 +316,22 @@ SoundManager::StartAlert(String& contactRingTone)
        if(__pSoundCallSession != null)
        {
                AppLogDebug("No Alert already in call");
+               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;
        }
        else
index dd2e5cc..9059e43 100644 (file)
@@ -919,6 +919,7 @@ TelephonyManager::DialOutgoingCall(String& contactNumber, bool isEmergency)
 {
        TelCallDial_t structDialCall;
 
+       AppLogDebug("Enter");
        //conversion "contactNumber" to char*
        const wchar_t* pContact = contactNumber.GetPointer();
        int len = contactNumber.GetLength()+1;