satengine/SatServer/Engine/src/csatprofilechangeobserver.cpp
branchRCL_3
changeset 19 7d48bed6ce0c
parent 0 ff3b6d0fd310
child 20 987c9837762f
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
     1 /*
     1 /*
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
       
    20 #include    <coreapplicationuissdkcrkeys.h>
    20 #include    "TSatSystemStateFactory.h"
    21 #include    "TSatSystemStateFactory.h"
    21 #include    "MSatSystemStateChangeNotifier.h"
    22 #include    "MSatSystemStateChangeNotifier.h"
    22 #include    "MSatUtils.h"
    23 #include    "MSatUtils.h"
    23 #include    "csatprofilechangeobserver.h"
    24 #include    "csatprofilechangeobserver.h"
    24 #include    "SatLog.h"
    25 #include    "SatLog.h"
    25 #include    "CSatSUiClientHandler.h"
    26 #include    "CSatSUiClientHandler.h"
    26 
       
    27 
       
    28 // CONSTANTS
       
    29 const TInt KSatActiveProfileOffline = 5; // value from ProfileEngine
       
    30 
    27 
    31 // ============================ MEMBER FUNCTIONS ===============================
    28 // ============================ MEMBER FUNCTIONS ===============================
    32 
    29 
    33 // -----------------------------------------------------------------------------
    30 // -----------------------------------------------------------------------------
    34 // CSatProfileChangeObserver::CSatProfileChangeObserver
    31 // CSatProfileChangeObserver::CSatProfileChangeObserver
   110     {
   107     {
   111     LOG2( SIMPLE, "SATENGINE: CSatProfileChangeObserver::StateChanged calling \
   108     LOG2( SIMPLE, "SATENGINE: CSatProfileChangeObserver::StateChanged calling \
   112         with value %d", aValue )
   109         with value %d", aValue )
   113 
   110 
   114     // If profile is off-line send removing event
   111     // If profile is off-line send removing event
   115     if ( KSatActiveProfileOffline == aValue )
   112     if ( ECoreAppUIsNetworkConnectionNotAllowed == aValue )
   116         {
   113         {
   117         LOG( SIMPLE, "SATENGINE: Off-line" )
   114         LOG( SIMPLE, "SATENGINE: Off-line" )
   118         // Off-line state activated.
   115         // Off-line state activated.
   119         // Notify listeners about SAT UI icon removing
   116         // Notify listeners about SAT UI icon removing
   120         iUtils.NotifyEvent( MSatUtils::ERemoveSatUiCalled );       
   117         iUtils.NotifyEvent( MSatUtils::ERemoveSatUiCalled );       
   124     // The event will not be sent in following case: Phone is started
   121     // The event will not be sent in following case: Phone is started
   125     // in offline mode and profile is changed to online. Proactive 
   122     // in offline mode and profile is changed to online. Proactive 
   126     // SetupMenu command is received from SIM card not before phone is
   123     // SetupMenu command is received from SIM card not before phone is
   127     // in online mode. iPreviousProfile is -1 when StateChanged is called
   124     // in online mode. iPreviousProfile is -1 when StateChanged is called
   128     // first time.
   125     // first time.
   129     else if ( ( KSatActiveProfileOffline != aValue ) &&  
   126     else if ( ( ECoreAppUIsNetworkConnectionNotAllowed != aValue ) &&  
   130         ( KSatActiveProfileOffline  == iPreviousProfile ) )
   127         ( ECoreAppUIsNetworkConnectionNotAllowed  == iPreviousProfile ) )
   131         {
   128         {
   132         LOG( SIMPLE, "SATENGINE: !Off-line" )
   129         LOG( SIMPLE, "SATENGINE: !Off-line" )
   133         // Notify listeners about SAT UI icon adding
   130         // Notify listeners about SAT UI icon adding
   134         iUtils.NotifyEvent( MSatUtils::EAddSatUiCalled );
   131         iUtils.NotifyEvent( MSatUtils::EAddSatUiCalled );
   135         }
   132         }