uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp
branchRCL_3
changeset 55 aecbbf00d063
parent 51 fcdfafb36fe7
child 56 d48ab3b357f1
--- a/uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp	Thu Aug 19 10:11:06 2010 +0300
+++ b/uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp	Tue Aug 31 15:28:30 2010 +0300
@@ -32,7 +32,6 @@
 #endif
 #include "avkoninternalpskeys.h"     // KAknIdleAppWindowGroupId
 #include <AknCapServerDefs.h>
-#include <activeidle2domainpskeys.h>
 #include <eikpriv.rsg>
 #include <coedef.h>
 #include <eiksvdef.h>
@@ -74,17 +73,13 @@
     #include <akntranseffect.h> // for Transition effect enumerations
 #endif
 
-#ifdef SYMBIAN_BUILD_GCE
-    #include <alf/alfclientbase.h>
-#endif    
-
 #ifdef RD_INTELLIGENT_TEXT_INPUT
 #include <AvkonInternalCRKeys.h>
 
 #include "akncapserverdiscreetpopuphandler.h"
 
 const TUid KPtiEnginePSUid = {0x101F8610}; // Same as PtiEngine dll
-
+const TUid KPhoneUid = { 0x100058B3 };
 enum TPtiEnginePSKeys
     {
     EKeyMapPropertyCount,
@@ -107,7 +102,7 @@
 const TInt KKeyEventICodeThreshold = 0x001f;
 const TInt KMaxLanguageCodeLength = 6; // 5 digits + separator
 
-const TInt KRemoveBlankDelay = 200000; // 0.2s     
+                
 
 _LIT(KEikSrvUIResFileName, "z:\\resource\\eiksrvui.rsc");
 _LIT_SECURITY_POLICY_PASS(KPassReadPolicy);
@@ -153,7 +148,6 @@
 CAknCapAppServerAppUi::~CAknCapAppServerAppUi()
     {
     delete iAlternateFS;
-    delete iTelephonyIdleUidSubscriber;
     delete iGlobalNotesAllowedSubscriber;
     
     if (iKeyCaptureControl)
@@ -172,8 +166,7 @@
     delete iMMCUnlock;
     delete iIdler;
     iEikSrv.Close(); // this shouldn't be connected here anyway
-    delete iPtiEngine;                          
-    iAlfClient.Close();	
+    delete iPtiEngine;          
     }
 
 _LIT(KProductSpecificHalFile, "z:\\system\\data\\ProductSpecificHalParams.txt");
@@ -231,11 +224,7 @@
 
     me->iEikSrv.AllowNotifierAppServersToLoad();
     me->iEikSrv.Close(); // currently there is no use to keep this session alive.
-    
-#ifdef SYMBIAN_BUILD_GCE
-    TRAP(err, CAlfAsynchStartup::StartL());
-#endif     
-    
+
     return err;
     }
 
@@ -277,8 +266,6 @@
     User::SetCritical(User::ESystemCritical);
 
     InitiateOFNStatus();
-    
-    iEikonEnv->SetSystem( ETrue );
 
     // install default FEP if none set before
     if (iEikonEnv->FepUid() == KNullUid)
@@ -371,6 +358,10 @@
     TFileName fileName(KEikSrvUIResFileName);
     BaflUtils::NearestLanguageFile(iEikonEnv->FsSession(),fileName);
     iResourceFileOffset=iCoeEnv->AddResourceFileL(fileName);
+
+    // Create FSW
+    iFSControl= new (ELeave) CAknFastSwapWindowControl(*this);
+    iFSControl->ConstructL();
     
     // MMC unlocker
     iMMCUnlock = CAknMMCPasswordRequester::NewL();
@@ -441,16 +432,6 @@
 
     iGlobalNotesAllowedSubscriber->Subscribe();
     
-    // Start listening "telephony idle uid" property.
-    User::LeaveIfError(iTelephonyIdleUidProperty.Attach(
-        KPSUidAiInformation, 
-        KActiveIdleUid));
-
-    iTelephonyIdleUidSubscriber = new (ELeave) CPropertySubscriber(
-        TCallBack(TelephonyIdleUidCallBack, this), 
-        iTelephonyIdleUidProperty);
-
-    iTelephonyIdleUidSubscriber->Subscribe();    
 #ifdef RD_INTELLIGENT_TEXT_INPUT
          
     TInt err1 = 0;         
@@ -485,14 +466,8 @@
 
     // Create capserver discreetpopuphandler     
     CAknCapServerDiscreetPopupHandler::CreateDiscreetPopupHandlerL();     
-	
-    LoadAlternateFsPlugin();
-    // Create FSW
-    if ( iAlternateFS == NULL )
-        {
-        iFSControl= new (ELeave) CAknFastSwapWindowControl(*this);
-        iFSControl->ConstructL();
-        }
+	LoadAlternateFsPlugin();
+
 	ProcessInitFlipStatus();
     }
     
