# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277306579 -10800 # Node ID 2222076f5c60c3c445cc2599617bf840bcc4952f # Parent 951aeeb3da43dd9d77603f9e224c3d395b4d09c3 Revision: 201023 Kit: 2010125 diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/apgrfx/apgrecog.cpp --- a/appfw/apparchitecture/apgrfx/apgrecog.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/apgrfx/apgrecog.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1997-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" @@ -403,11 +403,15 @@ /** Gets the data (MIME) type of data passed by buffer. -@param aBuffer A buffer containing data +@param aBuffer A buffer containing data; Provide preferred size of buffer. +If MIME type could not be recognized using this buffer, provide a buffer of +larger size. @param aDataType On return, contains the result of the attempt to recognize data. @return KErrNone, if successful; otherwise one of the other system-wide error codes. + +@see RApaLsSession::GetPreferredBufSize() */ EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const { @@ -417,12 +421,15 @@ /** Gets the data (MIME) type for data taken from a file with a specified name. @param aName The full filename, including drive and path, of the file containing the data. -@param aBuffer A buffer containing data taken from the specified file; typically -the data is read from the beginning of the file. +@param aBuffer A buffer containing data taken from the specified file; Provide preferred size of buffer +from beginning of the file. If MIME type could not be recognized using this buffer, provide a buffer of +larger size. @param aDataType On return, contains the result of the attempt to recognize data. @return KErrNone, if successful; otherwise one of the other system-wide error codes. + +@see RApaLsSession::GetPreferredBufSize() */ EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const { @@ -456,12 +463,15 @@ data (MIME) type. @param aName The name of the file containing the data. -@param aBuffer A buffer containing data taken from the specified file; typically -the data is read from the beginning of the file. +@param aBuffer A buffer containing data taken from the specified file; Provide preferred size of buffer +from beginning of the file. If MIME type could not be recognized using this buffer, provide a buffer of +larger size. @param aDataType The data (MIME) type. @param aResult On return, contains the result of the test. @return KErrNone, if successful; otherwise one of the other system-wide error codes. + +@see RApaLsSession::GetPreferredBufSize() */ EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const { diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/aplist/aplappinforeader.cpp --- a/appfw/apparchitecture/aplist/aplappinforeader.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/aplist/aplappinforeader.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -233,13 +233,13 @@ { ReadAppRegistrationInfoL(); ReadLocalisationInfoL(); -#ifdef _DEBUG +#ifdef APPARC_SHOW_TRACE DisplayAppInfo(); #endif return ETrue; } -#ifdef _DEBUG +#ifdef APPARC_SHOW_TRACE void CApaAppInfoReader::DisplayAppInfo() { RDebug::Print(_L("[Apparc] Application UID: %X"), iAppUid.iUid); diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/aplist/aplappinforeader.h --- a/appfw/apparchitecture/aplist/aplappinforeader.h Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/aplist/aplappinforeader.h Wed Jun 23 18:22:59 2010 +0300 @@ -172,7 +172,7 @@ void ReadMimeTypesSupportedL(const RPointerArray& dataTypes, CArrayFixFlat& aMimeTypesSupported); void ReadLocalisationInfoL(); void ReadViewInfoL(const RPointerArray& aViewData); -#ifdef _DEBUG +#ifdef APPARC_SHOW_TRACE void DisplayAppInfo(); #endif diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/aplist/aplapplist.cpp --- a/appfw/apparchitecture/aplist/aplapplist.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/aplist/aplapplist.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -830,7 +830,7 @@ @param aObserver Observer to be notified when the update has finished. */ { -#if _DEBUG +#ifdef APPARC_SHOW_TRACE RDebug::Printf("[Apparc] *****************START CREATING APPLIST ****************************"); #endif @@ -1225,7 +1225,7 @@ iAppData=appData->iNext; } -#if _DEBUG +#ifdef APPARC_SHOW_TRACE if(appData) { RDebug::Print(_L("[Apparc] Application with UID: %X is deleted from applist"), appData->iUidType[2]); @@ -1547,7 +1547,7 @@ aAppData->iNext=iAppData; iAppData=aAppData; -#if _DEBUG +#ifdef APPARC_SHOW_TRACE RDebug::Print(_L("[Apparc] Application with UID: %X is added to applist"), aAppData->iUidType[2]); #endif @@ -1809,7 +1809,7 @@ iScrAppInfo=NULL; iScr.Close(); #endif -#if _DEBUG +#ifdef APPARC_SHOW_TRACE RDebug::Printf("[Apparc] *****************END CREATING APPLIST ****************************"); #endif } diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/apserv/APSSES.CPP --- a/appfw/apparchitecture/apserv/APSSES.CPP Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/apserv/APSSES.CPP Wed Jun 23 18:22:59 2010 +0300 @@ -421,7 +421,7 @@ void CApaAppArcServSession::ServiceL(const RMessage2& aMessage) { -#ifdef _DEBUG +#ifdef APPARC_SHOW_TRACE TFullName* name = new(ELeave) TFullName(); RThread client; if ( aMessage.Client( client ) == KErrNone ) @@ -624,13 +624,13 @@ break; default: iAppListSession->DoServiceL(aMessage); -#ifdef _DEBUG +#ifdef APPARC_SHOW_TRACE RDebug::Print( _L("[Apparc] CApaAppListServSession::ServiceL(0x%08x) - END - op code: %04d, completeMessage: %d"), this, aMessage.Function(), completeMessage ); #endif return; } -#ifdef _DEBUG +#ifdef APPARC_SHOW_TRACE RDebug::Print( _L("[Apparc] CApaAppListServSession::ServiceL(0x%08x) - END - op code: %04d, completeMessage: %d"), this, aMessage.Function(), completeMessage ); #endif if (completeMessage && !aMessage.IsNull()) @@ -1456,30 +1456,59 @@ aInfo.iShortCaption = app->ShortCaption(); } -void CApaAppArcServSession::DoRecognizeUnpackLC(HBufC*& aName, HBufC8*& aBuffer, const RMessage2& aMessage) - { - ASSERT(aName==NULL); - ASSERT(aBuffer==NULL); - aName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1))); - TPtr name(aName->Des()); - aMessage.ReadL(1, name); - aBuffer=HBufC8::NewLC(User::LeaveIfError(aMessage.GetDesLength(2))); - TPtr8 buffer(aBuffer->Des()); - aMessage.ReadL(2, buffer); - } +TPtrC8 CApaAppArcServSession::DoRecognizeUnpackLC(HBufC*& aName, RChunk& aLocalChunk, const RMessage2& aMessage) + { + ASSERT(aName==NULL); + + aName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1))); + TPtr name(aName->Des()); + aMessage.ReadL(1, name); + + HBufC8* buffer=NULL; + TInt error=KErrNone; + TInt bufferSize= aMessage.GetDesLength(2); + User::LeaveIfError(bufferSize); + //Allocate memory in apparc's process heap. + TRAP(error, buffer=HBufC8::NewL(bufferSize)); + + if(error==KErrNone) + { + CleanupStack::PushL(buffer); + TPtr8 bufPtr(buffer->Des()); + aMessage.ReadL(2, bufPtr); + return bufPtr; + } + else if(error==KErrNoMemory) + { + //If memory is not available in apparc's process heap, then allocate in kernel heap + User::LeaveIfError(aLocalChunk.CreateLocal(bufferSize,bufferSize)); + CleanupClosePushL(aLocalChunk); + TPtr8 bufPtr(aLocalChunk.Base(), bufferSize); + aMessage.ReadL(2, bufPtr); + return bufPtr; + } + else + { + User::Leave(error); + } + + TPtrC8 bufPtr(NULL,0); //Never executed. To make compiler happy + return bufPtr; + } void CApaAppArcServSession::RecognizeDataL(const RMessage2& aMessage) // Recognize the data type of an object - { - HBufC* name=NULL; - HBufC8* buffer=NULL; - DoRecognizeUnpackLC(name,buffer,aMessage); + { + HBufC* name=NULL; + RChunk localChunk; + + TPtrC8 bufPtr=DoRecognizeUnpackLC(name, localChunk, aMessage); - const TDataRecognitionResult result = iServ.RecognizeDataL(*name, *buffer); + const TDataRecognitionResult result = iServ.RecognizeDataL(*name, bufPtr); - CleanupStack::PopAndDestroy(2); // name & buffer - aMessage.WriteL(0,TPckgC(result)); - } + CleanupStack::PopAndDestroy(2); // name & buffer or localChunk + aMessage.WriteL(0,TPckgC(result)); + } void CApaAppArcServSession::RecognizeFilesL(const RMessage2& aMessage) @@ -1754,16 +1783,17 @@ void CApaAppArcServSession::RecognizeSpecificDataL(const RMessage2& aMessage) // Determine whether an object is of a specific data type - { - HBufC* name=NULL; - HBufC8* buffer=NULL; - DoRecognizeUnpackLC(name,buffer,aMessage); - TDataType dataType; - {TPckg dataType_asDescriptor(dataType); - aMessage.ReadL(0, dataType_asDescriptor);} - aMessage.Complete(iServ.RecognizeDataL(*name,*buffer,dataType)); - CleanupStack::PopAndDestroy(2); // name & buffer - } + { + HBufC* name=NULL; + RChunk localChunk; + + TPtrC8 bufPtr=DoRecognizeUnpackLC(name, localChunk, aMessage); + TDataType dataType; + {TPckg dataType_asDescriptor(dataType); + aMessage.ReadL(0, dataType_asDescriptor);} + aMessage.Complete(iServ.RecognizeDataL(*name,bufPtr,dataType)); + CleanupStack::PopAndDestroy(2); // name & buffer or localChunk + } void CApaAppArcServSession::RecognizeSpecificDataPassedByFileHandleL(const RMessage2& aMessage) { diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/apserv/APSSES.H --- a/appfw/apparchitecture/apserv/APSSES.H Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/apserv/APSSES.H Wed Jun 23 18:22:59 2010 +0300 @@ -178,7 +178,7 @@ void RecognizeDataPassedByFileHandleL(const RMessage2& aMessage); void RecognizeSpecificDataL(const RMessage2& aMessage); void RecognizeSpecificDataPassedByFileHandleL(const RMessage2& aMessage); - static void DoRecognizeUnpackLC(HBufC*& aName, HBufC8*& aBuffer, const RMessage2& aMessage); + static TPtrC8 DoRecognizeUnpackLC(HBufC*& aName, RChunk& aLocalChunk, const RMessage2& aMessage); void AppForDataTypeL(const RMessage2& aMessage); TUid AppForDataTypeL(const TDataType& aDataType, const TUid* aServiceUid); diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/tef/testapp/testforceregistrationapp1/testforceregistrationapp1.mmp --- a/appfw/apparchitecture/tef/testapp/testforceregistrationapp1/testforceregistrationapp1.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/tef/testapp/testforceregistrationapp1/testforceregistrationapp1.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-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" @@ -14,12 +14,14 @@ // testforceregistrationapp1.mmp // +#include + target testforceregistrationapp1.exe targettype EXE UID 0x1000007a 0x102826E0 -systeminclude /epoc32/include +MW_LAYER_SYSTEMINCLUDE source ./testforceregistrationapp1.cpp diff -r 951aeeb3da43 -r 2222076f5c60 appfw/apparchitecture/tef/zerosizedicontestapp.mmp --- a/appfw/apparchitecture/tef/zerosizedicontestapp.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/apparchitecture/tef/zerosizedicontestapp.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -14,6 +14,8 @@ // zerosizedicontestapp.mmp // +#include + target zerosizedicontestapp.exe TARGETTYPE exe @@ -27,7 +29,7 @@ MW_LAYER_SYSTEMINCLUDE_SYMBIAN APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE . -SYSTEMINCLUDE /epoc32/include +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/techview // Application exe specific resource which is localised to the application diff -r 951aeeb3da43 -r 2222076f5c60 appfw/viewserver/server/VWSERVER.CPP --- a/appfw/viewserver/server/VWSERVER.CPP Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/viewserver/server/VWSERVER.CPP Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1999-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" @@ -206,7 +206,8 @@ iEnableBoostAppPriorityBeforePanic = valueOfKVwsBoostAppPriorityBeforePanic; } #endif - + LOG3(CVwsLog::EQuiet,_L("CVwsServer::IsPriorityBoostBeforePanicEnabled(): iEnableBoostAppPriorityBeforePanic = [%d] "),iEnableBoostAppPriorityBeforePanic); + if (iEnableBoostAppPriorityBeforePanic) { CVwsStartupAware* startupAware = new(ELeave)CVwsStartupAware(*this); @@ -837,7 +838,7 @@ { return; } - + if (starved.ProcessPriority() < EPriorityForeground) { RProcess owningProcess; diff -r 951aeeb3da43 -r 2222076f5c60 appfw/viewserver/server/VWSEVENT.CPP --- a/appfw/viewserver/server/VWSEVENT.CPP Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/viewserver/server/VWSEVENT.CPP Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1999-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" @@ -127,6 +127,7 @@ firstDelay=iServerEventTimeOut; } + LOG3(CVwsLog::EQuiet,_L("CVwsEventTimer::Start : firstDelay [%d] "),firstDelay.Int()); TTimeIntervalMicroSeconds32 delay(firstDelay); iPeriodic->Start(delay,delay,TCallBack(TimerCallBack,this)); iScreenDeviceChangeEvent = aScreenDeviceChangeEvent; @@ -167,7 +168,7 @@ else { //Delay of KTimeoutValueForPreemptedProcess is given after boosting priority of an application - TUint8 patchableConst = KTimeoutValueForPreemptedProcess; + TInt patchableConst = KTimeoutValueForPreemptedProcess; #ifdef __WINS__ // For the emulator allow the constant to be patched via epoc.ini UserSvr::HalFunction(EHalGroupEmulator, EEmulatorHalIntProperty, @@ -175,8 +176,9 @@ #endif delay = patchableConst; iTimeOutState = EServerEventTimeOut; + LOG2(CVwsLog::ELoud,_L("CVwsEventTimer::DoTimerCallBack : iTimeOutState == EIntermediateEventTimeOut")); } - + LOG3(CVwsLog::EQuiet,_L("CVwsEventTimer::DoTimerCallBack : delay = [%d] "),delay.Int()); iPeriodic->Start(delay,delay,TCallBack(TimerCallBack,this)); } } diff -r 951aeeb3da43 -r 2222076f5c60 appfw/viewserver/server/vwspatchdata.cpp --- a/appfw/viewserver/server/vwspatchdata.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/appfw/viewserver/server/vwspatchdata.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 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" @@ -15,6 +15,6 @@ #include -EXPORT_C extern const TInt KVwsBoostAppPriorityBeforePanic = 0; +EXPORT_C extern const TInt KVwsBoostAppPriorityBeforePanic = 1; EXPORT_C extern const TInt KTimeoutValueForPreemptedProcess = 4*1000*1000; //4 seconds diff -r 951aeeb3da43 -r 2222076f5c60 appsupport.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/appsupport.pro Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: Project file for building phonesrv components +# +# + +TEMPLATE = subdirs +CONFIG += ordered + +symbian: { +:BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"group/bld.inf\"" +SUBDIRS += coreapplicationuis\devicepowermenuplugin +} diff -r 951aeeb3da43 -r 2222076f5c60 appsupport_plat/system_application_notification_api/inc/coreapplicationuisdomainpskeys.h --- a/appsupport_plat/system_application_notification_api/inc/coreapplicationuisdomainpskeys.h Fri Jun 11 13:48:03 2010 +0300 +++ b/appsupport_plat/system_application_notification_api/inc/coreapplicationuisdomainpskeys.h Wed Jun 23 18:22:59 2010 +0300 @@ -215,6 +215,17 @@ ECoreAppUIsVideoSharingIndicatorOff, ECoreAppUIsVideoSharingIndicatorOn }; + +/** +* Used for notifying SysAp for releasing memory of power menu custom dialog +*/ +const TUint32 KCoreAppUIsPowerMenuCustomDialogStatus= 0x00000207; +enum TCoreAppUIsPowerMenuCustomDialog + { + ECoreAppUIsPowerMenuCustomDialogUninitialized = 0, + ECoreAppUIsPowerMenuCustomDialogOff, + ECoreAppUIsPowerMenuCustomDialogOn + }; // ============================================================================= // Contacts Database Recovery Status API diff -r 951aeeb3da43 -r 2222076f5c60 contenthandling/webrecognisers/Test/Group/t_ebookmark.mmp --- a/contenthandling/webrecognisers/Test/Group/t_ebookmark.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/contenthandling/webrecognisers/Test/Group/t_ebookmark.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// 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" @@ -13,6 +13,8 @@ // Description: // +#include + TARGET t_ebookmark.dll TARGETTYPE plugin CAPABILITY protserv @@ -27,14 +29,13 @@ USERINCLUDE . ../t_recogtest #ifdef SYMBIAN_OLD_EXPORT_LOCATION -SYSTEMINCLUDE /epoc32/include +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom #else OS_LAYER_SYSTEMINCLUDE_SYMBIAN SYSTEMINCLUDE /epoc32/include/ecom SYSTEMINCLUDE /epoc32/include/platform/ecom -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE /epoc32/include/platform/mw +MW_LAYER_SYSTEMINCLUDE #endif diff -r 951aeeb3da43 -r 2222076f5c60 contenthandling/webrecognisers/Test/Group/t_recogtest.mmp --- a/contenthandling/webrecognisers/Test/Group/t_recogtest.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/contenthandling/webrecognisers/Test/Group/t_recogtest.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// 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" @@ -13,6 +13,8 @@ // Description: // +#include + TARGET t_recogtest.exe TARGETTYPE exe CAPABILITY ProtServ @@ -23,14 +25,13 @@ USERINCLUDE . #ifdef SYMBIAN_OLD_EXPORT_LOCATION -SYSTEMINCLUDE /epoc32/include +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom #else OS_LAYER_SYSTEMINCLUDE_SYMBIAN SYSTEMINCLUDE /epoc32/include/ecom SYSTEMINCLUDE /epoc32/include/platform/ecom -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE /epoc32/include/platform/mw +MW_LAYER_SYSTEMINCLUDE #endif LIBRARY euser.lib ecom.lib diff -r 951aeeb3da43 -r 2222076f5c60 contenthandling/webrecognisers/Test/Group/t_recwap.mmp --- a/contenthandling/webrecognisers/Test/Group/t_recwap.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/contenthandling/webrecognisers/Test/Group/t_recwap.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 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" @@ -13,6 +13,8 @@ // Description: // +#include + TARGET t_recwap.dll TARGETTYPE plugin CAPABILITY protserv @@ -27,14 +29,13 @@ USERINCLUDE . ../t_recogtest #ifdef SYMBIAN_OLD_EXPORT_LOCATION -SYSTEMINCLUDE /epoc32/include +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom #else OS_LAYER_SYSTEMINCLUDE_SYMBIAN SYSTEMINCLUDE /epoc32/include/ecom SYSTEMINCLUDE /epoc32/include/platform/ecom -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE /epoc32/include/platform/mw +MW_LAYER_SYSTEMINCLUDE #endif diff -r 951aeeb3da43 -r 2222076f5c60 contenthandling/webrecognisers/Test/Group/t_recweb.mmp --- a/contenthandling/webrecognisers/Test/Group/t_recweb.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/contenthandling/webrecognisers/Test/Group/t_recweb.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// 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" @@ -13,6 +13,8 @@ // Description: // +#include + TARGET t_recweb.dll TARGETTYPE plugin CAPABILITY protserv @@ -27,14 +29,13 @@ USERINCLUDE . ../t_recogtest #ifdef SYMBIAN_OLD_EXPORT_LOCATION -SYSTEMINCLUDE /epoc32/include +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom #else OS_LAYER_SYSTEMINCLUDE_SYMBIAN SYSTEMINCLUDE /epoc32/include/ecom SYSTEMINCLUDE /epoc32/include/platform/ecom -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE /epoc32/include/platform/mw +MW_LAYER_SYSTEMINCLUDE #endif diff -r 951aeeb3da43 -r 2222076f5c60 contenthandling/webrecognisers/Test/Group/t_weburlrec.mmp --- a/contenthandling/webrecognisers/Test/Group/t_weburlrec.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/contenthandling/webrecognisers/Test/Group/t_weburlrec.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// 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" @@ -13,6 +13,8 @@ // Description: // +#include + TARGET t_weburlrec.dll TARGETTYPE plugin CAPABILITY protserv @@ -27,14 +29,13 @@ USERINCLUDE . ../t_recogtest #ifdef SYMBIAN_OLD_EXPORT_LOCATION -SYSTEMINCLUDE /epoc32/include +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom #else OS_LAYER_SYSTEMINCLUDE_SYMBIAN SYSTEMINCLUDE /epoc32/include/ecom SYSTEMINCLUDE /epoc32/include/platform/ecom -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE /epoc32/include/platform/mw +MW_LAYER_SYSTEMINCLUDE #endif diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/CenRep/CoreApplicationUIsPrivateCRKeys.h --- a/coreapplicationuis/SysAp/CenRep/CoreApplicationUIsPrivateCRKeys.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/CenRep/CoreApplicationUIsPrivateCRKeys.h Wed Jun 23 18:22:59 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2008 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" diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Data/SysAp.rss --- a/coreapplicationuis/SysAp/Data/SysAp.rss Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Data/SysAp.rss Wed Jun 23 18:22:59 2010 +0300 @@ -31,12 +31,18 @@ RESOURCE RSS_SIGNATURE { } -RESOURCE TBUF { buf=""; } +RESOURCE TBUF { buf="sysap"; } RESOURCE EIK_APP_INFO -{ - status_pane=R_AVKON_STATUS_PANE_LAYOUT_EMPTY; -} + { + status_pane = r_status_pane; + } + +RESOURCE STATUS_PANE_APP_MODEL r_status_pane + { + layout= R_AVKON_STATUS_PANE_LAYOUT_EMPTY; + } + // LOCALIZED STRINGS diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Group/SysAp.mmp --- a/coreapplicationuis/SysAp/Group/SysAp.mmp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Group/SysAp.mmp Wed Jun 23 18:22:59 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 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" @@ -35,119 +35,46 @@ MACRO SYSAP_USE_STARTUP_UI_PHASE #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + SOURCEPATH ../Src SOURCE SysApApp.cpp +SOURCE SysApDocument.cpp +//SOURCE main.cpp SOURCE SysApAppUi.cpp -SOURCE SysApDocument.cpp -SOURCE sysapkeymanagement.cpp +//SOURCE SysApWsClient.cpp +SOURCE SysApFeatureManager.cpp SOURCE SysApLightsController.cpp SOURCE SysApTimer.cpp - -SOURCE SysApPubSubObserver.cpp -SOURCE SysApProfileObserver.cpp -SOURCE SysApEtelNetworkBarObserver.cpp -SOURCE sysapetelnetworkbargetter.cpp - -//SOURCE CenRepObservers/sysapcenrepfmtxobserver.cpp -SOURCE CenRepObservers/SysApCenRepLogsObserver.cpp -SOURCE CenRepObservers/SysApCenRepBTObserver.cpp -SOURCE CenRepObservers/SysApCenRepHacSettingObserver.cpp -SOURCE CenRepObservers/sysapcenreplightsettingsobserver.cpp -SOURCE CenRepObservers/sysapcenrepcallforwardingobserver.cpp -SOURCE CenRepObservers/sysapcenrepmsgwaitingobserver.cpp -SOURCE SysApCenRepController.cpp - -SOURCE SysApStartupController.cpp -SOURCE SysApConnectionMonitorObserver.cpp -SOURCE SysApPowerKeyMenuObserver.cpp -SOURCE SysApSsSettingsObserver.cpp +SOURCE sysaplightpluginhandler.cpp +SOURCE SysApNspsHandler.cpp +SOURCE SysApNspsAnim.cpp +SOURCE SysApPubSubObserver.cpp SysApSubscriber.cpp sysapremconobserver.cpp +SOURCE sysapdefaultkeyhandler.cpp SysApStartupController.cpp SOURCE SysApShutdownImage.cpp -SOURCE SysApShutdownAnimation.cpp -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION -SOURCE SysApShutdownTone.cpp -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION -SOURCE SysApMsgSimMemLowQuery.cpp -SOURCE SysApNspsAnim.cpp -SOURCE SysApNspsHandler.cpp -SOURCE SysApEtelNetworkStatusNspsObserver.cpp -SOURCE SysApEtelSmsStoreObserver.cpp -SOURCE SysApWaitNote.cpp -SOURCE SysApConfirmationQuery.cpp -SOURCE SysApFeatureManager.cpp -SOURCE SysApSubscriber.cpp - -SOURCE SysApAnimKeySndControl.cpp -SOURCE SysApKeySndAnim.cpp -SOURCE SysApKeySndHandler.cpp - -SOURCE SysApSimChanged.cpp -LIBRARY logcli.lib - -SOURCE SysApAccessoryObserver.cpp -LIBRARY accclient.lib - -SOURCE SysApEtelConnector.cpp +SOURCE hbdevicepowermenusymbian.cpp #ifdef __OFFLINE_MODE SOURCE OfflineModeController/SysApOfflineModeControllerImpl.cpp -#else -SOURCE OfflineModeController/SysApOfflineModeControllerStub.cpp -#endif - -//Always use stub implementation of privacy framework, as it is no longer supported -// Find out if/how a replacement must be done -SOURCE PrivacyFramework/SysApLocationPrivacyIndicatorStub.cpp - -#ifdef __USB -SOURCE Usb/SysApUsbIndicatorImpl.cpp -LIBRARY usbman.lib // USB Manager -#else -SOURCE Usb/SysApUsbIndicatorStub.cpp -#endif -SOURCE Usb/sysapusbchargerdetector.cpp - -#ifdef __BT -SOURCE Bt/SysApBtControllerImpl.cpp -LIBRARY btengdevman.lib -LIBRARY btengsettings.lib -LIBRARY btmanclient.lib -#else -SOURCE Bt/SysApBtControllerStub.cpp #endif -#ifdef __BT_SAP -SOURCE BtSap/SysApBtSapControllerImpl.cpp -LIBRARY btengconnman.lib -LIBRARY btdevice.lib -LIBRARY bluetooth.lib -#else -SOURCE BtSap/SysApBtSapControllerStub.cpp -#endif -SOURCE SysApMediatorObserver.cpp - -SOURCE sysapdefaultkeyhandler.cpp -#ifdef RD_LIGHT_CONTROL_CHANGE -SOURCE sysaplightpluginhandler.cpp -#endif +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore +//SYSTEMINCLUDE /epoc32/include/mw/QtCore +SYSTEMINCLUDE /epoc32/include/mw -SOURCE sysapaudioroutingobserver.cpp -SOURCE sysapeteldatabearerobserver.cpp +USERINCLUDE . +USERINCLUDE ../Inc +USERINCLUDE ../Src/CenRepObservers +USERINCLUDE ../Src/Usb +USERINCLUDE ../Src/powersavemode +USERINCLUDE ../../inc // subsystem headers +USERINCLUDE ../../../inc // ado headers +USERINCLUDE ../CenRep +USERINCLUDE ../PubSub -SOURCE memorycard/SysApMMCObserver.cpp -#ifdef RD_MULTIPLE_DRIVE -SOURCE memorycard/sysapdrivelist.cpp -SOURCE memorycard/sysapdriveunlockhandler.cpp -SOURCE memorycard/sysapdriveejecthandler.cpp -#endif // RD_MULTIPLE_DRIVE +MW_LAYER_SYSTEMINCLUDE -SOURCE sysapetelnetworkinfoobserver.cpp -SOURCE sysapremconobserver.cpp -SOURCE powersavemode/sysappsmcontroller.cpp -SOURCE sysapbatteryinfocontroller.cpp - -SOURCE SysApSatObserver.cpp -LIBRARY satclient.lib // for sat refresh START RESOURCE ../Data/SysAp.rss HEADER @@ -167,20 +94,6 @@ TARGETPATH /private/10003a3f/apps END -SOURCEPATH ../Data - -USERINCLUDE . -USERINCLUDE ../Inc -USERINCLUDE ../Src/CenRepObservers -USERINCLUDE ../Src/memorycard -USERINCLUDE ../Src/Usb -USERINCLUDE ../Src/powersavemode -USERINCLUDE ../../inc // subsystem headers -USERINCLUDE ../../../inc // ado headers -USERINCLUDE ../CenRep -USERINCLUDE ../PubSub - -MW_LAYER_SYSTEMINCLUDE LIBRARY euser.lib LIBRARY apparc.lib @@ -188,67 +101,108 @@ LIBRARY eikcore.lib LIBRARY apgrfx.lib LIBRARY ws32.lib -LIBRARY avkon.lib + LIBRARY bafl.lib -LIBRARY aknnotify.lib + LIBRARY eiksrvc.lib LIBRARY connmon.lib LIBRARY dsclient.lib LIBRARY profileeng.lib LIBRARY starterclient.lib -LIBRARY centralrepository.lib -LIBRARY cenrepnotifhandler.lib -LIBRARY commonengine.lib -LIBRARY activitymanager.lib -LIBRARY akncapserverclient.lib -LIBRARY secui.lib -LIBRARY sssettings.lib + + LIBRARY fbscli.lib LIBRARY etel.lib LIBRARY etelmm.lib -LIBRARY customapi.lib +LIBRARY efsrv.lib + +LIBRARY esock.lib + +LIBRARY ecom.lib + +LIBRARY hbwidgets.lib +//LIBRARY qtcore.lib + +//LIBRARY HbDeviceInputDialogWidget.lib + +//For CHbIndicatorSymbian and for CHbPowereMenusymbian +LIBRARY hbcore.lib +LIBRARY hwrmlightclient.lib LIBRARY featmgr.lib -LIBRARY efsrv.lib -LIBRARY aknmemorycardui.lib -LIBRARY esock.lib +LIBRARY activitymanager.lib +LIBRARY remconcoreapi.lib +LIBRARY remconinterfacebase.lib +//LIBRARY hbpowermenuwidget.lib + +// End of File + + +#ifdef __USB +SOURCEPATH ../Src/Usb +SOURCE SysApUsbIndicatorImpl.cpp +LIBRARY usbman.lib // USB Manager +#endif +SOURCE sysapusbchargerdetector.cpp + +SOURCEPATH ../Src +SOURCE SysApAccessoryObserver.cpp SysApCenRepController.cpp +LIBRARY accclient.lib +LIBRARY accpolicy.lib + +SOURCE CenRepObservers/SysApCenRepBTObserver.cpp +SOURCE CenRepObservers/SysApCenRepHacSettingObserver.cpp +SOURCE CenRepObservers/sysapcenreplightsettingsobserver.cpp +SOURCE CenRepObservers/SysApCenRepLogsObserver.cpp +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib + +SOURCE sysapaudioroutingobserver.cpp +LIBRARY telephonyaudiorouting.lib + #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION LIBRARY sanimctrl.lib #else // RD_STARTUP_ANIMATION_CUSTOMIZATION LIBRARY MediaClientAudio.lib #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION -LIBRARY hwrmlightclient.lib -//LIBRARY hwrmfmtxclient.lib -LIBRARY remconcoreapi.lib -LIBRARY remconinterfacebase.lib -LIBRARY aknicon.lib -LIBRARY cdlengine.lib -// POC launching -LIBRARY servicehandler.lib - -LIBRARY ecom.lib - - -LIBRARY mediatorclient.lib LIBRARY bmpanim.lib -LIBRARY telephonyaudiorouting.lib -LIBRARY etelpckt.lib - -#ifdef RD_MULTIPLE_DRIVE -LIBRARY platformenv.lib -LIBRARY disknotifyhandler.lib -#endif // RD_MULTIPLE_DRIVE - +SOURCEPATH ../Src/powersavemode +SOURCE sysappsmcontroller.cpp LIBRARY psmclient.lib -LIBRARY keylockpolicyapi.lib +SOURCEPATH ../Src +SOURCE sysapbatteryinfocontroller.cpp SysApSimChanged.cpp +LIBRARY secui.lib LIBRARY bsutil.lib -LIBRARY batterypopupcontrol.lib +//LIBRARY batterypopupcontrol.lib +//LIBRARY CommonEngine.lib +SOURCEPATH ../Src/Bt +SOURCE SysApBtControllerImpl.cpp +SOURCEPATH ../Src/BtSap +SOURCE SysApBtSapControllerImpl.cpp -LIBRARY eikcoctl.lib -// End of File +//LIBRARY eikcoctl.lib +//LIBRARY etelpckt.lib +LIBRARY btengconnman.lib +LIBRARY btdevice.lib +LIBRARY bluetooth.lib +LIBRARY btengdevman.lib +LIBRARY btengsettings.lib +LIBRARY btmanclient.lib + +LIBRARY lockclient.lib + +SOURCEPATH ../Src +SOURCE sysapkeymanagement.cpp SysApTaskList.cpp + + +//For Shutdown +LIBRARY SVGEngine.lib +LIBRARY gdi.lib + +LIBRARY avkon.lib diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Group/bld.inf --- a/coreapplicationuis/SysAp/Group/bld.inf Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Group/bld.inf Wed Jun 23 18:22:59 2010 +0300 @@ -22,11 +22,6 @@ DEFAULT PRJ_EXTENSIONS -START EXTENSION s60/mifconv - OPTION TARGETFILE sysap.mif - OPTION HEADERFILE sysap.mbg - OPTION SOURCES -c8 qgn_startup_screen -END PRJ_EXPORTS @@ -47,6 +42,9 @@ ../PubSub/CoreApplicationUIsPrivatePSKeys.h |../../../inc/coreapplicationuisprivatepskeys.h // Illegal export for avoiding breaks +/epoc32/s60/icons/qgn_startup_screen.svg /epoc32/data/z/resource/apps/qgn_sysap_screen.svg +/epoc32/s60/icons/qgn_startup_screen.svg /epoc32/release/winscw/udeb/z/resource/apps/qgn_sysap_screen.svg +/epoc32/s60/icons/qgn_startup_screen.svg /epoc32/release/winscw/urel/z/resource/apps/qgn_sysap_screen.svg PRJ_MMPFILES //gnumakefile sysap_icons.mk diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApApp.h --- a/coreapplicationuis/SysAp/Inc/SysApApp.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApApp.h Wed Jun 23 18:22:59 2010 +0300 @@ -20,7 +20,8 @@ #define SYSAPAPP_H // INCLUDES -#include +//#include +#include // CONSTANTS const TUid KUidSysAp={0x100058F3}; @@ -33,7 +34,7 @@ * @since 1.0 */ -class CSysApApp : public CAknApplication +class CSysApApp : public CEikApplication { private: // from CApaApplication /** diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApAppUi.h --- a/coreapplicationuis/SysAp/Inc/SysApAppUi.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApAppUi.h Wed Jun 23 18:22:59 2010 +0300 @@ -1,116 +1,43 @@ /* -* Copyright (c) 2005-2009 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: CSysApAppUi class definition. This class handles all user -* actions and also System Agent events. -* -*/ - + * 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: + * + */ #ifndef SYSAPAPPUI_H #define SYSAPAPPUI_H - -// INCLUDES +//#include +//#include +//#include #include -#include -#ifndef RD_MULTIPLE_DRIVE - #include -#endif // RD_MULTIPLE_DRIVE -#include -#include -#include -#include - -#include #include "SysAp.hrh" -#include "SysApMMCObserver.h" -#include "MSysApPropertyResponder.h" -#include "SysApTimer.h" +#include +#include +#include #include -#include "coreapplicationuisprivatecrkeys.h" #include - +#include +#include "SysApTimer.h" +#include "SysApLightsController.h" +#include "coreapplicationuisprivatecrkeys.h" +#include "sysapusbchargerdetector.h" #include "SysApAccessoryObserver.h" -#ifdef RD_MULTIPLE_DRIVE - #include "sysapdrivelist.h" -#endif // RD_MULTIPLE_DRIVE - -#include "sysapusbchargerdetector.h" -#include "sysappsmcontroller.h" +#include +//For Powermenu--CHbDevicePowerMenuSymbian +#include "hbdevicepowermenusymbian.h" -// FORWARD DECLARATIONS -class CAknSmallIndicator; -class CAknSignalNotify; -class CAknBatteryNotify; -class CAknGlobalListQuery; -class CAknGlobalNote; -class CSystemLock; -class CSysApLightsController; -class CSysApPubSubObserver; -class CSysApProfileObserver; -class CSysApConnectionMonitorObserver; -class CSysApCenRepLightSettingsObserver; -class CSysApCenRepLogsObserver; -class CSysApCenRepBtObserver; -//class CSysApCenRepFmTxObserver; -class CSysApCenRepController; -class CSysApStartupController; -class CSysApPowerKeyMenuObserver; -class CSysApWaitNote; -class CSysApSsSettingsObserver; -class CSysApShutdownImage; -class CSysApShutdownAnimation; -class CSysApEtelConnector; -class CSysApMsgSimMemLowQuery; -class CSysApNspsHandler; -class CSysApConfirmationQuery; -class CSysApFeatureManager; -class MSysApOfflineModeController; -class MSysApBtController; -class MSysApBtSapController; -class MSysApUsbIndicator; -class MSysApLocationPrivacyIndicator; -class MProfileEngine; -class MProfilesNamesArray; -class CSysApKeySndHandler; -class CSysApKeyManagement; // KEF -class CSysApMediatorObserver; -class CAknAppUiBase; -class CSysApCenRepHacSettingObserver; -class CSysApAudioRoutingObserver; -class CSysApCenRepCallForwardingObserver; -class CSysApCenRepMsgWaitingObserver; - -// POC launching -class CAiwServiceHandler; - -class CSysApDefaultKeyHandler; -class CSysApDriveUnlockHandler; -class CSysApDriveEjectHandler; - -class CSysApBatteryInfoController; - -//CONSTANTS -const TInt KDummyReason( -1 ); -const TInt KBluetoothModulePowerModeOn ( 1 ); -const TInt KBluetoothModulePowerModeOff ( 0 ); -const TInt KGeneralProfileId ( 0 ); -const TInt KOfflineModeProfileId ( 5 ); -const TInt KApplicationScanningInterval( 1 ); // 1 second -_LIT( KFSName, "Fat" ); // MMC file system name -const TDriveNumber KMMCDrive = EDriveE; // MMC drive number - - +#include "sysappsmcontroller.h" //CLASS DECLARATION /** @@ -121,18 +48,49 @@ * @lib sysap * @since 1.0 */ +#include -class CSysApAppUi : - public CAknAppUi, -#ifndef RD_MULTIPLE_DRIVE - public MAknMemoryCardDialogObserver, -#endif // RD_MULTIPLE_DRIVE - public MSysApMemoryCardObserver, + +//class CAknAppUiBase; +//class CSysApKeySndHandler; +//class CSysApWsClient; +class CSysApFeatureManager; +class CSysApNspsHandler; +class CSysApPubSubObserver; +class CSysApStartupController; +class CSysApDefaultKeyHandler; +class CSysApKeyManagement; +class MSysApOfflineModeController; +class CHbDevicePowerMenuSymbian; +class CSysApShutdownImage; +class CSysApKeySndHandler; +class CSysApCenRepController; +class CSysApCenRepLightSettingsObserver; +class CSysApCenRepBtObserver; +class CSysApCenRepHacSettingObserver; +class CSysApAudioRoutingObserver; +class CSysApSsSettingsObserver; +class CSystemLock; +class CSysApCenRepCallForwardingObserver; +class CSysApBatteryInfoController; +class MSysApBtSapController; +class MSysApBtController; +class CSysApCenRepLogsObserver; +class MSysApUsbIndicator; +class CKeyguardAccessApi; + + +const TInt KBluetoothModulePowerModeOn ( 1 ); +const TInt KDummyReason( -1 ); + +//class HbMessageBox; + +class CSysApAppUi : public CAknAppUi, public MSysApTimerResponder, public MSysapCallback, public MSysApPsmControllerNotifyCallback -{ - public: + { + public: /** * C++ default constructor. * @param None @@ -146,7 +104,10 @@ * @return void */ virtual ~CSysApAppUi(); - + + // from CCoeAppUiBase + void PrepareToExit(); + protected: // From MSysApTimerResponder /** @@ -155,1057 +116,7 @@ * @return void */ void TimerExpiredL(); - - public: - - /** - * Gets called when shutdown continues after shutdown animation - * @param None - * @return void - */ - void ContinueShutdown(); - - /** - * Gets called when there is need to shutdown the device initiated by Symbian side - * @param None - * @return void - */ - void DoShutdownL( const TBool aReset, const TInt aResetReason ); - - /** - * Gets called by CSysApSharedDataObserver if user has selected "No" in - * "Do you want to use the phone in Off-line mode?" query in startup. - * @param aDoProfileChange if ETrue, the last active profile is restored - * @return void - */ - void GoOnlineL( TBool aDoProfileChange = ETrue ); - - /** - * Gets called by CSysApSharedDataObserver in Simless Offline Mode startup. - * @param None - * @return void - */ - void GoOfflineL(); - - /** - * Calls CSysApOfflineModeController::SwitchFromOnlineToOfflineModeL() - * @param None - * @return void - */ - void SwitchFromOnlineToOfflineModeL(); - - /** - * Called when offline mode change has been finished. - */ - void OfflineModeChangedL(); - - /** - * Gets called after changing the SW state. - * @param aSwState The new state - * @return void - */ - void DoStateChangedL( const RStarterSession::TGlobalState aSwState ); - -#ifdef SYSAP_USE_STARTUP_UI_PHASE - /** - * Called when UI is ready after boot. - */ - void HandleUiReadyAfterBootL(); - -#endif // SYSAP_USE_STARTUP_UI_PHASE - /** - * Returns whether UI is ready after boot. - */ - TBool UiReady() const; - - /** - * Gets called when any case selection on powerkey menu is done. - * Does what is needed per selection. - * @param TInt aSelection - * @return void - */ - void PowerKeyPopUpMenuSelectionDoneL( TInt aSelection ); - - /** - * Gets called when Alarm is being shown to user and lights need to be blinked. - * @param TBool aAlerting - * @return void - */ - void AlertUiAlertingL( const TBool aAlerting ); - - /** - * Gets called when Alarm is being shown to user and keylock need to be turned off. - * @param TBool aKeyLockOff - * @return void - */ - void AlertUiKeyLockOff( const TBool aKeyLockOff ); - - /** - * Notifies changes in KPSUidCoreApplicationUIs::KLightControl to light controller. - */ - void HandleLightsRequireL() const; - - /** - * Notifies changes in KPSUidCoreApplicationUIs::KCoreAppUIsLightsRawKeyEvent to light controller. - * - * @since S60 3.2 - */ - void HandleRawKeyEventLightsRequireL() const; - - /** - * Gets called when Video Telephony requests to force/cancel lights on/ - * @param const TInt aLightsParameter - * @return void - */ - void HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const; - - /** - * Gets called when Screen Saver requests to force lights on/off - * @param const TInt aLightsParameter - * @return void - */ - void HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const; - - /** - * Gets called when AT Command requests to force lights on/off - * @param const TInt aLightsParameter - * @return void - */ - void HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const; - /** - * Calls SysApLightsController::SwitchLightsOnSoftRejectL - * - * @since S60 3.1 - * @param None. - * @return None. - */ - void SwitchLightsOnSoftRejectL(); - - /** - * Asks state of one property from PubSub - * @param const TUid& - * @param const TUint - * @return const TInt ( value of property or error code ) - */ - TInt StateOfProperty( const TUid& aCategory, const TUint aKey ) const; - - /** - * Sets the indicator's aIndicator state to state aState. - * @param TInt aIndicator - * @param TInt aState - * @return void - */ - void SetIndicatorStateL( const TInt aIndicator, const TInt aState ) const; - - /** - * Returns the state of keylock - * @param none - * @return TBool the state of keylock - */ - TBool KeyLockState() const; - - /** - * Returns the state of devicelock - * @param none - * @return TBool the state of devicelock - */ - TBool DeviceLockState() const; - - /* - * @param None - * @return void - */ - void SetIhfIndicatorL(); - - /* - * Handles actions needed when either SIM memory gets too full to receive any more SMS's. - * @param aSimStoreFull If true, SIM memory is full. - * @return void - */ - void HandleSmsStorageNotificationL( TBool aSimStoreFull ); - - void HandleNspsRawKeyEventL(); - - void HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ); - - void HandleMessageTonePlayingQuitability( TInt aTonePlayingStatus ); - - /* - * Called by SysApLightsController when the lights are switced on/off - * @param aActivate If ETrue forwarding is activated, otherwise deactivated - * @return void - */ - void ActivateKeyeventForwardingForLights(TBool aActivate); - - /** - * Gets called when shutdown requested when sw state == ESWStateAlarm - * context active. - * @param None - * @return void - */ - void StartShutDownTimerOnAlarmAndChargingStates(); - static TInt DoShutdownOnAlarmStateAfterCallBack( TAny* aObject ); - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - /** - * Starts shutdown animation timing after shutdown tone sync is done - */ - void StartAnimTiming(); -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - /** - * Stops shutdown animation timing and continues shutdown. - */ - static TInt DoStopAnimTiming( TAny* aObject ); - - /** - * Gets called when GPRS is suspended because of a phone call established while - * context active. Delay (KDelayBeforeShowingGprsSuspendedNote) required to ensure - * that the phone call was really established. - * @param None - * @return void - */ - void StartGprsSuspendedTimer(); - static TInt ShowGprsSuspendedNoteAfterCallBack( TAny* aObject ); - - /** - * Gets called when an accessory was connected to device. The indicator - * is shown and profile gets changed if needed. - * @param aAccessoryState Indicates the new accessory state - * @return void - */ - void HandleAccessoryConnectedL( TAccMode aAccessoryState ); - - /** - * Gets called when headset/loopset was disconnected from device. The indicator - * is hidden and the original profile gets restored if needed. - * @param None - * @return void - */ - void HandleAccessoryDisconnectedL(); - - /** - * Gets called when SysAp receives KSysApSatRefreshStart. All - * non-system UI applications are closed - * and an information note is shown to the user. - * @param None - * @return void - */ - void HandleSatRefreshL(); - -#ifndef RD_MULTIPLE_DRIVE - /** - * Mounts MMC drive - * @param None - * @return TInt : error value from RFs::MountFileSystem() - */ - TInt MountMMC(); - - /** - * Dismounts MMC drive - * @param None - * @return TInt : error value from RFs::MountFileSystem() - */ - TInt DismountMMC(); -#endif // RD_MULTIPLE_DRIVE - - /** - * MMC Hot Swap Ejection from powerkey menu - * @param None - * @return void - */ - void EjectMMCL(); - - /** - * Disconnect BtSap from powerkey meny - * @param None - * @return void - */ - void DisconnectBtSap(); - - /** - * Enable or disable FM transmission - */ -// void ChangeFmTxStateL( TBool aEnable ); - -#ifndef RD_MULTIPLE_DRIVE - public: // from MAknMemoryCardDialogObserver - - /** - * To be notified when unlock completed - * @param TInt aResult - * @return void - */ - void UnlockComplete( TInt aResult ); -#endif // RD_MULTIPLE_DRIVE - - public: - - /** - * Plays the sound EAvkonSIDInformationTone - * @param None - * @return void - */ - void Beep(); - -#ifndef RD_MULTIPLE_DRIVE - /** - * Unlocks MMC - * @param None - * @return void - */ - void RunUnlockNotifierL( TSysApMemoryCardStatus aMemoryCardStatus = ESysApMemoryCardStatusNotKnown ); - - /** - * From MSysApMemoryCardObserver. - * Gets called by CSysApMMCObserver when an MMC is inserted/removed - * @return void - */ - void MMCStatusChangedL(); - - /** - * Shows "MMC removed..." dialogs - * @param None - * @return void - */ - void ShowMMCDismountedDialogL(); -#else // RD_MULTIPLE_DRIVE - - /** - * Updates PS key during boot - * @return void - */ - void MMCInsertedL(); - - /** - * Unlocks MMC - * @param None - * @return void - */ - void RunUnlockNotifierL(); - - /** - * From MSysApMemoryCardObserver. - * Gets called by CSysApMMCObserver when an MMC is inserted/removed - * @param aDrive Changed drive - * @return void - */ - void MMCStatusChangedL( TInt aDrive ); - - /** - * Shows "MMC removed..." dialogs - * @param aDrive Drive to dismount - * @param aEjectType Eject type used for the drive - * @return void - */ - TBool ShowMMCDismountedDialogL( - TInt aDrive, CSysApDriveList::TDriveEjectType aEjectType ); -#endif // RD_MULTIPLE_DRIVE - - /** - * Called after confirming dialog "MMC removed..." - * @param None - * @return void - */ - void MMCDismountedDialogConfirmed(); - - /** - * Gets called by CSysApSharedDataObserver when "Eject" is started - * or finished in File Manager application. - * @param None - * @return void - */ - void EjectStarted( TBool ejectStarted ); - - private: - /** - * EPOC default constructor. - * @param None - * @return void - */ - void ConstructL(); - - private: - -#ifndef RD_MULTIPLE_DRIVE - - /** - * Resolves process UID based on its thread id - * - * @since S60 3.1 - * @param aThreadId id of the thread - * @return TInt32 process UID - */ - TInt32 ResolveUidFromThread( TUint aThreadId ) const; - - /** - * Called recursively when shutting down apps in Hot Swap - * @param None - * @return void - */ - void CloseUIAppsInHotSwapL(); - - /** - * Called by CloseUIApplicationsHotSwapL when completing - * shutting apps - * @param None - * @return void - */ - void CompleteAppsShuttingInHotSwapL(); -#endif // RD_MULTIPLE_DRIVE - - public: - - /** - * Initializes parameters used in shutting down apps in BT SAP - * @param None - * @return void - */ - void InitCloseSimApplicationsL(); - - private: - - /** - * Called recursively when shutting down apps in BT SAP - * @param None - * @return void - */ - void CloseSimApplicationsL(); - - /** - * Called to re-envoke CloseSimApplicationsL() - * @param None - * @return void - */ - static TInt DoCloseSimApplicationsAfterCallBack( TAny* aObject ); - - private: - /** - * Takes care of command handling. - * @param aCommand command to be handled - * @return void - */ - void HandleCommandL( TInt aCommand); - - /** - * handles key events - * @param TKeyEvent& aKeyEvent - * @param TEventCode aType - * @return TKeyResponse - */ - TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - - private: - // By default, prohibit copy constructor - CSysApAppUi( const CSysApAppUi& ); - - // Prohibit assigment operator - CSysApAppUi& operator= ( const CSysApAppUi& ); - - private: - void HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent); - /** - * Gets called by ConstructL function to set initial states to indicators etc - * Needed state information is got from Shared Data and status pane's components - * are set to the correct states. - * @param None - * @return void - */ - void InitializeStatusPaneAreaL(); - - /** - * Gets called by HandleKeyEventL after detecting a long press of powerkey. - * According to current state of the device desides if it is time to either - * shutdown or make startup (from charging state ) to normal state - * @param None - * @return void - */ - void HandleLongPowerKeyPressedL(); - - /** - * Gets called by HandleKeyEventL after a short press of powerkey. - * According to current state of the device desides if it is time to - * either switch lights on and show mode selection dialog(normal state) - * or to shutdown the phone (in alarm state). - * @param None - * @return void - */ - void HandleShortPowerKeyPressedL(); - - /** - * Frees SysAp's reserved memory, closes connections to servers etc. - * @param None - * @return void - */ - void FreeResources(); - - public: - - /** - * Displays a UI query. - * @param TSysApConfirmationQueryIds - * @param aValue query related value - * @return void - */ - void ShowQueryL( const TSysApConfirmationQueryIds aQueryId, - const TDesC& aValue = KNullDesC ); - - /** - * Displays a UI note. - * @param TSysApNoteIds aSysApNoteIds - * @return void - */ - void ShowUiNoteL( const TSysApNoteIds aNote ) const; - - /** - * Displays a "Charger connected" note. - * @param None - * @return void - */ - void ShowChargingNoteL(); - - /** - * Handles charger related notes - * @param TInt : KPSUidChargerCStatusValue - * @return void - */ - void HandleChargerNotesL( const TInt aValue ); - - /** - * Displays a "Selected profile" note. - * @param None - * @return void - */ - void ShowProfileNoteL(); - - /** - * Cancels a UI wait note. - * @param None - * @return void - */ - void CancelWaitNote(); - - /** - * Cancels the global list query - * @param None - * @return void - */ - void CancelGlobalListQuery(); - - /** - * Updates signal bars to the value cached by Etel connector. - * @return void - */ - void UpdateSignalBarsL(); - - /** - * Updates signal bars to specified state. - * @param TInt aState Number of bars or KAknSignalOffLineMode - * @return void - */ - void UpdateSignalBarsL( const TInt aState ); - - /** - * Gets called by HandleSystemAgentEventL to singal availability indicator - * ie. Gprs state icon or common signal icon. - * @param None - * @return void - */ - void SetSignalIndicatorL(); - - /** - * Gets called by SetSignalIndicatorL() when in GSM network - * @param None - * @return void - */ - void SetSignalIndicatorGsmL(); - - /** - * Gets called by SetSignalIndicatorL() when in Wcdma network - * @param None - * @return void - */ - void SetSignalIndicatorWcdmaL(); - - /** - * Handles GPRS suspend/resume notes if feature supported. - * ie. Gprs state icon or common signal icon. - * @param None - * @return void - */ - void HandleGprsNotesL(); - - /** - * Returns the current bluetooth power mode setting using CSysApSharedDataObserver - * @param None - * @return TInt - */ - TInt BluetoothPowerMode() const; - - /** - * Activates the profile given as a parameter - * @param TInt aProfileId - * @return void - */ - void ActivateProfileL( const TInt aProfileId ) const; - - /** - * Activates the profile saved in iProfileToBeActivated. - * @param None - * @return void - */ - void ActivateOnlineProfileL() const; - - /** - * Checks whether Offline Mode is activated - * @param TBool - * @return void - */ - TBool OfflineModeActive(); - - /** - * Tolds Offline Mode controller not to activate BT - * when next going online. - * @param None - * @return void - */ - void DoNotActivateBt(); - - /** - * Switches BT module on/off using BT Engine - * @param TBool: ETrue = on, EFalse = off - * @return void - */ - TInt SetBtPowerState( TBool aBtState ); - - /** - * Sets iKeyLockOnBeforeCall = EFalse. - * @param None - * @return void - */ - void DoNotEnableKeylock(); - -#ifdef RD_MULTIPLE_DRIVE - /* - * Starts wait note for eject - */ - void ShowEjectWaitNoteL( TInt aDriveToEject ); - - /* - * Checks is eject query visible - */ - TBool IsEjectQueryVisible(); -#endif // RD_MULTIPLE_DRIVE - - /** - * Gets called by CSysApSharedDataObserver when "Eject" is selected - * in File Manager application. - * @param aDrive Drive to eject - * @return void - */ - void EjectUsed( TInt aDrive ); - - /** - * MMC Hot Swap Ejection from powerkey menu was canceled - * @param None - * @return void - */ - void EjectMMCCanceled(); - - private: - - /** - * Gets currently active profile's name. - * @param TPtr aProfileName - * @return void - */ - void ActiveProfileNameL( TPtr aProfileName ); - - public: - - /** - * Gets called by HandleSystemAgentEventL to update battery bars. - * @param TInt aState - * @return void - */ - void UpdateBatteryBarsL( const TInt aState ); - - /** - * Gets called by HandleSystemAgentEventL when profile was changed. - * Profile selected Global Note is shown. - * @param TInt aValue - * @return void - */ - void HandleProfileChangedL( const TInt aValue ); - - /** - * Checks if the active profile is silent and updates CSysApLightsController - * if needed. - * @param None - * @return void - */ - void CheckSilentModeL(); - - /** - * Gets called by CSysApOfflineModeController when activation/deactivation - * of Offline Mode fails - * @param TBool aOffline - * @return void - */ - void RestoreProfileL( const TBool aOffline ); - - /** - * Returns the id of the active profile. - * @param None - * @return Int - */ - TInt ActiveProfileId(); - - /** - * Gets called when the value of the SD key KGSDisplayLightsTimeout - * changes - * @param TInt : lights timeout in seconds - * @return void - */ - void DoLightsTimeoutChangedL( const TInt aTimeout ); - - private: - - /** - * Checks whether it is necessary to change profiles in case an accessory - * was connected/disconnected while the device was powered down. - * - * @param TInt aValue - * @return void - */ - void HandleAccessoryProfileInStartupL( ); - - public: - /** - * Gets called by HandleSystemAgentEventL to Disable keylock when devicelock is activated. - * This is done already when device lock is activated because this - * @param None - * @return void - */ - void SetDeviceLockEnabledL( const TBool aLockEnabled ); - - private: - - /** - * Gets called by HandleShortPowerKeyPressedL to display the power key popup menu - * @param None - * @return void - */ - void ShowPowerKeyPopUpMenuL(); - - /** - * Does what is needed to do inside SysAp before actually doing - * other shutdown related things. This is used when shutdown image is enabled. - * @param None - * @return void - */ - void PrepareForShutdownImage(); - - /** - * Does what is needed to do inside SysAp before actually doing - * other shutdown related things. This is used when shutdown animation is enabled. - * @param None - * @return void - */ - void PrepareForShutdownAnimation(); - - /** - * Show shutdown animation - * - * @param - * @return ETrue if animation is enabled - */ - #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION - void - #else // RD_STARTUP_ANIMATION_CUSTOMIZATION - TBool - #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - ShowAnimationL(); - - /** - * Makes Status pane visible/invisible when needed and changes it's layout between Charging/Alarm - * @param None - * @return void - */ - void SetStatusPaneLayoutL( const TSysApPhoneState aState ); - - /** - * Checks from current Symbian swstate if it is ok to initiate shutdown - * @param None - * @return const TBool - */ - TBool OkToInitiateShutdown(); - - /** - * Shows shutdown animation or shutdown image - * @param None - * @return void - */ - void PrepareForCompleteShutdown(); - - /** - * Makes the end part of shutdown sequence. - * @param None - * @return void - */ - void CompleteShutdown( const TBool aReset = EFalse, const TInt aResetReason = KDummyReason ); - - /** - * Sets calls forwarding indicators on/off accrding to aCallsForwardingState - * @param TInt aCallsForwardingState - * @return void - */ - void DoSwStateNormalConstructionL(); - - public: - - /** - * Starts an application or brings an already running application - * to foreground. - * @param TUid: UID of the application that is activated - * @return void - */ - void ActivateApplicationL( const TUid aUid ); - - void HandleCurrentCallStateChangeL( TInt aCurrentCallState ); - - void DoSimChangedFromPreviousBootL(); - - /** - * Gets called in SysAp construction or when SysAp gets a SA/P&S notification - * @param const TInt: indicator status - * @return void - */ - void HandleLocationPrivacyIndicatorL( const TInt aState ); - - /** - * Return value of the__SIMCARD feature - * @param None - * @return TBool - */ - TBool SimSupported(); - - /** - * Notify CSysApLightController of the empty battery. - * @param None - * @return void - */ - void BatteryEmptyL(); - - /** - * Prompt starter to change mode - * @param aState The new state - * @return KErrArgument if the state change is illegal (from current state - * it is not possible to change to the requested state), KErrNone if the - * global state change has been successfully initiated. - */ - TInt SetStarterState( const RStarterSession::TGlobalState aState ); - - /** - * Creates the device name string for BT Sap disconnect prompt. - * @return device name string. - */ - HBufC* GetBtSapDeviceNameL(); - - /** - * Handle alarm indicator - * @param aShowIndicator If ETrue, indicator is show, otherwise it is hidden. - */ - void ShowAlarmIndicatorL( TBool aShowIndicator ); - - /** - * Informs lights controller that flip has been opened/close - * @param aFlipOpen ETrue if flip is open, EFalse otherwise - */ - void SetFlipOpenL( TBool aFlipOpen ); - - /** - * Creates a virtual flip key event that is passed to the key management - * of SysAp. - * - * @since S60 3.2 - * @param aFlipOpen ETrue if flip is open, EFalse otherwise - * @return None - */ - void SimulateFlipKeyEventL( TBool aFlipOpen ); - - /** - * Informs lights controller that grip has been opened/close - * @param aGripOpen ETrue if grip is open, EFalse otherwise - */ - void SetGripOpenL( TBool aGripOpen ); - - /** - * Sets the status of the Central Repository key - * KCRUidCoreApplicationUIs / KCoreAppUIsNetworkConnectionAllowed - * @param TInt - * @return void - */ - void SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ); - - /** - * Get pointer to RTelServer - * - * @return pointer to RTelServer if iSysApEtelConnector is initialized. Otherwise return NULL. - */ - RTelServer* GetTelServer(); - - /** - * Show WLan indicator - * - * @param aValue The value of KPSWlanIndicator PS key. - */ - void HandleWlanIndicatorL( TInt aValue ); - - /** - * Show TARM indicator - * - * @param aValue The value of KCoreAppUIsTarmIndicator PS key - */ - void HandleTarmIndicatorL( TInt aValue ); - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - /** - * Continue shutdown animation showing after sync request - */ - void ShutdownAnimationSyncOK(); -#endif RD_STARTUP_ANIMATION_CUSTOMIZATION - - /** - * Skip shutdown animation (i.e. stop showing it). Initiated by CoverUI. - */ - void SkipShutdownAnimation(); - - /** - * Notifies CoverUI about skipping shutdown animation. - */ - void NotifyShutdownAnimationSkip(); - - /** - * Check cover display support - * - * @return ETrue if cover display is supported, EFalse otherwise - */ - TBool CoverDisplaySupported(); - - /** - * Returns reference to RStarterSession - * RStarterSession is connected when this method is called - * for the first time. - * - * Always (except when freeing resources) access the starter session via this method, - * don't use the member variable directly. - * - * @return reference to RStarterSession - */ - RStarterSession& StarterSession(); - - /** - * Returns reference to SysAp's CenRep controller - * - * @since S60 3.1 - * @param None - * @return reference to CSysApCenRepController - */ - CSysApCenRepController& CenRepController(); - - /** - * Ignore zero network bars signal notifies. - * This is needed in BT SAP mode. - * - * @param aIgnore If ETrue, ignore any future zero network bars notifications. - */ - void IgnoreZeroNetworkBarNotifications(TBool aIgnore); - - /** - * Check if BT SAP is enabled - * - * @return ETrue if BT SAP is enabled, EFalse otherwise - */ - TBool BtSapEnabled(); - - /** - * Deactivate BT when changing to normal mode. - * Can only be used during startup, has no effect after that. - */ - void DeactivateBT(); - - private: - /** - * Returns reference to SysAp's keylock session - * RAknKeylock2 session is connected when this method is called - * for the first time. - * - * Always (except when freeing resources) access the keylock session via this method, - * don't use the member variable directly. - * - * @since S60 3.1 - * @param None - * @return reference to RAknKeylock2 - */ - RAknKeylock2& KeyLock(); - - - -#ifdef __SYSAP_MODULE_TEST - - /** - * Can be used for showing a CAknGlobalNote in module tests - * @param noteText : text to be shown in the note - * @return void - */ - void ModuleTestShowUiNoteL( const TDesC& noteText ) const; -#endif - - /** - * shows power down note before displaying shutdown image - * @param: none - * @return void - */ - void ShowShutdownNoteL(); - - /** Return ETrue if the global system state is one of the 'normal' - * states: ESwStateNormalRfOn, ESwStateNormalRfOff or - * ESwStateNormalBTSap. - */ - TBool IsStateNormal() const; - - /** - * Returns max of three integers - * @param: TInt - * @return void - */ - TInt Max( const TInt aA, const TInt aB, const TInt aC ); - - /** - * Displays shutdown image. - * This method is just a nonleaving implementation, - * calls ShowShutdownImageL for performing the task. - * - * @since S60 3.1 - * @param aBitmapId bitmap identifier - * @return TInt an error value - * @see CSysApAppUi::ShowShutdownImageL - */ - TInt ShowShutdownImage( TInt aBitmapId ); - - /** - * Displays shutdown image. If a CSysApShutdownImage instance - * does not exist, it will be created. - * - * @since S60 3.1 - * @param aBitmapId bitmap identifier - * @return None - * @leave Symbian error code - */ - void ShowShutdownImageL( TInt aBitmapId ); - private: // from MSysapCallback /** * Executes a command in SysAp. @@ -1258,19 +169,60 @@ * @see MSysapCallback::TSysapQuery */ void ExecQueryL( TSysapQuery aQuery, TDes8& aReturn, const TDesC8& aParam ); - - public: + +// private: + /** + * EPOC default constructor. + * @param None + * @return void + */ + public: + void ConstructL(); + + private: // from CEikAppUi + /** + * Handles a change to the application's resources which are shared across the environment. + * + * @since S60 3.1 + * @param aType The type of resources that have changed. + * @return None. + */ +// void HandleResourceChangeL(TInt aType); + + private: /** - * Sets HAC (Hearing Aid Compatibility) indicator according to its CenRep-setting - * state. - * HAC indicator is not displayed if an accessory is connected. - * - * @param None - * @return None + * Takes care of command handling. + * @param aCommand command to be handled + * @return void + */ + void HandleCommandL( TInt aCommand); + + /** + * handles key events + * @param TKeyEvent& aKeyEvent + * @param TEventCode aType + * @return TKeyResponse */ - void SetHacIndicatorL(); + TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + public: + // void CallFromMain(); + + /** + * Returns the state of keylock + * @param none + * @return TBool the state of keylock + */ + TBool KeyLockState() const; /** + * Returns the state of devicelock + * @param none + * @return TBool the state of devicelock + */ + TBool DeviceLockState() const; + + /** * Returns reference to SysAp's internal feature manager. * * @since S60 3.1 @@ -1278,387 +230,199 @@ */ CSysApFeatureManager& SysApFeatureManager(); - /** - * Handles response to power save activation query. - * - * @param aEnable If ETrue, the user has accepted the query. - */ - void HandleActivatePsmQueryResponse( TBool aEnable ); - - /** - * Handles response to power save deactivation query. - * - * @param aDisable If ETrue, the user has accepted the query. - */ - void HandleDeactivatePsmQueryResponse( TBool aDisable ); - - private: // from CAknAppUi - /** - * Handles a change to the application's resources which are shared across the environment. - * - * @since S60 3.1 - * @param aType The type of resources that have changed. - * @return None. - */ - void HandleResourceChangeL(TInt aType); - - private: - /** - * Shows and hides the memory card indicator depending on whether the memory card is inserted or not. - * - * @since S60 3.1 - * @param None. - * @return None. - */ - void SetMemoryCardIndicatorL(); - - /** - * Returns whether IHF has been enabled. - * Creates audio routing observer if it does not exist.. - * - * @since S60 3.2 - * @return TBool ETrue if IHF is enabled + /* + * Called by SysApLightsController when the lights are switced on/off + * @param aActivate If ETrue forwarding is activated, otherwise deactivated + * @return void */ - TBool IhfEnabledL(); - -#ifdef RD_MULTIPLE_DRIVE - void UpdateInsertedMemoryCardsL(); -#endif // RD_MULTIPLE_DRIVE - - /** - * Handles setup of USB charger from given charging status. - * - * @since S60 3.2 - * @param aValue Given charging status - */ - void HandleUsbCharger( const TInt aValue ); - - public: - /** - * Sets USB connection attach status. - * This prevents double beep when USB file transfer gets activated. - * - * @since S60 3.2 - * @param aUsbConnected ETrue if USB cable has just been attached, otherwise EFalse - */ + void ActivateKeyeventForwardingForLights(TBool aActivate); + + TBool IsEncryptionOperationOngoingL() const; +// void ConnectToFileServerL(); +// void ConnectToWindowServerL(); + void ShowExampleUiNoteL ( const TDesC& noteText )const; + void ShowNotificationDialog(const TDesC& noteText)const; + void PopupNote(); +// void CreateWindowGroup(); + TBool ResourcesFreed() const; + void ShowUiNoteL( const TSysApNoteIds aNote ) const; + TInt StateOfProperty( const TUid& aCategory, const TUint aKey ) const; + TBool OfflineModeActive(); + void GoOnlineL( TBool aDoProfileChange = ETrue ); + void GoOfflineL(); + void SwitchFromOnlineToOfflineModeL(); + + void DoStateChangedL( const RStarterSession::TGlobalState aSwState ); + TInt SetStarterState( const RStarterSession::TGlobalState aState ); + TInt BluetoothPowerMode() const; + void SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ); + RStarterSession& StarterSession(); + TInt SetBtPowerState( TBool aBtState ); + TBool SimSupported(); + TBool BtSapEnabled(); + void OfflineModeChangedL(); + TBool UiReady() const; + void DoShutdownL( const TBool aReset, const TInt aResetReason ); + TBool IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const; void SetUsbAttachStatus( const TBool aUsbAttached ); - - /** - * Returns whether the key event is considered to be a device mode key event, - * which usually causes a transition in the device mode (e.g. grip, flip or twist). - * - * @since S60 3.2 - * @param aKeyEvent key event - * @return TBool ETrue key event is considered to be a device mode key - * EFalse not a device moed key - */ - TBool IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const; - - /** - * Returns whether resources (objects, server connections) owned by this - * class has been freed. - * - * @since S60 3.2 - * @return TBool ETrue if resource deallocation has been performed. - */ - TBool ResourcesFreed() const; - - /** - * Returns pointer to CSysApEtelConnector. - * - * @since S60 3.2 - * @return pointer to CSysApEtelConnector instance owned by this class. - * NULL if the object creation has failed. - */ - CSysApEtelConnector* EtelConnector() const; - - /** - * Returns reference to USB charger detector, TSysApUsbChargerDetector. - * - * @since S60 3.2 - * @return Reference to USB charger detector. - */ TSysApUsbChargerDetector& UsbChargerDetector(); - - /** - * Sets envelope indicator according to current messaging status. - * - * @since S60 3.2 - */ - void SetEnvelopeIndicatorL(); - - /** - * Handles value changes of the key KHWRMBatteryStatus. - * - * @since S60 3.2 - * @param aValue the updated key value - */ - void HandleBatteryStatusL( const TInt aValue ); - /** - * Handles value changes of the key KHWRMChargingStatus. - * - * @since S60 3.2 - * @param aValue the updated key value - */ - void HandleChargingStatusL( const TInt aValue ); - - /** - * Cancel the specified query if it is active. - * - * @param aQueryId ID of the query that must be cancelled. - * If ESysApNoQuery is given, the active query is cancelled. - * without checking its ID. - */ - void CancelQuery( TSysApConfirmationQueryIds aQueryId ); - - private: - // from MSysApPsmControllerNotifyCallback - void NotifyPowerSaveModeL( TSysApPsmStatus aStatus ); - - private: - /** - * Get the logs observer. Created if does not exist. - * - * @since S60 3.2 - * @return reference to CSysApCenRepLogsObserver object - */ - CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL(); - - private: //Data members + void HandleAccessoryConnectedL( TAccMode aAccessoryState ); - /***************************************************** - * Series 60 Customer / DOS - * Series 60 Domestic OS API - *****************************************************/ - - CSysApLightsController* iSysApLightsController; - - CSysApPubSubObserver* iSysApPubSubObserver; - CSysApProfileObserver* iSysApProfileObserver; + void HandleAccessoryDisconnectedL(); + void DoLightsTimeoutChangedL( const TInt aTimeout ); + void SetHacIndicatorL(); + void DoNotActivateBt(); + void SetIhfIndicatorL(); + void HandleLongPowerKeyPressedL(); + void IgnoreZeroNetworkBarNotifications(TBool aIgnore); + void InitCloseSimApplicationsL(); + void CloseSimApplicationsL(); + void DoSimChangedFromPreviousBootL(); + void ShowAlarmIndicatorL( TBool aShowIndicator ); + void AlertUiAlertingL( const TBool aAlerting ); + void HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const; + void HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const; + void HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const; + void HandleLightsRequireL() const; + void AlertUiKeyLockOff( const TBool aKeyLockOff ); + void DoNotEnableKeylock(); + void SwitchLightsOnSoftRejectL(); + void SetDeviceLockEnabledL( const TBool aLockEnabled ); + void HandleBatteryStatusL( const TInt aValue ); + void BatteryEmptyL(); + void ShowQueryL( const TSysApConfirmationQueryIds aQueryId, + const TDesC& aValue = KNullDesC ); + void HandleChargingStatusL( const TInt aValue ); + void HandleChargerNotesL( const TInt aValue ); + void UpdateBatteryBarsL( const TInt aState ); + void ShowChargingNoteL(); + void HandleCurrentCallStateChangeL( TInt aCurrentCallState ); + TBool IsEmergencyCall(); + CSysApCenRepController& CenRepController(); + void HandleWlanIndicatorL( TInt aValue ); - CSysApCenRepLightSettingsObserver* iSysApCenRepLightSettingsObserver; - CSysApCenRepLogsObserver* iSysApCenRepLogsObserver; - CSysApCenRepBtObserver* iSysApCenRepBtObserver; - CSysApCenRepHacSettingObserver* iSysApCenRepHacSettingObserver; -// CSysApCenRepFmTxObserver* iSysApCenRepFmTxObserver; - CSysApCenRepController* iSysApCenRepController; - CSysApStartupController* iSysApStartupController; - CSysApConnectionMonitorObserver* iSysApConnectionMonitorObserver; - CSysApPowerKeyMenuObserver* iSysApPowerKeyMenuObserver; - CSysApSsSettingsObserver* iSysApSsSettingsObserver; - CSysApShutdownImage* iSysApShutdownImage; - CSysApShutdownAnimation* iSysApShutdownAnimation; - CSysApEtelConnector* iSysApEtelConnector; - CSysApAccessoryObserver* iSysApAccessoryObserver; - CSysApMsgSimMemLowQuery* iSysApMsgSimMemLowQuery; - CSysApWaitNote* iSysApWaitNote; - CSysApConfirmationQuery* iSysApConfirmationQuery; - CSysApConfirmationQuery* iSysApConfirmationQueryForRestart; - CSysApFeatureManager* iSysApFeatureManager; - MSysApOfflineModeController* iSysApOfflineModeController; - CSysApMMCObserver* iSysApMMCObserver; - CSysApNspsHandler* iSysApNspsHandler; - MSysApUsbIndicator* iSysApUsbIndicatorController; - MSysApBtController* iSysApBtController; - MSysApBtSapController* iSysApBtSapController; - MSysApLocationPrivacyIndicator* iSysApLocationPrivacyIndicator; - CAknBatteryNotify* iBatteryNotify; - CAknSignalNotify* iSignalNotify; - CAknGlobalListQuery* iGlobalListQuery; + void SetKeyLockEnabledL(); + void SetKeyLockDisabledL(); + void SetLightsOnUnlockNoteL(); + void SetLightsOnEcsQueryL(); + void SetLightsOnSecurityQueryL(); + TBool CheckLongPowerKeyPressed(); + TBool ReleasePowerMenuCustomDialogMemory(); + +#ifdef SYSAP_USE_STARTUP_UI_PHASE + /** + * Called when UI is ready after boot. + */ + void HandleUiReadyAfterBootL(); - CSystemLock* iSysApSystemLock; - MProfileEngine* iProfileEngine; - MProfilesNamesArray* iProfileNamesArray; - RStarterSession iStarterSession; - RAknKeylock2 iKeyLock; -#ifndef RD_MULTIPLE_DRIVE - CAknMemoryCardDialog* iMemoryCardDialog; -#endif // RD_MULTIPLE_DRIVE - TInt iCapturedEKeyPowerOff; - TInt iCapturedEKeyPowerOffUpAndDowns; - TInt iCapturedAppskey; - TInt iCapturedAppskeyUpAndDowns; +#endif // SYSAP_USE_STARTUP_UI_PHASE + +// RFs iFsSession; +// RWsSession iWsSession; + + private: + /** + * Frees SysAp's reserved memory, closes connections to servers etc. + * @param None + * @return void + */ + void FreeResources(); + TBool OkToInitiateShutdown(); - TInt iNumberOfProfileNamesInPowerKeyMenu; - - TBool iPowerkeyMenuLockKeypadShown; - TBool iPowerkeyMenuExitSapShown; - TBool iPowerkeyMenuLockSystemShown; - TBool iPowerkeyMenuEjectShown; - - TInt iPowerkeyMenuLockKeypadSelection; - TInt iPowerkeyMenuExitSapSelection; - TInt iPowerkeyMenuLockSystemSelection; -#ifndef RD_MULTIPLE_DRIVE - TInt iPowerkeyMenuEjectSelection; -#endif // RD_MULTIPLE_DRIVE + void CompleteShutdown( const TBool aReset = EFalse, const TInt aResetReason = KDummyReason ); + void PrepareForShutdownImage(); + TInt ShowShutdownImage( TInt aBitmapId ); + void ShowShutdownImageL( TInt aBitmapId ); + TBool IhfEnabledL(); + void DoSwStateNormalConstructionL(); + static TInt DoCloseSimApplicationsAfterCallBack( TAny* aObject ); + + // from MSysApPsmControllerNotifyCallback + void NotifyPowerSaveModeL( TSysApPsmStatus aStatus ); + + void HandleUsbCharger( const TInt aValue ); + TBool IsStateNormal() const; + void HandleAccessoryProfileInStartupL( ); + + CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL(); - TInt iProfileToBeActivated; - TInt iActiveProfileBeforeOfflineMode; - - TInt iApplicationScanningRoundNumberInBtSap; - TBool iTimeToKillInBtSap; + + private: +// CSysApWsClient* iSysApWsClient; + CSysApLightsController* iSysApLightsController; + CSysApFeatureManager* iSysApFeatureManager; + CSysApNspsHandler* iSysApNspsHandler; + CSysApPubSubObserver* iSysApPubSubObserver; + + CSysApDefaultKeyHandler* iSysApDefaultKeyHandler; +// RWindowGroup groupWin; + CSysApStartupController* iSysApStartupController; + MSysApOfflineModeController* iSysApOfflineModeController; + RStarterSession iStarterSession; + TSysApUsbChargerDetector iSysApUsbChargerDetector; + CSysApAccessoryObserver* iSysApAccessoryObserver; + CSysApShutdownImage* iSysApShutdownImage; + CSysApKeySndHandler* iSysApKeySndHandler; + CSysApCenRepController* iSysApCenRepController; + CSysApCenRepLightSettingsObserver* iSysApCenRepLightSettingsObserver; + CSysApCenRepBtObserver* iSysApCenRepBtObserver; + CSysApCenRepHacSettingObserver* iSysApCenRepHacSettingObserver; + + CSysApAudioRoutingObserver* iSysApAudioRoutingObserver; + CSysApPsmController* iSysApPsmController; + CSysApSsSettingsObserver* iSysApSsSettingsObserver; + CSystemLock* iSysApSystemLock; + CSysApCenRepCallForwardingObserver* iSysApCenRepCallForwardingObserver; + CSysApBatteryInfoController* iSysApBatteryInfoController; + MSysApBtSapController* iSysApBtSapController; + CPeriodic* iSapTimer; + MSysApBtController* iSysApBtController; + CSysApCenRepLogsObserver* iSysApCenRepLogsObserver; + MSysApUsbIndicator* iSysApUsbIndicatorController; + CKeyguardAccessApi* iKeyguardController; + CHbDevicePowerMenuSymbian* iPowerMenuDialog; + CSysApKeyManagement* iSysApKeyManagement; + +// CSysApDriveList* iSysApDriveList; - CAknGlobalNote* iProfileNote; - TInt iProfileNoteId; - - TBool iLastPowerKeyWasShort; - TBool iIgnoreNextPowerKeyUpEvent; - TBool iIgnoreNextPowerKeyRepeats; - TBool iPowerKeyPopupMenuActive; - TBool iDisablePowerkeyMenu; - TBool iPowerkeyMenuPowerOffShown; - + private: + TBool iPowerKeyPopupMenuActive; TBool iDeviceLockEnabled; TBool iKeyLockEnabled; TBool iKeyLockOnBeforeCall; TBool iKeyLockOnBeforeAlarm; TBool iKeyLockOnBeforeCradle; - TBool iShowkeypadActivatedNoteAfterSoftReject; - - TBool iEmergencyCallActive; + TBool iResourcesFreed; + TInt iCapturedEKeyPowerOff; + TInt iCapturedEKeyPowerOffUpAndDowns; + TBool iOfflineModeActive; + TBool iShutdownStarted; + + TBool iIgnoreNextPowerKeyUpEvent; // need to be added this flag in maliks client side apis. + TBool iLastPowerKeyWasShort; + TBool iPowerKeyPopupMenuDismissed; // need to be added this flag in malik implementation. + TInt iKeyBoardRepeatCount; + TBool iIgnoreNextPowerKeyRepeats; + TInt iActiveProfileBeforeOfflineMode; + TBool iSimChangedDone; - TBool iResourcesFreed; - TBool iNsps; -#ifndef RD_MULTIPLE_DRIVE - TBool iHideFirstBeep; -#endif // RD_MULTIPLE_DRIVE - TBool iShutdownStarted; - TBool iAlarmOrChargingStateShutdownStarted; + TBool iIgnoreZeroNetworkBarNotifications; + TInt iApplicationScanningRoundNumberInBtSap; + TBool iTimeToKillInBtSap; + TBool iShowkeypadActivatedNoteAfterSoftReject; + TBool iCharging; // Indicates if charging is currently on + TBool iEmergencyCallActive; + TBool iCallActivated; // used in defining whether to show GPRS suspended note - TBool iIgnoreAccessorySpecificProfileChanges; - TBool iAccessoryJustConnected; - - TBool iHandleNextProfileEvent; TBool iActivateBt; TBool iDeactivateBt; -#ifndef RD_MULTIPLE_DRIVE - TBool iTimeToKill; // MMC Hot Swap - TInt iApplicationScanningRoundNumber; // MMC Hot Swap -#endif // RD_MULTIPLE_DRIVE - TBool iGprsActivated; // used in defining whether to show GPRS suspended note - TBool iGprsSuspended; // used in defining whether to show GPRS suspended note - TBool iCallActivated; // used in defining whether to show GPRS suspended note - TBool iGprsSuspendedNoteShown; - - TBool iMMCEjectUsed; -#ifndef RD_MULTIPLE_DRIVE - TBool iMMCPowerMenuEjectUsed; - TBool iMMCInserted; -#endif // RD_MULTIPLE_DRIVE - - CPeriodic* iTimer; - CPeriodic* iSapTimer; -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - CPeriodic* iAnimTimer; -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - CSysApTimer* iSysApTimer; - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - TInt iAnimationShowingTime; -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - CSysApKeySndHandler* iSysApKeySndHandler; - - TBool iIgnoreZeroNetworkBarNotifications; - - TBool iCharging; // Indicates if charging is currently on - CSysApKeyManagement* iSysApKeyManagement; - - CSysApMediatorObserver* iSysApMediatorObserver; - TBool iShutdownContinued; - - /** - * The default key handler. - * Own. - */ - CSysApDefaultKeyHandler* iSysApDefaultKeyHandler; - - TBool iPowerKeyPopupMenuDismissed; // Indicates if the popup menu has been dismissed - -#ifndef RD_MULTIPLE_DRIVE - TBool iHideNextBeep; // Prevents double beep when USB file transfer gets activated - TBool iFileManagerCloseDisabled; // Prevents File Manager to close on hotswap -#endif // RD_MULTIPLE_DRIVE - - CSysApAudioRoutingObserver* iSysApAudioRoutingObserver; - - /** - * Call forwarding status CenRep key observer. - * Own. - */ - CSysApCenRepCallForwardingObserver* iSysApCenRepCallForwardingObserver; - - /** - * Message waiting status CenRep key observer. - * Own. - */ - CSysApCenRepMsgWaitingObserver* iSysApCenRepMsgWaitingObserver; - -#ifdef RD_MULTIPLE_DRIVE - // First power menu index used for eject - TInt iPowerkeyMenuEjectSelectionBase; - - /** - * Drive list container - * Own. - */ - CSysApDriveList* iSysApDriveList; - - /** - * Drive unlock handler. - * Own. - */ - CSysApDriveUnlockHandler* iSysApDriveUnlockHandler; - - /** - * Drive eject handler. - * Own. - */ - CSysApDriveEjectHandler* iSysApDriveEjectHandler; - - /** - * Array for storing inserted memory cards. - * Own. - */ - RArray< CSysApDriveList::TMemoryCardEntry > iInsertedMemoryCards; - - // Stores drive for dismount query - TInt iDriveToDismount; - - // Stores drive for eject query - TInt iDriveToEject; -#endif // RD_MULTIPLE_DRIVE - - /** - * For USB charger detection. - */ - TSysApUsbChargerDetector iSysApUsbChargerDetector; - - /** - * SysAp power save mode controller. - * Own. - */ - CSysApPsmController* iSysApPsmController; + + TBool iIgnoreAccessorySpecificProfileChanges; + TBool iCheckLongPowerKeyEvent; - /** - * SysAp battery info controller. - * Own. - */ - CSysApBatteryInfoController* iSysApBatteryInfoController; - - /** - * Returns whether a de/encrypting operation is ongoing - * - * @since S60 3.1 - * @return TBool ETrue if a de/encrypting operation is in progress - */ - TBool IsEncryptionOperationOngoingL() const; - TInt iKeyBoardRepeatCount; - }; - -#endif // SYSAPAPPUI_H - -// End of File +// friend class CSysApWsClient; + }; + +#endif diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApDocument.h --- a/coreapplicationuis/SysAp/Inc/SysApDocument.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApDocument.h Wed Jun 23 18:22:59 2010 +0300 @@ -20,7 +20,8 @@ #define SYSAPDOCUMENT_H // INCLUDES -#include +//#include +#include // FORWARD DECLARATIONS class CEikAppUi; @@ -32,7 +33,7 @@ * @since 1.0 */ -class CSysApDocument : public CAknDocument +class CSysApDocument : public CEikDocument { public: /** @@ -40,7 +41,12 @@ * @param CEikApplication& aApp * @return void */ - CSysApDocument(CEikApplication& aApp): CAknDocument(aApp) { } + CSysApDocument(CEikApplication& aApp): CEikDocument(aApp) { } + + /** + * Two-phased constructor. + */ +// static CSysApDocument* NewL(CEikApplication& aApp); /** * Destructor. @@ -50,6 +56,12 @@ virtual ~CSysApDocument(); private: + + /** + * EPOC default constructor. + */ +// void ConstructL(); + /** * C++ default constructor. * @param None diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApFeatureManager.h --- a/coreapplicationuis/SysAp/Inc/SysApFeatureManager.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApFeatureManager.h Wed Jun 23 18:22:59 2010 +0300 @@ -209,7 +209,7 @@ * @since S60 3.2 * @return ETrue if feature is supported */ -// TBool FmTxSupported() const; + // TBool FmTxSupported() const; /** * Returns whether pen is enabled. @@ -244,7 +244,7 @@ * @since S60 5.1 * @return ETrue if feature is supported */ -// TBool FmTxRdsTextSupported() const; + // TBool FmTxRdsTextSupported() const; private: @@ -339,7 +339,7 @@ /** * FM TX supported status */ -// TBool iFmTxSupported; + // TBool iFmTxSupported; /** * Pen enabled status. @@ -359,7 +359,7 @@ /** * FM TX RDS Text support status. */ -// TBool iFmTxRdsTextSupported; + // TBool iFmTxRdsTextSupported; }; #endif // SYSAPFEATUREMANAGER_H diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApPubSubObserver.h --- a/coreapplicationuis/SysAp/Inc/SysApPubSubObserver.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApPubSubObserver.h Wed Jun 23 18:22:59 2010 +0300 @@ -38,6 +38,15 @@ * @since 2.X */ +enum TSecurityUIsLights + { + ESecurityUIsLightsUninitialized = 0, + ESecurityUIsLightsLockOnRequest, + ESecurityUIsLightsQueryOnRequest, + ESecurityUIsLightsLockOffRequest, + ESecurityUIsLightsLastValue + }; + class CSysApPubSubObserver : public CBase, public MSysApPropertyResponder @@ -99,7 +108,7 @@ /** * Handle keys under category KPSUidHWRMFmTx */ -// void HandleHwrmFmTxCategoryL( const TUint aKey, const TInt aValue ); + // void HandleHwrmFmTxCategoryL( const TUint aKey, const TInt aValue ); /** * Handle keys under category KPSUidDataSynchronizationInternalKeys @@ -134,6 +143,9 @@ */ CSysApPubSubObserver( CSysApAppUi& aSysApAppUi ); void ConstructL(); + + void HandleLKeylockEventL( const TUint aKey, const TInt aValue ); + void HandleLightsOnRequestL( const TUint aKey, const TInt aValue ); protected: // From MSysApPropertyResponder @@ -151,8 +163,8 @@ CSysApSubscriber* iInboxStatusSubscriber; // KUidInboxStatusValue CSysApSubscriber* iOutboxStatusSubscriber; // KUidOutboxStatus CSysApSubscriber* iIrdaStatusSubscriber; // KPSUidIrdaStatus - CSysApSubscriber* iGprsStatusSubscriber; // KPSUidGprsStatus - CSysApSubscriber* iWcdmaStatusSubscriber; // KPSUidWcdmaStatus +// CSysApSubscriber* iGprsStatusSubscriber; // KPSUidGprsStatus +// CSysApSubscriber* iWcdmaStatusSubscriber; // KPSUidWcdmaStatus CSysApSubscriber* iLocationGlobalPrivacySubscriber; // KPSUidLocationGlobalPrivacy CSysApSubscriber* iRestoreBackupSubscriber; // KUidBackupRestoreKey @@ -160,11 +172,11 @@ CSysApSubscriber* iSimChangedSubscriber; // KPSSimChanged // Category KHWRMFmTxStatus -// CSysApSubscriber* iFmTxStatusSubscriber; // KPSUidHWRMFmTx + // CSysApSubscriber* iFmTxStatusSubscriber; // KPSUidHWRMFmTx -// TInt iPreviousFmTxPSValue; + // TInt iPreviousFmTxPSValue; -// CSysApRemConObserver* iFmTxRemConObserver; + // CSysApRemConObserver* iFmTxRemConObserver; // Category KPSUidCoreApplicationUIs @@ -238,6 +250,13 @@ * Own. */ CSysApSubscriber* iSmsPhoneStoreSubscriber; + + CSysApSubscriber* iKeylockEventSubscriber; + + CSysApSubscriber* iLightsOnRequestSubscriber; + + CSysApSubscriber* iPowerMenuCustomDialogSubscriber; + }; #endif // SYSAPPUBSUBOBSERVER_H diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApShutdownImage.h --- a/coreapplicationuis/SysAp/Inc/SysApShutdownImage.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApShutdownImage.h Wed Jun 23 18:22:59 2010 +0300 @@ -131,6 +131,7 @@ */ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); + CFbsBitmap* ReadSVGL (TFileName aFileName); private: // Data //Used for showing user selected image diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/SysApTaskList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/SysAp/Inc/SysApTaskList.h Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2005 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 SYSAPTASKLIST_H +#define SYSAPTASKLIST_H + +// INCLUDES + +#include +#include + +// CLASS DECLARATION + +/** +* Class for finding out about running applications. +* This class specialises in locating and identifying root applications, +* those applications who do not have any parent window group. +* It can be used along-side TApaTaskList. +* +* @since Series 60 3.0 +*/ +class CSysApTaskList : public CBase + { +public: + /** + * Factory function + * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() + * @return a new fully constructed instance of CSysApTaskList + */ + static CSysApTaskList* NewL(RWsSession& aWsSession); + /** + * Factory function + * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() + * @return a new fully constructed instance of CSysApTaskList, which is on the cleanup stack + */ + static CSysApTaskList* NewLC(RWsSession& aWsSession); + /** + * Destructor. + */ + ~CSysApTaskList(); + + /** + * Refresh the window group array + */ + void UpdateListL(); + /** + * Accessor for the window group array + * @return an array containing the window groups of running applications. + */ + const RArray& WgArray() const; + + /** + * Find an application with the requested UID 3, which is running as a root application + * @param aAppUid the UID 3 of the target application. + * @return a TApaTask which refers to the running instance of the application. + * if the application is not running, the TApaTask's Exists() function will return EFalse. + */ + TApaTask FindRootApp(TUid aAppUid) const; + /** + * Query whether an application's window group is running as a root application. + * @param aWgId the window group identifier of the target application. + * @return ETrue if this window group is running as a root window group. + */ + TBool IsRootWindowGroup(TInt aWgId) const; + + /** + * Find the parent window group. If there is no parent, 0 is returned. + * @param aWgId the window group id that you want to find the parent of. + * @return The window group id of the parent, or 0 if there is no parent. + */ + TInt FindParentWgId(TInt aWgId) const; + /** + * Find the child window group. If there is no child, 0 is returned. + * @param aWgId the window group id that you want to find the child of. + * @return The window group id of the child, or 0 if there is no child. + */ + TInt FindChildWgId(TInt aWgId) const; + +private: + CSysApTaskList(RWsSession& aWsSession); + void ConstructL(); + +private: + RWsSession& iWs; + RArray iWgs; + }; + +#endif diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/hbdevicepowermenusymbian.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/SysAp/Inc/hbdevicepowermenusymbian.h Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,71 @@ +/* + * 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: + * + */ + +#ifndef HBDEVICEPOWERMENUSYMBIAN_H +#define HBDEVICEPOWERMENUSYMBIAN_H + +#if defined(__SYMBIAN32__) || defined(SYMBIAN) || defined(HB_DOXYGEN) + +#include +#include +#include +#include +#include +#include +#include "SysApAppUi.h" + +class CHbDevicePowerMenuPrivate; + +class CHbDevicePowerMenuSymbian : public CBase +{ +public: + + static CHbDevicePowerMenuSymbian* NewL(CSysApAppUi& aSysApServer ); + virtual ~CHbDevicePowerMenuSymbian(); + + //Displays Dialog + void ShowL(); + //Getters and Setters + void SetVolume(TInt aVolume); + void SetSilenceMode(TBool aEnable); + void SetOfflineMode(TBool aChecked); + void SetVibrationEnabled(TBool aEnable); + void SetPowerOffEnabled(TBool aEnable); + +private: + + CHbDevicePowerMenuSymbian(CSysApAppUi& aSysApServer); + void ConstructL(); + +private: + friend class CHbDevicePowerMenuPrivate; + //Used to set master Volume/Vibrate/Silence Mode in Control Panel + MProfileEngineExtended2* iProfileEngine; + //Used to Set and Get OfflineMode to and from Control Panel + CRepository* iCenrepOffline; + //Used to Get Master Volume/Vibrate/Silence Mode in Control Panel + CRepository* iCenrepProfile; + //Used to handle ShutDown + CSysApAppUi& iSysApServer; + CHbDevicePowerMenuPrivate* iPowerMenuPrivate; +}; + +#endif // defined(__SYMBIAN32__) || defined(SYMBIAN) || defined(HB_DOXYGEN) + +#endif // HBDEVICEPOWERMENUSYMBIAN_H + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/sysapaudioroutingobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/SysAp/Inc/sysapaudioroutingobserver.h Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007 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: Observes audio output routing changes +* +*/ + + +#ifndef SYSAPAUDIOROUTINGONBSERVER_H +#define SYSAPAUDIOROUTINGONBSERVER_H + +#include +class CSysApAppUi; + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class CSysApAudioRoutingObserver : public CBase, + public MTelephonyAudioRoutingObserver + { + +public: + + /** + * Symbian two-phased constructor. + * + * @param aSysApAppUi reference to System Application's application UI class + */ + static CSysApAudioRoutingObserver* NewL( CSysApAppUi& aSysApAppUi ); + + /** + * Destructor. + */ + virtual ~CSysApAudioRoutingObserver(); + + /** + * Returns whether audio output is routed to IHF. + * + * @since S60 3.2 + * @return TBool ETrue audios routed to IHF + * EFalse audios not routed to IHF. + */ + TBool IhfEnabled() const; + +private: // from MTelephonyAudioRoutingObserver + /** + * Signals that available audio outputs have changed. + * + * @since S60 3.2 + * @param CTelephonyAudioRouting& aTelephonyAudioRouting reference. + * @see MTelephonyAudioRoutingObserver::AvailableOutputsChanged + */ + virtual void AvailableOutputsChanged( CTelephonyAudioRouting& aTelephonyAudioRouting); + + /** + * Signals that current output has changed. + * + * @since 60 3.2 + * @param CTelephonyAudioRouting& aTelephonyAudioRouting reference. + * @see MTelephonyAudioRoutingObserver::OutputChanged + */ + virtual void OutputChanged( CTelephonyAudioRouting& aTelephonyAudioRouting); + + /** + * Signals that CTelephonyAudioRouting::SetOutputL request issued by this + * application (on CTelephonyAudioRouting instance) was serviced by the + * Adaptation. + * + * @since S60 3.2 + * @param CTelephonyAudioRouting& aTelephonyAudioRouting reference. + * @param aError KErrNone if output requested by application is set, else + * system-wide error code. + * @see MTelephonyAudioRoutingObserver::SetOutputComplete + */ + virtual void SetOutputComplete( CTelephonyAudioRouting& aTelephonyAudioRouting, TInt aError); + +private: + + /** + * C++ default constructor. + */ + CSysApAudioRoutingObserver(); + + /** + * Constructor. + * + * @param aSysApAppUi reference to System Application's application UI class + */ + CSysApAudioRoutingObserver( CSysApAppUi& aSysApAppUi ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + +private: // data + + /** + * Telephony audio routing instance. + * Own. + */ + CTelephonyAudioRouting* iTelephonyAudioRouting; + + /** + * System Application application UI class. + */ + CSysApAppUi& iSysApAppUi; + + }; + + +#endif // SYSAPAUDIOROUTINGONBSERVER_H diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/sysapbatteryinfocontroller.h --- a/coreapplicationuis/SysAp/Inc/sysapbatteryinfocontroller.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/sysapbatteryinfocontroller.h Wed Jun 23 18:22:59 2010 +0300 @@ -22,7 +22,7 @@ #include class CBSUtil; -class CBatteryPopupControl; +// class CBatteryPopupControl; /** * Controller for enhanced battery information. @@ -151,7 +151,7 @@ * Battery popup control. * Own. */ - CBatteryPopupControl* iBatteryPopup; + // CBatteryPopupControl* iBatteryPopup; }; diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/sysapdefaultkeyhandler.h --- a/coreapplicationuis/SysAp/Inc/sysapdefaultkeyhandler.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/sysapdefaultkeyhandler.h Wed Jun 23 18:22:59 2010 +0300 @@ -21,10 +21,13 @@ #include #include -#include +//#include +class RWindowGroup; class MSysapCallback; -class RAknKeylock2; + +//class RAknKeylock2; +//class CSysApAppUi; /** @@ -49,7 +52,7 @@ * @param aCallback reference to System Application callback interface. * @return pointer to a new instance of CSysApDefaultKeyHandler. */ - static CSysApDefaultKeyHandler* NewL( MSysapCallback& callback ); + static CSysApDefaultKeyHandler* NewL(MSysapCallback& callback); /** * Destructor. @@ -85,7 +88,7 @@ * * @param aCallback reference to System Application callback interface. */ - CSysApDefaultKeyHandler( MSysapCallback& callback ); + CSysApDefaultKeyHandler(MSysapCallback& callback ); private: @@ -162,7 +165,10 @@ TBool DoShowKeysLockedNote(); private: // data - + + // Our window group from SysappUi + // RWindowGroup& iRootWindowGroup; + /** * Reference to callback object. */ @@ -182,7 +188,7 @@ * Pointer to sysap-owned RAknKeylock2* * Not own. */ - RAknKeylock2* iKeylock; +// RAknKeylock2* iKeylock; /** * Handle of the captured camera key event. @@ -222,7 +228,7 @@ /** * Avkon UI Server */ - RAknUiServer iAknUiServer; +// RAknUiServer iAknUiServer; }; diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Inc/sysapkeymanagement.h --- a/coreapplicationuis/SysAp/Inc/sysapkeymanagement.h Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/sysapkeymanagement.h Wed Jun 23 18:22:59 2010 +0300 @@ -88,6 +88,7 @@ */ RArray iUpAndDownKeyHandles; //Handles of keys when capturing them + RArray iLongKeyPressHandle ; //Handles long key when capturing them /** * Tells if the plugin is a key provider plugin (plugin version 2) */ diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/BtSap/SysApBtSapControllerImpl.cpp --- a/coreapplicationuis/SysAp/Src/BtSap/SysApBtSapControllerImpl.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/BtSap/SysApBtSapControllerImpl.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -26,7 +26,7 @@ #include #include #include -#include +//#include MSysApBtSapController* CreateSysApBtSapControllerL( CSysApAppUi& aSysApAppUi ) @@ -162,7 +162,7 @@ // No RF available so signal bars should be same as in offline mode. iSysApAppUi.IgnoreZeroNetworkBarNotifications(ETrue); - TRAP( err, iSysApAppUi.UpdateSignalBarsL( KAknSignalOffLineMode ) ); +// TRAP( err, iSysApAppUi.UpdateSignalBarsL( KAknSignalOffLineMode ) ); iSysApAppUi.SetNetworkConnectionAllowed( ECoreAppUIsNetworkConnectionNotAllowed ); @@ -183,7 +183,8 @@ iFinalizeDisconnectNeeded = EFalse; iSysApAppUi.IgnoreZeroNetworkBarNotifications(EFalse); - if ( iSysApAppUi.ActiveProfileId() == KOfflineModeProfileId ) +// if ( iSysApAppUi.ActiveProfileId() == KOfflineModeProfileId ) + if(0) { if ( iSwitchingToOffline ) { diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/CenRepObservers/SysApCenRepLogsObserver.cpp --- a/coreapplicationuis/SysAp/Src/CenRepObservers/SysApCenRepLogsObserver.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/CenRepObservers/SysApCenRepLogsObserver.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -154,9 +154,9 @@ if ( iSimChangedCheckDone && iUiReady ) { - TInt newState( iMissedCallsValue > 0 ? EAknIndicatorStateOn : EAknIndicatorStateOff ); +// TInt newState( iMissedCallsValue > 0 ? EAknIndicatorStateOn : EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( EAknIndicatorMissedCalls, newState ); +// iSysApAppUi.SetIndicatorStateL( EAknIndicatorMissedCalls, newState ); } } diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/OfflineModeController/SysApOfflineModeControllerImpl.cpp --- a/coreapplicationuis/SysAp/Src/OfflineModeController/SysApOfflineModeControllerImpl.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/OfflineModeController/SysApOfflineModeControllerImpl.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -54,9 +54,9 @@ { TRACES( RDebug::Print( _L("CSysApOfflineModeController::ConstructL") ) ); // Check the active profile - TInt activeProfile( iSysApAppUi.ActiveProfileId() ); - activeProfile = iSysApAppUi.ActiveProfileId(); - if ( activeProfile == KOfflineModeProfileId ) +// TInt activeProfile( iSysApAppUi.ActiveProfileId() ); +// activeProfile = iSysApAppUi.ActiveProfileId(); +// if ( activeProfile == KOfflineModeProfileId ) { iOfflineModeActive = ETrue; } @@ -104,7 +104,7 @@ if ( err ) { - iSysApAppUi.RestoreProfileL( EFalse ); +// iSysApAppUi.RestoreProfileL( EFalse ); iSysApAppUi.ShowUiNoteL( ECannotActivateOfflineModeNote ); } else @@ -144,7 +144,7 @@ if ( err ) { - iSysApAppUi.RestoreProfileL( ETrue ); +// iSysApAppUi.RestoreProfileL( ETrue ); iSysApAppUi.ShowUiNoteL( ECannotDeactivateOfflineModeNote ); } else @@ -233,6 +233,7 @@ TInt btToBeActivated = iSysApAppUi.CenRepController().GetInt( KCRUidCoreApplicationUIsSysAp, KSysApBtStatusBeforeOfflineMode, &err ); + if ( err ) { TRACES( RDebug::Print( _L("CSysApOfflineModeController::BtActiveBeforeOfflineMode: ERROR: %d" ), err ) ); @@ -241,6 +242,7 @@ else { return ( TBool ) btToBeActivated; + //return ETrue; } } @@ -253,6 +255,7 @@ return BtActiveBeforeOfflineMode(); } + // End of File diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApApp.cpp --- a/coreapplicationuis/SysAp/Src/SysApApp.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApApp.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -40,6 +40,8 @@ CApaDocument* CSysApApp::CreateDocumentL() { return new( ELeave ) CSysApDocument( *this ); + + // return CSysApDocument::NewL(*this); } // ===================== OTHER EXPORTED FUNCTIONS ============================ diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApAppUi.cpp --- a/coreapplicationuis/SysAp/Src/SysApAppUi.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApAppUi.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -14,178 +14,57 @@ * Description: CSysApAppUi implementation. * */ - - // INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#include +#include "sysapappui.h" +#include "coreapplicationuisprivatepskeys.h" +#include +//#include +#include +#include +#include +#include +#include +#include #include -#include - -#include -#include "coreapplicationuisprivatepskeys.h" -#include -#include -#include +#include +#include +//#include +#include +#include -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS - #include -#else - #include - #include - #include -#endif //SYMBIAN_ENABLE_SPLIT_HEADERS - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "SysApSimChanged.h" - -#include -#include "SysApLightsController.h" - +//#include "SysApWsClient.h" +#include "SysApFeatureManager.h" +#include "SysApNspsHandler.h" #include "SysApPubSubObserver.h" -#include "SysApProfileObserver.h" - +#include "sysapdefaultkeyhandler.h" +#include "SysApStartupController.h" +#include "MSysApOfflineModeController.h" +#include "SysApCenRepController.h" #include "sysapcenreplightsettingsobserver.h" #include "SysApCenRepLogsObserver.h" #include "SysApCenRepBTObserver.h" #include "SysApCenRepHacSettingObserver.h" -#include "SysApCenRepController.h" -#include "coreapplicationuisprivatecrkeys.h" -#include "coreapplicationuisprivatepskeys.h" -#include - -#include "SysApStartupController.h" -#include "SysApConnectionMonitorObserver.h" -#include "SysApPowerKeyMenuObserver.h" -#include "SysApSsSettingsObserver.h" -#include "SysApAppUi.h" -#include "SysApShutdownImage.h" -#include "SysApEtelConnector.h" - -#include "SysApApp.h" -#include "SysApMsgSimMemLowQuery.h" -#include "SysApNspsHandler.h" -#include "SysApWaitNote.h" -#include "SysApConfirmationQuery.h" -#include "SysApFeatureManager.h" -#include "SysApSubscriber.h" -#include "MSysApOfflineModeController.h" +#include "sysapaudioroutingobserver.h" +#include "sysapbatteryinfocontroller.h" +#include "SysApSimChanged.h" +#include "MSysApBtSapController.h" #include "MSysApBtController.h" -#include "MSysApBtSapController.h" -#include "MSysApLocationPrivacyIndicator.h" #include "MSysApUsbIndicator.h" - -#include - -#include "SysApShutdownAnimation.h" - -//#include -//#include -//#include -//#include "sysapcenrepfmtxobserver.h" - -#include "SysApKeySndHandler.h" - -#include // KIrdaPropertyCategory // KIrdaStatus - -#include - -// POC launching -#include -#include - -#include // KUidPhonePwr - -#include // WLan indicator - -#include #include "sysapkeymanagement.h" - -#include "SysApMediatorObserver.h" +#include "SysApShutdownImage.h" -#include -#include "aknSDData.h" - -#include -#include - -#include "sysapdefaultkeyhandler.h" -#include "sysapaudioroutingobserver.h" -#include "sysapcenrepcallforwardingobserver.h" -#include "sysapcenrepmsgwaitingobserver.h" - -#ifdef RD_MULTIPLE_DRIVE - #include "sysapdrivelist.h" - #include "sysapdriveunlockhandler.h" - #include "sysapdriveejecthandler.h" -#endif // RD_MULTIPLE_DRIVE - -#include "sysappsmcontroller.h" -#include "sysapbatteryinfocontroller.h" - -#include +#include +#include +#include +#include -#include // USB transfer modes -#include -#include -#include -#include - -// CONSTANTS -const TInt KPowerKeyMenuSelectionCancelled( -1 ); -const TInt KPowerKeyMenuSelectionSwitchOff( 0 ); +class CHbSymbianVariant; const TInt KModifierMask( 0 ); -const TInt KDelayBeforeShuttingDownInAlarmAndChargingStates( 500000 ); -const TInt KDelayBeforeShowingGprsSuspendedNote( 500000 ); -const TInt KDelayBeforeNextScanningRound( 1000000 ); -const TInt KActiveProfile( 0 ); //The value of ActiveProfile for accessory default profile selection in GS/SD. -const TInt KProfileListInitialIndex( 0 ); -const TInt KMaxProfileNameLength( 64 ); -const TInt KTimeToShowShutdownNote( 2000000 ); //2 seconds time for Goodbye note to show before being shutdown -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION -const TInt KCoefficientToMakeMicroToMilliSeconds = 1000; -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - -/* ENABLE ANIMATION: Add id of background image. - Example: const TInt KBackgroundImageID = EMbmSysapQgn_graf_startup_bg; - If there is no image defined, clear screen is used.*/ -const TInt KBackgroundImageID = 0; -#ifndef RD_MULTIPLE_DRIVE -const TInt32 KAutolockAppUid = 0x100059B5; -const TInt KFileManagerAppUid = 0x101F84EB; -#endif // RD_MULTIPLE_DRIVE -const TInt KCoefficientKhzToMhz = 1000; -const TInt KDecimalsInMhzFrequency = 2; - _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); +const TInt KDelayBeforeNextScanningRound( 1000000 ); // ============================ MEMBER FUNCTIONS ============================== @@ -193,61 +72,25 @@ // CSysApAppUi::CSysApAppUi() // ---------------------------------------------------------------------------- -CSysApAppUi::CSysApAppUi() : - iSysApCenRepLogsObserver( NULL ), - iSysApCenRepHacSettingObserver( NULL ), - iSysApPowerKeyMenuObserver( NULL ), - iSysApShutdownImage( NULL ), - iSysApConfirmationQuery( NULL ), - iSysApConfirmationQueryForRestart( NULL ), - iSignalNotify( NULL ), -#ifndef RD_MULTIPLE_DRIVE - iMemoryCardDialog( 0 ), -#endif // RD_MULTIPLE_DRIVE - iProfileNote( NULL ), - iProfileNoteId( 0 ), - iPowerKeyPopupMenuActive( EFalse ), - iDisablePowerkeyMenu( EFalse ), - iDeviceLockEnabled( EFalse ), - iKeyLockEnabled( EFalse ), - iShowkeypadActivatedNoteAfterSoftReject( EFalse ), - iEmergencyCallActive( EFalse ), - iSimChangedDone( EFalse ), - iResourcesFreed( EFalse ), -#ifndef RD_MULTIPLE_DRIVE - iHideFirstBeep( ETrue ), -#endif // RD_MULTIPLE_DRIVE - iShutdownStarted( EFalse ), - iIgnoreAccessorySpecificProfileChanges( ETrue ), - iAccessoryJustConnected( EFalse ), - iHandleNextProfileEvent( ETrue ), - iActivateBt( EFalse ), - iDeactivateBt( EFalse ), - iGprsActivated( EFalse ), - iGprsSuspended( EFalse ), - iCallActivated( EFalse ), - iGprsSuspendedNoteShown( EFalse ), - iMMCEjectUsed( EFalse ), -#ifndef RD_MULTIPLE_DRIVE - iMMCPowerMenuEjectUsed( EFalse ), - iMMCInserted( EFalse ), -#endif // RD_MULTIPLE_DRIVE - iTimer( NULL ), - iSapTimer( NULL ), -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - iAnimTimer( NULL ), -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - iSysApTimer( NULL ), -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - iAnimationShowingTime( 0 ), -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - iShutdownContinued( EFalse ), - iSysApAudioRoutingObserver( NULL ), - iSysApCenRepCallForwardingObserver( NULL ), - iSysApCenRepMsgWaitingObserver( NULL ), - iKeyBoardRepeatCount(-1) - { - TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) ); +CSysApAppUi::CSysApAppUi() + :iSysApShutdownImage(NULL), + iPowerMenuDialog(NULL), + iDeviceLockEnabled(EFalse), + iKeyLockEnabled(EFalse), + iPowerKeyPopupMenuActive(EFalse), + iResourcesFreed (EFalse), + iShutdownStarted (EFalse), + iSysApAudioRoutingObserver (NULL), + iSysApBatteryInfoController (NULL), + iSysApPsmController(NULL), + iSapTimer (NULL), + iSysApCenRepLogsObserver (NULL), + iSysApUsbIndicatorController(NULL), + iKeyguardController (NULL), + iKeyLockOnBeforeCall (EFalse), + iCheckLongPowerKeyEvent (EFalse) + { + TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) ); } // ---------------------------------------------------------------------------- @@ -257,61 +100,59 @@ void CSysApAppUi::ConstructL() { TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: START") ) ); - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying BaseConstructL( EAknEnableSkin )") ) ); - BaseConstructL( EAknEnableSkin ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying BaseConstructL()") ) ); + BaseConstructL(); TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: BaseConstructL() OK") ) ); - - - /*SysAp is set as system application (Symbian terminology). This means some special privilege compared - to other applications. For example it does not get closed when system is asked to close applications - */ iEikonEnv->SetSystem( ETrue ); iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); - - static_cast(iEikonEnv->EikAppUi())->KeySounds()->PushContextL( R_AVKON_SILENT_SKEY_LIST ); - + RThread().SetProcessPriority( EPriorityForeground ); - - /*SysAp does not have any visible Status pane. An exception will be Charging state - where SysAp shows Status Pane as it is the only running application. - */ + TInt mode; User::LeaveIfError( RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ) ); - - if( mode == EStartupModeCharging || mode == EStartupModeAlarm ) - { - SetStatusPaneLayoutL( - mode == EStartupModeCharging ? ESysApCharging : ESysApAlarm ); - - SetKeyEventFlags( - CAknAppUiBase::EDisableSendKeyShort | - CAknAppUiBase::EDisableSendKeyLong ); - } - else - { - SetStatusPaneLayoutL( ESysApNormal ); - } - + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KPSGlobalStartupMode = %d"), mode ) ); + + //SysAp needs to capture PowerKey events because it handles all functionality related to that + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CEikApplication::RootWin()") ) ); + RWindowGroup groupWin = iCoeEnv->RootWin(); + User::LeaveIfError ( iCapturedEKeyPowerOff = groupWin.CaptureKey( EKeyPowerOff, KModifierMask, KModifierMask ) ); + User::LeaveIfError ( iCapturedEKeyPowerOffUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyDevice2, KModifierMask, KModifierMask ) ); + + TRACES ( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApDefaultKeyHandler::NewL()") ) ); + iSysApDefaultKeyHandler = CSysApDefaultKeyHandler::NewL(*this); + + // Define P&S keys "owned" by SysAp + RProperty::Define( KPSUidUikon, KUikMMCInserted, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); + //initially assuming that the memory card is not inserted + RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); + TDriveInfo driveInfo; + TInt driveNumber; + TInt err; + RFs& fileServer = iEikonEnv->FsSession(); + for ( driveNumber = EDriveD; driveNumber < EDriveZ; driveNumber++ ) + { + err = fileServer.Drive(driveInfo,driveNumber); + if(driveNumber == EDriveF && err == KErrNone && driveInfo.iType == EMediaHardDisk && driveInfo.iDriveAtt & KDriveAttRemovable) + { + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: err = %d, driveInfo.iType = %d, driveInfo.iDriveAtt %d, KDriveAttRemovable = %d "),err,driveInfo.iType,driveInfo.iDriveAtt,KDriveAttRemovable) ); + RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); + break; // Memory card drive found... + } + } + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApFeatureManager::NewL()") ) ); iSysApFeatureManager = CSysApFeatureManager::NewL(); - + // Setup USB charging detector - iSysApUsbChargerDetector.EnableUsbCharging( - iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && - iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ); - - // Construct notifiers that are used frequently or in OOM situations. - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CAknBatteryNotify::NewL()") ) ); - iBatteryNotify = CAknBatteryNotify::NewL(); - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CAknSignalNotify::NewL()") ) ); - iSignalNotify = CAknSignalNotify::NewL(); - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying new ( ELeave ) CSysApMsgSimMemLowQuery") ) ); - iSysApMsgSimMemLowQuery = new( ELeave ) CSysApMsgSimMemLowQuery( iSysApFeatureManager->CoverDisplaySupported() ); - + iSysApUsbChargerDetector.EnableUsbCharging( + iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && + iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApPubSubObserver::NewL()") ) ); iSysApPubSubObserver = CSysApPubSubObserver::NewL( *this ); + RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, ECoreAppUIsPocIndicatorUninitialized ); RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); @@ -324,43 +165,6 @@ RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, ECoreAppUIsVideoSharingIndicatorUninitialized ); - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApAccessoryObserver::NewL()") ) ); - iSysApAccessoryObserver = CSysApAccessoryObserver::NewL( *this ); - - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepController::NewL()") ) ); - iSysApCenRepController = CSysApCenRepController::NewL(); - - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepLightSettingsObserver::NewL") ) ); - iSysApCenRepLightSettingsObserver = CSysApCenRepLightSettingsObserver::NewL( *this ); - - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepBtObserver::NewL") ) ); - iSysApCenRepBtObserver = CSysApCenRepBtObserver::NewL( *this ); - -/* if ( iSysApFeatureManager->FmTxSupported() ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepFmTxObserver::NewL") ) ); - iSysApCenRepFmTxObserver = CSysApCenRepFmTxObserver::NewL( *this ); - } -*/ - // Define P&S keys "owned" by SysAp - RProperty::Define( KPSUidUikon, KUikMMCInserted, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); - //initially assuming that the memory card is not inserted - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - TDriveInfo driveInfo; - TInt driveNumber; - TInt err; - RFs& fileServer = iEikonEnv->FsSession(); - for ( driveNumber = EDriveD; driveNumber < EDriveZ; driveNumber++ ) - { - err = fileServer.Drive(driveInfo,driveNumber); - if(driveNumber == EDriveF && err == KErrNone && driveInfo.iType == EMediaHardDisk && driveInfo.iDriveAtt & KDriveAttRemovable) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: err = %d, driveInfo.iType = %d, driveInfo.iDriveAtt %d, KDriveAttRemovable = %d "),err,driveInfo.iType,driveInfo.iDriveAtt,KDriveAttRemovable) ); - RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); - break; // Memory card drive found... - } - } - RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsDisableKeyguard, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsSoftReject, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); @@ -381,717 +185,741 @@ // Initialize P&S keys "owned" by SysAp RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, ECoreAppUIsHideAlarmUninitialized ); - + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApAccessoryObserver::NewL()") ) ); + iSysApAccessoryObserver = CSysApAccessoryObserver::NewL( *this ); + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepController::NewL()") ) ); + iSysApCenRepController = CSysApCenRepController::NewL(); + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepLightSettingsObserver::NewL") ) ); + iSysApCenRepLightSettingsObserver = CSysApCenRepLightSettingsObserver::NewL( *this ); + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepBtObserver::NewL") ) ); + iSysApCenRepBtObserver = CSysApCenRepBtObserver::NewL( *this ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApStartupController::NewL()") ) ); iSysApStartupController = CSysApStartupController::NewL( *this, iSysApFeatureManager->OfflineModeSupported() ); + iActiveProfileBeforeOfflineMode = iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode ); + + iSysApFeatureManager->FeatureVariationCheckDone(); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApLightsController::NewL()") ) ); iSysApLightsController = CSysApLightsController::NewL( *this, iSysApCenRepLightSettingsObserver->GetLightsTimeout(), iSysApFeatureManager->CoverDisplaySupported() ); - - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApEtelConnector::NewL()") ) ); - iSysApEtelConnector = CSysApEtelConnector::NewL( *this ); - - //SysAp needs to capture PowerKey events because it handles all functionality related to that - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CEikApplication::RootWin()") ) ); - RWindowGroup groupWin = iCoeEnv->RootWin(); - User::LeaveIfError ( iCapturedEKeyPowerOff = groupWin.CaptureKey( EKeyPowerOff, KModifierMask, KModifierMask ) ); - User::LeaveIfError ( iCapturedEKeyPowerOffUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyDevice2, KModifierMask, KModifierMask ) ); - - TRACES ( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApDefaultKeyHandler::NewL()") ) ); - iSysApDefaultKeyHandler = CSysApDefaultKeyHandler::NewL( *this ); - - - if ( iSysApFeatureManager->GripNotSupported() ) - { - RProperty::Set( KPSUidHWRM, KHWRMGripStatus, EPSHWRMGripOpen ); - } - -#ifndef RD_MULTIPLE_DRIVE - if ( iSysApFeatureManager->MmcSupported() ) - { - iSysApMMCObserver = CSysApMMCObserver::NewL( this, &iEikonEnv->FsSession(), iSysApFeatureManager->MmcHotSwapSupported() ); - } -#else // RD_MULTIPLE_DRIVE - iSysApDriveList = CSysApDriveList::NewL( iEikonEnv->FsSession() ); - if ( iSysApFeatureManager->MmcSupported() ) - { - iSysApMMCObserver = CSysApMMCObserver::NewL( - iEikonEnv->FsSession(), *iSysApDriveList, *this, iSysApFeatureManager->MmcHotSwapSupported() ); - iSysApDriveUnlockHandler = CSysApDriveUnlockHandler::NewL( - *iSysApDriveList, *this, iSysApFeatureManager->MemoryCardLockSupported() ); - iSysApDriveEjectHandler = CSysApDriveEjectHandler::NewL( - *iSysApDriveList, *this, iEikonEnv->FsSession() ); - } -#endif // RD_MULTIPLE_DRIVE - + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying CreateSysApOfflineModeControllerL()") ) ); + iSysApOfflineModeController = CreateSysApOfflineModeControllerL( *this ); + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying DoInitialSwStateCheckL()") ) ); + iSysApStartupController->DoInitialSwStateCheckL(); + + TRACES( RDebug::Print( _L("CCSysApAppUi::ConstructL trying CSysApCenRepHacSettingObserver::NewL") ) ); + iSysApCenRepHacSettingObserver = CSysApCenRepHacSettingObserver::NewL( *this ); + //Instantiate the KEF plugin manager - //Trap constuction, since Sysap may live without iSysApKeyManagement + //Trap constuction, since Sysap may live without iSysApKeyManagement TRAPD(keyManagementErr, iSysApKeyManagement=CSysApKeyManagement::NewL(CCoeEnv::Static()->RootWin(), *this)); if (keyManagementErr) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : CSysApKeyManagement::NewL returns error=%d"), keyManagementErr ) ); - } + { + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : CSysApKeyManagement::NewL returns error=%d"), keyManagementErr ) ); + } + + iKeyguardController = CKeyguardAccessApi::NewL(); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApShutdownImage::NewL()") ) ); + iSysApShutdownImage = CSysApShutdownImage::NewL();//NULL; // + + RProperty::Define( KPSUidCoreApplicationUIs,KCoreAppUIsPowerMenuCustomDialogStatus, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); + RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPowerMenuCustomDialogStatus, ECoreAppUIsPowerMenuCustomDialogUninitialized ); + + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) ); + } - iSysApFeatureManager->FeatureVariationCheckDone(); - - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApProfileObserver::NewL()") ) ); - iSysApProfileObserver = CSysApProfileObserver::NewL( *this ); +// ---------------------------------------------------------------------------- +// CSysApAppUi::FreeResources() +// ---------------------------------------------------------------------------- - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying MProfileEngine* CreateProfileEngineL()") ) ); - iProfileEngine = CreateProfileEngineL( &( iEikonEnv->FsSession() ) ); +void CSysApAppUi::FreeResources() + { + TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources") ) ); + delete iSysApBatteryInfoController; + delete iSysApPsmController; + delete iSysApAudioRoutingObserver; - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying CreateSysApOfflineModeControllerL()") ) ); - iSysApOfflineModeController = CreateSysApOfflineModeControllerL( *this ); - - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying DoInitialSwStateCheckL()") ) ); - iSysApStartupController->DoInitialSwStateCheckL(); - - iActiveProfileBeforeOfflineMode = iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode ); + if ( iSapTimer ) + { + iSapTimer->Cancel(); + delete iSapTimer; + } + //Powermenu + if (iPowerMenuDialog!=NULL) + { + //PowerMenu already exist + delete iPowerMenuDialog; + iPowerMenuDialog = NULL; + } + + RWindowGroup groupWin = iCoeEnv->RootWin(); + groupWin.CancelCaptureKey( iCapturedEKeyPowerOff ); + groupWin.CancelCaptureKeyUpAndDowns( iCapturedEKeyPowerOffUpAndDowns ); + + delete iSysApDefaultKeyHandler; + delete iSysApCenRepLightSettingsObserver; + delete iSysApCenRepBtObserver; + delete iSysApCenRepHacSettingObserver; + delete iSysApCenRepController; - // Initialize animdll for handling side volume keys - // (needed before normal mode in case emergency number is dialed from PIN query) - iSysApKeySndHandler = CSysApKeySndHandler::NewL(iEikonEnv->WsSession()); + delete iSysApPubSubObserver; + + delete iSysApLightsController; + delete iSysApFeatureManager; + + delete iSysApCenRepLogsObserver; + delete iSysApOfflineModeController; + + delete iSysApUsbIndicatorController; + delete iKeyguardController; + + delete iSysApKeyManagement; + iSysApKeyManagement = NULL; + + REComSession::FinalClose(); + iResourcesFreed = ETrue; + TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources:END") ) ); + } - // Initialize shutdown image (needed by nspshandler) - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApShutdownImage::NewL()") ) ); - iSysApShutdownImage = CSysApShutdownImage::NewL(); +// --------------------------------------------------------------------------- +// CStartupAppUi::PrepareToExit() +// --------------------------------------------------------------------------- +void CSysApAppUi::PrepareToExit() + { + TRACES("CSysApAppUi::PrepareToExit()"); + CEikAppUi::PrepareToExit(); + } + - // Initialize nsps handler. Needed for proper lights control during PIN query. - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApNspsHandler::NewL") ) ); - iSysApNspsHandler = CSysApNspsHandler::NewL( iEikonEnv->WsSession(), iSysApShutdownImage->ShutdownCoeControlWindow() ); +// ---------------------------------------------------------------------------- +// CSysApAppUi::StateOfProperty() +// ---------------------------------------------------------------------------- +TInt CSysApAppUi::StateOfProperty( const TUid& aCategory, const TUint aKey ) const + { + TInt err( KErrNone ); + TInt value( 0 ); + err = RProperty::Get( aCategory, aKey, value ); + if ( err ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::StateOfProperty. RProperty::Get: err=%d"), err ) ); + return err; + } + return value; + } -#ifdef RD_LIGHT_CONTROL_CHANGE - // NSPS Plugin has been loaded, inform lights controller that in can activate key event forwarding - iSysApLightsController->KeyEventForwardingReady(); -#endif // RD_LIGHT_CONTROL_CHANGE +// ---------------------------------------------------------------------------- +// CSysApAppUi::OfflineModeActive() +// ---------------------------------------------------------------------------- +TBool CSysApAppUi::OfflineModeActive() + { + if(iSysApOfflineModeController) + { + return iSysApOfflineModeController->OfflineModeActive(); + } + else + { + return EFalse; + } + } - // Create HAC setting observer now because telephony state may change before entering to normal state - TRACES( RDebug::Print( _L("CCSysApAppUi::ConstructL trying CSysApCenRepHacSettingObserver::NewL") ) ); - iSysApCenRepHacSettingObserver = CSysApCenRepHacSettingObserver::NewL( *this ); +// ---------------------------------------------------------------------------- +// CSysApAppUi::GoOnlineL() +// ---------------------------------------------------------------------------- - TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) ); +void CSysApAppUi::GoOnlineL( TBool /* aDoProfileChange */ ) + { + if ( iSysApFeatureManager->OfflineModeSupported() ) + { +// TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: going from off-line into on-line: aDoProfileChange=%d" ), aDoProfileChange ) ); + iActivateBt = iSysApOfflineModeController->MustBtBeActivated(); + iSysApOfflineModeController->SwitchFromOfflineToOnlineModeL(); + TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: iActivateBt = %d" ), iActivateBt ) ); + } } // ---------------------------------------------------------------------------- -// CSysApAppUi::~CSysApAppUi() +// CSysApAppUi::GoOfflineL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::GoOfflineL() + { + if ( iSysApFeatureManager->OfflineModeSupported() ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::GoOfflineL" ) ) ); + iDeactivateBt = ETrue; + iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); + } + } + +#ifndef SYSAP_USE_STARTUP_UI_PHASE +// need to configure the above macro. +#else // SYSAP_USE_STARTUP_UI_PHASE + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleUiReadyAfterBootL() +// Called when startup UI activities has been finished +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleUiReadyAfterBootL() + { + TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL" ) ) ); + TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); + + UpdateBatteryBarsL( state ); + DoSwStateNormalConstructionL(); + HandleAccessoryProfileInStartupL(); + + if ( iSysApPsmController ) + { + if ( iCharging ) // if charger is connected on boot PSM queries may need to be shown + { + HandleChargingStatusL( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); + } + } + + TInt batteryStatus = StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryStatus ); + TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: batteryStatus %d" ), batteryStatus ) ); + if( batteryStatus == EBatteryStatusLow || batteryStatus == EBatteryStatusEmpty ) + { + // low and empty battery states are informed to the user in device startup + HandleBatteryStatusL( batteryStatus ); + } + else if ( iSysApPsmController && !iCharging ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: batteryStatus %d, iCharging %d -> disable partial psm" ), batteryStatus, iCharging ) ); + + iSysApPsmController->BatteryLow( EFalse ); + iSysApPsmController->DoEnablePartialPsm( EFalse ); + } + + if ( ! iSysApUsbIndicatorController ) + { + TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); + if ( usbErr ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: error in constructing USB ind. controller %d" ), usbErr ) ); + } + } + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) +// This method is not called after boot has finished. // ---------------------------------------------------------------------------- +void CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) + { + TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: %d" ), aSwState ) ); + + TRAPD( simChangedErr, DoSimChangedFromPreviousBootL() ); + TRACES( RDebug::Print( _L("CSysApAppUi::DoStateChangedL: simChangedErr = %d" ), simChangedErr ) ); + simChangedErr = simChangedErr; // suppress 'variable not used' warning + LogsObserverL().HandleSimChangedCheckDoneL(); + + if ( iSysApFeatureManager->PowerSaveSupported() ) + { + // create controller before checking battery state, so that power saving can be enabled during boot if needed + if ( !iSysApPsmController ) // created only in first state change + { + iSysApPsmController = CSysApPsmController::NewL( *this ); + } + + // in charger boot explicitly disable partial power save mode + if ( aSwState == RStarterSession::ECharging ) + { + iSysApPsmController->ChargerConnected(); + iSysApPsmController->DoEnablePartialPsm( EFalse ); // disable partial power save now + } + } + + if ( aSwState == RStarterSession::ECharging || aSwState == RStarterSession::EAlarm ) + { + TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); + //Also Charging status will be updated with the following function. + UpdateBatteryBarsL( state ); + } + + if( IsStateNormal() ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL to normal state.") ) ); + + iSysApBtController = CreateSysApBtControllerL( *this ); + iSysApBtSapController = CreateSysApBtSapControllerL( *this ); + + if ( iActivateBt ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Activating BT" ) ) ); + SetBtPowerState( ETrue ); + } + + if ( iDeactivateBt ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Deactivating BT" ) ) ); + SetBtPowerState( EFalse ); + } + + if ( !StarterSession().Handle() ) + { + User::Leave( KErrBadHandle ); + } + +/* if ( !KeyLock().Handle() ) + { + User::Leave( KErrBadHandle ); + } +*/ +#ifdef __SYSAP_MODULE_TEST + ModuleTestShowUiNoteL( _L("SysAp: SW state normal!") ); +#endif + } + + // Allow lights + iSysApLightsController->AllowLightsOn(); + } + +#endif // SYSAP_USE_STARTUP_UI_PHASE + CSysApAppUi::~CSysApAppUi() { TRACES( RDebug::Print( _L("~CSysApAppUi() started") ) ); if( !iResourcesFreed ) - { + { FreeResources(); - - iStarterSession.Close(); - - } - - delete iSysApShutdownImage; - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - if (iSysApShutdownAnimation) - { - RemoveFromStack( iSysApShutdownAnimation ); -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - delete iSysApShutdownAnimation; -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - delete iProfileNote; - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - if( iAnimTimer ) - { - iAnimTimer->Cancel(); - } - delete iAnimTimer; -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - delete iSysApPowerKeyMenuObserver; - - delete iSysApStartupController; - -#ifdef RD_MULTIPLE_DRIVE - iInsertedMemoryCards.Close(); - delete iSysApDriveEjectHandler; - delete iSysApDriveUnlockHandler; - delete iSysApDriveList; -#endif // RD_MULTIPLE_DRIVE - - TRACES( RDebug::Print( _L("~CSysApAppUi() completed") ) ); + } + } + +TBool CSysApAppUi::ResourcesFreed() const + { + return iResourcesFreed; } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleLocationPrivacyIndicatorL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleLocationPrivacyIndicatorL( const TInt aState ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleLocationPrivacyIndicatorL() state=%d"), aState ) ); - if ( iSysApFeatureManager->LocationPrivacySupported() ) - { - // Phase 1. Set all Location Privacy indicators off - if ( iSysApLocationPrivacyIndicator->iIndicatorIdAcceptAll != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll, EAknIndicatorStateOff ); - } - if ( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll, EAknIndicatorStateOff ); - } - if ( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk, EAknIndicatorStateOff ); - } - if ( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy, EAknIndicatorStateOff ); - } - // Phase 2. Set the required Location Privacy indicator on - switch ( aState ) - { - case EPSLocPrivAcceptAll: - if ( iSysApLocationPrivacyIndicator->iIndicatorIdAcceptAll != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdAcceptAll, EAknIndicatorStateOn ); - } - break; - case EPSLocPrivRejectAll: - if ( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll, EAknIndicatorStateOn ); - } - break; - case EPSLocPrivAlwaysAsk: - if ( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk, EAknIndicatorStateOn ); - } - break; - case EPSLocPrivIndividualPrivacy: - if ( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy != KSysApNoIndicator ) - { - SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy, EAknIndicatorStateOn ); - } - break; - default: - break; - } - } +void CSysApAppUi::ShowExampleUiNoteL( const TDesC& noteText )const + { + // QString msg = QString::fromUtf16(aStringPointer.Ptr(),aStringPointer.Length()); + TRACES( RDebug::Print( _L("CSysApAppUi::ShowExampleUiNoteL:: constructing CHbDeviceMessageBoxSymbian:BeGIN") ) ); + CHbDeviceMessageBoxSymbian *note = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation); + CleanupStack::PushL(note); + TRACES( RDebug::Print( _L("CSysApAppUi::ShowExampleUiNoteL:: construction of CHbDeviceMessageBoxSymbian:END") ) ); + // HbMessageBox *note = new HbMessageBox (HbMessageBox ::MessageTypeInformation); + note->SetTextL(noteText); + // note->SetTimeout(HbPopup::NoTimeout); + note->SetTimeout(5); + TRACES( RDebug::Print( _L("CSysApAppUi:: Display of CHbDeviceMessageBoxSymbian::Begin") ) ); + note->ShowL(); + TRACES( RDebug::Print( _L("CSysApAppUi:: Display of CHbDeviceMessageBoxSymbian::End") ) ); + CleanupStack::PopAndDestroy(note); } -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) -// ---------------------------------------------------------------------------- - -TKeyResponse CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) +void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn ) { - if ( ! iShutdownStarted ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d, iIgnoreNextPowerKeyUpEvent:%d, iPowerKeyPopupMenuActive:%d, iLastPowerKeyWasShort:%d, iPowerKeyPopupMenuDismissed:%d"), - aKeyEvent.iCode, aKeyEvent.iScanCode, aType, iIgnoreNextPowerKeyUpEvent, iPowerKeyPopupMenuActive, iLastPowerKeyWasShort, iPowerKeyPopupMenuDismissed ) ); - -#ifdef _DEBUG - // camery latency measurement environment instrumentation, don't remove - if ( aType == EEventKey && aKeyEvent.iCode == EKeyCamera ) - { - TRACES( RDebug::Print( _L("e_KEY_EVENT_SENDING 0") ) ); - } -#endif // _DEBUG - - TKeyResponse response( EKeyWasNotConsumed ); - if (iSysApKeyManagement && aKeyEvent.iCode != EKeyPowerOff && aKeyEvent.iCode != 'E') - { - response = iSysApKeyManagement->HandleKeyEventL(aKeyEvent, aType ); - } - - if( aType == EEventKey ) - { - switch ( aKeyEvent.iCode ) - { -#ifdef _DEBUG - case 'E': //For testing - Exit(); - break; -#endif - case EKeyPowerOff: - //Short power key press - iKeyBoardRepeatCount++; - if( aKeyEvent.iRepeats == 0 ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Short powerkey") ) ); - iLastPowerKeyWasShort = ETrue; - HandleShortPowerKeyPressedL(); - iIgnoreNextPowerKeyRepeats = EFalse; - } - //Long power key press - else if( aKeyEvent.iRepeats > 0 && iKeyBoardRepeatCount >= iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApPowerkeyRepeatcount )) - { - iKeyBoardRepeatCount = -1; - TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Long powerkey") ) ); - iLastPowerKeyWasShort = EFalse; - HandleLongPowerKeyPressedL(); - } - break; - - default: - { - TKeyResponse response = EKeyWasNotConsumed; - if (iSysApKeyManagement) - { - response = iSysApKeyManagement->HandleKeyEventL(aKeyEvent, aType ); - } - - if ( response == EKeyWasNotConsumed ) // none of the plugins consumed the key, offer it to default handling - { - iSysApDefaultKeyHandler->HandleKeyEventL( aKeyEvent, aType ); - } - } - break; - } - } - else if( aType == EEventKeyUp ) - { - if( aKeyEvent.iScanCode == EStdKeyDevice2 ) - { - if ( iIgnoreNextPowerKeyUpEvent ) - { - if ( !iPowerKeyPopupMenuDismissed ) // If the popup menu has been dismissed, do nothing - { - iPowerKeyPopupMenuActive = ETrue; - iIgnoreNextPowerKeyUpEvent = EFalse; - } - } - else if( iLastPowerKeyWasShort ) - { - if ( iPowerKeyPopupMenuActive ) - { - if ( iGlobalListQuery ) - { - if ( iSysApFeatureManager->NoPowerKeySupported() ) - { - CancelGlobalListQuery(); - } - else - { - iGlobalListQuery->MoveSelectionDown(); - } - } - } - } - - } - } - - TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL:ended, aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d, iIgnoreNextPowerKeyUpEvent:%d, iPowerKeyPopupMenuActive:%d, iLastPowerKeyWasShort:%d, iPowerKeyPopupMenuDismissed:%d"), - aKeyEvent.iCode, aKeyEvent.iScanCode, aType, iIgnoreNextPowerKeyUpEvent, iPowerKeyPopupMenuActive, iLastPowerKeyWasShort, iPowerKeyPopupMenuDismissed ) ); - } - else // shutdown started - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d"), - aKeyEvent.iCode, aKeyEvent.iScanCode, aType ) ); - - // When shutdown has been started, only device mode key events are passed to plug-in framework - // This for enabling plug-in activities during shutdown animation - if ( IsDeviceModeKey( aKeyEvent ) ) // Other key events are not passed, because they must cancel the shutdown animation as stated in UI spefication - { - if ( aType == EEventKey && iSysApKeyManagement ) - { - iSysApKeyManagement->HandleKeyEventL( aKeyEvent, aType ); - } - } - #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION - else if ( aType == EEventKey && iSysApShutdownAnimation && !iShutdownContinued ) - { - if ( aKeyEvent.iCode != EKeyPowerOff || iLastPowerKeyWasShort ) - { - iSysApShutdownAnimation->Cancel(); - NotifyShutdownAnimationSkip(); - } - } - - #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: ended") ) ); - } - return EKeyWasConsumed; + ExecQueryL( aQuery, aReturn, KNullDesC8 ); } // ---------------------------------------------------------------------------- -// CSysApAppUi::HandleCommandL( TInt aCommand) +// CSysApAppUi::ExecQueryL // ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleCommandL( TInt aCommand ) +// +void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn, const TDesC8& /*aParam*/ ) { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleCommandL aCommend: %d"), aCommand ) ); - switch ( aCommand ) + TRACES( RDebug::Print(_L("CSysApAppUi::ExecQueryL: aQuery=%d"), aQuery ) ); + + switch ( aQuery ) { - case EEikCmdExit: // EAknCmdExit - Exit(); + case EGetHwrmLight: // get handle to HWRM client session. Returns CHWRMLight*. + { + THwrmLightBuf retBuf( iSysApLightsController->GetHwrmLight() ); + aReturn.Copy( retBuf ); + } break; + + case EGetKeylock: // get handle to keylock client session. Returns RAknKeylock2*. + { + // do nothing + } + break; + + default: + __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecQueryL: Invalid query"), KErrArgument ) ); + User::Leave( KErrArgument ); break; } } // ---------------------------------------------------------------------------- -// CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) +// CSysApAppUi::ExecCommandL // ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) +// +void CSysApAppUi::ExecCommandL( TSysapCommand aCommand ) { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: aType:%d"), aType ) ); + ExecCommandL( aCommand, KNullDesC8 ); + } - CAknAppUi::HandleApplicationSpecificEventL(aType, aEvent); - - if ( ResourcesFreed() ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: discarded, shutting down") ) ); - return; - } - - switch( aType ) +// ---------------------------------------------------------------------------- +// CSysApAppUi::ExecCommandL +// ---------------------------------------------------------------------------- +// +void CSysApAppUi::ExecCommandL( TSysapCommand aCommand, const TDesC8& /* aParam */ ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::ExecCommandL: aCommand=%d"), aCommand ) ); + + switch ( aCommand ) { - case EEikKeyLockEnabled: - iKeyLockEnabled = ETrue; - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); - SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); - iSysApLightsController->KeylockStateChangedL( ETrue ); - break; - case EEikKeyLockDisabled: - iKeyLockEnabled = EFalse; - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); - SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); - if (! iDeviceLockEnabled ) - { - iSysApLightsController->KeylockStateChangedL( EFalse ); - if ( iSysApFeatureManager->MmcHotSwapSupported() ) - { - if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) - { - RunUnlockNotifierL(); - } - } - } - break; - case EEikKeyLockPowerKeyPressed: //sent when power key is captured by keylockserver - HandleShortPowerKeyPressedL(); - break; - - case EEikKeyLockLightsOnRequest: - iSysApLightsController->SetLightsOnUnlockNoteL(); - break; - - case EEikEcsQueryLights: // emergency note is shown - iSysApLightsController->SetLightsOnEcsQueryL(); - break; - - case EEikSecurityQueryLights: // for device lock security query - iSysApLightsController->SetLightsOnSecurityQueryL(); + case EResetKeyguardState: // reset the internal keyguard flags of the SysAp, except for iKeyLockOnBeforeCradle + iKeyLockOnBeforeCall = EFalse; + iKeyLockOnBeforeAlarm = EFalse; break; default: + // do nothing in release builds since no harm is done + __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecCommandL: Invalid command"), KErrArgument ) ); break; + } + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::TimerExpiredL() +// ---------------------------------------------------------------------------- +void CSysApAppUi::TimerExpiredL() + { +/* + * Not suppported , will take care in wk25 + * #ifndef RD_MULTIPLE_DRIVE + * CloseUIAppsInHotSwapL(); + * #endif // RD_MULTIPLE_DRIVE +*/ + } + + + // ---------------------------------------------------------------------------- +// CSysApAppUi::KeyLockState() const +// ---------------------------------------------------------------------------- + +TBool CSysApAppUi::KeyLockState() const + { + return iKeyLockEnabled; + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::DeviceLockState() const +// ---------------------------------------------------------------------------- + +TBool CSysApAppUi::DeviceLockState() const + { + return iDeviceLockEnabled; + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SysApFeatureManager +// ---------------------------------------------------------------------------- + +CSysApFeatureManager& CSysApAppUi::SysApFeatureManager() + { + __ASSERT_DEBUG( iSysApFeatureManager, User::Panic( _L("iSysApFeatureManager == NULL"), KErrBadHandle ) ); + + return *iSysApFeatureManager; + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::ActivateKeyeventForwardingForLights() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::ActivateKeyeventForwardingForLights(TBool aActivate) + { + if( iSysApNspsHandler ) + { + if ( aActivate ) + { + iSysApNspsHandler->ActivateKeyeventForwardingForLights(); } + else + { + iSysApNspsHandler->DeActivateKeyeventForwardingForLights(); + } + } + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::StarterSession() +// ---------------------------------------------------------------------------- + +RStarterSession& CSysApAppUi::StarterSession() + { + if ( !iStarterSession.Handle() ) + { + // All server connections are tried to be made KTriesToConnectServer times because occasional + // fails on connections are possible at least on some servers + TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: trying RStarterSession::Connect()") ) ); + TInt thisTry = 0; + TInt err; + while ( ( err = iStarterSession.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) + { + User::After( KTimeBeforeRetryingServerConnection ); + } + + if ( err != KErrNone ) + { + // What do in error case? + TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: RStarterSession::Connect() failed with %d"), err ) ); + } + } + + return iStarterSession; + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SetBtPowerState() +// ---------------------------------------------------------------------------- +TInt CSysApAppUi::SetBtPowerState( TBool aBtState ) + { + if ( iSysApBtController ) + { + return iSysApBtController->SetPowerState( aBtState ); + } + else + { + return KErrNotReady; + } + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SetStarterState() +// ---------------------------------------------------------------------------- + +TInt CSysApAppUi::SetStarterState( const RStarterSession::TGlobalState aState ) + { + if ( iSysApStartupController->GlobalStateChangeAllowed( aState ) ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d" ), aState ) ); + return StarterSession().SetState( aState ); + } + else + { + TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d - not allowed" ), aState ) ); + return KErrNone; + } + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SetNetworkConnectionAllowed() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::SetNetworkConnectionAllowed: status: %d" ), aNetworkConnectionAllowed ) ); + + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIs, KCoreAppUIsNetworkConnectionAllowed, (TInt) aNetworkConnectionAllowed ); + + // Also set the Symbian PS key used for the same purpose: + RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, aNetworkConnectionAllowed ? ESAPhoneOn : ESAPhoneOff); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::BluetoothPowerMode() +// ---------------------------------------------------------------------------- +TInt CSysApAppUi::BluetoothPowerMode() const + { + return iSysApCenRepBtObserver->BluetoothPowerMode(); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SimSupported() +// ---------------------------------------------------------------------------- +TBool CSysApAppUi::SimSupported() + { + return iSysApFeatureManager->SimSupported(); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::BtSapEnabled() +// ---------------------------------------------------------------------------- + +TBool CSysApAppUi::BtSapEnabled() + { + if ( iSysApBtSapController ) + { + return iSysApBtSapController->BtSapEnabled(); + } + return EFalse; } // ---------------------------------------------------------------------------- -// CSysApAppUi::InitializeStatusPaneAreaL() +// CSysApAppUi::OfflineModeChangedL() +// ---------------------------------------------------------------------------- +void CSysApAppUi::OfflineModeChangedL() + { +#ifdef SYSAP_USE_STARTUP_UI_PHASE + // if UI is not ready, don't update indicators + if ( !UiReady() ) + { + return; + } +#endif // SYSAP_USE_STARTUP_UI_PHASE + + SetHacIndicatorL(); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::UiReady() +// // ---------------------------------------------------------------------------- -void CSysApAppUi::InitializeStatusPaneAreaL() +TBool CSysApAppUi::UiReady() const { - TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): START") ) ); - TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); - - //Also Charging status will be updated with the following function. - UpdateBatteryBarsL( state ); +#ifdef SYSAP_USE_STARTUP_UI_PHASE + return iSysApStartupController->UiReady(); +#else // SYSAP_USE_STARTUP_UI_PHASE + // if startup UI phase information is not used, global system state normal is handled as UI idle state + return IsStateNormal(); +#endif // SYSAP_USE_STARTUP_UI_PHASE + } -#ifdef SYSAP_USE_STARTUP_UI_PHASE - if ( OfflineModeActive() ) - { - UpdateSignalBarsL( KAknSignalOffLineMode ); - } - else - { - UpdateSignalBarsL(); - } -#else - UpdateSignalBarsL(); -#endif // SYSAP_USE_STARTUP_UI_PHASE - - SetSignalIndicatorL(); - SetIhfIndicatorL(); - SetHacIndicatorL(); - LogsObserverL().HandleUiReadyL(); - - if ( iSysApEtelConnector ) - { - iSysApEtelConnector->ReadSimSmsStoreStatusInStartup(); - } - SetEnvelopeIndicatorL(); - - TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): accessories") ) ); - - TAccMode accessoryState(EAccModeHandPortable); - if ( iSysApAccessoryObserver ) - { - accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); - } +// ---------------------------------------------------------------------------- +// CSysApAppUi::CompleteShutdown() +// ---------------------------------------------------------------------------- - if( accessoryState == EAccModeWiredHeadset || - accessoryState == EAccModeWirelessHeadset || - accessoryState == EAccModeHeadphones ) - { - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if( accessoryState == EAccModeLoopset ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if( accessoryState == EAccModeTextDevice ) +void CSysApAppUi::CompleteShutdown( const TBool aReset, const TInt aResetReason ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): START" ) ) ); + + iCheckLongPowerKeyEvent = ETrue; + + PrepareForShutdownImage();//SysAp's internal preparation for ShutDown with image + + FreeResources(); + + if ( aReset ) { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if( accessoryState == EAccModeWiredCarKit || accessoryState == EAccModeWirelessCarKit ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if( accessoryState == EAccModeTVOut ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if (accessoryState == EAccModeHDMI ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOn ); - } - else // all indicators off - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - - TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): msg") ) ); - state = StateOfProperty( KUidSystemCategory, KUidOutboxStatusValue ); - if( state == ESADocumentsInOutbox ) - { - SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOn ); - } - else - { - SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOff ); - } - - state = StateOfProperty( KAlarmServerPubSubCategory, KWakeupAlarmPubSubKey ); - - if( state == EActiveWakeupAlarmSet ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::InitializeStatusPaneAreaL called the SetIndicatorStateL with EActiveWakeupAlarmSet "))); - SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOn ); + __ASSERT_DEBUG( aResetReason >= RStarterSession::ELanguageSwitchReset && + aResetReason <= RStarterSession::EDataRestoreReset, + User::Invariant() ); + StarterSession().Reset( static_cast( aResetReason ) ); } else { - TRACES( RDebug::Print(_L("CSysApAppUi::InitializeStatusPaneAreaL called the SetIndicatorStateL with EActiveNoWakeupAlarmsSet "))); - SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOff ); + StarterSession().Shutdown(); } - state = StateOfProperty( KIrdaPropertyCategory, KIrdaStatus ); - if( state == TIrdaStatusCodes::EIrLoaded || state == TIrdaStatusCodes::EIrDisconnected || state == TIrdaStatusCodes::EIrBlocked ) + StarterSession().Close(); + + TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): END" ) ) ); + } + + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::DoShutdownL( const TBool aReset, const TSWStartupReason aSWStartupReason ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::DoShutdownL( const TBool aReset, const TInt aResetReason ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: aResetReason:%d, aReset:%d" ), + aResetReason, aReset ) ); +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + TBool animationenabled( EFalse ); +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + + if( OkToInitiateShutdown() ) { - SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateAnimate ); - } - else if( state == TIrdaStatusCodes::EIrConnected ) - { - SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOn ); + TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was OkToToInitiateShutdown" ) ) ); + + + if ( !aReset && iSysApFeatureManager->Supported(KSysApFeatureIdGoodbyeNote) ) + { + // show shutdown note + } + + if( !aReset ) + { + #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION +// TRAPD( err, ShowAnimationL() ); +// if ( err ) + { + // TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); + CompleteShutdown(aReset, aResetReason); + } + } + else // aReset + { + CompleteShutdown(aReset, aResetReason); + } + #else // RD_STARTUP_ANIMATION_CUSTOMIZATION + TRAPD( err, animationenabled = ShowAnimationL() ); + if ( err ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); + } + } + + if ( !animationenabled ) + { + CompleteShutdown(aReset, aResetReason); + } + #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION } else { - SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOff ); - } - - iSysApCenRepCallForwardingObserver->UpdateCallForwardingIndicatorsL(); - - iSysApCenRepMsgWaitingObserver->UpdateMessageWaitingIndicatorsL(); - - state = StateOfProperty( KPSUidNetworkInfo, KNWHomeZoneStatus ); - if( state == ENWNone || state == ENWCityZone ) - { - SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOff ); - } - else if( state == ENWHomeZone ) - { - SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOn ); + TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was not OkToToInitiateShutdown" ) ) ); } - - // Initialize WLan state - state = StateOfProperty( KPSUidWlan, KPSWlanIndicator ); - HandleWlanIndicatorL(state); - - // Initialize Tarm state - state = StateOfProperty( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator ); - HandleTarmIndicatorL(state); - - TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): END") ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleWlanIndicator() -// ---------------------------------------------------------------------------- -void CSysApAppUi::HandleWlanIndicatorL( TInt aValue ) - { - if ( aValue == EPSWlanIndicatorAvailable ) - { - SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOn ); - } - else if ( aValue == EPSWlanIndicatorActive ) - { - SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOn ); - } - else if ( aValue == EPSWlanIndicatorActiveSecure ) - { - SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOn ); - } - else // No indication required - { - SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOff ); - } + TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: END" ) ) ); } -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleTarmIndicatorL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleTarmIndicatorL( TInt aValue ) - { - if ( aValue == ECoreAppUIsTarmTerminalSecurityOnIndicatorOn ) - { - SetIndicatorStateL( EAknIndicatorTARM, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTARMModuleOn, EAknIndicatorStateOn ); - } - else if ( aValue == ECoreAppUIsTarmMngActiveIndicatorOn ) - { - SetIndicatorStateL( EAknIndicatorTARMModuleOn, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTARM, EAknIndicatorStateOn ); - } - else - { - SetIndicatorStateL( EAknIndicatorTARM, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTARMModuleOn, EAknIndicatorStateOff ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleShortPowerKeyPressedL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleShortPowerKeyPressedL() - { - TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); - - TRACES ( - RDebug::Print( - _L("CSysApAppUi::HandleShortPowerKeyPressedL() callState:%d, iDeviceLockEnabled:%d" ), - callState, - iDeviceLockEnabled ); - ); - iSysApLightsController->PowerKeyPressedL(); - - RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, ECoreAppUIsHideAlarm ); - if( UiReady() && !iDeviceLockEnabled ) - { - if ( iPowerKeyPopupMenuActive ) - { - //Do nothing here. EEventKeyUp moves selection in the list! - } - else if ( !iKeyLockEnabled - && callState != EPSCTsyCallStateAlerting - && callState != EPSCTsyCallStateRinging - && callState != EPSCTsyCallStateDialling ) - //Show power key menu - { - ShowPowerKeyPopUpMenuL(); - } - } - else - { - TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); - - if( swState == ESwStateAlarm ) - //From Alarm state even a short press causes shutdown but charger state need to be checked - { - TInt chargerState( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); - if( chargerState == EChargingStatusNotConnected ) - //shutdown +/* +---------------------------------------------------------------------------- +CSysApAppUi::IsEncryptionOperationOngoingL() +Introduced the code as a part of Sub : 405-3362 - Power Management SUB for ES +recapture functionalities in platform which support multidrive as well. +------------------------------------------------------------------------------- +*/ +TBool CSysApAppUi::IsEncryptionOperationOngoingL() const + { + TBool deFeatureSupported(EFalse); + FeatureManager::InitializeLibL(); + deFeatureSupported = FeatureManager::FeatureSupported( KFeatureIdFfDeviceEncryptionFeature); + FeatureManager::UnInitializeLib(); + + if(deFeatureSupported) + { + /** + * Store the last memory status changed + * 0: Idle. It can be Encrypted or Decrypted + * 1: Encrypting + * 2: Decrypting + **/ + + RProperty deProperty; + User::LeaveIfError(deProperty.Attach(KDevEncProtectedUid, KDevEncOperationKey,EOwnerThread)); + TInt deValue = 0; + if((deProperty.Get(deValue)== KErrNone)&&( deValue == EOpEncrypting || deValue == EOpDecrypting)) { - StartShutDownTimerOnAlarmAndChargingStates(); + deProperty.Close(); + return ETrue; } else - //to charging state { - SetStarterState( RStarterSession::ECharging ); + deProperty.Close(); + return EFalse; } } - } + else + { + return EFalse; + } } // ---------------------------------------------------------------------------- @@ -1104,8 +932,8 @@ TInt swState; RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); - - iSysApLightsController->PowerKeyPressedL(); + + iSysApLightsController->PowerKeyPressedL(); //need to handle later. if( swState == ESwStateStartingCriticalApps || swState == ESwStateSelfTestOK || @@ -1121,10 +949,7 @@ { if( iPowerKeyPopupMenuActive ) { - if ( iGlobalListQuery ) - { - iGlobalListQuery->SelectItem(); - } + // do nothing } else if( !iIgnoreNextPowerKeyRepeats ) { @@ -1154,1101 +979,356 @@ } // ---------------------------------------------------------------------------- -// CSysApAppUi::FreeResources() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::FreeResources() - { - TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources") ) ); - - delete iSysApBatteryInfoController; - delete iSysApPsmController; - - delete iSysApAudioRoutingObserver; - - delete iProfileNamesArray; - iProfileNamesArray = NULL; - - if ( iTimer ) - { - iTimer->Cancel(); - delete iTimer; - } - - if ( iSapTimer ) - { - iSapTimer->Cancel(); - delete iSapTimer; - } - - if ( iSysApTimer ) - { - iSysApTimer->Cancel(); - delete iSysApTimer; - } - - delete iGlobalListQuery; - - RWindowGroup groupWin = iCoeEnv->RootWin(); - groupWin.CancelCaptureKey( iCapturedEKeyPowerOff ); - groupWin.CancelCaptureKeyUpAndDowns( iCapturedEKeyPowerOffUpAndDowns ); - - delete iSysApDefaultKeyHandler; - - if ( iProfileEngine ) - { - iProfileEngine->Release(); - } - - delete iSysApSsSettingsObserver; - delete iSysApEtelConnector; - - delete iSysApProfileObserver; - delete iSysApNspsHandler; - delete iSysApKeySndHandler; - delete iSysApCenRepMsgWaitingObserver; - delete iSysApCenRepCallForwardingObserver; - delete iSysApConnectionMonitorObserver; - delete iSysApCenRepLightSettingsObserver; - delete iSysApCenRepLogsObserver; - delete iSysApCenRepBtObserver; -// delete iSysApCenRepFmTxObserver; - delete iSysApCenRepHacSettingObserver; - delete iSysApCenRepController; - - delete iSysApPubSubObserver; - - delete iSysApMMCObserver; - delete iSysApMsgSimMemLowQuery; - delete iSysApWaitNote; - delete iSysApConfirmationQuery; - delete iSysApConfirmationQueryForRestart; - delete iSysApOfflineModeController; - delete iSysApUsbIndicatorController; - delete iSysApBtController; - delete iSysApBtSapController; - delete iSignalNotify; - delete iBatteryNotify; - delete iSysApSystemLock; - delete iSysApLocationPrivacyIndicator; - delete iSysApAccessoryObserver; - delete iSysApMediatorObserver; - - delete iSysApKeyManagement; - iSysApKeyManagement = NULL; - delete iSysApLightsController; - iKeyLock.Close(); - delete iSysApFeatureManager; - - // Cleanup ECom, used by key management and light control - REComSession::FinalClose(); - - iResourcesFreed = ETrue; - TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources:END") ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const +// CSysApAppUi::IsDeviceModeKey // ---------------------------------------------------------------------------- -void CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const +TBool CSysApAppUi::IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL aNote: %d"), aNote ) ); + return CSysApDefaultKeyHandler::IsDeviceModeKey( aKeyEvent ); + } + - TInt tone( EAvkonSIDNoSound ); - TAknGlobalNoteType noteType( EAknGlobalBatteryLowNote ); - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - TInt secondaryDisplayId(SecondaryDisplay::ECmdNoNote); +// ---------------------------------------------------------------------------- +// CSysApAppUi::ShowShutdownImage +// ---------------------------------------------------------------------------- +// +TInt CSysApAppUi::ShowShutdownImage( TInt aBitmapId ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImage") ) ); - switch ( aNote ) + TRAPD( err, ShowShutdownImageL( aBitmapId ) ); + + if ( err != KErrNone ) { - case EBatteryLowNote: - noteType = EAknGlobalBatteryLowNote; - tone = EAvkonSIDBatteryLowTone; - break; - case EBatteryFullNote: - noteType = EAknGlobalBatteryFullNote; - tone = EAvkonSIDInformationTone; - break; - case ERechargeBatteryNote: - iSysApLightsController->BatteryEmptyL( ETrue ); - noteType = EAknGlobalRechargeBatteryNote; - tone = EAvkonSIDRechargeBatteryTone; - break; - case ENotChargingNote: - noteType = EAknGlobalNotChargingNote; - tone = EAvkonSIDWrongCharger; - break; - case EInsertSimNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowInsertSimNote; - break; - case EMemoryCardRemovedWithoutEjectNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowMemoryCardRemovedWithoutEjectNote; - break; - case EGprsSuspendedNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowGprsSuspendedNote; - break; - case EGprsResumedNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowGprsResumedNote; - break; - case EShutdownNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowShutdownNote; - break; - case ECannotActivateOfflineModeNote: - noteType = EAknGlobalErrorNote; - tone = EAvkonSIDErrorTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowCannotActivateOfflineModeNote; - break; - case ECannotDeactivateOfflineModeNote: - noteType = EAknGlobalErrorNote; - tone = EAvkonSIDErrorTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowCannotDeactivateOfflineModeNote; - break; - case EKeypadActiveNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowKeypadActiveNote; - break; -/* case EFmTxAccessoryStandbyNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxStandbyInAccessoryConnectionNote; - break; - case EFmTxAccessoryForbidsNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxCannotEnableWhileAccessoryConnectedNote; - break; - case EFmTxVolumeDisabledNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxVolumeDisabledNote; - break; - case EFmTxOnNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxTuneRadioToFrequencyNote; - break; - case EFmTxOffNote: - noteType = EAknGlobalInformationNote; - tone = EAvkonSIDInformationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxDisabledNote; - break; -*/ case EBatteryFullUnplugChargerNote: - noteType = EAknGlobalBatteryFullUnplugNote; - tone = EAvkonSIDInformationTone; - break; - case EUnplugChargerNote: - noteType = EAknGlobalUnplugChargerNote; - tone = EAvkonSIDInformationTone; - break; - case EPowerSaveModeActivated: - noteType = EAknGlobalConfirmationNote; - tone = EAvkonSIDConfirmationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowPowerSavingActivatedNote; - break; - case EPowerSaveModeDeactivated: - noteType = EAknGlobalConfirmationNote; - tone = EAvkonSIDConfirmationTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowPowerSavingDeactivatedNote; - break; - case ECannotActivatePowerSaveMode: - noteType = EAknGlobalWarningNote; - tone = EAvkonSIDWarningTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowCannotActivatePowerSavingNote; - break; - case ECannotDeactivatePowerSaveMode: - noteType = EAknGlobalWarningNote; - tone = EAvkonSIDWarningTone; - secondaryDisplayId = SecondaryDisplay::ECmdShowCannotDeactivatePowerSavingNote; - break; - default: - break; - + TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL failed, err=%d"), err ) ); } - TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); - - if( UiReady() || swState == ESwStateSecurityCheck) - { - HBufC* noteStringBuf = NULL; - - switch ( aNote ) - { - case EInsertSimNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_SU_NOTE_INSERT_SIM, iEikonEnv ); - break; - case EMemoryCardRemovedWithoutEjectNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_MEMS_EJECT_ERROR, iEikonEnv ); - note->SetSoftkeys( R_AVKON_SOFTKEYS_OK_EMPTY ); - break; - case EGprsSuspendedNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_GPRS_CONF_GPRS_SUSPENDED, iEikonEnv ); - break; - case EGprsResumedNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_GPRS_CONF_GPRS_RESUMED, iEikonEnv ); - break; - case EShutdownNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_PWRC_INFO_GOODBYE, iEikonEnv); - break; - case ECannotActivateOfflineModeNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_ERR_OFFLINE_UNABLE, iEikonEnv ); - break; - case ECannotDeactivateOfflineModeNote: - noteStringBuf = StringLoader::LoadLC( R_QTN_ERR_OFFLINE_UNABLE_PROFILE, iEikonEnv ); - break; - case EKeypadActiveNote: - if ( iSysApFeatureManager->PenEnabled() ) - { - noteStringBuf = StringLoader::LoadLC( R_QTN_KEYG_CONF_DISPLAY_KEYS_ACTIVE, - iEikonEnv ); - } - else - { - noteStringBuf = StringLoader::LoadLC( R_QTN_KEYG_CONF_KEYPAD_ACTIVE, - iEikonEnv ); - } - note->SetAnimation( R_QGN_NOTE_KEYGUARD_OPEN_ANIM ); - break; -/* case EFmTxOnNote: - { - const TInt KFrequencyMaxLength(7); - // read frequency - TInt frequencykHz = iSysApCenRepFmTxObserver->Frequency(); - TReal frequencyMHz = static_cast( frequencykHz ) / KCoefficientKhzToMhz; // kHz to Mhz - TBuf frequencyAsString; - frequencyAsString.AppendNum( frequencyMHz, TRealFormat( KFrequencyMaxLength, KDecimalsInMhzFrequency ) ); - AknTextUtils::LanguageSpecificNumberConversion( frequencyAsString ); - noteStringBuf - = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_CHANGE_FREQ, - frequencyAsString, - iEikonEnv ); - break; - } - case EFmTxAccessoryForbidsNote: - { - noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_ACCESSORY_FORBIDS, - iEikonEnv ); - break; - } - case EFmTxAccessoryStandbyNote: - { - noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_ACCESSORY_STANDBY, - iEikonEnv ); - break; - } - case EFmTxVolumeDisabledNote: - { - noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_VOLUME_DISABLED, - iEikonEnv ); - break; - } - case EFmTxOffNote: - { - noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_DISABLED, - iEikonEnv ); - break; - } -*/ case EPowerSaveModeActivated: - noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_ACTIVATED_CONF_NOTE, iEikonEnv ); - break; - case EPowerSaveModeDeactivated: - noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_DEACTIVATED_CONF_NOTE, iEikonEnv ); - break; - case ECannotActivatePowerSaveMode: - noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_FAILED_WARNING_NOTE, iEikonEnv ); - break; - case ECannotDeactivatePowerSaveMode: - noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_DEACTIVATION_FAILED_WARNING_NOTE, iEikonEnv ); - break; - default: - break; - } - - note->SetTone( tone ); - - // Set secondary display data if necessary -/* if ( iSysApFeatureManager->CoverDisplaySupported() && secondaryDisplayId != SecondaryDisplay::ECmdNoNote) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL - Notifying secondary display") ) ); - CAknSDData* sd; - - if ( aNote == EFmTxOnNote ) // frequency information is passed to secondary display - { - SecondaryDisplay::TFmTxFrequencyInKhzPckg pckg( iSysApCenRepFmTxObserver->Frequency() ); - sd = CAknSDData::NewL( SecondaryDisplay::KCatSysAp, secondaryDisplayId, pckg ); - } - else - { - sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, secondaryDisplayId, KNullDesC8); - } - - note->SetSecondaryDisplayData(sd); // ownership to notifier client - } -*/ - if ( noteStringBuf ) - { - TPtr textBuffer = noteStringBuf->Des(); - TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL Next:note->ShowNoteL" ) ) ); - note->ShowNoteL( noteType, textBuffer ); - CleanupStack::PopAndDestroy( ); // noteStringbuf - } - else - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL Next:note->ShowNoteL" ) ) ); - note->ShowNoteL( noteType, KNullDesC ); - } - } - else if( swState == ESwStateAlarm || swState == ESwStateCharging ) - { - if ( aNote != EUnplugChargerNote ) // don't play tone when charger is disconnected in charging state - { - static_cast(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( tone ); - } - } - - CleanupStack::PopAndDestroy(); // note + return err; } -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowChargingNoteL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShowChargingNoteL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL") ) ); - TBool showNote( ETrue ); - - TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); - TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL: swState: %d"), swState ) ); - - if( UiReady() || swState == ESwStateSecurityCheck ) - { - if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) == EPSCTsyCallStateRinging ) - { - showNote = EFalse; - } - TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL KCTsyCallState=%d"), StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ) ); - if ( showNote ) // Power Mgmt UI spec defines that no Charging note is shown while the phone is ringing/alerting - { - CAknGlobalNote* chargingNote = CAknGlobalNote::NewLC(); - chargingNote->SetTone( EAvkonSIDChargingBatteryTone ); - chargingNote->ShowNoteL( EAknGlobalChargingNote, KNullDesC ); - CleanupStack::PopAndDestroy( chargingNote ); - } - } - else if( swState == ESwStateAlarm || swState == ESwStateCharging ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL - Just play tone") ) ); - static_cast(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDChargingBatteryTone ); - } - else - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL - No note shown") ) ); - } - } // ---------------------------------------------------------------------------- -// CSysApAppUi::HandleChargerNotesL() +// CSysApAppUi::ShowShutdownImageL // ---------------------------------------------------------------------------- -void CSysApAppUi::HandleChargerNotesL( const TInt aValue ) +// +void CSysApAppUi::ShowShutdownImageL( TInt aBitmapId ) { - TBool showNote(StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging); - if ( aValue == EChargingStatusCharging ) - { - iSysApLightsController->BatteryEmptyL( EFalse ); - TRACES( RDebug::Print( _L("SysAp: charger connected") ) ); - iSysApLightsController->ChargerConnectedL( ETrue ); - ShowChargingNoteL(); - } - //Display Not Charging note - else if ( aValue == EChargingStatusError ) + TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL") ) ); + // do nothing + if ( !iSysApShutdownImage ) // Shutdown image may be shown without entering normal state (e.g. charging), so construct here { - if(showNote) - { - ShowUiNoteL( ENotChargingNote ); - } + TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::NewL()") ) ); + iSysApShutdownImage = CSysApShutdownImage::NewL(); } - else if ( aValue == EChargingStatusChargingComplete ) + TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::ShowShutdownImageL()") ) ); + iSysApShutdownImage->ShowShutdownImageL( aBitmapId ); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::PrepareForShutdownImage() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::PrepareForShutdownImage() + { + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() START" ) ) ); + + // If RD_STARTUP_ANIMATION_CUSTOMIZATION is enabled, the following actions are always taken in PrepareForShutdownAnimation +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + if ( !iAnimationShowingTime ) // actions already taken in PrepareForShutdownAnimation { - iSysApLightsController->ChargingCompleteL(); + static_cast(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDPowerOffTone ); + CancelGlobalListQuery(); - TSysApNoteIds note( EBatteryFullNote ); - - if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && - iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) - { - note = EBatteryFullUnplugChargerNote; - } - iSysApUsbChargerDetector.Reset(); - if(showNote) + if ( iSysApPowerKeyMenuObserver ) { - ShowUiNoteL( note ); - } - } - else if ( aValue == EChargingStatusNotConnected ) - { - TRACES( RDebug::Print( _L("SysAp: charger removed") ) ); - iSysApLightsController->ChargerConnectedL( EFalse ); - - if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && - iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) - { - if(showNote) - { - ShowUiNoteL( EUnplugChargerNote ); - } + iSysApPowerKeyMenuObserver->Cancel(); } - iSysApUsbChargerDetector.Reset(); - } - else if ( aValue == EChargingStatusNotCharging ) - { - TRACES( RDebug::Print( _L("SysAp: Not charging") ) ); + + // deactivate notifiers before showing the shutdown image + AknNotifierController::CancelAllNotifications(); + AknNotifierController::HideAllNotifications(ETrue); + RWindowGroup groupWin = iCoeEnv->RootWin(); + iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); + iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); } - else if ( aValue == EChargingStatusAlmostComplete ) - { - TRACES( RDebug::Print( _L("SysAp: Charging almost complete") ) ); - } - else if ( aValue == EChargingStatusChargingContinued ) - { - //in this case we simply want to scroll the battery bars and not turn light on or show ui note - // set lights controller iBatteryEmpty to EFalse - iSysApLightsController->BatteryEmptyL( EFalse ); - TRACES( RDebug::Print( _L("SysAp: charging continues") ) ); - } +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + +#ifndef __SYSAP_MODULE_TEST //to make errors during shutdown sequence being seen more easily + iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() Show Shutdown image" ) ) ); + ShowShutdownImage( 1 );//EMbmSysapQgn_startup_screen +#endif + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() END" ) ) ); } // ---------------------------------------------------------------------------- -// CSysApAppUi::ShowProfileNoteL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShowProfileNoteL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowProfileNoteL") ) ); - - if ( UiReady() ) - { - if ( iProfileNote ) - { - // when a call is coming in, there might be a pending "Selected profile" - // we don't want to show anymore - iProfileNote->CancelNoteL( iProfileNoteId ); - } - - TBufC profileName; - HBufC* noteStringBuf = NULL; - ActiveProfileNameL( profileName.Des() ); - noteStringBuf = StringLoader::LoadLC( R_TEXT_MODE_SELECTED, profileName, iEikonEnv ); - TPtr textBuffer = noteStringBuf->Des(); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( textBuffer ); - - // profile note is constructed when it is needed for the first time - if ( !iProfileNote ) - { - iProfileNote = CAknGlobalNote::NewL(); - iProfileNote->SetTone( EAvkonSIDConfirmationTone ); - } - - // Set secondary display data if necessary - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowProfileNoteL - Notifying secondary display") ) ); - SecondaryDisplay::TProfileName sdProfileName; - sdProfileName.Append(profileName.Left(SecondaryDisplay::KProfileNameMaxLen)); - SecondaryDisplay::TProfileNotePckg pckg(sdProfileName); - CAknSDData* sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, SecondaryDisplay::ECmdShowProfileNote, pckg); - iProfileNote->SetSecondaryDisplayData(sd); // ownership to notifier client - } - - iProfileNoteId = iProfileNote->ShowNoteL( EAknGlobalConfirmationNote, textBuffer ); - - CleanupStack::PopAndDestroy( ); // noteStringbuf - - iSysApLightsController->ProfileChangedL(); // All notes should always turn lights on. - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowQueryL() +// CSysApAppUi::OkToInitiateShutdown() // ---------------------------------------------------------------------------- -void CSysApAppUi::ShowQueryL( const TSysApConfirmationQueryIds aQueryId, const TDesC& aValue ) +TBool CSysApAppUi::OkToInitiateShutdown() { - CancelGlobalListQuery(); + TInt swState; + RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); - if ( aQueryId == ESysApRestartPhoneQuery ) - { - iDisablePowerkeyMenu = ETrue; - // Cancel any other query that might be outstanding (i.e. ESysApRemoveMmcNote), - // to avoid multiple overlapping queries causing problems - if ( iSysApConfirmationQuery ) - { - iSysApConfirmationQuery->Cancel(); - } - - if ( !iSysApConfirmationQueryForRestart ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowQueryL: trying CSysApConfirmationQuery::NewL() for restart") ) ); - iSysApConfirmationQueryForRestart = CSysApConfirmationQuery::NewL( *this ); - } - - iSysApConfirmationQueryForRestart->ShowQueryL( aQueryId, iEikonEnv ); - } - else + if( !iShutdownStarted && + swState == ESwStateStartingCriticalApps || + swState == ESwStateSelfTestOK || + swState == ESwStateSecurityCheck || + swState == ESwStateCriticalPhaseOK || + swState == ESwStateEmergencyCallsOnly || + swState == ESwStateCharging || + swState == ESwStateAlarm || + swState == ESwStateNormalRfOn || + swState == ESwStateNormalRfOff || + swState == ESwStateNormalBTSap || + swState == ESwStateFatalStartupError ) { - if ( !iSysApConfirmationQuery ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowQueryL: trying CSysApConfirmationQuery::NewL()") ) ); - iSysApConfirmationQuery = CSysApConfirmationQuery::NewL( *this ); - } - - iSysApConfirmationQuery->ShowQueryL( aQueryId, aValue, iEikonEnv ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) - { - TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); - TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL aState: %d, chargerState:%d"), aState, state ) ); - HandleUsbCharger( state ); - if( state == EChargingStatusCharging || - state == EChargingStatusChargingContinued || - state == EChargingStatusAlmostComplete ) - { - if ( !iCharging ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Starting Charging") ) ); - iBatteryNotify->StartChargingL(); - iCharging = ETrue; - } - - // When Avkon supports battery state sending while charging, - // add setting battery level here also. + iShutdownStarted = ETrue; + return ETrue; } else { - if ( iCharging ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Stopping Charging") ) ); - iBatteryNotify->StopChargingL(); - iCharging = EFalse; - } - - if( state == KErrUnknown || aState == KErrUnknown ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: CAknBatteryNotify::SetBatteryLevelL(0)") ) ); - iBatteryNotify->SetBatteryLevelL( 0 ); - } - else - { - TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: CAknBatteryNotify::SetBatteryLevelL(%d)"), aState - EBatteryLevelLevel0 ) ); - iBatteryNotify->SetBatteryLevelL( aState - EBatteryLevelLevel0 ); - } - } - - if ( !iSysApPsmController ) // created here if first state change has not occurred yet - { - iSysApPsmController = CSysApPsmController::NewL( *this ); - } - - if ( iSysApPsmController ) - { - if ( iSysApPsmController->FullPsmEnabled() ) - { - iBatteryNotify->SetBatteryStateL( EAknBatteryIndicatorPowerSave ); - } - else - { - iBatteryNotify->SetBatteryStateL( EAknBatteryIndicatorNormal ); - } - } - - if ( iSysApBatteryInfoController ) - { - iSysApBatteryInfoController->BatteryLevelUpdatedL(); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UpdateSignalBarsL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::UpdateSignalBarsL() - { - UpdateSignalBarsL(iSysApEtelConnector->GetSignalBars()); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UpdateSignalBarsL( const TInt aState ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::UpdateSignalBarsL( const TInt aState ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::UpdateSignalBarsL aState: %d"), aState ) ); - - if( aState == KAknSignalOffLineMode || (iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive) ) - { - iSignalNotify->SetSignalLevelL( KAknSignalOffLineMode ); - } - else if( aState <= 0 ) - { - // Do not update indicator show zero bars if we should be showing X over bars - // This is required for indicator to work correctly in BT SAP mode. - // Cannot use check for BT SAP enabled status, as zero bars notify comes before enabled status changes. - if ( !iIgnoreZeroNetworkBarNotifications ) - { - iSignalNotify->SetSignalLevelL( 0 ); - } - } - else - { - iSignalNotify->SetSignalLevelL( aState ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetSignalIndicatorL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetSignalIndicatorL() - { - TSysApNetworkMode networkMode( ESysApGSM ); - - TInt networkModeFromNetworkInfo( StateOfProperty( KPSUidNetworkInfo, KNWTelephonyNetworkMode ) ); - if ( networkModeFromNetworkInfo == ENWNetworkModeWcdma ) - { - networkMode = ESysApWCDMA; - } - else - { - networkMode = ESysApGSM; - } - - TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorL: networkMode = %d" ), networkMode ) ); - - if( iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive ) - { - // The device is in Offline Mode - if ( iSysApFeatureManager->Supported( KSysApFeatureIdGprs_G_Icon ) ) - { - iSignalNotify->SetGprsStateL( EAknSignalGprsIndicatorOff ); - } - else - { - iSignalNotify->SetCommonPacketDataStateL( EAknSignalCommonPacketDataIndicatorOff ); - } - iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); - iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff); - } - else - { - // The device is in Online Mode - switch ( networkMode ) - { - case ESysApGSM: - SetSignalIndicatorGsmL(); - break; - - case ESysApWCDMA: - SetSignalIndicatorWcdmaL(); - break; - - default: - break; - } + return EFalse; } } -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetSignalIndicatorGsmL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::SetSignalIndicatorGsmL() + +void CSysApAppUi::PopupNote() { - TInt signalGprsIndicatorState( 0 ); - TInt signalIndicatorState( 0 ); - TInt bearerValue = EBearerUnknown; - - if(iSysApConnectionMonitorObserver) - { - bearerValue = iSysApConnectionMonitorObserver->GetBearerValue(); - } - - if(bearerValue == EBearerEdgeGPRS) - { - TInt egprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue ); - TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGsmL gprsStatus: %d" ), egprsStatus ) ); - iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); - iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff ); - switch ( egprsStatus ) - { - case EPSGprsContextActive: - signalGprsIndicatorState = EAknSignalEdgeIndicatorContext; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorContext; - iGprsActivated = ETrue; - iGprsSuspended = EFalse; - HandleGprsNotesL(); - break; - - case EPSGprsContextActivating: - signalGprsIndicatorState = EAknSignalEdgeIndicatorEstablishingContext; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorEstablishingContext; - iGprsActivated = EFalse; - iGprsSuspended = EFalse; - break; - - case EPSGprsSuspend: - signalGprsIndicatorState = EAknSignalEdgeIndicatorSuspended; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorSuspended; - iGprsSuspended = ETrue; - HandleGprsNotesL(); - break; - - case EPSGprsAttach: - signalGprsIndicatorState = EAknSignalEdgeIndicatorAttached; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorAttached; - iGprsActivated = EFalse; - iGprsSuspended = EFalse; - break; - - case EPSGprsMultibleContextActive: - signalGprsIndicatorState = EAknSignalEdgeIndicatorMultipdp; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorMultipdp; - iGprsActivated = ETrue; - iGprsSuspended = EFalse; - HandleGprsNotesL(); - break; - - case EPSGprsUnattached: - default: - signalGprsIndicatorState = EAknSignalEdgeIndicatorOff; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorOff; - iGprsSuspendedNoteShown = EFalse; - iGprsActivated = EFalse; - iGprsSuspended = EFalse; - iCallActivated = EFalse; - break; - } - } - else - { - - TInt gprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue ); - TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGsmL gprsStatus: %d" ), gprsStatus ) ); - iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); - iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff ); - switch ( gprsStatus ) - { - case EPSGprsContextActive: - signalGprsIndicatorState = EAknSignalGprsIndicatorContext; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorContext; - iGprsActivated = ETrue; - iGprsSuspended = EFalse; - HandleGprsNotesL(); - break; - - case EPSGprsContextActivating: - signalGprsIndicatorState = EAknSignalGprsIndicatorEstablishingContext; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorEstablishingContext; - iGprsActivated = EFalse; - iGprsSuspended = EFalse; - break; - - case EPSGprsSuspend: - signalGprsIndicatorState = EAknSignalGprsIndicatorSuspended; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorSuspended; - iGprsSuspended = ETrue; - HandleGprsNotesL(); - break; - - case EPSGprsAttach: - signalGprsIndicatorState = EAknSignalGprsIndicatorAttached; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorAttached; - iGprsActivated = EFalse; - iGprsSuspended = EFalse; - break; - - case EPSGprsMultibleContextActive: - signalGprsIndicatorState = EAknSignalGprsIndicatorMultipdp; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorMultipdp; - iGprsActivated = ETrue; - iGprsSuspended = EFalse; - HandleGprsNotesL(); - break; - - case EPSGprsUnattached: - default: - signalGprsIndicatorState = EAknSignalGprsIndicatorOff; - signalIndicatorState = EAknSignalCommonPacketDataIndicatorOff; - iGprsSuspendedNoteShown = EFalse; - iGprsActivated = EFalse; - iGprsSuspended = EFalse; - iCallActivated = EFalse; - break; - } - } - - if(bearerValue == EBearerEdgeGPRS) //EdgeGPRS connection - { - if( iSysApFeatureManager->Supported( KSysApFeatureIdUseEdgeGPRSIcon ) ) - { - iSignalNotify->SetEdgeStateL( signalGprsIndicatorState ); - } - else - { - iSignalNotify->SetCommonPacketDataStateL( signalIndicatorState ); - } - } - else - { - - if ( iSysApFeatureManager->Supported( KSysApFeatureIdGprs_G_Icon ) ) - { - iSignalNotify->SetGprsStateL( signalGprsIndicatorState ); - } - else - { - TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGsmL SetCommonPacketDataStateL( %d )" ), signalIndicatorState ) ); - iSignalNotify->SetCommonPacketDataStateL( signalIndicatorState ); - } - } + iIgnoreNextPowerKeyUpEvent = ETrue; + // TRACES( RDebug::Print( _L("CSysApAppUi::Key was consumed") ) ); + _LIT(KPowerPressKey,"Short power key"); + HBufC* aString = HBufC16::NewLC(50); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString } -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetSignalIndicatorWcdmaL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::SetSignalIndicatorWcdmaL() - { - TInt wcdmaStatus; - wcdmaStatus = StateOfProperty( KUidSystemCategory, KPSUidWcdmaStatusValue ); - TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorWcdmaL: wcdmaStatus: %d" ), wcdmaStatus ) ); - if ( iSysApFeatureManager->Supported( KSysApFeatureIdGprs_G_Icon ) ) - { - iSignalNotify->SetGprsStateL( EAknSignalGprsIndicatorOff ); - } - else - { - iSignalNotify->SetCommonPacketDataStateL( EAknSignalCommonPacketDataIndicatorOff ); - } +// ---------------------------------------------------------------------------- +// CSysApAppUi::SetUsbAttachStatus +// ---------------------------------------------------------------------------- +#ifndef RD_MULTIPLE_DRIVE +void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) + { + // Prevent double beep when USB file transfer gets activated but + // allow MMC inserted beep when: + // a) USB file transfer is active + // b) MMC is not inserted when USB cable is attached + iHideNextBeep = ( iMMCInserted && aUsbAttached ); + } +#else // RD_MULTIPLE_DRIVE +void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) + { + TRACES( RDebug::Print( + _L( "CSysApAppUi::SetUsbAttachStatus: aUsbAttached: %d" ), + aUsbAttached ) ); - TInt signalWcdmaIndicatorState; - TInt signalHsdpaIndicatorState; - - switch ( wcdmaStatus ) + if ( aUsbAttached ) { - case EPSWcdmaContextActive: - signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorContext; - signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorContext; - break; - case EPSWcdmaContextActivating: - signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorEstablishingContext; - signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorEstablishingContext; - break; - case EPSWcdmaSuspend: - signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorSuspended; - signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorSuspended; - break; - case EPSWcdmaAttach: - signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorAttached; - signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorAttached; - break; - case EPSWcdmaMultipleContextActive: - signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorMultipdp; - signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorMultipdp; - break; - case EPSWcdmaUnattached: - default: - signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorAvailable; - signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorAvailable; - break; + // For ignoring extra beeps caused by USB file transfer +/* iSysApDriveList->ResetDrivesInsertBeepIgnored(); + iSysApDriveList->MarkDrivesInsertBeepIgnored( iInsertedMemoryCards ); + // Will take care in next sub +*/ } + } +#endif // RD_MULTIPLE_DRIVE + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::UsbChargerDetector +// ---------------------------------------------------------------------------- +// +TSysApUsbChargerDetector& CSysApAppUi::UsbChargerDetector() + { + return iSysApUsbChargerDetector; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleAccessoryDisconnectedL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleAccessoryDisconnectedL() + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL()" ) ) ); + + + TAccMode accessoryState(EAccModeHandPortable); + if ( iSysApAccessoryObserver ) + { + accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); } - TBool showHsdpaAvailable = EFalse; - - if ( iSysApFeatureManager->Supported( KSysApFeatureIdUseHsdpaAvailableIcon ) ) + if ( accessoryState == EAccModeHandPortable ) { - // HSDPA Resource Availability information is a configurable feature. - showHsdpaAvailable = iSysApEtelConnector->HsdpaAvailable(); + iSysApLightsController->AccessoryConnectedL( EFalse ); + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 0 ); } - - TBool isHsdpaBearer = iSysApEtelConnector->IsBearerHsdpa(); - - TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorWcdmaL: isHdpaBearer=%d, showHsdpaAvailable=%d" ), - isHsdpaBearer, showHsdpaAvailable ) ); - - if ( isHsdpaBearer || showHsdpaAvailable ) - { - iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); - iSignalNotify->SetHsdpaStateL( signalHsdpaIndicatorState ); - } - else - { - iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff ); - iSignalNotify->SetWcdmaStateL( signalWcdmaIndicatorState ); - } - } + + SetIhfIndicatorL(); + SetHacIndicatorL(); -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleGprsNotesL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleGprsNotesL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleGprsNotesL" ) ) ); - if ( iSysApFeatureManager->Supported( KSysApFeatureIdGPRSNotes ) ) + // If lock disabled because of accessory, reactivate it, unless phone call or alarm is ongoing + if ( iKeyLockOnBeforeCradle ) { - // In WCDMA system, receiving or making calls has no effect to the possibly - // existing PDP contexts i.e. GPRS notes are not needed. - TInt networkMode = StateOfProperty( KPSUidNetworkInfo, KNWTelephonyNetworkMode ); - TRACES( RDebug::Print( _L("CSysApAppUi::HandleGprsNotesL: networkMode %d" ), networkMode ) ); - if ( networkMode != ENWNetworkModeWcdma ) + iKeyLockOnBeforeCradle = EFalse; + if ( !iKeyLockOnBeforeCall && !iKeyLockOnBeforeAlarm ) { - if ( iGprsActivated && iGprsSuspended && iCallActivated && !iGprsSuspendedNoteShown ) + if ( !iDeviceLockEnabled ) { - StartGprsSuspendedTimer(); + iKeyguardController->EnableKeyguard(ETrue); } - else if ( iGprsSuspendedNoteShown && !iGprsSuspended ) + else { - ShowUiNoteL( EGprsResumedNote ); - iGprsSuspendedNoteShown = EFalse; - iGprsSuspended = EFalse; - iCallActivated = EFalse; + iKeyguardController->EnableKeyguard(EFalse); } } } } -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetIndicatorStateL( TInt aIndicator, TInt aState ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetIndicatorStateL( const TInt aIndicator, const TInt aState ) const - { - CAknSmallIndicator* theIndicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) ); - theIndicator->SetIndicatorStateL( aState ); - CleanupStack::PopAndDestroy(); //theIndicator - } // ---------------------------------------------------------------------------- -// CSysApAppUi::GoOnlineL() +// CSysApAppUi::HandleAccessoryConnectedL() // ---------------------------------------------------------------------------- -void CSysApAppUi::GoOnlineL( TBool aDoProfileChange ) +void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState ) { - if ( iSysApFeatureManager->OfflineModeSupported() ) + TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d ) "), aAccessoryState ) ); + + if ( aAccessoryState == EAccModeWirelessHeadset || + aAccessoryState == EAccModeWiredHeadset || + aAccessoryState == EAccModeHeadphones ) + { + } + else if ( aAccessoryState == EAccModeLoopset ) + { + } + else if ( aAccessoryState == EAccModeTextDevice ) { - TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: going from off-line into on-line: aDoProfileChange=%d" ), aDoProfileChange ) ); - // in case profile change is not needed, event handling for subsequent profile changes are must be allowed - iHandleNextProfileEvent = !aDoProfileChange; - iActivateBt = iSysApOfflineModeController->MustBtBeActivated(); + } + else if ( aAccessoryState == EAccModeWirelessCarKit || aAccessoryState == EAccModeWiredCarKit ) + { + } + else if ( aAccessoryState == EAccModeTVOut ) + { + } + else if (aAccessoryState == EAccModeHDMI ) + { + } + + TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); + TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: swState: %d"), swState ) ); + + if( UiReady() || swState == ESwStateSecurityCheck ) + { + iSysApLightsController->AccessoryConnectedL( ETrue ); + } - if ( aDoProfileChange ) + if ( ( ! iSysApOfflineModeController->OfflineModeActive() )) + { + if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) < 1 ) + // accessory not connected already + { + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 1 ); + } + } + + // Carkit and music stand have also light on permanently option that needs to be checked + if( aAccessoryState == EAccModeWiredCarKit || aAccessoryState == EAccModeMusicStand ) + { + // When device is placed on a handsfree cradle, keyguard must be disabled (unless device is locked) + // Note: It is assumed that if carkit/music stand is connected, the phone is in the cradle. + if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCall || iKeyLockOnBeforeAlarm ) { - TRAPD( err, ActivateProfileL( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode ) ) ); - if ( err == KErrNotFound ) + iKeyLockOnBeforeCradle = ETrue; + + if ( iKeyLockEnabled && !iDeviceLockEnabled ) { - // Activate general profile instead, if previously used profile was not found - TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: Previously used profile was not found, restoring to general profile" ) ) ); - ActivateProfileL(KGeneralProfileId); + iKeyguardController->DisableKeyguard(EFalse); + } + } + } + SetIhfIndicatorL(); + SetHacIndicatorL(); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SetHacIndicatorL() +// ---------------------------------------------------------------------------- +void CSysApAppUi::SetHacIndicatorL() + { + + if ( !iSysApCenRepHacSettingObserver ) + { + // Do nothing if HAC setting observer has not been created yet + // This occurs in case some party is trying to set HAC indicator during + // ConstructL(), e.g. when switching from offline to online during startup + TRACES( RDebug::Print( _L("CSysApAppUi::SetHacIndicatorL: do nothing, HAC observer does not exist yet") ) ); + return; + } + + if ( iSysApCenRepHacSettingObserver->HacMode() ) + { + TBool accessoryConnected ( EFalse ); + + TAccMode accMode(EAccModeHandPortable); + + if ( iSysApAccessoryObserver ) + { + accMode = iSysApAccessoryObserver->GetAccessoryMode(); + + if ( accMode != EAccModeHandPortable ) + { + accessoryConnected = ETrue; } } - iSysApOfflineModeController->SwitchFromOfflineToOnlineModeL(); - TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: iActivateBt = %d" ), iActivateBt ) ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::GoOfflineL() -// ---------------------------------------------------------------------------- +// TInt indicatorState = EAknIndicatorStateOn; -void CSysApAppUi::GoOfflineL() - { - if ( iSysApFeatureManager->OfflineModeSupported() ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::GoOfflineL" ) ) ); - iHandleNextProfileEvent = EFalse; - iDeactivateBt = ETrue; - ActivateProfileL( KOfflineModeProfileId ); - iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SwitchFromOnlineToOfflineModeL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::SwitchFromOnlineToOfflineModeL() - { -/* if ( iSysApFeatureManager->FmTxSupported() ) - { - TFmTxState state = static_cast(StateOfProperty( KPSUidHWRMFmTx, KHWRMFmTxStatus )); - switch ( state ) + if ( !accessoryConnected ) // When accessory is not connected, check offline and call state { - case EFmTxStateActive: - case EFmTxStateInactive: - case EFmTxStateScanning: - ShowQueryL( ESysApUseFmTxInOfflineQuery ); // show "use fm tx in offline?" if FM TX is on - break; - - default: - // do nothing - break; - } - } -*/ iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); - } + if ( OfflineModeActive() ) // HAC indicator is not shown in offline mode + { + // indicatorState = EAknIndicatorStateOff; + } + else + { + // during active call with IHF activated HAC indicator is not shown + TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); + if ( callState < KErrNone ) + { + callState = EPSCTsyCallStateNone; + } -// ---------------------------------------------------------------------------- -// CSysApAppUi::OfflineModeChangedL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::OfflineModeChangedL() - { -#ifdef SYSAP_USE_STARTUP_UI_PHASE - // if UI is not ready, don't update indicators - if ( !UiReady() ) - { - return; - } -#endif // SYSAP_USE_STARTUP_UI_PHASE - - // Update network bar indicator - if ( OfflineModeActive() ) - { - UpdateSignalBarsL( KAknSignalOffLineMode ); + if ( callState != EPSCTsyCallStateNone && IhfEnabledL() ) + { + // indicatorState = EAknIndicatorStateOff; + } + } + + } + else + { + // If an accessory is connected, HAC indicator should not be shown +// indicatorState = EAknIndicatorStateOff; + } + + // SetIndicatorStateL( EAknIndicatorHAC, indicatorState ); + } else { - UpdateSignalBarsL(); - } - - // Update network mode indicator - SetSignalIndicatorL(); - - // Update HAC indicator - SetHacIndicatorL(); + // If HAC is not active, always disable indicator regardless of accessory state + // SetIndicatorStateL( EAknIndicatorHAC, EAknIndicatorStateOff ); + } + + } -// ---------------------------------------------------------------------------- -// CSysApAppUi::OfflineModeActive() -// ---------------------------------------------------------------------------- -TBool CSysApAppUi::OfflineModeActive() - { - return iSysApOfflineModeController->OfflineModeActive(); - } // ---------------------------------------------------------------------------- // CSysApAppUi::DoNotActivateBt() @@ -2258,57 +1338,23 @@ iSysApOfflineModeController->DoNotActivateBt(); } -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetBtPowerState() -// ---------------------------------------------------------------------------- -TInt CSysApAppUi::SetBtPowerState( TBool aBtState ) - { - if ( iSysApBtController ) - { - return iSysApBtController->SetPowerState( aBtState ); - } - else - { - return KErrNotReady; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::KeyLockState() const -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::KeyLockState() const - { - return iKeyLockEnabled; - } // ---------------------------------------------------------------------------- -// CSysApAppUi::DeviceLockState() const +// CSysApAppUi::IhfEnabledL // ---------------------------------------------------------------------------- -TBool CSysApAppUi::DeviceLockState() const - { - return iDeviceLockEnabled; - } -/* -// ---------------------------------------------------------------------------- -// CSysApAppUi::ChangeFmTxStateL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::ChangeFmTxStateL( TBool aEnable ) +TBool CSysApAppUi::IhfEnabledL() { - // disable fm transmission - CHWRMFmTx* fmtx = CHWRMFmTx::NewLC(); - if ( aEnable ) - { - fmtx->EnableL(); - } - else - { - fmtx->DisableL(); - } - CleanupStack::PopAndDestroy( fmtx ); - } -*/ + TRACES( RDebug::Print( _L("CSysApAppUi::IhfEnabledL(): iSysApAudioRoutingObserver=0x%x"), iSysApAudioRoutingObserver ) ); + + if ( !iSysApAudioRoutingObserver ) // create observer if needed + { + iSysApAudioRoutingObserver = CSysApAudioRoutingObserver::NewL( *this ); + } + + return iSysApAudioRoutingObserver->IhfEnabled(); + } + // ---------------------------------------------------------------------------- // CSysApAppUi::SetIhfIndicatorL() @@ -2334,786 +1380,100 @@ if( (callState != EPSCTsyCallStateNone && IhfEnabledL() && !accessoryConnected) || accMode == EAccModeMusicStand ) // Music stand always shows IHF indicator { - SetIndicatorStateL( EAknIndicatorIHFActive, EAknIndicatorStateOn ); - if ( accMode == EAccModeMusicStand ) { - // hide other accessory indicators to prevent displaying of duplicate icons in some cases - // e.g. when wireless hf is connected - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); + // do nothing } } else { - SetIndicatorStateL( EAknIndicatorIHFActive, EAknIndicatorStateOff ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleSmsStorageNotificationL: aSimStoreFull: %d "), aSimStoreFull ) ); - - if ( aSimStoreFull ) - { - HBufC* noteStringBuf; - noteStringBuf = StringLoader::LoadLC( R_QTN_MEMLO_MEMORY_LOW_SIM_MES, iEikonEnv ); - TPtr textBuffer = noteStringBuf->Des(); - iSysApMsgSimMemLowQuery->StartL( textBuffer ); - CleanupStack::PopAndDestroy(); - } - - SetEnvelopeIndicatorL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleNspsRawKeyEventL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleNspsRawKeyEventL() - { -#ifdef __SYSAP_MODULE_TEST - ModuleTestShowUiNoteL( _L("Network wakeup from NSPS") ); -#endif - - if ( iSysApEtelConnector ) - { - iSysApEtelConnector->CommandNetCsWakeupOnNsps(); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleNetworkNspsNotification aNspsStatus:%d, iNsps:%d )" ), aNspsStatus, iNsps ) ); - if( iSysApNspsHandler ) - { - if( aNspsStatus == RMmCustomAPI::ENspsOn ) - { - if( !iNsps ) - { -#ifdef __SYSAP_MODULE_TEST - TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS on") ) ); -#endif - iSysApNspsHandler->SetNspsOn(); - iNsps = ETrue; - } - } - else if( aNspsStatus == RMmCustomAPI::ENspsOff ) - { - if( iNsps ) - { -#ifdef __SYSAP_MODULE_TEST - TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS off") ) ); -#endif - iSysApNspsHandler->SetNspsOff(); - iNsps = EFalse; - } - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleMessageTonePlayingQuitability( TInt aTonePlayingStatus ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleMessageTonePlayingQuitability( TInt aTonePlayingStatus ) - { - if( iSysApNspsHandler ) - { - if( aTonePlayingStatus == ECoreAppUIsStopTonePlaying ) - { - iSysApNspsHandler->SetMessageToneNotPlaying(); - } - else if( aTonePlayingStatus == ECoreAppUIsTonePlaying ) - { - iSysApNspsHandler->SetMessageTonePlaying(); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ActivateKeyeventForwardingForLights() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ActivateKeyeventForwardingForLights(TBool aActivate) - { - if( iSysApNspsHandler ) - { - if ( aActivate ) - { - iSysApNspsHandler->ActivateKeyeventForwardingForLights(); - } - else - { - iSysApNspsHandler->DeActivateKeyeventForwardingForLights(); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::StartShutDownTimerOnAlarmAndChargingStates() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::StartShutDownTimerOnAlarmAndChargingStates() - { - if( !iAlarmOrChargingStateShutdownStarted ) - { - if ( !iTimer ) - { - TRAPD( err, iTimer = CPeriodic::NewL( EPriorityNormal ) ); - - if ( err != KErrNone ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::StartShutDownTimerOnAlarmAndChargingStates: CPeriodic::NewL failed: %d"), err ) ); - return; - } - } - iTimer->Cancel(); - iTimer->Start( KDelayBeforeShuttingDownInAlarmAndChargingStates, - KDelayBeforeShuttingDownInAlarmAndChargingStates, - TCallBack( DoShutdownOnAlarmStateAfterCallBack, this ) ); - iAlarmOrChargingStateShutdownStarted = ETrue; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoShutdownOnAlarmStateAfterCallBack( TAny* aObject ) -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::DoShutdownOnAlarmStateAfterCallBack( TAny* aObject ) - { - CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); - - if ( appUi->iTimer ) - { - appUi->iTimer->Cancel(); - } - - TRAP_IGNORE( appUi->DoShutdownL( EFalse, KDummyReason ) ); - - return KErrNone; - } - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION -// ---------------------------------------------------------------------------- -// CSysApAppUi::StartAnimTiming() -// ---------------------------------------------------------------------------- -void CSysApAppUi::StartAnimTiming() - { - TRACES( RDebug::Print( _L("CSysApAppUi::StartAnimTiming() Start animation timer, time %d ms" ), iAnimationShowingTime ) ); - - if ( !iAnimTimer ) - { - TRAPD( err, iAnimTimer = CPeriodic::NewL( EPriorityNormal ) ); - - if ( err != KErrNone ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::StartAnimTiming() CPeriodic::NewL failed %d " ), err ) ); - return; - } - } - - iAnimTimer->Start( - iAnimationShowingTime*KCoefficientToMakeMicroToMilliSeconds, - iAnimationShowingTime*KCoefficientToMakeMicroToMilliSeconds, - TCallBack( DoStopAnimTiming, this ) ); - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoStopAnimTiming( TAny* aObject ) -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::DoStopAnimTiming( TAny* aObject ) - { - TInt err(KErrNone); - CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); - - // This method could theoretically be called by two timers (iAnimTimer and one in CSysApShutdownAnimation), - // so a check is needed to prevent multiple executions. - if ( !(appUi->iShutdownContinued) ) - { - appUi->iShutdownContinued = ETrue; - - TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Animation timer completed or animation skipped" ) ) ); - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - if ( appUi->iAnimTimer ) - { - appUi->iAnimTimer->Cancel(); - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - if ( appUi->iTimer ) - { - appUi->iTimer->Cancel(); - } - - TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Call ContinueShutdown(...)" ) ) ); - appUi->ContinueShutdown(); - TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() end") ) ); - } - - return err; - } - - -// ---------------------------------------------------------------------------- -// CSysApAppUi::StartGprsSuspendedTimer() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::StartGprsSuspendedTimer() - { - TRACES( RDebug::Print( _L("CSysApAppUi::StartGprsSuspendedTimer()") ) ); - if( !iAlarmOrChargingStateShutdownStarted ) // not relevant if shutting down - { - if ( !iTimer ) - { - TRAPD( err, iTimer = CPeriodic::NewL( EPriorityNormal ) ); - - if ( err != KErrNone ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::StartGprsSuspendedTimer: CPeriodic::NewL failed: %d"), err ) ); - return; - } - } - - iTimer->Cancel(); - iTimer->Start( KDelayBeforeShowingGprsSuspendedNote, - KDelayBeforeShowingGprsSuspendedNote, - TCallBack( ShowGprsSuspendedNoteAfterCallBack, this ) ); + // do nothing } } // ---------------------------------------------------------------------------- -// CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack( TAny* aObject ) +// CSysApAppUi::DoLightsTimeoutChangedL // ---------------------------------------------------------------------------- - -TInt CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack( TAny* aObject ) +void CSysApAppUi::DoLightsTimeoutChangedL( const TInt aTimeout ) { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack") ) ); - - CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); - - if ( appUi->iTimer ) - { - appUi->iTimer->Cancel(); - } - - // Note is needed if call is still active and used network is not WCDMA - TInt callType = appUi->StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallType ); - TInt networkMode = appUi->StateOfProperty( KPSUidNetworkInfo, KNWTelephonyNetworkMode ); - TRACES( RDebug::Print( - _L("CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack: callType %d networkMode %d"), - callType, networkMode ) ); - if ( EPSCTsyCallTypeCSVoice == callType && ENWNetworkModeWcdma != networkMode ) - { - appUi->iGprsSuspendedNoteShown = ETrue; - TRAP_IGNORE( appUi->ShowUiNoteL( EGprsSuspendedNote ) ); - } - return KErrNone; + iSysApLightsController->DoLightsTimeoutChangedL( aTimeout ); } + // ---------------------------------------------------------------------------- -// CSysApAppUi::HandleAccessoryConnectedL() +// CSysApAppUi::DoSwStateNormalConstructionL() // ---------------------------------------------------------------------------- -void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState ) +void CSysApAppUi::DoSwStateNormalConstructionL() { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d ) "), aAccessoryState ) ); + // Let's ensure that the lights will remain on for 15 secs after sw state normal + User::ResetInactivityTime(); - if ( aAccessoryState == EAccModeWirelessHeadset || - aAccessoryState == EAccModeWiredHeadset || - aAccessoryState == EAccModeHeadphones ) - { - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if ( aAccessoryState == EAccModeLoopset ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if ( aAccessoryState == EAccModeTextDevice ) + TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : START" ) ) ); + + // In case of unexpected reset (e.g. hidden boot) the keylock must be enabled silently. Locking is done + // prior to time-consuming initializations, because otherwise UI is in unlocked state for a few seconds. + if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive ) == 1 ) { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if ( aAccessoryState == EAccModeWirelessCarKit || aAccessoryState == EAccModeWiredCarKit ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if ( aAccessoryState == EAccModeTVOut ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOn ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - } - else if (aAccessoryState == EAccModeHDMI ) - { - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOn ); - } - - TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); - TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: swState: %d"), swState ) ); - - if( UiReady() || swState == ESwStateSecurityCheck ) - { - iSysApLightsController->AccessoryConnectedL( ETrue ); + TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL: enabling keylock") ) ); + iKeyguardController->EnableKeyguard(ETrue); } - if ( ( ! iIgnoreAccessorySpecificProfileChanges ) && ( ! iSysApOfflineModeController->OfflineModeActive() ) ) - { - TInt profileId( 0 ); - TInt currentProfile( 0 ); - currentProfile = ActiveProfileId(); + // Initiate bearer change observation +// iSysApConnectionMonitorObserver = CSysApConnectionMonitorObserver::NewL( *this ); - if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) < 1 ) - // accessory not connected already - { - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 1 ); - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, currentProfile ); - } + TRACES( RDebug::Print( _L("SysAp: trying CSystemLock::NewL" ) ) ); + iSysApSystemLock = CSystemLock::NewL(); - if ( aAccessoryState == EAccModeWirelessCarKit ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApWirelessCarkit ); - } - else if( aAccessoryState == EAccModeWiredHeadset || - aAccessoryState == EAccModeWirelessHeadset ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApHeadset ); - } - else if( aAccessoryState == EAccModeLoopset ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApLoopset ); - } - else if( aAccessoryState == EAccModeTextDevice ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApTty ); - } - else if( aAccessoryState == EAccModeTVOut || aAccessoryState == EAccModeHDMI ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApTvOut ); - } - else if( aAccessoryState == EAccModeHeadphones ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApHeadphones ); - } - else if ( aAccessoryState == EAccModeWiredCarKit ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApCarkit ); - } - else if ( aAccessoryState == EAccModeMusicStand ) - { - profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApMusicStand ); - } - - // Carkit and music stand have also light on permanently option that needs to be checked - if( aAccessoryState == EAccModeWiredCarKit || aAccessoryState == EAccModeMusicStand ) - { - // When device is placed on a handsfree cradle, keyguard must be disabled (unless device is locked) - // Note: It is assumed that if carkit/music stand is connected, the phone is in the cradle. - if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCall || iKeyLockOnBeforeAlarm ) - { - iKeyLockOnBeforeCradle = ETrue; - - if ( iKeyLockEnabled && !iDeviceLockEnabled ) - { - KeyLock().DisableWithoutNote(); - } - } - } - - if( profileId != KActiveProfile ) - { - /*-1 because the first item in Accessory default profiles shared data values - is KActiveProfile and that must be subtracted from the index of profile to be activated*/ - - profileId -= 1; - - TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: current profile: %d, accessory profile: %d" ), - currentProfile, profileId ) ); - - if ( profileId != currentProfile ) - { - iAccessoryJustConnected = ETrue; - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired, 1 ); - ActivateProfileL( profileId ); - } - } + + if ( iSysApFeatureManager->Supported( KSysApFeatureIdBatteryInfoPopup ) ) + { + iSysApBatteryInfoController = CSysApBatteryInfoController::NewL( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsConf, + KCoreAppUIsBatteryInformationLowThreshold ) ); } - SetIhfIndicatorL(); - SetHacIndicatorL(); + TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : END" ) ) ); } -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleAccessoryDisconnectedL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleAccessoryDisconnectedL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL()" ) ) ); - TAccMode accessoryState(EAccModeHandPortable); - if ( iSysApAccessoryObserver ) - { - accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); - } +// ---------------------------------------------------------------------------- +// CSysApAppUi::DoSimChangedFromPreviousBootL() +// ---------------------------------------------------------------------------- - if ( accessoryState == EAccModeHandPortable ) - { - SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); - SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); - - iSysApLightsController->AccessoryConnectedL( EFalse ); - - if ( ! iIgnoreAccessorySpecificProfileChanges ) - { - TInt activeProfile ( ActiveProfileId() ); +void CSysApAppUi::DoSimChangedFromPreviousBootL() + { + TRACES( RDebug::Print( _L("CSysApAppUi::DoSimChangedFromPreviousBootL: iSimChangedDone=%d" ), iSimChangedDone ) ); - TInt activeProfileBeforeConnectingAccessory( - iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected ) - ); - if ( activeProfileBeforeConnectingAccessory < 0 ) // error - { - activeProfileBeforeConnectingAccessory = 0; // General Profile - } - TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL: active profile now: %d, active profile before: %d," ), - activeProfile, activeProfileBeforeConnectingAccessory ) ); - - if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired ) == 1 ) - { - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired, 0 ); - if ( activeProfile != activeProfileBeforeConnectingAccessory && ! iSysApOfflineModeController->OfflineModeActive() ) - { - ActivateProfileL( activeProfileBeforeConnectingAccessory ); - } - } - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 0 ); - } - } - - SetIhfIndicatorL(); - SetHacIndicatorL(); - - // If lock disabled because of accessory, reactivate it, unless phone call or alarm is ongoing - if ( iKeyLockOnBeforeCradle ) + if ( !iSimChangedDone ) { - iKeyLockOnBeforeCradle = EFalse; - if ( !iKeyLockOnBeforeCall && !iKeyLockOnBeforeAlarm ) - { - if ( !iDeviceLockEnabled ) - { - KeyLock().EnableKeyLock(); - } - else - { - KeyLock().EnableAutoLockEmulation(); - } - } + iSimChangedDone = ETrue; + CSysApSimChanged* simChanged = CSysApSimChanged::NewL( *this, iEikonEnv->FsSession() ); + CleanupStack::PushL( simChanged ); + simChanged->HandleSimChangedL(); + CleanupStack::PopAndDestroy( simChanged ); } } -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleAccessoryProfileInStartupL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleAccessoryProfileInStartupL() - { - TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL" ) ) ); - - if ( !iSysApOfflineModeController->OfflineModeActive() ) - { - iIgnoreAccessorySpecificProfileChanges = EFalse; - TBool accessoryConnectedInShutdown( EFalse ); - TInt accessoryTemp( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) ); - if ( accessoryTemp == 1 ) - { - accessoryConnectedInShutdown = ETrue; - } - - TBool accessoryConnectedNow ( EFalse ); - - TAccMode accessoryState(EAccModeHandPortable); - if ( iSysApAccessoryObserver ) - { - accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); - } - - if ( accessoryState != EAccModeHandPortable ) - { - accessoryConnectedNow = ETrue; - } - TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL: accessoryConnectedInShutdown: %d, accessoryConnectedNow: %d" ), - accessoryConnectedInShutdown, accessoryConnectedNow ) ); - - if ( accessoryConnectedInShutdown && !accessoryConnectedNow ) - { - HandleAccessoryDisconnectedL(); - } - else if ( !accessoryConnectedInShutdown && accessoryConnectedNow ) - { - HandleAccessoryConnectedL( accessoryState ); - } - else if ( !accessoryConnectedNow ) - { - TInt activeProfile ( ActiveProfileId() ); - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, activeProfile ); - } - } - } - -#ifndef RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ResolveUidFromThread() -// ---------------------------------------------------------------------------- -TInt32 CSysApAppUi::ResolveUidFromThread( TUint aThreadId ) const - { - TInt resolvedUid = 0; - - RThread appThread; - TInt err = appThread.Open( aThreadId ); - - if ( err == KErrNone ) - { - resolvedUid = appThread.SecureId().iId; - } - - appThread.Close(); - - TRACES( RDebug::Print( _L("CSysApAppUi::ResolveUidFromThread: err=%d, aThreadId=%d, resolvedUid=0x%x"), - err, aThreadId, resolvedUid ) ); - - return resolvedUid; - } // ---------------------------------------------------------------------------- -// CSysApAppUi::CloseUIAppsInHotSwapL() +// CSysApAppUi::IgnoreZeroNetworkBarNotifications // ---------------------------------------------------------------------------- -void CSysApAppUi::CloseUIAppsInHotSwapL() +// +void CSysApAppUi::IgnoreZeroNetworkBarNotifications(TBool aIgnore) { - TRACES( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL") ) ); - - CArrayFixFlat* wgIds=new(ELeave) CArrayFixFlat(4); - CleanupStack::PushL(wgIds); - User::LeaveIfError(iCoeEnv->WsSession().WindowGroupList(0, wgIds)); - TInt lastEntry=wgIds->Count()-1; - TRACES( RDebug::Print( _L( "CSysApAppUi::CloseUIAppsInHotSwapL: Found %d UI applications running." ), lastEntry + 1 ) ); - TInt numberOfApplicationsToShutDown( 0 ); - iApplicationScanningRoundNumber++; - - for ( TInt i=lastEntry; i>=0; i--) - { - CApaWindowGroupName* doomedApp = CApaWindowGroupName::NewLC(iCoeEnv->WsSession(),wgIds->At(i)); - - TBool systemApp = doomedApp->IsSystem(); - TBool hiddenApp = doomedApp->Hidden(); - - if ( systemApp || hiddenApp ) - { - TRACES ( - TPtrC caption=doomedApp->Caption(); - RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Privileged app \"%S\" UID 0x%x will not be closed, system: %d, hidden: %d" ), - &caption, - doomedApp->AppUid().iUid, - systemApp, - hiddenApp); - ); - } - else if ( ( iFileManagerCloseDisabled && doomedApp->AppUid().iUid == KFileManagerAppUid ) || - doomedApp->AppUid().iUid == KAutolockAppUid ) - { - // An additional failure protection: Autolock must not be closed in any circumstances - TRACES ( - TPtrC caption=doomedApp->Caption(); - RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Privileged app \"%S\" will not be closed, UID 0x%x"), - &caption, - doomedApp->AppUid().iUid ); - ); - } - else if ( doomedApp->AppUid().iUid == 0 && !iTimeToKill ) - { -#ifdef _DEBUG - TApaTask task(iCoeEnv->WsSession()); - task.SetWgId(wgIds->At(i)); - TUint threadId = (TUint)(task.ThreadId()); - TInt32 uid = ResolveUidFromThread( threadId ); - // CApaWindowGroupName stores the application UID, and in early application startup state AppUid()-method returns 0 - // In order not to accidentally close application that hasn't yet its window group properly set up, decicision whether - // to close the application is postponed, in maximum to the end of the waiting period. - TRACES ( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Unknown app will not be closed yet, threadId=%d, UID 0x%x, size=%d"), - threadId, uid, sizeof(TApaTask) ) ); -#endif // _DEBUG - numberOfApplicationsToShutDown++; // wait note must be displayed - } - else - { - numberOfApplicationsToShutDown++; - TApaTask* task = new (ELeave) TApaTask(iCoeEnv->WsSession()); - CleanupDeletePushL(task); - task->SetWgId(wgIds->At(i)); - - TRACES ( - const TDesC& caption = doomedApp->Caption(); - const TDesC& docname = doomedApp->DocName(); - const TDesC& wgname = doomedApp->WindowGroupName(); - TUid uid = doomedApp->AppUid(); - RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Closing app \"%S\" (ThreadId %d, WgId %d, UID 0x%X); Docname: %S, WGName : %S"), - &caption, - (TUint)(task->ThreadId()), - wgIds->At(i), - uid.iUid, - &docname, - &wgname); - ); - - ResolveUidFromThread( (TUint)(task->ThreadId()) ); - - if ( iApplicationScanningRoundNumber == 1 ) - { - task->EndTask(); // applications are kindly requested to close themselves on the first round - } - else if ( iTimeToKill ) - { - TBool doKill = ETrue; - - // final check, window group may still be uninitialized so use thread id for checking UID - if ( doomedApp->AppUid().iUid == 0 ) - { - if ( ResolveUidFromThread( (TUint)(task->ThreadId()) ) == KAutolockAppUid ) - { - doKill = EFalse; - } - } - - if ( doKill ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Killing app \"%S\""), &caption ) ); - task->KillTask(); // used after timeout on the last round - } - } - - CleanupStack::PopAndDestroy(); // task - } - CleanupStack::PopAndDestroy(); // doomedApp - } - CleanupStack::PopAndDestroy(); // wgIds - - if ( numberOfApplicationsToShutDown > 0 && iApplicationScanningRoundNumber <= KMaxExitTimeInHotSwap ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Show wait note, unless already showing") ) ); - if ( !iSysApWaitNote ) - { - HBufC* noteStringBuf = StringLoader::LoadLC( R_QTN_MEMC_WAIT_EJECT, iEikonEnv ); - iSysApWaitNote = CSysApWaitNote::NewL( iSysApFeatureManager->CoverDisplaySupported() ); - iSysApWaitNote->ShowNoteL( EClosingApplicationsNote, noteStringBuf ); - CleanupStack::PopAndDestroy(); - } - - if ( iApplicationScanningRoundNumber >= KMaxExitTimeInHotSwap ) - { - iTimeToKill = ETrue; - } - - if ( !iSysApTimer ) - { - iSysApTimer = new ( ELeave ) CSysApTimer( *this ); - } - - iSysApTimer->ActivateTimerL( KApplicationScanningInterval ); - } - else - { - iFileManagerCloseDisabled = EFalse; - CompleteAppsShuttingInHotSwapL(); - } + iIgnoreZeroNetworkBarNotifications = aIgnore; } -#endif // RD_MULTIPLE_DRIVE + // ---------------------------------------------------------------------------- -// CSysApAppUi::TimerExpiredL() +// CSysApAppUi::SwitchFromOnlineToOfflineModeL() // ---------------------------------------------------------------------------- -void CSysApAppUi::TimerExpiredL() +void CSysApAppUi::SwitchFromOnlineToOfflineModeL() { -#ifndef RD_MULTIPLE_DRIVE - CloseUIAppsInHotSwapL(); -#endif // RD_MULTIPLE_DRIVE + iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); } -#ifndef RD_MULTIPLE_DRIVE -// ---------------------------------------------------------------------------- -// CSysApAppUi::CompleteAppsShuttingInHotSwapL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::CompleteAppsShuttingInHotSwapL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::CompleteAppsShuttingInHotSwapL iMMCEjectUsed=%d, iMMCInserted=%d"), iMMCEjectUsed, iMMCInserted ) ); - CancelWaitNote(); - - if ( iMMCEjectUsed ) // From Powerkey Menu - { - DismountMMC(); - TRACES( RDebug::Print( _L( "CSysApAppUi::CompleteAppsShuttingInHotSwapL: Show note: Remove MMC and press OK...." ) ) ); - ShowQueryL( ESysApRemoveMmcNote ); - } - else if ( !iMMCInserted ) // The MMC might have been already re-mounted, that's why !iMMCInserted - { - ShowMMCDismountedDialogL(); - } - } -#endif // RD_MULTIPLE_DRIVE // ---------------------------------------------------------------------------- // CSysApAppUi::InitCloseSimApplicationsL() @@ -3125,6 +1485,7 @@ CloseSimApplicationsL(); } + // ---------------------------------------------------------------------------- // CSysApAppUi::CloseSimApplicationsL() // ---------------------------------------------------------------------------- @@ -3186,6 +1547,7 @@ } } + // ---------------------------------------------------------------------------- // CSysApAppUi::DoCloseSimApplicationsAfterCallBack // ---------------------------------------------------------------------------- @@ -3203,3377 +1565,7 @@ return KErrNone; } -// ---------------------------------------------------------------------------- -// CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) -// ---------------------------------------------------------------------------- -void CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiAlerting aAlerting:%d"), aAlerting ) ); - if ( aAlerting ) - { - TInt swState; - RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); - - if( swState == ESwStateCharging ) - { - SetStarterState( RStarterSession::EAlarm ); - } - } - - iSysApLightsController->AlarmOccuredL( aAlerting ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiKeyLockOff aKeyLockOff:%d, devicelock:%d"), - aKeyLockOff, iDeviceLockEnabled ) ); - - if( aKeyLockOff ) - { - // Notification to release keypad might come several times if e.g. calls are received - if ( !iKeyLockOnBeforeAlarm ) - { - if ( iKeyLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeCall ) - { - iKeyLockOnBeforeAlarm = ETrue; - } - } - KeyLock().DisableWithoutNote(); - } - else - { - if (iDeviceLockEnabled) - { - // Re-enable keylock in devicelock case only if phone call is not ongoing or is - // connected. Otherwise e.g. messages can be read using softkeys during ongoing call. - TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); - if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateConnected ) - { - KeyLock().EnableAutoLockEmulation(); - } - } - else if ( iKeyLockOnBeforeAlarm && !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeCall ) - { - KeyLock().EnableKeyLock(); - } - iKeyLockOnBeforeAlarm = EFalse; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleLightsRequireL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleLightsRequireL() const - { - iSysApLightsController->HandleLightsRequireL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleRawKeyEventLightsRequireL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleRawKeyEventLightsRequireL() const - { - iSysApLightsController->HandleRawKeyEventLightsRequireL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightParameter ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const - { - iSysApLightsController->HandleForcedLightsVTRequireL( aLightsParameter ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightParameter ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const - { - iSysApLightsController->HandleForcedLightsSSRequireL( aLightsParameter ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightParameter ) -// ---------------------------------------------------------------------------- -void CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const - { - iSysApLightsController->HandleForcedLightsATCRequireL( aLightsParameter ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SwitchLightsOnSoftRejectL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::SwitchLightsOnSoftRejectL() - { - iSysApLightsController->SwitchLightsOnSoftRejectL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::StateOfProperty() -// ---------------------------------------------------------------------------- -TInt CSysApAppUi::StateOfProperty( const TUid& aCategory, const TUint aKey ) const - { - TInt err( KErrNone ); - TInt value( 0 ); - err = RProperty::Get( aCategory, aKey, value ); - if ( err ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::StateOfProperty. RProperty::Get: err=%d"), err ) ); - return err; - } - return value; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::BluetoothPowerMode() -// ---------------------------------------------------------------------------- -TInt CSysApAppUi::BluetoothPowerMode() const - { - return iSysApCenRepBtObserver->BluetoothPowerMode(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ActivateProfileL( const TInt aProfileId ) const -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ActivateProfileL( const TInt aProfileId ) const - { - TRACES( RDebug::Print( _L("CSysApAppUi::ActivateProfile aProfileId: %d"), aProfileId ) ); - //No use of returning the Profile error code since it only tells if the activation was succesfull or not. - iProfileEngine->SetActiveProfileL( aProfileId ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ActivateOnlineProfileL() const -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ActivateOnlineProfileL() const - { - ActivateProfileL( iProfileToBeActivated ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ActiveProfileNameL( TPtr aProfileName ) const -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ActiveProfileNameL( TPtr aProfileName ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::ActiveProfileNameL START") ) ); - MProfile* profile = iProfileEngine->ActiveProfileL(); - const MProfileName& mProfileName = profile->ProfileName(); - aProfileName = mProfileName.Name(); - profile->Release(); - TRACES( RDebug::Print( _L("CSysApAppUi::ActiveProfileNameL END") ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::CheckSilentModeL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::CheckSilentModeL() - { - TBool isSilent( EFalse ); - MProfile* profile = iProfileEngine->ActiveProfileL(); - isSilent = profile->IsSilent(); - profile->Release(); - if ( isSilent ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::CheckSilentModeL: active profile is SILENT") ) ); - iSysApLightsController->SetSilentModeOn( ETrue ); - } - else - { - TRACES( RDebug::Print( _L("CSysApAppUi::CheckSilentModeL: active profile is NOT SILENT") ) ); - iSysApLightsController->SetSilentModeOn( EFalse ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleProfileChangedL( const TInt aValue ) -// ---------------------------------------------------------------------------- -void CSysApAppUi::HandleProfileChangedL( const TInt aNewProfileId ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleProfileChangedL: aNewProfileId=%d"), aNewProfileId ) ); - CheckSilentModeL(); - if ( iHandleNextProfileEvent ) - { - if ( iAccessoryJustConnected ) - { - iAccessoryJustConnected = EFalse; - } - else - { - // if the user delibarately changes profiles, the selected profile will - // remain active after disconnecting an accessory. - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired, 0 ); - } - - // Added as a part of REQ 415-6750 : Conditional UI-note for "Activated profile" - TInt noNeedToShowTheNote = 0; // if True, then note should not be shown - TInt err = KErrNone; - - err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsProfileActivatedNote, - noNeedToShowTheNote ); - /* - If there occured an error, it is likely caused by the non-existing property. - So trying to set it only if no error occured for maintaining the default behavior. - */ - if( KErrNone == err ) - { - TInt error = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsProfileActivatedNote, - ECoreAppUIsProfileActivatedNoteNotShown ); - } - - if(!noNeedToShowTheNote) // The value doesn't deny the showing, then... - { - ShowProfileNoteL(); - } - } - - if ( aNewProfileId != KOfflineModeProfileId ) - { - iActiveProfileBeforeOfflineMode = aNewProfileId; - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode, aNewProfileId ); - } - - if ( aNewProfileId == KOfflineModeProfileId && ! iSysApOfflineModeController->OfflineModeActive() ) - { - if ( BtSapEnabled() ) - { - // Choosing "Offline Mode" will disconnect BT SAP - // SwitchFromOnlineToOfflineModeL() will be called from CSysApBtSapController - iSysApBtSapController->SwitchingToOffline(); - iSysApBtSapController->Disconnect(); - } - else - { - SwitchFromOnlineToOfflineModeL(); - } - } - else if ( aNewProfileId != KOfflineModeProfileId && iSysApOfflineModeController->OfflineModeActive() ) - { - if ( BtSapEnabled() ) - { - iSysApOfflineModeController->DoNotActivateRF(); // Will be activated after BT SAP disconnection - } - iSysApOfflineModeController->SwitchFromOfflineToOnlineModeL(); - } - iHandleNextProfileEvent = ETrue; - } - - -// ---------------------------------------------------------------------------- -// CSysApAppUi::RestoreProfileL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::RestoreProfileL( const TBool aOffline ) - { - iHandleNextProfileEvent = EFalse; - if ( aOffline ) - { - ActivateProfileL( KOfflineModeProfileId ); - } - else - { - ActivateProfileL( iActiveProfileBeforeOfflineMode ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ActiveProfileId() -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::ActiveProfileId() - { - return iProfileEngine->ActiveProfileId(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowPowerKeyPopUpMenuL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShowPowerKeyPopUpMenuL() - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL iPowerKeyPopupMenuActive: %d" ), - iPowerKeyPopupMenuActive ) ); - - if ( !iPowerKeyPopupMenuActive && !iDisablePowerkeyMenu - && iSysApPowerKeyMenuObserver ) // normal state construction has been executed - { - iPowerKeyPopupMenuDismissed = EFalse; - iPowerkeyMenuPowerOffShown = EFalse; - CancelGlobalListQuery(); - - iGlobalListQuery = CAknGlobalListQuery::NewL(); - - iSysApPowerKeyMenuObserver->Cancel(); - - CDesCArray* profileNameCDesCArray; // Array for Powerkey Menu items - - RArray itemIdArray; // needed for cover UI - CleanupClosePushL(itemIdArray); - - // make sure old profile names array is clean - delete iProfileNamesArray; - iProfileNamesArray = NULL; - - // Must pop iProfileNamesArray here as cannot leave trap harness with uneven push/pop count. - // This is because profileEngine doesn't provide non-LC version of ProfilesNamesArrayLC - TRAPD( err, - iProfileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); - CleanupStack::Pop(); - ); - - if ( err != KErrNone ) - { - // creating menu failed, return (i.e. just don't show the menu) - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL iProfileEngine->ProfilesNamesArrayLC() ERROR: %d" ), err ) ); - iNumberOfProfileNamesInPowerKeyMenu = 0; - } - else - { - iNumberOfProfileNamesInPowerKeyMenu = iProfileNamesArray->MdcaCount(); - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL iNumberOfProfileNamesInPowerKeyMenu: %d" ), - iNumberOfProfileNamesInPowerKeyMenu ) ); - } - - if ( BtSapEnabled() ) - { - profileNameCDesCArray = new( ELeave ) CDesCArrayFlat( iNumberOfProfileNamesInPowerKeyMenu + 4 ); - } - else - { - profileNameCDesCArray = new( ELeave ) CDesCArrayFlat( iNumberOfProfileNamesInPowerKeyMenu + 3 ); - } - - CleanupStack::PushL( profileNameCDesCArray ); - profileNameCDesCArray->Reset(); - HBufC* itemStringBuf; - - TInt powerMenuItemIndex( 0 ); - - // "Switch off" menu item - if ( !IsEncryptionOperationOngoingL() ) - { - itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_SWITCH_OFF, iEikonEnv ); - profileNameCDesCArray->InsertL( 0, itemStringBuf->Des() ); - CleanupStack::PopAndDestroy(); // itemStringBuf - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemSwitchOff); - } - iPowerkeyMenuPowerOffShown = ETrue; - powerMenuItemIndex++; - } - - iPowerkeyMenuLockKeypadShown = EFalse; - iPowerkeyMenuExitSapShown = EFalse; - iPowerkeyMenuLockSystemShown = EFalse; - iPowerkeyMenuEjectShown = EFalse; - - iPowerkeyMenuLockKeypadSelection = KErrAccessDenied; - iPowerkeyMenuExitSapSelection = KErrAccessDenied; - iPowerkeyMenuLockSystemSelection = KErrAccessDenied; - -#ifndef RD_MULTIPLE_DRIVE - iPowerkeyMenuEjectSelection = KErrAccessDenied; -#else // RD_MULTIPLE_DRIVE - iPowerkeyMenuEjectSelectionBase = KErrAccessDenied; -#endif // RD_MULTIPLE_DRIVE - - // "Lock keypad" menu item - - TInt callState ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); - TInt callType ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallType ) ); - if ( !( callState == EPSCTsyCallStateConnected && callType == EPSCTsyCallTypeH324Multimedia ) ) - { - if ( iSysApFeatureManager->GripNotSupported() || - ( (!iSysApFeatureManager->GripNotSupported() ) && ( StateOfProperty( KPSUidHWRM, KHWRMGripStatus ) == EPSHWRMGripClosed ) ) ) - // "Lock keypad" command is shown always when there is no grip, and if there - // there is no grip, only when the grip is closed. - { - if ( CKeyLockPolicyApi::KeyguardAllowed() ) - { - if ( iSysApFeatureManager->PenEnabled() ) - { - itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_LOCK_DISPLAY, iEikonEnv ); - } - else - { - itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_LOCK_KEYS, iEikonEnv ); - } - profileNameCDesCArray->AppendL( itemStringBuf->Des() ); - CleanupStack::PopAndDestroy(); // itemStringBuf - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemLockKeypad); - } - iPowerkeyMenuLockKeypadShown = ETrue; - iPowerkeyMenuLockKeypadSelection = powerMenuItemIndex; - powerMenuItemIndex++; - } - } - } - - // "Exit SIM access profile" menu item - - if ( BtSapEnabled() ) - { - TRACES( RDebug::Print(_L( "CSysApAppUi::ShowPowerKeyPopUpMenuL: show \"Exit SIM access profile\" item" ) ) ); - itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_EXIT_SIM_ACCESS, iEikonEnv ); - profileNameCDesCArray->AppendL( itemStringBuf->Des() ); - CleanupStack::PopAndDestroy(); // itemStringBuf - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemExitBtSap); - } - iPowerkeyMenuExitSapShown = ETrue; - iPowerkeyMenuExitSapSelection = powerMenuItemIndex; - powerMenuItemIndex++; - } - - // Profile menu items - - TInt arrayIndex ( 0 ); - TBufC profileName; - - for ( arrayIndex = 0; arrayIndex < iNumberOfProfileNamesInPowerKeyMenu; arrayIndex++ ) - { - profileName = iProfileNamesArray->MdcaPoint( arrayIndex ); - TPtr profileNamePtr = profileName.Des(); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); - profileNameCDesCArray->AppendL( profileNamePtr ); - - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - TInt profileId = ( iProfileNamesArray->ProfileName( arrayIndex ) )->Id(); - itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemProfileItemBase+profileId); - } - powerMenuItemIndex++; - } - - // "Lock device" menu item - - callState = StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ); - - TInt devLockStatus( EAutolockStatusUninitialized ); - devLockStatus = StateOfProperty( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus ); // check whether Autolock has been started - - - if ( callState == EPSCTsyCallStateNone && devLockStatus != EAutolockStatusUninitialized ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: adding \"Lock device\", devLockStatus=%d" ), devLockStatus ) ); - iPowerkeyMenuLockSystemShown = ETrue; - itemStringBuf = StringLoader::LoadLC( R_QTN_SET_SEC_LOCK_SYSTEM, iEikonEnv ); - profileNameCDesCArray->AppendL( itemStringBuf->Des() ); - CleanupStack::PopAndDestroy(); // itemStringBuf - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemLockDevice); - } - iPowerkeyMenuLockSystemShown = ETrue; - iPowerkeyMenuLockSystemSelection = powerMenuItemIndex; - powerMenuItemIndex++; - } - - // "Eject MMC" menu item - - TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); - -#ifndef RD_MULTIPLE_DRIVE - if ( !IsEncryptionOperationOngoingL() ) - { - if ( iSysApFeatureManager->MmcHotSwapSupported() && - iMMCInserted && - iSysApFeatureManager->EjectRequiredInPowerMenu() && - propertyValue != KUsbPersonalityIdMS ) - { - iPowerkeyMenuEjectShown = ETrue; - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: adding \"Eject\"" ) ) ); - itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_EJECT_MMC, iEikonEnv ); - profileNameCDesCArray->AppendL( itemStringBuf->Des() ); - CleanupStack::PopAndDestroy(); // itemStringBuf - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemEjectMMC); - } - iPowerkeyMenuEjectShown = ETrue; - iPowerkeyMenuEjectSelection = powerMenuItemIndex; - powerMenuItemIndex++; - } - } - -#else // RD_MULTIPLE_DRIVE - if ( !IsEncryptionOperationOngoingL() ) - { - if ( iSysApFeatureManager->MmcHotSwapSupported() && - iSysApFeatureManager->EjectRequiredInPowerMenu() && - propertyValue != KUsbPersonalityIdMS ) - { - // Reset old eject status and dialog - iSysApDriveList->ResetDrivesToEject(); - if ( iSysApConfirmationQuery ) - { - if ( iSysApConfirmationQuery->CurrentQuery() == ESysApEjectMmcQuery ) - { - iSysApConfirmationQuery->Cancel(); - } - } - - // Append memory cards for eject selection - TInt count( iInsertedMemoryCards.Count() ); - for ( TInt i( 0 ); i < count; ++i ) - { - itemStringBuf = iSysApDriveList->GetFormattedDriveNameLC( - iInsertedMemoryCards[ i ].iDrive, - R_QTN_PWRC_EJECT_MEMORY_STORAGE ); - profileNameCDesCArray->AppendL( *itemStringBuf ); - CleanupStack::PopAndDestroy( itemStringBuf ); - - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL( SecondaryDisplay::EPwrMenuItemEjectItemBase + i ); - } - } - if ( count > 0 ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: added \"Eject\"" ) ) ); - iPowerkeyMenuEjectShown = ETrue; - iPowerkeyMenuEjectSelectionBase = powerMenuItemIndex; - powerMenuItemIndex += count; - } - } - } -#endif // RD_MULTIPLE_DRIVE - - // Activate/deactive power save mode - if ( iSysApPsmController ) // variable feature, not create if power save is not used - { - TBool showActivate = !(iSysApPsmController->FullPsmEnabled()); - - TInt textId = ( showActivate ? R_QTN_PWRC_ACTIVATE_POWER_SAVING : R_QTN_PWRC_DEACTIVATE_POWER_SAVING ); - - itemStringBuf = StringLoader::LoadLC( textId, iEikonEnv ); - iSysApPsmController->SetNextUiOperation( showActivate ); - - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - itemIdArray.AppendL( showActivate ? - SecondaryDisplay::EPwrMenuItemActivatePowerSaving : - SecondaryDisplay::EPwrMenuItemDeactivatePowerSaving ); - } - - profileNameCDesCArray->AppendL( itemStringBuf->Des() ); - CleanupStack::PopAndDestroy( itemStringBuf ); - - iSysApPsmController->SetUiItemId( powerMenuItemIndex ); - powerMenuItemIndex++; - } - - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL NumberOfAllItemsInPowerKeyMenu: %d" ), - profileNameCDesCArray->Count() ) ); - - iSysApPowerKeyMenuObserver->Start(); - - // Set secondary display data if necessary - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - CAknSDData* sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, SecondaryDisplay::ECmdShowPowerKeyListQuery, KNullDesC8); - sd->InsertGlobalListQueryItemIdsL(itemIdArray); - iGlobalListQuery->SetSecondaryDisplayData(sd); // ownership to notifier client - } - - iGlobalListQuery->ShowListQueryL( (MDesCArray*) profileNameCDesCArray, - iSysApPowerKeyMenuObserver->iStatus, - KProfileListInitialIndex ); - - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: list query shown" ) ) ); - - CleanupStack::PopAndDestroy( profileNameCDesCArray ); // profileNameCDesCArray - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: profileNameCDesCArray popped" ) ) ); - - CleanupStack::Pop(&itemIdArray); - itemIdArray.Close(); - - // Without following variable set ETrue powerkey up event would change the hightlighted item to be - // the second one instead of the wanted first one. - iIgnoreNextPowerKeyUpEvent = ETrue; - - if ( iSysApBatteryInfoController ) - { - iSysApBatteryInfoController->PowerMenuShownL(); - } - - TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL:end" ) ) ); - } -} - -// ---------------------------------------------------------------------------- -// CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL( TInt aSelection ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL( TInt aSelection ) - { - iPowerKeyPopupMenuDismissed = ETrue; - iPowerKeyPopupMenuActive = EFalse; - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: START aSelection:%d" ), aSelection ) ); - if ( aSelection == KPowerKeyMenuSelectionCancelled ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: Powerkey menu cancelled" ) ) ); - } - else if( aSelection < KPowerKeyMenuSelectionCancelled ) - { - iIgnoreNextPowerKeyUpEvent = EFalse; - } - else - { - TInt firstProfileItemIndex( 1 + Max( 0, iPowerkeyMenuLockKeypadSelection, iPowerkeyMenuExitSapSelection ) ); // index of "General" profile - - if ( aSelection == KPowerKeyMenuSelectionSwitchOff ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Switch off\" selected" ) ) ); - DoShutdownL( EFalse, KDummyReason ); - } - - else if ( iPowerkeyMenuLockKeypadShown && aSelection == iPowerkeyMenuLockKeypadSelection ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Lock keypad\" selected" ) ) ); - KeyLock().EnableKeyLock(); - } - - else if ( iPowerkeyMenuExitSapShown && aSelection == iPowerkeyMenuExitSapSelection ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Exit SAP\" selected" ) ) ); - ShowQueryL( ESysApBtSapDisconnectQuery ); - } - - else if ( aSelection < firstProfileItemIndex + iNumberOfProfileNamesInPowerKeyMenu ) - { - __ASSERT_DEBUG( iProfileNamesArray, User::Invariant() ); - - if ( iProfileNamesArray ) - { - iProfileToBeActivated = ( iProfileNamesArray->ProfileName( aSelection - firstProfileItemIndex ) )->Id(); - - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: profile id: %d selected" ), iProfileToBeActivated ) ); - if ( ! iSysApOfflineModeController->OfflineModeActive() || - ( iProfileToBeActivated ) == KOfflineModeProfileId ) - { - ActivateProfileL( iProfileToBeActivated ); - } - else - { - // iProfileToBeActivated profile will be activated from iSysApOfflineModeController if ok - iSysApOfflineModeController->GoOnlineIfOkL(); - } - } - } - - else if ( iPowerkeyMenuLockSystemShown && aSelection == iPowerkeyMenuLockSystemSelection ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Lock system\" selected" ) ) ); - iSysApSystemLock->SetLockedL(); - } -#ifndef RD_MULTIPLE_DRIVE - else if ( iPowerkeyMenuEjectShown && aSelection == iPowerkeyMenuEjectSelection ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Eject\" selected" ) ) ); - ShowQueryL( ESysApEjectMmcQuery ); - } -#else // RD_MULTIPLE_DRIVE - else if ( iPowerkeyMenuEjectShown && - aSelection >= iPowerkeyMenuEjectSelectionBase && - aSelection < iPowerkeyMenuEjectSelectionBase + iInsertedMemoryCards.Count() ) - { - iDriveToEject = - iInsertedMemoryCards[ aSelection - iPowerkeyMenuEjectSelectionBase ].iDrive; - TRACES( RDebug::Print( - _L( "CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Eject\" selected, drive=%d" ), - iDriveToEject ) ); - iSysApDriveList->ResetDrivesToEject(); - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - EjectMMCL(); - } -#endif // RD_MULTIPLE_DRIVE - else if ( iSysApPsmController && aSelection == iSysApPsmController->UiItemId() ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Activate|Deactivate power save\" selected" ) ) ); - iSysApPsmController->DoEnableFullPsm( iSysApPsmController->NextUiOperation() ); - } - - } - - delete iProfileNamesArray; - iProfileNamesArray = NULL; - - TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: END" ) ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::SetDeviceLockEnabledL aLockEnabled:%d" ), aLockEnabled ) ); - TBool currentState( iDeviceLockEnabled ); - - iDeviceLockEnabled = aLockEnabled; - - if ( currentState != iDeviceLockEnabled ) // filter out unnecessary light status modifications - { - iSysApLightsController->DeviceLockStateChangedL( iDeviceLockEnabled ); - } - - if( iDeviceLockEnabled ) - { - if( iKeyLockEnabled ) - { - KeyLock().DisableWithoutNote(); - } - } - else - { - // let's not activate keylock in case device lock was disabled during call or in cradle - iKeyLockOnBeforeCall = EFalse; - iKeyLockOnBeforeCradle = EFalse; - - // Memory card needs to be unlocked when device is unlocked - if ( iSysApFeatureManager->MmcHotSwapSupported() ) - { - RunUnlockNotifierL(); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoNotEnableKeylock() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DoNotEnableKeylock() - { - if ( !iKeyLockOnBeforeCradle ) - { - iShowkeypadActivatedNoteAfterSoftReject = iKeyLockOnBeforeCall; - } - - iKeyLockOnBeforeCall = EFalse; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoShutdownL( const TBool aReset, const TSWStartupReason aSWStartupReason ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DoShutdownL( const TBool aReset, const TInt aResetReason ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: aResetReason:%d, aReset:%d" ), - aResetReason, aReset ) ); -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - TBool animationenabled( EFalse ); -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - if( OkToInitiateShutdown() ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was OkToToInitiateShutdown" ) ) ); - - - if ( !aReset && iSysApFeatureManager->Supported(KSysApFeatureIdGoodbyeNote) ) - { - TRAPD( ignore, ShowShutdownNoteL() ); - if ( ignore ) ignore = 0; // hide compiler warning about not using variable - } - - if( !aReset ) - { - #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION - TRAPD( err, ShowAnimationL() ); - if ( err ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); - CompleteShutdown(aReset, aResetReason); - } - } - else // aReset - { - CompleteShutdown(aReset, aResetReason); - } - #else // RD_STARTUP_ANIMATION_CUSTOMIZATION - TRAPD( err, animationenabled = ShowAnimationL() ); - if ( err ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); - } - } - - if ( !animationenabled ) - { - CompleteShutdown(aReset, aResetReason); - } - #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - } - else - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was not OkToToInitiateShutdown" ) ) ); - } - TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: END" ) ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ContinueShutdown() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ContinueShutdown() - { - TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() started" ) ) ); - CompleteShutdown(); - TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() completed" ) ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowAnimationL() -// ---------------------------------------------------------------------------- - -#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION -void -#else // RD_STARTUP_ANIMATION_CUSTOMIZATION -TBool -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION -CSysApAppUi::ShowAnimationL() - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): START" ) ) ); - - TRACES( RDebug::Print( _L("CSysApAppUi::ShowAnimationL: Initialise shutdown animation") ) ); - -#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION - - PrepareForShutdownAnimation(); - - iSysApShutdownAnimation = CSysApShutdownAnimation::NewL( *iSysApShutdownImage ); - iSysApShutdownAnimation->Play( TCallBack( DoStopAnimTiming, this ) ); - - TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): End" ) ) ); - -#else // RD_STARTUP_ANIMATION_CUSTOMIZATION - iSysApShutdownAnimation = CSysApShutdownAnimation::NewL( this ); - AddToStackL( iSysApShutdownAnimation ); - iAnimationShowingTime = iSysApShutdownAnimation->ShowingTime(); - TRACES( RDebug::Print( _L("CSysApAppUi::ShowAnimationL: Shutdown animation initialised. Animation time = %d") ,iAnimationShowingTime) ); - - TBool ret_val( EFalse ); - - if ( iAnimationShowingTime ) - { - if ( iSysApFeatureManager->CoverDisplaySupported() ) - { - // Construct mediator observer - iSysApMediatorObserver = CSysApMediatorObserver::NewL( this ); - - // Sync animation - TInt err = iSysApMediatorObserver->SyncShutdownAnimation(); - - if ( err != KErrNone ) - { - // Pretend coverUI synced instantly if error in issuing command. - ShutdownAnimationSyncOK(); - } - } - else - { - // Pretend coverUI synced instantly when it is not supported. - ShutdownAnimationSyncOK(); - } - - ret_val = ETrue; - } - - TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): returns: %d" ),ret_val ) ); - return ret_val; -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - } - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShutdownAnimationSyncOK() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShutdownAnimationSyncOK() - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShutdownAnimationSyncOK(): Call PrepareForShutdownAnimation()" ) ) ); - PrepareForShutdownAnimation();//SysAp's internal preparation for ShutDown with animation - TRACES( RDebug::Print(_L("CSysApAppUi::ShutdownAnimationSyncOK(): Called PrepareForShutdownAnimation()" ) ) ); - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SkipShutdownAnimation() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SkipShutdownAnimation() - { - TRACES( RDebug::Print(_L("CSysApAppUi::SkipShutdownAnimation() " ) ) ); - -#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION - if ( iSysApShutdownAnimation ) - { - iSysApShutdownAnimation->Cancel(); - } -#else // RD_STARTUP_ANIMATION_CUSTOMIZATION - if ( iAnimationShowingTime ) - { - iSysApShutdownAnimation->EndAnimation(); - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::NotifyShutdownAnimationSkip() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::NotifyShutdownAnimationSkip() - { - TRACES( RDebug::Print(_L("CSysApAppUi::NotifyShutdownAnimationSkip() " ) ) ); - - if ( iSysApMediatorObserver ) - { - iSysApMediatorObserver->ShutdownAnimationSkipped(); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::CompleteShutdown() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::CompleteShutdown( const TBool aReset, const TInt aResetReason ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): START" ) ) ); - - PrepareForShutdownImage();//SysAp's internal preparation for ShutDown with image - - FreeResources(); - - if ( aReset ) - { - __ASSERT_DEBUG( aResetReason >= RStarterSession::ELanguageSwitchReset && - aResetReason <= RStarterSession::EDataRestoreReset, - User::Invariant() ); - StarterSession().Reset( static_cast( aResetReason ) ); - } - else - { - StarterSession().Shutdown(); - } - - StarterSession().Close(); - - TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): END" ) ) ); - } - -#ifndef SYSAP_USE_STARTUP_UI_PHASE -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) -// This method is not called after boot has finished. -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: %d" ), aSwState ) ); - - switch ( aSwState ) - { - case RStarterSession::ENormal: - SetStatusPaneLayoutL( ESysApNormal ); - break; - case RStarterSession::ECharging: - SetStatusPaneLayoutL( ESysApCharging ); - break; - case RStarterSession::EAlarm: - SetStatusPaneLayoutL( ESysApAlarm ); - break; - default: - break; - }; - - TRAPD( simChangedErr, DoSimChangedFromPreviousBootL() ); - TRACES( RDebug::Print( _L("CSysApAppUi::DoStateChangedL: simChangedErr = %d" ), simChangedErr ) ); - simChangedErr = simChangedErr; // suppress 'variable not used' warning - LogsObserverL().HandleSimChangedCheckDoneL(); - - if ( iSysApFeatureManager->PowerSaveSupported() ) - { - // create controller before checking battery state, so that power saving can be enabled during boot if needed - if ( !iSysApPsmController ) // created only in first state change - { - iSysApPsmController = CSysApPsmController::NewL( *this ); - } - - // in charger boot explicitly disable partial power save mode - if ( aSwState == RStarterSession::ECharging && !iCharging ) - { - iSysApPsmController->ChargerConnected(); - iSysApPsmController->DoEnablePartialPsm( EFalse ); // disable partial power save now - } - } - - TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); - //Also Charging status will be updated with the following function. - UpdateBatteryBarsL( state ); - - if( IsStateNormal() ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL to normal state.") ) ); - - DoSwStateNormalConstructionL(); - - InitializeStatusPaneAreaL(); - CheckSilentModeL(); - HandleAccessoryProfileInStartupL(); - - if ( iSysApFeatureManager->MmcSupported() ) - { -#ifndef RD_MULTIPLE_DRIVE - MountMMC(); - MMCStatusChangedL(); - iHideFirstBeep = EFalse; -#else // RD_MULTIPLE_DRIVE - iSysApDriveList->MountDrive( iSysApDriveList->DefaultMemoryCard() ); - UpdateInsertedMemoryCardsL(); -#endif // RD_MULTIPLE_DRIVE - } - if ( iSysApFeatureManager->MmcHotSwapSupported() ) - { - iSysApMMCObserver->StartMountObserver(); - } - - - if ( iSysApPsmController ) - { - if ( iCharging ) // if charger is connected on boot PSM queries may need to be shown - { - HandleChargingStatusL( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); - } - } - - TInt batteryStatus = StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryStatus ); - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: batteryStatus %d" ), batteryStatus ) ); - if( batteryStatus == EBatteryStatusLow || batteryStatus == EBatteryStatusEmpty ) - { - // low and empty battery states are informed to the user in device startup - HandleBatteryStatusL( batteryStatus ); - } - else if ( iSysApPsmController && !iCharging ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: batteryStatus %d, iCharging %d -> disable partial psm" ), batteryStatus, iCharging ) ); - - iSysApPsmController->BatteryLow( EFalse ); - iSysApPsmController->DoEnablePartialPsm( EFalse ); - } - - iSysApBtController = CreateSysApBtControllerL( *this ); - iSysApBtSapController = CreateSysApBtSapControllerL( *this ); - - if ( iActivateBt ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Activating BT" ) ) ); - SetBtPowerState( ETrue ); - } - - if ( iDeactivateBt ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Deactivating BT" ) ) ); - SetBtPowerState( EFalse ); - } - iSysApLocationPrivacyIndicator = CreateSysApLocationPrivacyIndicatorL( *this ); - iSysApLocationPrivacyIndicator->InitL(); - - if ( ! iSysApUsbIndicatorController ) - { - TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); - if ( usbErr ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: error in constructing USB ind. controller %d" ), usbErr ) ); - } - } - - // Other late initializations. - // In order to prevent unexpected behaviour e.g. in OOM situations, these calls are made to ensure - // that the services are connected when they are needed for the first time. - if ( !StarterSession().Handle() ) - { - User::Leave( KErrBadHandle ); - } - - if ( !KeyLock().Handle() ) - { - User::Leave( KErrBadHandle ); - } - -#ifdef __SYSAP_MODULE_TEST - ModuleTestShowUiNoteL( _L("SysAp: SW state normal!") ); -#endif - } - - // Allow lights - iSysApLightsController->AllowLightsOn(); - } - -#else // SYSAP_USE_STARTUP_UI_PHASE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleUiReadyAfterBootL() -// Called when startup UI activities has been finished -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleUiReadyAfterBootL() - { - TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL" ) ) ); - - SetStatusPaneLayoutL( ESysApNormal ); - - TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); - //Also Charging status will be updated with the following function. - UpdateBatteryBarsL( state ); - - DoSwStateNormalConstructionL(); - - InitializeStatusPaneAreaL(); - CheckSilentModeL(); - HandleAccessoryProfileInStartupL(); - - if ( iSysApFeatureManager->MmcSupported() ) - { -#ifndef RD_MULTIPLE_DRIVE - MountMMC(); - MMCStatusChangedL(); - iHideFirstBeep = EFalse; -#else // RD_MULTIPLE_DRIVE - iSysApDriveList->MountDrive( iSysApDriveList->DefaultMemoryCard() ); - UpdateInsertedMemoryCardsL(); -#endif // RD_MULTIPLE_DRIVE - } - - if ( iSysApFeatureManager->MmcHotSwapSupported() ) - { - iSysApMMCObserver->StartMountObserver(); - } - - if ( iSysApPsmController ) - { - if ( iCharging ) // if charger is connected on boot PSM queries may need to be shown - { - HandleChargingStatusL( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); - } - } - - TInt batteryStatus = StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryStatus ); - TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: batteryStatus %d" ), batteryStatus ) ); - if( batteryStatus == EBatteryStatusLow || batteryStatus == EBatteryStatusEmpty ) - { - // low and empty battery states are informed to the user in device startup - HandleBatteryStatusL( batteryStatus ); - } - else if ( iSysApPsmController && !iCharging ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: batteryStatus %d, iCharging %d -> disable partial psm" ), batteryStatus, iCharging ) ); - - iSysApPsmController->BatteryLow( EFalse ); - iSysApPsmController->DoEnablePartialPsm( EFalse ); - } - - iSysApLocationPrivacyIndicator = CreateSysApLocationPrivacyIndicatorL( *this ); - iSysApLocationPrivacyIndicator->InitL(); - - if ( ! iSysApUsbIndicatorController ) - { - TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); - if ( usbErr ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: error in constructing USB ind. controller %d" ), usbErr ) ); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) -// This method is not called after boot has finished. -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: %d" ), aSwState ) ); - - switch ( aSwState ) - { - case RStarterSession::ENormal: - // status pane layout will updated when UI is ready - break; - case RStarterSession::ECharging: - SetStatusPaneLayoutL( ESysApCharging ); - break; - case RStarterSession::EAlarm: - SetStatusPaneLayoutL( ESysApAlarm ); - break; - default: - break; - }; - - TRAPD( simChangedErr, DoSimChangedFromPreviousBootL() ); - TRACES( RDebug::Print( _L("CSysApAppUi::DoStateChangedL: simChangedErr = %d" ), simChangedErr ) ); - simChangedErr = simChangedErr; // suppress 'variable not used' warning - LogsObserverL().HandleSimChangedCheckDoneL(); - - if ( iSysApFeatureManager->PowerSaveSupported() ) - { - // create controller before checking battery state, so that power saving can be enabled during boot if needed - if ( !iSysApPsmController ) // created only in first state change - { - iSysApPsmController = CSysApPsmController::NewL( *this ); - } - - // in charger boot explicitly disable partial power save mode - if ( aSwState == RStarterSession::ECharging ) - { - iSysApPsmController->ChargerConnected(); - iSysApPsmController->DoEnablePartialPsm( EFalse ); // disable partial power save now - } - } - - if ( aSwState == RStarterSession::ECharging || aSwState == RStarterSession::EAlarm ) - { - TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); - //Also Charging status will be updated with the following function. - UpdateBatteryBarsL( state ); - } - - if( IsStateNormal() ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL to normal state.") ) ); - - iSysApBtController = CreateSysApBtControllerL( *this ); - iSysApBtSapController = CreateSysApBtSapControllerL( *this ); - - if ( iActivateBt ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Activating BT" ) ) ); - SetBtPowerState( ETrue ); - } - - if ( iDeactivateBt ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Deactivating BT" ) ) ); - SetBtPowerState( EFalse ); - } - - // Other late initializations. - // In order to prevent unexpected behaviour e.g. in OOM situations, these calls are made to ensure - // that the services are connected when they are needed for the first time. - if ( !StarterSession().Handle() ) - { - User::Leave( KErrBadHandle ); - } - - if ( !KeyLock().Handle() ) - { - User::Leave( KErrBadHandle ); - } - -#ifdef __SYSAP_MODULE_TEST - ModuleTestShowUiNoteL( _L("SysAp: SW state normal!") ); -#endif - } - - // Allow lights - iSysApLightsController->AllowLightsOn(); - } - - -#endif // SYSAP_USE_STARTUP_UI_PHASE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UiReady() -// -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::UiReady() const - { -#ifdef SYSAP_USE_STARTUP_UI_PHASE - return iSysApStartupController->UiReady(); -#else // SYSAP_USE_STARTUP_UI_PHASE - // if startup UI phase information is not used, global system state normal is handled as UI idle state - return IsStateNormal(); -#endif // SYSAP_USE_STARTUP_UI_PHASE - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::PrepareForShutdownAnimation() -// ---------------------------------------------------------------------------- -void CSysApAppUi::PrepareForShutdownAnimation() - { - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() begin") ) ); - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() showtime = %d"), iAnimationShowingTime ) ); - if ( iAnimationShowingTime ) - { -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - static_cast(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDPowerOffTone ); - CancelGlobalListQuery(); - - if ( iSysApPowerKeyMenuObserver ) - { - iSysApPowerKeyMenuObserver->Cancel(); - } - - // deactivate notifiers before showing the shutdown image - AknNotifierController::CancelAllNotifications(); - AknNotifierController::HideAllNotifications(ETrue); - RWindowGroup groupWin = iCoeEnv->RootWin(); - iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); - iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); - iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); - - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() Draw background image" ) ) ); - - ShowShutdownImage( KBackgroundImageID ); - -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() Show Shutdown animation" ) ) ); - TInt err(0); - TRAP( err, iSysApShutdownAnimation->StartL( iLastPowerKeyWasShort ) ); - if ( err ) - { - TRACES( RDebug::Print( _L("SysAp: Shutdown animation fails. Error code: %d" ), err ) ); - // Start animation timing immediatily if animation starting fails. - // Otherwise animation will call StartAnimTiming when it is ready. - StartAnimTiming(); - } - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() end") ) ); - } - - -// ---------------------------------------------------------------------------- -// CSysApAppUi::PrepareForShutdownImage() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::PrepareForShutdownImage() - { - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() START" ) ) ); - - // If RD_STARTUP_ANIMATION_CUSTOMIZATION is enabled, the following actions are always taken in PrepareForShutdownAnimation -#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION - if ( !iAnimationShowingTime ) // actions already taken in PrepareForShutdownAnimation - { - static_cast(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDPowerOffTone ); - CancelGlobalListQuery(); - - if ( iSysApPowerKeyMenuObserver ) - { - iSysApPowerKeyMenuObserver->Cancel(); - } - - // deactivate notifiers before showing the shutdown image - AknNotifierController::CancelAllNotifications(); - AknNotifierController::HideAllNotifications(ETrue); - RWindowGroup groupWin = iCoeEnv->RootWin(); - iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); - iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); - } -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - -#ifndef __SYSAP_MODULE_TEST //to make errors during shutdown sequence being seen more easily - iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() Show Shutdown image" ) ) ); - ShowShutdownImage( EMbmSysapQgn_startup_screen ); -#endif - TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() END" ) ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetStatusPaneLauoutL( const TSysApPhoneState aState ) -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetStatusPaneLayoutL( const TSysApPhoneState aState ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::SetStatusPaneLayoutL aState: %d"), aState ) ); - if( aState == ESysApNormal ) - //Status pane cannot be even visible on Normal mode - { - StatusPane()->MakeVisible( EFalse ); - StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_EMPTY ); - } - else if( aState == ESysApCharging ) - //SysAp's statuspane is visible on Charging mode - { - StatusPane()->MakeVisible( ETrue ); - StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE ); - } - else if( aState == ESysApAlarm ) - { - if ( !Layout_Meta_Data::IsLandscapeOrientation() ) - { - // Portrait mode - StatusPane()->MakeVisible( ETrue ); - StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE ); - } - else - { - // Landscape mode - TInt layout = R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE; - // For side softkey devices, use different layout - if (AVKONENV->StatusPaneResIdForCurrentLayout(R_AVKON_STATUS_PANE_LAYOUT_USUAL) == R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT) - layout = R_AVKON_STACON_PANE_LAYOUT_EMPTY_SOFTKEYS_RIGHT; - else if (AVKONENV->StatusPaneResIdForCurrentLayout(R_AVKON_STATUS_PANE_LAYOUT_USUAL) == R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT) - layout = R_AVKON_STACON_PANE_LAYOUT_EMPTY_SOFTKEYS_LEFT; - - StatusPane()->MakeVisible( ETrue ); - StatusPane()->SwitchLayoutL( layout ); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::OkToInitiateShutdown() -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::OkToInitiateShutdown() - { - TInt swState; - RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); - - if( !iShutdownStarted && - swState == ESwStateStartingCriticalApps || - swState == ESwStateSelfTestOK || - swState == ESwStateSecurityCheck || - swState == ESwStateCriticalPhaseOK || - swState == ESwStateEmergencyCallsOnly || - swState == ESwStateCharging || - swState == ESwStateAlarm || - swState == ESwStateNormalRfOn || - swState == ESwStateNormalRfOff || - swState == ESwStateNormalBTSap || - swState == ESwStateFatalStartupError ) - { - iShutdownStarted = ETrue; - return ETrue; - } - else - { - return EFalse; - } - } - -/** - * To check the for an emergency call. - * - * @return ETrue if there is an emergency call active otherwise, EFalse. - */ -TBool IsEmergencyCall() - { - TBool retVal( EFalse ); - TInt err( KErrNone ); - TInt state( 0 ); - - err = RProperty::Get(KPSUidCtsyEmergencyCallInfo, KCTSYEmergencyCallInfo, state ); - if ( err == KErrNone && state ) - { - retVal = ETrue; - } - return retVal; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleCurrentCallStateChangeL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleCurrentCallStateChangeL( TInt aCurrentCallState ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: KUidCurrentCall: %d" ), aCurrentCallState ) ); - - if( iPowerKeyPopupMenuActive ) - { - CancelGlobalListQuery(); - } - - switch ( aCurrentCallState ) - { - case EPSCTsyCallStateRinging: - { - iSysApLightsController->CallComingInL( ETrue ); - // Disable keylock when a call is coming in - if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeAlarm ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateRinging: disable keylock") ) ); - iKeyLockOnBeforeCall = ETrue; - - if ( iKeyLockEnabled || iDeviceLockEnabled ) - { - if ( !iSysApFeatureManager->TouchUnlockStrokeSupported() ) - { - KeyLock().DisableWithoutNote(); - } - } - } - break; - } - - case EPSCTsyCallStateDialling: - { - // Disable keypad lock during an emergency call - // no need to disable the key lock when a call is made using the wireless car-kit - // but if the call is an emergency one then we will disable the keypad lock - if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateDialling: disable keylock") ) ); - iKeyLockOnBeforeCall = ETrue; - - if ( IsEmergencyCall() && (iKeyLockEnabled || iDeviceLockEnabled )) - { - KeyLock().DisableWithoutNote(); - } - } - - // Enable signal & network indicators when an emergency call is made in Offline Mode - if( iSysApOfflineModeController->OfflineModeActive() ) - { - // Signal indicators not updated with VoIP call - if ( StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) != EPSCTsyCallTypeVoIP) - { - iEmergencyCallActive = ETrue; - UpdateSignalBarsL(); - SetSignalIndicatorL(); - } - } - break; - } - - case EPSCTsyCallStateConnected: - { - if (StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) == EPSCTsyCallTypeCSVoice) - { - // Check if GPRS suspended note is required - iCallActivated = ETrue; - HandleGprsNotesL(); - } - if ( iDeviceLockEnabled ) - { - // Enable keylock via autolock emulation if device lock enabled. - // Otherwise e.g. messages can be read using softkeys during ongoing call. - KeyLock().EnableAutoLockEmulation(); - } - break; - } - - case EPSCTsyCallStateNone: - { - // Reset timers in ScreenSaver and Autolock - User::ResetInactivityTime(); - - if ( iEmergencyCallActive ) - { - iEmergencyCallActive = EFalse; - UpdateSignalBarsL( 0 ); - SetSignalIndicatorL(); - } - if ( iKeyLockOnBeforeCall ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateNone: enable keylock") ) ); - iKeyLockOnBeforeCall = EFalse; - if ( !iDeviceLockEnabled ) - { - if ( !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeAlarm && - !iSysApFeatureManager->TouchUnlockStrokeSupported() ) - { - if ( iSysApCenRepController->GetInt( KCRUidCommonTelephonySettings, KSettingsSummaryAfterCall ) == 1 ) - { - KeyLock().EnableWithoutNote(); // Let's not hide "Summary After Call" dialog - } - else - { - KeyLock().EnableKeyLock(); - } - } - } - else - { - KeyLock().EnableAutoLockEmulation(); - } - } - if ( iShowkeypadActivatedNoteAfterSoftReject ) - { - ShowUiNoteL( EKeypadActiveNote ); - iShowkeypadActivatedNoteAfterSoftReject = EFalse; - } - iCallActivated = EFalse; - break; - } - - default: - break; - } - - if ( aCurrentCallState != EPSCTsyCallStateRinging ) - { - iSysApLightsController->CallComingInL( EFalse ); - } - - SetIhfIndicatorL(); - SetHacIndicatorL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoSwStateNormalConstructionL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DoSwStateNormalConstructionL() - { - // Let's ensure that the lights will remain on for 15 secs after sw state normal - User::ResetInactivityTime(); - - TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : START" ) ) ); - - // In case of unexpected reset (e.g. hidden boot) the keylock must be enabled silently. Locking is done - // prior to time-consuming initializations, because otherwise UI is in unlocked state for a few seconds. - if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive ) == 1 ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL: enabling keylock") ) ); - KeyLock().EnableWithoutNote(); - } - - // Initiate bearer change observation - iSysApConnectionMonitorObserver = CSysApConnectionMonitorObserver::NewL( *this ); - - TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL: trying CSysApSsSettingsObserver::NewL()") ) ); - iSysApSsSettingsObserver = CSysApSsSettingsObserver::NewL( *this ); - - TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL: trying new ( ELeave ) CSysApPowerKeyMenuObserver") ) ); - iSysApPowerKeyMenuObserver = new( ELeave ) CSysApPowerKeyMenuObserver( *this ); - - TRACES( RDebug::Print( _L("SysAp: trying CSystemLock::NewL" ) ) ); - iSysApSystemLock = CSystemLock::NewL(); - - iSysApCenRepCallForwardingObserver = CSysApCenRepCallForwardingObserver::NewL( *this ); - - iSysApCenRepMsgWaitingObserver = CSysApCenRepMsgWaitingObserver::NewL( *this ); - - - if ( iSysApFeatureManager->Supported( KSysApFeatureIdBatteryInfoPopup ) ) - { - iSysApBatteryInfoController = CSysApBatteryInfoController::NewL( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsConf, - KCoreAppUIsBatteryInformationLowThreshold ) ); - } - - - TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : END" ) ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoSimChangedFromPreviousBootL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DoSimChangedFromPreviousBootL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::DoSimChangedFromPreviousBootL: iSimChangedDone=%d" ), iSimChangedDone ) ); - - if ( !iSimChangedDone ) - { - iSimChangedDone = ETrue; - CSysApSimChanged* simChanged = CSysApSimChanged::NewL( *this, iEikonEnv->FsSession() ); - CleanupStack::PushL( simChanged ); - simChanged->HandleSimChangedL(); - CleanupStack::PopAndDestroy( simChanged ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::CancelWaitNote() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::CancelWaitNote() - { - TRACES( RDebug::Print( _L("CSysApAppUi::CancelWaitNote" ) ) ); - if ( iSysApWaitNote ) - { - iSysApWaitNote->Cancel(); - delete iSysApWaitNote; - iSysApWaitNote = NULL; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::CancelGlobalListQuery() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::CancelGlobalListQuery() - { - TRACES( RDebug::Print( _L("CSysApAppUi::CancelGlobalListQuery" ) ) ); - if ( iGlobalListQuery ) - { - iGlobalListQuery->CancelListQuery(); - delete iGlobalListQuery; - iGlobalListQuery = NULL; - } - } - -#ifndef RD_MULTIPLE_DRIVE -// ---------------------------------------------------------------------------- -// CSysApAppUi::MountMMC() -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::MountMMC() - { - TRACES( RDebug::Print( _L("CSysApAppUi::MountMMC") ) ); - TInt err ( KErrNotSupported ); - if ( iSysApFeatureManager->MmcSupported() ) - { -#ifdef __WINS__ // Let's sleep a second in WINS - User::After( 1000000 ); -#endif - err = iEikonEnv->FsSession().MountFileSystem( KFSName, KMMCDrive ); - TRACES( RDebug::Print( _L("CSysApAppUi::MountMMC: RFs::MountFileSystem() returned: %d"), err ) ); - if ( err == KErrInUse ) - { - User::After( 1000000 ); - err = iEikonEnv->FsSession().MountFileSystem( KFSName, KMMCDrive ); - TRACES( RDebug::Print( _L("CSysApAppUi::MountMMC: RFs::MountFileSystem() returned: %d"), err ) ); - } - } - return err; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DismountMMC() -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::DismountMMC() - { - TRACES( RDebug::Print( _L("CSysApAppUi::DismountMMC") ) ); -#ifdef __WINS__ // Let's sleep a second in WINS - User::After( 1000000 ); -#endif - - TInt err ( KErrNotSupported ); - if ( iSysApFeatureManager->MmcSupported() ) - { - err = iEikonEnv->FsSession().DismountFileSystem( KFSName, KMMCDrive ); - TRACES( RDebug::Print( _L("CSysApAppUi::DismountMMC: RFs::DismountFileSystem() returned: %d"), err ) ); - } - return err; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::EjectMMCL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::EjectMMCL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::EjectMMCL") ) ); - iMMCEjectUsed = ETrue; - iMMCPowerMenuEjectUsed = ETrue; - iTimeToKill = EFalse; - iApplicationScanningRoundNumber = 0; - CloseUIAppsInHotSwapL(); - } - -#else // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::EjectMMCL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::EjectMMCL() - { - // Called from eject confirm query, check drive inserted before start - TInt insertedIndex( CSysApDriveList::Find( - iInsertedMemoryCards, iDriveToEject ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::EjectMMCL: iMMCEjectUsed: %d, drive: %d, index: %d "), - iMMCEjectUsed, iDriveToEject, insertedIndex ) ); - - if ( insertedIndex != KErrNotFound ) - { - iSysApDriveList->MarkDriveToEject( - iDriveToEject, CSysApDriveList::EEjectFromMenu ); - iSysApDriveEjectHandler->StartEject(); - } - iMMCEjectUsed = EFalse; - } - -#endif // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DisconnectBtSap() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::DisconnectBtSap() - { - TRACES( RDebug::Print( _L("CSysApAppUi::DisconnectBtSap") ) ); - iSysApBtSapController->Disconnect(); - } - -#ifndef RD_MULTIPLE_DRIVE -// ---------------------------------------------------------------------------- -// CSysApAppUi::RunUnlockNotifierL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::RunUnlockNotifierL( TSysApMemoryCardStatus aMemoryCardStatus ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: START") ) ); - if ( iSysApFeatureManager->MmcSupported() ) - { - if ( UiReady() ) - { - TSysApMemoryCardStatus memoryCardStatus; - if ( aMemoryCardStatus == ESysApMemoryCardStatusNotKnown ) - { - memoryCardStatus = iSysApMMCObserver->MemoryCardStatus(); - } - else - { - memoryCardStatus = aMemoryCardStatus; - } - - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: memoryCardStatus=%d"), memoryCardStatus ) ); - - switch ( memoryCardStatus ) - { - case ESysApMemoryCardInserted: - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL MMC inserted") ) ); - if ( aMemoryCardStatus == ESysApMemoryCardInserted ) - { - RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); - } - break; - case ESysApMemoryCardLocked: - { - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL MMC locked") ) ); - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - TInt callState = StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ); - - if ( (! ( iDeviceLockEnabled || iKeyLockEnabled ) ) && - callState != EPSCTsyCallStateRinging && // We don't want to see the MMC passwd query - callState != EPSCTsyCallStateAlerting ) // when the user is e.g. making an emergency call - { - if ( iSysApFeatureManager->MemoryCardLockSupported() ) - { - if ( ! iMemoryCardDialog ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: ACTIVATE MMC passwd query") ) ); - CAknMemoryCardDialog* mmcDialog = CAknMemoryCardDialog::NewLC( this ); - iMemoryCardDialog = mmcDialog; // temporary variable used for hiding codescanner error - iMemoryCardDialog->SetSelfPointer( &iMemoryCardDialog ); - iMemoryCardDialog->UnlockCardLD(); // when UnlockCardLD completes it calls UnlockComplete() - } - } - else - { - // Since locked cards are not supported, notify user that card is locked. - ShowQueryL( ESysApMemoryCardLockedNote ); - } - } - } - break; - - case ESysApMemoryCardNotInserted: - default: - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL MMC not inserted") ) ); - if ( aMemoryCardStatus == ESysApMemoryCardNotInserted ) - { - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - } - } - } - } - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: END") ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UnlockComplete() from MAknMemoryCardDialogObserver -// ---------------------------------------------------------------------------- - -void CSysApAppUi::UnlockComplete( TInt aResult ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::UnlockComplete result: %d"), aResult ) ); - if ( aResult == KErrNone ) - { - RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::MMCStatusChangedL() from MSysApMemoryCardObserver -// ---------------------------------------------------------------------------- - -void CSysApAppUi::MMCStatusChangedL() - { - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL START: iMMCInserted: %d, iMMCEjectUsed: %d, iHideFirstBeep: %d, iHideNextBeep: %d" ), iMMCInserted, iMMCEjectUsed, iHideFirstBeep, iHideNextBeep ) ); - - if ( iSysApFeatureManager->MmcSupported() && !iShutdownStarted ) - { - TSysApMemoryCardStatus memoryCardStatus = iSysApMMCObserver->MemoryCardStatus(); - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL memoryCardStatus=%d" ), memoryCardStatus ) ); - - switch ( memoryCardStatus ) - { - case ESysApMemoryCardInserted: - case ESysApMemoryCardLocked: - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: MMC drive mounted" ) ) ); - if ( ! iMMCInserted ) // MMC was not inserted before - { - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: MMC newly inserted" ) ) ); - CancelWaitNote(); // just to be sure, the user might keep on closing and opening the MMC latch - // An MMC has been newly inserted, so play a sound and check if its password protected - - if ( UiReady() ) - { - if ( !iHideFirstBeep && !iHideNextBeep ) // starting up - { - Beep(); - // Switch lights on - iSysApLightsController->MemoryCardInsertedL(); - } - iHideNextBeep = EFalse; - } - - iMMCPowerMenuEjectUsed = EFalse; - iMMCEjectUsed = EFalse; - iMMCInserted = ETrue; - - // No need to show ESysApRemoveMmcNote after MMC already mounted - if ( iSysApConfirmationQuery ) - { - if ( iSysApConfirmationQuery->CurrentQuery() == ESysApRemoveMmcNote ) - { - iSysApConfirmationQuery->Cancel(); - } - } - - // Check if the MMC is locked and unlock it if necessary - RunUnlockNotifierL( memoryCardStatus ); - } - break; - default: - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: MMC drive not mounted" ) ) ); - delete iMemoryCardDialog; // sets itself to null - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - if ( iMMCInserted ) - { - // No need to show ESysApEjectMmcQuery after MMC already removed - if ( iSysApConfirmationQuery ) - { - if ( iSysApConfirmationQuery->CurrentQuery() == ESysApEjectMmcQuery ) - { - iSysApConfirmationQuery->Cancel(); - } - } - - iMMCInserted = EFalse; - - TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); - if ( !iMMCEjectUsed && propertyValue != KUsbPersonalityIdMS ) - { - // if USB file transfer active, do not close applications - // if eject selected in MMC App, MMC App takes care of the following and - // if eject selected from powerkeymenu, applications have already been shutdown - iTimeToKill = EFalse; - iApplicationScanningRoundNumber = 0; - CloseUIAppsInHotSwapL(); - } - } - else - { - // If MMC was not previously inserted and eject was chosed from power key menu, attempt to remount. - if ( iMMCPowerMenuEjectUsed ) - { - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: Attempt to remount" ) ) ); - MountMMC(); - // If mount was successful, unnecessary note will be canceled in insert notification handling. - } - } - break; - } - - // Update memory card indicator status - SetMemoryCardIndicatorL(); - } - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL END: iMMCInserted: %d, iMMCEjectUsed: %d, iHideFirstBeep: %d, iHideNextBeep: %d" ), iMMCInserted, iMMCEjectUsed, iHideFirstBeep, iHideNextBeep ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowMMCDismountedDialogL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShowMMCDismountedDialogL() - { - TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); - - // Do not show any note if USB file transfer is active. - if ( propertyValue != KUsbPersonalityIdMS ) - { - if ( iSysApFeatureManager->MemoryCardHatchSupported() ) - { // MMC hatch has been opened and MMC has been dismounted - TRACES( RDebug::Print( _L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: Remove MMC and press OK." ) ) ); - ShowQueryL( ESysApRemoveMmcNote ); - } - else - { - // MMC has been removed and dismounted - TRACES( RDebug::Print( _L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: You might have lost some data." ) ) ); - // No confirmation but let's set this true to enable MMC passwd query - ShowUiNoteL( EMemoryCardRemovedWithoutEjectNote ); - } - } - else - { - TRACES( RDebug::Print( _L( "CSysApAppUi::ShowMMCDismountedDialogL: No note shown, USB file transfer caused dismount." ) ) ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::MMCDismountedDialogConfirmed -// ---------------------------------------------------------------------------- - -void CSysApAppUi::MMCDismountedDialogConfirmed() - { - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCDismountedDialogConfirmed") ) ); - - // Try to remount just in case when eject was chosen from power key menu - if ( iMMCPowerMenuEjectUsed ) - { - iMMCPowerMenuEjectUsed = EFalse; - - if ( MountMMC() == KErrLocked ) // In case a locked card was not removed after all - { - TRAPD( err, MMCStatusChangedL() ); // This will update power menu and memory card icon. Also memory card password is requeried. - if ( err != KErrNone ) - { - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCDismountedDialogConfirmed: MMCStatusChangedL failed, err=%d"), err ) ); - } - } - } - - } - -#else // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::MMCInsertedL -// ---------------------------------------------------------------------------- - -void CSysApAppUi::MMCInsertedL() - { - TRACES( RDebug::Print( _L( "CSysApAppUi::MMCInsertedL") ) ); - - if ( iSysApFeatureManager->MmcSupported() && !iShutdownStarted ) - { - TBool normalState( UiReady() ); - - if ( normalState ) - { - TInt defaultMemoryCard( iSysApDriveList->DefaultMemoryCard() ); - TSysApMemoryCardStatus memoryCardStatus( iSysApDriveList->MemoryCardStatus( defaultMemoryCard ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCInsertedL: drive: %d, memoryCardStatus: %d" ), defaultMemoryCard, memoryCardStatus ) ); - - switch ( memoryCardStatus ) - { - case ESysApMemoryCardInserted: // Fall through - case ESysApMemoryCardLocked: - { - // Reset eject and unlock of inserted memory card - iSysApDriveList->ResetDriveToEject( defaultMemoryCard ); - iSysApDriveList->ResetDriveUnlockQueryShown( defaultMemoryCard ); - - CancelWaitNote(); - - if ( memoryCardStatus == ESysApMemoryCardInserted ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCInsertedL: memoryCardStatus ESysApMemoryCardInserted: %d" ), memoryCardStatus ) ); - RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); - } - else - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCInsertedL: memoryCardStatus ESysApMemoryCardLocked: %d" ), memoryCardStatus ) ); - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - } - break; - } - case ESysApMemoryCardNotInserted: - { - // Always reset eject and unlock of removed memory card - TBool isEject( iSysApDriveList->IsDriveToEject( defaultMemoryCard ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCInsertedL: isEject: %d, drive: %d" ), - isEject, defaultMemoryCard ) ); - - iSysApDriveList->ResetDriveToEject( defaultMemoryCard ); - iSysApDriveList->ResetDriveUnlockQueryShown( defaultMemoryCard ); - - TRACES( RDebug::Print( - _L( "SysApAppUi::MMCInsertedL: memoryCardStatus ESysApMemoryCardNotInserted: %d" ), memoryCardStatus ) ); - - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - break; - } - case ESysApMemoryCardStatusNotKnown: // Fall through - default: - { - break; - } - } - RunUnlockNotifierL(); - } - } - } - - -// ---------------------------------------------------------------------------- -// CSysApAppUi::RunUnlockNotifierL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::RunUnlockNotifierL() - { - TRACES( RDebug::Print( - _L("CSysApAppUi::RunUnlockNotifierL: START iDeviceLockEnabled: %d, iKeyLockEnabled: %d" ), - iDeviceLockEnabled, iKeyLockEnabled ) ); - - if ( !iSysApFeatureManager->MmcSupported() || - iDeviceLockEnabled || - iKeyLockEnabled || - !UiReady() ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: END") ) ); - return; - } - - // We don't want to see the MMC passwd query - // when the user is e.g. making an emergency call - TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); - if ( callState != EPSCTsyCallStateRinging && - callState != EPSCTsyCallStateAlerting ) - { - iSysApDriveUnlockHandler->StartUnlock(); - } - - TRACES( RDebug::Print( - _L("CSysApAppUi::RunUnlockNotifierL: END callState: %d"), callState ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::MMCStatusChangedL() from MSysApMemoryCardObserver -// ---------------------------------------------------------------------------- - -void CSysApAppUi::MMCStatusChangedL( TInt aDrive ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL START: MMCCount: %d, iMMCEjectUsed: %d" ), - iInsertedMemoryCards.Count(), iMMCEjectUsed ) ); - - if ( iShutdownStarted || !iSysApFeatureManager->MmcSupported() ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL iShutdownStarted: %d END" ), - iShutdownStarted ) ); - return; - } - - TBool normalState( UiReady() ); - - TInt defaultMemoryCard( iSysApDriveList->DefaultMemoryCard() ); - TSysApMemoryCardStatus memoryCardStatus( iSysApDriveList->MemoryCardStatus( aDrive ) ); - TInt insertedIndex( CSysApDriveList::Find( iInsertedMemoryCards, aDrive ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL: normalState: %d, index: %d, drive: %d, memoryCardStatus: %d" ), - normalState, insertedIndex, aDrive, memoryCardStatus ) ); - - switch ( memoryCardStatus ) - { - case ESysApMemoryCardInserted: // Fall through - case ESysApMemoryCardLocked: - { - if ( insertedIndex == KErrNotFound ) // Not inserted before - { - // Reset eject and unlock of inserted memory card - iSysApDriveList->ResetDriveToEject( aDrive ); - iSysApDriveList->ResetDriveUnlockQueryShown( aDrive ); - - CancelWaitNote(); - - if ( aDrive == defaultMemoryCard ) - { - if ( memoryCardStatus == ESysApMemoryCardInserted ) - { - RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); - } - else - { - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - } - } - - if ( normalState ) - { - // Ignore extra beep from USB file transfer - TBool ignoreBeep( - iSysApDriveList->IsDriveInsertBeepIgnored( aDrive ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL: ignoreBeep: %d, drive: %d" ), - ignoreBeep, aDrive ) ); - - if ( !ignoreBeep ) - { - Beep(); - iSysApLightsController->MemoryCardInsertedL(); - } - - iSysApDriveList->ResetDriveInsertBeepIgnored( aDrive ); - - // Keep ignoring extra beep if USB file transfer is active - TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL: usbState: %d" ), propertyValue ) ); - - if ( propertyValue == KUsbPersonalityIdMS ) - { - iSysApDriveList->MarkDriveInsertBeepIgnored( aDrive ); - } - } - - if ( iDriveToDismount == aDrive && iSysApConfirmationQuery ) - { - if ( iSysApConfirmationQuery->CurrentQuery() == ESysApRemoveMmcNote ) - { - // User put back ejected memory card or did not remove it - iSysApConfirmationQuery->Cancel(); - } - } - RunUnlockNotifierL(); - } - break; - } - case ESysApMemoryCardNotInserted: - { - // Always reset eject and unlock of removed memory card - TBool isEject( iSysApDriveList->IsDriveToEject( aDrive ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL: isEject: %d, drive: %d" ), - isEject, aDrive ) ); - - iSysApDriveList->ResetDriveToEject( aDrive ); - iSysApDriveList->ResetDriveUnlockQueryShown( aDrive ); - - if ( insertedIndex != KErrNotFound ) // Inserted before - { - if ( memoryCardStatus == ESysApMemoryCardNotInserted ) - { - // Reset extra beep ignore if memory card was removed without eject - iSysApDriveList->ResetDriveInsertBeepIgnored( aDrive ); - } - - CancelGlobalListQuery(); // Cancel power menu - - if ( aDrive == defaultMemoryCard ) - { - RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); - } - - if ( iSysApConfirmationQuery ) - { - if ( iSysApConfirmationQuery->CurrentQuery() == ESysApEjectMmcQuery ) - { - // User removed memory card too early - iSysApConfirmationQuery->Cancel(); - // Allow application closing to execute. - // Also FileManager is closed in this case, regardless where the eject was initiated from. - iMMCEjectUsed = EFalse; - } - } - - // Stop unlock of removed memory card - iSysApDriveUnlockHandler->StopUnlock( aDrive ); - - if ( !iMMCEjectUsed && !isEject ) - { - TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL: usbState: %d" ), propertyValue ) ); - - if ( propertyValue != KUsbPersonalityIdMS ) - { - if ( iSysApFeatureManager->MemoryCardHatchSupported() ) - { - // Store drive removed without eject and start eject handling - iSysApDriveList->MarkDriveToEject( - aDrive, CSysApDriveList::EEjectRemovedWithoutEject ); - iSysApDriveEjectHandler->StartEject(); - } - else - { - // Just show the note - ShowUiNoteL( EMemoryCardRemovedWithoutEjectNote ); - } - } - } - iMMCEjectUsed = EFalse; - } - break; - } - case ESysApMemoryCardStatusNotKnown: // Fall through - default: - { - break; - } - } - - // Update inserted memory cards - iSysApDriveList->GetMemoryCardsL( - iInsertedMemoryCards, CSysApDriveList::EIncludeInserted ); - - // Update memory card indicator status - SetMemoryCardIndicatorL(); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCStatusChangedL END: MMCCount: %d, iMMCEjectUsed: %d" ), - iInsertedMemoryCards.Count(), iMMCEjectUsed ) ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowMMCDismountedDialogL() -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::ShowMMCDismountedDialogL( - TInt aDrive, CSysApDriveList::TDriveEjectType aEjectType ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::ShowMMCDismountedDialogL: aDrive: %d, aEjectType: %d" ), - aDrive, aEjectType ) ); - - TBool ret( EFalse ); - iDriveToDismount = aDrive; - HBufC* driveName = iSysApDriveList->GetFormattedDriveNameLC( - aDrive, - R_QTN_EJECT_REMOVE_MEMORY_INFO ); - - if ( aEjectType == CSysApDriveList::EEjectFromMenu ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: Remove MMC and press OK...." ) ) ); - ShowQueryL( ESysApRemoveMmcNote, *driveName ); - ret = ETrue; - } - else - { - // Memory card was removed without eject - TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); - - // Do not show any note if USB file transfer is active. - if ( propertyValue != KUsbPersonalityIdMS ) - { - if ( iSysApFeatureManager->MemoryCardHatchSupported() ) - { - // MMC hatch has been opened and MMC has been dismounted - TRACES( RDebug::Print( - _L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: Remove MMC and press OK." ) ) ); - ShowQueryL( ESysApRemoveMmcNote, *driveName ); - ret = ETrue; - } - else - { - iSysApDriveList->ResetDrivesToEject(); - - // MMC has been removed and dismounted - TRACES( RDebug::Print( _L( - "CSysApAppUi::ShowMMCDismountedDialogL: Show note: You might have lost some data." ) ) ); - - // No confirmation but let's set this true to enable MMC passwd query - ShowUiNoteL( EMemoryCardRemovedWithoutEjectNote ); - } - } - else - { - iSysApDriveList->ResetDrivesToEject(); - TRACES( RDebug::Print( - _L( "CSysApAppUi::ShowMMCDismountedDialogL: No note shown, USB file transfer caused dismount." ) ) ); - } - } - - CleanupStack::PopAndDestroy( driveName ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::ShowMMCDismountedDialogL: ret: %d" ), ret ) ); - - return ret; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::MMCDismountedDialogConfirmed -// ---------------------------------------------------------------------------- - -void CSysApAppUi::MMCDismountedDialogConfirmed() - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::MMCDismountedDialogConfirmed: iDriveToDismount: %d" ), - iDriveToDismount ) ); - - // Try remount to check if drive was put back - iSysApDriveList->MountDrive( iDriveToDismount ); - if ( !iSysApDriveEjectHandler->CompleteDismount( iDriveToDismount ) ) - { - // When ready, check for locked memory cards and update indicators - TRAP_IGNORE( SetMemoryCardIndicatorL() ); - TRAP_IGNORE( RunUnlockNotifierL() ); - } - } - -#endif // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::EjectStarted() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::EjectStarted( TBool ejectStarted ) - { - TRACES( RDebug::Print( _L( "CSysApAppUi::EjectStarted" ) ) ); - iMMCEjectUsed = ejectStarted; - -#ifndef RD_MULTIPLE_DRIVE - iFileManagerCloseDisabled = ejectStarted; -#endif // RD_MULTIPLE_DRIVE -} - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DoLightsTimeoutChangedL -// ---------------------------------------------------------------------------- -void CSysApAppUi::DoLightsTimeoutChangedL( const TInt aTimeout ) - { - iSysApLightsController->DoLightsTimeoutChangedL( aTimeout ); - } - -#ifdef __SYSAP_MODULE_TEST - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ModuleTestShowUiNoteL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ModuleTestShowUiNoteL( const TDesC& noteText ) const - { - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - note->SetTone( EAvkonSIDNoSound ); - note->ShowNoteL( EAknGlobalInformationNote, noteText ); - CleanupStack::PopAndDestroy(); // note - } - -#endif - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowShutdownNoteL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::ShowShutdownNoteL() - { - TRACES( RDebug::Print( _L( "CSysApAppUi::ShowShutdownNoteL") ) ); - ShowUiNoteL( EShutdownNote ); - User::After( KTimeToShowShutdownNote ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::Beep() -// ---------------------------------------------------------------------------- -void CSysApAppUi::Beep() - { - static_cast(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDInformationTone ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SimSupported() -// ---------------------------------------------------------------------------- -TBool CSysApAppUi::SimSupported() - { - return iSysApFeatureManager->SimSupported(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::IsStateNormal() -// -// ---------------------------------------------------------------------------- -TBool CSysApAppUi::IsStateNormal() const - { - TInt state; - TInt errorCode = - RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state ); - if ( errorCode == KErrNone ) - { - return state == ESwStateNormalRfOn || - state == ESwStateNormalRfOff || - state == ESwStateNormalBTSap; - } - else - { - TRACES( RDebug::Print( _L( "CSysApAppUi::IsStateNormal: Failed to read global system state, error code %d." ), errorCode ) ); - return EFalse; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::BatteryEmptyL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::BatteryEmptyL() - { - iSysApLightsController->BatteryEmptyL( ETrue ); - // Do not reactivate keyguard in the next startup - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::Max() -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::Max( const TInt aA, const TInt aB, const TInt aC ) - { - TInt max( aA ); - if ( aB > max ) - { - max = aB; - } - if ( aC > max ) - { - max = aC; - } - return max; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetStarterState() -// ---------------------------------------------------------------------------- - -TInt CSysApAppUi::SetStarterState( const RStarterSession::TGlobalState aState ) - { - if ( iSysApStartupController->GlobalStateChangeAllowed( aState ) ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d" ), aState ) ); - return StarterSession().SetState( aState ); - } - else - { - TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d - not allowed" ), aState ) ); - return KErrNone; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::GetBtSapDeviceNameL() -// ---------------------------------------------------------------------------- - -HBufC* CSysApAppUi::GetBtSapDeviceNameL() - { - return iSysApBtSapController->GetBtSapDeviceNameL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowAlarmIndicatorL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShowAlarmIndicatorL( TBool aShowIndicator ) - { - if ( aShowIndicator) - { - SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOn ); - } - else - { - SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOff ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SimulateFlipKeyEventL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SimulateFlipKeyEventL( TBool aFlipOpen ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::SimulateFlipKeyEventL: aFlipOpen: %d" ), aFlipOpen ) ); - - /* - Flip key is constructed when a flip notification via Pub&Sub is received. The reason behind - providing this as a key event is to enable unified handling of keys also with flip, and because - flip is captured&consumed by Avkon it is not possible to capture flip key events directly - from default handler/plugins. - */ - - TKeyEvent flipEvent; - flipEvent.iCode = aFlipOpen ? EKeyFlipOpen : EKeyFlipClose; - flipEvent.iScanCode = 0; - flipEvent.iModifiers = 0; - flipEvent.iRepeats = 0; - - HandleKeyEventL( flipEvent, EEventKey ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetFlipOpenL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetFlipOpenL( TBool aFlipOpen ) - { - iSysApLightsController->SetFlipOpenL( aFlipOpen ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetGripOpenL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::SetGripOpenL( TBool aGripOpen ) - { - iSysApLightsController->SetGripOpenL( aGripOpen ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetNetworkConnectionAllowed() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::SetNetworkConnectionAllowed: status: %d" ), aNetworkConnectionAllowed ) ); - - iSysApCenRepController->SetInt( KCRUidCoreApplicationUIs, KCoreAppUIsNetworkConnectionAllowed, (TInt) aNetworkConnectionAllowed ); - - // Also set the Symbian PS key used for the same purpose: - RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, aNetworkConnectionAllowed ? ESAPhoneOn : ESAPhoneOff); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::GetTelServerL() -// ---------------------------------------------------------------------------- - -RTelServer* CSysApAppUi::GetTelServer() - { - if ( iSysApEtelConnector ) - { - return iSysApEtelConnector->GetTelServer(); - } - else - { - return NULL; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::CoverDisplaySupported() -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::CoverDisplaySupported() - { - return iSysApFeatureManager->CoverDisplaySupported(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::StarterSession() -// ---------------------------------------------------------------------------- - -RStarterSession& CSysApAppUi::StarterSession() - { - if ( !iStarterSession.Handle() ) - { - // All server connections are tried to be made KTriesToConnectServer times because occasional - // fails on connections are possible at least on some servers - TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: trying RStarterSession::Connect()") ) ); - TInt thisTry = 0; - TInt err; - while ( ( err = iStarterSession.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) - { - User::After( KTimeBeforeRetryingServerConnection ); - } - - if ( err != KErrNone ) - { - // What do in error case? - TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: RStarterSession::Connect() failed with %d"), err ) ); - } - } - - return iStarterSession; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::KeyLock() -// ---------------------------------------------------------------------------- - -RAknKeylock2& CSysApAppUi::KeyLock() - { - if ( !iKeyLock.Handle() ) - { - // All server connections are tried to be made KTriesToConnectServer times because occasional - // fails on connections are possible at least on some servers - TInt thisTry = 0; - TInt err; - - TRACES( RDebug::Print( _L("CSysApAppUi::KeyLock: trying RAknKeylock2::Connect()") ) ); - thisTry = 0; - while ( ( err = iKeyLock.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) - { - User::After( KTimeBeforeRetryingServerConnection ); - } - - if ( err != KErrNone ) - { - // What do in error case? - TRACES( RDebug::Print( _L("CSysApAppUi::KeyLock: RAknKeylock2::Connect() failed with %d"), err ) ); - } - } - - return iKeyLock; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::CenRepController() -// ---------------------------------------------------------------------------- - -CSysApCenRepController& CSysApAppUi::CenRepController() - { - __ASSERT_ALWAYS( iSysApCenRepController, User::Panic( _L("CSysApAppUi::CenRepController"), KErrBadHandle ) ); - - return *iSysApCenRepController; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ExecCommandL -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::ExecCommandL( TSysapCommand aCommand ) - { - ExecCommandL( aCommand, KNullDesC8 ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ExecCommandL -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::ExecCommandL( TSysapCommand aCommand, const TDesC8& aParam ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ExecCommandL: aCommand=%d"), aCommand ) ); - - switch ( aCommand ) - { - case EResetKeyguardState: // reset the internal keyguard flags of the SysAp, except for iKeyLockOnBeforeCradle - iKeyLockOnBeforeCall = EFalse; - iKeyLockOnBeforeAlarm = EFalse; - break; - - case ECancelPowermenu: // hide power menu if it is visible - if( iPowerKeyPopupMenuActive ) - { - CancelGlobalListQuery(); - } - break; - - case EUpdateLights: // apply key specific light handling - { - TUpdateLightsBuf lightBuf; - lightBuf.Copy( aParam ); - - switch ( lightBuf() ) - { - case EKeyGripClose: - SetGripOpenL( EFalse ); - break; - - case EKeyGripOpen: - SetGripOpenL( ETrue ); - break; - - case EKeyFlipClose: - SetFlipOpenL( EFalse ); - break; - - case EKeyFlipOpen: - SetFlipOpenL( ETrue ); - break; - - default: - // No specific light handling for other keys. - break; - } - } - break; - - default: - // do nothing in release builds since no harm is done - __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecCommandL: Invalid command"), KErrArgument ) ); - break; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ExecQueryL -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn ) - { - ExecQueryL( aQuery, aReturn, KNullDesC8 ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ExecQueryL -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn, const TDesC8& /*aParam*/ ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ExecQueryL: aQuery=%d"), aQuery ) ); - - switch ( aQuery ) - { - case EGetHwrmLight: // get handle to HWRM client session. Returns CHWRMLight*. - { - THwrmLightBuf retBuf( iSysApLightsController->GetHwrmLight() ); - aReturn.Copy( retBuf ); - } - break; - - case EGetKeylock: // get handle to keylock client session. Returns RAknKeylock2*. - { - TKeyLockBuf retBuf( &(KeyLock()) ); - aReturn.Copy( retBuf ); - } - break; - - default: - __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecQueryL: Invalid query"), KErrArgument ) ); - User::Leave( KErrArgument ); - break; - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowShutdownImage -// ---------------------------------------------------------------------------- -// -TInt CSysApAppUi::ShowShutdownImage( TInt aBitmapId ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImage") ) ); - - TRAPD( err, ShowShutdownImageL( aBitmapId ) ); - - if ( err != KErrNone ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL failed, err=%d"), err ) ); - } - - return err; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowShutdownImageL -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::ShowShutdownImageL( TInt aBitmapId ) - { - TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL") ) ); - - if ( !iSysApShutdownImage ) // Shutdown image may be shown without entering normal state (e.g. charging), so construct here - { - TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::NewL()") ) ); - iSysApShutdownImage = CSysApShutdownImage::NewL(); - } - - TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::ShowShutdownImageL()") ) ); - iSysApShutdownImage->ShowShutdownImageL( aBitmapId ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::IgnoreZeroNetworkBarNotifications -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::IgnoreZeroNetworkBarNotifications(TBool aIgnore) - { - iIgnoreZeroNetworkBarNotifications = aIgnore; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::BtSapEnabled() -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::BtSapEnabled() - { - if ( iSysApBtSapController ) - { - return iSysApBtSapController->BtSapEnabled(); - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::DeactivateBT -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::DeactivateBT() - { - // Will deactivate BT when changing to normal mode - iDeactivateBt = ETrue; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetHacIndicatorL() -// ---------------------------------------------------------------------------- -void CSysApAppUi::SetHacIndicatorL() - { - - if ( !iSysApCenRepHacSettingObserver ) - { - // Do nothing if HAC setting observer has not been created yet - // This occurs in case some party is trying to set HAC indicator during - // ConstructL(), e.g. when switching from offline to online during startup - TRACES( RDebug::Print( _L("CSysApAppUi::SetHacIndicatorL: do nothing, HAC observer does not exist yet") ) ); - return; - } - - if ( iSysApCenRepHacSettingObserver->HacMode() ) - { - TBool accessoryConnected ( EFalse ); - - TAccMode accMode(EAccModeHandPortable); - - if ( iSysApAccessoryObserver ) - { - accMode = iSysApAccessoryObserver->GetAccessoryMode(); - - if ( accMode != EAccModeHandPortable ) - { - accessoryConnected = ETrue; - } - } - - TInt indicatorState = EAknIndicatorStateOn; - - if ( !accessoryConnected ) // When accessory is not connected, check offline and call state - { - if ( OfflineModeActive() ) // HAC indicator is not shown in offline mode - { - indicatorState = EAknIndicatorStateOff; - } - else - { - // during active call with IHF activated HAC indicator is not shown - TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); - if ( callState < KErrNone ) - { - callState = EPSCTsyCallStateNone; - } - - if ( callState != EPSCTsyCallStateNone && IhfEnabledL() ) - { - indicatorState = EAknIndicatorStateOff; - } - } - - } - else - { - // If an accessory is connected, HAC indicator should not be shown - indicatorState = EAknIndicatorStateOff; - } - - SetIndicatorStateL( EAknIndicatorHAC, indicatorState ); - - } - else - { - // If HAC is not active, always disable indicator regardless of accessory state - SetIndicatorStateL( EAknIndicatorHAC, EAknIndicatorStateOff ); - } - - - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleResourceChangeL() -// ---------------------------------------------------------------------------- - -void CSysApAppUi::HandleResourceChangeL( TInt aType ) - { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleResourceChangeL aType: %d"), aType ) ); - CAknAppUi::HandleResourceChangeL(aType); - - if ( aType == KEikDynamicLayoutVariantSwitch ) - { -#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION - iSysApShutdownImage->SetRect( ApplicationRect() ); -#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION - - TInt mode; - User::LeaveIfError( RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ) ); - - if ( mode == EStartupModeAlarm ) - { - SetStatusPaneLayoutL( ESysApAlarm ); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetMemoryCardIndicatorL -// ---------------------------------------------------------------------------- - -void CSysApAppUi::SetMemoryCardIndicatorL() - { - if ( iSysApFeatureManager->Supported( KSysApFeatureIdMemoryCardIcon ) ) - { -#ifndef RD_MULTIPLE_DRIVE - TSysApMemoryCardStatus memoryCardStatus = iSysApMMCObserver->MemoryCardStatus(); - - TRACES( RDebug::Print( _L("CSysApAppUi::SetMemoryCardIndicatorL: memoryCardStatus=%d"), memoryCardStatus ) ); - - if ( memoryCardStatus == ESysApMemoryCardInserted || memoryCardStatus == ESysApMemoryCardLocked ) -#else // RD_MULTIPLE_DRIVE - TInt insertedCount( CSysApDriveList::NonUsbDriveCount( iInsertedMemoryCards ) ); - - TRACES( RDebug::Print( _L("CSysApAppUi::SetMemoryCardIndicatorL: insertedCount=%d"), insertedCount ) ); - - if ( insertedCount > 0 ) -#endif // RD_MULTIPLE_DRIVE - { - SetIndicatorStateL( EAknIndicatorMemoryCard, EAknIndicatorStateOn ); - } - else - { - SetIndicatorStateL( EAknIndicatorMemoryCard, EAknIndicatorStateOff ); - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SysApFeatureManager -// ---------------------------------------------------------------------------- - -CSysApFeatureManager& CSysApAppUi::SysApFeatureManager() - { - __ASSERT_DEBUG( iSysApFeatureManager, User::Panic( _L("iSysApFeatureManager == NULL"), KErrBadHandle ) ); - - return *iSysApFeatureManager; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetUsbAttachStatus -// ---------------------------------------------------------------------------- -#ifndef RD_MULTIPLE_DRIVE -void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) - { - // Prevent double beep when USB file transfer gets activated but - // allow MMC inserted beep when: - // a) USB file transfer is active - // b) MMC is not inserted when USB cable is attached - iHideNextBeep = ( iMMCInserted && aUsbAttached ); - } -#else // RD_MULTIPLE_DRIVE -void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::SetUsbAttachStatus: aUsbAttached: %d" ), - aUsbAttached ) ); - - if ( aUsbAttached ) - { - // For ignoring extra beeps caused by USB file transfer - iSysApDriveList->ResetDrivesInsertBeepIgnored(); - iSysApDriveList->MarkDrivesInsertBeepIgnored( iInsertedMemoryCards ); - } - } -#endif // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::IhfEnabledL -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::IhfEnabledL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::IhfEnabledL(): iSysApAudioRoutingObserver=0x%x"), iSysApAudioRoutingObserver ) ); - - if ( !iSysApAudioRoutingObserver ) // create observer if needed - { - iSysApAudioRoutingObserver = CSysApAudioRoutingObserver::NewL( *this ); - } - - return iSysApAudioRoutingObserver->IhfEnabled(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::IsDeviceModeKey -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const - { - return CSysApDefaultKeyHandler::IsDeviceModeKey( aKeyEvent ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ResourcesFreed -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::ResourcesFreed() const - { - return iResourcesFreed; - } - -/* ----------------------------------------------------------------------------- -CSysApAppUi::IsEncryptionOperationOngoingL() -Introduced the code as a part of Sub : 405-3362 - Power Management SUB for ES -recapture functionalities in platform which support multidrive as well. -------------------------------------------------------------------------------- -*/ -TBool CSysApAppUi::IsEncryptionOperationOngoingL() const - { - TBool deFeatureSupported(EFalse); - FeatureManager::InitializeLibL(); - deFeatureSupported = FeatureManager::FeatureSupported( KFeatureIdFfDeviceEncryptionFeature); - FeatureManager::UnInitializeLib(); - - if(deFeatureSupported) - { - /** - * Store the last memory status changed - * 0: Idle. It can be Encrypted or Decrypted - * 1: Encrypting - * 2: Decrypting - **/ - - RProperty deProperty; - User::LeaveIfError(deProperty.Attach(KDevEncProtectedUid, KDevEncOperationKey,EOwnerThread)); - TInt deValue = 0; - if((deProperty.Get(deValue)== KErrNone)&&( deValue == EOpEncrypting || deValue == EOpDecrypting)) - { - deProperty.Close(); - return ETrue; - } - else - { - deProperty.Close(); - return EFalse; - } - } - else - { - return EFalse; - } - } -// ---------------------------------------------------------------------------- -// CSysApAppUi::EtelConnector -// ---------------------------------------------------------------------------- - -CSysApEtelConnector* CSysApAppUi::EtelConnector() const - { - return iSysApEtelConnector; - } - -#ifndef RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::EjectUsed -// ---------------------------------------------------------------------------- - -void CSysApAppUi::EjectUsed( TInt /*aDrive*/ ) - { - } - -#else // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::ShowEjectWaitNoteL -// ---------------------------------------------------------------------------- - -void CSysApAppUi::ShowEjectWaitNoteL( TInt aDriveToEject ) - { - if ( iSysApWaitNote ) - { - return; - } - HBufC* text = iSysApDriveList->GetFormattedDriveNameLC( - aDriveToEject, - 0, // Not used - R_QTN_EJECTING_MEMORY_NAME_WAIT ); - iSysApWaitNote = CSysApWaitNote::NewL( - iSysApFeatureManager->CoverDisplaySupported() ); - iSysApWaitNote->ShowNoteL( EClosingApplicationsNote, text ); - CleanupStack::PopAndDestroy( text ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::IsEjectQueryVisible -// ---------------------------------------------------------------------------- - -TBool CSysApAppUi::IsEjectQueryVisible() - { - if ( !iSysApConfirmationQuery ) - { - return EFalse; - } - TInt queryId( iSysApConfirmationQuery->CurrentQuery() ); - return ( queryId == ESysApEjectMmcQuery || queryId == ESysApRemoveMmcNote ); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UpdateInsertedMemoryCardsL -// ---------------------------------------------------------------------------- - -void CSysApAppUi::UpdateInsertedMemoryCardsL() - { - // Update inserted memory cards - iSysApDriveList->GetMemoryCardsL( - iInsertedMemoryCards, CSysApDriveList::EIncludeInserted ); - - // Update memory card indicator status - SetMemoryCardIndicatorL(); - - // Handle unlock - RunUnlockNotifierL(); - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::EjectUsed -// ---------------------------------------------------------------------------- - -void CSysApAppUi::EjectUsed( TInt aDrive ) - { - // Check drive inserted before starting eject confirm query - TInt insertedIndex( CSysApDriveList::Find( iInsertedMemoryCards, aDrive ) ); - - TRACES( RDebug::Print( - _L( "CSysApAppUi::EjectUsed: drive: %d, index: %d" ), - aDrive, insertedIndex ) ); - - if ( insertedIndex == KErrNotFound ) - { - return; - } - - iMMCEjectUsed = ETrue; - iDriveToEject = aDrive; - iSysApDriveList->ResetDrivesToEject(); - TRAPD( err, EjectMMCL() ); - if ( err != KErrNone ) - { - TRACES( RDebug::Print( - _L( "CSysApAppUi::EjectUsed: err: %d" ), err ) ); - iMMCEjectUsed = EFalse; - } - } - -#endif // RD_MULTIPLE_DRIVE - -// ---------------------------------------------------------------------------- -// CSysApAppUi::EjectMMCCanceled -// ---------------------------------------------------------------------------- - -void CSysApAppUi::EjectMMCCanceled() - { - // Called from eject confirm query, reset eject status -#ifdef RD_MULTIPLE_DRIVE - iMMCEjectUsed = EFalse; -#endif // RD_MULTIPLE_DRIVE - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::UsbChargerDetector -// ---------------------------------------------------------------------------- -// -TSysApUsbChargerDetector& CSysApAppUi::UsbChargerDetector() - { - return iSysApUsbChargerDetector; - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleUsbCharger -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::HandleUsbCharger( const TInt aValue ) - { - if ( aValue == EChargingStatusCharging || - aValue == EChargingStatusChargingContinued || - aValue == EChargingStatusAlmostComplete ) - { - iSysApUsbChargerDetector.SetChargingUsed( ETrue ); - if ( !iSysApUsbIndicatorController && - iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && - iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ) - { - // Start observing USB state for the reminder note - TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); - if ( usbErr ) - { - TRACES( RDebug::Print( - _L("CSysApAppUi::HandleUsbCharger: error in constructing USB ind. controller %d" ), - usbErr ) ); - } - } - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::SetEnvelopeIndicatorL -// ---------------------------------------------------------------------------- -// -void CSysApAppUi::SetEnvelopeIndicatorL() - { - TInt phoneStoreStatus( StateOfProperty( KUidPSSMSStackCategory, KUidPSSMSStackDiskSpaceMonitorKey ) ); - TInt inboxStatus( StateOfProperty( KUidSystemCategory, KUidInboxStatusValue ) ); - TBool simStoreFull( iSysApEtelConnector && iSysApEtelConnector->IsSimSmsStoreFull() ); - - TRACES( RDebug::Print( - _L("CSysApAppUi::SetEnvelopeIndicatorL() phoneStoreStatus %d, simStoreFull %d, inboxStatus %d"), - phoneStoreStatus, simStoreFull, inboxStatus ) ); - - if ( phoneStoreStatus == ESmsDiskSpaceFull || simStoreFull ) - { - // Blink the Envelope indicator - SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateAnimate ); - } - else if ( inboxStatus == ESADocumentsInInbox ) - { - // Show the Envelope indicator. - SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateOn ); - } - else - { - // Hide the Envelope indicator. - SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateOff ); - } - } - -// ---------------------------------------------------------------------------- -// CSysApAppUi::LogsObserverL -// ---------------------------------------------------------------------------- -// -CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL() - { - TRACES( RDebug::Print( _L("CSysApAppUi::LogsObserverL()") ) ); - - // Create Logs observer when it is needed for the first time - if ( !iSysApCenRepLogsObserver ) - { - iSysApCenRepLogsObserver = CSysApCenRepLogsObserver::NewL( *this ); - } - - return *iSysApCenRepLogsObserver; - } - // ---------------------------------------------------------------------------- // CSysApAppUi::NotifyPowerSaveModeL // ---------------------------------------------------------------------------- @@ -6583,8 +1575,9 @@ TRACES( RDebug::Print( _L("CSysApAppUi::NotifyPowerSaveModeL aStatus: %d"), aStatus ) ); // cancel any active power saving query because user has changed the state manually - CancelQuery( ESysApBattChargingPowerSavingQuery ); - CancelQuery( ESysApBattLowPowerSavingQuery ); + // CancelQuery( ESysApBattChargingPowerSavingQuery ); + // CancelQuery( ESysApBattLowPowerSavingQuery ); + // will take care in next sub switch ( aStatus ) { @@ -6611,6 +1604,189 @@ } } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::ShowAlarmIndicatorL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::ShowAlarmIndicatorL( TBool aShowIndicator ) + { + if ( aShowIndicator) + { + // do nothing + } + else + { + // do nothing + } + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) +// ---------------------------------------------------------------------------- +void CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiAlerting aAlerting:%d"), aAlerting ) ); + + if ( aAlerting ) + { + TInt swState; + RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); + + if( swState == ESwStateCharging ) + { + SetStarterState( RStarterSession::EAlarm ); + } + } + + iSysApLightsController->AlarmOccuredL( aAlerting ); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightParameter ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const + { + iSysApLightsController->HandleForcedLightsVTRequireL( aLightsParameter ); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightParameter ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const + { + iSysApLightsController->HandleForcedLightsSSRequireL( aLightsParameter ); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightParameter ) +// ---------------------------------------------------------------------------- +void CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const + { + iSysApLightsController->HandleForcedLightsATCRequireL( aLightsParameter ); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleLightsRequireL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleLightsRequireL() const + { + iSysApLightsController->HandleLightsRequireL(); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiKeyLockOff aKeyLockOff:%d, devicelock:%d"), + aKeyLockOff, iDeviceLockEnabled ) ); + + if( aKeyLockOff ) + { + // Notification to release keypad might come several times if e.g. calls are received + if ( !iKeyLockOnBeforeAlarm ) + { + if ( iKeyLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeCall ) + { + iKeyLockOnBeforeAlarm = ETrue; + } + } + iKeyguardController->DisableKeyguard(EFalse); + } + else + { + if (iDeviceLockEnabled) + { + // Re-enable keylock in devicelock case only if phone call is not ongoing or is + // connected. Otherwise e.g. messages can be read using softkeys during ongoing call. + TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); + if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateConnected ) + { + iKeyguardController->EnableKeyguard(EFalse); + } + } + else if ( iKeyLockOnBeforeAlarm && !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeCall ) + { + iKeyguardController->EnableKeyguard(ETrue); + } + iKeyLockOnBeforeAlarm = EFalse; + } + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::DoNotEnableKeylock() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::DoNotEnableKeylock() + { + if ( !iKeyLockOnBeforeCradle ) + { + iShowkeypadActivatedNoteAfterSoftReject = iKeyLockOnBeforeCall; + } + + iKeyLockOnBeforeCall = EFalse; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SwitchLightsOnSoftRejectL() +// ---------------------------------------------------------------------------- +void CSysApAppUi::SwitchLightsOnSoftRejectL() + { + iSysApLightsController->SwitchLightsOnSoftRejectL(); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::SetDeviceLockEnabledL aLockEnabled:%d" ), aLockEnabled ) ); + TBool currentState( iDeviceLockEnabled ); + + iDeviceLockEnabled = aLockEnabled; + + if ( currentState != iDeviceLockEnabled ) // filter out unnecessary light status modifications + { + iSysApLightsController->DeviceLockStateChangedL( iDeviceLockEnabled ); + } + + if( iDeviceLockEnabled ) + { + if( iKeyLockEnabled ) + { + iKeyguardController->DisableKeyguard(EFalse); + } + } + else + { + // let's not activate keylock in case device lock was disabled during call or in cradle + iKeyLockOnBeforeCall = EFalse; + iKeyLockOnBeforeCradle = EFalse; + + // Memory card needs to be unlocked when device is unlocked + if ( iSysApFeatureManager->MmcHotSwapSupported() ) + { + // RunUnlockNotifierL(); + // Need to handle feature for unlocking the MMC card + } + } + } + + // ---------------------------------------------------------------------------- // CSysApAppUi::HandleBatteryStatusL // ---------------------------------------------------------------------------- @@ -6659,6 +1835,118 @@ } // ---------------------------------------------------------------------------- +// CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const +// ---------------------------------------------------------------------------- + +void CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const + { + TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL aNote: %d"), aNote ) ); + + TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); + + if( UiReady() || swState == ESwStateSecurityCheck) + { + switch ( aNote ) + { + case EBatteryLowNote: + { + _LIT(KPowerPressKey,"Battery low"); + HBufC* aString = HBufC16::NewLC(100); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + break; + case EBatteryFullNote: + { + _LIT(KPowerPressKey,"Battery full"); + HBufC* aString = HBufC16::NewLC(100); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + break; + case ERechargeBatteryNote: + { + iSysApLightsController->BatteryEmptyL( ETrue ); + _LIT(KPowerPressKey,"Battery empty. Recharge"); + HBufC* aString = HBufC16::NewLC(100); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + break; + case ENotChargingNote: + { + _LIT(KPowerPressKey,"Not charging"); + HBufC* aString = HBufC16::NewLC(100); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + break; + case EBatteryFullUnplugChargerNote: + { + iSysApLightsController->BatteryEmptyL( ETrue ); + _LIT(KPowerPressKey,"Charging complete. Unplug charger to save energy."); + HBufC* aString = HBufC16::NewLC(200); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + break; + case EUnplugChargerNote: + { + _LIT(KPowerPressKey,"Unplug charger from power supply to save energy"); + HBufC* aString = HBufC16::NewLC(250); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KPowerPressKey); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + break; + default: + break; + } + } + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::BatteryEmptyL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::BatteryEmptyL() + { + iSysApLightsController->BatteryEmptyL( ETrue ); + // Do not reactivate keyguard in the next startup + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::ShowQueryL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::ShowQueryL( const TSysApConfirmationQueryIds /* aQueryId */, const TDesC& /* aValue */) + { + // do nothing + } + + + +// ---------------------------------------------------------------------------- // CSysApAppUi::HandleChargingStatusL // ---------------------------------------------------------------------------- // @@ -6671,13 +1959,7 @@ UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); if ( iSysApPsmController && UiReady() ) - { - if ( iCharging ) // iCharging updated in UpdateBatteryBarsL - { - // cancel activation query if charger is connected while query is on display - CancelQuery( ESysApBattLowPowerSavingQuery ); - } - + { if ( iCharging && !iSysApPsmController->ChargerConnected() ) // first time after charger connection { iSysApPsmController->ConnectCharger( ETrue ); @@ -6696,9 +1978,6 @@ else if ( aValue == EChargingStatusNotConnected ) { iSysApPsmController->ConnectCharger( EFalse ); - - // cancel deactivation query if charger is disconnected while query is on display - CancelQuery( ESysApBattChargingPowerSavingQuery ); } } if( showNote ) @@ -6707,58 +1986,693 @@ } } -// ---------------------------------------------------------------------------- -// CSysApAppUi::HandleActivatePsmQueryResponse + // ---------------------------------------------------------------------------- -// -void CSysApAppUi::HandleActivatePsmQueryResponse( TBool aEnable ) +// CSysApAppUi::HandleChargerNotesL() +// ---------------------------------------------------------------------------- +void CSysApAppUi::HandleChargerNotesL( const TInt aValue ) { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleActivatePsmQueryResponse aEnable: %d"), - aEnable ) ); - - __ASSERT_DEBUG( iSysApPsmController, User::Invariant() ); - - if ( aEnable ) + TBool showNote(StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging); + if ( aValue == EChargingStatusCharging ) + { + iSysApLightsController->BatteryEmptyL( EFalse ); + TRACES( RDebug::Print( _L("SysAp: charger connected") ) ); + iSysApLightsController->ChargerConnectedL( ETrue ); + ShowChargingNoteL(); + } + //Display Not Charging note + else if ( aValue == EChargingStatusError ) + { + if(showNote) + { + ShowUiNoteL( ENotChargingNote ); + } + } + else if ( aValue == EChargingStatusChargingComplete ) + { + iSysApLightsController->ChargingCompleteL(); + + TSysApNoteIds note( EBatteryFullNote ); + + if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && + iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) + { + note = EBatteryFullUnplugChargerNote; + } + iSysApUsbChargerDetector.Reset(); + if(showNote) + { + ShowUiNoteL( note ); + } + } + else if ( aValue == EChargingStatusNotConnected ) { - iSysApPsmController->DoEnableFullPsm( ETrue ); + TRACES( RDebug::Print( _L("SysAp: charger removed") ) ); + iSysApLightsController->ChargerConnectedL( EFalse ); + + if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && + iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) + { + if(showNote) + { + ShowUiNoteL( EUnplugChargerNote ); + } + } + iSysApUsbChargerDetector.Reset(); + } + else if ( aValue == EChargingStatusNotCharging ) + { + TRACES( RDebug::Print( _L("SysAp: Not charging") ) ); + } + else if ( aValue == EChargingStatusAlmostComplete ) + { + TRACES( RDebug::Print( _L("SysAp: Charging almost complete") ) ); + } + else if ( aValue == EChargingStatusChargingContinued ) + { + //in this case we simply want to scroll the battery bars and not turn light on or show ui note + // set lights controller iBatteryEmpty to EFalse + iSysApLightsController->BatteryEmptyL( EFalse ); + TRACES( RDebug::Print( _L("SysAp: charging continues") ) ); + } + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::UpdateBatteryBarsL( const TInt /* aState */) + { + TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); +// TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL aState: %d, chargerState:%d"), aState, state ) ); + HandleUsbCharger( state ); + if( state == EChargingStatusCharging || + state == EChargingStatusChargingContinued || + state == EChargingStatusAlmostComplete ) + { + if ( !iCharging ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Starting Charging") ) ); + iCharging = ETrue; + } } else { - iSysApPsmController->DoEnablePartialPsm( ETrue ); - } + if ( iCharging ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Stopping Charging") ) ); + iCharging = EFalse; + } + } + + if ( !iSysApPsmController ) // created here if first state change has not occurred yet + { + iSysApPsmController = CSysApPsmController::NewL( *this ); + } + + if ( iSysApPsmController ) + { + if ( iSysApPsmController->FullPsmEnabled() ) + { + // activate psm indicator + } + else + { + // deactivate psm indicator + } + } + + if ( iSysApBatteryInfoController ) + { + iSysApBatteryInfoController->BatteryLevelUpdatedL(); + } + } + + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::ShowChargingNoteL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::ShowChargingNoteL() + { + TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL") ) ); + TBool showNote( ETrue ); + + TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); + TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL: swState: %d"), swState ) ); + + if( UiReady() || swState == ESwStateSecurityCheck ) + { + if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) == EPSCTsyCallStateRinging ) + { + showNote = EFalse; + } + TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL KCTsyCallState=%d"), StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ) ); + if ( showNote ) // Power Mgmt UI spec defines that no Charging note is shown while the phone is ringing/alerting + { + _LIT(KChargingNote,"Charging"); + HBufC* aString = HBufC16::NewLC(50); + TPtrC aStringPointer = aString->Des(); + aStringPointer.Set(KChargingNote); + TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); + ShowExampleUiNoteL( aStringPointer ); + CleanupStack::PopAndDestroy(); // aString + } + } + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleUsbCharger +// ---------------------------------------------------------------------------- +// +void CSysApAppUi::HandleUsbCharger( const TInt aValue ) + { + if ( aValue == EChargingStatusCharging || + aValue == EChargingStatusChargingContinued || + aValue == EChargingStatusAlmostComplete ) + { + iSysApUsbChargerDetector.SetChargingUsed( ETrue ); + if ( !iSysApUsbIndicatorController && + iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && + iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ) + { + // Start observing USB state for the reminder note + TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); + if ( usbErr ) + { + TRACES( RDebug::Print( + _L("CSysApAppUi::HandleUsbCharger: error in constructing USB ind. controller %d" ), + usbErr ) ); + } + } + } } // ---------------------------------------------------------------------------- -// CSysApAppUi::HandleDeactivatePsmQueryResponse +// CSysApAppUi::HandleCurrentCallStateChangeL() // ---------------------------------------------------------------------------- -// -void CSysApAppUi::HandleDeactivatePsmQueryResponse( TBool aDisable ) + +void CSysApAppUi::HandleCurrentCallStateChangeL( TInt aCurrentCallState ) { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleDeactivatePsmQueryResponse aDisable: %d"), - aDisable ) ); + TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: KUidCurrentCall: %d" ), aCurrentCallState ) ); + + switch ( aCurrentCallState ) + { + case EPSCTsyCallStateRinging: + { + iSysApLightsController->CallComingInL( ETrue ); + // Disable keylock when a call is coming in + if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeAlarm ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateRinging: disable keylock") ) ); + iKeyLockOnBeforeCall = ETrue; + + if ( iKeyLockEnabled || iDeviceLockEnabled ) + { + if ( !iSysApFeatureManager->TouchUnlockStrokeSupported() ) + { + iKeyguardController->DisableKeyguard(EFalse); + } + } + } + break; + } + + case EPSCTsyCallStateDialling: + { + // Disable keypad lock during an emergency call + // no need to disable the key lock when a call is made using the wireless car-kit + // but if the call is an emergency one then we will disable the keypad lock + if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateDialling: disable keylock") ) ); + iKeyLockOnBeforeCall = ETrue; + + if ( IsEmergencyCall() && (iKeyLockEnabled || iDeviceLockEnabled )) + { + iKeyguardController->DisableKeyguard(EFalse); + } + } + + // Enable signal & network indicators when an emergency call is made in Offline Mode + if( iSysApOfflineModeController->OfflineModeActive() ) + { + // Signal indicators not updated with VoIP call + if ( StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) != EPSCTsyCallTypeVoIP) + { + iEmergencyCallActive = ETrue; + // not supporting this + // UpdateSignalBarsL(); + // SetSignalIndicatorL(); + } + } + break; + } + + case EPSCTsyCallStateConnected: + { + if (StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) == EPSCTsyCallTypeCSVoice) + { + // Check if GPRS suspended note is required + iCallActivated = ETrue; + // not supporting this + // HandleGprsNotesL(); + } + if ( iDeviceLockEnabled ) + { + // Enable keylock via autolock emulation if device lock enabled. + // Otherwise e.g. messages can be read using softkeys during ongoing call. + iKeyguardController->EnableKeyguard(EFalse); + } + break; + } + + case EPSCTsyCallStateNone: + { + // Reset timers in ScreenSaver and Autolock + User::ResetInactivityTime(); - __ASSERT_DEBUG( iSysApPsmController, User::Invariant() ); - - if ( aDisable ) + if ( iEmergencyCallActive ) + { + iEmergencyCallActive = EFalse; + // not supporting this + // UpdateSignalBarsL( 0 ); + // SetSignalIndicatorL(); + } + if ( iKeyLockOnBeforeCall ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateNone: enable keylock") ) ); + iKeyLockOnBeforeCall = EFalse; + if ( !iDeviceLockEnabled ) + { + if ( !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeAlarm && + !iSysApFeatureManager->TouchUnlockStrokeSupported() ) + { + if ( iSysApCenRepController->GetInt( KCRUidCommonTelephonySettings, KSettingsSummaryAfterCall ) == 1 ) + { + // Let's not hide "Summary After Call" dialog + iKeyguardController->EnableKeyguard(EFalse); + } + else + { + iKeyguardController->EnableKeyguard(ETrue); + } + } + } + else + { + iKeyguardController->EnableKeyguard(EFalse); + } + } + if ( iShowkeypadActivatedNoteAfterSoftReject ) + { + ShowUiNoteL( EKeypadActiveNote ); + iShowkeypadActivatedNoteAfterSoftReject = EFalse; + } + iCallActivated = EFalse; + break; + } + + default: + break; + } + + if ( aCurrentCallState != EPSCTsyCallStateRinging ) { - iSysApPsmController->DoEnableFullPsm( EFalse ); + iSysApLightsController->CallComingInL( EFalse ); + } + + SetIhfIndicatorL(); + SetHacIndicatorL(); + } + + + +/** + * To check the for an emergency call. + * + * @return ETrue if there is an emergency call active otherwise, EFalse. + */ +TBool CSysApAppUi::IsEmergencyCall() + { + TBool retVal( EFalse ); + TInt err( KErrNone ); + TInt state( 0 ); + + err = RProperty::Get(KPSUidCtsyEmergencyCallInfo, KCTSYEmergencyCallInfo, state ); + if ( err == KErrNone && state ) + { + retVal = ETrue; + } + return retVal; + } + + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::IsStateNormal() +// +// ---------------------------------------------------------------------------- +TBool CSysApAppUi::IsStateNormal() const + { + TInt state; + TInt errorCode = + RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state ); + if ( errorCode == KErrNone ) + { + return state == ESwStateNormalRfOn || + state == ESwStateNormalRfOff || + state == ESwStateNormalBTSap; + } + else + { + TRACES( RDebug::Print( _L( "CSysApAppUi::IsStateNormal: Failed to read global system state, error code %d." ), errorCode ) ); + return EFalse; } } - + + // ---------------------------------------------------------------------------- -// CSysApAppUi::CancelQuery +// CSysApAppUi::HandleAccessoryProfileInStartupL() // ---------------------------------------------------------------------------- -// -void CSysApAppUi::CancelQuery( TSysApConfirmationQueryIds aQueryId ) + +void CSysApAppUi::HandleAccessoryProfileInStartupL() { - TRACES( RDebug::Print( _L("CSysApAppUi::CancelQuery aQueryId: %d"), aQueryId ) ); + TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL" ) ) ); - if ( iSysApConfirmationQuery ) + if ( !iSysApOfflineModeController->OfflineModeActive() ) { - if ( aQueryId == iSysApConfirmationQuery->CurrentQuery() || aQueryId == ESysApNoQuery ) + iIgnoreAccessorySpecificProfileChanges = EFalse; + TBool accessoryConnectedInShutdown( EFalse ); + TInt accessoryTemp( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) ); + if ( accessoryTemp == 1 ) + { + accessoryConnectedInShutdown = ETrue; + } + + TBool accessoryConnectedNow ( EFalse ); + + TAccMode accessoryState(EAccModeHandPortable); + if ( iSysApAccessoryObserver ) + { + accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); + } + + if ( accessoryState != EAccModeHandPortable ) { - iSysApConfirmationQuery->Cancel(); + accessoryConnectedNow = ETrue; + } + TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL: accessoryConnectedInShutdown: %d, accessoryConnectedNow: %d" ), + accessoryConnectedInShutdown, accessoryConnectedNow ) ); + + if ( accessoryConnectedInShutdown && !accessoryConnectedNow ) + { + HandleAccessoryDisconnectedL(); + } + else if ( !accessoryConnectedInShutdown && accessoryConnectedNow ) + { + HandleAccessoryConnectedL( accessoryState ); + } + else if ( !accessoryConnectedNow ) + { + // not supporting this + // TInt activeProfile ( ActiveProfileId() ); + // SysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, activeProfile ); } } } -// End of File + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::CenRepController() +// ---------------------------------------------------------------------------- + +CSysApCenRepController& CSysApAppUi::CenRepController() + { + __ASSERT_ALWAYS( iSysApCenRepController, User::Panic( _L("CSysApAppUi::CenRepController"), KErrBadHandle ) ); + + return *iSysApCenRepController; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::LogsObserverL +// ---------------------------------------------------------------------------- +// +CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL() + { + TRACES( RDebug::Print( _L("CSysApAppUi::LogsObserverL()") ) ); + + // Create Logs observer when it is needed for the first time + if ( !iSysApCenRepLogsObserver ) + { + iSysApCenRepLogsObserver = CSysApCenRepLogsObserver::NewL( *this ); + } + + return *iSysApCenRepLogsObserver; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleWlanIndicator() +// ---------------------------------------------------------------------------- +void CSysApAppUi::HandleWlanIndicatorL( TInt aValue ) + { + if ( aValue == EPSWlanIndicatorAvailable ) + { + // do nothing + } + else if ( aValue == EPSWlanIndicatorActive ) + { + // do nothing + } + else if ( aValue == EPSWlanIndicatorActiveSecure ) + { + // do nothing + } + else // No indication required + { + // do nothing + } + } + +void CSysApAppUi::ShowNotificationDialog(const TDesC& noteText)const +{ + //Todo:4.Notification--Just Popup message + //Todo: #include + CHbDeviceNotificationDialogSymbian *notificationDialog = CHbDeviceNotificationDialogSymbian::NewL(); + CleanupStack::PushL(notificationDialog); + notificationDialog->SetTextL(noteText);//noteText with Qm file input + notificationDialog->SetTimeout(100); + notificationDialog->ShowL(); + CleanupStack::PopAndDestroy(notificationDialog); +} + +void CSysApAppUi::SetKeyLockEnabledL() + { + iKeyLockEnabled = ETrue; + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); + // not supporting indicator +// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); + iSysApLightsController->KeylockStateChangedL( ETrue ); + } + +void CSysApAppUi::SetKeyLockDisabledL() + { + iKeyLockEnabled = EFalse; + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); + // SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); + if (! iDeviceLockEnabled ) + { + iSysApLightsController->KeylockStateChangedL( EFalse ); + if ( iSysApFeatureManager->MmcHotSwapSupported() ) + { + if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) + { + // RunUnlockNotifierL(); + // need to handle MMC unlock query in next sub + } + } + } + } + +void CSysApAppUi::SetLightsOnUnlockNoteL() + { + iSysApLightsController->SetLightsOnUnlockNoteL(); + } + +void CSysApAppUi::SetLightsOnEcsQueryL() + { + iSysApLightsController->SetLightsOnEcsQueryL(); + } + +void CSysApAppUi::SetLightsOnSecurityQueryL() + { + iSysApLightsController->SetLightsOnSecurityQueryL(); + } + +TBool CSysApAppUi::CheckLongPowerKeyPressed() + { + return iCheckLongPowerKeyEvent; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) +// ---------------------------------------------------------------------------- + +TKeyResponse CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) + { + if ( ! iShutdownStarted ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d, iIgnoreNextPowerKeyUpEvent:%d, iPowerKeyPopupMenuActive:%d, iLastPowerKeyWasShort:%d, iPowerKeyPopupMenuDismissed:%d"), + aKeyEvent.iCode, aKeyEvent.iScanCode, aType, iIgnoreNextPowerKeyUpEvent, iPowerKeyPopupMenuActive, iLastPowerKeyWasShort, iPowerKeyPopupMenuDismissed ) ); + +#ifdef _DEBUG + // camery latency measurement environment instrumentation, don't remove + if ( aType == EEventKey && aKeyEvent.iCode == EKeyCamera ) + { + TRACES( RDebug::Print( _L("e_KEY_EVENT_SENDING 0") ) ); + } +#endif // _DEBUG + + TKeyResponse response( EKeyWasNotConsumed ); + if (iSysApKeyManagement && aKeyEvent.iCode != EKeyPowerOff && aKeyEvent.iCode != 'E') + { + response = iSysApKeyManagement->HandleKeyEventL(aKeyEvent, aType ); + } + + if( aType == EEventKey ) + { + switch ( aKeyEvent.iCode ) + { +#ifdef _DEBUG + case 'E': //For testing + Exit(); + break; +#endif + case EKeyPowerOff: + //Short power key press + iKeyBoardRepeatCount++; + if( aKeyEvent.iRepeats == 0 ) + { + TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Short powerkey") ) ); + iLastPowerKeyWasShort = ETrue; + TRACES( RDebug::Print( _L("CSysApAppUi::Key was consumed by pressing short power") ) ); + //Powermenu + if (iPowerMenuDialog != NULL) + { + //PowerMenu already exist + delete iPowerMenuDialog; + iPowerMenuDialog = NULL; + } + + iPowerMenuDialog = CHbDevicePowerMenuSymbian::NewL(*this); + iPowerMenuDialog->ShowL(); + iIgnoreNextPowerKeyRepeats = EFalse; + } + //Long power key press + else if( aKeyEvent.iRepeats > 0 && iKeyBoardRepeatCount >= iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApPowerkeyRepeatcount )) + { + iKeyBoardRepeatCount = -1; + TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Long powerkey") ) ); + iLastPowerKeyWasShort = EFalse; + HandleLongPowerKeyPressedL(); + } + break; + + default: + { + TKeyResponse response = EKeyWasNotConsumed; + if (iSysApKeyManagement) + { + response = iSysApKeyManagement->HandleKeyEventL(aKeyEvent, aType ); + } + + if ( response == EKeyWasNotConsumed ) // none of the plugins consumed the key, offer it to default handling + { + iSysApDefaultKeyHandler->HandleKeyEventL( aKeyEvent, aType ); + } + } + break; + } + } + else if( aType == EEventKeyUp ) + { + if( aKeyEvent.iScanCode == EStdKeyDevice2 ) + { + if ( iIgnoreNextPowerKeyUpEvent ) + { + if ( !iPowerKeyPopupMenuDismissed ) // If the popup menu has been dismissed, do nothing + { + iPowerKeyPopupMenuActive = ETrue; + iIgnoreNextPowerKeyUpEvent = EFalse; + } + } + else if( iLastPowerKeyWasShort ) + { + if ( iPowerKeyPopupMenuActive ) + { + } + } + + } + } + + TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL:ended, aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d, iIgnoreNextPowerKeyUpEvent:%d, iPowerKeyPopupMenuActive:%d, iLastPowerKeyWasShort:%d, iPowerKeyPopupMenuDismissed:%d"), + aKeyEvent.iCode, aKeyEvent.iScanCode, aType, iIgnoreNextPowerKeyUpEvent, iPowerKeyPopupMenuActive, iLastPowerKeyWasShort, iPowerKeyPopupMenuDismissed ) ); + } + else // shutdown started + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d"), + aKeyEvent.iCode, aKeyEvent.iScanCode, aType ) ); + + // When shutdown has been started, only device mode key events are passed to plug-in framework + // This for enabling plug-in activities during shutdown animation + if ( IsDeviceModeKey( aKeyEvent ) ) // Other key events are not passed, because they must cancel the shutdown animation as stated in UI spefication + { + if ( aType == EEventKey && iSysApKeyManagement ) + { + iSysApKeyManagement->HandleKeyEventL( aKeyEvent, aType ); + } + } + TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: ended") ) ); + } + return EKeyWasConsumed; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleCommandL( TInt aCommand) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleCommandL( TInt aCommand ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleCommandL aCommend: %d"), aCommand ) ); + switch ( aCommand ) + { + case EEikCmdExit: // EAknCmdExit + Exit(); + break; + default: + break; + } + } + +TBool CSysApAppUi::ReleasePowerMenuCustomDialogMemory() + { + if (iPowerMenuDialog!=NULL) + { + //PowerMenu already exist + delete iPowerMenuDialog; + iPowerMenuDialog = NULL; + return ETrue; + } + return EFalse; + } + + +//end of file diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApDocument.cpp --- a/coreapplicationuis/SysAp/Src/SysApDocument.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApDocument.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -31,7 +31,26 @@ CSysApDocument::~CSysApDocument() { } +/* +// --------------------------------------------------------- +// CSysApDocument::ConstructL() +// --------------------------------------------------------- +void CSysApDocument::ConstructL() + { + } +// --------------------------------------------------------- +// CSysApDocument::NewL() +// --------------------------------------------------------- +CSysApDocument* CSysApDocument::NewL(CEikApplication& aApp) // CSysApp reference + { + CSysApDocument* self = new (ELeave) CSysApDocument(aApp); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } +*/ // ---------------------------------------------------------------------------- // CSysApDocument::CreateAppUiL() // constructs CSysApUi @@ -46,7 +65,7 @@ // ---------------------------------------------------------------------------- void CSysApDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName ) { - CAknDocument::UpdateTaskNameL( aWgName ); + CEikDocument::UpdateTaskNameL( aWgName ); aWgName->SetHidden( ETrue ); } diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApFeatureManager.cpp --- a/coreapplicationuis/SysAp/Src/SysApFeatureManager.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApFeatureManager.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -94,9 +94,9 @@ TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: No power key supported=%d"), iNoPowerKeySupported ) ); // iFmTxSupported = FeatureManager::FeatureSupported( KFeatureIdFmtx ); - // TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: FM TX supported=%d"), iFmTxSupported ) ); +// TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: FM TX supported=%d"), iFmTxSupported ) ); - iPenEnabled = AknLayoutUtils::PenEnabled(); +// iPenEnabled = AknLayoutUtils::PenEnabled(); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Pen enabled=%d"), iPenEnabled ) ); iVmbxCallDivertIconSupported = FeatureManager::FeatureSupported( KFeatureIdVmbxCallDivertIcon ); @@ -180,11 +180,11 @@ iGripNotSupported( ETrue ), iPowerSaveSupported( EFalse ), iNoPowerKeySupported( EFalse ), -// iFmTxSupported( EFalse ), + //iFmTxSupported( EFalse ), iPenEnabled( EFalse ), iVmbxCallDivertIconSupported( EFalse ), iTouchUnlockStrokeSupported( EFalse ) -// iFmTxRdsTextSupported( EFalse ) + //iFmTxRdsTextSupported( EFalse ) { } @@ -379,6 +379,7 @@ return iFmTxSupported; } */ + // ---------------------------------------------------------------------------- // CSysApFeatureManager::PenEnabled() // ---------------------------------------------------------------------------- diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApLightsController.cpp --- a/coreapplicationuis/SysAp/Src/SysApLightsController.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApLightsController.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -150,7 +150,7 @@ TBool blinkEnabled = ETrue; - if( iSysApFeatureManager->Supported( KSysApFeatureIdNoFlasUiInSilentMode ) ) + if( iSysApFeatureManager->Supported( KSysApFeatureIdNoFlasUiInSilentMode )) { blinkEnabled = EFalse; } diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp --- a/coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -38,6 +38,7 @@ #include "sysapremconobserver.h" #include #include +#include #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS #include @@ -47,11 +48,13 @@ #include #endif //SYMBIAN_ENABLE_SPLIT_HEADERS - // CONSTANTS const TUint KCoreAppUIsMmcRemovedWithoutEjectCmdMask = 0xFFFF; const TUint KCoreAppUIsMmcRemovedWithoutEjectValShift = 16; +const TUid KPSUidSecurityUIs = { 0x100059b5 }; +const TUint32 KSecurityUIsLights = 0x00000308; + // ============================ MEMBER FUNCTIONS ============================== // ---------------------------------------------------------------------------- @@ -93,10 +96,10 @@ iOutboxStatusSubscriber->Subscribe(); iIrdaStatusSubscriber = CSysApSubscriber::NewL( *this, KIrdaPropertyCategory, KIrdaStatus ); iIrdaStatusSubscriber->Subscribe(); - iGprsStatusSubscriber = CSysApSubscriber::NewL( *this, KUidSystemCategory, KPSUidGprsStatusValue ); - iGprsStatusSubscriber->Subscribe(); - iWcdmaStatusSubscriber = CSysApSubscriber::NewL( *this, KUidSystemCategory, KPSUidWcdmaStatusValue ); - iWcdmaStatusSubscriber->Subscribe(); +// iGprsStatusSubscriber = CSysApSubscriber::NewL( *this, KUidSystemCategory, KPSUidGprsStatusValue ); +// iGprsStatusSubscriber->Subscribe(); +// iWcdmaStatusSubscriber = CSysApSubscriber::NewL( *this, KUidSystemCategory, KPSUidWcdmaStatusValue ); +// iWcdmaStatusSubscriber->Subscribe(); iLocationGlobalPrivacySubscriber = CSysApSubscriber::NewL( *this, KUidSystemCategory, KPSUidLocationGlobalPrivacyValue ); iLocationGlobalPrivacySubscriber->Subscribe(); iRestoreBackupSubscriber = CSysApSubscriber::NewL( *this, KUidSystemCategory, conn::KUidBackupRestoreKey ); @@ -185,6 +188,15 @@ iSmsPhoneStoreSubscriber = CSysApSubscriber::NewL( *this, KUidPSSMSStackCategory, KUidPSSMSStackDiskSpaceMonitorKey ); iSmsPhoneStoreSubscriber->Subscribe(); + + iKeylockEventSubscriber = CSysApSubscriber::NewL( *this, KPSUidAvkonDomain, KAknKeyguardStatus ); + iKeylockEventSubscriber->Subscribe(); + + iLightsOnRequestSubscriber = CSysApSubscriber::NewL( *this, KPSUidSecurityUIs, KSecurityUIsLights ); + iLightsOnRequestSubscriber->Subscribe(); + + iPowerMenuCustomDialogSubscriber = CSysApSubscriber::NewL( *this, KPSUidCoreApplicationUIs, KCoreAppUIsPowerMenuCustomDialogStatus ); + iPowerMenuCustomDialogSubscriber->Subscribe(); } // ---------------------------------------------------------------------------- @@ -202,8 +214,8 @@ delete iInboxStatusSubscriber; delete iOutboxStatusSubscriber; delete iIrdaStatusSubscriber; - delete iGprsStatusSubscriber; - delete iWcdmaStatusSubscriber; +// delete iGprsStatusSubscriber; +// delete iWcdmaStatusSubscriber; delete iHomeZoneStatusSubscriber; delete iNewEmailStatusSubscriber; delete iLocationGlobalPrivacySubscriber; @@ -236,6 +248,9 @@ delete iVideoSharingIndicatorSubscriber; delete iGpsIndicatorSubscriber; delete iSmsPhoneStoreSubscriber; + delete iKeylockEventSubscriber; + delete iLightsOnRequestSubscriber; + delete iPowerMenuCustomDialogSubscriber; } @@ -306,7 +321,8 @@ { HandleHwrmFmTxCategoryL( aKey, value ); } -*/ else if ( aCategory == KPSUidDataSynchronizationInternalKeys ) +*/ + else if ( aCategory == KPSUidDataSynchronizationInternalKeys ) { HandleDataSyncCategoryL( aKey, value ); } @@ -318,6 +334,14 @@ { HandleSmsStackCategoryL( aKey, value ); } + else if ( aCategory == KPSUidAvkonDomain) + { + HandleLKeylockEventL( aKey, value ); + } + else if ( aCategory == KPSUidSecurityUIs) + { + HandleLightsOnRequestL( aKey, value ); + } } // ---------------------------------------------------------------------------- // CSysApPubSubObserver::HandleCoreAppUIsCategoryL() @@ -361,23 +385,23 @@ case KCoreAppUIsUipInd: if ( aValue == ECoreAppUIsDoNotShow ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorInstantMessage, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorInstantMessage, EAknIndicatorStateOff ); } else if ( aValue == ECoreAppUIsShow ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorInstantMessage, EAknIndicatorStateOn ); +// iSysApAppUi.SetIndicatorStateL( EAknIndicatorInstantMessage, EAknIndicatorStateOn ); } break; case KCoreAppUIsMessageToneQuit: - iSysApAppUi.HandleMessageTonePlayingQuitability( aValue ); + // iSysApAppUi.HandleMessageTonePlayingQuitability( aValue ); break; case KCoreAppUIsNspsRawKeyEvent: - iSysApAppUi.HandleNspsRawKeyEventL(); + // iSysApAppUi.HandleNspsRawKeyEventL(); break; case KCoreAppUIsLightsRawKeyEvent: if ( aValue == ECoreAppUIsKeyEvent ) { - iSysApAppUi.HandleRawKeyEventLightsRequireL(); + // iSysApAppUi.HandleRawKeyEventLightsRequireL(); } break; case KCoreAppUIsMmcRemovedWithoutEject: @@ -385,27 +409,27 @@ TUint cmd( aValue & KCoreAppUIsMmcRemovedWithoutEjectCmdMask ); if ( cmd == ECoreAppUIsEjectCommandUsed ) { - iSysApAppUi.EjectStarted( ETrue ); + // iSysApAppUi.EjectStarted( ETrue ); } else if ( cmd == ECoreAppUIsEjectCommandNotUsed ) { - iSysApAppUi.EjectStarted( EFalse ); + // iSysApAppUi.EjectStarted( EFalse ); } else if ( cmd == ECoreAppUIsEjectCommandUsedToDrive ) { TInt drive( aValue >> KCoreAppUIsMmcRemovedWithoutEjectValShift ); - iSysApAppUi.EjectUsed( drive ); + // iSysApAppUi.EjectUsed( drive ); } break; } case KCoreAppUIsNewEmailStatus: if ( aValue == ECoreAppUIsNewEmail ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorEmailMessage, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorEmailMessage, EAknIndicatorStateOn ); } else if ( aValue == ECoreAppUIsNoNewEmail ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorEmailMessage, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorEmailMessage, EAknIndicatorStateOff ); } break; @@ -423,68 +447,84 @@ case KCoreAppUIsPoCIndicator: if ( aValue == ECoreAppUIsPocIndicatorOff || aValue == ECoreAppUIsPocIndicatorUninitialized ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoC, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCDnD, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoC, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCDnD, EAknIndicatorStateOff ); } else if ( aValue == ECoreAppUIsPocIndicatorDoNotDisturb ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoC, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCDnD, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoC, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCDnD, EAknIndicatorStateOn ); } else if ( aValue == ECoreAppUIsPocIndicatorConnectionOn ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoC, EAknIndicatorStateOn ); - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCDnD, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoC, EAknIndicatorStateOn ); +// iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCDnD, EAknIndicatorStateOff ); } break; case KCoreAppUIsPoCMissedIndicator: if ( aValue == ECoreAppUIsPocMissedIndicatorOff || aValue == ECoreAppUIsPocMissedIndicatorUninitialized ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCMissed, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCMissed, EAknIndicatorStateOff ); } else if ( aValue == ECoreAppUIsPocMissedIndicatorOn ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCMissed, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorPoCMissed, EAknIndicatorStateOn ); } break; case KCoreAppUIsTarmIndicator: - iSysApAppUi.HandleTarmIndicatorL( aValue ); + // iSysApAppUi.HandleTarmIndicatorL( aValue ); break; case KCoreAppUIsMtvRecStatus: if ( aValue == ECoreAppUIsMtvRecStatusOn ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTVRec, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTVRec, EAknIndicatorStateOn ); } else if ( aValue == ECoreAppUIsMtvRecStatusOff || aValue == ECoreAppUIsMtvRecStatusUninitialized ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTVRec, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTVRec, EAknIndicatorStateOff ); } break; case KCoreAppUIsMtvDvbhStatus: if ( aValue == ECoreAppUIsMtvDvbhStatusOn ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTV, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTV, EAknIndicatorStateOn ); } else if ( aValue == ECoreAppUIsMtvDvbhStatusOff || aValue == ECoreAppUIsMtvDvbhStatusUninitialized ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTV, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( EAknIndicatorMobileTV, EAknIndicatorStateOff ); } break; case KCoreAppUIsVideoSharingIndicator: if ( aValue == ECoreAppUIsVideoSharingIndicatorOn ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorVideoSharing, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorVideoSharing, EAknIndicatorStateOn ); } else if ( aValue == ECoreAppUIsVideoSharingIndicatorOff || aValue == ECoreAppUIsVideoSharingIndicatorUninitialized ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorVideoSharing, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorVideoSharing, EAknIndicatorStateOff ); } break; - + + case KCoreAppUIsPowerMenuCustomDialogStatus: + if ( aValue == ECoreAppUIsPowerMenuCustomDialogOn ) + { + TBool powerMenuMemoryStatus = EFalse; + powerMenuMemoryStatus = iSysApAppUi.ReleasePowerMenuCustomDialogMemory(); + if(powerMenuMemoryStatus) + { + RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPowerMenuCustomDialogStatus, ECoreAppUIsPowerMenuCustomDialogOff ); + } + } + else if ( aValue == ECoreAppUIsPowerMenuCustomDialogOff || aValue == ECoreAppUIsPowerMenuCustomDialogUninitialized ) + { + // do nothing + } + break; + default: break; } @@ -525,43 +565,43 @@ switch ( aKey ) { case KUidInboxStatusValue: - iSysApAppUi.SetEnvelopeIndicatorL(); +// iSysApAppUi.SetEnvelopeIndicatorL(); break; case KUidOutboxStatusValue: if ( aValue == ESADocumentsInOutbox ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOn ); } //Hide the Outbox indicator else if ( aValue == ESAOutboxEmpty ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOff ); } break; case KIrdaStatus: if ( aValue == TIrdaStatusCodes::EIrLoaded || aValue == TIrdaStatusCodes::EIrBlocked || aValue == TIrdaStatusCodes::EIrDisconnected ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateAnimate ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateAnimate ); } else if ( aValue == TIrdaStatusCodes::EIrConnected ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOn ); } else if ( aValue == TIrdaStatusCodes::EIrUnloaded ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOff ); } break; - case KPSUidGprsStatusValue: - case KPSUidWcdmaStatusValue: - iSysApAppUi.SetSignalIndicatorL(); - break; +// case KPSUidGprsStatusValue: + // case KPSUidWcdmaStatusValue: + // iSysApAppUi.SetSignalIndicatorL(); +// break; case KPSUidLocationGlobalPrivacyValue: - iSysApAppUi.HandleLocationPrivacyIndicatorL( aValue ); +// iSysApAppUi.HandleLocationPrivacyIndicatorL( aValue ); break; case conn::KUidBackupRestoreKey: @@ -594,7 +634,7 @@ switch ( aKey ) { case KHWRMBatteryLevel: - iSysApAppUi.UpdateBatteryBarsL( aValue ); + // iSysApAppUi.UpdateBatteryBarsL( aValue ); break; case KHWRMBatteryStatus: @@ -642,17 +682,17 @@ TRACES(RDebug::Print(_L("CSysApPubSubObserver::HandleHwrmFmTxCategoryL Active/Inactive -> Off transition"))); // turn any FM TX indicators off - iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOff ); // give notification if ( aValue == EFmTxStatePowerSaveAccessory ) { - iSysApAppUi.ShowUiNoteL( EFmTxAccessoryStandbyNote ); +// iSysApAppUi.ShowUiNoteL( EFmTxAccessoryStandbyNote ); } else { - iSysApAppUi.ShowUiNoteL( EFmTxOffNote ); + // iSysApAppUi.ShowUiNoteL( EFmTxOffNote ); } isFmTxTurnedOff = ETrue; } @@ -662,8 +702,8 @@ TRACES(RDebug::Print(_L("CSysApPubSubObserver::HandleHwrmFmTxCategoryL Active -> Inactive transition"))); // enable not sending indicator - iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOn ); +// iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOn ); } else if ( aValue == EFmTxStateActive ) { @@ -671,8 +711,8 @@ TRACES(RDebug::Print(_L("CSysApPubSubObserver::HandleHwrmFmTxCategoryL Inactive -> Active transition"))); // enable active indicator - iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOn ); +// iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOff ); +// iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOn ); } break; @@ -689,11 +729,11 @@ TRACES(RDebug::Print(_L("CSysApPubSubObserver::HandleHwrmFmTxCategoryL Off -> Active transition"))); // enable active indicator - iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOn ); // give notification - iSysApAppUi.ShowUiNoteL( EFmTxOnNote ); + // iSysApAppUi.ShowUiNoteL( EFmTxOnNote ); isFmTxTurnedOn = ETrue; } else if ( aValue == EFmTxStateInactive || aValue == EFmTxStateScanning ) @@ -702,11 +742,11 @@ TRACES(RDebug::Print(_L("CSysApPubSubObserver::HandleHwrmFmTxCategoryL Off -> Inactive transition"))); // enable not sending indicator - iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOff ); - iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOn ); +// iSysApAppUi.SetIndicatorStateL( KFmTxActiveIndicator, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( KFmTxNotSendingIndicator, EAknIndicatorStateOn ); // give notification - iSysApAppUi.ShowUiNoteL( EFmTxOnNote ); + // iSysApAppUi.ShowUiNoteL( EFmTxOnNote ); isFmTxTurnedOn = ETrue; } break; @@ -794,16 +834,16 @@ case KNWHomeZoneStatus: if ( aValue == ENWHomeZone ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOn ); } else if ( aValue == ENWNone || aValue == ENWCityZone ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOff ); } break; case KNWTelephonyNetworkMode: - iSysApAppUi.SetSignalIndicatorL(); + // iSysApAppUi.SetSignalIndicatorL(); break; default: @@ -821,11 +861,11 @@ case KHWRMFlipStatus: if ( aValue == EPSHWRMFlipClosed ) { - iSysApAppUi.SimulateFlipKeyEventL( EFalse ); + // iSysApAppUi.SimulateFlipKeyEventL( EFalse ); } else if ( aValue == EPSHWRMFlipOpen ) { - iSysApAppUi.SimulateFlipKeyEventL( ETrue ); + // iSysApAppUi.SimulateFlipKeyEventL( ETrue ); } break; @@ -844,11 +884,11 @@ case KDataSyncStatus: if ( aValue > EDataSyncNotRunning ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorSynchronization , EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorSynchronization , EAknIndicatorStateOn ); } else { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorSynchronization, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorSynchronization, EAknIndicatorStateOff ); } break; @@ -868,15 +908,15 @@ case KPosIntGpsHwStatus: if ( aValue == EPosIntGpsHwOff ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateOff ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateOff ); } else if ( aValue == EPosIntGpsHwOn ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateOn ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateOn ); } else if ( aValue == EPosIntGpsHwIntermediate ) { - iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateAnimate ); + // iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateAnimate ); } break; @@ -893,8 +933,8 @@ { switch ( aKey ) { - case KUidPSSMSStackDiskSpaceMonitorKey: - iSysApAppUi.SetEnvelopeIndicatorL(); + case KAknKeyguardStatus: + // iSysApAppUi.SetEnvelopeIndicatorL(); break; default: @@ -902,7 +942,39 @@ } } -// End of File +void CSysApPubSubObserver::HandleLKeylockEventL( const TUint /* aKey */, const TInt aValue ) + { + switch( aValue ) + { + case EEikKeyLockEnabled: + iSysApAppUi.SetKeyLockEnabledL(); + break; + case EEikKeyLockDisabled: + iSysApAppUi.SetKeyLockDisabledL(); + break; + default: + break; + } + } +void CSysApPubSubObserver::HandleLightsOnRequestL( const TUint /* aKey */, const TInt aValue ) + { + switch ( aValue ) + { + case EEikKeyLockLightsOnRequest: + iSysApAppUi.SetLightsOnUnlockNoteL(); + break; + case EEikEcsQueryLights: // emergency note is shown + iSysApAppUi.SetLightsOnEcsQueryL(); + break; + case EEikSecurityQueryLights: // for device lock security query + iSysApAppUi.SetLightsOnSecurityQueryL(); + break; + default: + break; + } + } + +// End of File diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApShutdownImage.cpp --- a/coreapplicationuis/SysAp/Src/SysApShutdownImage.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApShutdownImage.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -17,15 +17,20 @@ // INCLUDE FILES -#include -#include -#include +//#include +//#include +//#include +#include #include #include //use of TResourceReader -#include +//#include #include "SysApShutdownImage.h" #include "SysAp.hrh" #include +#include +#include + +//_LIT(KDC_APP_BITMAP_DIR,"\\resource\\apps\\"); // ============================ MEMBER FUNCTIONS ============================== @@ -70,13 +75,16 @@ { TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL:start" ) ) ); TInt err ( 0 ); + TRect rect(iCoeEnv->ScreenDevice()->SizeInPixels()); + SetRect(rect); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:SetRect --Minus one" ) ) ); + ActivateL(); - SetRect(iAvkonAppUi->ApplicationRect()); - ActivateL(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ActivateL --Zero" ) ) ); if ( aBitmapId ) { - _LIT( KDirAndFile, "z:sysap.mif" ); + _LIT( KDirAndFile, "z:qgn_sysap_screen.svg" ); TParse* fp = new (ELeave) TParse(); CleanupStack::PushL(fp); fp->Set( KDirAndFile, &KDC_APP_BITMAP_DIR, NULL ); @@ -99,27 +107,35 @@ delete iBitmap; iBitmap = NULL; // Ownership of bitmap is transferred to CSysApShutdownImage in CreateIconL - iBitmap = AknIconUtils::CreateIconL( fp->FullName(), aBitmapId ); - TAknLayoutRect bitmapRect; - bitmapRect.LayoutRect( Rect(), AKN_LAYOUT_WINDOW_screen ); - AknIconUtils::SetSize( iBitmap, bitmapRect.Rect().Size(), EAspectRatioPreservedAndUnusedSpaceRemoved ); + iBitmap = ReadSVGL(fp->FullName()); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ReadSVGL --First" ) ) ); TInt xDelta=0; // for x coordinates TInt yDelta=0; // for y coordinates TSize bmpSizeInPixels = iBitmap->SizeInPixels(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:SizeInPixels --Second" ) ) ); //center image to the center of the screen TRect rect = Rect(); xDelta=( rect.Width() - bmpSizeInPixels.iWidth ) / 2; yDelta=( rect.Height() - bmpSizeInPixels.iHeight ) / 2; TPoint pos = TPoint( xDelta , yDelta ); // displacement vector //pos += rect.iTl; // bitmap top left corner position + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:TPoint --Three" ) ) ); CWindowGc& gc = SystemGc(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:SystemGc --Four" ) ) ); ActivateGc(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ActivateGc --Five" ) ) ); Window().Invalidate( rect ); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:Invalidate --Six" ) ) ); Window().BeginRedraw( rect ); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:BeginRedraw --Seven" ) ) ); gc.Clear(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.Clear --Eight" ) ) ); gc.BitBlt( pos, iBitmap ); // CWindowGc member function + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.BitBlt --Nine" ) ) ); Window().EndRedraw(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.EndRedraw --Ten" ) ) ); DeactivateGc(); + TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.DeactivateGc --Eleven" ) ) ); ControlEnv()->WsSession().Flush(); // force draw of the context TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL:end" ) ) ); } @@ -144,7 +160,60 @@ ControlEnv()->WsSession().Flush(); // force draw of the context #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION } + } +// ---------------------------------------------------------------------------- +// CSysApShutdownImage::ShowShutdownImage() +// ---------------------------------------------------------------------------- +CFbsBitmap* CSysApShutdownImage::ReadSVGL (TFileName aFileName) + { + TRACES( RDebug::Print(_L("CSysApShutdownImage::ReadSVGL:start" ) ) ); + TFontSpec fontspec; + TDisplayMode mode = EColor16MA; + TInt SIZE_X(360), SIZE_Y(360); + TSize size(SIZE_X, SIZE_Y); + + //if ( mode >= (TDisplayMode)13 ) { mode = EColor16MA; } + + CFbsBitmap* frameBuffer = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( frameBuffer ); + frameBuffer->Create( size, mode ); + + CSvgEngineInterfaceImpl* svgEngine = NULL; + svgEngine = CSvgEngineInterfaceImpl::NewL(frameBuffer, NULL, fontspec ); + + if (svgEngine == NULL) + { + TRACES( RDebug::Print(_L("CSysApShutdownImage::ReadSVGL:SVG engine creation failed" ) ) ); + } + + CleanupStack::PushL( svgEngine ); + TInt domHandle = 0; + svgEngine->PrepareDom( aFileName, domHandle ) ; + if (domHandle == 0) + { + TRACES( RDebug::Print(_L("CSysApShutdownImage::ReadSVGL():DOM handle creation failed" ) ) ); + } + + CFbsBitmap* bitmap = new(ELeave) CFbsBitmap; + CleanupStack::PushL( bitmap ); + User::LeaveIfError( bitmap->Create( size, EColor64K ) ); + + svgEngine->UseDom( domHandle, bitmap, NULL ) ; + + MSvgError* err; + svgEngine->Start( err ); + if (err->HasError()) + { + TRACES( RDebug::Print(_L("CSysApShutdownImage::ReadSVGL(): SVG Engine Start failed" ) ) ); + } + + svgEngine->DeleteDom( domHandle ); + CleanupStack::Pop( bitmap ); + CleanupStack::PopAndDestroy( svgEngine ); + CleanupStack::PopAndDestroy( frameBuffer ); + TRACES( RDebug::Print(_L("CSysApShutdownImage::ReadSVGL:End" ) ) ); + return bitmap; } // ---------------------------------------------------------------------------- diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApSimChanged.cpp --- a/coreapplicationuis/SysAp/Src/SysApSimChanged.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApSimChanged.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -117,13 +117,13 @@ dateTime.Set( 2100, EJanuary, 1, 0, 0, 0, 0 ); TTime date(dateTime); - TRACES( RDebug::Print( _L("CSysApSimChanged::ClearLogsL(): trying CLogClient::NewL") ) ); +/* TRACES( RDebug::Print( _L("CSysApSimChanged::ClearLogsL(): trying CLogClient::NewL") ) ); CLogClient* logClient = CLogClient::NewL( iFs ); logClient->ClearLog( date, active->iStatus ); - +*/ CActiveScheduler::Start(); - delete logClient; +// delete logClient; CleanupStack::PopAndDestroy( active ); } @@ -136,7 +136,7 @@ TRACES( RDebug::Print( _L("CSysApSimChanged::ClearSsSettingsL()") ) ); // Reset SSSettings values - RSSSettings ssSettings; +/* RSSSettings ssSettings; User::LeaveIfError( ssSettings.Open( iSysApAppUi.GetTelServer() ) ); TRACES( RDebug::Print( _L("CSysApSimChanged::ClearSsSettingsL(): trying RSSSettings::HandleSIMChanged") ) ); @@ -144,6 +144,7 @@ ssSettings.Close(); User::LeaveIfError( err ); +*/ } // ----------------------------------------------------------------------------- diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApTaskList.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/SysAp/Src/SysApTaskList.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 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: +* +*/ +#include "SysApTaskList.h" +#include + +CSysApTaskList* CSysApTaskList::NewL(RWsSession& aWsSession) + { + CSysApTaskList* self = NewLC(aWsSession); + CleanupStack::Pop(self); + return self; + } + + CSysApTaskList* CSysApTaskList::NewLC(RWsSession& aWsSession) + { + CSysApTaskList* self = new(ELeave) CSysApTaskList(aWsSession); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CSysApTaskList::CSysApTaskList(RWsSession& aWsSession) +: iWs(aWsSession) + { + } + +void CSysApTaskList::ConstructL() + { + UpdateListL(); + } + + CSysApTaskList::~CSysApTaskList() + { + iWgs.Close(); + } + + void CSysApTaskList::UpdateListL() + { + User::LeaveIfError(iWs.WindowGroupList(0, &iWgs)); + } + + const RArray& CSysApTaskList::WgArray() const + { + return iWgs; + } + + TApaTask CSysApTaskList::FindRootApp(TUid aAppUid) const + { + TApaTask task(iWs); + task.SetWgId(0); // initialise task to non-existant task + // wgId = 0 tells FindAppByUid to start looking for apps + TInt wgId=0; + FOREVER + { + CApaWindowGroupName::FindByAppUid(aAppUid, iWs, wgId); + // KErrNotFound means that no more apps can be found + if (wgId == KErrNotFound) + break; + if (IsRootWindowGroup(wgId)) + { + // Found a root wg with the right app UID, return it. + task.SetWgId(wgId); + break; + } + } + return task; + } + + TBool CSysApTaskList::IsRootWindowGroup(TInt aWgId) const + { + TInt count = iWgs.Count(); + for (TInt ii=0; ii 0 && info.iParentId != info.iId) + return info.iParentId; + } + return 0; + } + + TInt CSysApTaskList::FindChildWgId(TInt aWgId) const + { + TInt count = iWgs.Count(); + for (TInt ii=0; ii 0 && info.iParentId != info.iId) + return info.iId; + } + return 0; + } + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/SysApTimer.cpp --- a/coreapplicationuis/SysAp/Src/SysApTimer.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApTimer.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -18,8 +18,8 @@ // INCLUDES -#include -#include +//#include +//#include #include "SysAp.hrh" #include "SysApTimer.h" diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/hbdevicepowermenusymbian.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/SysAp/Src/hbdevicepowermenusymbian.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,434 @@ +/* + * 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: + * + */ + +#include +#include +#include +#include "hbdevicepowermenusymbian.h" + + +//These Keys will be used in CHbSymbianVariantMap +//Donot Change these strings +_LIT(KVolumeLevel, "VolumeLevel"); +_LIT(KSilenceLatchOn, "SilenceLatchOn"); //Used to latch silencebutton +_LIT(KCypherOff, "CypherOff"); //used to poweroffButtonEnabled/Disabled +_LIT(KVibrationEnable, "VibrationEnable"); +_LIT(KOfflineEnable, "OfflineEnable"); +_LIT(KShutDown, "ShutDown"); + +//used to load plugin +_LIT(KPluginIdentifier, "com.nokia.hb.devicepowermenu/1.0"); + + +NONSHARABLE_CLASS(CHbDevicePowerMenuPrivate) : public CBase, public MHbDeviceDialogObserver +{ +public: + static CHbDevicePowerMenuPrivate* NewL(CHbDevicePowerMenuSymbian* aDialog); + virtual ~CHbDevicePowerMenuPrivate(); + + void ShowL(); + void AddVariantL(const TDesC& aKey, const TAny* aData, CHbSymbianVariant::TType aDataType); + + //Set Methods + void SetVolume(TInt aVolume); + void SetSilenceMode(TBool aEnable); + void SetOfflineMode(TBool aChecked); + void SetVibrationEnabled(TBool aEnable); + void SetPowerOffEnabled(TBool aEnable); + +public: + // MHbDeviceDialogObserver + void DataReceived(CHbSymbianVariantMap& aData); + void DeviceDialogClosed(TInt aCompletionCode); + +private: + CHbDevicePowerMenuPrivate(); + void ConstructL(CHbDevicePowerMenuSymbian* aDialog); + +private: + //symbian FW client intreface to load Qt.plugin + CHbDeviceDialogSymbian* iDeviceDialog; + //Parameter for loading qt.plugin + CHbSymbianVariantMap* iVariantMap; + //Symbian client interface for Powermenu + CHbDevicePowerMenuSymbian* iPowerMenuManager; + + //Variants used in VariantMap + TInt iVolumeLevel; //Volume level ranges 1 to 10 + TBool iSilenceLatchOn; //Silence Enabled or Disbaled + TBool iVibrationEnable; //Master Vibarate enabled/Disabled + TBool iOfflineEnable; //Oflline Mode enabled or Disabled + TBool iCypherOff; //Encryption/Decryption ON/OFF +}; + +/** + * Create an object of CHbDevicePowerMenuPrivate + */ +CHbDevicePowerMenuPrivate* CHbDevicePowerMenuPrivate::NewL(CHbDevicePowerMenuSymbian* aDialog) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::NewL: START") ) ); + CHbDevicePowerMenuPrivate* self = new (ELeave) CHbDevicePowerMenuPrivate(); + CleanupStack::PushL(self); + self->ConstructL(aDialog); + CleanupStack::Pop(self); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::NewL: END") ) ); + return self; + } + +/** + * Constructor + */ +CHbDevicePowerMenuPrivate::CHbDevicePowerMenuPrivate() + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::Constructor") ) ); + //Do nothing + } + +/** + * Destructor + */ +CHbDevicePowerMenuPrivate::~CHbDevicePowerMenuPrivate() + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::Destructor: START") ) ); + delete iDeviceDialog; + delete iVariantMap; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::Destructor: END") ) ); + } + +/** + * Constrcuts all its member variables + */ +void CHbDevicePowerMenuPrivate::ConstructL(CHbDevicePowerMenuSymbian* aDialog) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::ConstructL: START") ) ); + iPowerMenuManager = aDialog; + iDeviceDialog = CHbDeviceDialogSymbian::NewL(); + iVariantMap = CHbSymbianVariantMap::NewL(); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::ConstructL: END") ) ); + } + +/** + * Builds all parameters required for showing the PowerMenu Dialog. + * Loads the required powermenu plugin and calls show on DeviceDialog. + * This Displays the Customized PowerMenu Widget. + */ +void CHbDevicePowerMenuPrivate::ShowL() + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::ShowL: START") ) ); + AddVariantL(KVolumeLevel, &iVolumeLevel, CHbSymbianVariant::EInt); + AddVariantL(KSilenceLatchOn, &iSilenceLatchOn, CHbSymbianVariant::EBool); + AddVariantL(KVibrationEnable, &iVibrationEnable, CHbSymbianVariant::EBool); + AddVariantL(KOfflineEnable, &iOfflineEnable, CHbSymbianVariant::EBool); + AddVariantL(KCypherOff, &iCypherOff, CHbSymbianVariant::EBool); + //No shutdown varinat will be added to showL + User::LeaveIfError(iDeviceDialog->Show(KPluginIdentifier, *iVariantMap, this)); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::ShowL: END") ) ); + } + +/** + * Sets Volume to aVolume + */ +void CHbDevicePowerMenuPrivate::SetVolume(TInt aVolume) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetVolume: START") ) ); + iVolumeLevel = aVolume; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetVolume: END") ) ); + } + +/** + * Sets SilenceMode to Enable/Disable + */ +void CHbDevicePowerMenuPrivate::SetSilenceMode(TBool aEnable) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetSilenceMode: START") ) ); + iSilenceLatchOn = aEnable; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetSilenceMode: END") ) ); + } + +/** + * Sets OfflineMode to Checked/UnChecked + */ +void CHbDevicePowerMenuPrivate::SetOfflineMode(TBool aChecked) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetOfflineMode: START") ) ); + iOfflineEnable = aChecked; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetOfflineMode: END") ) ); + } + +/** + * Sets VibrationEnabled to Checked/UnChecked + */ +void CHbDevicePowerMenuPrivate::SetVibrationEnabled(TBool aChecked) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetVibrationEnabled: START") ) ); + iVibrationEnable = aChecked; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetVibrationEnabled: END") ) ); + } + +/** + * Sets PowerOffEnabled to Enable/Disable + */ +void CHbDevicePowerMenuPrivate::SetPowerOffEnabled(TBool aEnable) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetPowerOffEnabled: START") ) ); + iCypherOff = aEnable; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::SetPowerOffEnabled: END") ) ); + } + +/** + * Data received from HBDeviceDialog will hit by emit deviceDialogData in plugin + * The values received from UI will set to ControlPanel. + */ +void CHbDevicePowerMenuPrivate::DataReceived(CHbSymbianVariantMap& aData) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: START") ) ); + // Updates received from the plugin. + //1. Volume + const CHbSymbianVariant* volumeVariant = aData.Get(KVolumeLevel); + if(volumeVariant) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: volumeVariant::Start") ) ); + TInt* volumeValue = volumeVariant->Value(); + if(volumeValue) + { + iVolumeLevel = *volumeValue; + iPowerMenuManager->iProfileEngine->SetMasterVolumeL( iVolumeLevel ); + } + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived:volumeVariant::End") ) ); + } + + //2. Silence + const CHbSymbianVariant* SilenceVariant = aData.Get(KSilenceLatchOn); + if(SilenceVariant) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: SilenceVariant::Start") ) ); + TBool* LatchValue = SilenceVariant->Value(); + if(LatchValue) + { + iSilenceLatchOn = *LatchValue; + iPowerMenuManager->iProfileEngine->SetSilenceModeL( iSilenceLatchOn );//member in CHbDevicePowerMenuSymbian + } + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: SilenceVariant::End") ) ); + } + + //3. Vibration + const CHbSymbianVariant* VibrationVariant = aData.Get(KVibrationEnable); + if(VibrationVariant) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: VibrationVariant::Start") ) ); + TBool* VibrationValue = VibrationVariant->Value(); + if(VibrationValue) + { + iVibrationEnable = *VibrationValue; + iPowerMenuManager->iProfileEngine->SetMasterVibraL( iVibrationEnable );//member in CHbDevicePowerMenuSymbian + } + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: VibrationVariant::End") ) ); + } + + //4.Offline + const CHbSymbianVariant* OfflineVariant = aData.Get(KOfflineEnable); + if(OfflineVariant) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: OfflineVariant::Start") ) ); + TBool* OfflineValue = OfflineVariant->Value(); + if(OfflineValue) + { + iOfflineEnable = *OfflineValue; + User::LeaveIfError( iPowerMenuManager->iCenrepOffline->Set( KSettingsAirplaneMode, iOfflineEnable ) ); + } + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: OfflineVariant::End") ) ); + } + + //5.shutdown + const CHbSymbianVariant* ShutDownVariant = aData.Get(KShutDown); + if(ShutDownVariant) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: ShutDownVariant::Start") ) ); + TBool* ShutDownValue = ShutDownVariant->Value(); + if(ShutDownValue) + { + TBool shutDown = *ShutDownValue; + if (shutDown) + { + iPowerMenuManager->iSysApServer.HandleLongPowerKeyPressedL(); + } + + } + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: ShutDownVariant::End") ) ); + } + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: END") ) ); + return; + } + +/** + * DeviceDialogClosed will be executed by the event emit deviceDialogClosed in plugin. + * This will be executed when 1. Tap out side the Dialog to Close + * 2. When Power Off Button is clicked. + */ +void CHbDevicePowerMenuPrivate::DeviceDialogClosed(TInt /*aCompletionCode*/) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DeviceDialogClosed") ) ); + // Inform sysap to release the memory of power menu custom dialog. + RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPowerMenuCustomDialogStatus, ECoreAppUIsPowerMenuCustomDialogOn ); + } + +/** + * Contrcuts VariantMap + */ +void CHbDevicePowerMenuPrivate::AddVariantL(const TDesC& aKey, const TAny* aData, CHbSymbianVariant::TType aDataType) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::AddVariantL: START") ) ); + CHbSymbianVariant *variant = CHbSymbianVariant::NewL(aData, aDataType); + CleanupStack::PushL(variant); + //iVariantMap takes the ownerhip of variant + User::LeaveIfError(iVariantMap->Add(aKey, variant)); + CleanupStack::Pop(variant); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::AddVariantL: End") ) ); + } + +/* + * Creates an object of CHbDevicePowerMenuSymbian +*/ +CHbDevicePowerMenuSymbian* CHbDevicePowerMenuSymbian::NewL(CSysApAppUi& aSysApServer) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::NewL: START") ) ); + CHbDevicePowerMenuSymbian* self = new (ELeave) CHbDevicePowerMenuSymbian(aSysApServer); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::NewL: END") ) ); + return self; + } + +/* + * Destructs the class. +*/ +CHbDevicePowerMenuSymbian::~CHbDevicePowerMenuSymbian() + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::Destructor: START") ) ); + delete iCenrepProfile; + delete iCenrepOffline; + iProfileEngine->Release(); + delete iPowerMenuPrivate; + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::Destructor: End") ) ); + } + +/* + * Executes the dialog asynchronously. +*/ +void CHbDevicePowerMenuSymbian::ShowL() + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::ShowL: START") ) ); + iPowerMenuPrivate->ShowL(); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::ShowL: End") ) ); + } + +/** + * Sets Volume to aVolume + */ +void CHbDevicePowerMenuSymbian::SetVolume(TInt aVolume) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetVolume: START") ) ); + iPowerMenuPrivate->SetVolume(aVolume); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetVolume: End") ) ); + } + +/** + * Sets SilenceMode to Enable/Disable + */ +void CHbDevicePowerMenuSymbian::SetSilenceMode(TBool aEnable) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetSilenceMode: START") ) ); + iPowerMenuPrivate->SetSilenceMode(aEnable); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetSilenceMode: END") ) ); + } + +/** + * Sets OfflineMode to Checked/UnChecked + */ +void CHbDevicePowerMenuSymbian::SetOfflineMode(TBool aChecked) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetOfflineMode: START") ) ); + iPowerMenuPrivate->SetOfflineMode(aChecked); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetOfflineMode: End") ) ); + } + +/** + * Sets VibrationEnabled to Checked/UnChecked + */ +void CHbDevicePowerMenuSymbian::SetVibrationEnabled(TBool aEnable) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetVibrationEnabled: START") ) ); + iPowerMenuPrivate->SetVibrationEnabled(aEnable); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetVibrationEnabled: End") ) ); + } + +/** + * Sets PowerOffEnabled to Enable/Disable + */ +void CHbDevicePowerMenuSymbian::SetPowerOffEnabled(TBool aEnable) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetPowerOffEnabled: START") ) ); + iPowerMenuPrivate->SetPowerOffEnabled(aEnable); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::SetPowerOffEnabled: END") ) ); + } + +/* + * Constructor. +*/ +CHbDevicePowerMenuSymbian::CHbDevicePowerMenuSymbian(CSysApAppUi& aSysApServer) + :iSysApServer(aSysApServer) + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::Constructor") ) ); + //Do Nothing + } + +/* + * 2nd Constructor. + * Constructs and initializes all its meber variables +*/ +void CHbDevicePowerMenuSymbian::ConstructL() + { + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::ConstructL: START") ) ); + iProfileEngine = ::CreateProfileEngineExtended2L(); + iCenrepOffline = CRepository::NewL( KCRUidCommunicationSettings ); + iCenrepProfile = CRepository::NewL( KCRUidProfileEngine ); + iPowerMenuPrivate = CHbDevicePowerMenuPrivate::NewL(this); + + //To Sync with Contro panel + TBool airplaneMode(0); + User::LeaveIfError( iCenrepOffline->Get( KSettingsAirplaneMode, airplaneMode ) ); + SetOfflineMode(airplaneMode); + + TInt masterVolume(0); + User::LeaveIfError( iCenrepProfile->Get( KProEngMasterVolume, masterVolume ) ); + SetVolume(masterVolume); + + TBool masterVibrate(0); + User::LeaveIfError( iCenrepProfile->Get( KProEngMasterVibra, masterVibrate ) ); + SetVibrationEnabled(masterVibrate); + + TBool silenceMode(EFalse); + User::LeaveIfError( iCenrepProfile->Get( KProEngSilenceMode, silenceMode ) ); + SetSilenceMode(silenceMode); + + //Cypheroff is True when No encryption/Decryption is happening + TBool cypherOff(!(iSysApServer.IsEncryptionOperationOngoingL())); + SetPowerOffEnabled(cypherOff); + TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::ConstructL: END") ) ); + } + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/sysapbatteryinfocontroller.cpp --- a/coreapplicationuis/SysAp/Src/sysapbatteryinfocontroller.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/sysapbatteryinfocontroller.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -19,13 +19,8 @@ #include #include #include -#include #include "bsutil.h" #include -#include -#include -#include -#include "batterypopupcontrol.h" #include "sysapbatteryinfocontroller.h" #include "SysAp.hrh" @@ -43,8 +38,8 @@ : iBsUtil( NULL ), iCurrentCapacity( KNotInitialized ), iThresholdCapacity( aThreshold ), - iBatteryInfoState( EBatteryInfoAboveThreshold ), - iBatteryPopup( NULL ) + iBatteryInfoState( EBatteryInfoAboveThreshold ) + // iBatteryPopup( NULL ) { // sanity check, fall back to hard coded default value const TInt min(0); @@ -92,7 +87,7 @@ { TRACES( RDebug::Print( _L("CSysApBatteryInfoController::~CSysApBatteryInfoController") ) ); delete iBsUtil; - delete iBatteryPopup; + // delete iBatteryPopup; } // --------------------------------------------------------------------------- @@ -183,38 +178,12 @@ // CSysApBatteryInfoController::ShowBatteryPreviewPopupL // --------------------------------------------------------------------------- // -void CSysApBatteryInfoController::ShowBatteryPreviewPopupL( TInt aCapacity ) +void CSysApBatteryInfoController::ShowBatteryPreviewPopupL( TInt /* aCapacity */ ) { - TRACES( RDebug::Print( _L("CSysApBatteryInfoController::ShowBatteryPreviewPopupL: aCapacity=%d"), aCapacity ) ); - - delete iBatteryPopup; - iBatteryPopup = NULL; - HBufC* popupTextBuf = StringLoader::LoadLC( R_QTN_BATTERY_STATUS_POPUP, aCapacity ); - iBatteryPopup = CBatteryPopupControl::NewL( *popupTextBuf, KNullDesC ); - CleanupStack::PopAndDestroy( popupTextBuf ); - - // switch layout for showing the battery popup - CAknAppUi* appUi = static_cast(CCoeEnv::Static()->AppUi()); - CEikStatusPane* statusPane = appUi->StatusPane(); + // TRACES( RDebug::Print( _L("CSysApBatteryInfoController::ShowBatteryPreviewPopupL: aCapacity=%d"), aCapacity ) ); - TInt currLayout = statusPane->CurrentLayoutResId(); - - RAknUiServer* aknSrv = CAknSgcClient::AknSrv(); - if ( aknSrv ) - { - statusPane->SwitchLayoutL( aknSrv->StatusPaneResourceId() ); - } - // Trap for switching layout back to current. - TRAPD( err, iBatteryPopup->ShowPopUpL() ); - - if( err ) - { - TRACES( RDebug::Print( _L("CSysApBatteryInfoController::ShowBatteryPreviewPopupL ShowPopUpL() leaved: %d"), err ) ); - } - - // restore layout - statusPane->SwitchLayoutL( currLayout ); - - User::LeaveIfError( err ); + // delete iBatteryPopup; + // iBatteryPopup = NULL; + // preview battery capacity } diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp --- a/coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -19,8 +19,9 @@ #include #include #include -#include -#include +//#include +//#include +#include "SysApTaskList.h" #include #include #include @@ -33,11 +34,13 @@ #include #include #include -#include +//#include #include "sysapdefaultkeyhandler.h" #include "sysapcallback.h" #include "SysAp.hrh" -#include "AknSgcc.h" +#include +//#include "sysapappui.h" +#include const TInt KModifierMask( 0 ); @@ -48,18 +51,18 @@ // CSysApDefaultKeyHandler::CSysApDefaultKeyHandler // --------------------------------------------------------------------------- // -CSysApDefaultKeyHandler::CSysApDefaultKeyHandler( MSysapCallback& aCallback ) : +CSysApDefaultKeyHandler::CSysApDefaultKeyHandler( MSysapCallback& aCallback ): iCallback(aCallback), iCameraSupported(EFalse), iCoverDisplaySupported(EFalse), - iKeylock(NULL), +// iKeylock(NULL), iCapturedEKeyCamera(0), iCapturedEKeyTwistOpen(0), iCapturedEKeyTwistClose(0), iCapturedEKeyGripOpen(0), iCapturedEKeyGripClose(0), - iCapturedEKeyPoC(0), - iAknUiServerConnected(EFalse) + iCapturedEKeyPoC(0) +// iAknUiServerConnected(EFalse) { } @@ -73,63 +76,23 @@ RWindowGroup groupWin = CCoeEnv::Static()->RootWin(); User::LeaveIfError ( iCapturedEKeyCamera = groupWin.CaptureKey( EKeyCamera, KModifierMask, KModifierMask ) ); - User::LeaveIfError ( iCapturedEKeyTwistOpen = groupWin.CaptureKey( EKeyTwistOpen, KModifierMask, KModifierMask ) ); - User::LeaveIfError ( iCapturedEKeyTwistClose = groupWin.CaptureKey( EKeyTwistClose, KModifierMask, KModifierMask ) ); - User::LeaveIfError ( iCapturedEKeyGripOpen = groupWin.CaptureKey( EKeyGripOpen, KModifierMask, KModifierMask ) ); - User::LeaveIfError ( iCapturedEKeyGripClose = groupWin.CaptureKey( EKeyGripClose, KModifierMask, KModifierMask ) ); - User::LeaveIfError ( iCapturedEKeyPoC = groupWin.CaptureKey( EKeyPoC, KModifierMask, KModifierMask ) ); - - // flip key events don't need to be captured, because in current setup they are not real events but simulated by SysAp - // according to notifications received from P&S key that stores flip information FeatureManager::InitializeLibL(); iCameraSupported = FeatureManager::FeatureSupported( KFeatureIdCamera ); iCoverDisplaySupported = FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ); FeatureManager::UnInitializeLib(); - - TKeyLockBuf lockBuf; - iCallback.ExecQueryL( MSysapCallback::EGetKeylock, lockBuf ); - iKeylock = lockBuf(); - - __ASSERT_DEBUG( iKeylock, User::Panic( _L("CSysApDefaultKeyHandler::ConstructL: iKeylock not initialized"), KErrBadHandle ) ); - - if ( iCoverDisplaySupported ) // if flip status is monitored, set the initial flip status now - { - TInt flipValue; - TInt err = RProperty::Get( KPSUidHWRM, KHWRMFlipStatus, flipValue ); - - TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::ConstructL: flipValue=%d, err=%d"), flipValue, err ) ); - - if ( err == KErrNone ) - { - switch ( flipValue ) - { - case EPSHWRMFlipOpen: - SetDisplayState( ETrue ); - break; - - case EPSHWRMFlipClosed: - SetDisplayState( EFalse ); - break; - - case EPSHWRMFlipStatusUninitialized: - default: - // set display state only if the current flip position is known - break; - } - } - } + } // --------------------------------------------------------------------------- // CSysApDefaultKeyHandler::NewL // --------------------------------------------------------------------------- // -CSysApDefaultKeyHandler* CSysApDefaultKeyHandler::NewL( MSysapCallback& aCallback ) +CSysApDefaultKeyHandler* CSysApDefaultKeyHandler::NewL(MSysapCallback& aCallback ) { TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::NewL()") ) ); - CSysApDefaultKeyHandler* self = new( ELeave ) CSysApDefaultKeyHandler( aCallback) ; + CSysApDefaultKeyHandler* self = new( ELeave ) CSysApDefaultKeyHandler(aCallback) ; CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -144,17 +107,8 @@ CSysApDefaultKeyHandler::~CSysApDefaultKeyHandler() { TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::~CSysApDefaultKeyHandler()") ) ); - - iAknUiServer.Close(); - RWindowGroup groupWin = CCoeEnv::Static()->RootWin(); - groupWin.CancelCaptureKey( iCapturedEKeyCamera ); - groupWin.CancelCaptureKey( iCapturedEKeyTwistOpen ); - groupWin.CancelCaptureKey( iCapturedEKeyTwistClose ); - groupWin.CancelCaptureKey( iCapturedEKeyGripOpen ); - groupWin.CancelCaptureKey( iCapturedEKeyGripClose ); - groupWin.CancelCaptureKey( iCapturedEKeyPoC ); - + groupWin.CancelCaptureKey( iCapturedEKeyCamera ); } @@ -176,58 +130,7 @@ response = EKeyWasConsumed; // set again in default case if not consumed switch ( aKeyEvent.iCode ) - { - case EKeyGripOpen: - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyGripOpen") ) ); - RProperty::Set( KPSUidHWRM, KHWRMGripStatus, EPSHWRMGripOpen ); - if (!IsDeviceLocked()) - { - iCallback.ExecCommandL( MSysapCallback::EResetKeyguardState ); - iKeylock->DisableKeyLock(); - iCallback.ExecCommandL( MSysapCallback::ECancelPowermenu ); - } - // apply default light control - iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyGripOpen) ); - break; - - case EKeyGripClose: - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyGripClosed") ) ); - RProperty::Set( KPSUidHWRM, KHWRMGripStatus, EPSHWRMGripClosed ); - iCallback.ExecCommandL( MSysapCallback::ECancelPowermenu ); - if ( !IsDeviceLocked() && UiReady() ) - { - iKeylock->OfferKeyLock(); - } - // apply default light control - iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyGripClose) ); - break; - - case EKeyFlipOpen: // simulated key event - { - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyFlipOpen") ) ); - SetDisplayState( ETrue ); - // apply default light control - iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyFlipOpen) ); - } - break; - - case EKeyFlipClose: // simulated key event - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyFlipClose") ) ); - SetDisplayState( EFalse ); - // apply default light control - iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyFlipClose) ); - break; - - case EKeyTwistOpen: - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyTwistOpen") ) ); - RProperty::Set( KPSUidHWRM, KHWRMTwistStatus, EPSHWRMTwistOpen ); - break; - - case EKeyTwistClose: - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyTwistClose") ) ); - RProperty::Set( KPSUidHWRM, KHWRMTwistStatus, EPSHWRMTwistClose ); - break; - + { case EKeyCamera: TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyCamera") ) ); if ( iCameraSupported && !IsDeviceLocked() && !DoShowKeysLockedNote() ) @@ -235,17 +138,10 @@ ActivateApplicationL( KSysApCamcorderUid ); } break; - - case EKeyPoC: - TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::HandleKeyEventL: EKeyPoC") ) ); - LaunchPocL(); - break; - default: response = EKeyWasNotConsumed; TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::CSysApDefaultKeyHandler: key was not consumed.") ) ); - break; - + break; } } @@ -318,15 +214,17 @@ // void CSysApDefaultKeyHandler::ActivateApplicationL( const TUid aUid ) const { + TUid check = aUid; + TRACES( RDebug::Print( _L( "CSysApDefaultKeyHandler::ActivateApplicationL") ) ); // Applications must not be activated before reaching normal system operation state if ( UiReady() ) { - CAknTaskList* apaTaskList = CAknTaskList::NewL( CCoeEnv::Static()->WsSession() ); + CSysApTaskList* apaTaskList = CSysApTaskList::NewLC( CCoeEnv::Static()->WsSession() ); TApaTask apaTask = apaTaskList->FindRootApp( aUid ); // only root application should not be activated - delete apaTaskList; - + CleanupStack::PopAndDestroy( apaTaskList ); + if ( apaTask.Exists() ) { TRACES( RDebug::Print( _L( "CSysApDefaultKeyHandler::ActivateApplicationL: application brought to foreground") ) ); @@ -336,8 +234,8 @@ { TRACES( RDebug::Print( _L("e_CAM_PRI_OFF_TO_ON 1") ) ); } -#endif // _DEBUG - CAknSgcClient::MoveApp ( apaTask.WgId(), ESgcMoveAppToForeground ); +#endif // _DEBUG + apaTask.BringToForeground(); } else { @@ -380,20 +278,8 @@ void CSysApDefaultKeyHandler::LaunchPocL() { TRACES( RDebug::Print(_L("CSysApDefaultKeyHandler::LaunchPocL") ) ); - - if ( UiReady() && !IsDeviceLocked() && !DoShowKeysLockedNote() ) - { - CAiwServiceHandler* serviceHandler = CAiwServiceHandler::NewLC(); - serviceHandler->AttachL( R_POC_AIW_INTEREST ); - - CAiwGenericParamList* inParams = CAiwGenericParamList::NewLC(); - inParams->AppendL(TAiwGenericParam( EGenericParamPoCLaunchView, TAiwVariant(EAiwPoCMainView))); - serviceHandler->ExecuteServiceCmdL( KAiwCmdPoC, *inParams, serviceHandler->OutParamListL()); - - CleanupStack::PopAndDestroy( inParams ); - CleanupStack::PopAndDestroy( serviceHandler); - } - } + // not supported + } // ---------------------------------------------------------------------------- // CSysApDefaultKeyHandler::IsDeviceLocked() @@ -451,25 +337,25 @@ if ( !iAknUiServerConnected ) { - err = iAknUiServer.Connect(); +/* err = iAknUiServer.Connect(); if ( err != KErrNone ) { - TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::DoShowKeysLockedNote: RAknUiServer::Connect failed, err=%d"), err ) ); + // TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::DoShowKeysLockedNote: RAknUiServer::Connect failed, err=%d"), err ) ); return ETrue; // assume that keypad/device is locked } iAknUiServerConnected = ETrue; - } + */ } - TBool keysLocked; - err = iAknUiServer.ShowKeysLockedNote( keysLocked ); + TBool keysLocked = EFalse; +/* err = iAknUiServer.ShowKeysLockedNote( keysLocked ); if ( err != KErrNone ) { TRACES( RDebug::Print( _L("CSysApDefaultKeyHandler::DoShowKeysLockedNote: RAknUiServer::ShowKeysLockedNote failed, err=%d"), err ) ); keysLocked = ETrue; // assume that keypad/device is locked } - + */ return keysLocked; } @@ -500,3 +386,6 @@ return response; } + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/sysapkeymanagement.cpp --- a/coreapplicationuis/SysAp/Src/sysapkeymanagement.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/sysapkeymanagement.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -134,6 +134,10 @@ { iRootWindowGroup.CancelCaptureKeyUpAndDowns( info->iUpAndDownKeyHandles[upAndDownKeyHandleCounter] ); } + for ( TInt keyHandleCounter = info->iLongKeyPressHandle.Count()-1; keyHandleCounter >= 0; keyHandleCounter-- ) + { + iRootWindowGroup.CancelCaptureLongKey( info->iLongKeyPressHandle[keyHandleCounter] ); + } } } @@ -166,8 +170,10 @@ captureKey, info->iPluginUid ) ); if (info->iIsKeyProvider) { + TUint repeatValue = 0; TInt captureUpDownKey = info->iKeys[keyCounter].iScanCode; TUint modifiers = info->iKeys[keyCounter].iModifiers; + repeatValue = info->iKeys[keyCounter].iRepeats; TInt32 keyHandle = iRootWindowGroup.CaptureKey( captureKey, modifiers, modifiers ); @@ -196,6 +202,19 @@ //error of Append ignored, key will not be cancelled. We can live with that. TRACES( RDebug::Print( _L("CSysApKeyManagement::CaptureKeys UpAndDowns: Append failed, error %d"), upAndDownKeyHandle ) ); } + if( repeatValue == 1 ) + { + TInt32 longKeyPressHandle = iRootWindowGroup.CaptureLongKey( captureKey, captureKey,0, modifiers,0, ELongCaptureWaitShort); + if ( longKeyPressHandle < KErrNone ) + { + TRACES( RDebug::Print( _L("CSysApKeyManagement::CaptureLongKey : error %d"), longKeyPressHandle ) ); + continue; // other keys may be possible to capture, so continue + } + if ( ( longKeyPressHandle = info->iLongKeyPressHandle.Append( longKeyPressHandle ) ) != KErrNone ) //store handle for CancelCaptureKeyUpAndDowns + { + TRACES( RDebug::Print( _L("CSysApKeyManagement::CaptureLongKey : Append failed, error %d"), longKeyPressHandle ) ); + } + } } else { diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/Src/sysapremconobserver.cpp --- a/coreapplicationuis/SysAp/Src/sysapremconobserver.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/sysapremconobserver.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -19,7 +19,7 @@ // INCLUDE FILES #include #include -#include +//#include #include "sysapremconobserver.h" #include "SysApAppUi.h" @@ -102,13 +102,13 @@ || aOperationId == ERemConCoreApiMute ) { // A volume key is pressed down -/* TRAPD( err, iSysApAppUi.ShowUiNoteL( EFmTxVolumeDisabledNote ) ); + TRAPD( err, iSysApAppUi.ShowUiNoteL( EFmTxVolumeDisabledNote ) ); if ( err != KErrNone ) { TRACES( RDebug::Print( _L("CSysApRemConObserver::MrccatoCommand: err=%d"), err ) ); } -*/ } + } } } diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/SysAp/rom/SysAp.iby --- a/coreapplicationuis/SysAp/rom/SysAp.iby Fri Jun 11 13:48:03 2010 +0300 +++ b/coreapplicationuis/SysAp/rom/SysAp.iby Wed Jun 23 18:22:59 2010 +0300 @@ -20,6 +20,7 @@ #define __SysAp_IBY__ file=ABI_DIR\BUILD_DIR\NspsWsPlugin.dll SHARED_LIB_DIR\NspsWsPlugin.dll +data=DATAZ_\resource\apps\qgn_sysap_screen.svg resource\apps\qgn_sysap_screen.svg S60_APP_EXE(SysAp) S60_APP_AIF_RSC(SysAp) diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/devicepowermenuplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/devicepowermenuplugin.pro Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,63 @@ +# +############################################################################# +## +## 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: +## +############################################################################# +# + +TEMPLATE = lib +TARGET = DevicePowerMenuPlugin +CONFIG += hb plugin + +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + +# Input +HEADERS += .\inc\hbdevicepowermenuplugin_p.h \ + .\inc\hbdevicepowermenupluginerrors_p.h \ + .\inc\hbdevicepowermenuwidegt_p.h + + +SOURCES += .\src\hbdevicepowermenuplugin.cpp \ + .\src\hbdevicepowermenuwidegt.cpp + +RESOURCES += hbdevicepowermenu.qrc + +MOC_DIR = ./tmp + +TRANSLATIONS += power_menu.ts + +symbian: +{ +TARGET.UID3 = 0x2002F375 +TARGET.CAPABILITY = ALL -TCB +TARGET.EPOCALLOWDLLDATA = 1 + +pluginstub.sources = DevicePowerMenuPlugin.dll +pluginstub.path = /resource/plugins/devicedialogs +DEPLOYMENT += pluginstub +} + +symbian: +{ +BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include " \ + "qmakepluginstubs/DevicePowerMenuPlugin.qtplugin /epoc32/data/z/pluginstub/DevicePowerMenuPlugin.qtplugin" \ + ".\rom\devicepowermenuplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(devicepowermenuplugin.iby)" \ + ".\rom\devicepowermenu_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(devicepowermenu_resources.iby)" +} + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/docml/powermenu.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/docml/powermenu.docml Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/hbdevicepowermenu.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/hbdevicepowermenu.qrc Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,11 @@ + + + docml/powermenu.docml + + + images/decrement.svg + images/increment.svg + images/muted.svg + images/unmuted.svg + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/images/decrement.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/images/decrement.svg Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/images/increment.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/images/increment.svg Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/images/muted.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/images/muted.svg Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/images/unmuted.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/images/unmuted.svg Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/inc/hbdevicepowermenuplugin_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/inc/hbdevicepowermenuplugin_p.h Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,54 @@ +/* + * 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: + * + */ + +#ifndef HBDEVICEPOWERMENUPLUGIN_P_H +#define HBDEVICEPOWERMENUPLUGIN_P_H + +#include +#include + +#include + +//fwd Declaration +class HbDevicePowerMenuPluginPrivate; + +class HbDevicePowerMenuPlugin : public HbDeviceDialogPlugin +{ + Q_OBJECT + +public: + friend class HbDevicePowerMenuPluginPrivate; + + HbDevicePowerMenuPlugin(); + ~HbDevicePowerMenuPlugin(); + + //Pure Virtual method of class HbDeviceDialogPluginInterface + HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType, const QVariantMap ¶meters); + //Pure Virtual Mehods of class HbDeviceDialogPlugin + bool accessAllowed(const QString &deviceDialogType, const QVariantMap ¶meters, const QVariantMap &securityInfo) const; + bool deviceDialogInfo(const QString &deviceDialogType, const QVariantMap ¶meters, DeviceDialogInfo *info) const; + QStringList deviceDialogTypes() const; + PluginFlags pluginFlags() const; + int error() const; + +private: + Q_DISABLE_COPY(HbDevicePowerMenuPlugin) + HbDevicePowerMenuPluginPrivate *d; +}; + +#endif // HBDEVICEPOWERMENUPLUGIN_P_H + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/inc/hbdevicepowermenupluginerrors_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/inc/hbdevicepowermenupluginerrors_p.h Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,41 @@ +/* + * 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: + * + */ + +#ifndef HBDEVICEPOWERMENUPLUGINERRORS_P_H +#define HBDEVICEPOWERMENUPLUGINERRORS_P_H + +#include +#include +#ifdef _DEBUG + + #define TRACES( x ) x + +#else + + #define TRACES( x ) + +#endif + + +// No error +const int NoError = 0; +// Illegal parameter error +const int ParameterError = HbDeviceDialog::PluginErrors + 1; +// Unknown device dialog error +const int UnknownDeviceDialogError = HbDeviceDialog::PluginErrors + 2; + +#endif // HBDEVICEPOWERMENUPLUGINERRORS_P_H diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/inc/hbdevicepowermenuwidegt_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/inc/hbdevicepowermenuwidegt_p.h Wed Jun 23 18:22:59 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: + * + */ + +#ifndef HBDEVICEPOWERMENUWIDEGT_P_H +#define HBDEVICEPOWERMENUWIDEGT_P_H + + +#include +#include +#include +#include +#include +#include +#include +//For widgets used +#include +#include +#include +#include + +class HbDevicePowerMenuWidget : public QObject, public HbDeviceDialogInterface +{ + Q_OBJECT + +public: + HbDevicePowerMenuWidget(const QVariantMap ¶meters); + ~HbDevicePowerMenuWidget(); + +public: + //HbDeviceDialogInterface methods to be implemented + bool setDeviceDialogParameters(const QVariantMap ¶meters); + int deviceDialogError() const; + void closeDeviceDialog(bool byClient); + HbPopup *deviceDialogWidget() const; + virtual QObject *signalSender() const; + + +private: + bool preConstructDialog(); + void constructDialog(const QVariantMap ¶meters); + void hideEvent(QHideEvent *event); + void showEvent(QShowEvent *event); + void cleanupMemory(); + +private: + void customizeVolumeSlider(); + void setSpeakerIcon(); + bool IsValidHandles(); + +private slots: + void handleVolumeChanged(int aVolume); + void handleSilenceMode(bool aState); + void handleVibrationToggled(int aVibrationToggel); + void handleOfflineToggled(int aOfflineToggel); + void handlePowerOff(bool aState); + //void setDialogWidget(Qt::Orientation); + void closedialog(); + +signals: + void deviceDialogClosed(); + void deviceDialogData(QVariantMap data); + +private: + Q_DISABLE_COPY(HbDevicePowerMenuWidget) + + int mDeviceDialogError; //DeviceDialogError + int mVolumeLevel; //shows current Volume Level + bool mShowVolume; //used to Enable or Disbale Volume + bool mVibrationChecked; //Vibration enabled or Disabled + bool mOfflineChecked; //offline enabled or Disabled + bool mSilencelatched; //SilenceMode Enabled or Disabled + bool mCypherOff; //Shows Encryption/Decryption ON/OFF + + HbDialog* mDialogWidget; //Handle for Powermenu Dialog + HbPushButton* mSilenceButton; //Handle for Silence button + HbSlider* mVolumeSlider; //Handle for Slider + HbCheckBox* mVibarte; //Handle for Vibration check Box + HbCheckBox* mOffline; //Handle for Offline CheckBox + HbPushButton * mPowerOffButton; //Handle for PowerOff Button + HbDocumentLoader* mLoader; //Hnadle for Documnet Loader to load docml + //HbMainWindow* mMainWindow; //Handle for mainWindow, used to Catch Orientation changes + HbTranslator* mHbTranslator; //Translator used for localization; loads translation files +}; + +#endif // HBDEVICEPOWERMENUWIDEGT_P_H diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/rom/devicepowermenu_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/rom/devicepowermenu_resources.iby Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,27 @@ +/* + * 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: + * + */ + +#ifndef __DEVICEPOWERMENU_RESOURCES_IBY__ +#define __DEVICEPOWERMENU_RESOURCES_IBY__ + +//this iby is required for language specific things to be exported to Language iby layer +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\power_menu.qm QT_TRANSLATIONS_DIR\power_menu.qm + + +#endif //__DEVICEPOWERMENU_RESOURCES_IBY__ diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/rom/devicepowermenuplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/rom/devicepowermenuplugin.iby Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,24 @@ +/* + * 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: + * + */ + +#ifndef __DEVICEPOWERMENUPLUGIN_IBY__ +#define __DEVICEPOWERMENUPLUGIN_IBY__ + +file = \epoc32\release\armv5\urel\DevicePowerMenuPlugin.dll \sys\bin\DevicePowerMenuPlugin.dll UNPAGED +data=\epoc32\data\z\pluginstub\DevicePowerMenuPlugin.qtplugin \resource\plugins\devicedialogs\DevicePowerMenuPlugin.qtplugin + +#endif //__DEVICEPOWERMENUPLUGIN_IBY__ diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/src/hbdevicepowermenuplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/src/hbdevicepowermenuplugin.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,166 @@ +/* + * 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: + * + */ + +//System includes +#include +#include + +//user includes +#include "hbdevicepowermenuplugin_p.h" +#include "hbdevicepowermenuwidegt_p.h" +#include "hbdevicepowermenupluginerrors_p.h" + +//SysAp's Secure UID +const quint32 KSecureUid = 0x100058F3; + +Q_EXPORT_PLUGIN2(devicepowermenuplugin, HbDevicePowerMenuPlugin) + +// This plugin implements a device dialog type +static const struct + { + const char *mTypeString; + } dialogInfos[] = {{"com.nokia.hb.devicepowermenu/1.0"}}; + +class HbDevicePowerMenuPluginPrivate + { +public: + HbDevicePowerMenuPluginPrivate() {mError = NoError;} + int mError; + }; + +/** + * Constructor + */ +HbDevicePowerMenuPlugin::HbDevicePowerMenuPlugin() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::Constructor:Begin") ) ); + d = new HbDevicePowerMenuPluginPrivate; + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::Constructor:End") ) ); + } + +/** + * Destructor + */ +HbDevicePowerMenuPlugin::~HbDevicePowerMenuPlugin() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::Destructor:Begin") ) ); + delete d; + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::Destructor:End") ) ); + } + +/** + * This method is Pure Virtual in HbDeviceDialogPlugin + * Checks if client is allowed to use device dialog widget + * Its a customized widget for Sysap, and allows only Sysap to use this plugin + */ +bool HbDevicePowerMenuPlugin::accessAllowed(const QString &deviceDialogType, const QVariantMap ¶meters, const QVariantMap &securityInfo) const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::accessAllowed:Begin") ) ); + Q_UNUSED(deviceDialogType) + Q_UNUSED(parameters) + TBool secured(false); + quint32 secUid = static_cast(securityInfo.value("sym-secureId").toInt()); + if (secUid == KSecureUid ) + { + secured = true; + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::accessAllowed:End") ) ); + return secured; + } + +/** + * Creates device dialog widget + */ +HbDeviceDialogInterface *HbDevicePowerMenuPlugin::createDeviceDialog(const QString &deviceDialogType, const QVariantMap ¶meters) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::createDeviceDialog:Begin") ) ); + d->mError = NoError; + + HbDeviceDialogInterface *ret(NULL); + if (dialogInfos[0].mTypeString == deviceDialogType) + { + QVariantMap params = parameters; + HbDevicePowerMenuWidget *powMenu = new HbDevicePowerMenuWidget(params); + d->mError = powMenu->deviceDialogError(); + if (d->mError != NoError) + { + delete powMenu; + powMenu = NULL; + } + ret = powMenu; + } + else + { + d->mError = UnknownDeviceDialogError; + ret = NULL; + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::createDeviceDialog:End") ) ); + return ret; + } + +/** + * Return information of device dialog the plugin creates + */ +bool HbDevicePowerMenuPlugin::deviceDialogInfo(const QString &deviceDialogType, const QVariantMap ¶meters, DeviceDialogInfo *info) const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::deviceDialogInfo:Begin") ) ); + Q_UNUSED(parameters) + Q_UNUSED(deviceDialogType) + + info->group = GenericDeviceDialogGroup; + info->flags = SecurityCheck; + info->priority = DefaultPriority; + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::deviceDialogInfo:End") ) ); + return true; + } + +/** + * Return device dialog types this plugin implements + */ +QStringList HbDevicePowerMenuPlugin::deviceDialogTypes() const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::deviceDialogTypes:Begin") ) ); + QStringList types; + const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]); + for(int i = 0; i < numTypes; i++) + { + types.append(dialogInfos[i].mTypeString); + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::deviceDialogTypes:End") ) ); + return types; + } + +/** + * Return plugin flags + */ +HbDeviceDialogPlugin::PluginFlags HbDevicePowerMenuPlugin::pluginFlags() const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::pluginFlags:Begin") ) ); + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::pluginFlags:End") ) ); + return NoPluginFlags; + } + +/** + * Return last error + */ +int HbDevicePowerMenuPlugin::error() const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::error:Begin") ) ); + TRACES( RDebug::Print( _L("HbDevicePowerMenuPlugin::error:End") ) ); + return d->mError; + } + diff -r 951aeeb3da43 -r 2222076f5c60 coreapplicationuis/devicepowermenuplugin/src/hbdevicepowermenuwidegt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/devicepowermenuplugin/src/hbdevicepowermenuwidegt.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,481 @@ +/* + * 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: + * + */ + + +#include "hbdevicepowermenuwidegt_p.h" +#include "hbdevicepowermenupluginerrors_p.h" +#include + +//resuorces +QString POWER_MENU_DOCML(":/xml/powermenu.docml"); +QString VOLUME_DECREASE_ICON(":/images/decrement.svg"); +QString VOLUME_INCREASE_ICON(":/images/increment.svg"); +QString VOLUME_UNMUTE_ICON(":/images/unmuted.svg"); +QString VOLUME_MUTE_ICON(":/images/muted.svg"); +//For Localization +QString LOCALE_PATH("/resource/qt/translations/"); +QString TS_FILE("power_menu"); + +//Widget names +QString MAIN_DLG("maindialog"); +QString PWR_SILENCE("Silence"); +QString PWR_VOLUME("Volume"); +QString PWR_VIBARTE("Vibrate"); +QString PWR_OFFLINE("Offline"); +QString PWR_POWEROFF("PowerOff"); +QString PWR_CONTAINER("container_1"); + +//DO not modify these strings +QString KVolumeLevel("VolumeLevel"); +QString KSilenceLatchOn("SilenceLatchOn"); //Used to latch silencebutton +QString KVibrationEnable("VibrationEnable"); +QString KOfflineEnable("OfflineEnable"); +QString KCypherOff("CypherOff"); //used to poweroffButtonEnabled/Disabled +QString KShutDown("ShutDown"); + +//Used for Orientation of PowerMenu +qreal KVerticalX = 175; +//width of PowerMenu +qreal KPMWidth = 360; +/** + * Constructor + */ +HbDevicePowerMenuWidget::HbDevicePowerMenuWidget(const QVariantMap ¶meters) + :mDeviceDialogError(NoError), + mVolumeLevel(0), + mShowVolume(false), + mVibrationChecked(true), + mOfflineChecked(true), + mSilencelatched(true), + mCypherOff(true), + mDialogWidget(NULL), + mSilenceButton(NULL), + mVolumeSlider(NULL), + mVibarte(NULL), + mOffline(NULL), + mPowerOffButton(NULL), + mLoader(NULL), + mHbTranslator(NULL) + { + // mMainWindow(NULL), + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::Constructor:Begin") ) ); + if (preConstructDialog()) + { + //Translator loaded succesfully then olny construct widgets + constructDialog(parameters); + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::Constructor:End") ) ); + } + +/** + * Destructor + */ +HbDevicePowerMenuWidget::~HbDevicePowerMenuWidget() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::Destructor()") ) ); + delete mLoader; + delete mHbTranslator; + } + +/** + * Implementation of HbDeviceDialogInterface method + * sets parameters of custom widget + */ +bool HbDevicePowerMenuWidget::setDeviceDialogParameters(const QVariantMap ¶meters) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::setDeviceDialogParameters:Begin") ) ); + if(parameters.contains(KVolumeLevel)) + { + mVolumeLevel = parameters.value(KVolumeLevel).toInt(); + } + if(parameters.contains(KSilenceLatchOn)) + { + mSilencelatched = parameters.value(KSilenceLatchOn).toBool(); + //If SilenceMode is Enabled then MasterVolume control is Disabled + mShowVolume = mSilencelatched? false:true; + } + if(parameters.contains(KVibrationEnable)) + { + mVibrationChecked = parameters.value(KVibrationEnable).toBool(); + } + if(parameters.contains(KOfflineEnable)) + { + mOfflineChecked = parameters.value(KOfflineEnable).toBool(); + } + if(parameters.contains(KCypherOff)) + { + mCypherOff = parameters.value(KCypherOff).toBool(); + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::setDeviceDialogParameters:End") ) ); + return true; + } + +/** + * Returns error code + */ +int HbDevicePowerMenuWidget::deviceDialogError() const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::deviceDialogError") ) ); + return mDeviceDialogError; + } + +/** + * Close DeviceDialog + */ +void HbDevicePowerMenuWidget::closeDeviceDialog(bool byClient) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::closeDeviceDialog:Begin") ) ); + Q_UNUSED(byClient); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::closeDeviceDialog:End") ) ); + mDialogWidget->close(); + } + +/** + * Implementation of HbDeviceDialogInterface method + */ +HbPopup* HbDevicePowerMenuWidget::deviceDialogWidget() const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::deviceDialogWidget") ) ); + return mDialogWidget; + } + +/** + * Implementation of HbDeviceDialogInterface method + * to get signals from action events + */ +QObject* HbDevicePowerMenuWidget::signalSender() const + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::signalSender") ) ); + return const_cast(this); + } + +/** + * Before loading docml and widgets Translator must be loaded + */ +bool HbDevicePowerMenuWidget::preConstructDialog() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::preConstructDialog:Begin") ) ); + //Translator + mHbTranslator = new HbTranslator(LOCALE_PATH,TS_FILE); + if(!mHbTranslator) + { + //Translator is failed to create + mDeviceDialogError = UnknownDeviceDialogError; + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::preConstructDialog:MemoryAllocation Failed") ) ); + return false; + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::preConstructDialog:End") ) ); + return true; + } + +/** + * Constrcuts customized widget dialog by loading the UI from docml and + * initializes all parameters and attributes. + * Throws bad-memory on Un-succesful memory allocations + */ +void HbDevicePowerMenuWidget::constructDialog(const QVariantMap ¶meters) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::constructDialog:Begin") ) ); + bool dialogLoaded(false); + //Docml loader + mLoader = new HbDocumentLoader(); + if(!mLoader) + { + //Document Loader failed to create + mDeviceDialogError = UnknownDeviceDialogError; + cleanupMemory(); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::constructDialog:mLoader::MemoryAllocation Failed") ) ); + return; + } + mLoader->load(POWER_MENU_DOCML, &dialogLoaded); + Q_ASSERT_X(dialogLoaded, "HbDevicePowerMenuWidget", "Invalid xml file"); + //Widgets + if (dialogLoaded) + { + //Dialog loaded succesfully from docml + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::constructDialog:dialogLoaded:Begin") ) ); + + //Initialize Parameters received + setDeviceDialogParameters(parameters); + mDialogWidget = qobject_cast (mLoader->findWidget(MAIN_DLG)); + //Find the handles for all widget items + mSilenceButton = qobject_cast (mLoader->findWidget(PWR_SILENCE)); + mVolumeSlider = qobject_cast (mLoader->findWidget(PWR_VOLUME)); + mVibarte = qobject_cast (mLoader->findWidget(PWR_VIBARTE)); + mOffline = qobject_cast (mLoader->findWidget(PWR_OFFLINE)); + mPowerOffButton = qobject_cast (mLoader->findWidget(PWR_POWEROFF)); + QGraphicsWidget *widget(NULL); + widget = mLoader->findWidget(PWR_CONTAINER); + if (!(IsValidHandles()&&(widget))) + { + //Atleast, One of the Handles are not allocated memory + mDeviceDialogError = UnknownDeviceDialogError; + cleanupMemory(); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::constructDialog:Widgets::MemoryAllocation Failed") ) ); + return; + } + //Sets Speaker icon + setSpeakerIcon(); + //Customize slider to VolumeSlider + customizeVolumeSlider(); + mDialogWidget->setContentWidget(widget); + //SetWidget Attributes + //1. Volume + mVolumeSlider->setSliderPosition(mVolumeLevel); + mVolumeSlider->setEnabled(mShowVolume); + //This will avoid IPC calls while dragging the Slider + mVolumeSlider->setTracking(false); + bool ok = connect(mVolumeSlider,SIGNAL(valueChanged(int)) , this , SLOT(handleVolumeChanged(int))); + Q_ASSERT_X(ok, "VolumeSlider", "Invalid IncrementDecrement Change"); + + //2.Silence Mode + mSilenceButton->setDown(mSilencelatched); + ok = connect(mSilenceButton,SIGNAL(clicked(bool)) , this , SLOT(handleSilenceMode(bool))); + Q_ASSERT_X(ok, "SilenceButton", "Invalid Clicked"); + + //3.Master Vibration + mVibarte->setChecked(mVibrationChecked); + ok = connect(mVibarte,SIGNAL(stateChanged(int)) , this , SLOT(handleVibrationToggled(int))); + Q_ASSERT_X(ok, "Vibrator", "Invalid Vibrator Toggeld"); + + //4.Offline + mOffline->setChecked(mOfflineChecked); + ok = connect(mOffline,SIGNAL(stateChanged(int)) , this , SLOT(handleOfflineToggled(int))); + Q_ASSERT_X(ok, "Vibrator", "Invalid Offline Toggeld"); + + //5.Power off + mPowerOffButton->setEnabled(mCypherOff); + ok = connect(mPowerOffButton,SIGNAL(clicked(bool)) , this , SLOT(handlePowerOff(bool))); + Q_ASSERT_X(ok, "PowerOffButton", "Invalid Clicked"); + + //Dialog dismiss only with Tap outside + mDialogWidget->setTimeout(HbPopup::NoTimeout); + mDialogWidget->setDismissPolicy(HbPopup::TapOutside); + mDialogWidget->setPreferredWidth(KPMWidth); + //Sets Dialog position on screen +/* + HbInstance* instance = HbInstance::instance(); + mMainWindow = instance->allMainWindows().first(); + ok = connect(mMainWindow , SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setDialogWidget(Qt::Orientation))); + //This is required to launch menu in right place for very first time + setDialogWidget(mMainWindow->orientation()); + + Q_ASSERT_X(ok, "Orientation", "Invalid Orientation"); +*/ + connect(mDialogWidget,SIGNAL(aboutToClose()),this, SLOT(closedialog())); + + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::constructDialog:dialogLoaded:End") ) ); + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::constructDialog:End") ) ); + } + +/** + * Checks whether all Hadles for widgets DialogWidget, + * SilenceButton, Vibrate, Offline and Poweroff Button allocated memory. + * Returns True, if all Handles allocated memory. + * Flase, atleast one of them NOT allocated memory. + */ +bool HbDevicePowerMenuWidget::IsValidHandles() + { + if((!mDialogWidget) || (!mSilenceButton) || (!mVolumeSlider)||(!mVibarte) || (!mOffline) || (!mPowerOffButton)) + { + return false; + } + else{ + //All handles are allocated memory + return true; + } + } + +/** + * Sets Mute/Unmute icon for Volume slider + * Mute/Unmute icon to display the current status of Silence Mode. + * Mute icon dispalyed when Device in Silence mode. + * Unmute icon dispalyed when Device Non-Silence mode. + */ +void HbDevicePowerMenuWidget::setSpeakerIcon() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::setSpeakerIcon:Begin") ) ); + QString speakerIcon= ( mSilencelatched )? VOLUME_MUTE_ICON : VOLUME_UNMUTE_ICON ; + mVolumeSlider->setElementIcon(HbSlider:: IconElement,HbIcon(speakerIcon)); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::setSpeakerIcon:End") ) ); + } + + +/** + * Customizes the slider to Vloume Slider + */ +void HbDevicePowerMenuWidget::customizeVolumeSlider() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::customizeVolumeSlider:Begin") ) ); + //Construct Volume Slider from the HbSlider + mVolumeSlider->setSliderElements(QList() + << HbSlider::DecreaseElement + << HbSlider::TrackElement + << HbSlider::IncreaseElement + << HbSlider::IconElement ); + + // To set DecreaseIcon and IncreseIcon + mVolumeSlider->setElementIcon(HbSlider::DecreaseElement, HbIcon(VOLUME_DECREASE_ICON)); + mVolumeSlider->setElementIcon(HbSlider:: IncreaseElement, HbIcon(VOLUME_INCREASE_ICON)); + //set Range of volume + mVolumeSlider->setRange(1,10); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::customizeVolumeSlider:End") ) ); + } + +/** + * Widget is about to hide. + * This method is dervied from HBpopUp + * + */ +void HbDevicePowerMenuWidget::hideEvent(QHideEvent *event) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::hideEvent:Begin") ) ); + Q_UNUSED(event); + //emit deviceDialogClosed(); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::hideEvent:End") ) ); + } + +void HbDevicePowerMenuWidget::closedialog() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::closedialog:Begin") ) ); + emit deviceDialogClosed(); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::closedialog:Begin") ) ); + } +/** + * Widget is about to show + * This method is dervied from HBpopUp + */ +void HbDevicePowerMenuWidget::showEvent(QShowEvent *event) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::showEvent") ) ); + Q_UNUSED(event); + } + +/** + * Slot + */ +void HbDevicePowerMenuWidget::handleVolumeChanged(int aVolume) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleVolumeChanged:Begin") ) ); + mVolumeLevel = aVolume; + //inform the client may be through data changed etc. + QVariantMap mDataToSend; + QVariant volume(mVolumeLevel); + mDataToSend.insert(KVolumeLevel, volume); + emit deviceDialogData(mDataToSend); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleVolumeChanged:Begin") ) ); + } + +/** + * Slot + * Switch between the states to latch down and latch up. + * In case of Silence mode, The Silence button id latched down and Disables Volume control. + * In case of Non-Silence mode, The Silence button id latched Up and enables Volume control. + */ +void HbDevicePowerMenuWidget::handleSilenceMode(bool aState) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleSilenceMode:Begin") ) ); + Q_UNUSED(aState); + mShowVolume = !(mShowVolume); + mSilencelatched = !(mSilencelatched); + mSilenceButton->setDown(mSilencelatched); + mVolumeSlider->setEnabled(mShowVolume); + setSpeakerIcon(); + //inform the client may be through data changed etc. + QVariantMap mDataToSend; + QVariant silence(mSilencelatched); + mDataToSend.insert(KSilenceLatchOn, silence); + emit deviceDialogData(mDataToSend); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleSilenceMode:End") ) ); + } + +/** + * Slot + */ +void HbDevicePowerMenuWidget::handlePowerOff(bool aState) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handlePowerOff:Begin") ) ); + Q_UNUSED(aState); + QVariantMap mDataToSend; + QVariant shutdown(true); + mDataToSend.insert(KShutDown, shutdown); + emit deviceDialogData(mDataToSend); + emit deviceDialogClosed(); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handlePowerOff:End") ) ); + } + +/** + * Slot + */ +void HbDevicePowerMenuWidget::handleOfflineToggled(int aOfflineToggel) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleOfflineToggled:Begin") ) ); + mOfflineChecked = aOfflineToggel; + QVariantMap mDataToSend; + QVariant offline(mOfflineChecked); + mDataToSend.insert(KOfflineEnable, offline); + emit deviceDialogData(mDataToSend); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleOfflineToggled:End") ) ); + } + +/** + * Slot + */ +void HbDevicePowerMenuWidget::handleVibrationToggled(int aVibrationToggel) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleVibrationToggled:Begin") ) ); + mVibrationChecked = aVibrationToggel; + QVariantMap mDataToSend; + QVariant vibration(mVibrationChecked); + mDataToSend.insert(KVibrationEnable, vibration); + emit deviceDialogData(mDataToSend); + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::handleVibrationToggled:End") ) ); + } + +void HbDevicePowerMenuWidget::cleanupMemory() + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::cleanupMemory:Begin") ) ); + if(mLoader) + { + delete mLoader; + } + if(mHbTranslator) + { + delete mHbTranslator; + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::cleanupMemory:End") ) ); + } + +/** + * Slot + * Sets Dialog position on screen + */ +/*void HbDevicePowerMenuWidget::setDialogWidget(Qt::Orientation aOrientation) + { + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::setDialogWidget:Begin") ) ); + if (aOrientation == Qt::Vertical) + { + mDialogWidget->setPreferredPos(QPointF(0,0),HbPopup::TopLeftCorner); + } + else + { + mDialogWidget->setPreferredPos(QPointF(KVerticalX,0),HbPopup::TopLeftCorner); + } + TRACES( RDebug::Print( _L("HbDevicePowerMenuWidget::setDialogWidget:End") ) ); + }*/ + diff -r 951aeeb3da43 -r 2222076f5c60 layers.sysdef.xml --- a/layers.sysdef.xml Fri Jun 11 13:48:03 2010 +0300 +++ b/layers.sysdef.xml Wed Jun 23 18:22:59 2010 +0300 @@ -1,13 +1,13 @@ - ]> - + - + diff -r 951aeeb3da43 -r 2222076f5c60 sysdef_1_4_0.dtd --- a/sysdef_1_4_0.dtd Fri Jun 11 13:48:03 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 951aeeb3da43 -r 2222076f5c60 sysdef_1_5_1.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_5_1.dtd Wed Jun 23 18:22:59 2010 +0300 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 951aeeb3da43 -r 2222076f5c60 sysresmonitoring/oommonitor/inc/oommemorymonitor.h --- a/sysresmonitoring/oommonitor/inc/oommemorymonitor.h Fri Jun 11 13:48:03 2010 +0300 +++ b/sysresmonitoring/oommonitor/inc/oommemorymonitor.h Wed Jun 23 18:22:59 2010 +0300 @@ -20,7 +20,7 @@ #define OOMMEMORYMONITOR_H #include -#include +#include #include #include "oomglobalconfig.h" #include "oomwindowgrouplist.h" diff -r 951aeeb3da43 -r 2222076f5c60 sysresmonitoring/oommonitor/inc/oommemorymonitorsession.h --- a/sysresmonitoring/oommonitor/inc/oommemorymonitorsession.h Fri Jun 11 13:48:03 2010 +0300 +++ b/sysresmonitoring/oommonitor/inc/oommemorymonitorsession.h Wed Jun 23 18:22:59 2010 +0300 @@ -31,6 +31,7 @@ CMemoryMonitorSession(); #ifndef CLIENT_REQUEST_QUEUE void CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood); + TBool IsDataPaged(const RMessage2& aMessage); #endif private: @@ -41,7 +42,6 @@ #endif CMemoryMonitor& Monitor(); void ServiceL(const RMessage2& aMessage); - TBool IsDataPaged(const RMessage2& aMessage); private: RMessagePtr2 iRequestFreeRam; #ifndef CLIENT_REQUEST_QUEUE diff -r 951aeeb3da43 -r 2222076f5c60 sysresmonitoring/oommonitor/src/oomlog.cpp --- a/sysresmonitoring/oommonitor/src/oomlog.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/sysresmonitoring/oommonitor/src/oomlog.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff -r 951aeeb3da43 -r 2222076f5c60 sysresmonitoring/oommonitor/src/oommemorymonitorsession.cpp --- a/sysresmonitoring/oommonitor/src/oommemorymonitorsession.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/sysresmonitoring/oommonitor/src/oommemorymonitorsession.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -60,7 +60,7 @@ return Server().Monitor(); #endif } - +#ifndef CLIENT_REQUEST_QUEUE TBool CMemoryMonitorSession::IsDataPaged(const RMessage2& aMessage) { RThread clientThread; @@ -85,6 +85,7 @@ } return dataPaged; } +#endif void CMemoryMonitorSession::ServiceL(const RMessage2& aMessage) { diff -r 951aeeb3da43 -r 2222076f5c60 sysresmonitoring/oommonitor/tsrc/oomtest/t_oomdummyapp/src/t_oomdummyappAppUi.cpp --- a/sysresmonitoring/oommonitor/tsrc/oomtest/t_oomdummyapp/src/t_oomdummyappAppUi.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/sysresmonitoring/oommonitor/tsrc/oomtest/t_oomdummyapp/src/t_oomdummyappAppUi.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -r 951aeeb3da43 -r 2222076f5c60 sysresmonitoring/oommonitor/tsrc/oomtest/t_oomtestapp/src/t_oomtestappappui.cpp --- a/sysresmonitoring/oommonitor/tsrc/oomtest/t_oomtestapp/src/t_oomtestappappui.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/sysresmonitoring/oommonitor/tsrc/oomtest/t_oomtestapp/src/t_oomtestappappui.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include "t_oomtestappcmd.hrh" #include "t_oomtestappApplication.h" diff -r 951aeeb3da43 -r 2222076f5c60 tzservices/tzloc/src/TzLocalizationDbAccessor.cpp --- a/tzservices/tzloc/src/TzLocalizationDbAccessor.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/tzservices/tzloc/src/TzLocalizationDbAccessor.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// 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 "Eclipse Public License v1.0" @@ -111,12 +111,15 @@ } User::LeaveIfError(error); // Check if both tables are created. - TRAP(error, iLocalizedTimeZoneDb.ColSetL(KCZTableName)); + CDbColSet *colSet = NULL; + TRAP(error, colSet = iLocalizedTimeZoneDb.ColSetL(KCZTableName)); + delete colSet; if (error) { User::LeaveIfError(CreateFrequentlyUsedZoneTableL()); } - TRAP(error, iLocalizedTimeZoneDb.ColSetL(KUCTableName)); + TRAP(error, colSet = iLocalizedTimeZoneDb.ColSetL(KUCTableName)); + delete colSet; if (error) { User::LeaveIfError(CreateUserCityTableL()); diff -r 951aeeb3da43 -r 2222076f5c60 tzservices/tzserver/Server/Source/timezonesession.cpp --- a/tzservices/tzserver/Server/Source/timezonesession.cpp Fri Jun 11 13:48:03 2010 +0300 +++ b/tzservices/tzserver/Server/Source/timezonesession.cpp Wed Jun 23 18:22:59 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1997-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" @@ -698,19 +698,23 @@ TInt CTzServerSession::doGetUserTimeZoneNamesL(const RMessage2& aMessage) { TInt size = iTzUserDataCache->SizeOfNames(); - CBufFlat* buffer = CBufFlat::NewL(size); - CleanupStack::PushL(buffer); - buffer->ExpandL(0,size); - - RBufWriteStream writeStream; - CleanupClosePushL(writeStream); - writeStream.Open(*buffer); - const CTzUserNames& names = iTzUserDataCache->GetNames(); - writeStream << names; - writeStream.CommitL(); - aMessage.WriteL(0, buffer->Ptr(0)); - CleanupStack::PopAndDestroy(2, buffer); - return KErrNone; + if ( size > 0 ) + { + CBufFlat* buffer = CBufFlat::NewL(size); + CleanupStack::PushL(buffer); + buffer->ExpandL(0,size); + + RBufWriteStream writeStream; + CleanupClosePushL(writeStream); + writeStream.Open(*buffer); + const CTzUserNames& names = iTzUserDataCache->GetNames(); + writeStream << names; + writeStream.CommitL(); + aMessage.WriteL(0, buffer->Ptr(0)); + CleanupStack::PopAndDestroy(2, buffer); + return KErrNone; + } + return KErrArgument; } /**