convergedconnectionhandler/cchclientapi/cchuinotif/src/cchuinotifconnectionhandler.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:29:57 +0100
branchRCL_3
changeset 22 d38647835c2e
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  Provider access to SNAPs
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include <cmmanagerdef.h>
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include <cmpluginwlandef.h> // bearer type
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <cmdestinationext.h>
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <cmconnectionmethoddef.h>
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <cmconnectionmethodext.h>
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <cmpluginpacketdatadef.h>
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include "cchuilogger.h"
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include "cchuinotifconnectionhandler.h"
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
// ======== MEMBER FUNCTIONS ========
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
CCchUiNotifConnectionHandler::CCchUiNotifConnectionHandler()
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
void CCchUiNotifConnectionHandler::ConstructL()
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
    iCmManagerExt.OpenL();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
CCchUiNotifConnectionHandler* CCchUiNotifConnectionHandler::NewL()
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
    CCchUiNotifConnectionHandler* self = NewLC();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
    CleanupStack::Pop(self);
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
    return self;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
CCchUiNotifConnectionHandler* CCchUiNotifConnectionHandler::NewLC()
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
    CCchUiNotifConnectionHandler* self =
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
        new (ELeave) CCchUiNotifConnectionHandler();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
    CleanupStack::PushL(self);
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
    self->ConstructL();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
    return self;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
CCchUiNotifConnectionHandler::~CCchUiNotifConnectionHandler()
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
    iCmManagerExt.Close();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
