bearermanagement/mpm/src/mpmserver.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 12:38:40 +0300
branchRCL_3
changeset 65 14754bf06654
parent 62 bb1f80fb7db2
child 69 cf1b3ddbe9a1
permissions -rw-r--r--
Revision: 201035 Kit: 201036
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description: MPM server implementation
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
/**
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
@file mpmserver.cpp
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
Mobility Policy Manager server implementation.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
*/
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
// INCLUDE FILES
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <commdb.h>
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <etel3rdparty.h>                // Voice call notification
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <mmtsy_names.h>                 // KMmTsyModuleName
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <centralrepository.h>
12
ea6e024ea6f9 Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 8
diff changeset
    28
#include <es_sock_partner.h>
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    29
#include <CoreApplicationUIsSDKCRKeys.h>
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include "mpmserver.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include "mpmserversession.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include "mpmconnmonevents.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include "mpmlogger.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
#include "mpmdtmwatcher.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
#include "mpmroamingwatcher.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    37
#include "mpmdisconnectdlg.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
#include "mpmconfirmdlgroaming.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include "mpmconfirmdlgstarting.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    40
#include "mpmdefaultconnection.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include "mpmcommsdataccess.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    42
#include "mpmwlanquerydialog.h"
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    43
#include "mpmdialog.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
#include "mpmprivatecrkeys.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
#include "mpmcsidwatcher.h"
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
    46
#include "mpmdatausagewatcher.h"
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
    47
#include "mpmpropertydef.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    48
#include "mpmofflinewatcher.h"
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
    49
#include "mpmconnpermquerytimer.h"
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
    50
#include "mpmofflinequerytimer.h"
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
    51
#include "mpmconnselectiondlgtimer.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
// ============================= LOCAL FUNCTIONS ===============================
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
// PanicServer 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
// Panics the server in case of programming error.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
void PanicServer( TInt aPanic )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
    User::Panic( KMPMPanicCategory, aPanic );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
// ============================ MEMBER FUNCTIONS ===============================
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
// CMPMServer::NewL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
CMPMServer* CMPMServer::NewL()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
    CMPMServer* self = new ( ELeave ) CMPMServer();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    CleanupStack::PushL( self );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    self->ConstructL();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    CleanupStack::Pop( self );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
    return self;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