@@ -586,22 +561,19 @@
                     }
                 else
                     {
-                    if ( iFSControl )
-                    	{
-                        if ( aMessage.Int0() )
-                            {
-                            TInt err = KErrNone;
-                            TRAP( err, iFSControl->InitializeWindowGroupListL( EFalse ));
-                            if ( !err )
-                                {   
-                                iFSControl->RunFastSwapL();             
-                                }
+                    if ( aMessage.Int0() )
+                        {
+                        TInt err = KErrNone;
+                        TRAP( err, iFSControl->InitializeWindowGroupListL( EFalse ));
+                        if ( !err )
+                            {   
+                            iFSControl->RunFastSwapL();             
                             }
-                        else
-                            {
-                            iFSControl->CloseFastSwap();
-                            }  
-                    	}
+                        }
+                    else
+                        {
+                        iFSControl->CloseFastSwap();
+                        }                        
                     }
                 }
             aMessage.Complete(KErrNone);
@@ -612,10 +584,7 @@
             TInt err = UpdateTaskListL( ETrue );
             if ( err != KErrNone )
                 {
-                if ( iFSControl )
-                	{
-                    iFSControl->CloseFastSwap();
-                	}
+                iFSControl->CloseFastSwap();
                 }
             aMessage.Complete(err);
             break;
@@ -810,15 +779,11 @@
         iAlternateFS->HandleShortAppKeyPress();
         return ETrue;
         }
-    if ( iFSControl )
-    	{
-        if (iFSControl->IsVisible())
-            {
-            iFSControl->HandleShortAppsKeyPressL();
-            return ETrue;
-            }
-    	}
-    
+    if (iFSControl->IsVisible())
+        {
+        iFSControl->HandleShortAppsKeyPressL();
+        return ETrue;
+        }
         
     return EFalse;
     }
@@ -833,25 +798,21 @@
             }
         else
             {
-            if ( iFSControl )
-            	{
-                if ( iFSControl->IsVisible())
+            if (iFSControl->IsVisible())
+                {
+                iFSControl->HandleLongAppsKeyPressL();
+                }
+            else
+                {
+                if (iFSControl->VisibleWindowGroupsCountL()<1)
                     {
-                    iFSControl->HandleLongAppsKeyPressL();
+                    return EFalse;
                     }
                 else
                     {
-                    if (iFSControl->VisibleWindowGroupsCountL()<1)
-                        {
-                        return EFalse;
-                        }
-                    else
-                        {
-                        iFSControl->RunFastSwapL();
-                        }
+                    iFSControl->RunFastSwapL();
                     }
-            	}
-                        
+                }            
             }
         }
     return ETrue;
@@ -873,26 +834,12 @@
         }
     }
 
-TInt CAknCapAppServerAppUi::RemoveBlankCallBack( TAny* aThis )
-    {
-    static_cast<CAknCapAppServerAppUi*>( aThis )->DoRemoveBlank();
-    return EFalse;
-    }
-
-void CAknCapAppServerAppUi::BlankScreenL(TBool aBlank, TBool /* aToForeground */)
+void CAknCapAppServerAppUi::BlankScreenL(TBool aBlank, TBool aToForeground)
     {
     if (aBlank)
         {
         if (++iBlankWinRefCount == 1)
             {
-            delete iRemoveBlankCallBack;
-            iRemoveBlankCallBack = NULL;
-
-		    // We are ignoring the foreground parameter because we only have one 
-            // type of blanking behaviour in AlfClient. Act as if ETrue
-            iAlfClient.BlankScreen(ETrue);	
-            iForegroundBlankScreen = ETrue; // always as if foreground blanking
-/*
             ASSERT(!iBlankWin);
             if (aToForeground)
                 {
@@ -904,30 +851,16 @@
                 }
             iBlankWin = CAknServBlankWin::NewL(iBackdropWindowGroup, iStatusPane);
             iForegroundBlankScreen = aToForeground;
-*/
             }
         }
     else if (--iBlankWinRefCount <= 0)
         {
         iBlankWinRefCount = 0;
-
-        // Blanking IPC is delayed or restarted
-        delete iRemoveBlankCallBack;
-        iRemoveBlankCallBack = NULL;
-        iRemoveBlankCallBack = CPeriodic::NewL(CActive::EPriorityLow);     
-        
-        iRemoveBlankCallBack->Start(
-            KRemoveBlankDelay,
-            KRemoveBlankDelay,
-            TCallBack(RemoveBlankCallBack, this));
-        
-
-/*        if (iForegroundBlankScreen)
+        if (iForegroundBlankScreen)
             {
-            */
 #ifdef RD_UI_TRANSITION_EFFECTS_LAYOUT_SWITCH
+            CWsScreenDevice* screen = iEikonEnv->ScreenDevice();
             /*
-            CWsScreenDevice* screen = iEikonEnv->ScreenDevice();
             RWsSession& ws = iEikonEnv->WsSession();
             TInt wgId = ws.GetFocusWindowGroup();
             CApaWindowGroupName* wgName = CApaWindowGroupName::NewL(ws, wgId);
@@ -941,28 +874,18 @@
             //        AknTransEffect::GfxTransParam( KTfxServerUid )
             //        );
 
-//            GfxTransEffect::EndFullScreen();
+            GfxTransEffect::EndFullScreen();
 #endif
-/*            iBackdropWindowGroup.SetOrdinalPosition(1, ECoeWinPriorityNormal);
-           }
+            iBackdropWindowGroup.SetOrdinalPosition(1, ECoeWinPriorityNormal);
+            }
         delete iBlankWin;
         iBlankWin = 0;
-*/
         iForegroundBlankScreen = EFalse;
         } 
     }
 
