// --------------------------------------------------------------------------- // From class MTelephonyAudioRoutingObserver. // AvailableOutputsChanged // --------------------------------------------------------------------------- // void CSysApAudioRoutingObserver::AvailableOutputsChanged( CTelephonyAudioRouting& /*aTelephonyAudioRouting*/ ) { TRACES( RDebug::Print( _L("CSysApAudioRoutingObserver::AvailableOutputsChanged") ) ); }
CSysApShutdownImage::CSysApShutdownImage() { TRACES( RDebug::Print(_L("CSysApShutdownImage::CSysApShutdownImage()" ) ) ); }
void CShareActive::RunL() { TRACES( RDebug::Print( _L("CSysApSimChanged::CShareActive::RunL: iStatus=%d"), iStatus.Int() ) ); CActiveScheduler::Stop(); }
void CMemoryMonitor::SwitchMemMode(TGOomMemMode aMemMode, TBool aForced) { if(iMemMode == aMemMode) { if(iMemMode == EGOomGoodMemMode) { TRACES("CMemoryMonitor::SwitchMemMode NOT switching rendering mode. Already in GOOD Mode"); } else { TRACES("CMemoryMonitor::SwitchMemMode NOT switching rendering mode. Already in LOW Mode"); } return; } #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS TWsEvent event; if(aMemMode == EGOomLowMemMode) { if(!aForced) { if(iRendswitched < 3) iRendswitched ++; else return; } iLowOnMemWgs.Reset(); iGOomWindowGroupList->GetListOfWindowGroupsWSurfaces(iLowOnMemWgs); event.SetType(KGoomMemoryLowEvent); TRACES("CMemoryMonitor::SwitchMemMode. Switching rendering mode to SW, Sending KGoomMemoryLowEvent"); } else { if(!aForced) { if(iRendswitched > 0) { if(iRendswitched < 3) iRendswitched ++; else { TRACES("CMemoryMonitor::SwitchMemMode GOOM Detected SW-HW-SW looping. NOT switching to HW rendering mode"); return; } } } event.SetType(KGoomMemoryGoodEvent); TRACES("CMemoryMonitor::SwitchMemMode. Switching rendering mode to HW, Sending KGoomMemoryGoodEvent"); } for (TInt i = iLowOnMemWgs.Count()-1; i>=0; i--) { iWs.SendEventToWindowGroup(iLowOnMemWgs[i], event); TRACES1("CMemoryMonitor::SwitchMemMode. Sending event to wg %d",iLowOnMemWgs[i]); } #endif iMemMode = aMemMode; }
RWindow& CSysApShutdownImage::ShutdownCoeControlWindow() { TRACES( RDebug::Print(_L("CSysApShutdownImage::ShutdownCoeControlWindow()" ) ) ); return Window(); }
void CHeartbeatTimer::addObserver(MHeartBeatObserver *observer) { TRACES(qDebug() << "CHeartbeatTimer::CHeartbeatTimer::addObserver"); m_observers.append(observer); }
CSysApCenRepController::~CSysApCenRepController() { TRACES( RDebug::Print( _L("~CSysApCenRepController") ) ); delete iSysApRepository; delete iProfileSettingsRepository; }
// ---------------------------------------------------------------------------- // CSysApCenRepCallForwardingObserver::HandleNotifyError() // ---------------------------------------------------------------------------- // void CSysApCenRepCallForwardingObserver::HandleNotifyError( TUint32 /* aId */, TInt /* error */, CCenRepNotifyHandler* /* aHandler */ ) { TRACES( RDebug::Print( _L("CSysApCenRepCallForwardingObserver::HandleNotifyError()" ) ) ); }
// ---------------------------------------------------------------------------- // CSysApCenRepCallForwardingObserver::UpdateCallForwardingIndicatorsL() // ---------------------------------------------------------------------------- void CSysApCenRepCallForwardingObserver::UpdateCallForwardingIndicatorsL() { TRACES( RDebug::Print( _L("CSysApCenRepCallForwardingObserver::UpdateCallForwardingIndicatorsL(): iCallForwardingStatus=0x%x" ), iCallForwardingStatus ) ); if ( !iUiReady ) { iUiReady = ETrue; // CenRep notfications are allowed to update the indicators from now on } switch( iCallForwardingStatus ) { case KCFVoiceForwarded: case KCFVideoForwarded: case KCFVoiceForwarded | KCFVideoForwarded: iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine1, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine2, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnBothLines, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOn ); break; case KCFVoiceForwarded | KCFForwardedOnLine1: case KCFVideoForwarded | KCFForwardedOnLine1: case KCFVoiceForwarded | KCFVideoForwarded | KCFForwardedOnLine1: iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine2, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnBothLines, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine1, EAknIndicatorStateOn ); break; case KCFForwardedOnLine2: iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine1, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnBothLines, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine2, EAknIndicatorStateOn ); break; case KCFVoiceForwarded | KCFForwardedOnLine1 | KCFForwardedOnLine2: case KCFVideoForwarded | KCFForwardedOnLine1 | KCFForwardedOnLine2: case KCFVoiceForwarded | KCFVideoForwarded | KCFForwardedOnLine1 | KCFForwardedOnLine2: iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine1, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine2, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnBothLines, EAknIndicatorStateOn ); break; case KCFVideoForwardedToVoiceMailbox: case KCFVoiceForwardedToVoiceMailbox: case KCFVideoForwardedToVoiceMailbox | KCFVoiceForwarded: case KCFVoiceForwardedToVoiceMailbox | KCFVideoForwarded: case KCFVoiceForwarded | KCFVideoForwarded | KCFForwardedToVoiceMailbox: iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine1, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine2, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnBothLines, EAknIndicatorStateOff ); if ( iSysApAppUi.SysApFeatureManager().VmbxCallDivertIconSupported() ) { iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOn ); } else { iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOn ); } break; case KCFNoCallsForwarded: case KCFIndicatorUnknown: iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine1, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnLine2, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedOnBothLines, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorCallsForwardedToVoiceMailbox, EAknIndicatorStateOff ); iSysApAppUi.SetIndicatorStateL( EAknIndicatorAllCallsForwarded, EAknIndicatorStateOff ); break; default: break; } TRACES( RDebug::Print( _L("CSysApCenRepCallForwardingObserver::UpdateCallForwardingIndicatorsL(): end" ) ) ); }
void CSysApConfirmationQuery::DoCancel() { TRACES( RDebug::Print( _L("CSysApConfirmationQuery::DoCancel()" ) ) ); iQuery->CancelConfirmationQuery(); }
// ---------------------------------------------------------------------------- // CSysApCenRepCallForwardingObserver::MapForwarding() // ---------------------------------------------------------------------------- // void CSysApCenRepCallForwardingObserver::MapForwarding() { RMobilePhone::TCFUIndicatorStatus callForwardingStatus; TInt err = GetSimCallForwardingStatus( callForwardingStatus ); if ( err != KErrNone ) { // update KCtsyUnconditionalCFStatus also if an error occurs because otherwise we might end up looping TRACES( RDebug::Print( _L("CSysApCenRepCallForwardingObserver::MapForwarding(): err=%d" ), err ) ); iCallForwardingStatus = KCFNoCallsForwarded; iSimCFCurrentStatus = RMobilePhone::KCFUIndicatorUnknown; } else { iSimCFCurrentStatus = callForwardingStatus; if ( !AlsSupport() ) { switch( callForwardingStatus ) { case RMobilePhone::KCFUIndicatorVoice: case RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = KCFVoiceForwarded; break; case RMobilePhone::KCFUIndicatorData: case RMobilePhone::KCFUIndicatorData | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = KCFVideoForwarded; break; case RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData: case RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus>( KCFVoiceForwarded | KCFVideoForwarded ); break; default: iCallForwardingStatus = KCFNoCallsForwarded; break; } } else { switch( callForwardingStatus ) { case RMobilePhone::KCFUIndicatorVoice: case RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus> ( KCFVoiceForwarded | KCFForwardedOnLine1 ); break; case RMobilePhone::KCFUIndicatorData: case RMobilePhone::KCFUIndicatorData | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus> ( KCFVideoForwarded | KCFForwardedOnLine1 ); break; case RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData: case RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus>( KCFVoiceForwarded | KCFVideoForwarded | KCFForwardedOnLine1 ); break; case RMobilePhone::KCFUIndicatorAuxVoice: case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus>( KCFForwardedOnLine2 ); break; case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorVoice: case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus>( KCFVoiceForwarded | KCFForwardedOnLine1 | KCFForwardedOnLine2 ); break; case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData: case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus>( KCFVoiceForwarded | KCFVideoForwarded | KCFForwardedOnLine1 | KCFForwardedOnLine2 ); break; case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorData: case RMobilePhone::KCFUIndicatorAuxVoice | RMobilePhone::KCFUIndicatorData | RMobilePhone::KCFUIndicatorFax: iCallForwardingStatus = static_cast<TUnconditionalCFStatus>( KCFVideoForwarded | KCFForwardedOnLine1 | KCFForwardedOnLine2 ); break; default: iCallForwardingStatus = KCFNoCallsForwarded; break; } } } TInt package = iCallForwardingStatus; TPckg<TInt> forwardingPckg( package ); err = iSession->Set( KCtsyUnconditionalCFStatus, forwardingPckg ); TRACES( RDebug::Print( _L("CSysApCenRepCallForwardingObserver::MapForwarding(): err=%d, callForwardingStatus=0x%x, iCallForwardingStatus=0x%x" ), err, callForwardingStatus, iCallForwardingStatus ) ); }
TInt CSysApConfirmationQuery::RunError( TInt /* aError */ ) #endif { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunError: error code: %d " ), aError ) ); return KErrNone; }
void CSysApConfirmationQuery::RunL() { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: iQueryId = %d, iStatus = %d" ), iQueryId, iStatus.Int() ) ); switch ( iQueryId ) { case ESysApRestartPhoneQuery: { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: calling CSysApAppUi::DoShutdownL( ETrue, EDataRestoreReset )" ) ) ); iSysApAppUi.DoShutdownL( ETrue, RStarterSession::EDataRestoreReset ); } break; case ESysApLeaveOfflineModeQuery: if ( iStatus.Int() == EAknSoftkeyYes ) { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: calling CSysApAppUi::ActivateOnlineProfileL()" ) ) ); iSysApAppUi.ActivateOnlineProfileL(); } break; case ESysApRemoveMmcNote: TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: calling CSysApAppUi::MMCDismountedDialogConfirmed()" ) ) ); iSysApAppUi.MMCDismountedDialogConfirmed(); break; case ESysApEjectMmcQuery: if ( iStatus.Int() == EAknSoftkeyYes || iStatus.Int() == EEikBidOk ) { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: calling CSysApAppUi::EjectMMCL()" ) ) ); iSysApAppUi.EjectMMCL(); } else { iSysApAppUi.EjectMMCCanceled(); } break; case ESysApBtSapDisconnectQuery: if ( iStatus.Int() == EAknSoftkeyYes ) { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: calling CSysApAppUi::DisconnectBtSap()" ) ) ); iSysApAppUi.DisconnectBtSap(); } break; case ESysApMemoryCardLockedNote: // In case of MMC locked note we are only interested about error, as it means there is overriding query if ( iStatus.Int() < 0 && iPendingQuery != ESysApMemoryCardLockedNote ) { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: Canceled ESysApMemoryCardLockedNote because more important query" ) ) ); ShowQueryL( iPendingQuery, CCoeEnv::Static() ); } break; /* case ESysApUseFmTxInOfflineQuery: if ( iStatus.Int() == EAknSoftkeyNo ) { TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: calling CSysApAppUi::ChangeFmTxStateL( EFalse )" ) ) ); iSysApAppUi.ChangeFmTxStateL( EFalse ); // disable FM TX } break; */ case ESysApBattChargingPowerSavingQuery: iSysApAppUi.HandleDeactivatePsmQueryResponse( iStatus.Int() == EAknSoftkeyYes ); break; case ESysApBattLowPowerSavingQuery: iSysApAppUi.HandleActivatePsmQueryResponse( iStatus.Int() == EAknSoftkeyYes ); break; default: TRACES( RDebug::Print( _L( "CSysApConfirmationQuery::RunL: default" ) ) ); break; } }
void CSysApConfirmationQuery::ShowQueryL( const TSysApConfirmationQueryIds aQueryId, const TDesC& /*aValue*/, CCoeEnv* aLoaderEnv ) #endif // RD_MULTIPLE_DRIVE { TRACES( RDebug::Print( _L("CSysApConfirmationQuery::ShowQueryL( %d )"), aQueryId ) ); HBufC* queryStringBuf = NULL; HBufC* deviceNameBuf = NULL; CAknQueryDialog::TTone tone = CAknQueryDialog::ENoTone; if( !IsActive() ) { iQueryId = aQueryId; TInt secondaryDisplayCmdId(SecondaryDisplay::ECmdNoNote); TInt keys(0); TInt anim(0); switch ( iQueryId ) { case ESysApRestartPhoneQuery: queryStringBuf = StringLoader::LoadLC( R_QTN_RESTART_QUERY, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_OK_EMPTY; anim = R_QGN_NOTE_WARNING_ANIM; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowRestartPhoneQuery; break; case ESysApLeaveOfflineModeQuery: queryStringBuf = StringLoader::LoadLC( R_QTN_LEAVE_OFFLINE_MODE_QUERY, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowLeaveOfflineModeQuery; break; #ifndef RD_MULTIPLE_DRIVE case ESysApRemoveMmcNote: queryStringBuf = StringLoader::LoadLC( R_QTN_MEMC_INFO_EJECT, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_OK_EMPTY; anim = R_QGN_NOTE_INFO_ANIM; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowRemoveMmcQuery; break; case ESysApEjectMmcQuery: queryStringBuf = StringLoader::LoadLC( R_QTN_MEMC_CONF_EJECT, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowEjectMmcQuery; break; #else // RD_MULTIPLE_DRIVE case ESysApRemoveMmcNote: queryStringBuf = aValue.AllocLC(); keys = R_AVKON_SOFTKEYS_OK_EMPTY; anim = R_QGN_NOTE_INFO_ANIM; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowRemoveMmcQuery; break; case ESysApEjectMmcQuery: queryStringBuf = aValue.AllocLC(); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowEjectMmcQuery; break; #endif // RD_MULTIPLE_DRIVE case ESysApBtSapDisconnectQuery: deviceNameBuf = iSysApAppUi.GetBtSapDeviceNameL(); if ( deviceNameBuf ) { CleanupStack::PushL(deviceNameBuf); queryStringBuf = StringLoader::LoadL( R_QTN_BT_DISCONN_FROM, *deviceNameBuf, aLoaderEnv ); } else { queryStringBuf = StringLoader::LoadL( R_QTN_BT_DISCONN_FROM, KEmptyString, aLoaderEnv ); } CleanupStack::PushL(queryStringBuf); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowBtSapDisconnectQuery; break; case ESysApMemoryCardLockedNote: iPendingQuery = ESysApMemoryCardLockedNote; queryStringBuf = StringLoader::LoadLC( R_QTN_MEMC_LOCKED_NOT_SUPPORTED, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_OK_EMPTY; anim = R_QGN_NOTE_INFO_ANIM; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowMemoryCardLockedQuery; break; /* case ESysApUseFmTxInOfflineQuery: queryStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_NOTE_ACTIVATE_IN_OFFLINE, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowFmTxKeepOnInOfflineQuery; break; */ case ESysApBattChargingPowerSavingQuery: queryStringBuf = StringLoader::LoadLC( R_QTN_BATTERY_CHARGING_POWER_SAVING_QUERY, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowChargingDeactivatePowerSavingQuery; tone = static_cast<CAknQueryDialog::TTone>( EAvkonSIDChargingBatteryTone ); break; case ESysApBattLowPowerSavingQuery: queryStringBuf = StringLoader::LoadLC( R_QTN_BATTERY_CONF_QUERY, aLoaderEnv ); keys = R_AVKON_SOFTKEYS_YES_NO; secondaryDisplayCmdId = SecondaryDisplay::ECmdShowBattLowActivatePowerSavingQuery; break; default: break; } if ( iSysApAppUi.CoverDisplaySupported() && secondaryDisplayCmdId != SecondaryDisplay::ECmdNoNote ) { TRACES( RDebug::Print( _L("CSysApConfirmationQuery::ShowQueryL - Notifying secondary display") ) ); CAknSDData* sd = NULL; if ( secondaryDisplayCmdId == SecondaryDisplay::ECmdShowBtSapDisconnectQuery ) { SecondaryDisplay::TDeviceName sdDeviceName; sdDeviceName.Append(deviceNameBuf->Left(SecondaryDisplay::KMaxDeviceNameLen)); SecondaryDisplay::TBtSapDisconnectQueryPckg pckg(sdDeviceName); sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, SecondaryDisplay::ECmdShowBtSapDisconnectQuery, pckg); } else { sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, secondaryDisplayCmdId, KNullDesC8); } iQuery->SetSecondaryDisplayData(sd); // ownership to notifier client } if ( keys && queryStringBuf ) { if ( anim ) { iQuery->ShowConfirmationQueryL( iStatus, queryStringBuf->Des(), keys, anim, KNullDesC, 0, 0, tone ); } else { iQuery->ShowConfirmationQueryL( iStatus, queryStringBuf->Des(), keys, 0, KNullDesC, 0, 0, tone ); } } SetActive(); } else { // If another query is wanted when ESysApMemoryCardLockedNote is active, override it (Continues in RunL which handles cancel). if ( iQueryId == ESysApMemoryCardLockedNote && aQueryId != ESysApMemoryCardLockedNote ) { iPendingQuery = aQueryId; iQuery->CancelConfirmationQuery(); } } if ( queryStringBuf ) { CleanupStack::PopAndDestroy( queryStringBuf ); // queryStringbuf } if ( deviceNameBuf ) { CleanupStack::PopAndDestroy( deviceNameBuf ); // deviceNameBuf } }
// ---------------------------------------------------------------------------- // CSysApFeatureManager::ConstructL() // ---------------------------------------------------------------------------- void CSysApFeatureManager::ConstructL() { TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL()") ) ); FeatureManager::InitializeLibL(); iFeatMgrActive = ETrue; iSimSupported = FeatureManager::FeatureSupported( KFeatureIdSimCard ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: SIM card supported=%d"), iSimSupported ) ); iOfflineModeSupported = FeatureManager::FeatureSupported( KFeatureIdOfflineMode ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Offline mode supported=%d"), iOfflineModeSupported ) ); iCoverDisplaySupported = FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Cover display supported=%d"), iCoverDisplaySupported ) ); iGripNotSupported = FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: iGripNotSupported=%d"), iGripNotSupported ) ); iLocationPrivacySupported = FeatureManager::FeatureSupported( KFeatureIdPrivacyFramework ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Location Privacy supported=%d"), iLocationPrivacySupported ) ); iMMCSupported = FeatureManager::FeatureSupported( KFeatureIdMmc ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: MMC supported=%d"), iMMCSupported ) ); iMMCHotSwapSupported = FeatureManager::FeatureSupported( KFeatureIdMmcHotswap ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: MMC HotSwap supported=%d"), iMMCHotSwapSupported ) ); iStarterExtensionsSupported = FeatureManager::FeatureSupported( KFeatureIdExtendedStartup ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Starter Extensions supported=%d"), iStarterExtensionsSupported ) ); iCameraSupported = FeatureManager::FeatureSupported( KFeatureIdCamera ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Camera supported=%d"), iCameraSupported ) ); iBtSupported = FeatureManager::FeatureSupported( KFeatureIdBt ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Bluetooth supported=%d"), iBtSupported ) ); iLockSupported = FeatureManager::FeatureSupported( KFeatureIdMmcLock ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Memory card lock supported=%d"), iLockSupported ) ); iEject = FeatureManager::FeatureSupported( KFeatureIdMmcEject ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Memory card sw eject supported=%d"), iEject ) ); iPowerSaveSupported = FeatureManager::FeatureSupported( KFeatureIdPowerSave ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Power save supported=%d"), iPowerSaveSupported ) ); iNoPowerKeySupported = FeatureManager::FeatureSupported( KFeatureIdNoPowerkey ); 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 ) ); // iPenEnabled = AknLayoutUtils::PenEnabled(); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Pen enabled=%d"), iPenEnabled ) ); iVmbxCallDivertIconSupported = FeatureManager::FeatureSupported( KFeatureIdVmbxCallDivertIcon ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: VMBX call divert icon supported=%d"), iVmbxCallDivertIconSupported ) ); iTouchUnlockStrokeSupported = FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ); TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: Touch unlock stroke supported=%d"), iTouchUnlockStrokeSupported ) ); // iFmTxRdsTextSupported = FeatureManager::FeatureSupported( KFeatureIdFfFmtxRdsText ); // TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: FM TX RDS-TEXT supported=%d"), iFmTxRdsTextSupported ) ); CRepository* repository = NULL; TRAPD( err, repository = CRepository::NewL( KCRUidCoreApplicationUIsConf ) ); if ( err == KErrNone ) { err = repository->Get( KCoreAppUIsSysAp, iSysApFeatures ); if ( err != KErrNone || iSysApFeatures < 0 ) // ERROR { TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: ERROR: %d, KCoreAppUIsSysAp=%d"), err, iSysApFeatures ) ); iSysApFeatures = 0; } TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: KCoreAppUIsSysAp=%d"), iSysApFeatures ) ); err = repository->Get( KCoreAppUIsHotSwapMemoryCardHatch, iHatchSupported ); if ( err != KErrNone || iHatchSupported < 0 ) // ERROR { TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: ERROR: %d, KCoreAppUIsHotSwapMemoryCardHatch=%d"), err, iHatchSupported ) ); iHatchSupported = EFalse; } err = repository->Get( KCoreAppUIsLockedStateLights, iLockedStateLightsSupported ); if ( err != KErrNone || iLockedStateLightsSupported < 0 ) // ERROR { TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: ERROR: %d, KCoreAppUIsLightsLocked=%d"), err, iLockedStateLightsSupported ) ); iLockedStateLightsSupported = EFalse; iLockedStateLightsIntensity = KHWRMDefaultIntensity; } if ( iLockedStateLightsSupported ) // get intensity only if configuration is supported { err = repository->Get( KCoreAppUIsLockedStateLightsIntensity, iLockedStateLightsIntensity ); if ( err != KErrNone || iLockedStateLightsIntensity < KHWRMLightMinIntensity || iLockedStateLightsIntensity > KHWRMLightMaxIntensity ) { TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: ERROR: %d, KCoreAppUIsLightsLockedIntensity=%d"), err, iLockedStateLightsIntensity ) ); iLockedStateLightsIntensity = KHWRMDefaultIntensity; } } } else { TRACES( RDebug::Print( _L("CSysApFeatureManager::ConstructL: open KCRUidCoreApplicatinUIsConf failed, err=%d"), err ) ); } delete repository; }
void CNspsWsPlugin::ConstructL( TAny* /*aArgs*/, TBool /*aHasFocus*/ ) { TRACES( RDebug::Print( _L( "CNspsWsPlugin::ConstructL" ) ) ); }
CHeartbeatTimer::CHeartbeatTimer(TInt aPriority):CFlexTimer(aPriority), m_singleShot(false),m_interval(0) { TRACES(qDebug() << "CHeartbeatTimer::CHeartbeatTimer"); }
void CSysApEtelConnector::ConstructL() { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: START") ) ); TInt err( KErrGeneral ); TInt thisTry( 0 ); /* Server connections are tried KTriesToConnectServer times because occasional fails on connections are possible at least on some servers */ TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: trying RTelServer::Connect()") ) ); while ( ( err = iEtelServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: RTelServer::Connect() failed. Error: %d"), err ) ); User::After( KTimeBeforeRetryingServerConnection ); } User::LeaveIfError( err ); TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: trying RTelServer::LoadPhoneModule()") ) ); err = iEtelServer.LoadPhoneModule( KMmTsyModuleName ); while ( ( err != KErrNone ) && ( err != KErrAlreadyExists ) && ( thisTry++ ) <= KTriesToConnectServer ) { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: RTelServer::LoadPhoneModule() failed. Error: %d"), err ) ); User::After( KTimeBeforeRetryingServerConnection ); err = iEtelServer.LoadPhoneModule( KMmTsyModuleName ); } User::LeaveIfError( err ); thisTry = 0; TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: trying RMobilePhone::Open()") ) ); while ( ( err = iPhone.Open( iEtelServer, KMmTsyPhoneName ) ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: RMobilePhone::Open() failed. Error: %d"), err ) ); User::After( KTimeBeforeRetryingServerConnection ); } User::LeaveIfError( err ); thisTry = 0; TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: trying RMmCustomAPI::Open()") ) ); while ( ( err = iCustomAPI.Open( iPhone ) ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: RMmCustomAPI::Open() failed. Error: %d"), err ) ); User::After( KTimeBeforeRetryingServerConnection ); } User::LeaveIfError( err ); // Connect to SMS messaging thisTry = 0; TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: trying RMobileSmsMessaging::Open()") ) ); while ( ( err = iSmsMessaging.Open( iPhone ) ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: RMobileSmsMessaging::Open() failed. Error: %d"), err ) ); User::After( KTimeBeforeRetryingServerConnection ); } User::LeaveIfError( err ); // Connect to SMS message store thisTry = 0; TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: trying RMobileSmsStore::Open()") ) ); while ( ( err = iSmsStore.Open( iSmsMessaging, KETelIccSmsStore ) ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) { TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: RMobileSmsStore::Open() failed. Error: %d"), err ) ); User::After( KTimeBeforeRetryingServerConnection ); } User::LeaveIfError( err ); // Initialize SMS Message store observer iSysApEtelSmsStoreObserver = CSysApEtelSmsStoreObserver::NewL( iSysApAppUi, iSmsStore ); iSysApEtelNetworkStatusNspsObserver = new( ELeave ) CSysApEtelNetworkStatusNspsObserver( iSysApAppUi, iCustomAPI ); iSysApEtelNetworkBarObserver = CSysApEtelNetworkBarObserver::NewL(iSysApAppUi, iPhone); iSysApEtelDataBearerObserver = CSysApEtelDataBearerObserver::NewL( iSysApAppUi, iPhone ); if ( iSysApAppUi.SysApFeatureManager().Supported( KSysApFeatureIdUseHsdpaAvailableIcon ) ) { iSysApEtelNetworkInfoObserver = CSysApEtelNetworkInfoObserver::NewL( iSysApAppUi, iPhone, iCustomAPI ); } TRACES( RDebug::Print( _L("CSysApEtelConnector::ConstructL: END") ) ); }
void CHeartbeatTimer::removeObserver(MHeartBeatObserver *observer) { TRACES(qDebug() << "CHeartbeatTimer::CHeartbeatTimer::removeObserver"); m_observers.removeOne(observer); }
void CSysApAccessoryObserver::DoCancel() { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::DoCancel()" ) ) ); iAccessoryMode.CancelNotifyAccessoryModeChanged(); iAccessoryConnection.CancelGetAccessoryConnectionStatus(); }
// --------------------------------------------------------- // // --------------------------------------------------------- // void CMemoryMonitor::ConstructL() { FUNC_LOG; //Initialize EGL extension for memory data EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); EGLint major, minor; eglInitialize(dpy, &major, &minor); /* ** Search for extName in the extensions string. Use of strstr() ** is not sufficient because extension names can be prefixes of ** other extension names. Could use strtok() but the constant ** string returned by glGetString can be in read-only memory. */ TBool extensionFound = EFalse; char *p = (char *) eglQueryString(dpy,EGL_EXTENSIONS); char *end; int extNameLen; extNameLen = strlen("EGL_NOK_resource_profiling"); end = p + strlen(p); while (p < end) { int n = strcspn(p, " "); if ((extNameLen == n) && (strncmp("EGL_NOK_resource_profiling", p, n) == 0)) { extensionFound = ETrue; break; } p += (n + 1); } if (!extensionFound) { TRACES("EGL_NOK_resource_profiling not found from EGL_EXTENSIONS"); } // okay, let's fetch the function ptr to our profiling functions eglQueryProfilingData = (NOK_resource_profiling)eglGetProcAddress("eglQueryProfilingDataNOK"); if (!eglQueryProfilingData) { TRACES("eglQueryProfilingDataNOK not found via eglGetProcAddress()"); User::Leave(KErrNotSupported); } User::LeaveIfError(iWs.Connect()); iWs.ComputeMode(RWsSession::EPriorityControlDisabled); iGOomWindowGroupList = CGOomWindowGroupList::NewL(iWs); iConfig = CGOomConfig::NewL(); iServer = CMemoryMonitorServer::NewL(*this); // Load up threshold & OOM app lists from resource. User::LeaveIfError(iFs.Connect()); CGOomConfigParser* oomConfigParser = new (ELeave) CGOomConfigParser(*iConfig, iFs); CleanupStack::PushL(oomConfigParser); oomConfigParser->ParseL(); CleanupStack::PopAndDestroy(oomConfigParser); iGOomActionList = CGOomActionList::NewL(*this, *iServer, iWs, *iConfig); #ifdef _DEBUG iLogger = CGOomLogger::NewL(iWs, iFs); #endif // Get the thresholds based on the current foreground app and the config RefreshThresholds(); iWservEventReceiver = new(ELeave) CWservEventReceiver(*this, iWs); iWservEventReceiver->ConstructL(); iSynchTimer = CGOomSynchTimer::NewL(*this); }
void CSysApAccessoryObserver::ConstructL( ) { TInt err( KErrNone ); TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): trying RAccessoryServer::Connect" ) ) ); err = iAccessoryServer.Connect(); if ( err == KErrNone ) { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): trying RAccessoryMode::CreateSubSession" ) ) ); err = iAccessoryMode.CreateSubSession( iAccessoryServer ); if ( err == KErrNone ) { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): connection to RAccessoryMode established" ) ) ); err = iAccessoryMode.GetAccessoryMode( iAccMode ); if ( err != KErrNone ) { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): RAccessoryMode::AccessoryMode() - Error: %d"), err ) ); iAccMode.iAccessoryMode = EAccModeHandPortable; iPreviousMode = EAccModeHandPortable; } else { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): iAccMode.iAccessoryMode=%d" ), iAccMode.iAccessoryMode ) ); iPreviousMode = iAccMode.iAccessoryMode; } TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): trying RAccessoryConnection::CreateSubSession" ) ) ); err = iAccessoryConnection.CreateSubSession( iAccessoryServer ); if ( err == KErrNone ) { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): connection to RAccessoryConnection established" ) ) ); TAccPolGenericIDArray iAccGenericIDArray; err = iAccessoryConnection.GetAccessoryConnectionStatus( iAccGenericIDArray ); if ( err == KErrNone ) { TInt iIndex = 0; TAccPolGenericID iAccGenericID = iAccGenericIDArray.GetGenericIDL( iIndex ); TUint iPhysicalConnection = iAccGenericID.PhysicalConnectionCaps(); if (iPhysicalConnection & KPCWired) { iPhysicalConnectionType = KPCWired; } else if (iPhysicalConnection & KPCBluetooth) { iPhysicalConnectionType = KPCBluetooth; } else if (iPhysicalConnection & KPCInfraRed) { iPhysicalConnectionType = KPCInfraRed; } else if (iPhysicalConnection & KPCUSB) { iPhysicalConnectionType = KPCUSB; } else if (iPhysicalConnection & KPCHDMI) { iPhysicalConnectionType = KPCHDMI; } iAccessoryMode.NotifyAccessoryModeChanged( iStatus, iAccMode ); SetActive(); } else { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): Error in Getting AccessoryConnectionStatus Error: %d " ),err ) ); } } else { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): RAccessoryConnection::CreateSubSession - Error: %d" ), err ) ); } } else { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): RAccessoryMode::CreateSubSession - Error: %d" ), err ) ); } } else { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): RAccessoryServer::Connect - Error: %d" ), err ) ); } }
TInt CMemoryMonitor::GetFreeMemory() { FUNC_LOG; if (!eglQueryProfilingData) { TRACES("EGL_NOK_resource_profiling not available"); return 0; } EGLint data_count; EGLint* prof_data; TInt i(0); TInt totalMem(0); TInt totalUsed(0); EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); /* Find out how much profiling data is available */ eglQueryProfilingData(dpy, EGL_PROF_QUERY_GLOBAL_BIT_NOK | EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK, NULL, 0, &data_count); TRACES1("eglQueryProfilingData - data size: %d", data_count); /* Allocate room for the profiling data */ prof_data = (EGLint*)User::Alloc(data_count * sizeof(EGLint)); TRACES("eglQueryProfilingData - alloc for data done"); if (prof_data == NULL) { TRACES1("eglQueryProfilingData - could not alloc: %d", data_count * sizeof(EGLint)); return KErrNoMemory; } /* Retrieve the profiling data */ eglQueryProfilingData(dpy, EGL_PROF_QUERY_GLOBAL_BIT_NOK | EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK, prof_data, data_count, &data_count); TRACES("eglQueryProfilingData - profiling data acquired"); /* Iterate over the returned data */ while (i < data_count) { TRACES2("EGL_NOK_resource_profiling - index: %d data: %d", i, prof_data[i]); switch (prof_data[i++]) { case EGL_PROF_USED_MEMORY_NOK: { totalUsed = prof_data[i++]; TRACES1("EGL_NOK_resource_profiling - total Used: %d", totalUsed); break; } case EGL_PROF_TOTAL_MEMORY_NOK: { totalMem = prof_data[i++]; TRACES1("EGL_NOK_resource_profiling - total Mem: %d", totalMem); break; } case EGL_PROF_PROCESS_ID_NOK: { if (sizeof(EGLNativeProcessIdTypeNOK) == 8) { i+=2; } else { i++; } break; } case EGL_PROF_PROCESS_USED_PRIVATE_MEMORY_NOK: { TUint mem = prof_data[i]; TRACES1("Private memory Usage by app is %d", mem); break; } case EGL_PROF_PROCESS_USED_SHARED_MEMORY_NOK: { TUint mem = prof_data[i]; TRACES1("Shared memory Usage by app is %d", mem); break; } default: { i++; break; } } } /* Free allocated memory */ User::Free(prof_data); if ((totalMem-totalUsed) < 0) { return 0; } return totalMem - totalUsed; }
void driver::start(bool _gethandle) { TRACEV("[driver] [start] > Entering routine."); if(m_started) { TRACEI("[driver] [start] driver already started"); return; } TRACEI("[driver] [start] starting driver"); DWORD err = 0; SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if(!manager) { TRACEERR("[driver] [start]", L"ERROR: OpenSCManager", err = GetLastError()); throw win32_error("OpenSCManager"); } SC_HANDLE service = OpenService(manager, m_name.c_str(), SERVICE_ALL_ACCESS); if(!service) { CloseServiceHandle(manager); TRACEERR("[driver] [start]", L"ERROR: OpenService", err = GetLastError()); throw win32_error("OpenService", err); } if(!StartService(service, 0, NULL) && (err = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING) { bool startFailed = true; if (err == ERROR_SERVICE_DATABASE_LOCKED) { int numRetries = 0; do { TRACEW("[driver] [start] experiencing ERROR_SERVICE_DATABASE_LOCKED condition; waiting 10 seconds and trying again"); Sleep(10000); // 10 seconds err = 0; if (!StartService(service, 0, NULL) && (err = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING) // still having problems ++numRetries; else // either success, or another error break; } while (err == ERROR_SERVICE_DATABASE_LOCKED && numRetries < 6); if (numRetries < 6 && (err == 0 || err == ERROR_SERVICE_ALREADY_RUNNING)) { startFailed = false; TRACES("[driver] [start] successfully recovered from ERROR_SERVICE_DATABASE_LOCKED condition"); } else if (err == ERROR_SERVICE_DATABASE_LOCKED) { TRACEE("[driver] [start] cannot recover from ERROR_SERVICE_DATABASE_LOCKED condition; giving up"); } else { TRACEE("[driver] [start] cannot recover from ERROR_SERVICE_DATABASE_LOCKED condition; another error surfaced; giving up"); } } if (startFailed) { CloseServiceHandle(service); CloseServiceHandle(manager); TRACEERR("[driver] [start]", L"ERROR: StartService", err); throw win32_error("StartService", err); } } CloseServiceHandle(service); CloseServiceHandle(manager); if (_gethandle) { tstring strBuf = boost::str(tformat(_T("[driver] [start] getting handle to driver - devfile: [%1%]")) % m_devfile.c_str() ); TRACEBUFI(strBuf); m_dev = CreateFile(m_devfile.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); if(m_dev == INVALID_HANDLE_VALUE) { TRACEERR("[driver] [start]", L"ERROR: CreateFile", err = GetLastError()); throw win32_error("CreateFile"); } m_stoppable = true; } else { m_stoppable = false; // should only be false for MS IpFilterDriver TRACEI("[driver] [start] flagging driver as not stoppable"); } TRACEI("[driver] [start] started driver"); m_started = true; TRACEV("[driver] [start] < Leaving routine."); } // End of start()
void CSysApShutdownImage::ConstructL() { TRACES( RDebug::Print(_L("CSysApShutdownImage::ConstructL" ) ) ); CreateWindowL(); }
void driver::load(const std::wstring &name, const std::wstring &file, const std::wstring &devfile) { TRACEV("[driver] [load(3)] > Entering routine."); if(m_loaded) throw std::exception("driver already loaded", 0); { tstring strBuf = boost::str(tformat(_T("[driver] [load(3)] loading driver - name: [%1%], file: [%2%], devfile: [%3%]")) % name.c_str() % file.c_str() % devfile.c_str() ); TRACEBUFI(strBuf); } m_name = name; m_file = file; m_devfile = devfile; SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if(!manager) throw win32_error("OpenSCManager"); SC_HANDLE service = CreateService(manager, m_name.c_str(), m_name.c_str(), SERVICE_ALL_ACCESS, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, m_file.c_str(), NULL, NULL, NULL, NULL, NULL); if(!service) { DWORD err = 0; TRACEERR("[driver] [load(3)]", L"driver not currently installed as service", err = GetLastError()); err = 0; service = OpenService(manager, m_name.c_str(), SERVICE_ALL_ACCESS); if(!service) { TRACEERR("[driver] [load(3)]", L"opening service", err = GetLastError()); CloseServiceHandle(manager); throw win32_error("OpenService", err); } // make sure it has the same path as m_file. DWORD bytes; BOOL ret = QueryServiceConfig(service, NULL, 0, &bytes); if(ret || (err = GetLastError()) != ERROR_INSUFFICIENT_BUFFER) { TRACEERR("[driver] [load(3)]", L"calling QueryServiceConfig", err); CloseServiceHandle(service); CloseServiceHandle(manager); throw win32_error("QueryServiceConfig", err); } err = 0; // reset error-code, so that nobody else accidentally trips over it. QUERY_SERVICE_CONFIG *qsc = (QUERY_SERVICE_CONFIG*)malloc(bytes); if(!qsc) { TRACEERR("[driver] [load(3)]", L"allocating memory for QueryServiceConfig", err = GetLastError()); CloseServiceHandle(service); CloseServiceHandle(manager); throw std::bad_alloc(); } ret = QueryServiceConfig(service, qsc, bytes, &bytes); if(!ret) { TRACEERR("[driver] [load(3)]", L"second call to QueryServiceConfig", err = GetLastError()); CloseServiceHandle(service); CloseServiceHandle(manager); throw win32_error("QueryServiceConfig", err); } bool del = _wcsicmp(qsc->lpBinaryPathName, m_file.c_str()) != 0; if (del) { // check for e.g. \??\C:\WINDOWS\System32\DRIVERS\ipfltdrv.sys wchar_t * descr = _wgetenv(L"WINDIR"); if (descr) { wstring strFullPath(L"\\??\\"); strFullPath += descr; strFullPath += L"\\"; strFullPath += m_file; tstring strBuf = boost::str(tformat(_T("[driver] [load(3)] comparing against driver full-path:[%1%]")) % strFullPath ); TRACEBUFI(strBuf); del = _wcsicmp(qsc->lpBinaryPathName, strFullPath.c_str()) != 0; } else { TRACEW("[driver] [load(3)] WINDIR environment variable not found!"); } } tstring strBuf = boost::str(tformat(_T("[driver] [load(3)] service name: [%1%], file name: [%2%]")) % qsc->lpBinaryPathName % m_file.c_str() ); TRACEBUFI(strBuf); free(qsc); // paths don't match, remove service and recreate. if(del) { TRACEW("[driver] [load(3)] paths don't match, removing and recreating driver-service"); TCHAR buf[128]; // if it's not removable, bail out. if(!this->removable) { TRACEC("[driver] [load(3)] ERROR trying to remove driver-service"); CloseServiceHandle(service); CloseServiceHandle(manager); throw std::exception("unremovable service mismatch", 0); } // check if its running SERVICE_STATUS status; ret = QueryServiceStatus(service, &status); if(!ret) { TRACEERR("[driver] [load(3)]", L"ERROR calling QueryServiceStatus", err = GetLastError()); CloseServiceHandle(service); CloseServiceHandle(manager); throw win32_error("QueryServiceStatus", err); } // and stop it if it is. switch(status.dwCurrentState) { case SERVICE_STOPPED: TRACEI("[driver] [load(3)] service state: [SERVICE_STOPPED]"); break; case SERVICE_START_PENDING: TRACEI("[driver] [load(3)] service state: [SERVICE_START_PENDING]"); break; case SERVICE_STOP_PENDING: TRACEI("[driver] [load(3)] service state: [SERVICE_STOP_PENDING]"); break; case SERVICE_RUNNING: TRACEI("[driver] [load(3)] service state: [SERVICE_RUNNING]"); break; case SERVICE_CONTINUE_PENDING: TRACEI("[driver] [load(3)] service state: [SERVICE_CONTINUE_PENDING]"); break; case SERVICE_PAUSE_PENDING: TRACEI("[driver] [load(3)] service state: [SERVICE_PAUSE_PENDING]"); break; case SERVICE_PAUSED: TRACEI("[driver] [load(3)] service state: [SERVICE_PAUSED]"); break; default: swprintf_s(buf, _countof(buf), L"[driver] [load(3)] * ERROR: Unknown service state: [%u]", status.dwCurrentState); TRACEBUFE(buf); break; } if(status.dwCurrentState != SERVICE_STOPPED && status.dwCurrentState != SERVICE_STOP_PENDING) { ret = ControlService(service, SERVICE_CONTROL_STOP, &status); if(!ret) { TRACEERR("[driver] [load(3)]", L"ERROR stopping driver-service", err = GetLastError()); CloseServiceHandle(service); CloseServiceHandle(manager); throw win32_error("ControlService", err); } } // now delete the service. ret = DeleteService(service); err = GetLastError(); CloseServiceHandle(service); if(!ret && err != ERROR_SERVICE_MARKED_FOR_DELETE) { TRACEERR("[driver] [load(3)]", L"ERROR deleting driver-service", err); CloseServiceHandle(manager); throw win32_error("DeleteService", err); } // finally recreate it. service = CreateService(manager, m_name.c_str(), m_name.c_str(), SERVICE_ALL_ACCESS, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, m_file.c_str(), NULL, NULL, NULL, NULL, NULL); if(!service && (err = GetLastError()) == ERROR_SERVICE_MARKED_FOR_DELETE) { TRACEW("[driver] [load(3)] Service marked for delete; trying closing/reopening SCM"); CloseServiceHandle(manager); Sleep(10000); manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (!manager) { TRACEERR("[driver] [load(3)]", L"ERROR while re-opening SCM", err = GetLastError()); throw win32_error("OpenSCManager 2", err); } service = CreateService(manager, m_name.c_str(), m_name.c_str(), SERVICE_ALL_ACCESS, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, m_file.c_str(), NULL, NULL, NULL, NULL, NULL); } if(!service) { TRACEERR("[driver] [load(3)]", L"ERROR re-creating driver-service", err = GetLastError()); CloseServiceHandle(manager); throw win32_error("CreateService", err); } TRACEI("[driver] [load(3)] finished re-creating driver-service"); } } SERVICE_STATUS status; if(QueryServiceStatus(service, &status)) { if (status.dwCurrentState == SERVICE_RUNNING) { TRACES("[driver] [load(3)] Driver-service is running"); m_started = true; } else if (status.dwCurrentState == SERVICE_START_PENDING) { TRACEI("[driver] [load(3)] Driver-service is starting"); } else { TRACEI("[driver] [load(3)] driver-service not running"); TCHAR buf[128]; swprintf_s(buf, _countof(buf), L"[driver] [load(3)] - service state: [%u]", status.dwCurrentState); TRACEBUFW(buf); } } CloseServiceHandle(service); CloseServiceHandle(manager); m_loaded = true; TRACEV("[driver] [load(3)] < Leaving routine."); }
void CSysApShutdownImage::ShowShutdownImageL(TInt aBitmapId) { 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(); TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ActivateL --Zero" ) ) ); if ( aBitmapId ) { _LIT( KDirAndFile, "z:qgn_sysap_screen.svg" ); TParse* fp = new (ELeave) TParse(); CleanupStack::PushL(fp); fp->Set( KDirAndFile, &KDC_APP_BITMAP_DIR, NULL ); TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL shutdown image: %S" ), &(fp->FullName())) ); RFs fs; err = fs.Connect(); if ( err == KErrNone ) { CleanupClosePushL(fs); TFindFile findFile( fs ); err = findFile.FindByPath( fp->FullName(), NULL ); if ( err != KErrNone ) { TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL: shutdown image not found, err=%d"), err ) ); } else { delete iBitmap; iBitmap = NULL; // Ownership of bitmap is transferred to CSysApShutdownImage in CreateIconL 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" ) ) ); } } CleanupStack::PopAndDestroy(2); //fp, fs } else { #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION DrawDeferred(); #else // RD_STARTUP_ANIMATION_CUSTOMIZATION TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL - Bitmap not defined, blank screen only" ) ) ); CWindowGc& gc = SystemGc(); ActivateGc(); Window().Invalidate(); Window().BeginRedraw(); gc.SetBrushColor(KRgbWhite); gc.Clear(); Window().EndRedraw(); DeactivateGc(); ControlEnv()->WsSession().Flush(); // force draw of the context #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION } }
// ---------------------------------------------------------------------------- // CSysApFeatureManager::FeatureVariationCheckDone() // ---------------------------------------------------------------------------- // void CSysApFeatureManager::FeatureVariationCheckDone() { TRACES( RDebug::Print( _L("CSysApFeatureManager::FeatureVariationCheckDone()") ) ); FeatureManager::UnInitializeLib(); iFeatMgrActive = EFalse; }
CSysApSimChanged* CSysApSimChanged::NewL( CSysApAppUi& aSysApAppUi, RFs& aFs ) { TRACES( RDebug::Print( _L("CSysApSimChanged::NewL()") ) ); CSysApSimChanged* self = new(ELeave) CSysApSimChanged(aSysApAppUi, aFs ); return self; }
// --------------------------------------------------------------------------- // ~CSysApAudioRoutingObserver // --------------------------------------------------------------------------- // CSysApAudioRoutingObserver::~CSysApAudioRoutingObserver() { TRACES( RDebug::Print( _L("CSysApAudioRoutingObserver::~CSysApAudioRoutingObserver") ) ); delete iTelephonyAudioRouting; }