// CMPMServer::CMPMServer
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
CMPMServer::CMPMServer()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
    : CPolicyServer( CPolicyServer::EPriorityStandard, KMPMPolicy ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
      iEvents( NULL ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
      iTSYLoaded( EFalse ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
      iPacketServLoaded( EFalse ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
      iDtmWatcher( NULL ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
      iWLANScanRequired( EFalse ), 
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    93
      iDisconnectQueue( NULL ), 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
      iRoamingQueue( NULL ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
      iStartingQueue( NULL ),
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    96
      iWlanQueryQueue( NULL ),
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    97
      iConnectDialogQueue( NULL ),
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    98
      iDefaultConnection( NULL ), 
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    99
      iConnectionCounter( 0 ),
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   100
      iOfflineMode( ECoreAppUIsNetworkConnectionAllowed )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
// CMPMServer::ConstructL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
void CMPMServer::ConstructL()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
    // identify ourselves and open for service
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
    MPMLOGSTRING( "MPMServer is starting" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
    StartL( KMPMServerName );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
    // Connect to ETel server
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
    // The RTelServer::Connect() might not always work with the first trial,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
    // because of a coding error related to using semaphores in the method.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
    TInt err( KErrNotReady );
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   119
    err = iTelServer.Connect();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
    TInt a = 0;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
    while( a < KPhoneRetryCount && err != KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
        User::After( KPhoneRetryTimeout );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
        err = iTelServer.Connect();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
        a++;       
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
    User::LeaveIfError( err );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
       
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
    // Try to load phone.tsy
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
    TBuf< KCommsDbSvrMaxColumnNameLength > tsyName;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
    tsyName.Copy( KMmTsyModuleName );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
    err = iTelServer.LoadPhoneModule( tsyName );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
    if ( err == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
        iTSYLoaded = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
        // Phone info can be retrieved with value 0 if there is only 1 phone
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
        RTelServer::TPhoneInfo info;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
        User::LeaveIfError( iTelServer.GetPhoneInfo( 0, info ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
        User::LeaveIfError( iMobilePhone.Open( iTelServer, info.iName ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
        // Open packet service
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
        err = iPacketService.Open( iMobilePhone );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
        if ( err == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
            iPacketServLoaded = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
            iDtmWatcher = CMPMDtmWatcher::NewL( iPacketService );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
        else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
            MPMLOGSTRING2( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
                "CMPMServer::ConstructL iPacketService.Open error: %d", err )  
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
    iRoamingWatcher = CMPMRoamingWatcher::NewL(iMobilePhone);
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
    iCommsDatAccess = CMPMCommsDatAccess::NewL( );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   161
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   162
    iDisconnectQueue = new ( ELeave ) CArrayPtrFlat<CMPMDisconnectDlg>( KGranularity );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   163
    iDisconnectQueue->Reset();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
    iRoamingQueue = new ( ELeave ) CArrayPtrFlat<CMPMConfirmDlgRoaming>( KGranularity );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
    iRoamingQueue->Reset();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
    iStartingQueue = new ( ELeave ) CArrayPtrFlat<CMPMConfirmDlgStarting>( KGranularity ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
    iStartingQueue->Reset();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   171
    iWlanQueryQueue = new ( ELeave ) CArrayPtrFlat<CMPMWlanQueryDialog>( KGranularity );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   172
    iWlanQueryQueue->Reset();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   173
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   174
    iConnectDialogQueue = new ( ELeave ) CArrayPtrFlat<CMPMDialog>( KGranularity );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   175
    iConnectDialogQueue->Reset();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   176
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   177
    iDefaultConnection = CMPMDefaultConnection::NewL( this );    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   178
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
    // Create central repository watcher and start it
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
    iMpmCsIdWatcher = CMpmCsIdWatcher::NewL();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
    iMpmCsIdWatcher->StartL();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   183
    // Create another central repository watcher and start it
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   184
    TRAPD( duwErr, iMpmDataUsageWatcher = CMpmDataUsageWatcher::NewL( this ) );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   185
    if (duwErr == KErrNone)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   186
        {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   187
        iMpmDataUsageWatcher->StartL();
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   188
        }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   189
    else
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   190
        {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   191
        iMpmDataUsageWatcher = NULL;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   192
        MPMLOGSTRING( "CMPMServer::ConstructL: CMpmDataUsageWatcher::NewL() failed!" )
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   193
        }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   194
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   195
    // Create another central repository watcher and start it
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   196
    TRAPD( owErr, iMpmOfflineWatcher = CMpmOfflineWatcher::NewL( this ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   197
    if (owErr == KErrNone)
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   198
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   199
        iMpmOfflineWatcher->StartL();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   200
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   201
    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   202
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   203
        iMpmOfflineWatcher = NULL;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   204
        MPMLOGSTRING( "CMPMServer::ConstructL: CMpmOfflineWatcher::NewL() failed!" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   205
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   206
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   207
    // Define P&S keys (snap & iap) for the user connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   208
    TInt ret = RProperty::Define( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   209
                                  KMPMPSKeyUserConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   210
                                  KMPMUserConnectionSnapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   211
                                  KMPMUserConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   212
                                  KMPMUserConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   213
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   214
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   215
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   216
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   217
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   218
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   219
    ret = RProperty::Define( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   220
                             KMPMPSKeyUserConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   221
                             KMPMUserConnectionIapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   222
                             KMPMUserConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   223
                             KMPMUserConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   224
                                          
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   225
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   226
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   227
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   228
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   229
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   230
    // Set initial values for the keys
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   231
    User::LeaveIfError(RProperty::Set( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   232
                                       KMPMPSKeyUserConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   233
                                       0 ));
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   234
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   235
    User::LeaveIfError(RProperty::Set( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   236
                                       KMPMPSKeyUserConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   237
                                       0 ));
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   238
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
    // Read dedicated clients from the central repository
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
    CRepository* repository = CRepository::NewL( KCRUidMPM );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
    CleanupStack::PushL( repository );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
    TUint32 baseKey = KMpmDedicatedClientBase;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
    TInt value;
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   246
    ret = KErrNone;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
    while ( ret == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
        ret = repository->Get ( baseKey, value );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
        if ( ret == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
            iDedicatedClients.AppendL( value );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
            MPMLOGSTRING2( "CMPMServer::ConstructL: Dedicated client id: %d", value)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
        baseKey++;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
    CleanupStack::PopAndDestroy ( repository );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   262
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   263
    // Define P&S keys for the connection dialogs
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   264
    ret = RProperty::Define( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   265
                             KMPMPSKeyActiveConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   266
                             KMPMActiveConnectionIapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   267
                             KMPMActiveConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   268
                             KMPMActiveConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   269
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   270
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   271
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   272
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   273
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   274
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   275
    ret = RProperty::Define( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   276
                             KMPMPSKeyActiveConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   277
                             KMPMActiveConnectionSnapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   278
                             KMPMActiveConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   279
                             KMPMActiveConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   280
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   281
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   282
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   283
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   284
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   285
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   286
    ret = RProperty::Define( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   287
                             KMPMPSKeyActiveConnectionBearer,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   288
                             KMPMActiveConnectionBearerType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   289
                             KMPMActiveConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   290
                             KMPMActiveConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   291
                                          
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   292
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   293
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   294
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   295
        }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
        
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   297
    PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   298
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   299
    iRoamingToWlanPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   300
    iRoamingToHotspotWlanPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   301
            
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
// CMPMServer::~CMPMServer
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
CMPMServer::~CMPMServer()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
    {
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   311
	if ( iRoamingToWlanPeriodic )
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   312
        {
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   313
        iRoamingToWlanPeriodic->Cancel();
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   314
		delete iRoamingToWlanPeriodic;
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   315
        }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   316
    if ( iRoamingToHotspotWlanPeriodic )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   317
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   318
        iRoamingToHotspotWlanPeriodic->Cancel();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   319
        delete iRoamingToHotspotWlanPeriodic;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   320
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   321
    if ( iDisconnectQueue )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   322
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   323
        iDisconnectQueue->ResetAndDestroy();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   324
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   325
    delete iDisconnectQueue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   326
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
    if ( iRoamingQueue )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
        iRoamingQueue->ResetAndDestroy();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
    delete iRoamingQueue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
    if ( iStartingQueue )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
        iStartingQueue->ResetAndDestroy();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
    delete iStartingQueue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   339
    while ( iWlanQueryQueue && iWlanQueryQueue->Count() > 0 )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   340
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   341
        iWlanQueryQueue->Delete( 0 );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   342
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   343
    delete iWlanQueryQueue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   344
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   345
    if ( iConnectDialogQueue )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   346
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   347
        iConnectDialogQueue->ResetAndDestroy();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   348
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   349
    delete iConnectDialogQueue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   350
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
    delete iEvents;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
    for ( TInt i = 0; i < iBlackListIdList.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
        iBlackListIdList[i].Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
    iActiveBMConns.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
    iSessions.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
    delete iDtmWatcher;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
    delete iRoamingWatcher;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
    // Close "global" ETEL objects
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
    if ( iPacketServLoaded )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
        iPacketService.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
        }    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
    iMobilePhone.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
    iTelServer.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
    
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   373
    delete iDefaultConnection;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   374
    
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
    delete iMpmCsIdWatcher;    
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   376
    
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   377
    delete iMpmDataUsageWatcher;    
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   378
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   379
    delete iMpmOfflineWatcher;    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   380
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
    iDedicatedClients.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   383
    delete iCommsDatAccess;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   384
    
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   385
    delete iConnPermQueryTimer;
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
   386
    
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
   387
    delete iOfflineQueryTimer; 
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
   388
    
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
   389
    delete iConnSelectionDlgTimer;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
// CMPMServer::NewSessionL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
CSession2* CMPMServer::NewSessionL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
    const TVersion& aVersion,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
    const RMessage2& /*aMessage*/) const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
    MPMLOGSTRING( "CMPMServer::NewSessionL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
    // Check we're the right version
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
    if ( !User::QueryVersionSupported(TVersion(KMPMServerMajorVersionNumber,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
                                               KMPMServerMinorVersionNumber,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
                                               KMPMServerBuildVersionNumber ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
                                     aVersion ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
        User::Leave( KErrNotSupported );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
    CSession2* session = CMPMServerSession::NewL( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
                             *const_cast<CMPMServer*>( this ));
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
    return session;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
// CMPMServer::PanicClient
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
void CMPMServer::PanicClient(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
    const TInt aPanic) const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
    // let's have a look before we panic the client
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
    __DEBUGGER()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
    // ok, go for it
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
    RThread clientThread;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
    TInt err = Message().Client( clientThread );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
    if ( err == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
        clientThread.Panic( KMPMServerName, aPanic );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
        clientThread.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
// CMPMServer::AppendBMConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
void CMPMServer::AppendBMConnection( const TConnectionId aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
                                     const TUint32       aSnap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
                                     const TUint32       aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
                                     TConnectionState    aState,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
                                     CMPMServerSession&  aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
        "CMPMServer::AppendBMConnection - aConnId = 0x%x, aSnap = %i",
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
        aConnId, aSnap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   452
    // Set the Connection Id, SNAP, Iap Id and connection state, into TActiveBMConn
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
    TActiveBMConn conn;
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   454
    conn.iConnInfo.iConnId = aConnId;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   455
    conn.iConnInfo.iSnap   = aSnap;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   456
    conn.iConnInfo.iIapId  = aIapId;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   457
    conn.iConnInfo.iState  = aState;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   458
    conn.iConnInfo.iAppUid = aSession.AppUid();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
    if ( index1 == KErrNotFound )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
        // If this connInfo is not yet there, insert it at the end of array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
        iActiveBMConns.Append( conn );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
        // connInfo already active, check whether Connection Id is there
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
        if ( index1 < iActiveBMConns.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
            // Set the Iap Id and connection state
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
            iActiveBMConns[index1].iConnInfo.iIapId = aIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
            iActiveBMConns[index1].iConnInfo.iState = aState;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
            iActiveBMConns[index1].iConnInfo.iAppUid = aSession.AppUid();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   482
    if ( aState == EStarted && aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   483
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   484
        UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   485
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   486
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
// CMPMServer::ResetBMConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
void CMPMServer::ResetBMConnection( const TConnectionId aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
                                    const TUint32       aIapId,
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   501
                                    CMPMServerSession&  aSession )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
        "CMPMServer::ResetBMConnection - aConnId = 0x%x, aIapId = %i", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
        aConnId, aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
    // Get the current connection SNAP for this Connection Id
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
    //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
    TUint32 snap = GetBMSnap( aConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
    // Set the Connection Id and SNAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
    TConnectionInfo connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
    connInfo.iConnId = aConnId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
    connInfo.iSnap   = snap;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
    // Set the Iap Id 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
    conn.iConnInfo          = connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
    conn.iConnInfo.iIapId   = aIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
    if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
//       && ( aIapId == iActiveBMConns[index1].iConnInfo.iIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
        // If connInfo found, reset the Iap Id as zero and 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
        // update connection state as EIdle.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
        // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
        // It is expected that MPM keeps the Connection Id and SNAP 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
        // relationship in a database entry and that this entry survives 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
        // a roaming event (an ApplicationLeavesConnection call).
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
        iActiveBMConns[index1].iConnInfo.iIapId = 0;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
        iActiveBMConns[index1].iConnInfo.iState = EIdle;
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   537
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   538
        // Change state of P&S keys if needed
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   539
        if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   540
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   541
            UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   542
            }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
// CMPMServer::RemoveBMConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
void CMPMServer::RemoveBMConnection( const TConnectionId aConnId,
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   557
                                     CMPMServerSession&  aSession )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
    MPMLOGSTRING2( "CMPMServer::RemoveBMConnection - aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
        aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
    // This time we are browsing the array from the end to the beginning, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
    // because removing one element from array affects index numbering.
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   564
    // Decrement i by one, because count is n, but indexes in array are 0 .. n-1
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   565
    for ( TInt i = iActiveBMConns.Count() - 1; i >= 0; i-- )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
        if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   569
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   570
            TInt closeIapId = iActiveBMConns[i].iConnInfo.iIapId;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   571
            if ( !closeIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   572
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   573
                TRAP_IGNORE( closeIapId = aSession.IapSelectionL()->MpmConnPref().IapId() );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   574
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   575
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
            // If Connection Id found, remove it. 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
            iActiveBMConns.Remove( i );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   578
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   579
            // Update active connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   580
            if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   581
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   582
                UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   583
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   584
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   585
            CheckIapForDisconnect( closeIapId );
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
        }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   588
    
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
// CMPMServer::GetBMIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
TUint32 CMPMServer::GetBMIap( const TConnectionId aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
    MPMLOGSTRING2( "CMPMServer::GetBMIap - aConnId = 0x%x", aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
    TUint32 connectionIapId( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
    // Set the Connection Id and SNAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
    TConnectionInfo connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
    connInfo.iConnId = aConnId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
    conn.iConnInfo = connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
    if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
        // If connInfo found, set the Iap Id as connectionIapId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
        connectionIapId = iActiveBMConns[index1].iConnInfo.iIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
    MPMLOGSTRING2( "CMPMServer::GetBMIap - connectionIapId = %i", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622
        connectionIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
    return connectionIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
// CMPMServer::GetBMSnap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
TUint32 CMPMServer::GetBMSnap( const TConnectionId aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
    MPMLOGSTRING2( "CMPMServer::GetBMSnap - aConnId = 0x%x", aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
    TUint32 snap( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
    TBool   snapFound( EFalse );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
    for ( TInt i = 0; ( ( i < iActiveBMConns.Count() ) && !snapFound ); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
        if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   641
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
            snap = iActiveBMConns[i].iConnInfo.iSnap;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
            snapFound = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
    MPMLOGSTRING2( "CMPMServer::GetBMSnap - SNAP = %i", snap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
    return snap;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
// CMPMServer::GetConnectionState
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
void CMPMServer::GetConnectionState( const TConnectionId    aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
                                     TConnectionState&      aState )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
    MPMLOGSTRING2( "CMPMServer::GetConnectionState - aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
        aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
    TConnectionInfo connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
    connInfo.iConnId = aConnId; 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
    conn.iConnInfo = connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
    if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   669
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
        // If connInfo found
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   672
        aState = iActiveBMConns[index1].iConnInfo.iState;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   675
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
        // Since connInfo has no entry in iActiveBMConns, then 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   677
        // the state of connection must be EStarting.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
        // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
        aState = EStarting;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   682
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   683
    switch( aState )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   684
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
        case EStarting:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   686
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   687
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Starting" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   688
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
        case EStarted:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   692
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Started" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   694
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   695
        case EIdle:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   696
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   697
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Idle" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   698
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   699
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   700
        case ERoaming:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   702
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Roaming" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   704
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   705
        default:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Unknown" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   714
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   715
// CMPMServer::CheckUsageOfIap
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   716
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
//
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   718
TConnectionState CMPMServer::CheckUsageOfIap( const TUint32 aIapId , 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   719
                                  const TConnectionId aOwnConnId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
    {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   721
    MPMLOGSTRING3( "CMPMServer::CheckUsageOfIap - aIapId = %i, aOwnConnId = 0x%x", 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   722
                  aIapId, aOwnConnId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   724
    TConnectionState state = EIdle;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
    // Loop all connections until EStarted is found or no more connections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
    // 
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   728
    for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
        {
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   730
        // Check if IAP Id matches; exclude matching with own connection
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
        // 
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   732
        if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId && 
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   733
             iActiveBMConns[i].iConnInfo.iConnId != aOwnConnId)
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
            state = iActiveBMConns[i].iConnInfo.iState;  
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
            // Stop looping if EStarted found
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
            if ( state == EStarted )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
                {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   741
                break; // Breaks the for loop
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
    switch( state )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
        case EStarting:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   751
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Starting" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
        case EStarted:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   756
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Started" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
        case EIdle:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   761
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Idle" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
        case ERoaming:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   766
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Roaming" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
        default:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   771
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Unknown" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
#endif // _DEBUG
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   776
        
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   777
    return state;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
// CMPMServer::IsWlanConnectionStartedL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
TUint32 CMPMServer::IsWlanConnectionStartedL( const CMPMCommsDatAccess* aCdbAccess )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
    TUint32 iapId( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
    MPMLOGSTRING( "CMPMServer::IsWlanConnectionStartedL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
    TBool stopLoop( EFalse );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
    // Loop all connections until EStarted is found or no more connections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
    for ( TInt i = 0; ( ( i < iActiveBMConns.Count() ) && !stopLoop ); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
        // Check if IAP Id matches
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
        // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
        if ( iActiveBMConns[i].iConnInfo.iState == EStarting ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
             iActiveBMConns[i].iConnInfo.iState == EStarted )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
            {
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   801
            TWlanIapType iapType( ENotWlanIap );             	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   802
            TRAPD ( leave, iapType = aCdbAccess->CheckWlanL( iActiveBMConns[i].iConnInfo.iIapId ) )             	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   803
            if ( ( leave == KErrNone ) && ( iapType != ENotWlanIap ) )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
                stopLoop = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
                iapId = iActiveBMConns[i].iConnInfo.iIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
                MPMLOGSTRING2( "CMPMServer::IsWlanConnectionStartedL, found wlan iap %d", iapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
    return iapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
// CMPMServer::AppendBMIAPConnectionL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
void CMPMServer::AppendBMIAPConnectionL( const TUint32       aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
                                         const TConnectionId aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   822
                                         CMPMServerSession& aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
        "CMPMServer::AppendBMIAPConnectionL - aIapId = %i, aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
        aIapId, aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
    conn.iConnInfo.iIapId = aIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
    conn.iConnInfo.iState = EStarted;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
    conn.iConnInfo.iAppUid = aSession.AppUid();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
    if ( index1 == KErrNotFound )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
        // If this Iap is not yet there, insert it at the end of array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
        iActiveBMConns.AppendL( conn );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   842
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
        // Iap already active, update connection state as started. 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
        // This Iap could be shared by multiple applications, but 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
        // update only the one with matching connection id.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
        for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
            if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
                iActiveBMConns[i].iConnInfo.iState = EStarted;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
            else if ( iActiveBMConns[i].iConnInfo.iSnap == 0 &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
                    iActiveBMConns[i].iConnInfo.iIapId == aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   856
                iActiveBMConns[i].iConnInfo.iState = EStarted;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   861
    if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   862
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   863
        UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   864
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   865
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
// CMPMServer::RemoveBMIAPConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
void CMPMServer::RemoveBMIAPConnection( const TUint32       aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
                                        const TConnectionId aConnId,
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   880
                                        CMPMServerSession&  aSession )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
        "CMPMServer::RemoveBMIAPConnection - aIapId = %i, aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
        aIapId, aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   886
    // The IAP connection lifetime is determined by the two calls 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   887
    // IAPConnectionStarted and IAPConnectionStopped. 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   888
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   889
    // This time we are browsing the array from the end to the beginning, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   890
    // because removing one element from array affects index numbering.
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   891
    // Decrement i by one, because count is n, but indexes in array are 0 .. n-1
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   892
    for ( TInt i = iActiveBMConns.Count() - 1; i >= 0; i-- )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   893
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
        if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   896
            if ( iActiveBMConns[i].iConnInfo.iSnap == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   897
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
                // If IAPConnectionStopped has been called and SNAP is zero,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   899
                // then this entry can be removed from database.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   900
                // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   901
                iActiveBMConns.Remove( i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   902
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
            else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   905
                // If IAP found, reset the Iap Id as zero and 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   906
                // update connection state as idle.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
                // This Iap could be shared by multiple applications, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
                // but update only the one with matching connection id.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   909
                // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   910
                if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
                    iActiveBMConns[i].iConnInfo.iIapId = 0;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
                    iActiveBMConns[i].iConnInfo.iState = EIdle;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   914
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   915
                }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   916
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   917
            // Update active connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   918
            if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   919
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   920
                UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   921
                }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   922
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   923
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   924
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   925
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   926
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   928
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   929
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   933
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   934
// CMPMServer::AppendSessionL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   935
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
void CMPMServer::AppendSessionL( const CMPMServerSession* aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
    MPMLOGSTRING( "CMPMServer::AppendSession" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
    iSessions.AppendL( aSession );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   942
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   943
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   946
// CMPMServer::RemoveSession
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
void CMPMServer::RemoveSession( const CMPMServerSession* aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   951
    MPMLOGSTRING( "CMPMServer::RemoveSession" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   953
    TInt index = iSessions.Find( aSession );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   954
    if ( index != KErrNotFound )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
        {
36
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   956
        if ( Events() )
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   957
            {
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   958
            // Cancel WLAN scan request if one exists
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   959
            TRAP_IGNORE( Events()->CancelScanL( iSessions[index] ) )
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   960
            }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   961
        iSessions.Remove( index );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   962
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   963
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   964
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   965
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   966
// CMPMServer::NotifyBMPrefIapL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   967
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   968
//
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   969
void CMPMServer::NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo, 
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   970
                                   const TPrefIAPNotifCaller aCaller )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   971
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   972
    MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - IAPs count: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   973
        aIapInfo.iCount)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   974
    TConnMonIapInfo iapInfo = aIapInfo;
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   975
    iConnMonIapInfo = aIapInfo;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   977
    for (TUint i = 0; i < iapInfo.Count(); i++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   978
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   979
        MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIap - IAP: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   980
            iapInfo.iIap[i].iIapId) 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   983
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   984
    // Read info for forced roaming from Commdat
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   985
    TUint32 maxOpenTransAttempts ( KMaxOpenTransAttempts ) ;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   986
    TUint32 retryAfter ( KRetryAfter );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   987
    TInt err;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   988
    // CommDat reading might fail because CommDat session could be locked by another process at the moment
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   989
    // So, we may wait/retry to read from CommDat a bit later.
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   990
    TCmUsageOfWlan usageOfWlan ( ECmUsageOfWlanKnown );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   991
    do
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   992
        {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   993
        TRAP ( err, usageOfWlan = CommsDatAccess()->ForcedRoamingL() );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   994
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   995
        if( err )
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   996
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   997
            User::After( retryAfter );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   998
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   999
        } while( err && maxOpenTransAttempts-- );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1000
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1001
    // Start possible forced roaming
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1002
    if ( !err )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1003
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1004
        if ( usageOfWlan == ECmUsageOfWlanKnown || usageOfWlan == ECmUsageOfWlanKnownAndNew )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1005
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1006
            if ( IsWlanConnectionStartedL( CommsDatAccess() ) )
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1007
                {
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1008
                iRoamingToWlanPeriodic->Cancel();
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1009
                iRoamingToHotspotWlanPeriodic->Cancel();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1010
                        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1011
                // Start periodic object that calls StartForcedRoamingToWlanL after 10s. 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1012
                // this handles the case when new wlan connection is 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1013
                // started from e.g. wlan sniffer but IAP is not yet in Internet SNAP 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1014
                iRoamingToWlanPeriodic->Start( 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1015
                        TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1016
                        TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1017
                        TCallBack( StartForcedRoamingToConnectedWlanL, this ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1018
                
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1019
                // Start periodic object that calls StartForcedRoamingToWlanL after 120s. 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1020
                // this handles the case when new captive portal hotspot wlan 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1021
                // connection is started. IAP will be moved to Internet SNAP after 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1022
                // successful login only. 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1023
                iRoamingToHotspotWlanPeriodic->Start( 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1024
                        TTimeIntervalMicroSeconds32( KRoamingToHotspotWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1025
                        TTimeIntervalMicroSeconds32( KRoamingToHotspotWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1026
                        TCallBack( StartForcedRoamingToConnectedHotspotWlanL, this ) );
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1027
                }
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1028
            else
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1029
                {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1030
                StartForcedRoamingToWlanL( iapInfo );
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1031
                }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1032
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1033
            StartForcedRoamingFromWlanL( iapInfo );
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1034
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1035
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1036
    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1037
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1038
        MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - \
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1039
reading info for forced roaming fails with err %d, forced roaming fails", err )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1040
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1041
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1042
    MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1043
    "CMPMServer::NotifyBMPrefIapL - Send notifications for %d sessions", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1044
        iSessions.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1045
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1046
    for ( TInt i = 0; i < iSessions.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1047
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
        iapInfo = iSessions[i]->GetAvailableIAPs( );
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
  1049
        iSessions[i]->PrefIAPNotificationL( iapInfo, aCaller );
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1050
        }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1051
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1052
    // If a session is displaying connection selection dialog 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1053
    // the contents of the dialog should be updated according to the 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1054
    // current iap availability
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1055
    //
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1056
    for ( TInt i( 0 ); i < iSessions.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1057
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1058
        iSessions[i]->UpdateConnectionDialogL();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1059
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1060
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1061
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1062
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1063
// CMPMServer::UpdateSessionConnectionDlgL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1064
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1065
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1066
void CMPMServer::UpdateSessionConnectionDlgL()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1067
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1068
    MPMLOGSTRING( "CMPMServer::UpdateSessionConnectionDlgL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1069
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1070
    // If a session is displaying connection selection dialog 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1071
    // the contents of the dialog should be updated according to the 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1072
    // current iap availability
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1073
    //
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1074
    for ( TInt i( 0 ); i < iSessions.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1075
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1076
        iSessions[i]->UpdateConnectionDialogL();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1077
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1078
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1079
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1080
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1081
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1082
// CMPMServer::HandlePendingMsgs
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1083
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1084
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1085
void CMPMServer::HandlePendingMsgs( TUint            aIapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1086
                                    TInt             aError, 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1087
                                    TInt*            aErrorReturned,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1088
                                    TBMNeededAction* aNeededAction )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1089
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1090
    MPMLOGSTRING3( "CMPMServer::HandlePendingMsgs aError = %d iapId = %d", 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1091
                   aError, aIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1092
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1093
    for ( TInt i( 0 ); i < iSessions.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1094
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1095
        // Read the Connection Id of the application
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1096
        TConnectionId connId = iSessions[i]->ConnectionId();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1097
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1098
        // Get the current connection IapId for this connId 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1099
        TUint32 currentIap = iSessions[i]->MyServer().GetBMIap( connId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1100
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1101
        MPMLOGSTRING2( "Session IapId = %d", currentIap );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1102
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1103
        if ( currentIap == aIapId && !iSessions[i]->ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1104
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1105
            iSessions[i]->ProcessErrorComplete( aError, 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1106
                                                aErrorReturned, 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1107
                                                aNeededAction );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1108
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1109
        }
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1110
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1111
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1112
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1113
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1114
// CMPMServer::HandleServerBlackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1116
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1117
TInt CMPMServer::HandleServerBlackListIap( const TConnectionId  aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
                                           TUint32              aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
                                           TBlacklistCategory   aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1122
        "CMPMServer::HandleServerBlackListIap - aConnId = 0x%x, iapId = %i",
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
        aConnId, aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
    MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
        "CMPMServer::HandleServerBlackListIap - aCategory = %i", aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
    BlackListIap( aConnId, aIapId, aCategory ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1130
    TUint32 presumedIap = Events()->PresumedIapId( aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
                                                   aIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
    if ( ( presumedIap != 0 ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1133
         ( presumedIap != aIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1135
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1136
            "CMPMServer::HandleServerBlackListIap - presumedIap = %i",
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
            presumedIap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
        BlackListIap( aConnId, presumedIap, aCategory ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1139
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
// CMPMServer::BlackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
TInt CMPMServer::BlackListIap( const TConnectionId  aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
                               TUint32              aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
                               TBlacklistCategory   aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
    TInt i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
    found = FindBlacklistedConnIndex( aConnId, i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
    if ( found )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
        TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
        connIdInfo.Append( aIapId, aCategory );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
        iBlackListIdList.Remove( i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
        iBlackListIdList.Insert( connIdInfo, 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1163
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1164
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1165
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
        TMPMBlackListConnId connIdInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
        connIdInfo.iConnId = aConnId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1168
        connIdInfo.Append( aIapId, aCategory );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
        iBlackListIdList.Insert( connIdInfo, 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1171
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1172
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1173
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1174
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
// CMPMServer::HandleServerUnblackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1178
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1179
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1180
TInt CMPMServer::HandleServerUnblackListIap( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
    const TConnectionId aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
    TUint32             aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1184
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1185
        "CMPMServer::HandleServerUnblackListIap - aConnId = 0x%x, iapId = %i"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1186
        ,aConnId, aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1187
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1188
    TInt i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1189
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1191
    found = FindBlacklistedConnIndex( aConnId, i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1192
    if ( found )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1193
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1194
        // found blacklisted Connection Id
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1195
        TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1196
        iBlackListIdList.Remove( i ); // remove from the list 
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1197
        
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1198
        MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1199
connIdInfo count: %d", connIdInfo.Count() )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1200
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
        if ( aIapId == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1202
            { // 0 will reset Connection Id blacklisted iap list 
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1203
            MPMLOGSTRING( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1204
reset Connection Id blacklisted iap list" )
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1205
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1206
            connIdInfo.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1207
            return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1208
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1209
        
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1210
        found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1211
        for (TInt j = 0; j < connIdInfo.Count(); j++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1212
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1213
            if ( connIdInfo.Iap( j ) == aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1214
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1215
                // found and remove blacklisted iap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1216
                connIdInfo.Remove( j ); 
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1217
                MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1218
removed blacklisted iap in index = %d", j )
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1219
                
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1220
                if ( connIdInfo.Count() == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1221
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1222
                    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1223
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1224
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1225
                // reinsert connIdInfo at the beginning to reflect activeness
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
                iBlackListIdList.Insert( connIdInfo, 0 ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1227
                return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1229
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1230
        // nothing found and reinsert at the beginning 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1231
        // connIdInfo to reflect activeness
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
        iBlackListIdList.Insert( connIdInfo, 0 ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1233
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1236
        {
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1237
        MPMLOGSTRING( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1238
not found blacklisted Connection Id" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1242
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1243
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
// CMPMServer::HandleServerUnblackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
void CMPMServer::HandleServerUnblackListIap( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
    TBlacklistCategory  aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
    {
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1250
    MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap -\
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1251
aCategory = %i blacklisted Id count = %d", 
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1252
                   aCategory, iBlackListIdList.Count() )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1254
    for (TInt i = iBlackListIdList.Count()-1; i >= 0; i--)
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1255
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1256
        // found blacklisted Connection Id
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1257
        TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
        iBlackListIdList.Remove( i ); // remove from the list 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1260
        MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1261
aConnId = 0x%x, blacklisted IapId count = %d", connIdInfo.iConnId, 
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1262
        connIdInfo.Count() )
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1263
        
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1264
        for (TInt j = connIdInfo.Count()-1; j >= 0; j--)
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1265
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1266
            if ( connIdInfo.Category( j ) == aCategory ) 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1267
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1268
                // found and remove blacklisted iap
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1269
                MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1270
removed blacklisted iap id %i in index: %d", connIdInfo.Iap( j ), j )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1271
                connIdInfo.Remove( j ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1272
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1273
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1274
        // If any blacklisted iaps remain reinsert at the 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1275
        // beginning connIdInfo to reflect activeness
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1276
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1277
        if( connIdInfo.Count() > 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1278
            {
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1279
            MPMLOGSTRING( "reinsert connIdInfo to reflect activeness" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1280
            iBlackListIdList.Insert( connIdInfo, 0 );             
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1283
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1284
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1285
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1286
// CMPMServer::GetBlacklistedIAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1288
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1289
TInt CMPMServer::GetBlacklistedIAP( TConnectionId    aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1290
                                    RArray<TUint32> &aBlacklistedIAP )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1291
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1292
    TInt  i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1294
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
    found = FindBlacklistedConnIndex( aConnId, i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1296
    if ( !found )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1297
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1298
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1299
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
    TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1302
    iBlackListIdList.Remove( i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1303
    iBlackListIdList.Insert( connIdInfo, 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1304
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1305
    for (TInt j = 0; j < connIdInfo.Count(); j++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1306
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1307
        aBlacklistedIAP.Append( connIdInfo.Iap( j ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1308
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1309
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1310
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1311
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1312
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1313
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1314
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1315
// CMPMServer::GetBlacklistedIAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1316
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
TInt CMPMServer::GetBlacklistedIAP( RArray<TUint32> &aBlacklistedIAP )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1319
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
    // Returns all blacklisted IAPs regardless of Connection Id 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1321
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1322
    for ( TInt i( 0 ); i < iBlackListIdList.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1324
        for ( TInt j( 0 ); j < iBlackListIdList[i].Count(); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1325
              j++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1326
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1327
            // Inserts an object into the array in ascending unsigned 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1328
            // key order. No duplicate entries are permitted. 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1329
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
            // The array remains unchanged following an attempt to 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
            // insert a duplicate entry.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1332
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1333
            aBlacklistedIAP.InsertInUnsignedKeyOrder( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
                                    iBlackListIdList[i].Iap( j ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1335
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1336
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1337
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1338
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1339
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1340
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1341
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1342
// CMPMServer::FindId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1343
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1344
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1345
TBool CMPMServer::FindBlacklistedConnIndex( const TConnectionId aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1346
                                            TInt                &aIndex )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1347
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1348
    TInt  i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1349
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1350
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1351
    for (i = 0;( (i < iBlackListIdList.Count()) && !found ); i++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1352
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1353
        if ( iBlackListIdList[i].iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1354
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1355
            found = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1356
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1357
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
    i--; // Since i is incremented after finding the correct iConnId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
    aIndex = i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
    return found;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1362
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
// CMPMServer::IsVoiceCallActiveL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
// Checks if voice call is active or not.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
// Return ETrue if voice call is active.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
// Return EFalse if voice call is not active.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
TBool CMPMServer::IsVoiceCallActiveL() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
    MPMLOGSTRING( "CMPMServer::IsVoiceCallActiveL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
    CTelephony*                   telephony = CTelephony::NewLC();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
    CTelephony::TCallStatusV1     callStatusV1;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
    CTelephony::TCallStatusV1Pckg callStatusV1Pckg( callStatusV1 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
    CTelephony::TPhoneLine        line = CTelephony::EVoiceLine;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
    telephony->GetLineStatus( line, callStatusV1Pckg );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
    CTelephony::TCallStatus voiceLineStatus = callStatusV1.iStatus;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
    CleanupStack::PopAndDestroy( telephony );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
    if ( voiceLineStatus == CTelephony::EStatusDialling         ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
         voiceLineStatus == CTelephony::EStatusRinging          ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
         voiceLineStatus == CTelephony::EStatusAnswering        ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
         voiceLineStatus == CTelephony::EStatusConnecting       ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1390
         voiceLineStatus == CTelephony::EStatusConnected        ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1391
         voiceLineStatus == CTelephony::EStatusReconnectPending ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
         voiceLineStatus == CTelephony::EStatusDisconnecting    ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
         voiceLineStatus == CTelephony::EStatusHold             ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
         voiceLineStatus == CTelephony::EStatusTransferring     ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1395
         voiceLineStatus == CTelephony::EStatusTransferAlerting  )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1396
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1397
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
            "CMPMServer::IsVoiceCallActiveL Voice call is active: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1399
            voiceLineStatus )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1400
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1401
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
    else if ( voiceLineStatus == CTelephony::EStatusIdle ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1403
              voiceLineStatus == CTelephony::EStatusUnknown )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1404
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1405
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1406
            "CMPMServer::IsVoiceCallActiveL Voice call is not active: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
            voiceLineStatus )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
            "CMPMServer::IsVoiceCallActiveL Unknown voice line status: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
            voiceLineStatus )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1415
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1416
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1417
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
// CMPMServer::IsModeGSM
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1422
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
// Checks if mode is GSM or not.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
// Return ETrue if mode is GSM.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
// Return EFalse if mode is something else.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1427
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
TBool CMPMServer::IsModeGSM() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1429
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1430
    MPMLOGSTRING( "CMPMServer::IsModeGSM" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
    if ( iTSYLoaded )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
        RMobilePhone::TMobilePhoneNetworkMode mode( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1435
            RMobilePhone::ENetworkModeUnknown );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1437
        TInt ret = iMobilePhone.GetCurrentMode( mode );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1438
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
        if ( ( ret == KErrNone ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
             ( mode == RMobilePhone::ENetworkModeGsm ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1441
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1442
            MPMLOGSTRING( "CMPMServer::IsModeGSM Mode is GSM" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
            return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
        else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1446
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1447
            MPMLOGSTRING( "CMPMServer::IsModeGSM Mode is not GSM" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
            return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
    MPMLOGSTRING( "CMPMServer::IsModeGSM phone.tsy not loaded" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
    return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1454
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1455
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
// CMPMServer::IsDTMSupported
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1458
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1459
// Checks if phone supports Dual Transfer Mode or not.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
// Return ETrue if phone supports DTM.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
// Return EFalse if phone does not support DTM.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1462
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1463
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
TBool CMPMServer::IsDTMSupported() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1465
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1466
    MPMLOGSTRING( "CMPMServer::IsDTMSupported" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1467
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1468
    if ( iPacketServLoaded )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1469
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1470
        TBool rv = iDtmWatcher->IsInDualMode();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1471
        if ( rv )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
            MPMLOGSTRING( "CMPMServer::IsDTMSupported DTM is supported" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
        else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1476
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1477
            MPMLOGSTRING( "CMPMServer::IsDTMSupported DTM is not supported" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1478
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1479
        return rv;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1480
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1481
 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1482
    MPMLOGSTRING( "CMPMServer::IsDTMSupported Packet service not loaded" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
    return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1487
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1488
// CMPMServer::DumpActiveBMConns
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1489
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1491
void CMPMServer::DumpActiveBMConns()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1492
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1493
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1494
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1495
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1496
    MPMLOGSTRING( "Display array of active connections - Start" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
    MPMLOGSTRING( "" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1499
    if ( iActiveBMConns.Count() == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1500
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
        MPMLOGSTRING( "Array of active connections is empty" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1502
        MPMLOGSTRING( "" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1503
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
    for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
        MPMLOGSTRING3( "Connection Id = 0x%x Snap = %i", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1508
            iActiveBMConns[i].iConnInfo.iConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
            iActiveBMConns[i].iConnInfo.iSnap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
        switch( iActiveBMConns[i].iConnInfo.iState )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1513
            case EStarting:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1515
                MPMLOGSTRING2( "IAP %i: Connection state = Starting", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1516
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1518
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
            case EStarted:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1520
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1521
                MPMLOGSTRING2( "IAP %i: Connection state = Started", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1522
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1523
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1524
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1525
            case EIdle:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1526
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1527
                MPMLOGSTRING2( "IAP %i: Connection state = Idle", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1528
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1529
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1530
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1531
            case ERoaming:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1533
                MPMLOGSTRING2( "IAP %i: Connection state = Roaming", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1534
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1536
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1537
            default:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1539
                MPMLOGSTRING2( "IAP %i: Unknown connection state", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1540
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1541
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1543
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1544
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
        MPMLOGSTRING( "" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1546
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1547
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1548
    MPMLOGSTRING( "Display array of active connections - End" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1549
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1550
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1552
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1553
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1554
// CMPMServer::DefaultConnection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1555
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1556
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1557
CMPMDefaultConnection* CMPMServer::DefaultConnection()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1558
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1559
    MPMLOGSTRING( "CMPMServer::DefaultConnection:\
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1560
 Default Connection" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1561
    return iDefaultConnection;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1562
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1563
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1564
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1565
// CMPMServer::StartedConnectionExists
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1566
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1567
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1568
TInt CMPMServer::StartedConnectionExists( TInt aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1569
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1570
    MPMLOGSTRING( "CMPMServer::StartedConnectionExists" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1571
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1572
    // Loop all connections until EStarted is found or no more connections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1573
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1574
    for ( TInt i = 0; ( i < iActiveBMConns.Count() ); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1575
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1576
        if ( iActiveBMConns[i].iConnInfo.iState == EStarted &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1577
                ( aIapId == KErrNotFound || aIapId == iActiveBMConns[i].iConnInfo.iIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1578
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
            MPMLOGSTRING( "CMPMServer::StartedConnectionExists: True" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1580
            return iActiveBMConns[i].iConnInfo.iIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1581
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1582
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
    // Modem connection may exist, check from connection counter
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1584
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
    if ( ConnectionCounter() > 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1586
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
        MPMLOGSTRING( "CMPMServer::StartedConnectionExists: True (modem connection)" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
        return KMaxTInt; // arbitrary high number that is NOT from Iap range[0:255] 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1591
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
        MPMLOGSTRING( "CMPMServer::StartedConnectionExists: False" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1593
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1594
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1595
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1596
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1598
// CMPMServer::AppendWlanQueryQueueL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1599
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1600
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1601
void CMPMServer::AppendWlanQueryQueueL( CMPMWlanQueryDialog* aDlg )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1602
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1603
    if( aDlg )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1604
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1605
        iWlanQueryQueue->AppendL( aDlg );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1606
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1607
    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1608
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1609
        MPMLOGSTRING( "CMPMServer::AppendWlanQueryQueueL argument NULL, Error" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1610
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1611
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1612
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1613
// -----------------------------------------------------------------------------
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1614
// CMPMServer::StopConnections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1615
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1616
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1617
void CMPMServer::StopConnections( TInt aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1618
    {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1619
    MPMLOGSTRING2( "CMPMServer::StopConnections aIapId = %d", aIapId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1620
    for (TInt index = 0; index < iSessions.Count(); index++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1621
        {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1622
        CMPMServerSession* session = iSessions[index];
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1623
        // Stop connection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1624
        if ( aIapId == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
            {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1626
            session->StopConnection();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1627
            }
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1628
        else if ( GetBMIap( session->ConnectionId() ) == aIapId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
            {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1630
            TRAP_IGNORE( session->StopIAPNotificationL( aIapId ));
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1631
            }     
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1632
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1633
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1635
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1636
// CMPMServer::UpdateActiveConnection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1637
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1638
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1639
void CMPMServer::UpdateActiveConnection( CMPMServerSession& aSession )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1640
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1641
    // Update active connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1642
    TInt ret = KErrNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1643
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1644
    TRAP ( ret, UpdateActiveConnectionL( aSession ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1645
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1646
    if ( ret != KErrNone )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1647
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1648
        iActiveBearerType = EMPMBearerTypeNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1649
        iActiveIapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1650
        iActiveSnapId = 0;            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1651
        }   
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1652
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1653
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1654
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1655
// CMPMServer::UpdateActiveConnectionL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1656
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1657
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1658
void CMPMServer::UpdateActiveConnectionL( CMPMServerSession& aSession )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1659
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1660
    MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1661
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1662
    TBool keysUpToDate( ETrue );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1663
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1664
    // number of active iaps
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1665
    TInt numberOfActive = NumberOfActiveConnections( keysUpToDate );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1666
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1667
    if ( numberOfActive == 0 )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1668
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1669
        // If no active connections then just reset keys and publish
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1670
        iActiveBearerType = EMPMBearerTypeNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1671
        iActiveIapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1672
        iActiveSnapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1673
        PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1674
        return;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1675
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1676
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1677
    if ( keysUpToDate )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1678
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1679
        MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL: already up-to-date" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1680
        return;   
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1681
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1682
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1683
    if ( numberOfActive > 1 )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1684
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1685
        // Check if all active connections are in same snap
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1686
        TUint32 snapId;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1687
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1688
        if ( CommsDatAccess()->AreActiveIapsInSameSnapL(
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1689
             iActiveBMConns, snapId, *this ) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1690
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1691
            MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL: Active iaps are in one SNAP" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1692
            // Select active connection according to priority
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1693
            CommsDatAccess()->SelectActiveConnectionL (
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1694
                snapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1695
                iActiveBMConns,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1696
                iActiveIapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1697
                iActiveSnapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1698
                iActiveBearerType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1699
                aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1700
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1701
            PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1702
            return;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1703
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1704
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1705
        MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL: Active iaps are in different SNAPs" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1706
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1707
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1708
    // Reset active connections
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1709
    iActiveBearerType = EMPMBearerTypeNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1710
    iActiveIapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1711
    iActiveSnapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1712
                
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1713
    // Active connections locating in different snaps
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1714
    // Use priority order vpn, wlan and packet
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1715
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1716
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1717
        CMPMServerSession* serverSession = GetServerSession(
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1718
            iActiveBMConns[index].iConnInfo.iConnId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1719
                     	
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1720
        // Do check only for active connections
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1721
        if ( iActiveBMConns[index].iConnInfo.iState == EStarted &&
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1722
        	   serverSession->ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1723
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1724
            TMPMBearerType bearerType = EMPMBearerTypeOther;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1725
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1726
            TInt ret = iDedicatedClients.Find( iActiveBMConns[index].iConnInfo.iAppUid );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1727
            if ( ret != KErrNotFound )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1728
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1729
                // Skip dedicated client
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1730
                MPMLOGSTRING2( "Skip dedicated client = %d", iActiveBMConns[index].iConnInfo.iAppUid )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1731
                continue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1732
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1733
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1734
            bearerType = CommsDatAccess()->GetBearerTypeL( 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1735
                         iActiveBMConns[index].iConnInfo.iIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1736
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1737
            if ( bearerType == EMPMBearerTypeOther )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1738
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1739
                // Don't publish this connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1740
                continue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1741
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1742
                    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1743
            // This is true if,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1744
            // bearer type is smaller or different than none
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1745
            // or
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1746
            // bearer type is same and iap is different.
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1747
            if ( ( bearerType < iActiveBearerType ) || 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1748
                 ( iActiveBearerType == EMPMBearerTypeNone ) ||
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1749
                 ( ( bearerType == iActiveBearerType) &&
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1750
                   ( iActiveIapId != iActiveBMConns[index].iConnInfo.iIapId ) ) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1751
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1752
                iActiveBearerType = bearerType;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1753
                iActiveIapId = iActiveBMConns[index].iConnInfo.iIapId;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1754
                iActiveSnapId = iActiveBMConns[index].iConnInfo.iSnap;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1755
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1756
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1757
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1758
    PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1759
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1760
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1761
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1762
// CMPMServer::MapBearerType
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1763
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1764
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1765
TUint32 CMPMServer::MapBearerType(TMPMBearerType aBearerType)
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1766
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1767
    MPMLOGSTRING( "CMPMServer::MapBearerType" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1768
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1769
    switch ( aBearerType )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1770
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1771
        case EMPMBearerTypeNone:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1772
            return 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1773
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1774
        case EMPMBearerTypeVpn:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1775
            return KCommDbBearerVirtual;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1776
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1777
        case EMPMBearerTypeWlan:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1778
            return KCommDbBearerWLAN;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1779
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1780
        case EMPMBearerTypePacketData:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1781
            return KCommDbBearerWcdma;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1782
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1783
        case EMPMBearerTypeOther:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1784
            return KCommDbBearerUnknown;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1785
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1786
        default:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1787
            MPMLOGSTRING( "CMPMServer::MapBearerType: Unknown bearer type" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1788
            break;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1789
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1790
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1791
    return KCommDbBearerUnknown;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1792
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1793
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1794
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1795
// CMPMServer::PublishActiveConnection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1796
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1797
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1798
void CMPMServer::PublishActiveConnection()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1799
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1800
    MPMLOGSTRING( "CMPMServer::PublishActiveConnection" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1801
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1802
    // update active connection keys
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1803
    RProperty::Set( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1804
                    KMPMPSKeyActiveConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1805
                    iActiveIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1806
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1807
    RProperty::Set( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1808
                    KMPMPSKeyActiveConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1809
                    iActiveSnapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1810
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1811
    RProperty::Set( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1812
                    KMPMPSKeyActiveConnectionBearer,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1813
                    MapBearerType( iActiveBearerType ) );    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1814
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1815
    MPMLOGSTRING4( "CMPMServer::PublishActiveConnection: Set to: %d, %d, %d",
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1816
                   iActiveIapId, iActiveSnapId, iActiveBearerType )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1817
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1818
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1819
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1820
// CMPMServer::NumberOfActiveConnections
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1821
// Returns number of active iaps.
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1822
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1823
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1824
TInt CMPMServer::NumberOfActiveConnections( TBool& aKeysUpToDate )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1825
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1826
    MPMLOGSTRING( "CMPMServer::NumberOfActiveConnections" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1827
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1828
    aKeysUpToDate = ETrue; 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1829
    TInt count( 0 );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1830
    RArray<TUint32> activeIaps;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1831
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1832
    activeIaps.Reset();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1833
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1834
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1835
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1836
        CMPMServerSession* serverSession = GetServerSession(
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1837
             iActiveBMConns[index].iConnInfo.iConnId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1838
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1839
        if ( iActiveBMConns[index].iConnInfo.iState == EStarted &&
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1840
             serverSession->ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1841
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1842
            TInt ret = activeIaps.Find( iActiveBMConns[index].iConnInfo.iIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1843
 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1844
            if ( ret == KErrNotFound )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1845
                {        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1846
                activeIaps.Append ( iActiveBMConns[index].iConnInfo.iIapId ); 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1847
                count++;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1848
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1849
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1850
            if ( iActiveIapId != iActiveBMConns[index].iConnInfo.iIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1851
                 {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1852
                 // iap that is different from current active iap was found
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1853
                 aKeysUpToDate = EFalse;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1854
                 }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1855
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1856
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1857
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1858
    activeIaps.Close();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1859
    MPMLOGSTRING2( "CMPMServer::NumberOfActiveConnections: count = %d", count )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1860
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1861
    return count;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1862
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1863
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1864
// -----------------------------------------------------------------------------
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1865
// CMPMServer::UserConnectionInInternet
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1866
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1867
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1868
TBool CMPMServer::UserConnectionInInternet() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1869
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1870
    TBool isInternet = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1871
    TInt ret = KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1872
        
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1873
    TRAP( ret, isInternet = iCommsDatAccess->IsInternetSnapL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1874
          UserConnPref()->IapId(), UserConnPref()->SnapId() ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1875
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1876
    if ( ret != KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1877
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1878
        isInternet = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1879
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1880
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1881
    return isInternet;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1882
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1883
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1884
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1885
// CMPMServer::StartForcedRoamingToWlanL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1886
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1887
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1888
void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1889
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1890
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1891
 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1892
    // Copy all available wlan iap ids to own array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1893
    RArray<TUint32> wlanIapIds;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1894
    CleanupClosePushL( wlanIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1895
    RAvailableIAPList iapList;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1896
    CleanupClosePushL( iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1897
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  1898
    for ( TUint index = 0; index < aIapInfo.iCount; index++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1899
        {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1900
        TWlanIapType iapType ( ENotWlanIap );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1901
        TRAPD (leave, iapType = CommsDatAccess()->CheckWlanL( aIapInfo.iIap[index].iIapId ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1902
        if ( ( iapType != ENotWlanIap ) && ( leave == KErrNone ) )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1903
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1904
            // Accept only wlan iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1905
            if ( iCommsDatAccess->IsInternetSnapL( aIapInfo.iIap[index].iIapId, 0 ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1906
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1907
                wlanIapIds.AppendL( aIapInfo.iIap[index].iIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1908
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1909
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1910
        // Fill iap list to be used later to check best iap;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1911
        if ( leave == KErrNone )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1912
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1913
            iapList.AppendL( aIapInfo.iIap[index].iIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1914
            }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1915
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1916
    // No wlans available -> no reason to continue
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1917
    if ( !wlanIapIds.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1918
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1919
        CleanupStack::PopAndDestroy( &iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1920
        CleanupStack::PopAndDestroy( &wlanIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1921
        return;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1922
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1923
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1924
    // Go through all active connections and start roaming for the ones connected
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1925
    // to snap containing wlan and not using mobility api
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1926
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1927
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1928
        // Check if snap is internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1929
        TBool internetSnap =
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1930
            iCommsDatAccess->IsInternetSnapL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1931
                iActiveBMConns[index].iConnInfo.iIapId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1932
                iActiveBMConns[index].iConnInfo.iSnap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1933
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1934
        CMPMServerSession* serverSession = GetServerSession(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1935
                iActiveBMConns[index].iConnInfo.iConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1936
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1937
        // Check that connection is started, established to snap and
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1938
        // choose best iap is called for the connection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1939
        if ( ( iActiveBMConns[index].iConnInfo.iState == EStarted ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1940
             ( iActiveBMConns[index].iConnInfo.iSnap ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1941
             ( serverSession->ChooseBestIapCalled() ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1942
             ( internetSnap ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1943
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1944
            // Notify client to disconnect
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1945
            NotifyDisconnectL( index, wlanIapIds, iapList, ETrue,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1946
                EMPMBearerTypeWlan );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1947
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1948
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1949
    CleanupStack::PopAndDestroy( &iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1950
    CleanupStack::PopAndDestroy( &wlanIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1951
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1952
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1953
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1954
// ---------------------------------------------------------------------------
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1955
// CMPMServer::StartForcedRoamingToConnectedWlanL
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1956
// ---------------------------------------------------------------------------
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1957
//    
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1958
TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1959
    {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1960
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1961
    CMPMServer* self = static_cast<CMPMServer*>( aUpdater );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1962
    if ( self )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1963
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1964
        // cancel the periodic object        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1965
        self->iRoamingToWlanPeriodic->Cancel();
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1966
        TRAPD( error, self->StartForcedRoamingToWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1967
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1968
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1969
            MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error1 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1970
            return 0;
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1971
            }
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1972
            
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  1973
        // Added also execution of policy based roaming logic because
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  1974
        // connections that are in EStarting state, when WLAN signal
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  1975
        // gets weak, would remain in WLAN as long as signal is weak. 
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1976
        TRAP( error, self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1977
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1978
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1979
            MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error2 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1980
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1981
        }
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1982
    return 0;
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1983
    }
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1984
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1985
// ---------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1986
// CMPMServer::StartForcedRoamingToConnectedHotspotWlanL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1987
// ---------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1988
//    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1989
TInt CMPMServer::StartForcedRoamingToConnectedHotspotWlanL( TAny* aUpdater )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1990
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1991
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedHotspotWlanL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1992
    CMPMServer* self = static_cast<CMPMServer*>( aUpdater );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1993
    if ( self )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1994
        {        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1995
        // cancel the periodic object
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1996
        self->iRoamingToHotspotWlanPeriodic->Cancel();
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1997
        TRAPD( error, self->StartForcedRoamingToWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1998
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1999
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2000
            MPMLOGSTRING2("StartForcedRoamingToConnectedHotspotWlanL error1 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2001
            return 0;
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2002
            }
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2003
            
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2004
        // Added also execution of policy based roaming logic because
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2005
        // connections that are in EStarting state, when WLAN signal
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2006
        // gets weak, would remain in WLAN as long as signal is weak. 
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2007
        TRAP( error, self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2008
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2009
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2010
            MPMLOGSTRING2("StartForcedRoamingToConnectedHotspotWlanL error2 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2011
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2012
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2013
    return 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2014
    }
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  2015
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2016
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2017
// CMPMServer::StartForcedRoamingFromWlanL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2018
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2019
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2020
void CMPMServer::StartForcedRoamingFromWlanL( const TConnMonIapInfo& aIapInfo )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2021
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2022
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingFromWlan" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2023
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2024
    // Copy all available packet data iap ids to own array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2025
    RArray<TUint32> packetDataIapIds;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2026
    CleanupClosePushL( packetDataIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2027
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2028
    for ( TUint index = 0; index < aIapInfo.iCount; index++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2029
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2030
        if ( CommsDatAccess()->GetBearerTypeL( aIapInfo.iIap[index].iIapId ) ==
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2031
            EMPMBearerTypePacketData )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2032
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2033
            // Accept only packet data iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2034
            if ( iCommsDatAccess->IsInternetSnapL( aIapInfo.iIap[index].iIapId, 0 ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2035
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2036
                packetDataIapIds.AppendL( aIapInfo.iIap[index].iIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2037
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2038
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2039
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2040
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2041
    // No packet data iaps available -> no reason to continue
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2042
    if ( !packetDataIapIds.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2043
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2044
        CleanupStack::PopAndDestroy( &packetDataIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2045
        return;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2046
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2047
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2048
    // Go through all active connections and start roaming for the ones connected
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2049
    // to a wlan not anymore listed in available iaps and not using mobility api
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2050
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2051
        {
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2052
        TWlanIapType iapType( ENotWlanIap );
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2053
        TRAPD( leave, iapType = iCommsDatAccess->CheckWlanL( iActiveBMConns[index].iConnInfo.iIapId ) )        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2054
        if ( ( leave == KErrNone ) && ( iapType == EWlanIap ) )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2055
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2056
            // Check if used WLAN is still available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2057
            TBool currentWlanIapAvailable = EFalse;
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2058
            for ( TUint iapIndex = 0; iapIndex < aIapInfo.iCount; iapIndex++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2059
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2060
                if ( aIapInfo.iIap[iapIndex].iIapId ==
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2061
                    iActiveBMConns[index].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2062
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2063
                    // Current WLAN IAP found from list of available IAPs
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2064
                    currentWlanIapAvailable = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2065
                    break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2066
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2067
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2068
            
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2069
            if ( !currentWlanIapAvailable )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2070
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2071
                // Current WLAN not available anymore
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2072
                // Check if snap is internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2073
                TBool internetSnap = iCommsDatAccess->IsInternetSnapL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2074
                    iActiveBMConns[index].iConnInfo.iIapId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2075
                    iActiveBMConns[index].iConnInfo.iSnap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2076
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2077
                CMPMServerSession* serverSession = GetServerSession(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2078
                    iActiveBMConns[index].iConnInfo.iConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2079
                
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2080
                // Check that connection is started, established to snap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2081
                // choose best iap is called for the connection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2082
                if ( ( iActiveBMConns[index].iConnInfo.iState == EStarted ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2083
                    ( iActiveBMConns[index].iConnInfo.iSnap ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2084
                    ( serverSession->ChooseBestIapCalled() ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2085
                    ( internetSnap ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2086
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2087
                    // Notify client to disconnect, don't check if current
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2088
                    // WLAN IAP is the best because we want to disconnect
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2089
                    // it anyway (it was not included in available IAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2090
                    // list anymore)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2091
                    RAvailableIAPList iapList;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2092
                    CleanupClosePushL( iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2093
                    NotifyDisconnectL( index, packetDataIapIds, iapList, EFalse,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2094
                        EMPMBearerTypePacketData );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2095
                    CleanupStack::PopAndDestroy( &iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2096
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2097
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2098
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2099
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2100
    CleanupStack::PopAndDestroy( &packetDataIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2101
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2102
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2103
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2104
// CMPMServer::NotifyDisconnectL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2105
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2106
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2107
void CMPMServer::NotifyDisconnectL( TInt aConnIndex,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2108
                                    RArray<TUint32>& aAvailIapIds,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2109
                                    RAvailableIAPList& aIapList,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2110
                                    TBool aCheckForBestIap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2111
                                    TMPMBearerType aDestinationBearerType )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2112
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2113
    MPMLOGSTRING( "CMPMServer::NotifyDisconnectL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2114
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2115
    // Get iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2116
    RArray<TNetIap> destNetIds;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2117
    CleanupClosePushL( destNetIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2118
    CommsDatAccess()->SearchDNEntriesL( iActiveBMConns[aConnIndex].iConnInfo.iSnap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2119
                                        destNetIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2120
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2121
    // Save available iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2122
    RArray<TUint32> iapIdsInInternet;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2123
    CleanupClosePushL( iapIdsInInternet );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2124
                        
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2125
    for ( TInt iIndex = 0; iIndex < destNetIds.Count(); iIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2126
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2127
        for ( TInt wIndex = 0; wIndex < aAvailIapIds.Count(); wIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2128
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2129
            if ( destNetIds[iIndex].iIapId == aAvailIapIds[wIndex] )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2130
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2131
                iapIdsInInternet.AppendL( destNetIds[iIndex].iIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2132
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2133
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2134
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2135
                    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2136
        if ( iapIdsInInternet.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2137
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2138
            // Leave loop when count is non-zero
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2139
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2140
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2141
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2142
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2143
    // Check if an iap in internet snap is available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2144
    if ( iapIdsInInternet.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2145
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2146
        // Find session and notify error
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2147
        for (TInt sIndex = 0; sIndex < iSessions.Count(); sIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2148
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2149
            // Check that CMPMIapSelection object exists for the session.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2150
            TRAPD( error, iSessions[sIndex]->IapSelectionL() );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2151
            if ( error == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2152
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2153
                MPMLOGSTRING( "CMPMServer::NotifyDisconnectL: IapSelectionL() != NULL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2154
                // Check the connection preferences for forced roaming
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2155
                if ( iSessions[sIndex]->ForcedRoaming() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2156
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2157
                    MPMLOGSTRING( "CMPMServer::NotifyDisconnectL: ForcedRoaming == ETrue" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2158
                    // Notify disconnect error for session,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2159
                    // if mobility api is not used
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2160
                    if ( ( iSessions[sIndex]->ConnectionId() ==
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2161
                        iActiveBMConns[aConnIndex].iConnInfo.iConnId ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2162
                        !iSessions[sIndex]->PreferredIapRequested() &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2163
                        iSessions[sIndex]->IsBearerAccepted( aDestinationBearerType ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2164
                        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2165
                        if ( aCheckForBestIap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2166
                            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2167
                            // Check whether current IAP and the best IAP are the same.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2168
                            // Disconnection not done if IAPs are the same   
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2169
                            TMpmConnPref connPref;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2170
                            connPref.SetIapId( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2171
                            connPref.SetSnapId(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2172
                                iActiveBMConns[aConnIndex].iConnInfo.iSnap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2173
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2174
                            iSessions[sIndex]->IapSelectionL()->ChooseBestIAPL( connPref, aIapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2175
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2176
                            // if the best iap is the current iap, don't roam, move to next item
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2177
                            if ( ( aIapList.Count() > 0 ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2178
                                ( connPref.IapId() == iActiveBMConns[aConnIndex].iConnInfo.iIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2179
                                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2180
                                MPMLOGSTRING( "CMPMServer::NotifyDisconnectL: Same IAP selected. Disconnection not done." )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2181
                                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2182
                                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2183
                            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2184
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2185
                        MPMLOGSTRING2( "CMPMServer::NotifyDisconnectL: \
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2186
Disconnected Connection Id = 0x%x", iSessions[sIndex]->ConnectionId() )
12
ea6e024ea6f9 Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 8
diff changeset
  2187
                        iSessions[sIndex]->ClientErrorNotificationL( KErrForceDisconnected );
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2188
                        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2189
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2190
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2191
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2192
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2193
            
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2194
    CleanupStack::PopAndDestroy( &iapIdsInInternet );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2195
    CleanupStack::PopAndDestroy( &destNetIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2196
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2197
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2198
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2199
// CMPMServer::IsVisitorNetwork
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2200
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2201
// Checks if phone is in visitor network or in home network.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2202
// Return ETrue if phone is in visitor network.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2203
// Return EFalse if phone is not in visitor network.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2204
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2205
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2206
TBool CMPMServer::IsVisitorNetwork() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2207
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2208
    MPMLOGSTRING( "CMPMServer::IsVisitorNetwork" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2209
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2210
    if ( iRoamingWatcher->RoamingStatus()== EMPMInternationalRoaming )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2211
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2212
        MPMLOGSTRING( "CMPMServer::IsVisitorNetwork: TRUE" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2213
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2214
        } 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2215
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2216
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2217
        MPMLOGSTRING( "CMPMServer::IsVisitorNetwork: FALSE" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2218
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2219
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2220
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2221
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2222
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2223
// CMPMServer::GetServerSession
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2224
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2225
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2226
CMPMServerSession* CMPMServer::GetServerSession( TConnectionId aConnId ) const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2227
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2228
    MPMLOGSTRING2( "CMPMServer::GetServerSession: \
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2229
Connection Id = 0x%x", aConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2230
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2231
    CMPMServerSession* serverSession = NULL;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2232
    for ( TInt sIndex = 0; sIndex < iSessions.Count(); sIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2233
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2234
        if ( iSessions[sIndex]->ConnectionId() == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2235
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2236
            serverSession = iSessions[sIndex];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2237
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2238
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2239
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2240
    ASSERT( serverSession != NULL );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2241
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2242
    return serverSession;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2243
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2244
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2245
// ---------------------------------------------------------------------------
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2246
// CMPMServer::StopCellularConns
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2247
// Stop all cellular connections except MMS
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2248
// ---------------------------------------------------------------------------
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2249
//
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2250
void CMPMServer::StopCellularConns( TBool aSilentOnly )
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2251
    {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2252
    MPMLOGSTRING( "CMPMServer::StopCellularConns" )
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2253
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2254
    TUint32 iapId;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2255
	TMPMBearerType bearerType = EMPMBearerTypeNone;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2256
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2257
	// No cleanup stack used cause this function doesn't leave.
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2258
    RArray<TUint32> stoppedIaps;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2259
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2260
    // Check through active connections
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2261
    for (TInt i = 0; i < iActiveBMConns.Count(); i++)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2262
        {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2263
        iapId = iActiveBMConns[i].iConnInfo.iIapId;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2264
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2265
        // Don't stop the same IAP twice.
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2266
        if (stoppedIaps.Find( iapId ) == KErrNotFound)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2267
            {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2268
            TRAPD( err, bearerType = CommsDatAccess()->GetBearerTypeL( iapId ) );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2269
            if (err == KErrNone &&
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2270
                    iapId != 0 &&
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2271
                    bearerType == EMPMBearerTypePacketData)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2272
                {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2273
                TInt mmsIap( 0 );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2274
                err = RProperty::Get( KMPMCathegory, KMPMPropertyKeyMMS, mmsIap );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2275
                // Check that it's not MMS IAP.
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2276
                if (!(err == KErrNone && iapId == mmsIap))
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2277
                    {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2278
                    // Stop the conn / IAP.
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2279
                    if ( aSilentOnly )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2280
                        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2281
                        CheckIapForDisconnect( iapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2282
                        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2283
                    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2284
                        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2285
                        StopConnections( iapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2286
                        }
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2287
                    stoppedIaps.Append( iapId );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2288
                    }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2289
                }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2290
            }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2291
        }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2292
    stoppedIaps.Close();
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2293
    }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2294
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2295
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2296
// CMPMServer::UpdateOfflineMode
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2297
// Offline watcher listens the offline mode and calls this when it's changed.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2298
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2299
//
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2300
void CMPMServer::UpdateOfflineMode( TInt newModeValue )
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2301
    {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2302
    MPMLOGSTRING2( "CMPMServer::UpdateOfflineMode: Value %d", newModeValue )
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2303
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2304
    iOfflineMode = newModeValue;
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2305
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2306
    if ( iOfflineMode == ECoreAppUIsNetworkConnectionAllowed )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2307
        {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2308
        // Offline mode finished, reset the QueryResponse variable.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2309
        iOfflineWlanQueryResponse = EOfflineResponseUndefined;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2310
        }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2311
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2312
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2313
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2314
// CMPMServer::IsPhoneOffline
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2315
// Returns the current offline mode.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2316
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2317
//
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2318
TBool CMPMServer::IsPhoneOffline()
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2319
    {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2320
    MPMLOGSTRING( "CMPMServer::IsPhoneOffline" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2321
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2322
    TBool retval = EFalse;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2323
    if ( iOfflineMode == ECoreAppUIsNetworkConnectionNotAllowed)
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2324
        {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2325
        retval = ETrue;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2326
        MPMLOGSTRING( "CMPMServer::IsPhoneOffline: Yes." )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2327
        }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2328
    return retval;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2329
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2330
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2331
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2332
// CMPMServer::OfflineWlanQueryResponse
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2333
// Tells the "Use WLAN in offline mode" query's response during the
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2334
// current offline mode session.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2335
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2336
//
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2337
TOfflineWlanQueryResponse CMPMServer::OfflineWlanQueryResponse()
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2338
    {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2339
    MPMLOGSTRING( "CMPMServer::OfflineWlanQueryResponse" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2340
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2341
#ifndef _PLATFORM_SIMULATOR_
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2342
    MPMLOGSTRING2( "CMPMServer::IsOfflineWlanQueryAccepted: %d", iOfflineWlanQueryResponse )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2343
    return iOfflineWlanQueryResponse;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2344
#else
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2345
    // Platsim simulates WLAN and offline-mode. To ease automated testing,
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2346
    // offline connection confirmation is not asked in Platsim-variant
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2347
    MPMLOGSTRING( "CMPMServer::OfflineWlanQueryResponse: yes for Platsim" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2348
    return EOfflineResponseYes;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2349
#endif
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2350
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2351
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2352
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2353
// CMPMServer::SetOfflineWlanQueryResponse
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2354
// Called when the "Use WLAN in offline mode" note has been responded.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2355
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2356
//
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2357
void CMPMServer::SetOfflineWlanQueryResponse( TOfflineWlanQueryResponse aResponse)
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2358
    {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2359
    MPMLOGSTRING( "CMPMServer::SetOfflineWlanQueryResponse" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2360
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2361
    iOfflineWlanQueryResponse = aResponse;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2362
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2363
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2364
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2365
// CMPMServer::StartConnPermQueryTimer
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2366
// Starts the connection permission query timer.
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2367
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2368
//
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2369
void CMPMServer::StartConnPermQueryTimer()
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2370
    {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2371
    MPMLOGSTRING( "CMPMServer::StartConnPermQueryTimer" )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2372
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2373
    if ( !iConnPermQueryTimer )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2374
        {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2375
        TRAPD( err, iConnPermQueryTimer = CMPMConnPermQueryTimer::NewL( this ) );
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2376
        if ( err == KErrNone )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2377
            {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2378
            iConnPermQueryTimer->StartTimer();
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2379
            MPMLOGSTRING( "CMPMServer::StartConnPermQueryTimer: Ok." )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2380
            }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2381
        }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2382
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2383
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2384
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2385
// CMPMServer::ResetConnPermQueryTimer
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2386
// Resets the connection permission query timer.
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2387
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2388
//
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2389
void CMPMServer::ResetConnPermQueryTimer()
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2390
    {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2391
    MPMLOGSTRING( "CMPMServer::ResetConnPermQueryTimer" )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2392
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2393
    if ( iConnPermQueryTimer )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2394
        {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2395
        delete iConnPermQueryTimer;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2396
        iConnPermQueryTimer = NULL;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2397
        MPMLOGSTRING( "CMPMServer::ResetConnPermQueryTimer: Ok." )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2398
        }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2399
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2400
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2401
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2402
// CMPMServer::IsConnPermQueryTimerOn
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2403
// Tells if the connection permission query timer is on.
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2404
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2405
//
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2406
TBool CMPMServer::IsConnPermQueryTimerOn()
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2407
    {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2408
    MPMLOGSTRING( "CMPMServer::IsConnPermQueryTimerOn" )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2409
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2410
    TBool retval = EFalse;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2411
    if ( iConnPermQueryTimer )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2412
        {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2413
        retval = ETrue;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2414
        MPMLOGSTRING( "CMPMServer::IsConnPermQueryTimerOn: Yes." )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2415
        }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2416
    return retval;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2417
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2418
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2419
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2420
// CMPMServer::StartOfflineQueryTimer
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2421
// Starts the offline query timer.
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2422
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2423
//
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2424
void CMPMServer::StartOfflineQueryTimer()
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2425
    {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2426
    MPMLOGSTRING( "CMPMServer::StartOfflineQueryTimer" )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2427
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2428
    if ( !iOfflineQueryTimer )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2429
        {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2430
        TRAPD( err, iOfflineQueryTimer = CMPMOfflineQueryTimer::NewL( this ) );
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2431
        if ( err == KErrNone )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2432
            {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2433
            iOfflineQueryTimer->StartTimer();
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2434
            MPMLOGSTRING( "CMPMServer::StartOfflineQueryTimer: Ok." )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2435
            }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2436
        }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2437
    }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2438
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2439
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2440
// CMPMServer::ResetOfflineQueryTimer
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2441
// Resets the offline query timer.
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2442
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2443
//
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2444
void CMPMServer::ResetOfflineQueryTimer()
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2445
    {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2446
    MPMLOGSTRING( "CMPMServer::ResetOfflineQueryTimer" )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2447
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2448
    if ( iOfflineQueryTimer )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2449
        {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2450
        delete iOfflineQueryTimer;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2451
        iOfflineQueryTimer = NULL;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2452
        MPMLOGSTRING( "CMPMServer::ResetOfflineQueryTimer: Ok." )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2453
        }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2454
    }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2455
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2456
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2457
// CMPMServer::IsOfflineQueryTimerOn
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2458
// Tells if the offline query timer is on.
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2459
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2460
//
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2461
TBool CMPMServer::IsOfflineQueryTimerOn()
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2462
    {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2463
    MPMLOGSTRING( "CMPMServer::IsOfflineQueryTimerOn" )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2464
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2465
    TBool retval = EFalse;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2466
    if ( iOfflineQueryTimer )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2467
        {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2468
        retval = ETrue;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2469
        MPMLOGSTRING( "CMPMServer::IsOfflineQueryTimerOn: Yes." )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2470
        }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2471
    return retval;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2472
    }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2473
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2474
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2475
// CMPMServer::StartConnSelectionDlgTimer
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2476
// Starts the connection selection dialog timer.
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2477
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2478
//
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2479
void CMPMServer::StartConnSelectionDlgTimer()
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2480
    {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2481
    MPMLOGSTRING( "CMPMServer::StartConnSelectionDlgTimer" )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2482
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2483
    if ( !iConnSelectionDlgTimer )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2484
        {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2485
        TRAPD( err, iConnSelectionDlgTimer = CMPMConnSelectionDlgTimer::NewL( this ) );
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2486
        if ( err == KErrNone )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2487
            {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2488
            iConnSelectionDlgTimer->StartTimer();
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2489
            MPMLOGSTRING( "CMPMServer::StartConnSelectionDlgTimer: Ok." )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2490
            }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2491
        }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2492
    }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2493
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2494
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2495
// CMPMServer::ResetConnSelectionDlgTimer
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2496
// Resets the connection selection dialog timer.
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2497
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2498
//
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2499
void CMPMServer::ResetConnSelectionDlgTimer()
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2500
    {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2501
    MPMLOGSTRING( "CMPMServer::ResetConnSelectionDlgTimer" )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2502
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2503
    if ( iConnSelectionDlgTimer )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2504
        {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2505
        delete iConnSelectionDlgTimer;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2506
        iConnSelectionDlgTimer = NULL;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2507
        MPMLOGSTRING( "CMPMServer::ResetConnSelectionDlgTimer: Ok." )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2508
        }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2509
    }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2510
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2511
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2512
// CMPMServer::IsConnSelectionDlgTimerOn
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2513
// Tells if the connection selection dialog timer is on.
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2514
// ---------------------------------------------------------------------------
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2515
//
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2516
TBool CMPMServer::IsConnSelectionDlgTimerOn()
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2517
    {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2518
    MPMLOGSTRING( "CMPMServer::IsConnSelectionDlgTimerOn" )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2519
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2520
    TBool retval = EFalse;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2521
    if ( iConnSelectionDlgTimer )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2522
        {
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2523
        retval = ETrue;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2524
        MPMLOGSTRING( "CMPMServer::IsConnSelectionDlgTimerOn: Yes." )
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2525
        }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2526
    return retval;
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2527
    }
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2528
    
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2529
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2530
// CMPMServer::CheckIapForDisconnect
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2531
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2532
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2533
void CMPMServer::CheckIapForDisconnect( TInt aIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2534
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2535
    MPMLOGSTRING2( "CMPMServer::CheckIapForDisconnect - aIapId = 0x%x", 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2536
        aIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2537
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2538
    // Fix for case ou1cimx1#468999: stop sessions to cellular iap
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2539
    // when there is only silent connections to it, and cellular usage is set
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2540
    // to always ask
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2541
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2542
    // Check iap type and usage policy
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2543
    TMPMBearerType bearerType( EMPMBearerTypeNone );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2544
    TRAP_IGNORE( bearerType = CommsDatAccess()->GetBearerTypeL( aIapId ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2545
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2546
    TBool closeIap = ( bearerType == EMPMBearerTypePacketData
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2547
                && DataUsageWatcher()->CellularDataUsage() == ECmCellularDataUsageConfirm ); 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2548
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2549
    // No need to put iapSessions to CleanupStack; there are no leaves
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2550
    RPointerArray<CMPMServerSession> iapSessions;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2551
    if ( closeIap )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2552
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2553
        // Check for non-silent sessions to iap
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2554
        // closeIap is left true also when there are no sessions using the iap
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2555
        for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2556
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2557
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2558
            CMPMServerSession* session
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2559
                = GetServerSession( iActiveBMConns[i].iConnInfo.iConnId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2560
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2561
            TInt sessionIapId = iActiveBMConns[i].iConnInfo.iIapId;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2562
            if ( !sessionIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2563
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2564
                TRAP_IGNORE( sessionIapId = session->IapSelectionL()->MpmConnPref().IapId() );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2565
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2566
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2567
            if ( sessionIapId == aIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2568
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2569
                iapSessions.Append( session ); // Don't mind if Append fails
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2570
                
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2571
                TBool silent( ETrue );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2572
                TRAP_IGNORE( silent = session->IapSelectionL()->MpmConnPref().NoteBehaviour()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2573
                                      & TExtendedConnPref::ENoteBehaviourConnDisableNotes );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2574
                if ( !silent )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2575
                    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2576
                    // Non-silent session to iap found
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2577
                    closeIap = EFalse;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2578
                    break; // for
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2579
                    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2580
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2581
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2582
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2583
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2584
    if ( closeIap )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2585
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2586
        MPMLOGSTRING2( "CMPMServer::CheckIapForDisconnect - stopping silent sessions to iap 0x%x", 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2587
            aIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2588
        // Stop all (silent) sessions to iap
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2589
        for ( TInt i = 0; i < iapSessions.Count(); i++)
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2590
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2591
            MPMLOGSTRING2( "CMPMServer::CheckIapForDisconnect - stopping connId 0x%x",
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2592
                    iapSessions[i]->ConnectionId());
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2593
            iapSessions[i]->StopConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2594
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2595
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2596
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2597
    iapSessions.Close();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2598
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2599
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2600
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2601
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2602
// -----------------------------------------------------------------------------
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2603
// TMPMBlackListConnId::Append
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2604
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2605
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2606
void TMPMBlackListConnId::Append( TUint32 aIap, TBlacklistCategory aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2607
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2608
    iBlackListIap.Append( aIap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2609
    iCategory.Append( aCategory );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2610
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2611
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2612
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2613
// TMPMBlackListConnId::Remove
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2614
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2615
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2616
void TMPMBlackListConnId::Remove( TInt aIndex )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2617
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2618
    iBlackListIap.Remove( aIndex );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2619
    iCategory.Remove( aIndex );    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2620
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2621
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2622
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2623
// TMPMBlackListConnId::Close
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2624
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2625
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2626
void TMPMBlackListConnId::Close()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2627
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2628
    iBlackListIap.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2629
    iCategory.Close();    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2630
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2631
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2632
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2633
// TMPMBlackListConnId::Count
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2634
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2635
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2636
TInt TMPMBlackListConnId::Count() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2637
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2638
    return iBlackListIap.Count();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2639
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2640
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2641
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2642
// TConnectionInfo::TConnectionInfo
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2643
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2644
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2645
TConnectionInfo::TConnectionInfo() 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2646
    : iConnId( 0 ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2647
      iSnap( 0 ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2648
      iIapId( 0 ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2649
      iState( EIdle ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2650
      iAppUid( 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2651
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2652
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2653
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2654
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2655
// TConnectionInfo::MatchId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2656
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2657
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2658
TBool TConnectionInfo::MatchId( const TConnectionInfo& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2659
                                       const TConnectionInfo& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2660
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2661
    if ( aFirst.iConnId == aSecond.iConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2662
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2663
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2664
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2665
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2666
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2667
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2668
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2669
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2670
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2671
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2672
// TConnectionInfo::MatchIdSnap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2673
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2674
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2675
TBool TConnectionInfo::MatchIdSnap( const TConnectionInfo& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2676
                                    const TConnectionInfo& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2677
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2678
    if ( ( aFirst.iConnId  == aSecond.iConnId ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2679
         ( aFirst.iSnap    == aSecond.iSnap ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2680
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2681
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2682
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2683
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2684
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2685
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2686
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2687
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2688
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2689
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2690
// TActiveBMConn::TActiveBMConn
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2691
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2692
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2693
TActiveBMConn::TActiveBMConn() 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2694
    : iConnInfo()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2695
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2696
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2697
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2698
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2699
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2700
// TActiveBMConn::MatchIapId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2701
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2702
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2703
TBool TActiveBMConn::MatchIapId( const TActiveBMConn& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2704
                                 const TActiveBMConn& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2705
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2706
    if ( aFirst.iConnInfo.iIapId == aSecond.iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2707
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2708
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2709
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2710
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2711
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2712
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2713
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2714
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2715
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2716
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2717
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2718
// TActiveBMConn::MatchConnInfo
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2719
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2720
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2721
TBool TActiveBMConn::MatchConnInfo( const TActiveBMConn& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2722
                                    const TActiveBMConn& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2723
    { 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2724
    if ( TConnectionInfo::MatchId( aFirst.iConnInfo, aSecond.iConnInfo ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2725
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2726
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2727
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2728
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2729
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2730
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2731
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2732
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2733
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2734
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2735
//  End of File