uifw/AvKon/src/AknDef.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
--- a/uifw/AvKon/src/AknDef.cpp	Tue Aug 31 15:28:30 2010 +0300
+++ b/uifw/AvKon/src/AknDef.cpp	Wed Sep 01 12:16:19 2010 +0100
@@ -21,8 +21,13 @@
 #include "AknDef.h"
 #include <vwsdef.h> // TVwsViewId
 
-const TUid KPhoneUid = { 0x100058B3 };
-const TUid KPhoneViewUid = { 0x10282D81 };
+#ifdef RD_IDLE_SEPARATION
+#include <e32property.h>
+#include <activeidle2domainpskeys.h>
+#endif
+
+const TInt KPhoneUid( 0x100058B3 );
+const TInt KActiveIdle2Uid( 0x102750F0 );
 
 // -----------------------------------------------------------------------------
 // AknDef::GetPhoneIdleViewId()
@@ -33,9 +38,56 @@
 //
 EXPORT_C TInt AknDef::GetPhoneIdleViewId(TVwsViewId& aViewId)
     {
-    aViewId.iAppUid = KPhoneUid;
-    aViewId.iViewUid = KPhoneViewUid;
-    return KErrNone;
+    TInt uidValue = NULL;
+    TInt retVal = KErrNone;
+
+#ifdef RD_IDLE_SEPARATION
+    retVal = RProperty::Get( KPSUidAiInformation, KActiveIdleUid, uidValue );
+    if(retVal == KErrNotFound)
+        {
+        retVal = KErrNone;
+        uidValue = KPhoneUid;
+        }
+#else
+    uidValue = KPhoneUid;  // Was defined as KAknPhoneIdleViewId in akndef.h.
+#endif // RD_IDLE_SEPARATION
+
+    if(retVal == KErrNone)
+        {
+        aViewId = TVwsViewId(TUid::Uid(uidValue), TUid::Uid(uidValue));
+        }
+        
+#ifdef RD_BOOT_CUSTOMIZABLE_AI
+
+    // ActiveIdle2 is view-based, so this is a temporary fix
+    // in order to be able to activate idle from app shell with menu-key,
+    // until a proper way for view uid acquisition is made.
+    
+    TInt pluginRangeStart;
+    TInt pluginRangeEnd;
+    
+    RProperty::Get( KPSUidAiInformation, KAIActivePluginRangeStart, pluginRangeStart );
+    RProperty::Get( KPSUidAiInformation, KAIActivePluginRangeEnd, pluginRangeEnd );
+    
+    if ( uidValue >= pluginRangeStart && uidValue <= pluginRangeEnd && pluginRangeEnd )
+        {
+        uidValue = KActiveIdle2Uid;
+        aViewId.iAppUid = TUid::Uid( uidValue );
+        }
+    else if ( uidValue >= pluginRangeStart ) // end UID may not be defined
+        {
+        uidValue = KActiveIdle2Uid;
+        aViewId.iAppUid = TUid::Uid( uidValue );
+        }
+    
+    if ( uidValue == KActiveIdle2Uid )
+        {
+        aViewId.iViewUid = TUid::Uid(1);
+        }
+        
+#endif // RD_BOOT_CUSTOMIZABLE_AI
+
+    return retVal; 
     }
 
 //  End of File