iaupdate/IAD/api/client/src/iaupdateclient.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 12:20:42 +0300
branchRCL_3
changeset 73 79647526f98c
parent 70 e8965914fac7
child 81 42552535c1ac
permissions -rw-r--r--
Revision: 201035 Kit: 201036
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
     2
* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
ba25891c3a9e 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
ba25891c3a9e 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"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ba25891c3a9e 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".
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    14
* Description:   This module contains the implementation of RIAUpdateClient
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*                class member functions.
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
*/
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
//INCLUDES
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <eikenv.h>
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <apgcli.h>
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <e32math.h>
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include "iaupdateclient.h"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include "iaupdateclientdefines.h"
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    27
#include "iaupdatetools.h"
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include "iaupdatedebug.h"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    32
// RIAUpdateClient::RIAUpdateClient
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
// 
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    36
RIAUpdateClient::RIAUpdateClient() 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    37
: iPtr1( NULL, 0 ),
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    38
  iPtr2( NULL, 0 ),
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    39
  iPtr3( NULL, 0 )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    {
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    45
// RIAUpdateClient::Open
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
// 
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    49
TInt RIAUpdateClient::Open()
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    51
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::Open() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    52
    TInt error( KErrNone );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    53
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    54
    if ( !iConnected )
65
7333d7932ef7 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    55
        {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    56
        TRAP( error, ConnectNewAppL( ServiceUid() ) );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    57
        if ( error == KErrNone ) 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    58
            {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    59
            iConnected = ETrue;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    60
            CEikonEnv* eikEnv = CEikonEnv::Static();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    61
            if ( eikEnv )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    62
                {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    63
            	RWindowGroup owngroup;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    64
		        iOwnWgId = eikEnv->RootWin().Identifier(); 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    65
		        
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    66
	            TPckg<TInt> wgId( iOwnWgId );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    67
	            delete iData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    68
	            iData = NULL;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    69
	             TRAP_IGNORE( iData = wgId.AllocL() );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    70
	            
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    71
                TIpcArgs args;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    72
                args.Set( 0, iData );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    73
                SendReceive( IAUpdateClientDefines::EIAUpdateServerSendWgId, args );    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    74
	            } 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    75
            }
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
        }
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    77
    IAUPDATE_TRACE_1("[IAUPDATE] RIAUpdateClient::Open() end error code: %d", error );
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    78
    return error;
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    79
    }
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    80
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    81
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    82
// RIAUpdateClient::OpenToBackroundAsync
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    83
// 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    84
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    85
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    86
TInt RIAUpdateClient::OpenToBackroundAsync( TRequestStatus& aStatus )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    87
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    88
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::OpenToBackroundAsync() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    89
    TInt error( KErrNone );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    90
    if ( !iConnected )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    91
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    92
        TRAP( error, StartNewAppToBackgroundL( ServiceUid(), aStatus ) );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    93
        }
73
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
    94
    else
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
    95
        {
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
    96
        error = KErrAlreadyExists;
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
    97
        } 
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    98
    IAUPDATE_TRACE_1("[IAUPDATE] RIAUpdateClient::OpenToBackroundAsync() end error code: %d", error );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    99
    return error;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   100
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   101
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   102
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   103
// RIAUpdateClient::ConnectToApp
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   104
// 
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   105
// -----------------------------------------------------------------------------
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   106
//
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   107
TInt RIAUpdateClient::ConnectToApp()
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   108
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   109
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::ConnectToApp() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   110
    TInt error( KErrNone );
73
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   111
    if ( iConnected )
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   112
        {
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   113
        return error;
79647526f98c Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 70
diff changeset
   114
        }
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   115
    TName serverName;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   116
    ServerName(serverName, ServiceUid(), iDifferentiator);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   117
    TRAP( error,ConnectExistingByNameL( serverName ) );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   118
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   119
    if ( error == KErrNone ) 
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   120
        {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   121
        iConnected = ETrue;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   122
        CEikonEnv* eikEnv = CEikonEnv::Static();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   123
        if ( eikEnv )
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   124
            {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   125
            RWindowGroup owngroup;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   126
            iOwnWgId = eikEnv->RootWin().Identifier(); 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   127
                    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   128
            TPckg<TInt> wgId( iOwnWgId );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   129
            delete iData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   130
            iData = NULL;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   131
            TRAP_IGNORE( iData = wgId.AllocL() );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   132
                    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   133
            TIpcArgs args;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   134
            args.Set( 0, iData );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   135
            SendReceive( IAUpdateClientDefines::EIAUpdateServerSendWgId, args );    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   136
            } 
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   137
        }
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   138
    IAUPDATE_TRACE_1("[IAUPDATE] RIAUpdateClient::ConnectToApp() end error code: %d", error );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   139
    return error; 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   140
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   141
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   142
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   143
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   144
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   145
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   146
// RIAUpdateClient::Close
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   147
// 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   148
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   149
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   150
void RIAUpdateClient::Close()
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   151
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   152
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::Close() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   153
    // Let the parent handle closing.