// Gets GPRS access points from Internet SNAP
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
TUint32 CCchUiNotifConnectionHandler::GetGprsAccessPointsL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
    CDesCArray& aIaps, RArray<TUint32>& aIapIds )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
    {    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::GetGprsAccessPointsL - IN" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
    TUint32 internetSnapId = KErrNone;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
    RArray<TUint32> destIds = RArray<TUint32>( 1 );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    CleanupClosePushL( destIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    iCmManagerExt.AllDestinationsL( destIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
    for ( TInt index = 0 ; index < destIds.Count() ; index++ )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
        RCmDestinationExt refDestination = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
            iCmManagerExt.DestinationL( destIds[index] );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
        CleanupClosePushL( refDestination );    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
        if ( refDestination.MetadataL( CMManager::ESnapMetadataInternet ) )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
            // Get all GPRS access point from this destination
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
            GetGprsAccessPointsFromSnapL( aIaps, aIapIds, refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
            internetSnapId = refDestination.Id();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
        CleanupStack::PopAndDestroy( &refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
    CleanupStack::PopAndDestroy( &destIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::GetGprsAccessPointsL - OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
    return internetSnapId;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
    } 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
// Gets connection name.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
void CCchUiNotifConnectionHandler::ConnectionNameL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    TUint aIapId, TDesC& aServiceName, RBuf& aIapName )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    {    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::ConnectionNameL - IN" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    if ( aIapId )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
        RCmConnectionMethodExt connMethod = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
        iCmManagerExt.ConnectionMethodL( aIapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
        CleanupClosePushL( connMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
        HBufC* connName = connMethod.GetStringAttributeL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
            CMManager::ECmName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
        CleanupStack::PushL( connName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
                    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
        aIapName.CreateL( connName->Des().Length() );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
        aIapName.Copy( connName->Des() );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
                    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
        CleanupStack::PopAndDestroy( connName );              
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
        CleanupStack::PopAndDestroy( &connMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
    else
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
        RArray<TUint32> destinationIds;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
        CleanupClosePushL( destinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
        iCmManagerExt.AllDestinationsL( destinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
        for ( TInt i( 0 ) ; i < destinationIds.Count() ; i++ )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
            RCmDestinationExt dest = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
                iCmManagerExt.DestinationL( destinationIds[ i ] );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
            CleanupClosePushL( dest );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
            HBufC* destName = dest.NameLC();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
            if ( destName->Des().Compare( aServiceName ) == 0  )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
                {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
                // Get highest priority connecton method from snap
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
                RCmConnectionMethodExt cm = dest.ConnectionMethodL( 0 );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
                CleanupClosePushL( cm );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
                
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
                HBufC* cmName = NULL;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
                cmName = cm.GetStringAttributeL( CMManager::ECmName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
                
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
                if ( cmName )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
                    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
                    CleanupStack::PushL( cmName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
                    aIapName.CreateL( cmName->Des().Length() );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
                    aIapName.Copy( cmName->Des() );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
                    CleanupStack::PopAndDestroy( cmName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
                    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
                
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
                CleanupStack::PopAndDestroy( &cm );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
                }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
            
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
            CleanupStack::PopAndDestroy( destName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
            CleanupStack::PopAndDestroy( &dest );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
        CleanupStack::PopAndDestroy( &destinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    CCHUIDEBUG2( "ConnectionNameL - NAME=%S", &aIapName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
            "CCchUiNotifConnectionHandler::ConnectionNameL - OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
// Gets all but specified service´s destinations.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
void CCchUiNotifConnectionHandler::GetDestinationsL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    TDesC& aServiceName, RArray<TUint32>& aDestinationIds )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
    {  
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::GetDestinationsL - IN" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
    iCmManagerExt.AllDestinationsL( aDestinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
    // Remove our services destination from destination ids.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
    for ( TInt i( 0 ) ; i < aDestinationIds.Count() ; i++ )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
        RCmDestinationExt refDestination = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
        iCmManagerExt.DestinationL( aDestinationIds[ i ] );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
        CleanupClosePushL( refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
               
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
        HBufC* destName = refDestination.NameLC();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
               
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
        if ( destName->Des().Compare( aServiceName ) == 0 )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
            CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
                "GetDestinationsL - remove current service´s destination" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
            
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
            aDestinationIds.Remove( i );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
            aDestinationIds.Compress();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
               
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
        CleanupStack::PopAndDestroy( destName );      
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
        CleanupStack::PopAndDestroy( &refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::GetDestinationsL - OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
// CCchUiNotifConnectionHandler::GetDestinationL
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
void CCchUiNotifConnectionHandler::GetDestinationL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
    TUint aIapId, TInt& aError, TUint32& aDestinationId )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
    CCHUIDEBUG2(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
        "CCchUiNotifConnectionHandler::GetDestinationL - IN aIapID = %d", &aIapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
    aError = KErrNotFound;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    RArray<TUint32> destinationIds;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    CleanupClosePushL( destinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
    iCmManagerExt.AllDestinationsL( destinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
    // Find our service destination from Iap ids.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
    for ( TInt i( 0 ) ; i < destinationIds.Count() && KErrNone != aError; i++ )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
        RCmDestinationExt refDestination = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
            iCmManagerExt.DestinationL( destinationIds[ i ] );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
        CleanupClosePushL( refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
        HBufC* destName = refDestination.NameLC();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
        RCmConnectionMethodExt connectionMethod;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
        CleanupClosePushL( connectionMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
        TRAPD( error, connectionMethod =
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
            refDestination.ConnectionMethodByIDL( aIapId ) );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
        if ( KErrNone == error )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
            CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
                "GetDestinationsL - IapID found from destination" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
            aDestinationId = destinationIds[ i ];
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
            aError = KErrNone;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
        CleanupStack::PopAndDestroy( &connectionMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
        CleanupStack::PopAndDestroy( destName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
        CleanupStack::PopAndDestroy( &refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
    CleanupStack::PopAndDestroy( &destinationIds );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::GetDestinationL - OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
// Gets all access point ids from SNAP.
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
void CCchUiNotifConnectionHandler::GetAccessPointsFromSnapL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
    RArray<TUint32>& aIapIds, TUint32 aDestinationId )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
    {    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
    CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
        "CCchUiNotifConnectionHandler::GetAccessPointsFromSnapL - IN" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
    CleanupClosePushL(aIapIds);
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
    RCmDestinationExt destination = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
                iCmManagerExt.DestinationL( aDestinationId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
    CleanupClosePushL( destination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
    for ( TInt index = 0 ; 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
        index < destination.ConnectionMethodCount() ; index++ )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
        RCmConnectionMethodExt connMethod = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
            destination.ConnectionMethodL( index );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
        CleanupClosePushL( connMethod );      
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
        TUint32 iapId = connMethod.GetIntAttributeL( CMManager::ECmIapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
        aIapIds.AppendL( iapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
        CleanupStack::PopAndDestroy( &connMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
    CleanupStack::PopAndDestroy( &destination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
    CleanupStack::Pop();
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
    CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
        "CCchUiNotifConnectionHandler::GetAccessPointsFromSnapL - OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
// Gets GPRS access points from Internet SNAP
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
void CCchUiNotifConnectionHandler::GetGprsAccessPointsFromSnapL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
    CDesCArray& aIaps, 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
    RArray<TUint32>& aIapIds, 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
    RCmDestinationExt& aDestination )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
    {    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
    CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
        "CCchUiNotifConnectionHandler::GetGprsAccessPointsFromSnapL - IN" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
    __ASSERT_ALWAYS( aDestination.ConnectionMethodCount(), 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
        User::Leave( KErrNotFound ) );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
    for ( TInt index = 0 ; 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
        index < aDestination.ConnectionMethodCount() ; index++ )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
        RCmConnectionMethodExt connMethod = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
            aDestination.ConnectionMethodL( index );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
        CleanupClosePushL( connMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
        if ( KUidPacketDataBearerType == connMethod.GetIntAttributeL( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
                CMManager::ECmBearerType ) )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
            HBufC* connName = 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
                connMethod.GetStringAttributeL( CMManager::ECmName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
            CleanupStack::PushL( connName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
            
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
            CCHUIDEBUG( "GetGprsAccessPointsFromSnapL - iap name ok" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
            
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
            aIaps.AppendL( *connName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
            CleanupStack::PopAndDestroy( connName );    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
            TUint32 iapId = connMethod.GetIntAttributeL( CMManager::ECmIapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
            aIapIds.AppendL( iapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
            
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
            CCHUIDEBUG2( "GetGprsAccessPointsFromSnapL - iap id: %d", iapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
        CleanupStack::PopAndDestroy( &connMethod );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
    CCHUIDEBUG( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
        "CCchUiNotifConnectionHandler::GetGprsAccessPointsFromSnapL - OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
// CCchUiNotifConnectionHandler::GetGprsAccessPointsSetToServiceSnapL
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
TInt CCchUiNotifConnectionHandler::GetGprsAccessPointsSetToServiceSnapL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
    CDesCArray& aIaps, RArray<TUint32>& aIapIds, TUint aIapId )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
    CCHUIDEBUG2( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
        "CCchUiNotifConnectionHandler::GetGprsAccessPointsSetToServiceSnapL - IN aIapId = %d", aIapId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
    TUint32 destinationId = 0;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
    TInt error;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
    GetDestinationL( aIapId, error, destinationId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
    if ( KErrNone == error )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
        CCHUIDEBUG2( 
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
            "GetGprsAccessPointsSetToServiceSnapL - destinationId = %d", destinationId );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
        RCmDestinationExt refDestination;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
        CleanupClosePushL( refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
        TRAPD( error,
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
            refDestination = iCmManagerExt.DestinationL( destinationId ) );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
        CCHUIDEBUG2(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
            "GetGprsAccessPointsSetToServiceSnapL -Destination error %d", error );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
        if ( KErrNone == error )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
            GetGprsAccessPointsFromSnapL( aIaps, aIapIds, refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
        CleanupStack::PopAndDestroy( &refDestination );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
    CCHUIDEBUG2(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
        "CCchUiNotifConnectionHandler::GetGprsAccessPointsSetToServiceSnapL -return %d", error );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
    return error;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
// CCchUiNotifConnectionHandler::IsConnectionMethodSimilarL
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
// ---------------------------------------------------------------------------
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
//
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
TBool CCchUiNotifConnectionHandler::IsConnectionMethodSimilarL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
    TUint32 aIapId, TUint32 aIapIdToCompare )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
    CCHUIDEBUG( "CCchUiNotifConnectionHandler::IsConnectionMethodSimilarL - IN" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
    TBool returnVal = EFalse;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
    TUint32 bearerType = iCmManagerExt.GetConnectionMethodInfoIntL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
        aIapId, CMManager::ECmBearerType );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
    if ( bearerType == iCmManagerExt.GetConnectionMethodInfoIntL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
        aIapIdToCompare, CMManager::ECmBearerType ) )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
        {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
        HBufC* buffer = NULL;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
        HBufC* bufferToCompare = NULL;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
        
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
        switch( bearerType )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
            {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
            case KUidWlanBearerType:
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
                CCHUIDEBUG( "IsConnectionMethodSimilarL - KUidWlanBearerType" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
                buffer = iCmManagerExt.GetConnectionMethodInfoStringL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
                    aIapId, CMManager::EWlanSSID );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
                CCHUIDEBUG( "GetConnectionMethodInfoStringL - aIapId EWlanSSID OUT" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
                CleanupStack::PushL( buffer );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
                bufferToCompare = iCmManagerExt.GetConnectionMethodInfoStringL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
                    aIapIdToCompare, CMManager::EWlanSSID );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
                if ( buffer->Compare( *bufferToCompare ) == 0 )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
                    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
                    returnVal = ETrue;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
                    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
                CleanupStack::PopAndDestroy( buffer );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
                delete bufferToCompare;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
                bufferToCompare = NULL;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
                break;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
            case KUidPacketDataBearerType:
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
                CCHUIDEBUG( "IsConnectionMethodSimilarL - KUidPacketDataBearerType" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
                buffer = iCmManagerExt.GetConnectionMethodInfoStringL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
                    aIapId, CMManager::EPacketDataAPName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
                CleanupStack::PushL( buffer );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
                bufferToCompare = iCmManagerExt.GetConnectionMethodInfoStringL(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
                    aIapIdToCompare, CMManager::EPacketDataAPName );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
                if ( buffer->Compare( *bufferToCompare ) == 0 )
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
                    {
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
                    returnVal = ETrue;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
                    }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
                CleanupStack::PopAndDestroy( buffer );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
                delete bufferToCompare;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
                bufferToCompare = NULL;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
                break;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
            default:
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
			    CCHUIDEBUG( "IsConnectionMethodSimilarL - Bearer type unknown" );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
                break;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
            }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
        }
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
    CCHUIDEBUG2(
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
        "CCchUiNotifConnectionHandler::IsConnectionMethodSimilarL -return = %d", returnVal );
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
    
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
    return returnVal;
d38647835c2e Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
    }