-void CAknCapAppServerAppUi::DoRemoveBlank()
-    {
-    RDebug::Print( _L("CAknCapAppServerAppUi::DoRemoveBlank"));
-    iAlfClient.BlankScreen(EFalse); 
-    delete iRemoveBlankCallBack;
-    iRemoveBlankCallBack = NULL;
-    }
-
 void CAknCapAppServerAppUi::SwapLayoutSwitchBlankScreenL()
     {
-    	/*
     if (iBlankWin)
         {
         if (!iForegroundBlankScreen)
@@ -975,7 +898,6 @@
         delete iBlankWin;
         iBlankWin = newBlankWin;
         }
-        */
     }
 
 TBool CAknCapAppServerAppUi::IsDisplayingForegroundBlankScreen() const
@@ -1023,9 +945,7 @@
     
 void CAknCapAppServerAppUi::HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination)
     {
-    if ( iMessageReaderLongPressDetector && 
-    	 !IsAppsKeySuppressed() && 
-    	 ( iFSControl == NULL || !iFSControl->IsDisplayed() ) )
+    if ( iMessageReaderLongPressDetector && !IsAppsKeySuppressed() && !iFSControl->IsDisplayed() )
         {
         // Message Reader can be launched by long pressing left soft key 
         // events need to be intercepted/consumed before they are forwarded to cba
@@ -1085,7 +1005,7 @@
 TInt CAknCapAppServerAppUi::UpdateTaskListL( TBool aTaskListRefreshNeeded )
     {
     TInt err = KErrNone;
-    if ( iFSControl && iFSControl->IsDisplayed() )
+    if ( iFSControl->IsDisplayed() )
         {
         // update window group list (task list)
         TInt windowGroupListChanged = ETrue;
@@ -1131,9 +1051,7 @@
     TBool isNumber = EFalse;
     numCategory = (TChar(aChar)).GetBdCategory();
     isNumber = ((numCategory == TChar::EEuropeanNumber) || (numCategory == TChar::EArabicNumber) ||
-               (numCategory == TChar::EEuropeanNumberTerminator) || 
-               ( numCategory == TChar::EEuropeanNumberSeparator ) ||
-               (aChar == 0x2E) || 
+               (numCategory == TChar::EEuropeanNumberTerminator) || (aChar == 0x2E) || 
                (aChar == 0x2A) || (aChar == 0x3D) || (aChar == 0x2F));
     return isNumber;
 }
@@ -1421,15 +1339,6 @@
     return KErrNone;
     }
 
-TInt CAknCapAppServerAppUi::TelephonyIdleUidCallBack(TAny* aPtr)
-    {
-    CAknCapAppServerAppUi* self = static_cast<CAknCapAppServerAppUi*>(aPtr);
-    if (self)
-        {
-        self->HandlePropertyChange(KActiveIdleUid);
-        }
-    return KErrNone;
-    }
     
 void CAknCapAppServerAppUi::HandlePropertyChange(const TInt aProperty)
     {
@@ -1437,29 +1346,15 @@
         {
         case KUikGlobalNotesAllowed:
             {
-            TInt globalNotesAllowed = 0;
-            TInt err = iTelephonyIdleUidProperty.Get(globalNotesAllowed);
-            if(!err && globalNotesAllowed)
+            TUid uid = KPhoneUid;
+            TApaTaskList taskList ( CEikonEnv::Static ()->WsSession () );
+            TApaTask task = taskList.FindApp ( uid );
+            if ( task.Exists() )
                 {
-                // Global notes allowed, so the boot is finished. Now the idle app uid and its
-                // window group id can be fetched.
-                HandlePropertyChange(KActiveIdleUid);
-                }
-            }
-            break;
-        case KActiveIdleUid:
-            {
-            TInt idleAppUid = 0;
-            TInt err = iTelephonyIdleUidProperty.Get(idleAppUid);
-            if(!err)
-                {
-                // Fetch the Idle application window group id.
-                TApaTaskList taskList(CEikonEnv::Static()->WsSession());
-                TApaTask task = taskList.FindApp(TUid::Uid(idleAppUid));
-                TInt wgId = task.WgId();
-                
+                TInt wgId = task.WgId ();
                 // Save the window group id to PubSub. 
-                RProperty::Set(KPSUidAvkonInternal, KAknIdleAppWindowGroupId, wgId);     
+                RProperty::Set ( KPSUidAvkonInternal, KAknIdleAppWindowGroupId,
+                        wgId );
                 }
             }
             break;