70
e8965914fac7 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 66
diff changeset
   154
    REikAppServiceBase::Close();
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   155
    iConnected = EFalse;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   156
    delete iData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   157
    iData = NULL;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   158
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::Close() end");
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   159
    }
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   160
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   161
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   162
// RIAUpdateClient::CheckUpdates
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
//
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   166
TInt RIAUpdateClient::CheckUpdates( const CIAUpdateParameters& aUpdateParameters,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   167
                                    TInt& aAvailableUpdates, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   168
                                    TRequestStatus& aStatus )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   170
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::CheckUpdates()");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   171
    // Inform the caller about the success of the request initializing.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   172
    return SendCheckUpdatesRequest( IAUpdateClientDefines::EIAUpdateServerCheckUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   173
                                    aUpdateParameters,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   174
                                    aAvailableUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   175
                                    aStatus );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   176
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   177
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   178
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   179
// RIAUpdateClient::ShowUpdates
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   180
// 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   181
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   182
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   183
TInt RIAUpdateClient::ShowUpdates( const CIAUpdateParameters& aUpdateParameters,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   184
                                   TInt& aNumberOfSuccessfullUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   185
                                   TInt& aNumberOfFailedUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   186
                                   TInt& aNumberOfCancelledUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   187
                                   TRequestStatus& aStatus )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   188
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   189
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::ShowUpdates()");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   190
    // Inform the caller about the success of the request initializing.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   191
    return SendUpdateRequest( IAUpdateClientDefines::EIAUpdateServerShowUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   192
                              aUpdateParameters,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   193
                              aNumberOfSuccessfullUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   194
                              aNumberOfFailedUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   195
                              aNumberOfCancelledUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   196
                              aStatus );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
    
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   201
// RIAUpdateClient::UpdateQuery
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
//    
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   205
TInt RIAUpdateClient::UpdateQuery( TBool& aUpdateNow, TRequestStatus& aStatus )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   207
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::UpdateQuery() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   208
	TPckg<TBool> updateNow( aUpdateNow );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   209
	iPtr1.Set( updateNow );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   210
	            
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   211
    TIpcArgs args;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   212
    args.Set( 1, &iPtr1 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   213
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   214
	SendReceive( IAUpdateClientDefines::EIAUpdateServerShowUpdateQuery, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   215
	             args, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   216
	             aStatus );    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   217
	IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::UpdateQuery() begin");    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   218
    return KErrNone;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   222
// RIAUpdateClient::BroughtToForeground
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
//
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   226
void RIAUpdateClient::BroughtToForeground()
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   228
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::BroughtToForeground() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   229
    if ( iConnected )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
        {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   231
    	SendReceive( IAUpdateClientDefines::EIAUpdateServerToForeground );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
        }
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   233
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::BroughtToForeground() end");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   234
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   235
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   238
// RIAUpdateClient::CancelAsyncRequest
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   239
// 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   240
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   241
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   242
void RIAUpdateClient::CancelAsyncRequest()
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   243
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   244
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::CancelAsyncRequest() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   245
    // We suppose that an active object will
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   246
    // wait for the cancellation to complete.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   247
    // So, let the server know that operation is cancelled.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   248
    // The server should set the correct status and complete
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   249
    // the request of the active object. So, the cancellation 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   250
    // can proceed to the end.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   251
    if ( iConnected )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   252
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   253
    	SendReceive( IAUpdateClientDefines::EIAUpdateServerCancel ); 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   254
        }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   255
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::CancelAsyncRequest() end");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   256
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   257
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   258
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   259
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   260
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   261
// RIAUpdateClient::ServiceUid()
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   262
// 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   263
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   264
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   265
TUid RIAUpdateClient::ServiceUid() const
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   266
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   267
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::ServiceUid()");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   268
    return IAUpdateClientDefines::KIAUpdateServiceUid;    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   269
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   270
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   271
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   272
// RIAUpdateClient::SendCheckUpdatesRequest
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
//
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   276
TInt RIAUpdateClient::SendCheckUpdatesRequest( TInt aUpdateFunction,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   277
                                               const CIAUpdateParameters& aUpdateParameters,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   278
                                               TInt& aCount,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   279
                                               TRequestStatus& aStatus )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   281
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::SendCheckUpdatesRequest() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   282
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   283
    aStatus = KRequestPending;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   284
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   285
    delete iData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   286
    iData = NULL;   
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   287
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   288
    TInt error( KErrNone );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   289
    TRAP( error, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   290
          IAUpdateTools::ExternalizeParametersL( iData, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   291
                                                 aUpdateParameters ) );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   292
    IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", error );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   293
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   294
    // Because this function does not leave,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   295
    // use error value to check if request can be done.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   296
    if ( error == KErrNone )
