satengine/SatServer/Engine/src/csatprofilechangeobserver.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
     1 /*
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007 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>
       
    21 #include    "TSatSystemStateFactory.h"
    20 #include    "TSatSystemStateFactory.h"
    22 #include    "MSatSystemStateChangeNotifier.h"
    21 #include    "MSatSystemStateChangeNotifier.h"
    23 #include    "MSatUtils.h"
    22 #include    "MSatUtils.h"
    24 #include    "csatprofilechangeobserver.h"
    23 #include    "csatprofilechangeobserver.h"
    25 #include    "SatLog.h"
    24 #include    "SatLog.h"
    26 #include    "CSatSUiClientHandler.h"
    25 #include    "CSatSUiClientHandler.h"
       
    26 
       
    27 
       
    28 // CONSTANTS
       
    29 const TInt KSatActiveProfileOffline = 5; // value from ProfileEngine
    27 
    30 
    28 // ============================ MEMBER FUNCTIONS ===============================
    31 // ============================ MEMBER FUNCTIONS ===============================
    29 
    32 
    30 // -----------------------------------------------------------------------------
    33 // -----------------------------------------------------------------------------
    31 // CSatProfileChangeObserver::CSatProfileChangeObserver
    34 // CSatProfileChangeObserver::CSatProfileChangeObserver
   107     {
   110     {
   108     LOG2( SIMPLE, "SATENGINE: CSatProfileChangeObserver::StateChanged calling \
   111     LOG2( SIMPLE, "SATENGINE: CSatProfileChangeObserver::StateChanged calling \
   109         with value %d", aValue )
   112         with value %d", aValue )
   110 
   113 
   111     // If profile is off-line send removing event
   114     // If profile is off-line send removing event
   112     if ( ECoreAppUIsNetworkConnectionNotAllowed == aValue )
   115     if ( KSatActiveProfileOffline == aValue )
   113         {
   116         {
   114         LOG( SIMPLE, "SATENGINE: Off-line" )
   117         LOG( SIMPLE, "SATENGINE: Off-line" )
   115         // Off-line state activated.
   118         // Off-line state activated.
   116         // Notify listeners about SAT UI icon removing
   119         // Notify listeners about SAT UI icon removing
   117         iUtils.NotifyEvent( MSatUtils::ERemoveSatUiCalled );       
   120         iUtils.NotifyEvent( MSatUtils::ERemoveSatUiCalled );       
   121     // The event will not be sent in following case: Phone is started
   124     // The event will not be sent in following case: Phone is started
   122     // in offline mode and profile is changed to online. Proactive 
   125     // in offline mode and profile is changed to online. Proactive 
   123     // SetupMenu command is received from SIM card not before phone is
   126     // SetupMenu command is received from SIM card not before phone is
   124     // in online mode. iPreviousProfile is -1 when StateChanged is called
   127     // in online mode. iPreviousProfile is -1 when StateChanged is called
   125     // first time.
   128     // first time.
   126     else if ( ( ECoreAppUIsNetworkConnectionNotAllowed != aValue ) &&  
   129     else if ( ( KSatActiveProfileOffline != aValue ) &&  
   127         ( ECoreAppUIsNetworkConnectionNotAllowed  == iPreviousProfile ) )
   130         ( KSatActiveProfileOffline  == iPreviousProfile ) )
   128         {
   131         {
   129         LOG( SIMPLE, "SATENGINE: !Off-line" )
   132         LOG( SIMPLE, "SATENGINE: !Off-line" )
   130         // Notify listeners about SAT UI icon adding
   133         // Notify listeners about SAT UI icon adding
   131         iUtils.NotifyEvent( MSatUtils::EAddSatUiCalled );
   134         iUtils.NotifyEvent( MSatUtils::EAddSatUiCalled );
   132         }
   135         }