Prevent issue fix. Nabi issues fixed
[apps/osp/Call.git] / src / CallApp.cpp
index 3545d3d..99397f9 100644 (file)
@@ -401,13 +401,6 @@ CallApp::HandleDialCallAppControlRequest(RequestId reqId,const IMap* pArgsMap,co
                //Check if its a valid number
                if(CheckNumberIsValid(phoneNumber) == false)
                {
-                       //Show messageBox showing automatic call rejection
-                       MessageBox InvalidNumberMsgBox;
-                       InvalidNumberMsgBox.Construct(AppUtility::GetResourceString(IDS_INVALID_NUMBER), L"",MSGBOX_STYLE_NONE,1000);
-                       int modalResult = 0;
-                       // Calls ShowAndWait() : Draws and Shows itself and processes events
-                       InvalidNumberMsgBox.ShowAndWait(modalResult);
-
                        //go back to previous scene if App was already running, else exit application.
                        if(__initialSceneId.IsEmpty() == true)
                        {
@@ -519,15 +512,18 @@ CallApp::SetTopMostWindow(bool bTopMost)
                GetAppFrame()->GetFrame()->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_HIGHEST);
                if(PowerManager::IsScreenOn() == false)
                {
+                       AppLogDebug("TurnScreenOn");
                        res = PowerManager::TurnScreenOn();
+                       AppLogDebug("TurnScreenOn %d",res);
                }
-               res = PowerManager::KeepScreenOnState(true,false);
+               AppManager::GetInstance()->AddActiveAppEventListener(*this);
 
        }
        else
        {
                GetAppFrame()->GetFrame()->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_NORMAL);
                PowerManager::KeepScreenOnState(false);
+               AppManager::GetInstance()->RemoveActiveAppEventListener(*this);
        }
        //Unlock the phone if its locked
 /*     if(LockManager::GetInstance()->IsLocked())
@@ -537,3 +533,16 @@ CallApp::SetTopMostWindow(bool bTopMost)
        }*/
 
 }
+void
+CallApp::OnActiveAppChanged(const String& appId)
+{
+       AppLogDebug("Enter %ls",appId.GetPointer());
+       if(GetAppId().Equals(appId) == true)
+       {
+               result res = PowerManager::KeepScreenOnState(true,false);
+               AppLogDebug("KeepScreenOnState %d",res);
+
+
+       }
+
+}