65
7333d7932ef7 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   297
        {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   298
        TPckg<TInt> count( aCount );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   299
	    iPtr1.Set( count );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   300
	            
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   301
        TIpcArgs args;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   302
        args.Set( 0, iData );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   303
        args.Set( 1, &iPtr1 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   304
              
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   305
        // Start the asynchronous operation in the server side.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   306
        SendReceive( aUpdateFunction, args, aStatus );        
65
7333d7932ef7 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   307
        }
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   308
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   309
    // Inform the caller about the success of the request initializing.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   310
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::SendCheckUpdatesRequest() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   311
    return error;
65
7333d7932ef7 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   312
    }
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   315
// RIAUpdateClient::SendUpdateRequest
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
// 
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
//
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   319
TInt RIAUpdateClient::SendUpdateRequest( TInt aUpdateFunction,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   320
                                         const CIAUpdateParameters& aUpdateParameters,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   321
                                         TInt& aNumberOfSuccessfullUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   322
                                         TInt& aNumberOfFailedUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   323
                                         TInt& aNumberOfCancelledUpdates,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   324
                                         TRequestStatus& aStatus )
65
7333d7932ef7 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   325
    {
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   326
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::SendUpdateRequest() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   327
    aStatus = KRequestPending;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   328
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   329
    delete iData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   330
    iData = NULL;   
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   331
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   332
    TInt error( KErrNone );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   333
    TRAP( error, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   334
          IAUpdateTools::ExternalizeParametersL( iData, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   335
                                                 aUpdateParameters ) );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   336
    IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", error );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   337
    // Because this function does not leave,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   338
    // use error value to check if request can be done.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   339
    if ( error == KErrNone )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   340
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   341
        TPckg<TInt> successCount( aNumberOfSuccessfullUpdates );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   342
	    iPtr1.Set( successCount );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   344
        TPckg<TInt> failCount( aNumberOfFailedUpdates );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   345
	    iPtr2.Set( failCount );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   346
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   347
        TPckg<TInt> cancelCount( aNumberOfCancelledUpdates );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   348
	    iPtr3.Set( cancelCount );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   349
	    	            
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   350
        TIpcArgs args;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   351
        args.Set( 0, iData );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   352
        args.Set( 1, &iPtr1 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   353
        args.Set( 2, &iPtr2 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   354
        args.Set( 3, &iPtr3 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   355
      
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   356
        // Start the asynchronous operation in the server side.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   357
        SendReceive( aUpdateFunction, args, aStatus );        
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   358
        }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   359
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   360
    // Inform the caller about the success of the request initializing.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   361
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::SendUpdateRequest() end");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   362
    return error;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   363
    }    
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   365
// -----------------------------------------------------------------------------
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   366
// RIAUpdateClient::StartNewAppToBackgroundL
36
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   367
// 
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   368
// -----------------------------------------------------------------------------
f9033e605ee2 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   369
//
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   370
void RIAUpdateClient::StartNewAppToBackgroundL( TUid aAppUid, TRequestStatus& aStatus )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   371
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   372
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::StartNewAppToBackgroundL() begin");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   373
    TName notUsed;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   374
    iDifferentiator = GenerateServerDifferentiatorAndName(notUsed, aAppUid);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   375
       
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   376
    RApaLsSession apa;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   377
    User::LeaveIfError(apa.Connect());
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   378
    CleanupClosePushL(apa);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   379
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   380
    TApaAppInfo info;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   381
    User::LeaveIfError(apa.GetAppInfo(info, aAppUid));
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   382
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   383
    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   384
    cmdLine->SetExecutableNameL(info.iFullName);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   385
    cmdLine->SetServerRequiredL( iDifferentiator );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   386
    cmdLine->SetCommandL(EApaCommandBackground);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   387
         
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   388
    TThreadId notUsedId;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   389
    User::LeaveIfError(apa.StartApp(*cmdLine, notUsedId, &aStatus));
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   390
          
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   391
    CleanupStack::PopAndDestroy(2, &apa);   // cmdLine and apa
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   392
    IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::StartNewAppToBackgroundL() end");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   393
    }
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
66
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   397
void RIAUpdateClient::ServerName(TName& aServerName, TUid aAppServerUid, TUint aServerDifferentiator)
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   398
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   399
    _LIT(KServerNameFormat, "%08x_%08x_AppServer");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   400
    aServerName.Format(KServerNameFormat, aServerDifferentiator, aAppServerUid);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   401
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   402
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   403
TUint RIAUpdateClient::GenerateServerDifferentiatorAndName(TName& aServerName, TUid aAppServerUid)
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   404
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   405
    TUint r;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   406
    FOREVER
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   407
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   408
        r = Math::Random();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   409
        if (r==0)
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   410
            continue;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   411
        ServerName(aServerName, aAppServerUid, r);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   412
        TFindServer find(aServerName);
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   413
        TFullName fullName;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   414
        if (find.Next(fullName) == KErrNone)
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   415
            continue;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   416
        break;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   417
        }       
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   418
    return r;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   419
    }