--- a/appsupport_plat/oom_monitor_plugin_api/inc/oommonitorplugin.h Thu Jul 15 18:49:38 2010 +0300
+++ b/appsupport_plat/oom_monitor_plugin_api/inc/oommonitorplugin.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -78,6 +78,16 @@
* between low and good memory states.
*/
virtual void MemoryGood() = 0;
+
+ /**
+ * Function: AppId
+ * The function return the UID3 of the process which implements the plugin
+ * By default, the Null UID [KNullUid] is returned.
+ * The plugin can override this API with their own implementation.
+ * COomMonitorPlugin monitor plugins
+ * @return the UID3 the application which implements the plugin
+ */
+ virtual const TUid AppId() const;
public:
/**
@@ -174,6 +184,16 @@
public:
IMPORT_C static CAppOomMonitorPlugin* NewL(TUid aAppUid);
+ /**
+ * Function: AppId
+ * The function return the UID3 of the process which implements the plugin
+ * By default, the Null UID [KNullUid] is returned.
+ * The plugin can override this API with their own implementation.
+ * COomMonitorPlugin monitor plugins
+ * @return the UID3 the application which implements the plugin
+ */
+ const TUid AppId() const;
+
private:
CAppOomMonitorPlugin(TUid aAppUid);
--- a/appsupport_plat/system_application_notification_api/inc/coreapplicationuisdomainpskeys.h Thu Jul 15 18:49:38 2010 +0300
+++ b/appsupport_plat/system_application_notification_api/inc/coreapplicationuisdomainpskeys.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -332,4 +332,31 @@
ECoreAppUIsProfileActivatedNoteShown = 1
};
+
+
+// =============================================================================
+// GAN Mode API
+// =============================================================================
+
+// Use TUid KPSUidCoreApplicationUIs = { 0x101F8767 }
+
+const TUint32 KCoreAppUIsGanPropertyGanMode = 0x00000601;
+
+/** GANmode (actual network mode) */
+enum TCoreAppUIsGanMode
+ {
+ EGanModeUnspecified = 0, // We are not aware of MS GAN/GERAN state
+ EGanModeGAN = 1, // MS is in GAN
+ EGanModeGeran = 2 // MS is in GERAN
+ };
+
+
+// =============================================================================
+// GAN Signal strength
+// =============================================================================
+
+// Use TUid KPSUidCoreApplicationUIs = { 0x101F8767 }
+
+const TUint32 KCoreAppUIsGanPropertySignalLevel = 0x00000602;
+
#endif // COREAPPLICATIONUISDOMAINPSKEYS_H
--- a/contextframework/cfw/src/cfclient/cfcontextservice.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/contextframework/cfw/src/cfclient/cfcontextservice.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -291,7 +291,7 @@
TInt err = KErrNone;
// Stream context query set into buffer
- HBufC8* buffer = buffer = WriteStreamContextQueryLC( aContextQuery );
+ HBufC8* buffer = WriteStreamContextQueryLC( aContextQuery );
HBufC8* resultBuffer = HBufC8::NewLC( iRequestBufferSize );
TPtr8 resultBufferPtr = resultBuffer->Des();
TPckg<TInt> bufferSizePtr( iRequestBufferSize );
--- a/contextframework/cfw/src/cfscriptengine/cfpersistentdata.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/contextframework/cfw/src/cfscriptengine/cfpersistentdata.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -183,7 +183,7 @@
{
FUNC_LOG;
- for (TInt i = iPendingTasks.Count(); i > 0; i--)
+ for (TInt i = iPendingTasks.Count()-1; i >= 0; i--)
{
CCFPendingPersistencyTask* iTask = iPendingTasks[i];
if ( iTask->Mode() == CCFPendingPersistencyTask::EStore )
--- a/contextframework/cfwplugins/PSStateSourcePlugIn/src/psstatesourceplugin.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/contextframework/cfwplugins/PSStateSourcePlugIn/src/psstatesourceplugin.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -247,7 +247,7 @@
TInt psValue;
TLex lex( psValueDesc );
- lex.Val(psValue);
+ User::LeaveIfError( lex.Val(psValue) );
intmapper->AddMappingL(psValue, contextValue);
}
--- a/contextframework/cfwplugins/orientationactionplugin/src/orientationactionplugin.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/contextframework/cfwplugins/orientationactionplugin/src/orientationactionplugin.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -84,7 +84,6 @@
CCFActionPlugIn::TExecutionTime time = CCFActionPlugIn::ENone;
- const RKeyValueArray& params = aActionIndication->Parameters();
// Check for action ID: Orientation
if( aActionIndication->Identifier().CompareF(
KOrientationAction ) == KErrNone )
--- a/coreapplicationuis/Rfs/eabi/rfsU.DEF Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/Rfs/eabi/rfsU.DEF Thu Aug 19 10:05:08 2010 +0300
@@ -33,4 +33,6 @@
_ZTV12CRfsShutdown @ 32 NONAME ; #<VT>#
_ZTV13CRfsCompleter @ 33 NONAME ; #<VT>#
_ZTV9CRfsAppUi @ 34 NONAME ; #<VT>#
+ _ZTI12CRfsConTimer @ 35 NONAME
+ _ZTV12CRfsConTimer @ 36 NONAME
--- a/coreapplicationuis/Rfs/group/rfs.mmp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/Rfs/group/rfs.mmp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -41,6 +41,7 @@
SOURCE rfsShutdown.cpp
SOURCE rfsCompleter.cpp
SOURCE rfsConnectionObserver.cpp
+SOURCE rfscontimer.cpp
START RESOURCE ../src/rfs.rss
TARGETPATH RESOURCE_FILES_DIR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/Rfs/inc/rfsConTimer.h Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __RFSCONTIMER_H
+#define __RFSCONTIMER_H
+
+#include <e32base.h>
+#include <e32def.h>
+#include <e32std.h>
+
+#include "rfsConnectionObserver.h"
+
+class CRfsConnectionObserver;
+
+class CRfsConTimer : public CActive
+ {
+ private:
+
+ CRfsConTimer(CRfsConnectionObserver * aRfsConnectionObserver); // Construction
+
+
+
+public:
+
+ static CRfsConTimer* CRfsConTimer::NewL(CRfsConnectionObserver * aRfsConnectionObserver);
+ ~CRfsConTimer(); // Destruction
+ void IssueTimerRequest(); // issue request
+
+protected:
+ void DoCancel(); // Cancel request
+ void RunL(); // service completed request.
+
+public:
+
+ RTimer iTimer; // Asynchronous service provider.
+ CRfsConnectionObserver* iRfsConnectionObserver;
+
+private: // friend classes
+
+ friend class CRfsConnectionObserver;
+ };
+
+#endif //__RFSCONTIMER_H
--- a/coreapplicationuis/Rfs/inc/rfsConnectionObserver.h Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/Rfs/inc/rfsConnectionObserver.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,16 @@
#ifndef __RFSPDPOBSERVER_H
#define __RFSPDPOBSERVER_H
+#include <AknWaitDialog.h>
+
+// P&S KEYS FROM SIP & PDP CONNECTION
+#include <e32property.h>
+#include <pdpcontextmanagerpskeys.h>
+#include <sipsystemstatemonitorpskeys.h>
+
+#include "rfsConTimer.h"
+
+class CRfsConTimer;
enum TRfsConnectionCloseState
{
@@ -26,7 +36,7 @@
EPdpConnectionClose // this should be the last enum
};
-NONSHARABLE_CLASS( CRfsConnectionObserver ): CActive
+NONSHARABLE_CLASS( CRfsConnectionObserver ): public CActive
{
public:
@@ -62,13 +72,22 @@
void ReOpenPDPConnection();
void ReportRfsFailureToSip();
void ReportRfsCompletionToSip();
+ /**
+ * Subscribes PDP property
+ *
+ * @since S60 v3.1
+ */
+ void Subscribe();
+
+
-private:
+protected:
/**
* From base class CActive
*/
-
+ void DoCancel();
+
/**
* From CActive
*
@@ -76,25 +95,13 @@
*/
void RunL();
- /**
- * From CActive
- *
- * @since S60 v3.1
- */
- void DoCancel();
-
+
private:
/**
* New methods
*/
- /**
- * Subscribes PDP property
- *
- * @since S60 v3.1
- */
- void Subscribe();
/**
* Dismisses closing connections dialog
@@ -161,14 +168,17 @@
*/
TBool iAllConnectionClosed;
TBool iIsWaitForDialogExecuted;
- TInt iIsPDPFeatureEnabled;
TBool iIsSIPConnectionsPresent;
TBool iIsDialogNeedToBeDisplayed;
TBool iIsSipInformedForClosingAllConnection;
TBool iIsPDPInformedforClosingAllConnection;
TBool iIsClosingConnectionsApplicable;
+
+public:
TRfsConnectionCloseState iState;
+ TInt iIsPDPFeatureEnabled;
+ CRfsConTimer* iRfsConTimer;
};
#endif //RFSPDPOBSERVER_H
--- a/coreapplicationuis/Rfs/src/rfsConnectionObserver.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/Rfs/src/rfsConnectionObserver.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -20,17 +20,12 @@
// SYSTEM INCLUDES
#include <rfs.rsg>
#include <PSVariables.h>
-#include <AknWaitDialog.h>
+
#include <featmgr.h>
#include <centralrepository.h>
-#include <AknWaitDialog.h>
#include <pdpcontextmanagerpskeys.h>
#include <pdpcontextmanagerinternalcrkeys.h>
-// P&S KEYS FROM SIP & PDP CONNECTION
-#include <e32property.h>
-#include <pdpcontextmanagerpskeys.h>
-#include <sipsystemstatemonitorpskeys.h>
// USER INCLUDES
#include "rfsConnectionObserver.h"
@@ -141,6 +136,9 @@
Subscribe();
}
+ // Create the Timer Active Object
+ iRfsConTimer = CRfsConTimer :: NewL(this);
+
TRACES("CRfsConnectionObserver::ConstructL(): End");
}
@@ -170,6 +168,11 @@
CRfsConnectionObserver::~CRfsConnectionObserver()
{
TRACES("CRfsConnectionObserver::~CRfsConnectionObserver()");
+
+ if(iRfsConTimer)
+ {
+ delete iRfsConTimer;
+ }
Cancel();
TRACES("CRfsConnectionObserver::~CRfsConnectionObserver(): End");
}
@@ -190,16 +193,21 @@
// only perform the following operation if the 'iIsClosingConnectionsApplicable' is ETrue
iAllConnectionClosed = EFalse;
- // Send P&S notification to SIP that RFS has started
TInt err(KErrNone);
if (iIsSIPConnectionsPresent && iState == ESipConnectionClose)
{
+ // Send P&S notification to SIP that RFS has started and start the timer
+
err = iSIPProperty.Set(KPSSipRfsUid, KSipRfsState, ESipRfsStarted );
+ iRfsConTimer->IssueTimerRequest();
iIsSipInformedForClosingAllConnection = ETrue;
}
else if (iIsPDPFeatureEnabled && iState == EPdpConnectionClose)
{
+ // Send P&S notification to PDP that RFS has started and start the timer
+
err = iPDPProperty.Set(KPDPContextManager2,KPDPContextManagerFactorySettingsReset,EPDPContextManagerFactorySettingsResetStart );
+ iRfsConTimer->IssueTimerRequest();
iIsPDPInformedforClosingAllConnection = ETrue;
}
@@ -207,12 +215,6 @@
// Leave from here is there is any error setting the intial handshake information
// This means that RFS has failed as there was some problem setting the P&S keys
User::LeaveIfError(err);
- if(err != KErrNone)
- {
- TRACES1("CRfsConnectionObserver::CloseAlwaysOnConnectionL(): Err = %d", err);
- // This means that the RFS has failed
- return EFalse;
- }
// we set the flag to indicate ExecuteLD is called and the dialog needs to be
// dismissed from within the RunL()
@@ -236,6 +238,11 @@
{
iPDPProperty.Set(KPDPContextManager2,KPDPContextManagerFactorySettingsReset,EPDPContextManagerFactorySettingsResetStop);
}
+ if(iRfsConTimer)
+ {
+ // Cancel the Active timer if the user cancel the Rfs operation
+ iRfsConTimer->Cancel();
+ }
}
return iAllConnectionClosed;
}
@@ -316,7 +323,9 @@
{
// set the information that we have closed all the active connections
// here itself because the PDP connection/feature doen't exist
+ // Cancel the outstanding timer request
iAllConnectionClosed = ETrue;
+ iRfsConTimer->Cancel();
DismissWaitDialog();
}
@@ -325,7 +334,14 @@
iPDPProperty.Set(KPDPContextManager2,KPDPContextManagerFactorySettingsReset,EPDPContextManagerFactorySettingsResetStart );
// change the state to the next from within this as we are done with closing the SIP connection
- iState = EPdpConnectionClose;
+ // Cancel the Outstanding SIP and timer request
+ // Subscribe to PDP and start the timer
+ Cancel();
+ iRfsConTimer->Cancel();
+ iState = EPdpConnectionClose;
+ Subscribe();
+ iRfsConTimer->IssueTimerRequest();
+
//
// Under following cases the 'iIsPDPInformedforClosingAllConnection' will be set
//
@@ -366,8 +382,9 @@
// Now we may proceed to dsmiss the dialog and also set the state to the True for
// all active connections closed
iAllConnectionClosed = ETrue;
+ iRfsConTimer->Cancel();
DismissWaitDialog();
- }
+ }
}
} // end switch-case block
}
@@ -400,17 +417,19 @@
{
TRACES("CRfsConnectionObserver::DoCancel()");
- if(iIsPDPFeatureEnabled)
+ if(iIsSIPConnectionsPresent && iState == ESipConnectionClose)
+ {
+ iSIPProperty.Cancel();
+ if(!iIsPDPFeatureEnabled)
+ {
+ DismissWaitDialog();
+ }
+ }
+ if(iIsPDPFeatureEnabled && iState == EPdpConnectionClose)
{
iPDPProperty.Cancel();
+ DismissWaitDialog();
}
- if(iIsSIPConnectionsPresent)
- {
- iSIPProperty.Cancel();
- }
-
- DismissWaitDialog();
-
TRACES("CRfsConnectionObserver::DoCancel(): End");
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/Rfs/src/rfscontimer.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Implements CRFsScript class which controls the parsing of the Rfs scripts
+*
+*/
+
+
+#include "rfsConTimer.h"
+#include "RfsTraces.h"
+
+const TInt KRfsConnectionTimeOut = 60000000;
+
+CRfsConTimer :: CRfsConTimer(CRfsConnectionObserver * aRfsConnectionObserver):CActive( EPriorityStandard )
+ {
+ iRfsConnectionObserver = aRfsConnectionObserver;
+ iTimer.CreateLocal();
+ CActiveScheduler::Add( this );
+ }
+
+CRfsConTimer :: ~CRfsConTimer()
+ {
+ TRACES("CRfsConTimer :: ~CRfsConTimer()");
+
+ iRfsConnectionObserver = NULL;
+ Cancel();
+ iTimer.Close();
+ }
+
+CRfsConTimer* CRfsConTimer::NewL(CRfsConnectionObserver * aRfsConnectionObserver)
+ {
+ TRACES("CRfsConTimer :: NewL()");
+
+ CRfsConTimer* self = new (ELeave) CRfsConTimer(aRfsConnectionObserver );
+ return self;
+ }
+
+void CRfsConTimer :: IssueTimerRequest()
+ {
+ TRACES("CRfsConTimer :: IssueTimerRequest()");
+
+ if(!IsActive())
+ {
+ iTimer.After(iStatus, KRfsConnectionTimeOut);
+ SetActive();
+ }
+ }
+void CRfsConTimer :: RunL()
+ {
+ TRACES("CRfsConTimer :: RunL()");
+
+ if(iRfsConnectionObserver->iState == ESipConnectionClose && iRfsConnectionObserver->iIsPDPFeatureEnabled)
+ {
+ // If SIP doesn't respond with in the set time, RunL will be called,
+ // Rfs cancels the outstanding SIP request and If PDP connection exists,
+ // Rfs will inform the PDP and start the timer.
+
+ iRfsConnectionObserver->Cancel();
+ iRfsConnectionObserver->iState = EPdpConnectionClose;
+ iRfsConnectionObserver->Subscribe();
+ iTimer.After(iStatus, KRfsConnectionTimeOut);
+ SetActive();
+ }
+ else
+ {
+ iRfsConnectionObserver->Cancel();
+ }
+ }
+
+void CRfsConTimer :: DoCancel()
+ {
+ TRACES("CRfsConTimer :: DoCancel()");
+
+ if(IsActive())
+ {
+ iTimer.Cancel();
+ }
+ }
--- a/coreapplicationuis/SysAp/Group/SysAp.mmp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Group/SysAp.mmp Thu Aug 19 10:05:08 2010 +0300
@@ -147,6 +147,9 @@
SOURCE powersavemode/sysappsmcontroller.cpp
SOURCE sysapbatteryinfocontroller.cpp
+SOURCE gan\sysapganpropertylistener.cpp
+SOURCE gan\sysapganhandler.cpp
+
SOURCE SysApSatObserver.cpp
LIBRARY satclient.lib // for sat refresh
@@ -181,6 +184,8 @@
USERINCLUDE ../CenRep
USERINCLUDE ../PubSub
+USERINCLUDE ../src/gan
+
APP_LAYER_SYSTEMINCLUDE // used instead of MW_LAYER_SYSTEMINCLUDE due to dependencies to APP layer
LIBRARY euser.lib
--- a/coreapplicationuis/SysAp/Inc/SysApAppUi.h Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Inc/SysApAppUi.h Thu Aug 19 10:05:08 2010 +0300
@@ -98,6 +98,8 @@
class CSysApDriveUnlockHandler;
class CSysApDriveEjectHandler;
+class CSysApGanHandler;
+
class CSysApBatteryInfoController;
//CONSTANTS
@@ -736,6 +738,13 @@
void SetSignalIndicatorWcdmaL();
/**
+ * Gets called by SetSignalIndicatorL() when in Gan network
+ * @param None
+ * @return void
+ */
+ void SetSignalIndicatorGanL();
+
+ /**
* Handles GPRS suspend/resume notes if feature supported.
* ie. Gprs state icon or common signal icon.
* @param None
@@ -1430,7 +1439,7 @@
* @since S60 3.2
* @return reference to CSysApCenRepLogsObserver object
*/
- CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL();
+ CSysApCenRepLogsObserver& LogsObserverL();
/**
* Adds MMC removal item(s) to power menu.
@@ -1692,6 +1701,12 @@
//Flag to record if the TD network is enalbed.
TBool iTDEnable;
TBool IsDefaultPowerKeyBehavior();
+
+ // Are we in GAN mode
+ TBool iGanEnabled;
+
+ // Handler for GAN events
+ CSysApGanHandler* iSysApGanHandler;
};
--- a/coreapplicationuis/SysAp/Inc/SysApFeatureManager.h Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Inc/SysApFeatureManager.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -185,7 +185,7 @@
* @since S60 9.2
* @return ETrue if feature is set
*/
- TBool CSysApFeatureManager::SlideSupported() const;
+ TBool SlideSupported() const;
/**
* Returns whether Cover Display is supported.
@@ -264,6 +264,14 @@
*/
TBool PowerKeyIsLockKey() const;
+ /**
+ * Returns whether GAN is supported.
+ *
+ * @since S60 3.2
+ * @return ETrue if feature is supported
+ */
+ TBool GanSupported() const;
+
private:
/**
@@ -389,6 +397,12 @@
* Short press of power key invokes keylock
*/
TBool iPowerKeyIsLockKey;
+
+ /**
+ * Generic Access Network (GAN) supported status.
+ */
+ TBool iGanSupported;
+
};
#endif // SYSAPFEATUREMANAGER_H
--- a/coreapplicationuis/SysAp/Inc/sysapremconobserver.h Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Inc/sysapremconobserver.h Thu Aug 19 10:05:08 2010 +0300
@@ -58,7 +58,7 @@
/**
* Open remcon interface and reserve the volume keys
*/
- void StartRemconInterface();
+ void StartRemconInterfaceL();
/**
* close the remcon interface and release the volume keys
--- a/coreapplicationuis/SysAp/Src/CenRepObservers/SysApCenRepLogsObserver.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/CenRepObservers/SysApCenRepLogsObserver.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -79,7 +79,7 @@
KLogsNewMissedCalls );
iNewMissedCallsHandler->StartListeningL();
- iSession->Get(KLogsNewMissedCalls, iMissedCallsValue);
+ User::LeaveIfError(iSession->Get(KLogsNewMissedCalls, iMissedCallsValue));
}
// ----------------------------------------------------------------------------
--- a/coreapplicationuis/SysAp/Src/SysApAppUi.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/SysApAppUi.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -59,6 +59,7 @@
#include <secui.h>
#include <settingsinternalcrkeys.h>
+#include "sysapganhandler.h"
#include <AknNotifierController.h>
#include <eikappui.h>
#include <es_enum.h>
@@ -247,7 +248,8 @@
iSysApAudioRoutingObserver( NULL ),
iSysApCenRepCallForwardingObserver( NULL ),
iSysApCenRepMsgWaitingObserver( NULL ),
- iKeyBoardRepeatCount(-1)
+ iSysApGanHandler( NULL ),
+ iKeyBoardRepeatCount(-1)
{
TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) );
}
@@ -490,6 +492,15 @@
DeactivatePSMifBatteryNotLowL ();
+ if( iSysApFeatureManager->GanSupported() )
+ {
+
+
+ RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsGanPropertyGanMode, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy );
+ RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsGanPropertySignalLevel, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy );
+ iSysApGanHandler = CSysApGanHandler::NewL( *this );
+ }
+
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) );
}
@@ -570,6 +581,8 @@
delete iSysApStartupController;
+ delete iSysApGanHandler;
+
#ifdef RD_MULTIPLE_DRIVE
iInsertedMemoryCards.Close();
delete iSysApDriveEjectHandler;
@@ -747,6 +760,7 @@
TInt errorCode2 = RProperty::Get( KPSUidStartup, KStartupSecurityCodeQueryStatus, securityQueryState);
TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KCoreAppUIsDisableKeyguard - State Value: %d"),alarmState));
TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KStartupSecurityCodeQueryStatus - State Value: %d"),securityQueryState));
+ TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) );
//Disable keylock if Alarm is active or if a Security code query is active on the display
if ( alarmState == ECoreAppUIsDisableKeyguard || securityQueryState == ESecurityQueryActive )
{
@@ -754,7 +768,10 @@
}
else
{
- KeyLock().EnableWithoutNote();
+ if( callState != EPSCTsyCallStateConnected && !iDeviceLockEnabled)
+ {
+ KeyLock().EnableWithoutNote();
+ }
}
}
else
@@ -1888,8 +1905,11 @@
void CSysApAppUi::UpdateSignalBarsL( const TInt aState )
{
TRACES( RDebug::Print( _L("CSysApAppUi::UpdateSignalBarsL aState: %d"), aState ) );
-
- if( aState == KAknSignalOffLineMode || (iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive) )
+ if( iSysApGanHandler && iSysApGanHandler->IsInGanMode() )
+ {
+ iSignalNotify->SetSignalLevelL( iSysApGanHandler->GanSignalLevel() );
+ }
+ else if( aState == KAknSignalOffLineMode || (iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive) )
{
iSignalNotify->SetSignalLevelL( KAknSignalOffLineMode );
}
@@ -1942,22 +1962,39 @@
}
iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff );
iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff);
+ TRACES( RDebug::Print(_L("CSysApAppUi::SetSignalIndicatorL: gan off" ) ) );
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorOff );
}
else
{
- // The device is in Online Mode
- switch ( networkMode )
- {
- case ESysApGSM:
- SetSignalIndicatorGsmL();
- break;
-
- case ESysApWCDMA:
- SetSignalIndicatorWcdmaL();
- break;
-
- default:
- break;
+ if( iSysApGanHandler && iSysApGanHandler->IsInGanMode() )
+ {
+ // Enter GAN: set GAN signal bar
+ SetSignalIndicatorGanL();
+ iGanEnabled = ETrue;
+ }
+ else
+ {
+ if( iGanEnabled )
+ {
+ UpdateSignalBarsL();
+ iGanEnabled = EFalse;
+ }
+
+ // The device is in Online Mode
+ switch ( networkMode )
+ {
+ case ESysApGSM:
+ SetSignalIndicatorGsmL();
+ break;
+
+ case ESysApWCDMA:
+ SetSignalIndicatorWcdmaL();
+ break;
+
+ default:
+ break;
+ }
}
}
}
@@ -2209,6 +2246,47 @@
}
// ----------------------------------------------------------------------------
+// CSysApAppUi::SetSignalIndicatorGanL()
+// ----------------------------------------------------------------------------
+void CSysApAppUi::SetSignalIndicatorGanL()
+ {
+ TRACES( RDebug::Print(_L("CSysApAppUi::SetSignalIndicatorGanL: available" ) ) );
+
+ TInt gprsStatus( 0 );
+ gprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue );
+
+ TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGanL gprsStatus: %d" ), gprsStatus ) );
+
+ switch ( gprsStatus )
+ {
+ case EPSGprsContextActive:
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorContext );
+ break;
+
+ case EPSGprsContextActivating:
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorEstablishingContext );
+ break;
+
+ case EPSGprsSuspend:
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorSuspended );
+ break;
+
+ case EPSGprsAttach:
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorAttached );
+ break;
+
+ case EPSGprsMultibleContextActive:
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorMultipdp );
+ break;
+
+ case EPSGprsUnattached:
+ default:
+ iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorAvailable );
+ break;
+ }
+ }
+
+// ----------------------------------------------------------------------------
// CSysApAppUi::HandleGprsNotesL()
// ----------------------------------------------------------------------------
--- a/coreapplicationuis/SysAp/Src/SysApFeatureManager.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/SysApFeatureManager.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -114,6 +114,9 @@
iPowerKeyIsLockKey = FeatureManager::FeatureSupported( KFeatureIdFfPowerKeyAsKeyguard );
TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Power Key as keyguard supported=%d"), iPowerKeyIsLockKey ) );
+
+ iGanSupported = FeatureManager::FeatureSupported( KFeatureIdFfGenericAccessNetwork );
+ TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: GAN supported=%d"), iGanSupported ) );
CRepository* repository = NULL;
@@ -192,8 +195,8 @@
iVmbxCallDivertIconSupported( EFalse ),
iTouchUnlockStrokeSupported( EFalse ),
iFmTxRdsTextSupported( EFalse ),
- iPowerKeyIsLockKey ( EFalse )
-
+ iPowerKeyIsLockKey ( EFalse ),
+ iGanSupported( EFalse )
{
}
@@ -441,6 +444,15 @@
return iPowerKeyIsLockKey;
}
+// ----------------------------------------------------------------------------
+// CSysApFeatureManager::GanSupported()
+// ----------------------------------------------------------------------------
+//
+TBool CSysApFeatureManager::GanSupported() const
+ {
+ return iGanSupported;
+ }
+
// End of File
--- a/coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -718,7 +718,7 @@
if(iFmTxRemConObserver)
{
//Open Remcon and reserve the volume keys
- iFmTxRemConObserver->StartRemconInterface();
+ iFmTxRemConObserver->StartRemconInterfaceL();
}
}
else
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/SysAp/Src/gan/msysapganpropertyobserver.h Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MSysApGanPropertyObserver class definition. This is a callback
+* interface from RProperty listener to client application.
+*
+*/
+
+#ifndef MSYSAPGANPROPERTYOBSERVER_H_
+#define MSYSAPGANPROPERTYOBSERVER_H_
+
+class CSysApGanPropertyListener;
+
+NONSHARABLE_CLASS( MSysApGanPropertyObserver )
+ {
+public:
+ /**
+ * Method is called when property value changes.
+ * @param aPropertyListener Listener of the changed property.
+ * @param aStatus Status of the event.
+ */
+ virtual void PropertyEvent(
+ CSysApGanPropertyListener& aPropertyListener,
+ TInt aStatus ) = 0;
+ };
+
+#endif /* MSYSAPGANPROPERTYOBSERVER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/SysAp/Src/gan/sysapganhandler.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Handle GAN server events
+*
+*/
+
+#include <e32base.h>
+#include "coreapplicationuisdomainpskeys.h"
+#include "sysapganhandler.h"
+#include "SysApAppUi.h"
+#include "SysAp.hrh"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CSysApGanHandler::CSysApGanHandler( CSysApAppUi& aSysApAppUi ) :
+ iSysApAppUi( aSysApAppUi ),
+ iGanMode( EGanModeUnspecified )
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CSysApGanHandler::ConstructL()
+ {
+ TRACES( RDebug::Print( _L("CSysApGanHandler::ConstructL IN") ) );
+ TInt err( KErrNone );
+
+ // Start listening for GAN mode
+ err = iPropertyGanMode.Attach( KPSUidCoreApplicationUIs, KCoreAppUIsGanPropertyGanMode );
+ User::LeaveIfError( err );
+ iGanModeListener = CSysApGanPropertyListener::NewL( iPropertyGanMode, *this );
+ iGanModeListener->Subscribe();
+
+ // Start listening for signal strength
+ err = iPropertySignalLevel.Attach( KPSUidCoreApplicationUIs, KCoreAppUIsGanPropertySignalLevel );
+ User::LeaveIfError( err );
+ iSignalLevelListener = CSysApGanPropertyListener::NewL( iPropertySignalLevel, *this );
+ iSignalLevelListener->Subscribe();
+
+ // Get current GAN mode
+ TInt mode;
+ err = iPropertyGanMode.Get( mode );
+ if( KErrNone == err )
+ {
+ iGanMode = (TCoreAppUIsGanMode)mode;
+ }
+
+ // Get current GAN signal level
+ iPropertySignalLevel.Get( iGanSignalLevel );
+
+ TRACES( RDebug::Print( _L("CSysApGanHandler::ConstructL OUT") ) );
+ }
+
+// ---------------------------------------------------------------------------
+// Static constructor.
+// ---------------------------------------------------------------------------
+//
+CSysApGanHandler* CSysApGanHandler::NewL( CSysApAppUi& aSysApAppUi )
+ {
+ CSysApGanHandler* self = new (ELeave) CSysApGanHandler( aSysApAppUi );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CSysApGanHandler::~CSysApGanHandler()
+ {
+ delete iGanModeListener;
+ delete iSignalLevelListener;
+ iPropertyGanMode.Close();
+ iPropertySignalLevel.Close();
+ }
+
+TBool CSysApGanHandler::IsInGanMode()
+ {
+ return iGanMode == EGanModeGAN;
+ }
+
+TInt CSysApGanHandler::GanSignalLevel()
+ {
+ return iGanSignalLevel;
+ }
+
+// ---------------------------------------------------------------------------
+// Handle UI Status RProperty change event. Read the new RProperty value
+// and publish the content on idle screen.
+// ---------------------------------------------------------------------------
+//
+void CSysApGanHandler::PropertyEvent(
+ CSysApGanPropertyListener& aPropertyListener,
+ TInt aStatus )
+ {
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent IN") ) );
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent status %d"), aStatus ) );
+
+ if( KErrNone == aStatus )
+ {
+ if( iGanModeListener == &aPropertyListener )
+ {
+ // GAN mode event
+ TInt mode;
+ TInt err = iPropertyGanMode.Get( mode );
+ iGanMode = (TCoreAppUIsGanMode)mode;
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent RProp err %d"), err ) );
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent GAN mode %d"), iGanMode ) );
+ iSysApAppUi.SetSignalIndicatorL();
+ }
+ else if( iSignalLevelListener == &aPropertyListener )
+ {
+ // Signal level event
+ TInt err = iPropertySignalLevel.Get( iGanSignalLevel );
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent RProp err %d"), err ) );
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent signal level %d"), iGanSignalLevel ) );
+ iSysApAppUi.UpdateSignalBarsL();
+ }
+ }
+ aPropertyListener.Subscribe();
+ TRACES( RDebug::Print( _L("CSysApGanHandler::PropertyEvent OUT") ) );
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/SysAp/Src/gan/sysapganhandler.h Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CSysApGanHandler class definition.
+*
+*/
+
+#ifndef SYSAPGANHANDLER_H_
+#define SYSAPGANHANDLER_H_
+
+#include <e32base.h>
+#include <e32property.h>
+#include "sysapganpropertylistener.h"
+
+class CSysApAppUi;
+
+/**
+ * Listen RProperty events from GAN server.
+ */
+NONSHARABLE_CLASS( CSysApGanHandler ) :
+ public CBase,
+ private MSysApGanPropertyObserver
+ {
+public:
+ /**
+ * Static constructor.
+ * @param aSysApUi Application UI.
+ */
+ static CSysApGanHandler* NewL( CSysApAppUi& aSysApAppUi );
+
+ /**
+ * Destructor.
+ */
+ ~CSysApGanHandler();
+
+ /**
+ * Tells if phone is in GAN mode.
+ * @return ETrue if in GAN mode (not in GERAN)
+ */
+ TBool IsInGanMode();
+
+ /**
+ * Tells the signal bar level in GAN mode.
+ * @return The number of signal bar blocks.
+ */
+ TInt GanSignalLevel();
+
+private: // from MSysApGanPropertyObserver
+
+ /**
+ * Receive RProperty notification. This same interface can receive
+ * notifications from multiple listeners.
+ * @param aPropertyListener Property lister that received the notification.
+ * @param aStatus Status of the notification.
+ */
+ void PropertyEvent(
+ CSysApGanPropertyListener& aPropertyListener, TInt aStatus );
+
+private:
+ /**
+ * C++ constructor.
+ * @param aSysApUi Application UI.
+ */
+ CSysApGanHandler( CSysApAppUi& aSysApAppUi );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+
+protected: // Data
+
+ /**
+ * Application UI.
+ */
+ CSysApAppUi& iSysApAppUi;
+
+ /**
+ * Current GAN mode.
+ */
+ TCoreAppUIsGanMode iGanMode;
+
+ /**
+ * Current GAN signal level.
+ */
+ TInt iGanSignalLevel;
+
+ /**
+ * GAN mode property.
+ */
+ RProperty iPropertyGanMode;
+
+ /**
+ * Signal level property.
+ */
+ RProperty iPropertySignalLevel;
+
+ /**
+ * Listener for GAN mode property.
+ */
+ CSysApGanPropertyListener* iGanModeListener;
+
+ /**
+ * Listener for signal level property.
+ */
+ CSysApGanPropertyListener* iSignalLevelListener;
+
+ };
+
+#endif /* SYSAPGANHANDLER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/SysAp/Src/gan/sysapganpropertylistener.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Listens to given P&S key and notifies
+* observer whenever the value changes.
+*/
+
+
+#include "sysapganpropertylistener.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CSysApGanPropertyListener::CSysApGanPropertyListener(
+ RProperty& aProperty,
+ MSysApGanPropertyObserver& aObserver ) :
+ CActive( CActive::EPriorityStandard ),
+ iObserver( aObserver ),
+ iProperty( aProperty )
+ {
+ CActiveScheduler::Add( this );
+ }
+
+// ---------------------------------------------------------------------------
+// Static constructor.
+// ---------------------------------------------------------------------------
+//
+CSysApGanPropertyListener* CSysApGanPropertyListener::NewL(
+ RProperty& aProperty,
+ MSysApGanPropertyObserver& aObserver )
+ {
+ CSysApGanPropertyListener* self =
+ new ( ELeave ) CSysApGanPropertyListener( aProperty, aObserver );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CSysApGanPropertyListener::~CSysApGanPropertyListener()
+ {
+ Cancel(); // Cancel any request, if outstanding
+ }
+
+// ---------------------------------------------------------------------------
+// Subscribe for property value changes.
+// ---------------------------------------------------------------------------
+//
+void CSysApGanPropertyListener::Subscribe()
+ {
+ // Cancel any outstanding request
+ Cancel();
+
+ iProperty.Subscribe( iStatus );
+ SetActive();
+ }
+
+// ---------------------------------------------------------------------------
+// Property value changed.
+// ---------------------------------------------------------------------------
+//
+void CSysApGanPropertyListener::RunL()
+ {
+ // Notify the observer.
+ iObserver.PropertyEvent( *this, iStatus.Int() );
+ }
+
+// ---------------------------------------------------------------------------
+// Subscription cancelled.
+// ---------------------------------------------------------------------------
+//
+void CSysApGanPropertyListener::DoCancel()
+ {
+ iProperty.Cancel();
+ }
+
+// ---------------------------------------------------------------------------
+// Error in RunL.
+// ---------------------------------------------------------------------------
+//
+TInt CSysApGanPropertyListener::RunError( TInt /*aError*/ )
+ {
+ // ignore error
+ return KErrNone;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coreapplicationuis/SysAp/Src/gan/sysapganpropertylistener.h Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CSysApGanPropertyListener class definition. Class for
+* RProperty changes from GAN server.
+*/
+
+
+#ifndef C_SYSAPGANPROPERTYLISTENER_H
+#define C_SYSAPGANPROPERTYLISTENER_H
+
+#include <e32base.h>
+#include <e32property.h>
+#include "msysapganpropertyobserver.h"
+
+/**
+ * Listen RProperty events.
+ */
+NONSHARABLE_CLASS( CSysApGanPropertyListener ) :
+ public CActive
+ {
+public:
+ /**
+ * Static constructor.
+ * @param aProperty Property to listen to.
+ * @param aObserver Object that is informed about about new IAP usage.
+ */
+ static CSysApGanPropertyListener* NewL(
+ RProperty& aProperty,
+ MSysApGanPropertyObserver& aObserver );
+
+ /**
+ * Destructor.
+ */
+ ~CSysApGanPropertyListener();
+
+protected:
+ /**
+ * C++ constructor.
+ * @param aProperty Property to listen to.
+ * @param aObserver Object that is informed about about new IAP usage.
+ */
+ CSysApGanPropertyListener(
+ RProperty& aProperty,
+ MSysApGanPropertyObserver& aObserver );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+public:
+ /**
+ * Subscribes to a property.
+ */
+ void Subscribe();
+
+protected: // From CActive
+
+ /**
+ * Handles an active object's request completion event.
+ */
+ void RunL();
+
+ /**
+ * Cancels asynchronous request.
+ */
+ void DoCancel();
+
+ /**
+ * Handles a leave occurring in RunL().
+ * @param aError Error that caused RunL to leave.
+ */
+ TInt RunError( TInt aError );
+
+protected: // Data
+
+ /**
+ * Observer to notifiy about property changes.
+ */
+ MSysApGanPropertyObserver& iObserver;
+
+ /**
+ * Property to listen to.
+ */
+ RProperty& iProperty;
+
+ };
+
+#endif // C_SYSAPGANPROPERTYLISTENER_H
--- a/coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -237,7 +237,7 @@
{
TInt keyGuardSetting;
- iSlideRepository->Get( KSlideKeyguard, keyGuardSetting );
+ User::LeaveIfError(iSlideRepository->Get( KSlideKeyguard, keyGuardSetting ));
switch( ( TSlideSettingKeyguard ) keyGuardSetting )
{
case ESlideSettingsKeyguardActivatingOn:
--- a/coreapplicationuis/SysAp/Src/sysapremconobserver.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/sysapremconobserver.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -108,7 +108,7 @@
/**
* Reserve the volume keys
*/
-void CSysApRemConObserver::StartRemconInterface()
+void CSysApRemConObserver::StartRemconInterfaceL()
{
TRACES( RDebug::Print( _L("CSysApRemConObserver::BlockKeys")));
if(!iInterfaceSelector)
--- a/coreapplicationuis/advancedtspcontroller/data/keyevent.rul Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/advancedtspcontroller/data/keyevent.rul Thu Aug 19 10:05:08 2010 +0300
@@ -105,7 +105,6 @@
<Tsp
routingTable='07'
keyEventRemConPlay='44'
- keyEventRemConPause='46'
/>
<Tsp
@@ -113,33 +112,48 @@
ruleActiveAudio='00'
ruleLastPlayedAudio='03'
ruleForeground='01'
- ruleLaunchDefaultApp='04'
+ ruleLaunchDefaultApp='04'
defaultLaunchApp='102072C3'
/>
-
+
<Tsp
routingTable='08'
- keyEventRemConStop='45'
+ keyEventRemConPause='46'
/>
<Tsp
routingTable='08'
ruleActiveAudio='00'
+ ruleLastPlayedAudio='03'
+ ruleForeground='01'
+ ruleDefaultApp='02'
+ defaultApplicationPhone='100058B3'
+ />
+
+
+ <Tsp
+ routingTable='09'
+ keyEventRemConStop='45'
+ />
+
+ <Tsp
+ routingTable='09'
+ ruleActiveAudio='00'
ruleForeground='01'
ruleLastPlayedAudio='03'
ruleDefaultApp='02'
defaultApplicationPhone='100058B3'
- />
+ />
<Tsp
- routingTable='09'
+ routingTable='10'
KRemConSetAbsoluteVolume='1050'
KRemConAbsoluteVolumeNotification='0d31'
EGetFolderItemsOperationId='00'
/>
<Tsp
- routingTable='09'
+ routingTable='10'
transparentApplicationBTAudioMan='10208971'
/>
</actions>
--- a/coreapplicationuis/kefmapper/data/AknKeyEventMap.rss Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/kefmapper/data/AknKeyEventMap.rss Thu Aug 19 10:05:08 2010 +0300
@@ -44,7 +44,22 @@
devicemode = { KKefModeDefault };
eventtype = { KKefTypeShort | KKefTypeKey };
feedbacktype = 1; // 1 = Basic feedback
- }
+ },
+ KEF_KEY_EVENT
+ {
+ scancode = { EStdKeyRightFunc, EStdKeyUpArrow } ;
+ keycode = { EStdKeyApplicationC, EStdKeyApplicationC, EStdKeyApplicationC } ;
+ devicemode = { 0, 1, 2 };
+ eventtype = { KKefTypeShort | KKefTypeLong, KKefTypeShort | KKefTypeLong, KKefTypeShort | KKefTypeLong };
+ },
+
+ KEF_KEY_EVENT
+ {
+ scancode = { EStdKeyRightFunc, EStdKeyDownArrow } ;
+ keycode = { EStdKeyApplicationD, EStdKeyApplicationD, EStdKeyApplicationD } ;
+ devicemode = { 0, 1, 2 };
+ eventtype = { KKefTypeShort | KKefTypeLong, KKefTypeShort | KKefTypeLong, KKefTypeShort | KKefTypeLong };
+ }
};
}
--- a/coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/batterypopupcontrol.h Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/batterypopupcontrol.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-10 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -290,6 +290,11 @@
* Rect for link
*/
TRect iLinkRect;
+
+ /**
+ * Alignment of the Layout either ERight or ELeft
+ */
+ CGraphicsContext::TTextAlign iAlign;
};
--- a/coreapplicationuis/powersaveutilities/batterypopupcontrol/src/batterypopupcontrol.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/coreapplicationuis/powersaveutilities/batterypopupcontrol/src/batterypopupcontrol.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -341,7 +341,7 @@
TInt textBaseLineOffset = 0;
textBaseLineOffset = (rect.Height() - font->FontMaxHeight())/2;
- gc.DrawText( *(iText->Text()), rect, textBaseLineOffset, CGraphicsContext::ELeft );
+ gc.DrawText( *(iText->Text()), rect, textBaseLineOffset, iAlign );
//gc.Reset();
}
@@ -397,7 +397,7 @@
baselineOffset = font->AscentInPixels() +
( rect.Height() - font->AscentInPixels() ) / 2;
gc.DrawText( ptr, rect, baselineOffset,
- CGraphicsContext::ELeft );
+ iAlign );
delete visualText;
}
}
@@ -475,12 +475,8 @@
TAknTextComponentLayout textLayout =
AknLayoutScalable_Avkon::popup_battery_window_t1( iVariant );
- TAknLayoutText textRect;
- textRect.LayoutText( rectPopUpWindow, textLayout );
-
- iText->SetRect( textRect.TextRect() );
- // Set text font
- iText->SetFont( textRect.Font() );
+ AknLayoutUtils::LayoutLabel(iText, rectPopUpWindow, textLayout);
+
}
// Set link text rect
@@ -491,6 +487,8 @@
linkLayoutText.LayoutText( rectPopUpWindow,
AknLayoutScalable_Avkon::popup_battery_window_t2( EVariantIconTextLink ) );
+ iAlign = linkLayoutText.Align();
+
iFont = linkLayoutText.Font();
TInt tempWidth = iFont->TextWidthInPixels( *(iLinkText) );
@@ -508,7 +506,17 @@
tempRect = TRect( linkLayout.Rect() );
}
- tempRect.SetWidth( tempWidth );
+
+ if( iAlign == CGraphicsContext::ERight )
+ {
+ tempRect.iTl.iX = tempWidth - tempRect.iBr.iX;
+ }
+ else
+ {
+ tempRect.SetWidth( tempWidth );
+ }
+
+
iLinkRect = tempRect;
}
}
--- a/mediakeys/MMKeyBearer/src/MMKeyBearerImplementation.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/mediakeys/MMKeyBearer/src/MMKeyBearerImplementation.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -342,6 +342,12 @@
INFO_3( "Received key: enumValue = %d, keyType = %d, usbFileTransfer = %d",
aEnumValue, aKeyType, iUSBFileTransfer );
+ //Start the listener once again
+ if (aKeyType == ESideVolumeKeys)
+ {
+ iMMKeyBearerObserver->Start();
+ }
+
// Mediakeys must be disabled when MTP (Music Transfer) is happening.
if (aKeyType == EFileTransferStatus)
{
@@ -412,11 +418,7 @@
TInt aError = Observer().NewCommand(addr);
//Start the listener once again
- if (aKeyType == ESideVolumeKeys)
- {
- iMMKeyBearerObserver->Start();
- }
- else if (aKeyType == EMediaKeys)
+ if (aKeyType == EMediaKeys)
{
iMediaKeyObserver->Start();
}
--- a/startupservices/Startup/inc/StartupAppUi.h Thu Jul 15 18:49:38 2010 +0300
+++ b/startupservices/Startup/inc/StartupAppUi.h Thu Aug 19 10:05:08 2010 +0300
@@ -393,6 +393,8 @@
* @param aType The type of resources that have changed.
*/
void HandleResourceChangeL( TInt aType );
+
+ void IsFTUAvailableL(TBool& aFTUAvailable);
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/startupservices/Startup/inc/StartupWelcomeCrKeys.h Thu Aug 19 10:05:08 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Startup Welcome keys
+*/
+
+#ifndef __STARTUPWELCOMECRKEYS_H
+#define __STARTUPWELCOMECRKEYS_H
+
+/**
+ * The Uid for the repository itself
+ * This repository holds the settings for Welcome2
+ */
+const TUid KCRUidWelcome6 = { 0x200122A4 };
+
+/*
+ * Used by PA to indicate if it has accomplished the task.
+ */
+
+const TUint32 KPhoneActicationCompleted = 0x0000000B;
+#endif // STARTUPWELCOMCRKEYS_H
+
+// End of file
\ No newline at end of file
--- a/startupservices/Startup/src/StartupAppUi.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/startupservices/Startup/src/StartupAppUi.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -35,6 +35,7 @@
#include <startupdomaincrkeys.h>
#include <CoreApplicationUIsSDKCRKeys.h>
#include <starterclient.h>
+#include "StartupWelcomeCrKeys.h"
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
// Transition effects
@@ -939,7 +940,21 @@
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
- UpdateStartupUiPhase( EStartupUiPhaseAllDone );
+ TBool fTUDone = ETrue;
+ TRAP_IGNORE(IsFTUAvailableL(fTUDone));
+
+ if(fTUDone)
+ {
+ UpdateStartupUiPhase( EStartupUiPhaseAllDone );
+ }
+ else
+ {
+ UpdateStartupUiPhase(EStartupUiPhaseAllDone+1);
+ }
+
+ //UpdateStartupUiPhase( EStartupUiPhaseAllDone );
+
+
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
TRACES("CStartupAppUi::DoStartupEndPart(): Exit application.");
@@ -948,6 +963,15 @@
TRACES("CStartupAppUi::DoStartupEndPart(): End");
}
+void CStartupAppUi::IsFTUAvailableL(TBool& aFTUAvailable)
+ {
+ //From Startupwelcomecrkeys.h
+ CRepository* repo = CRepository::NewLC(KCRUidWelcome6);
+ repo->Get(KPhoneActicationCompleted, aFTUAvailable);
+ CleanupStack::PopAndDestroy(repo);
+ }
+
+
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
// ---------------------------------------------------------------------------
// CStartupAppUi::ContinueStartupAfterToneL()
--- a/sysresmonitoring/oommonitor/bwins/oommonitorU.DEF Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/bwins/oommonitorU.DEF Thu Aug 19 10:05:08 2010 +0300
@@ -17,4 +17,5 @@
?RequestOptionalRam@ROomMonitorSession@@QAEHHHHAAH@Z @ 16 NONAME ; int ROomMonitorSession::RequestOptionalRam(int, int, int, int &)
?RequestOptionalRam@ROomMonitorSession@@QAEXHHHAAVTRequestStatus@@@Z @ 17 NONAME ; void ROomMonitorSession::RequestOptionalRam(int, int, int, class TRequestStatus &)
?SetOomPriority@ROomMonitorSession@@QAEXW4TOomPriority@1@@Z @ 18 NONAME ; void ROomMonitorSession::SetOomPriority(enum ROomMonitorSession::TOomPriority)
+ ?AppId@COomMonitorPlugin@@UBE?BVTUid@@XZ @ 19 NONAME ; class TUid const COomMonitorPlugin::AppId(void) const
--- a/sysresmonitoring/oommonitor/data/oomconfig.xml Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/data/oomconfig.xml Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+ Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved.
This component and the accompanying materials are made available
under the terms of the License "Eclipse Public License v1.0"
@@ -41,7 +41,7 @@
actions are needed. This value is meaningful only when "check" or "estimate" sync mode is
used with plugins.
-->
- <global_settings low_ram_threshold="3637" good_ram_threshold="4900" max_app_close_batch="3" default_wait_after_plugin="10" max_app_exit_time="2000">
+ <global_settings low_ram_threshold="3637" good_ram_threshold="4900" swap_usage_monitored="true" low_swap_threshold="15000" good_swap_threshold="25000" max_app_close_batch="3" default_wait_after_plugin="10" max_app_exit_time="2000">
</global_settings>
<!-- Application specific low RAM and good RAM thresholds are defined here. The higher values of
--- a/sysresmonitoring/oommonitor/eabi/oommonitorU.DEF Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/eabi/oommonitorU.DEF Thu Aug 19 10:05:08 2010 +0300
@@ -23,4 +23,5 @@
_ZTV19COomMonitorPluginV2 @ 22 NONAME ; #<VT>#
_ZN18ROomMonitorSession18RequestOptionalRamEiiiR14TRequestStatus @ 23 NONAME
_ZN18ROomMonitorSession14SetOomPriorityENS_12TOomPriorityE @ 24 NONAME
+ _ZNK17COomMonitorPlugin5AppIdEv @ 25 NONAME
--- a/sysresmonitoring/oommonitor/inc/oomaction.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomaction.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -46,7 +46,7 @@
* @since S60 5.0
* @param aBytesRequested ?description
*/
- virtual void FreeMemory(TInt aBytesRequested) = 0;
+ virtual void FreeMemory(TInt aBytesRequested, TBool aIsDataPaged) = 0;
/**
* @since S60 5.0
--- a/sysresmonitoring/oommonitor/inc/oomactionlist.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomactionlist.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -139,9 +139,10 @@
* occurs
*
* @since S60 5.0
- * @param aCurrentTarget the prio
+ * @param aCurrentRamTarget the desired amount of free unpaged memory
+ * @param aCurrentSwapTarget the desired amount of free paged memory
*/
- inline void SetCurrentTarget(TUint aCurrentTarget);
+ inline void SetCurrentTargets(TUint aCurrentRamTarget, TUint aCurrentSwapTarget);
/**
* Switch all plugins to Off (Memory Good) state
@@ -202,7 +203,9 @@
TInt iCurrentActionIndex;
- TUint iCurrentTarget;
+ TUint iCurrentRamTarget;
+ TBool iSwapUsageMonitored;
+ TUint iCurrentSwapTarget;
/*
* Flag specifying that a OomMonitor event is in progress.
--- a/sysresmonitoring/oommonitor/inc/oomactionlist.inl Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomactionlist.inl Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -37,9 +37,10 @@
return iPlugins[aIndex].iUid;
}
-inline void COomActionList::SetCurrentTarget(TUint aCurrentTarget)
+inline void COomActionList::SetCurrentTargets(TUint aCurrentRamTarget, TUint aCurrentSwapTarget)
{
- iCurrentTarget = aCurrentTarget;
+ iCurrentRamTarget = aCurrentRamTarget;
+ iCurrentSwapTarget = aCurrentSwapTarget;
}
--- a/sysresmonitoring/oommonitor/inc/oomapplicationconfig.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomapplicationconfig.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -71,6 +71,8 @@
TUint iGoodRamThreshold;
TUint iLowRamThreshold;
+ TUint iGoodSwapThreshold;
+ TUint iLowSwapThreshold;
private:
--- a/sysresmonitoring/oommonitor/inc/oomcloseapp.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomcloseapp.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -52,7 +52,7 @@
* Call the COomAction::MemoryFreed when it is done
* @param aBytesRequested not used for clsoe app actions
*/
- virtual void FreeMemory(TInt aBytesRequested);
+ virtual void FreeMemory(TInt aBytesRequested, TBool aIsDataPaged);
~COomCloseApp();
--- a/sysresmonitoring/oommonitor/inc/oomconfig.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomconfig.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -83,6 +83,9 @@
inline void SetDefaultLowRamThreshold(TInt aLowRamThreshold);
inline void SetDefaultGoodRamThreshold(TInt aGoodRamThreshold);
+ inline void SetSwapUsageMonitored(TBool aMonitored);
+ inline void SetDefaultLowSwapThreshold(TInt aLowSwapThreshold);
+ inline void SetDefaultGoodSwapThreshold(TInt aGoodSwapThreshold);
inline void SetMaxCloseAppBatch(TUint MaxCloseAppBatch);
inline void SetDefaultWaitAfterPlugin(TInt aMilliseconds);
inline void SetMaxAppExitTime(TInt aMilliseconds);
--- a/sysresmonitoring/oommonitor/inc/oomconfig.inl Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomconfig.inl Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -34,6 +34,21 @@
iGlobalConfig.iGoodRamThreshold = aGoodRamThreshold;
}
+void COomConfig::SetSwapUsageMonitored(TBool aMonitored)
+ {
+ iGlobalConfig.iSwapUsageMonitored = aMonitored;
+ }
+
+void COomConfig::SetDefaultLowSwapThreshold(TInt aLowSwapThreshold)
+ {
+ iGlobalConfig.iLowSwapThreshold = aLowSwapThreshold;
+ }
+
+void COomConfig::SetDefaultGoodSwapThreshold(TInt aGoodSwapThreshold)
+ {
+ iGlobalConfig.iGoodSwapThreshold = aGoodSwapThreshold;
+ }
+
void COomConfig::SetMaxCloseAppBatch(TUint aMaxCloseAppBatch)
{
iGlobalConfig.iMaxCloseAppBatch = aMaxCloseAppBatch;
--- a/sysresmonitoring/oommonitor/inc/oomglobalconfig.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomglobalconfig.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -42,6 +42,9 @@
public:
TInt iLowRamThreshold;
TInt iGoodRamThreshold;
+ TBool iSwapUsageMonitored;
+ TInt iLowSwapThreshold;
+ TInt iGoodSwapThreshold;
TUint iMaxCloseAppBatch;
TInt iDefaultWaitAfterPlugin;
TInt iMaxAppExitTime;
--- a/sysresmonitoring/oommonitor/inc/oommemorymonitor.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oommemorymonitor.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,7 @@
#ifndef OOMMEMORYMONITOR_H
#define OOMMEMORYMONITOR_H
+#include <u32hal.h>
#include <e32property.h>
#include <f32file.h>
#include <w32std.h>
@@ -69,9 +70,9 @@
public: // event handlers
void FreeMemThresholdCrossedL();
void AppNotExiting(TInt aWgId);
- void StartFreeSomeRamL(TInt aTargetFree);
- void StartFreeSomeRamL(TInt aTargetFree, TInt aMaxPriority);
- void FreeOptionalRamL(TInt aBytesRequested, TInt aPluginId); // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
+ void StartFreeSomeRamL(TInt aFreeRamTarget, TInt aFreeSwapSpaceTarget);
+ void StartFreeSomeRamL(TInt aFreeRamTarget, TInt aFreeSwapSpaceTarget, TInt aMaxPriority);
+ void FreeOptionalRamL(TInt aBytesRequested, TInt aPluginId, TBool aDataPaged); // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
void HandleFocusedWgChangeL();
static const COomGlobalConfig& GlobalConfig();
void SetPriorityBusy(TInt aWgId);
@@ -80,13 +81,14 @@
void ResetTargets();
void RequestTimerCallbackL();
void GetFreeMemory(TInt& aCurrentFreeMemory);
+ void GetFreeSwapSpace(TInt& aCurrentFreeSwapSpace);
TActionTriggerType ActionTrigger() const;
#ifdef CLIENT_REQUEST_QUEUE
void ActionsCompleted(TInt aBytesFree, TBool aMemoryGood);
- TInt GoodThreshold() const;
- TInt LowThreshold() const;
+ TInt GoodRamThreshold() const;
+ TInt LowRamThreshold() const;
#endif
- void RequestFreeMemoryL(TInt aBytesRequested);
+ void RequestFreeMemoryL(TInt aBytesRequested, TBool aDataPaged);
void RequestFreeMemoryPandSL(TInt aBytesRequested);
/*
@@ -115,12 +117,20 @@
RFs iFs;
RWsSession iWs;
+ TBool iDataPaged;
+
private: //data
// parameters for OOM watcher.
- TInt iLowThreshold;
- TInt iGoodThreshold;
- TInt iCurrentTarget;
+ TInt iLowRamThreshold;
+ TInt iGoodRamThreshold;
+ TInt iLowSwapThreshold;
+ TInt iGoodSwapThreshold;
+ TInt iCurrentRamTarget;
+ TInt iCurrentSwapTarget;
+
+
+
#ifdef CLIENT_REQUEST_QUEUE
TInt iClientBytesRequested;
#endif
--- a/sysresmonitoring/oommonitor/inc/oommemorymonitorsession.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oommemorymonitorsession.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -31,6 +31,7 @@
CMemoryMonitorSession();
#ifndef CLIENT_REQUEST_QUEUE
void CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood);
+ TBool IsDataPaged(const RMessage2& aMessage);
#endif
private:
--- a/sysresmonitoring/oommonitor/inc/oomoutofmemorywatcher.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomoutofmemorywatcher.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -33,7 +33,8 @@
NONSHARABLE_CLASS(COutOfMemoryWatcher) : public CActive
{
public:
- static COutOfMemoryWatcher* NewL(CMemoryMonitor& aLafShutdown, TInt aLowThreshold, TInt aGoodThreshold);
+ static COutOfMemoryWatcher* NewL(CMemoryMonitor& aMonitor, TInt aLowRamThreshold, TInt aGoodRamThreshold,
+ TBool aSwapUsageMonitored, TInt aLowSwapThreshold, TInt aGoodSwapThreshold);
~COutOfMemoryWatcher();
void Start();
@@ -43,16 +44,17 @@
* @param aLowThreshold If Ram Level drops below the low threshold Oom Monitor actions are started.
* @param aGoodThreshold When memory returns above the Good threshold then Oom Monitor stops freeing memory.
*/
- void UpdateThresholds(TInt aLowThreshold, TInt aGoodThreshold);
+ void UpdateThresholds(TInt aLowRamThreshold, TInt aGoodRamThreshold, TInt aLowSwapThreshold, TInt aGoodSwapThreshold);
private:
- COutOfMemoryWatcher(CMemoryMonitor& aLafShutdown);
- void ConstructL(TInt aLowThreshold, TInt aGoodThreshold);
+ COutOfMemoryWatcher(CMemoryMonitor& aMonitor, TBool aSwapUsageMonitored);
+ void ConstructL(TInt aLowRamThreshold, TInt aGoodRamThreshold, TInt aLowSwapThreshold, TInt aGoodSwapThreshold);
private: // from CActive
void DoCancel();
void RunL();
private: // data
RChangeNotifier iChangeNotifier;
- CMemoryMonitor& iLafShutdown;
+ CMemoryMonitor& iMemoryMonitor;
+ TBool iSwapUsageMonitored;
};
#endif /*OOMOUTOFMEMORYWATCHER_H*/
--- a/sysresmonitoring/oommonitor/inc/oomrunplugin.h Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/inc/oomrunplugin.h Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -44,7 +44,7 @@
// Run the OOM plugin in order to free memory
// Call the COomAction::MemoryFreed when it is done
- virtual void FreeMemory(TInt aBytesRequested);
+ virtual void FreeMemory(TInt aBytesRequested, TBool aIsDataPaged);
// Call the memory good function on the plugin but...
// only if there is an outstanding FreeMemory request
@@ -63,8 +63,20 @@
private:
- COomRunPlugin(TUint aPluginId, COomRunPluginConfig& aConfig, MOomActionObserver& aStateChangeObserver, COomMonitorPlugin& aPlugin, COomMonitorPluginV2* aV2Plugin);
+ COomRunPlugin(TUint aPluginId, COomRunPluginConfig& aConfig,
+ MOomActionObserver& aStateChangeObserver,
+ COomMonitorPlugin& aPlugin, COomMonitorPluginV2* aV2Plugin);
+ /**
+ * Function: IsAppDataPaged
+ * Checks whether the application which implements the given
+ * COomMonitorPlugin is data paged
+ * @param instance of the monitor plugin.
+ * @return ETrue if the application is data paged, else EFalse;
+ */
+ TBool IsAppDataPaged( COomMonitorPlugin& aPlugin ) const;
+
+private:
TUint iPluginId;
COomMonitorPlugin& iPlugin;
--- a/sysresmonitoring/oommonitor/src/oomactionlist.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomactionlist.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -327,10 +327,16 @@
TInt maxBatchSize = globalConfig.iMaxCloseAppBatch;
TInt numberOfRunningActions = 0;
- TInt memoryEstimate; // The amount of free memory we expect to be free after the currently initiated operations
- HAL::Get(HALData::EMemoryRAMFree, memoryEstimate);
-
-
+ TInt freeRamEstimate = 0; // The amount of free memory we expect to be free after the currently initiated operations
+ HAL::Get(HALData::EMemoryRAMFree, freeRamEstimate);
+ TUint64 freeSwapEstimate = 0;
+ if (iSwapUsageMonitored)
+ {
+ SVMSwapInfo swapInfo;
+ UserSvr::HalFunction(EHalGroupVM, EVMHalGetSwapInfo, &swapInfo, 0);
+ freeSwapEstimate = swapInfo.iSwapFree;
+ }
+
while (iCurrentActionIndex < iActionRefs.Count()
&& iActionRefs[iCurrentActionIndex].Priority() <= aMaxPriority)
{
@@ -351,7 +357,20 @@
iMonitor.SetMemoryMonitorStatusProperty(EFreeingMemory);
- action->FreeMemory(iCurrentTarget - memoryEstimate);
+ // At the moment the actions don't make any difference between freeing
+ // RAM and freeing swap. So we try to free the biggest of the two.
+ // Until the plugins are updated to make a distinction between swap and RAM this is the best
+ // we can do. For application close actions the amount to try to free is ignored anyway.
+ TUint amountToTryToFree = 0;
+ if (iCurrentRamTarget > freeRamEstimate)
+ {
+ amountToTryToFree = iCurrentRamTarget - freeRamEstimate;
+ }
+ if (iSwapUsageMonitored && (iCurrentSwapTarget > freeSwapEstimate) && ((iCurrentSwapTarget - freeSwapEstimate) > amountToTryToFree))
+ {
+ amountToTryToFree = iCurrentSwapTarget - freeSwapEstimate;
+ }
+ action->FreeMemory(amountToTryToFree, iMonitor.iDataPaged);
memoryFreeingActionRun = ETrue;
// Actions with EContinueIgnoreMaxBatchSize don't add to the tally of running actions
@@ -359,12 +378,12 @@
numberOfRunningActions++;
// Update our estimate of how much RAM we think we'll have after this operation
- memoryEstimate += ref.RamEstimate();
+ freeRamEstimate += ref.RamEstimate();
// Do we estimate that we are freeing enough memory (only applies if the sync mode is "esimtate" for this action)
TBool estimatedEnoughMemoryFreed = EFalse;
if ((ref.SyncMode() == EEstimate)
- && (memoryEstimate >= iCurrentTarget))
+ && (freeRamEstimate >= iCurrentRamTarget))
{
estimatedEnoughMemoryFreed = ETrue;
}
@@ -391,9 +410,15 @@
// No usable memory freeing action has been found, so we give up
TRACES("COomActionList::FreeMemory: No usable memory freeing action has been found");
iMonitor.ResetTargets();
- TInt freeMemory;
+ TInt freeMemory = 0;
iMonitor.GetFreeMemory(freeMemory);
- if (freeMemory >= iCurrentTarget)
+ TInt freeSwap = 0;
+ if (iSwapUsageMonitored)
+ {
+ iMonitor.GetFreeSwapSpace(freeSwap);
+ }
+ if ((freeMemory >= iCurrentRamTarget) &&
+ ((!iSwapUsageMonitored) || (freeSwap >= iCurrentSwapTarget)))
{
SwitchOffPlugins();
iMonitor.SetMemoryMonitorStatusProperty(EAboveTreshHold);
@@ -570,9 +595,15 @@
//and therefore we are still in a memory freeing state
iFreeingMemory = EFalse;
// If all of the actions are complete then check memory and run more if necessary
- TInt freeMemory;
+ TInt freeMemory = 0;
iMonitor.GetFreeMemory(freeMemory);
- if (freeMemory < iCurrentTarget)
+ TInt freeSwap = 0;
+ if (iSwapUsageMonitored)
+ {
+ iMonitor.GetFreeSwapSpace(freeSwap);
+ }
+ if ((freeMemory < iCurrentRamTarget) ||
+ (iSwapUsageMonitored && (freeSwap < iCurrentSwapTarget)))
// If we are still below the good-memory-threshold then continue running actions
{
iCurrentActionIndex++;
@@ -582,7 +613,8 @@
// There are no more actions to try, so we give up
TRACES1("COomActionList::StateChanged: All current actions complete, below good threshold with no more actions available. freeMemory=%d", freeMemory);
iMonitor.ResetTargets();
- if (freeMemory >= iCurrentTarget)
+ if ((freeMemory >= iCurrentRamTarget) &&
+ ((!iSwapUsageMonitored) || (freeSwap >= iCurrentSwapTarget)))
{
SwitchOffPlugins();
iMonitor.SetMemoryMonitorStatusProperty(EAboveTreshHold);
@@ -637,6 +669,7 @@
FUNC_LOG;
iCurrentActionIndex = 0;
+ iSwapUsageMonitored = aConfig.GlobalConfig().iSwapUsageMonitored;
iFreeingMemory = EFalse;
// Get the list of V1 and V2 plugins available to the system
@@ -663,7 +696,7 @@
COomRunPluginConfig& pluginConfig = aConfig.GetPluginConfig(iPluginListV2->Uid(pluginIndex));
// Create an action acording to the config
- COomRunPlugin* action = COomRunPlugin::NewL(iPluginList->Uid(pluginIndex), pluginConfig, *this, iPluginListV2->Implementation(pluginIndex), &(iPluginListV2->Implementation(pluginIndex)));
+ COomRunPlugin* action = COomRunPlugin::NewL(iPluginListV2->Uid(pluginIndex), pluginConfig, *this, iPluginListV2->Implementation(pluginIndex), &(iPluginListV2->Implementation(pluginIndex)));
iRunPluginActions.AppendL(action);
}
--- a/sysresmonitoring/oommonitor/src/oomapplicationconfig.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomapplicationconfig.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -59,6 +59,8 @@
iGoodRamThreshold = KOomThresholdUnset;
iLowRamThreshold = KOomThresholdUnset;
+ iGoodSwapThreshold = KOomThresholdUnset;
+ iLowSwapThreshold = KOomThresholdUnset;
}
COomApplicationConfig::COomApplicationConfig(TUint aApplicationId) : iApplicationId(aApplicationId)
--- a/sysresmonitoring/oommonitor/src/oomclientrequestqueue.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomclientrequestqueue.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -185,17 +185,32 @@
iClientRequestActive = ETrue;
TClientRequest* request = iQueue.First();
-
+
+ RThread clientThread;
+ TInt err = (request->iRequestFreeRamMessage).Client(clientThread);
+ TBool dataPaged = EFalse;
+ if(err == KErrNone)
+ {
+ RProcess processName;
+ err = clientThread.Process(processName);
+ dataPaged = processName.DefaultDataPaged();
+ }
+ else
+ {
+ OomMonitorPanic(KInvalidClientRequestType);
+ }
+
+
switch (request->iClientRequestType)
{
case EClientServerRequestOptionalRam:
{
TInt pluginId = request->iRequestFreeRamMessage.Int2();
- iMonitor.FreeOptionalRamL(request->iBytesRequested, pluginId);
+ iMonitor.FreeOptionalRamL(request->iBytesRequested, pluginId, dataPaged);
break;
}
case EClientServerRequestFreeMemory:
- iMonitor.RequestFreeMemoryL(request->iBytesRequested);
+ iMonitor.RequestFreeMemoryL(request->iBytesRequested, dataPaged);
break;
case EPublishAndSubscribe:
iMonitor.RequestFreeMemoryPandSL(request->iBytesRequested);
@@ -258,7 +273,7 @@
message = request->iRequestFreeRamMessage;
if (!message.IsNull())
{
- TInt memoryAvailable = aBytesFree - iMonitor.GoodThreshold();
+ TInt memoryAvailable = aBytesFree - iMonitor.GoodRamThreshold();
TInt minimumNeeded = message.Int1();
if (memoryAvailable >= minimumNeeded)
{
--- a/sysresmonitoring/oommonitor/src/oomcloseapp.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomcloseapp.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -40,7 +40,7 @@
// Close the application in order to free memory
// Call the COomAction::MemoryFreed when it is done
-void COomCloseApp::FreeMemory(TInt)
+void COomCloseApp::FreeMemory(TInt, TBool aIsDataPaged)
{
FUNC_LOG;
@@ -56,7 +56,19 @@
iAppCloseWatcher->Start(iCurrentTask);
// Tell the app to close
TRACES1("COomCloseApp::FreeMemory: Closing app with window group id %d",iWgId);
- iCurrentTask.EndTask();
+
+ RThread thread;
+ TInt err=thread.Open(iCurrentTask.ThreadId());
+ if (err == KErrNone)
+ {
+ RProcess process;
+ thread.Process(process);
+ TBool isDataPaged = process.DefaultDataPaged();
+ if((aIsDataPaged && isDataPaged) || (!aIsDataPaged && !isDataPaged ))
+ {
+ iCurrentTask.EndTask();
+ }
+ }
}
COomCloseApp::~COomCloseApp()
--- a/sysresmonitoring/oommonitor/src/oomconfigparser.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomconfigparser.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -37,6 +37,9 @@
KOomErrAppIdleSettingsMustComeAfterAppCloseSettings,
KOomErrLowRamErrorInGlobalSettings,
KOomErrGoodRamErrorInGlobalSettings,
+KOomErrSwapUsageMonitoredErrorInGlobalSettings,
+KOomErrLowSwapErrorInGlobalSettings,
+KOomErrGoodSwapErrorInGlobalSettings,
KOomErrMaxCloseErrorInGlobalSettings,
KOomErrDefaultPriorityErrorInGlobalSettings,
KOomErrMissingUidFromAppCloseConfig,
@@ -118,6 +121,9 @@
// Global settings attribute names
_LIT8(KOomAttributeLowRamThreshold, "low_ram_threshold");
_LIT8(KOomAttributeGoodRamThreshold, "good_ram_threshold");
+_LIT8(KOomAttributeSwapUsageMonitored, "swap_usage_monitored");
+_LIT8(KOomAttributeLowSwapThreshold, "low_swap_threshold");
+_LIT8(KOomAttributeGoodSwapThreshold, "good_swap_threshold");
_LIT8(KOomAttributeMaxAppCloseBatch, "max_app_close_batch");
_LIT8(KOomAttributeDefaultWaitAfterPlugin, "default_wait_after_plugin");
_LIT8(KOomAttributeMaxAppExitTime , "max_app_exit_time");
@@ -383,6 +389,39 @@
if (err == KErrNone)
{
+ TInt swapUsageMonitored;
+ TInt err = GetValueFromBooleanAttributeList(aAttributes, KOomAttributeSwapUsageMonitored, swapUsageMonitored);
+
+ if (err == KErrNone)
+ iConfig.SetSwapUsageMonitored(swapUsageMonitored);
+ else
+ ConfigError(KOomErrSwapUsageMonitoredErrorInGlobalSettings);
+ }
+
+ if (err == KErrNone)
+ {
+ TInt defaultLowSwapThreshold;
+ TInt err = GetValueFromDecimalAttributeList(aAttributes, KOomAttributeLowSwapThreshold, defaultLowSwapThreshold);
+
+ if (err == KErrNone)
+ iConfig.SetDefaultLowSwapThreshold(defaultLowSwapThreshold * KBytesInMegabyte);
+ else
+ ConfigError(KOomErrLowSwapErrorInGlobalSettings);
+ }
+
+ if (err == KErrNone)
+ {
+ TInt defaultGoodSwapThreshold;
+ TInt err = GetValueFromDecimalAttributeList(aAttributes, KOomAttributeGoodSwapThreshold, defaultGoodSwapThreshold);
+
+ if (err == KErrNone)
+ iConfig.SetDefaultGoodSwapThreshold(defaultGoodSwapThreshold * KBytesInMegabyte);
+ else
+ ConfigError(KOomErrGoodSwapErrorInGlobalSettings);
+ }
+
+ if (err == KErrNone)
+ {
TInt defaultMaxCloseAppBatch;
TInt err = GetValueFromDecimalAttributeList(aAttributes, KOomAttributeMaxAppCloseBatch, defaultMaxCloseAppBatch);
@@ -479,6 +518,39 @@
ConfigError(KOomErrBadGoodThresholdValueForAppConfig);
}
+ // Set the app specific swap thresholds (if they exist)
+ // Get the app specific low swap threshold
+ if (err == KErrNone)
+ {
+ TUint lowThreshold;
+ err = GetValueFromDecimalAttributeList(aAttributes, KOomAttributeLowSwapThreshold, lowThreshold);
+ if (err == KErrNone)
+ {
+ appConfig->iLowSwapThreshold = lowThreshold * KBytesInMegabyte;
+ }
+ else if (err == KErrNotFound)
+ err = KErrNone;
+
+ if (err != KErrNone)
+ ConfigError(KOomErrBadLowThresholdValueForAppConfig);
+ }
+
+ // Get the app specific good swapthreshold
+ if (err == KErrNone)
+ {
+ TUint goodThreshold;
+ err = GetValueFromDecimalAttributeList(aAttributes, KOomAttributeGoodSwapThreshold, goodThreshold);
+ if (err == KErrNone)
+ {
+ appConfig->iGoodSwapThreshold = goodThreshold * KBytesInMegabyte;
+ }
+ else if (err == KErrNotFound)
+ err = KErrNone;
+
+ if (err != KErrNone)
+ ConfigError(KOomErrBadGoodThresholdValueForAppConfig);
+ }
+
// Add the applciation config to the main config
if ((err == KErrNone) && (appConfig))
{
--- a/sysresmonitoring/oommonitor/src/oommemorymonitor.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oommemorymonitor.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -18,6 +18,7 @@
#include <hal.h>
+
#include <UikonInternalPSKeys.h>
#include "oommemorymonitor.h"
@@ -162,7 +163,7 @@
#endif
- iOOMWatcher = COutOfMemoryWatcher::NewL(*this, iLowThreshold, iGoodThreshold);
+ iOOMWatcher = COutOfMemoryWatcher::NewL(*this, iLowRamThreshold, iGoodRamThreshold, iConfig->GlobalConfig().iSwapUsageMonitored, iLowSwapThreshold, iGoodSwapThreshold);
iOOMWatcher->Start();
iWservEventReceiver = new(ELeave) CWservEventReceiver(*this, iWs);
@@ -185,61 +186,86 @@
FUNC_LOG;
iActionTrigger = ERamRotation;
- StartFreeSomeRamL(iGoodThreshold);
+ StartFreeSomeRamL(iGoodRamThreshold, iGoodSwapThreshold);
}
void CMemoryMonitor::HandleFocusedWgChangeL()
{
FUNC_LOG;
- TInt oldGoodThreshold = iGoodThreshold;
- TInt oldLowThreshold = iLowThreshold;
-
+ TInt oldGoodRamThreshold = iGoodRamThreshold;
+ TInt oldLowRamThreshold = iLowRamThreshold;
+ TInt oldGoodSwapThreshold = iGoodSwapThreshold;
+ TInt oldLowSwapThreshold = iLowSwapThreshold;
+
// Refresh the low and good memory thresholds as they may have changed due to the new foreground application
RefreshThresholds();
- if ((oldGoodThreshold != iGoodThreshold)
- || (oldLowThreshold != iLowThreshold))
+ if ((oldGoodRamThreshold != iGoodRamThreshold)
+ || (oldLowRamThreshold != iLowRamThreshold)
+ || (oldGoodSwapThreshold != iGoodSwapThreshold)
+ || (oldLowSwapThreshold != iLowSwapThreshold))
// If the thresholds have changed then update the memory watched
{
- iOOMWatcher->UpdateThresholds(iLowThreshold, iGoodThreshold);
+ iOOMWatcher->UpdateThresholds(iLowRamThreshold, iGoodRamThreshold, iLowSwapThreshold, iGoodSwapThreshold);
}
// If the available memory is less than the low memory threshold then free some RAM
User::CompressAllHeaps();
- TInt current = 0;
- HAL::Get( HALData::EMemoryRAMFree, current );
+ TInt currentFreeRam = 0;
+ HAL::Get( HALData::EMemoryRAMFree, currentFreeRam );
+ TInt currentFreeSwap = 0;
+ if (iConfig->GlobalConfig().iSwapUsageMonitored)
+ {
+ SVMSwapInfo swapInfo;
+ UserSvr::HalFunction(EHalGroupVM, EVMHalGetSwapInfo, &swapInfo, 0);
+ currentFreeSwap = swapInfo.iSwapFree;
+ }
- if (current < iLowThreshold)
+ if ((currentFreeRam < iLowRamThreshold) ||
+ (iConfig->GlobalConfig().iSwapUsageMonitored && (currentFreeSwap < iLowSwapThreshold)))
{
iActionTrigger = ERamRotation;
- StartFreeSomeRamL(iGoodThreshold);
+ StartFreeSomeRamL(iGoodRamThreshold, iGoodSwapThreshold);
}
}
-void CMemoryMonitor::StartFreeSomeRamL(TInt aTargetFree)
+void CMemoryMonitor::StartFreeSomeRamL(TInt aFreeRamTarget, TInt aFreeSwapTarget)
{
- StartFreeSomeRamL(aTargetFree, KOomPriorityInfinate - 1);
+ StartFreeSomeRamL(aFreeRamTarget, aFreeSwapTarget, KOomPriorityInfinate - 1);
}
-void CMemoryMonitor::StartFreeSomeRamL(TInt aTargetFree, TInt aMaxPriority) // The maximum priority of action to run
+void CMemoryMonitor::StartFreeSomeRamL(TInt aFreeRamTarget, TInt aFreeSwapTarget, TInt aMaxPriority) // The maximum priority of action to run
{
FUNC_LOG;
- TRACES2("MemoryMonitor::StartFreeSomeRamL: aTargetFree = %d, iCurrentTarget = %d", aTargetFree, iCurrentTarget);
+ TRACES4("MemoryMonitor::StartFreeSomeRamL: aFreeRamTarget = %d, iCurrentRamTarget = %d, aFreeSwapSpaceTarget = %d, iCurrentSwapTarget = %d", aFreeRamTarget, iCurrentRamTarget, aFreeSwapTarget, iCurrentSwapTarget);
// Update the target if new target is higher. If the target is lower than the current target and memory
// is currently being freed then we do not want to reduce the amount of memory this operation frees.
- if (aTargetFree > iCurrentTarget)
- iCurrentTarget = aTargetFree;
+ if (aFreeRamTarget > iCurrentRamTarget)
+ {
+ iCurrentRamTarget = aFreeRamTarget;
+ }
+
+ if (aFreeSwapTarget > iCurrentSwapTarget)
+ {
+ iCurrentSwapTarget = aFreeSwapTarget;
+ }
// check if there is enough free memory already.
- TInt freeMemory;
+ TInt freeMemory = 0;
GetFreeMemory(freeMemory);
+ TInt freeSwap = 0;
+ if (iConfig->GlobalConfig().iSwapUsageMonitored)
+ {
+ GetFreeSwapSpace(freeSwap);
+ }
- TRACES1("MemoryMonitor::StartFreeSomeRamL, freeMemory = %d", freeMemory);
+ TRACES2("MemoryMonitor::StartFreeSomeRamL, freeMemory = %d, freeSwap = %d", freeMemory, freeSwap);
- if (freeMemory >= iCurrentTarget)
+ if ((freeMemory >= iCurrentRamTarget) &&
+ ((!iConfig->GlobalConfig().iSwapUsageMonitored) || (freeSwap >= iCurrentSwapTarget)))
{
if (iLastMemoryMonitorStatusProperty != EFreeingMemory)
{
@@ -262,7 +288,7 @@
// Build the list of memory freeing actions
iOomActionList->BuildActionListL(*iOomWindowGroupList, *iConfig);
- iOomActionList->SetCurrentTarget(iCurrentTarget);
+ iOomActionList->SetCurrentTargets(iCurrentRamTarget, iCurrentSwapTarget);
// Run the memory freeing actions
iOomActionList->FreeMemory(aMaxPriority);
@@ -273,27 +299,30 @@
FUNC_LOG;
iActionTrigger = EPublishAndSubscribe;
- StartFreeSomeRamL(aBytesRequested + iLowThreshold);
+ StartFreeSomeRamL(aBytesRequested + iLowRamThreshold, iLowSwapThreshold);
}
-void CMemoryMonitor::RequestFreeMemoryL(TInt aBytesRequested)
+void CMemoryMonitor::RequestFreeMemoryL(TInt aBytesRequested, TBool aDataPaged)
{
FUNC_LOG;
iActionTrigger = EClientServerRequestFreeMemory;
- StartFreeSomeRamL(aBytesRequested + iLowThreshold);
+ iDataPaged = aDataPaged;
+ StartFreeSomeRamL(iLowRamThreshold, aBytesRequested + iLowSwapThreshold);
}
-void CMemoryMonitor::FreeOptionalRamL(TInt aBytesRequested, TInt aPluginId) // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
+void CMemoryMonitor::FreeOptionalRamL(TInt aBytesRequested, TInt aPluginId, TBool aDataPaged) // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
{
FUNC_LOG;
iActionTrigger = EClientServerRequestOptionalRam;
+ iDataPaged = aDataPaged;
+
// Calculate the priority of the allocation (the priority of the plugin that will clear it up - 1)
TInt priorityOfAllocation = iConfig->GetPluginConfig(aPluginId).CalculatePluginPriority(*iOomWindowGroupList) - 1;
- StartFreeSomeRamL(aBytesRequested + iGoodThreshold, priorityOfAllocation);
+ StartFreeSomeRamL(aBytesRequested + iGoodRamThreshold, iLowSwapThreshold, priorityOfAllocation);
}
void CMemoryMonitor::GetFreeMemory(TInt& aCurrentFreeMemory)
@@ -308,6 +337,17 @@
TRACES1("CMemoryMonitor::GetFreeMemory: Free RAM now %d", aCurrentFreeMemory);
}
+void CMemoryMonitor::GetFreeSwapSpace(TInt& aCurrentFreeSwapSpace)
+ {
+ FUNC_LOG;
+
+ SVMSwapInfo swapInfo;
+ UserSvr::HalFunction(EHalGroupVM, EVMHalGetSwapInfo, &swapInfo, 0);
+ aCurrentFreeSwapSpace = swapInfo.iSwapFree;
+
+ TRACES1("CMemoryMonitor::GetFreeSwapSpace: Free swap space now %d", aCurrentFreeSwapSpace);
+ }
+
#ifndef CLIENT_REQUEST_QUEUE
TInt CMemoryMonitor::WatchdogStatusStatusChanged(TAny* aPtr)
{
@@ -358,9 +398,11 @@
iOomWindowGroupList->Refresh();
// Calculate the desired good threshold, this could be the globally configured value...
- iGoodThreshold = CMemoryMonitor::GlobalConfig().iGoodRamThreshold;
- iLowThreshold = CMemoryMonitor::GlobalConfig().iLowRamThreshold;
- TRACES2("CMemoryMonitor::RefreshThresholds: Global Good Threshold = %d, Global Low Threshold = %d", iGoodThreshold, iLowThreshold);
+ iGoodRamThreshold = CMemoryMonitor::GlobalConfig().iGoodRamThreshold;
+ iLowRamThreshold = CMemoryMonitor::GlobalConfig().iLowRamThreshold;
+ iGoodSwapThreshold = CMemoryMonitor::GlobalConfig().iGoodSwapThreshold;
+ iLowSwapThreshold = CMemoryMonitor::GlobalConfig().iLowSwapThreshold;
+ TRACES4("CMemoryMonitor::RefreshThresholds: Global Good Ram Threshold = %d, Global Low Ram Threshold = %d, Global Good Swap Threshold = %d, Global Low Swap Threshold = %d", iGoodRamThreshold, iLowRamThreshold, iGoodSwapThreshold, iLowSwapThreshold);
#ifdef _DEBUG
TRACES("CMemoryMonitor::RefreshThresholds: Dumping Window Group List");
@@ -393,16 +435,27 @@
// If this application configuration overrides the good_ram_threshold then set it
if (iConfig->GetApplicationConfig(foregroundAppId).iGoodRamThreshold != KOomThresholdUnset)
{
- iGoodThreshold = iConfig->GetApplicationConfig(foregroundAppId).iGoodRamThreshold;
- TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Good Threshold = %d", foregroundAppId, iGoodThreshold);
+ iGoodRamThreshold = iConfig->GetApplicationConfig(foregroundAppId).iGoodRamThreshold;
+ TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Good Ram Threshold = %d", foregroundAppId, iGoodRamThreshold);
}
// If this application configuration overrides the low_ram_threshold then set it
if (iConfig->GetApplicationConfig(foregroundAppId).iLowRamThreshold != KOomThresholdUnset)
{
- iLowThreshold = iConfig->GetApplicationConfig(foregroundAppId).iLowRamThreshold;
- TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Low Threshold = %d", foregroundAppId, iLowThreshold);
+ iLowRamThreshold = iConfig->GetApplicationConfig(foregroundAppId).iLowRamThreshold;
+ TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Low Ram Threshold = %d", foregroundAppId, iLowRamThreshold);
}
+ if (iConfig->GetApplicationConfig(foregroundAppId).iGoodSwapThreshold != KOomThresholdUnset)
+ {
+ iGoodSwapThreshold = iConfig->GetApplicationConfig(foregroundAppId).iGoodSwapThreshold;
+ TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Good Swap Threshold = %d", foregroundAppId, iGoodSwapThreshold);
+ }
+ // If this application configuration overrides the low_swap_threshold then set it
+ if (iConfig->GetApplicationConfig(foregroundAppId).iLowSwapThreshold != KOomThresholdUnset)
+ {
+ iLowSwapThreshold = iConfig->GetApplicationConfig(foregroundAppId).iLowSwapThreshold;
+ TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Low Swap Threshold = %d", foregroundAppId, iLowSwapThreshold);
+ }
}
}
@@ -423,8 +476,9 @@
//we reset the target when a memory free operation completes, to deal with the case
//where the operation was initiated with a target larger than the current good threshold
- iCurrentTarget = iGoodThreshold;
- iOomActionList->SetCurrentTarget(iCurrentTarget);
+ iCurrentRamTarget = iGoodRamThreshold;
+ iCurrentSwapTarget = iGoodSwapThreshold;
+ iOomActionList->SetCurrentTargets(iCurrentRamTarget, iCurrentSwapTarget);
}
void CMemoryMonitor::SetPriorityBusy(TInt aWgId)
@@ -452,14 +506,14 @@
}
#ifdef CLIENT_REQUEST_QUEUE
-TInt CMemoryMonitor::GoodThreshold() const
+TInt CMemoryMonitor::GoodRamThreshold() const
{
- return iGoodThreshold;
+ return iGoodRamThreshold;
}
-TInt CMemoryMonitor::LowThreshold() const
+TInt CMemoryMonitor::LowRamThreshold() const
{
- return iLowThreshold;
+ return iLowRamThreshold;
}
void CMemoryMonitor::ActionsCompleted(TInt aBytesFree, TBool aMemoryGood)
--- a/sysresmonitoring/oommonitor/src/oommemorymonitorsession.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oommemorymonitorsession.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -60,6 +60,32 @@
return Server().Monitor();
#endif
}
+#ifndef CLIENT_REQUEST_QUEUE
+TBool CMemoryMonitorSession::IsDataPaged(const RMessage2& aMessage)
+ {
+ RThread clientThread;
+ TInt err = aMessage.Client(clientThread);
+ TBool dataPaged = EFalse;
+ if(err == KErrNone)
+ {
+ RProcess processName;
+ err = clientThread.Process(processName);
+ if(err == KErrNone)
+ {
+ dataPaged = processName.DefaultDataPaged();
+ }
+ else
+ {
+ PanicClient(aMessage, EPanicIllegalFunction);
+ }
+ }
+ else
+ {
+ PanicClient(aMessage, EPanicIllegalFunction);
+ }
+ return dataPaged;
+ }
+#endif
void CMemoryMonitorSession::ServiceL(const RMessage2& aMessage)
{
@@ -79,7 +105,7 @@
ClientRequestQueue().RequestFreeMemoryL(aMessage);
#else
iRequestFreeRam = aMessage;
- Monitor().RequestFreeMemoryL(aMessage.Int0());
+ Monitor().RequestFreeMemoryL(aMessage.Int0(), IsDataPaged(aMessage));
#endif
break;
@@ -103,7 +129,7 @@
#else
iRequestFreeRam = aMessage;
iMinimumMemoryRequested = aMessage.Int1();
- Monitor().FreeOptionalRamL(aMessage.Int0(), aMessage.Int2());
+ Monitor().FreeOptionalRamL(aMessage.Int0(), aMessage.Int2(), IsDataPaged(aMessage));
#endif
break;
--- a/sysresmonitoring/oommonitor/src/oommonitorplugin.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oommonitorplugin.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -87,7 +87,16 @@
return iMemoryMonitor->iWs;
}
-
+//-----------------------------------------------------------------------------
+// Function: AppId
+// Function returns the UID3 of the application which implements the
+// plugin
+//-----------------------------------------------------------------------------
+//
+EXPORT_C const TUid COomMonitorPlugin::AppId() const
+ {
+ return KNullUid;
+ }
EXPORT_C void COomMonitorPluginV2::FreeRam()
{
@@ -137,3 +146,15 @@
}
while (wgId>0);
}
+
+//-----------------------------------------------------------------------------
+// Function: AppId
+// Function returns the UID3 of the application which implements the
+// plugin
+//-----------------------------------------------------------------------------
+//
+const TUid CAppOomMonitorPlugin::AppId() const
+ {
+ return iAppUid;
+ }
+
--- a/sysresmonitoring/oommonitor/src/oomoutofmemorywatcher.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomoutofmemorywatcher.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -30,13 +30,13 @@
//
// ---------------------------------------------------------
//
-COutOfMemoryWatcher* COutOfMemoryWatcher::NewL(CMemoryMonitor& aMonitor, TInt aLowThreshold, TInt aGoodThreshold)
+COutOfMemoryWatcher* COutOfMemoryWatcher::NewL(CMemoryMonitor& aMonitor, TInt aLowRamThreshold, TInt aGoodRamThreshold, TBool aSwapUsageMonitored, TInt aLowSwapThreshold, TInt aGoodSwapThreshold)
{
FUNC_LOG;
- COutOfMemoryWatcher* self = new (ELeave) COutOfMemoryWatcher(aMonitor);
+ COutOfMemoryWatcher* self = new (ELeave) COutOfMemoryWatcher(aMonitor, aSwapUsageMonitored);
CleanupStack::PushL(self);
- self->ConstructL(aLowThreshold, aGoodThreshold);
+ self->ConstructL(aLowRamThreshold, aGoodRamThreshold, aLowSwapThreshold, aGoodSwapThreshold);
CleanupStack::Pop(self);
return self;
}
@@ -56,9 +56,10 @@
//
// ---------------------------------------------------------
//
-COutOfMemoryWatcher::COutOfMemoryWatcher(CMemoryMonitor& aMonitor)
+COutOfMemoryWatcher::COutOfMemoryWatcher(CMemoryMonitor& aMonitor, TBool aSwapUsageMonitored)
: CActive(CActive::EPriorityStandard),
- iLafShutdown(aMonitor)
+ iMemoryMonitor(aMonitor),
+ iSwapUsageMonitored(aSwapUsageMonitored)
{
FUNC_LOG;
@@ -69,19 +70,33 @@
//
// ---------------------------------------------------------
//
-void COutOfMemoryWatcher::ConstructL(TInt aLowThreshold, TInt aGoodThreshold)
+void COutOfMemoryWatcher::ConstructL(TInt aLowRamThreshold, TInt aGoodRamThreshold, TInt aLowSwapThreshold, TInt aGoodSwapThreshold)
{
FUNC_LOG;
- UserSvr::SetMemoryThresholds(aLowThreshold,aGoodThreshold);
+ UserSvr::SetMemoryThresholds(aLowRamThreshold,aGoodRamThreshold);
+ if (iSwapUsageMonitored)
+ {
+ SVMSwapThresholds thresholds;
+ thresholds.iLowThreshold = aLowSwapThreshold;
+ thresholds.iGoodThreshold = aGoodSwapThreshold;
+ UserSvr::HalFunction(EHalGroupVM, EVMHalSetSwapThresholds, &thresholds, 0);
+ }
User::LeaveIfError(iChangeNotifier.Create());
}
-void COutOfMemoryWatcher::UpdateThresholds(TInt aLowThreshold, TInt aGoodThreshold)
+void COutOfMemoryWatcher::UpdateThresholds(TInt aLowRamThreshold, TInt aGoodRamThreshold, TInt aLowSwapThreshold, TInt aGoodSwapThreshold)
{
FUNC_LOG;
- UserSvr::SetMemoryThresholds(aLowThreshold,aGoodThreshold);
+ UserSvr::SetMemoryThresholds(aLowRamThreshold,aGoodRamThreshold);
+ if (iSwapUsageMonitored)
+ {
+ SVMSwapThresholds thresholds;
+ thresholds.iLowThreshold = aLowSwapThreshold;
+ thresholds.iGoodThreshold = aGoodSwapThreshold;
+ UserSvr::HalFunction(EHalGroupVM, EVMHalSetSwapThresholds, &thresholds, 0);
+ }
}
// ---------------------------------------------------------
@@ -128,7 +143,7 @@
// Check for memory status change.
if (status & EChangesFreeMemory)
{
- iLafShutdown.FreeMemThresholdCrossedL();
+ iMemoryMonitor.FreeMemThresholdCrossedL();
}
// We are not active until FreeMemThresholdCrossedL returns.
--- a/sysresmonitoring/oommonitor/src/oomrunplugin.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomrunplugin.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -21,6 +21,9 @@
#include "oommonitorplugin.h"
#include "oompanic.h"
+#include <apgtask.h>
+#include <w32std.h>
+
COomRunPlugin* COomRunPlugin::NewL(TUint aPluginId, COomRunPluginConfig& aConfig, MOomActionObserver& aStateChangeObserver, COomMonitorPlugin& aPlugin, COomMonitorPluginV2* aV2Plugin)
{
FUNC_LOG;
@@ -34,21 +37,40 @@
// Run the OOM plugin in order to free memory
// Call the COomAction::MemoryFreed when it is done
-void COomRunPlugin::FreeMemory(TInt aBytesRequested)
+void COomRunPlugin::FreeMemory(TInt aBytesRequested, TBool aIsDataPaged)
{
FUNC_LOG;
- TRACES1("COomRunPlugin::FreeMemory: iPluginId = %x", iPluginId);
-
- // Ask the plugin to free some memory
-
+ iFreeMemoryCalled = ETrue;
+
// Do we have a V2 plugin, if so then use it
if (iV2Plugin)
+ {
+ //RDebug::Printf("COomRunPlugin::FreeMemory: Requesting to free the RAM iV2Plugin->FreeRam(%d) \n",aBytesRequested);
iV2Plugin->FreeRam(aBytesRequested);
- else
- // If we only have a V1 plugin then use that
+ }
+ else if( aIsDataPaged )
+ {
+ if (IsAppDataPaged(iPlugin) )
+ {
+ //the plugins implemented by the application which are WDP enabled
+ //are notified.
+ //RDebug::Printf("COomRunPlugin::FreeMemory: Requesting to free the RAM to Data paged app \n");
+ iPlugin.FreeRam();
+ }
+ else
+ {
+ //Request is for freeing the paged memory(swap) but the App(iPlugin belongs to)
+ //is non WDP no need to notify; as it can't free the swap memory
+ iFreeMemoryCalled = EFalse;
+ return;
+ }
+ }
+ else
+ {
+ //Unpaged memory will be freed in case of non WDP app
+ //RDebug::Printf("COomRunPlugin::FreeMemory: Requesting to free the RAM \n");
iPlugin.FreeRam();
-
- iFreeMemoryCalled = ETrue;
+ }
// Wait for the required time before we signal completion.
__ASSERT_DEBUG(!iPluginWaiter->IsActive(), OomMonitorPanic(KStartingActivePluginWaiter));
@@ -94,3 +116,50 @@
iPluginWaiter = COomPluginWaiter::NewL(waitDuration, *this);
}
+
+//-----------------------------------------------------------------------------
+// Function: IsAppDataPaged
+// Checks whether the application which implements the given
+// COomMonitorPlugin is data paged
+//-----------------------------------------------------------------------------
+//
+TBool COomRunPlugin::IsAppDataPaged
+ ( COomMonitorPlugin& aPlugin ) const
+ {
+ FUNC_LOG;
+ /*
+ /TRACES1("COomRunPlugin::IsAppDataPaged: aPlugin.AppId() = %x ", aPlugin.AppId() );
+ //RDebug::Printf("COomRunPlugin::IsAppDataPaged: aPlugin.AppId() = %x ", aPlugin.AppId() );
+ */
+ //the function find the process with given appid and check
+ //application supports the data paging.
+ RProcess clientprocess;
+ TApaTaskList taskList(aPlugin.WsSession());
+ RThread clientthread;
+ TInt err = clientthread.Open
+ (taskList.FindApp(aPlugin.AppId()).ThreadId());
+
+ //RDebug::Printf("COomRunPlugin::IsAppDataPaged: clientthread.Open() err = %d ", err );
+
+ if( !err )
+ {
+ //getting the process which provides the plugin
+ err = clientthread.Process(clientprocess);
+ RDebug::Printf("COomRunPlugin::IsAppDataPaged: clientthread.Process() err = %d ", err );
+
+ if( !err )
+ {
+ //checking whether the process is Data paged or not
+ TBool isdatapaged = clientprocess.DefaultDataPaged();
+ clientprocess.Close();
+ clientthread.Close();
+ //RDebug::Printf("COomRunPlugin::IsAppDataPaged: isdatapaged = %d ", isdatapaged );
+
+ return isdatapaged;
+ }
+ clientthread.Close();
+ }
+ //could not successfully open the handle of process or thread,
+ //the return EFalse
+ return EFalse;
+ }
--- a/systemsettings/gssensorplugin/data/gssensorpluginrsc.rss Thu Jul 15 18:49:38 2010 +0300
+++ b/systemsettings/gssensorplugin/data/gssensorpluginrsc.rss Thu Aug 19 10:05:08 2010 +0300
@@ -404,7 +404,9 @@
//
RESOURCE AVKON_VIEW r_gs_checkbox_view
{
- cba = r_gs_sen_softkeys_ok_back__change;
+ //cba = r_gs_sen_softkeys_ok_back__change; ou1cimx1#467503
+ menubar = r_gs_sen_menubar_change_exit;
+ cba =R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
}
// *** SENSOR ACTIVE STATUS ***
--- a/systemsettings/gssensorplugin/inc/gssenturnctrlview.h Thu Jul 15 18:49:38 2010 +0300
+++ b/systemsettings/gssensorplugin/inc/gssenturnctrlview.h Thu Aug 19 10:05:08 2010 +0300
@@ -71,6 +71,11 @@
* Checks currently activated item in list and updates MSK label if needed
*/
void CheckMiddleSoftkeyLabelL();
+
+ /**
+ * Deactivates current view.
+ */
+ void DoDeactivate();
private:
--- a/systemsettings/gssensorplugin/src/gssenturnctrlview.cpp Thu Jul 15 18:49:38 2010 +0300
+++ b/systemsettings/gssensorplugin/src/gssenturnctrlview.cpp Thu Aug 19 10:05:08 2010 +0300
@@ -29,6 +29,8 @@
#include <gssensorpluginrsc.rsg>
#include <gscommon.hrh>
#include <eikbtgpc.h>
+#include <featmgr.h>
+#include <hlplch.h>
// ========================= MEMBER FUNCTIONS ================================
@@ -121,24 +123,52 @@
break;
}
case EGSCmdOk:
- // Check selections
+ case EAknSoftkeyBack:
+ {
+ // Check selections
Container()->CheckSelections();
// Store changes and show previous view
Container()->StoreSelectionsL();
// cont. to next case
- case EAknSoftkeyBack:
- {
// activate previous view
iAppUi->ActivateLocalViewL( KGSSensorPluginUid );
break;
}
+ case EAknCmdHelp:
+ {
+ if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+ {
+ HlpLauncher::LaunchHelpApplicationL(
+ iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+ }
+ break;
+ }
+ case EGSSenMenuExit:
+ {
+ aCommand=EAknCmdExit;
+ iAppUi->HandleCommandL( aCommand );
+ break;
+ }
+
default:
iAppUi->HandleCommandL( aCommand );
break;
}
TRACE_( "[GSSensorPlugin] CGSSenTurnCtrlView::HandleCommandL() - return" );
}
-
+// ---------------------------------------------------------------------------
+// CGSSenTurnCtrlView::DoDeactivate
+// Deactivates the current view
+// ---------------------------------------------------------------------------
+void CGSSenTurnCtrlView::DoDeactivate()
+ {
+ // Check selections
+ Container()->CheckSelections();
+ // Store changes and show previous view
+ Container()->StoreSelectionsL();
+ CGSSensorBaseView::DoDeactivate();
+
+ }
// ---------------------------------------------------------------------------
// CGSSenTurnCtrlView::Container
// Returns call container item