applicationmanagement/server/src/ApplicationManagementServer.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:05:55 +0300
branchRCL_3
changeset 57 6757f1e2efd2
parent 55 c4687ff85147
child 58 5b858729772b
permissions -rw-r--r--
Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
3ce708148e4d 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
3ce708148e4d 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"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
3ce708148e4d 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".
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 *
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 *
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * Contributors:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
 *
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
 * Description: Implementation of applicationmanagement components
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 *
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 */
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#define __INCLUDE_CAPABILITY_NAMES__
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <e32svr.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <badesca.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <e32cmn.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <bautils.h> 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <featmgr.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <imcvcodc.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <uikon.hrh>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <e32property.h>
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    27
#include <driveinfo.h>
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <SWInstDefs.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include <PolicyEngineClient.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include <PolicyEngineXACML.h>
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    31
#include <eikenv.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    32
#include <hbapplication.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    33
#include <apgwgnam.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    34
#include <nsmldmconst.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    35
#include <DevManInternalCRKeys.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    36
#include <apgtask.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    37
#include <apgwgnam.h>
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    38
#include "ampskeys.h"
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    39
#include "amprivateCRKeys.h"
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    40
#include "ApplicationManagementConst.h"
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include "ApplicationManagementCommon.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
#include "ApplicationManagementClientServer.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
#include "ApplicationManagementServer.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
#include "AMDeploymentComponent.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
#include "amsmlhelper.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
#include "ApplicationManagementUtility.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
#include "ApplicationManagementUtilityFactory.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
#include "debug.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
#include "coemain.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
#include "AMPreInstallApp.h"
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    51
#include "amview.h"
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    52
#include "appmgmtnotifier.h"
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
using namespace NApplicationManagement;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
#ifdef __AM_CONNECT_INSTALLER_ONSTARTUP_	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
#pragma message("AM Connecting installer at startup")
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
#else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
#pragma message("AM Connecting installer when needed")
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
// Needed only for jad+jar installation  
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
_LIT( KInstallDir, "c:\\temp\\" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
_LIT8(KMIDletJarURL, "MIDlet-Jar-URL");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
//OMA SCOMO Specific
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
_LIT8(KDownloadState, "./SCOMO/Download/");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
_LIT8(KDeliveredState, "./SCOMO/Inventory/Delivered/");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
_LIT8(KDeployedState, "./SCOMO/Inventory/Deployed/");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    70
//Package all the above together into a policy
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    71
CPolicyServer::TPolicy KApplicationManagementSecurityPolicy;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
// CApplicationManagementServer::ComponentDownloadComplete()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
void CApplicationManagementServer::ComponentDownloadComplete(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
        CDeploymentComponent *aComponent, TInt iapid, HBufC8 *aServerId)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    TInt err = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
    TRAP( err, DownloadCompleteL( aComponent, iapid, aServerId ));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
// CApplicationManagementServer::DownloadCompleteL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
void CApplicationManagementServer::DownloadCompleteL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
        CDeploymentComponent *aComponent, TInt iapid, HBufC8 *aServerId)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
    RDEBUG( "ApplicationManagementServer DownloadComplete - start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
    __ASSERT_DEBUG( aComponent, User::Invariant() );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    92
    iComp = aComponent;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    93
    iStorage->UpdateL(*aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    TInt errdownload = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    TInt errInstall = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
    TInt status = KStatusSuccess;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    97
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
    98
    if (!aComponent->DownloadFailed())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   100
        CDeploymentComponent *old = DoDataUpdateCheckL(*aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
        TDownloadTarget trgt = aComponent->DownloadTarget();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
        switch (trgt)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
            case EDeliver:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
            case EInstall:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
            case EInstallAndActivate:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   111
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
                TRAP(errInstall,DoTheInstallL( *aComponent));
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   113
RDEBUG_2( "ApplicationManagementServer DownloadComplete - start %d", errInstall);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   114
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
                if (trgt == EInstall && errInstall == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
                    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   117
                    iStorage->DeactivateL(*aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
            case EUpdate:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
            case EUpdateAndActivate:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
                if (old)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
                    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   127
                    FullUpdateL(*aComponent, *old);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
                    if (trgt == EUpdate)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
                        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   130
                        iStorage->DeactivateL(*aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
            default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
        errdownload = aComponent->DownloadStatus();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
    RDEBUG( "ApplicationManagementServer DownloadComplete - Start Send to background" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
    //Download Completed/ Failed or installation success/ failure Send server to Background.
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
    iOMASCOMOEnabled = IsOMASCOMOEnabledL();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   150
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   151
    m_Window->lower();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   152
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
    if (iOMASCOMOEnabled)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   155
        status = GetErrorStatus(errdownload, errInstall);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   156
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
        TInt ASyncSupported = -1;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   159
        CRepository *repository = CRepository::NewLC(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   160
                KUidPSApplicationManagementKeys);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
        repository->Get(KAsyncEnabled, ASyncSupported);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
        CleanupStack::PopAndDestroy();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   163
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
        // For Sync Reporting
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
        if (!ASyncSupported)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
            // Update Central Repository with proper error code for Sync
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   168
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   169
            CRepository *repository = CRepository::NewLC(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   170
                    KUidPSApplicationManagementKeys);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
            repository->Set(KAMSyncStatus, status);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
            CleanupStack::PopAndDestroy();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   173
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
            RProperty counter;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   175
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   176
            TInt r = counter.Attach(KUidPSApplicationManagementKeys,
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
                    KSyncNotifier, EOwnerThread);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
            User::LeaveIfError(r);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   180
            TInt err = counter.Set(KErrCancel);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   181
            User::LeaveIfError(err);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   182
            counter.Close();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   183
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   184
        else// Do AsyncReporting
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   185
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   186
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   187
            RDEBUG( "CApplicationManagementServer::ASync Reporting Step 1" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   188
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   189
            // Get deployement component entries
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   190
            TInt internalid = aComponent->InternalId();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   191
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   192
            RDEBUG( "CApplicationManagementServer::ASync Reporting Step 2" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   193
40
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   194
            TBuf8<256> targetURI;
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   195
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   196
            TDeploymentComponentState state = aComponent->State();
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   197
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   198
            RDEBUG( "CApplicationManagementServer::ASync Reporting Step 3" );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
            if (state == EDCSDownload)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   202
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   203
                RDEBUG( "CApplicationManagementServer::ASync EDCSDownload Start" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   204
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
                targetURI.Append(KDownloadState);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
                targetURI.Append(aComponent->UserId());
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   207
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   208
                RDEBUG( "CApplicationManagementServer::ASync EDCSDownload End" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   209
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   211
            else if (state == EDCSDelivered)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   212
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   213
                RDEBUG( "CApplicationManagementServer::ASync EDCSDelivered Start" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   214
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   215
                targetURI.Append(KDeliveredState);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   216
                targetURI.Append(aComponent->UserId());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   217
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   218
                RDEBUG( "CApplicationManagementServer::ASync EDCSDelivered End" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   219
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   220
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   221
            else if (state == EDCSActive || state == EDCSInactive)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   222
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   223
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   224
                RDEBUG( "CApplicationManagementServer::ASync EDCSActive Start" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   225
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   226
                targetURI.Append(KDeployedState);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   227
                targetURI.Append(aComponent->UserId());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   228
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   229
                RDEBUG( "CApplicationManagementServer::ASync EDCSActive End" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   230
                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
            //Save Entry to database with status and target URI of deployment component
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   233
            TInt iapidval = 2;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   234
            TRAPD( err1, SmlHelper::GetDefaultIAPFromDMProfileL( iapid ) );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   235
            if (err1 == KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   236
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   237
                RDEBUG_2("Application Mgmt Server service::DownloadCompleteL iapid to : %d", iapid );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   238
                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
            TInt index;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
            iAMServerDB->SaveToDatabaseL(index, internalid, status,
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   242
                    targetURI, iapidval);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   243
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   244
            RDEBUG( "CApplicationManagementServer::ASync SaveToDatabaseL completed" );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
            EnableDMNetworkMonL(iapid, aServerId);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   249
    int value = 0 ;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   250
    int err = RProperty::Set(TUid::Uid(KOmaDMAppUid), KDownloadActive, value);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   251
    RDEBUG_2("RProperty set (%d)", err  );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
    if (iDownloadMngr->DownloadCount() == 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   254
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
        RDEBUG_2( "CApplicationManagementServer::ConstructL - ERROR leaving cannot connect installer: %d", iSessionCount );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   256
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
        // Is session count is not modified whenever there is error then at the end of download complete decrement
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
        //  the session count.
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   259
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   260
        if (status != KStatusSuccess && iSessionCount != 0)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   262
            iSessionCount--;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   264
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
        if (iSessionCount == 0)
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   266
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   267
            iShutdown.Start();    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   270
    aComponent->SetDriveSelectionStatus(false);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
    RDEBUG( "ApplicationManagementServer DownloadComplete - end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   274
void CApplicationManagementServer::InstallationCancelled()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   275
	{
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   276
		iInstaller.CancelOperation();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   277
	}
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
// CApplicationManagementServer::IsOMASCOMOEnabledL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
TBool CApplicationManagementServer::IsOMASCOMOEnabledL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   284
    RDEBUG( "CApplicationManagementServer::IsOMASCOMOEnabledL Start" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   285
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
    TInt adapterValue;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   287
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   288
    CRepository *repository = CRepository::NewLC(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   289
            KCRUidPrivateApplicationManagementKeys);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
    repository->Get(KAMAdapterValue, adapterValue);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
    CleanupStack::PopAndDestroy();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   292
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   293
    RDEBUG( "CApplicationManagementServer::IsOMASCOMOEnabledL End" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   294
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   295
    if (adapterValue == 0 || adapterValue == 1)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   296
        return EFalse;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   297
    else
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   298
        return ETrue;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
// CApplicationManagementServer::GetErrorStatus()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
// ------------------------------------------------------------------------------------------------
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   304
TInt CApplicationManagementServer::GetErrorStatus(TInt aErrorDownload,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   305
        TInt aErrorInstall)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   306
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   307
    TInt status = KStatusSuccess;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   308
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   309
    if (aErrorDownload != KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   310
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   311
        if (aErrorDownload == KStatusUserCancelled || aErrorDownload
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   312
                == KStatusDowloadFailedOOM || aErrorDownload
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   313
                == KStatusUnSupportedEnvironment || aErrorDownload
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   314
                == KStatusAlternateDownldAuthFail || aErrorDownload
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   315
                == KStatusAltDowldUnavailable)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   316
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   317
            status = aErrorDownload;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   318
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   319
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   320
            status = KStatusDownloadFailed;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   321
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   322
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   323
    else if (aErrorInstall != KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   324
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   325
        if (aErrorInstall == SwiUI::KSWInstErrSecurityFailure)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   326
            status = KStatusPkgValidationFailed;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   327
        if (aErrorInstall == SwiUI::KSWInstErrInsufficientMemory)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   328
            status = KStatusInstallFailedOOM;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   329
	  if (aErrorInstall == KStatusUserCancelled)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   330
		status = KStatusUserCancelled;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   331
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   332
            status = KStatusInstallFailed;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   333
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   334
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   335
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   336
    return status;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   337
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   338
    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   339
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
// CApplicationManagementServer::EnableDMNetworkMonL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
// ------------------------------------------------------------------------------------------------
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   343
void CApplicationManagementServer::EnableDMNetworkMonL(TInt iapid,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   344
        HBufC8 *aServerId)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   345
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   346
    TInt retryenabled = 1;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   347
    _LIT( KNetMon,"\\dmnetworkmon.exe" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   348
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   349
    // Enable DM Network Monitoring for retry of Generic alert in case of N/W loss
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   350
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   351
    CRepository *repository = CRepository::NewLC(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   352
            KCRUidDeviceManagementInternalKeys);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   353
    TInt err_val = repository->Set(KDevManEnableDMNetworkMon, retryenabled);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   354
    RDEBUG_2( "CApplicationManagementServer::EnableDMNetworkMonL Retry enabled err: %d", err_val );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   355
    RDEBUG_2( "CApplicationManagementServer::EnableDMNetworkMonL Retry enabled value: %d", retryenabled );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   356
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   357
    err_val = repository->Set(KDevManIapIdKey, iapid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   358
    RDEBUG_2( "CApplicationManagementServer::EnableDMNetworkMonL devmaniapid: %d", err_val );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   359
    RDEBUG_2( "CApplicationManagementServer::EnableDMNetworkMonL iap id: %d", iapid );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   360
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   361
    err_val = repository->Set(KDevManServerIdKey, *aServerId);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   362
    RDEBUG_2( "CApplicationManagementServer::EnableDMNetworkMonL serveridkey: %d", err_val );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   363
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   364
    TBuf<256> buf1;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   365
    buf1.Copy(*aServerId);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   366
    RDEBUG_2( "Server ID -  '%S'", &buf1);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   367
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   368
    CleanupStack::PopAndDestroy();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   369
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   370
    // create NetMon EXE
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   371
    RProcess rp;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   372
    TInt err = rp.Create(KNetMon, KNullDesC);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   373
    User::LeaveIfError(err);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   374
    TRequestStatus stat;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   375
    rp.Rendezvous(stat);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   376
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   377
    if (stat != KRequestPending)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   378
        rp.Kill(0); // abort startup
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   379
    else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   380
        rp.Resume(); // logon OK - start the server
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   381
    TInt r = (rp.ExitType() == EExitPanic) ? KErrGeneral : stat.Int();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   382
    rp.Close();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   383
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   384
    }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
// CApplicationManagementServer::CApplicationManagementServer
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   390
inline CApplicationManagementServer::CApplicationManagementServer() :
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   391
    CPolicyServer(0, KApplicationManagementSecurityPolicy, ESharableSessions)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
// CApplicationManagementServer::AddSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
void CApplicationManagementServer::AddSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
    // A new session is being created
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
    RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::AddSession" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
    ++iSessionCount;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
    // Cancel the shutdown timer if it was running
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
    iShutdown.Cancel();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
// CApplicationManagementServer::DropSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
void CApplicationManagementServer::DropSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
    // A session is being destroyed
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
    RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::DropSession" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
    // Start the shutdown timer if it is the last session
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   419
    if (--iSessionCount == 0)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
        if (iDownloadMngr->DownloadCount() > 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
            RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::DropSession download in progress" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
            iShutdown.Start();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
// -----------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
// CApplicationManagementServer::AddDownloadL( CDeploymentComponent *aComponent )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
// -----------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
void CApplicationManagementServer::AddDownloadL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
        CDeploymentComponent *aComponent)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
    __ASSERT_DEBUG( aComponent, User::Invariant() );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   440
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   441
    RDEBUG( "CApplicationManagementServer::AddDownloadL Start" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   442
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
    iDownloadMngr->AddDownloadL(aComponent);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   444
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   445
    RDEBUG( "CApplicationManagementServer::AddDownloadL End" );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
// ------------------------------------------------------------------------------------------------
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   449
// CApplicationManagementServer
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   450
// -----------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   451
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   452
CServer2* CApplicationManagementServer::NewL(HbMainWindow *mainWindow)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   454
    //specifies all connect attempts should pass
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   455
    KApplicationManagementSecurityPolicy.iOnConnect
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   456
            = CPolicyServer::EAlwaysPass;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   457
    KApplicationManagementSecurityPolicy.iRangeCount
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   458
            = KApplicationManagementRangeCount; //number of ranges                                   
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   459
    KApplicationManagementSecurityPolicy.iRanges
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   460
            = KApplicationManagementRanges;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   461
    KApplicationManagementSecurityPolicy.iElementsIndex
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   462
            = KApplicationManagementSecurityElementsIndex;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   463
    KApplicationManagementSecurityPolicy.iElements
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   464
            = KApplicationManagementSecurityElements;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   465
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   466
    RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::NewLC" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   467
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   468
    CApplicationManagementServer* self =
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   469
            new (ELeave) CApplicationManagementServer;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   470
    CleanupStack::PushL(self);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   471
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   472
    self->ConstructL(mainWindow);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   473
    CleanupStack::Pop();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   474
    return self;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   478
// -----------------------------------------------------------------------------
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
// CApplicationManagementServer::~CApplicationManagementServer
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
CApplicationManagementServer::~CApplicationManagementServer()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
    RDEBUG_3("CApplicationManagementServer::~CApplicationManagementServer 0x%X - 0x%X", reinterpret_cast<TUint>(this ),
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
            reinterpret_cast<TUint>(this)+sizeof( CApplicationManagementServer ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
    FeatureManager::UnInitializeLib();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
    iInstaller.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
    delete iStorage;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
    delete iUtility;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
    delete iAMServerDB;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
    RProperty::Delete(KUidPSApplicationManagementKeys, KAMServerUIEnabled);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
    RProperty::Delete(KUidPSApplicationManagementKeys, KAMOperationNonSilent);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
    RProperty::Delete(KUidPSApplicationManagementKeys, KSyncNotifier);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
    RProperty::Delete(KUidPSApplicationManagementKeys, KDMUINotClosed);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
    iInstallFile.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
    iInstallRFs.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
    delete iDownloadMngr;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   505
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
// CApplicationManagementServer::HandleAllClientsClosed
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
void CApplicationManagementServer::HandleAllClientsClosed()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
    // Do Nothing
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
    RDEBUG( "CApplicationManagementServer::HandleAllClientsClosed" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
// CApplicationManagementServer::ConstructL
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   521
void CApplicationManagementServer::ConstructL(HbMainWindow* aWindow)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
    // 2nd phase construction - ensure the timer and server objects are running
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
    RDEBUG( "CApplicationManagementServer::ConstructL - Start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
    iOMASCOMOEnabled = ETrue;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   528
    mUserCancelled = 0;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   529
    TRAPD( errf, FeatureManager::InitializeLibL() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
    if (errf != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
        User::Leave(errf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   534
    m_Window = aWindow;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
    RDEBUG( "CApplicationManagementServer::ConstructL - start" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   536
    StartL(KApplicationManagementServerName);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
    iStorage = CDeliveryComponentStorage::NewL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
    iUtility
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
            = ApplicationManagementUtilityFactory::CreateManagementUtilityL();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   541
    iDownloadMngr = CAMDownloadStore::NewL(*this);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
    iAMServerDB = CAMDownloaddb::NewL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
    // Define P&S Keys
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
    RProperty::Define(KUidPSApplicationManagementKeys, KAMServerUIEnabled,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
            RProperty::EInt);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
    RProperty::Define(KUidPSApplicationManagementKeys, KAMOperationNonSilent,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
            RProperty::EInt);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
    RProperty::Define(KUidPSApplicationManagementKeys, KSyncNotifier,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
            RProperty::EInt);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
    RProperty::Define(KUidPSApplicationManagementKeys, KDMUINotClosed,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
            RProperty::EInt);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
    RProperty syncproperty;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
    //Ignore error status
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
    syncproperty.Attach(KUidPSApplicationManagementKeys, KSyncNotifier,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
            EOwnerThread);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
    syncproperty.Set(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
    syncproperty.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   565
#ifdef __AM_CONNECT_INSTALLER_ONSTARTUP_	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
    TInt err( iInstaller.Connect() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
    if ( err != KErrNone )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
        RDEBUG_2( "CApplicationManagementServer::ConstructL - ERROR leaving cannot connect installer: %d", err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
        User::LeaveIfError( err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   571
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   572
#endif	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
    iShutdown.ConstructL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
    // ensure that the server still exits even if the 1st client fails to connect
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   575
    iShutdown.Start();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
    RDEBUG( "CApplicationManagementServer::ConstructL - end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
    }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   579
//---------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   580
// Create a new client session. 
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   581
//---------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   582
CSession2* CApplicationManagementServer::NewSessionL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   583
        const TVersion& aVersion, const RMessage2& /*aMessage */) const
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   584
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   585
    RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::NewSessionL" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   586
    TVersion ver(KAMVerMajor, KAMVerMinor, KAMVerBuild);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   587
    if (!User::QueryVersionSupported(ver, aVersion))
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   588
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   589
        RDEBUG( "CApplicationManagementServer::NewSessionL(): wrong version offered -> BAIL OUT!" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   590
        User::Leave(KErrNotSupported);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   591
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   592
    return new (ELeave) CApplicationManagementSession();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   593
    }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
// CApplicationManagementServer::CustomSecurityCheckL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
CPolicyServer::TCustomResult CApplicationManagementServer::CustomSecurityCheckL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
        const RMessage2& /*aMsg*/, TInt& /*aAction*/, TSecurityInfo& /*aMissing*/)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
    return EPass;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
// CApplicationManagementServer::InstallCompleteL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
void CApplicationManagementServer::InstallCompleteL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
        const CDeploymentComponent& aCompo, const TBool &aInstallSuccess)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
    RDEBUG_2("CApplicationManagementServer::InstallCompleteL start (%d)", aInstallSuccess);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   613
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
    iInstallFile.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
    // if java jad + jar install, remove files from c:\temp directory
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
    if (CDeploymentComponent::IsJavaMimeL(aCompo.MetaData().MimeType() ) && CDeploymentComponent::IsJavaMimeL(aCompo.Data().MimeType() ) )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
        TFileName fn, fn2;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
        GenerateTempFileNameL(iInstallRFs, aCompo, fn, fn2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
        RDEBUG_3("CApplicationManagementServer::InstallCompleteL delete files: (%S) (%S)", &fn, &fn2);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   621
        User::LeaveIfError(iInstallRFs.Delete(fn));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   622
        User::LeaveIfError(iInstallRFs.Delete(fn2));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   624
         TInt silentsession = 0;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   625
        TInt r2 = RProperty::Get(KPSUidNSmlSOSServerKey, KNSmlDMSilentJob,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   626
                silentsession);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   627
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   628
	  if(r2 == KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   629
		CApplicationManagementUtility::iSilentSession = silentsession;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   630
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   631
        if (!CApplicationManagementUtility::iSilentSession)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   632
        	{
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   633
    AppMgmtNotifier* note = new AppMgmtNotifier(m_appName);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
    if (aInstallSuccess)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   636
        note->showInstallSuccessNote();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
        // Remove temporary files from private directory 
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   638
        const_cast<CDeploymentComponent&> (aCompo).ResetDataL(iInstallRFs);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   639
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   640
    else if(mUserCancelled == 0)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   641
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   642
        note->showInstallFailedNote();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   643
        m_Window->lower();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   645
        
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   646
    delete note;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   647
     }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   648
     else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   649
     	{
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   650
     		 if (aInstallSuccess)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   651
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   652
        
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   653
        const_cast<CDeploymentComponent&> (aCompo).ResetDataL(iInstallRFs);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   654
        m_Window->lower();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   655
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   656
     	}
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   657
     
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
    iInstallRFs.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
    iInstallInProgress = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
#ifndef __AM_CONNECT_INSTALLER_ONSTARTUP_	
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   662
    iInstaller.Close();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
    RDEBUG("CApplicationManagementServer::InstallCompleteL end");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
// CApplicationManagementServer::GenerateTempJarFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   669
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
void CApplicationManagementServer::GenerateTempJarFileNameL(RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   672
        const TDesC& aMetaSource, TFileName &aFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
    if (aMetaSource != KNullDesC)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   675
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
        RFile file;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   677
        User::LeaveIfError(file.Open(aFs, aMetaSource, EFileRead));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
        CleanupClosePushL(file);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
        TFileName temp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
        temp = ReadJarFileNameL(file);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
        GenerateTempFileNameL(aFs, temp, aFileName);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   682
        CleanupStack::PopAndDestroy(&file);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   683
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   684
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   686
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   687
// CApplicationManagementServer::GenerateTempFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   688
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
void CApplicationManagementServer::GenerateTempFileNameL(const RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
        const TDesC& aSource, TFileName &aFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   692
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
    if (aSource != KNullDesC)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   694
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   695
        aFileName.Copy(KInstallDir);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   696
        TParse p;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   697
        User::LeaveIfError(aFs.Parse(aSource, p));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   698
        aFileName.Append(p.NameAndExt());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   699
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   700
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   702
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
// CApplicationManagementServer::GenerateTempFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   704
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   705
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
void CApplicationManagementServer::GenerateTempFileNameL(RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
        const CDeploymentComponent& aCompo, TFileName& aSource,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
        TFileName &aMetaSource, TFileName &aFileName,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
        TFileName &aMetaFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   711
    if (!BaflUtils::FolderExists(aFs, KInstallDir))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
        aFs.MkDirAll(KInstallDir);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   714
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   716
    aMetaSource.Copy(aCompo.MetaData().DataFileName());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
    GenerateTempFileNameL(aFs, aMetaSource, aMetaFileName);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   718
    aSource.Copy(aCompo.Data().DataFileName());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
    GenerateTempJarFileNameL(aFs, aMetaSource, aFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
// CApplicationManagementServer::GenerateTempFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
void CApplicationManagementServer::GenerateTempFileNameL(RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
        const CDeploymentComponent& aCompo, TFileName &aFileName,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
        TFileName &aMetaFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
    TFileName ftemp, msource;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
    GenerateTempFileNameL(aFs, aCompo, ftemp, msource, aFileName,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
            aMetaFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
// CApplicationManagementServer::ReadJarFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
TFileName CApplicationManagementServer::ReadJarFileNameL(RFile& aFile) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
    TFileName jarFileName;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   742
    HBufC8* lineBuffer = HBufC8::NewLC(KMaxFileName + 72); // lets hope all lines fit to this
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   743
    TPtr8 linePtr(lineBuffer->Des());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
    TInt length(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
    aFile.Size(length);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
    HBufC8* data = HBufC8::NewLC(length);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   747
    TPtr8 ptr(data->Des());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
    aFile.Read(ptr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
    RDesReadStream stream(*data);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
    CleanupClosePushL(stream);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   751
    TInt colonIndex = -1;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
    TInt err(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
    TInt found(KErrNotFound);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
    const TInt KJadNameValueSeparator = 0x3A; //':' 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   756
    for (;;)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
        TRAP( err, ReadLineL(stream, linePtr) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
        if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
            RDEBUG8_2("Read line: (%S)", &linePtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
            found = linePtr.Find(KMIDletJarURL);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
            if (found != KErrNotFound && found == 0) // found
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
                TPtrC8 filename(linePtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
                colonIndex = linePtr.Locate(KJadNameValueSeparator);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
                if (colonIndex != KErrNotFound)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
                    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   769
                    filename.Set(linePtr.Mid(colonIndex + 1)); // get jar filename, format is: MIDlet-Jar-URL: bomber.jar
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
                    jarFileName.Copy(filename);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
                    jarFileName.Trim();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
                    break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   776
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
            User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
    CleanupStack::PopAndDestroy(3, lineBuffer); // stream, data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
    return jarFileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
// CApplicationManagementServer::ReadLineL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
void CApplicationManagementServer::ReadLineL(RReadStream& aStream,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
        TDes8& aLineBuffer) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
    TBuf8<1> input;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
    const TUint32 LF = 10;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
    const TUint32 CR = 13;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
    TBool endOfLine(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
    TInt errRead(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
    // reset
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
    aLineBuffer.Zero();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   801
    while (!endOfLine)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
        TRAP(errRead, aStream.ReadL(input, 1));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
        if (errRead == KErrEof)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
            // EOF
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
            User::Leave(KErrEof);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
        // check special characters	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
        if (input[0] == LF)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
            // End of line
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
            endOfLine = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   816
        else if (input[0] == CR)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   817
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   818
            // Only end of line if not followed by a LF
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   819
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
        else
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   821
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   822
            // We put any other character in the buffer
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   823
            if (aLineBuffer.Length() < aLineBuffer.MaxLength())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   825
                aLineBuffer.Append(input[0]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   827
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
// CApplicationManagementServer::PrepareInstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
TBool CApplicationManagementServer::PrepareInstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
        const CDeploymentComponent &aComponent, TFileName &aFileName)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
    RDEBUG( "CApplicationManagementServer::PrepareInstallL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
    TBool res(ETrue);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
#ifndef __AM_CONNECT_INSTALLER_ONSTARTUP_
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   842
    TInt err(iInstaller.Connect());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
        RDEBUG_2( "CApplicationManagementServer::PrepareInstallL - ERROR leaving cannot connect installer: %d", err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   848
    CleanupClosePushL(iInstaller);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
    RDEBUG( "CApplicationManagementServer::PrepareInstallL - connected to installer" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
    // Copy data file name (install file)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
    if (aComponent.Data().DataFileName().Length() > 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   855
        aFileName.Copy(aComponent.Data().DataFileName());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   856
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
        // data file has not been created for component!	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
        User::Leave(KErrNotFound);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   861
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
    // Open RFs session
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   863
    User::LeaveIfError(iInstallRFs.Connect());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   864
    User::LeaveIfError(iInstallRFs.ShareProtected());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   865
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
    // set installoptions and correct mime type
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
    using namespace SwiUI;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
    iInstallOptions = aComponent.InstallOpts().iOptions;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
    TInstallReq req;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   870
    if (aComponent.Data().MimeType() == SwiUI::KSisMimeType)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   871
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   872
        //convert if MIME type is application/vnd.symbian.install to x-epoc/x-sisx-app
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   873
        //as installer doesn't support application/vnd.symbian.install MIME type from S60 3rd edition onwards.
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   874
        req.iMIME = SwiUI::KSisxMimeType;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   875
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   876
    else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   877
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   878
        req.iMIME = aComponent.Data().MimeType();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   879
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   880
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   881
    if (CDeploymentComponent::IsJavaMimeL(aComponent.MetaData().MimeType()))
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   882
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   883
        // Check if both jad and jar files already exist in the phone	
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   884
        if (CDeploymentComponent::IsJavaMimeL(aComponent.Data().MimeType())
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   885
                && aComponent.MetaData().MimeType() == SwiUI::KJadMIMEType)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   886
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   887
            // Move both files to temporary location and use jad to install java application
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   888
            CFileMan *fm = CFileMan::NewL(iInstallRFs);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   889
            CleanupStack::PushL(fm);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   890
            TFileName source, metasource, metatarget;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   891
            aFileName.Copy(KNullDesC8()); // reset
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   892
            GenerateTempFileNameL(iInstallRFs, aComponent, source,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   893
                    metasource, aFileName, metatarget);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
            RDEBUG_2( "CApplicationManagementServer::PrepareInstallL - temp jar file '%S'", &aFileName );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   896
            RDEBUG_2( "CApplicationManagementServer::PrepareInstallL - temp jad file '%S'", &metatarget );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   897
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
            // Copy datafile (jar)
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   899
            TInt copyer(fm->Copy(source, aFileName));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   900
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   901
            // Copy metadatafile (jad)
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   902
            TInt copyer2(fm->Copy(metasource, metatarget));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
            CleanupStack::PopAndDestroy(fm);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   905
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   906
            RDEBUG_3( "CApplicationManagementServer::PrepareInstallL - (%d)-(%d)", copyer, copyer2 );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
            if (copyer == KErrNone && copyer2 == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   909
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   910
                res = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
                aFileName = metatarget;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
                req.iMIME = aComponent.MetaData().MimeType();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   914
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   915
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   916
                User::Leave(KErrWrite);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   917
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   918
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   919
        else if (aComponent.MetaData().MimeType() == SwiUI::KJadMIMEType)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   920
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   921
            aFileName.Copy(aComponent.MetaData().DataFileName());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   922
            req.iMIME = aComponent.MetaData().MimeType();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   923
            RDEBUG_2( "CApplicationManagementServer::PrepareInstallL - Using Jad file to install java application: %S", &aFileName );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   924
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   925
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   926
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
    if (aComponent.GetIAP() > -1)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   928
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   929
        req.iIAP = aComponent.GetIAP();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
        RDEBUG_2( "CApplicationManagementServer::PrepareInstallL: setting iap to %d", req.iIAP );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   933
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   934
        TInt iap = KErrNotFound;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   935
        TRAPD( err, SmlHelper::GetDefaultIAPFromDMProfileL( iap ) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
        if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
            req.iIAP = iap;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
            RDEBUG_2("	-> using DM profile default IAP: %d", iap);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   942
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   943
            RDEBUG_2("**** ERROR while fetching DM profile default iap: %d", err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   946
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
    iInstallReq = SwiUI::TInstallReqPckg(req);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
    RDEBUG8_2( "CApplicationManagementServer::PrepareInstallL: mime type is (%S)", &req.iMIME);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
    RDEBUG_2( "CApplicationManagementServer::PrepareInstallL - Using temp file '%S'", &aFileName );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   951
    User::LeaveIfError(iInstallFile.Open(iInstallRFs, aFileName, EFileRead));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
    TInt sz;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   953
    User::LeaveIfError(iInstallFile.Size(sz));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   954
    if (!(sz > 0))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   956
        res = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   957
        RDEBUG( "CApplicationManagementServer::PrepareInstallL - ERROR size of source file is 0!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   958
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   959
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   960
#ifndef __AM_CONNECT_INSTALLER_ONSTARTUP_   
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   961
    CleanupStack::Pop(&iInstaller);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   962
#endif
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   963
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   964
    RDEBUG( "CApplicationManagementServer::PrepareInstallL end" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   965
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   966
    iAppname = aFileName;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   967
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   968
    return res;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   969
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   970
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   971
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   972
// CApplicationManagementServer::InstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   973
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   974
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   975
void CApplicationManagementServer::InstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
        const CDeploymentComponent &aComponent, TRequestStatus &aStatus)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   977
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   978
    RDEBUG( "CApplicationManagementServer::InstallL (async): begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   979
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   980
    if (iInstallInProgress == EFalse)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
        TFileName fn;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   983
        TInt type = EInstallWaitDlg;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   984
        TInt silentsession = 0;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   985
        TInt r2 = RProperty::Get(KPSUidNSmlSOSServerKey, KNSmlDMSilentJob,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   986
                silentsession);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   987
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   988
	  if(r2 == KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   989
		CApplicationManagementUtility::iSilentSession = silentsession;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   990
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   991
        if (!CApplicationManagementUtility::iSilentSession)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   992
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   993
            m_Dlg = new AMWaitProgDialog(m_appName, *this);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   994
            m_Dlg->createWaitDialog(type);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   995
            if (CApplicationManagementUtility::mHidden == 1)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   996
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
   997
                m_Dlg->startIndicator();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   998
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   999
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1000
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1001
                m_Window->raise();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1002
                CApplicationManagementUtility::mCurrDlg->setVisible(true);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1003
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1004
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1005
        if (PrepareInstallL(aComponent, fn))
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1006
            {	  
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1007
            if (m_Dlg)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1008
                m_Dlg->registerInstallRequest(aStatus);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1009
            delete iArgu;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1010
            iArgu = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1011
            iArgu = Usif::COpaqueNamedParams::NewL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1012
            iArgu->AddIntL(Usif::KSifInParam_InstallSilently, 1);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1013
            TAMInstallOptions opts = aComponent.InstallOpts();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1014
            TChar drive = opts.iOptions.iDrive;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1015
            RFs iFs;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1016
            TInt driveNumber;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1017
            iFs.CharToDrive(drive,driveNumber);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1018
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1019
            iArgu->AddIntL(Usif::KSifInParam_Drive, driveNumber);  
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1020
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1021
            delete iResults;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1022
            iResults = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1023
            iResults = Usif::COpaqueNamedParams::NewL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1024
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1025
            RDEBUG_3( "CApplicationManagementServer::InstallL: Install '%S' sizeof opts: %d", &fn, sizeof (aComponent.InstallOpts()));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1026
		TRAPD( err ,iInstaller.Install( iInstallFile, *iArgu, *iResults, aStatus ) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1027
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1028
            RDEBUG_2( "CApplicationManagementServer::InstallL: status: %d", err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1029
            User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1030
            iInstallInProgress = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1031
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1032
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1033
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1034
            RDEBUG( "CApplicationManagementServer::InstallL - PrepareInstallL failed, leaving" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1035
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1036
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1037
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1038
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1039
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1040
        RDEBUG( "CApplicationManagementServer::InstallL (async): previous install still in progress...bailing out" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1041
        TRequestStatus * status = &aStatus;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1042
        User::RequestComplete(status, KErrInUse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1043
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1044
    RDEBUG( "CApplicationManagementServer::InstallL (async): end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1045
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1046
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1047
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
// CApplicationManagementServer::PrepareInstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1049
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1050
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1051
void CApplicationManagementServer::InstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1052
        const CDeploymentComponent &aComponent)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1053
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1054
    RDEBUG( "CApplicationManagementServer::InstallL: begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1055
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1056
    if (iInstallInProgress == EFalse)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1057
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1058
        TFileName fn;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1059
        if (PrepareInstallL(aComponent, fn))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1060
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1061
            iInstallInProgress = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1062
            RDEBUG_2( "CApplicationManagementServer::InstallL: Install '%S' ", &fn);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1063
            SwiUI::TInstallOptionsPckg pkg(aComponent.InstallOpts().iOptions);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1064
            iInstallInProgress = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1065
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1066
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1067
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1068
            RDEBUG( "CApplicationManagementServer::InstallL - PrepareInstallL failed, leaving" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1069
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1070
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1071
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1072
    RDEBUG( "CApplicationManagementServer::InstallL: end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1073
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1074
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1075
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1076
// CApplicationManagementServer::UninstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1077
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1078
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1079
void CApplicationManagementServer::UninstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1080
        const CDeploymentComponent &aComponent, TRequestStatus &aStatus)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1081
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1082
    RDEBUG( "CApplicationManagementServer::UninstallL: begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1083
    if (iInstallInProgress == EFalse)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1084
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1085
        TInt err(iInstaller.Connect());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1086
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1087
        RDEBUG_2( "CApplicationManagementServer::UninstallL: UninstallL '0x%X' ", aComponent.Uid());
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1088
        using namespace SwiUI;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1089
        iUninstallOptions = aComponent.UninstallOpts();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1090
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1091
        delete iArgu;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1092
        iArgu = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1093
        iArgu = Usif::COpaqueNamedParams::NewL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1094
        iArgu->AddIntL( Usif::KSifInParam_InstallSilently, 1 );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1095
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1096
        delete iResults;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1097
        iResults = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1098
        iResults = Usif::COpaqueNamedParams::NewL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1099
        TRAP( err ,iInstaller.Uninstall( aComponent.GetComponentId(), *iArgu, *iResults, aStatus ));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1100
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1101
        RDEBUG_2( "CApplicationManagementServer::UninstallL: UninstallL result '0x%X'", err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1102
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1103
        iInstallInProgress = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1104
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1105
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1106
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1107
        RDEBUG( "CApplicationManagementServer::UninstallL: previous uninstall still in progress...bailing out" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1108
        TRequestStatus * status = &aStatus;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1109
        User::RequestComplete(status, KErrInUse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1110
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1111
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1112
    RDEBUG( "CApplicationManagementServer::UninstallL: end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1113
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1114
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
// CApplicationManagementServer::PerformRFSL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1116
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1117
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
void CApplicationManagementServer::PerformRFSL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
    RDEBUG( "CApplicationManagementServer::PerformRFSL: begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
    const RComponentIdArray &arrt = iStorage->GetComponentIds();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1122
    TCertInfoPckg *corcert = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1123
    for (TInt i(0); i < arrt.Count(); i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
        RDEBUG_3( "CApplicationManagementServer::PerformRFSL processing dc %d of %d", i, arrt.Count() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
        CDeploymentComponent &c = iStorage->ComponentL(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
        const RCertArray &certs = iStorage->Certificates();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
        TInt index = c.Owner();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1130
        TCertInfoPckg *certp = NULL;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
        if (index >= 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1133
            certp = certs[c.Owner()];
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1134
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1135
        if (!corcert && certp)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1136
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1137
            if (CheckCertL((*certp)()))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1139
                corcert = certp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
                RDEBUG_2( "CApplicationManagementServer::PerformRFSL Found CORP Cert! Removing %d ", i );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
                RemoveInternalL(c);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
                RDEBUG_2( "CApplicationManagementServer::PerformRFSL skipping %d because not corp dc", i );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
            if (corcert == certp)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
                RDEBUG_2( "CApplicationManagementServer::PerformRFSL Removing %d ", i );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
                RemoveInternalL(c);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
                RDEBUG_2( "CApplicationManagementServer::PerformRFSL skipping %d because not corp dc", i );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
    RDEBUG( "CApplicationManagementServer::PerformRFSL: end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1163
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1164
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1165
// CApplicationManagementServer::RemoveInternalL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1168
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
void CApplicationManagementServer::RemoveInternalL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
        const CDeploymentComponent &aCompo, TBool aDoUninstall /* = ETrue */)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1171
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1172
    RDEBUG_2("CApplicationManagementServer: RemoveInternalL - Remove id: (%d)", aCompo.InternalId() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1173
    TInt err(KErrNone);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1174
    TDeploymentComponentName name = aCompo.ComponentName();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1175
    TBuf<KDeploymentComponentNameMaxLength> ne;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1176
    ne.Copy(name);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1177
    m_appName = QString::fromUtf16(ne.Ptr(), ne.Length());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1178
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1179
    RDEBUG("CApplicationManagementServer: RemoveInternalL - step1");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1180
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1181
    TInt err1 = KErrNone;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1182
    if (!err1)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1184
        RDEBUG("CApplicationManagementServer: RemoveInternalL - step2");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1185
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1186
        aCompo.SetStatusNode(EDelivered_RemoveProgress);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1187
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1188
        TDeploymentComponentState st(aCompo.State());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1189
        if (st == EDCSDelivered || st == EDCSDownload)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1191
            RDEBUG("CApplicationManagementServer: RemoveInternalL - step3 start");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1192
            TRAP(err,iStorage->RemoveL( aCompo.InternalId() ));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1193
            RDEBUG("CApplicationManagementServer: RemoveInternalL - step4 start");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1194
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1195
        else if (st == EDCSActive || st == EDCSInactive)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1196
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1197
            RDEBUG("CApplicationManagementServer: RemoveInternalL - step5 start");
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1198
            if (aDoUninstall)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1199
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1200
                if (aCompo.Uid() != TUid::Null())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1202
                    TInt nonSilentOperation = KErrNotFound;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1203
                    iOMASCOMOEnabled = IsOMASCOMOEnabledL();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1204
                    if (!iOMASCOMOEnabled)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1205
                        nonSilentOperation = 0;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1206
                    RDEBUG("CApplicationManagementServer: RemoveInternalL - step5 start 1");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1207
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1208
                    TInt silentsession = 0;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1209
                    RProperty::Get(KPSUidNSmlSOSServerKey, KNSmlDMSilentJob,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1210
                            silentsession);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1211
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1212
                    CApplicationManagementUtility::iSilentSession
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1213
                            = silentsession;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1214
                    TRequestStatus s1 = KRequestPending;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1215
                    AppMgmtNotifier* note = new AppMgmtNotifier(m_appName);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1216
                    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1217
                    // displaying uninstall confirm notes
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1218
                    if (!CApplicationManagementUtility::iSilentSession)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1219
                        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1220
                        CDialogWait* wait = CDialogWait::NewL(); 
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1221
                        note->showUninstallDialog(aCompo, wait->iStatus);     
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1222
                        m_Window->raise();   
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1223
                        wait->StartWait();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1224
                        s1=wait->iStatus;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1225
                        delete wait;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
                        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1227
                    if (s1 != KStatusUserCancelled)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
                        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1229
                        TInt type = EUninstallWaitDlg;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1230
                        TRequestStatus s;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1231
                        if (!CApplicationManagementUtility::iSilentSession)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
                            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1233
                            m_Dlg = new AMWaitProgDialog(m_appName, *this);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1234
                            m_Dlg->createWaitDialog(type);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1235
                            m_Window->raise();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1236
                            CApplicationManagementUtility::mCurrDlg->setVisible(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1237
                                        true);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1238
                                
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1239
                            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1240
                        CDialogWait* wait1 = CDialogWait::NewL();           
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1241
                     
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1242
                        TRAP(err,UninstallL( aCompo, wait1->iStatus ));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1243
                        //wait till uninstall completes
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1244
                        wait1->StartWait();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1245
                        if (!CApplicationManagementUtility::iSilentSession)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1246
                            m_Dlg->closeAMWaitDialog();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1247
                        m_Window->lower();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1248
                        s = wait1->iStatus;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1249
                        delete wait1;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1250
                        iInstallInProgress = EFalse;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1251
                        // Capturing Installer errors,if any
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1252
                        err = s.Int();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1253
                        if (s.Int() == KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1254
                            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1255
                            note->showUnInstallSuccessNote();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1256
                            RDEBUG("CApplicationManagementServer::RemoveInternalL Uninstalled");
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1257
                            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
                        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
                            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1260
                            note->showUnInstallFailedNote();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1261
                            if (s.Int() == KErrNotFound)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1262
                                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1263
                                RDEBUG( "CApplicationManagementServer: RemoveInternalL WARNING component was not found by uninstaller" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1264
                                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1265
                            else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1266
                                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1267
                                RDEBUG_2("CApplicationManagementServer: RemoveInternalL ERROR uninstall failed %d", s.Int() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1268
                                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1269
                            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1270
                        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1271
                    else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1272
                        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1273
                        err = SwiUI::KSWInstErrUserCancel;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1274
                        aCompo.SetStatusNode(EDelivered_RemoveFailed);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1275
                        RDEBUG( "CApplicationManagementServer: RemoveInternalL User cancelled" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1276
                        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1277
                    delete note;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1278
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1279
                else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1280
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
                    RDEBUG( "CApplicationManagementServer: RemoveInternalL ERROR component is deployed but has null uid - it cannot be uninstalled!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1283
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1284
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1285
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1286
                RDEBUG_2("CApplicationManagementServer: RemoveInternalL - Skipped uninstall of %d", aCompo.InternalId() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1288
            /*
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1289
             *   if (unstall is sucesss) then remove component from storage
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1290
             *   
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1291
             */
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1292
            if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1294
                iStorage->RemoveL(aCompo.InternalId());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1296
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1297
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1298
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1299
            RDEBUG_2("CApplicationManagementServer: RemoveInternalL ERROR called with illegal state component id %d", aCompo.State() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1302
        /*  
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1303
         * if error set state to remove failed
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1304
         * Finally call userleaveiferror()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1305
         * */
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1306
        if (err != KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1307
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1308
            aCompo.SetStatusNode(EDelivered_RemoveFailed);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1309
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1310
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1311
    else
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1312
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1313
        err = SwiUI::KSWInstErrUserCancel;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1314
        aCompo.SetStatusNode(EDelivered_RemoveFailed);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1315
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1316
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
    User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
    }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1319
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1321
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1322
// CApplicationManagementServer::CheckCertL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1324
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1325
TBool CApplicationManagementServer::CheckCertL(const TCertInfo &aInfo) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1326
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1327
    TBool go(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1328
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1329
    if (FeatureManager::FeatureSupported(KFeatureIdSapPolicyManagement))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
        //	#ifdef __SAP_POLICY_MANAGEMENT
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1332
        RPolicyEngine peng;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1333
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
        // The management session
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1335
        //
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1336
        TInt err(peng.Connect());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1337
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1338
        if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1339
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1340
            CleanupClosePushL(peng);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1341
            RPolicyRequest rq;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1342
            err = rq.Open(peng);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1343
            if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1344
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1345
                CleanupClosePushL(rq);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1346
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1347
                TRequestContext rc;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1348
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1349
                using namespace PolicyEngineXACML;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1350
                using namespace NPolicyConstants;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1351
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1352
                rc.AddSubjectAttributeL(KTrustedSubject, aInfo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1353
                rc.AddResourceAttributeL(KResourceId, KApplicationManagement,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1354
                        KStringDataType);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1355
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1356
                TResponse resp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1357
                err = rq.MakeRequest(rc, resp);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
                if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
                    if (resp.GetResponseValue() == EResponsePermit
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
#ifdef _DEBUG
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1362
                            || resp.GetResponseValue()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
                                    == EResponseNotApplicable
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
#endif 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
                    )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
                        go = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
                    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
                        RDEBUG_2( "CApplicationManagementSession::CheckCertL; Policy response denies access! %d", resp.GetResponseValue());
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
                else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
                    RDEBUG_2( "CApplicationManagementSession::CheckCertL; ERROR making policy request! %d", err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
                    }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1378
                CleanupStack::PopAndDestroy(&rq);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
                RDEBUG_2( "CApplicationManagementSession::CheckCertL; ERROR Failed to open policy engine session! %d", err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1384
            CleanupStack::PopAndDestroy(&peng);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
            RDEBUG_2( "CApplicationManagementSession::CheckCertL; ERROR Failed to connect policy engine! %d", err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1390
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1391
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
        RDEBUG( "CApplicationManagementSession::CheckCertL; No PolicyManagement by featmgr-> cert ok!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1395
        go = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1396
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1397
    return go;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1399
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1400
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1401
// CApplicationManagementServer::HasUidL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1403
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1404
TBool CApplicationManagementServer::HasUidL(const TUid &aUid,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1405
        CDeploymentComponent *& aCompo, CDeploymentComponent *aIgnored /* = NULL */)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1406
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
    TBool found(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
    const RComponentIdArray &arrt = iStorage->GetComponentIds();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1409
    TInt count(arrt.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1410
    for (TInt i(0); i < count; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
        CDeploymentComponent &compo = iStorage->ComponentL(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
        if (compo.Uid() == aUid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1415
            if (&compo != aIgnored)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1416
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1417
                aCompo = &compo;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
                found = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
                RDEBUG_3( "ApplicationManagementServer: UidExistsL 0x%X - Found NOT ignored %d", aUid.iUid, compo.InternalId() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1422
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
                RDEBUG( "ApplicationManagementServer: UidExistsL - Found ignored " );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1427
    if (!found)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1429
        found = FindInstalledSisUidL(aUid);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1430
        if (!found)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
            found = FindInstalledJavaUidL(aUid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1435
    return found;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1437
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1438
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
// CApplicationManagementServer::FindInstalledSisUidL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1441
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1442
TBool CApplicationManagementServer::FindInstalledSisUidL(const TUid &aUid) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
    TBool found(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
    Swi::RSisRegistrySession sisses;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1446
    TInt r(sisses.Connect());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1447
    User::LeaveIfError(r);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
    CleanupClosePushL(sisses);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
    RArray<TUid> uids;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
    sisses.InstalledUidsL(uids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
    CleanupClosePushL(uids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1454
    TInt uidc(uids.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1455
    for (TInt j(0); found == EFalse && j < uidc; j++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
        if (uids[j] == aUid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1458
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1459
            found = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1462
    CleanupStack::PopAndDestroy(&uids);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1463
    CleanupStack::PopAndDestroy(&sisses);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1465
    return found;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1466
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1467
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1468
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1469
// CApplicationManagementServer::FindInstalledJavaUidL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1470
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1471
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
TBool CApplicationManagementServer::FindInstalledJavaUidL(const TUid &aUid) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
    TBool found(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
    iUtility->RefreshJavaRegistryL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1476
    found = iUtility->FindInstalledJavaUidL(aUid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1477
    return found;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1478
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1479
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1480
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1481
// CApplicationManagementServer::FindNewUid()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1482
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
TUid CApplicationManagementServer::FindNewUid(const RArray<TUid> &aUidsOrig,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
        const RArray<TUid> &aUidsNew) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1487
    TUid ret(TUid::Null());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1488
    TInt c1(aUidsOrig.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1489
    TInt c2(aUidsNew.Count());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
    if (c2 >= c1)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1491
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1492
        for (TInt i(c2 - 1); i >= 0 && !ret.iUid; i--)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1493
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1494
            if (aUidsOrig.Find(aUidsNew[i]) == KErrNotFound)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1495
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1496
                ret = aUidsNew[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1499
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1500
    return ret;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1502
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1503
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
// CApplicationManagementServer::JavaUidsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
void CApplicationManagementServer::JavaUidsL(RArray<TUid> &aUids) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1508
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
    iUtility->RefreshJavaRegistryL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
    iUtility->JavaUidsL(aUids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1513
void CApplicationManagementServer::CheckforDuplicateMidletsL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
        TMidletParameters& amidletParameters)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1515
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1516
    RDEBUG( "CApplicationManagementServer::CheckforDuplicateMidletsL: Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
    const RComponentIdArray &arrt = iStorage->GetComponentIds();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1518
    TInt cont(arrt.Count());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
    for (TInt i( 0); i < cont; i++)
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1520
     {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1521
     CDeploymentComponent &compo = iStorage->ComponentL(arrt[i]);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1522
     if (((compo.State() == EDCSActive) || (compo.State() == EDCSInactive ))
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1523
     && (compo.MidletName()== amidletParameters.iMidletName)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1524
     && (compo.MidletVendor()== amidletParameters.iMidletVenorName))
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1525
     {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1526
     //remove old one
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1527
     iStorage->RemoveL(compo.InternalId() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1528
     }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1529
     }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1530
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1531
    RDEBUG( "CApplicationManagementServer::CheckforDuplicateMidletsL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1533
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1534
// CApplicationManagementServer::JavaInstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1536
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1537
void CApplicationManagementServer::JavaInstallL(CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1539
    RDEBUG( "CApplicationManagementServer::JavaInstallL: Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1540
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1541
    //TRequestStatus s;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
    TInt err(KErrNone);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1543
    // set state to install progressf
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1544
    CDialogWait* wait = CDialogWait::NewL();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
    aCompo.SetStatusNode(EDelivered_InstallProgress);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1546
    TRAP(err,InstallL( aCompo,wait->iStatus ));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1547
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1548
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1549
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1550
        delete wait;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
        User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1552
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1553
    wait->StartWait();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1554
    if (!CApplicationManagementUtility::iSilentSession && CApplicationManagementUtility::mCurrDlg)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1555
        m_Dlg->closeAMWaitDialog();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1556
    m_Window->lower();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1557
    TRequestStatus s1 = wait->iStatus;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1558
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1559
    RDEBUG_2( "ApplicationManagementSession: JavaInstallL 1 failed with code %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1560
                s1.Int() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1561
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1562
    TInt usifdeplid = -1;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1563
        if (iResults && wait->iStatus.Int()!=KErrCancel)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1564
	  {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1565
            iResults->GetIntByNameL(Usif::KSifOutParam_ComponentId, usifdeplid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1566
    		RDEBUG_2( "ApplicationManagementSession: JavaInstallL usifdeplid %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1567
                usifdeplid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1568
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1569
	  }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1570
      RDEBUG( "wait->StartWait() CApplicationManagementServer::javainstallL Step3");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1571
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1572
        aCompo.SetComponentId(usifdeplid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1573
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1574
         s1 = wait->iStatus;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1575
        delete wait;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1576
        RDEBUG_2("ApplicationManagementSession: javainstallL with code %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1577
                        s1.Int() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1578
    if (s1 == KErrCancel)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1580
        RDEBUG_2( "ApplicationManagementSession: JavaInstallL failed with code %d",
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1581
                s1.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1582
        // set state to install failed with data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1584
        User::Leave(s1.Int());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1586
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
        TMidletParameters midletParameters;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
        iUtility->RefreshJavaRegistryL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
        //Ignore if any error comes
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1591
        TRAPD(err,iUtility->GetInstalledMidletParametersL(midletParameters));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
        TRAP(err,CheckforDuplicateMidletsL(midletParameters));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1593
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1594
        if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1595
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1596
            aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
            User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1598
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1599
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1600
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1601
            aCompo.SetStatusNode(EIdle);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1602
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1603
        aCompo.SetUid(midletParameters.iMidletUid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1604
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1605
        RDEBUG( "CApplicationManagementServer::JavaInstallL: Step1");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1606
        if (aCompo.ComponentVersion() == KNullDesC8)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1607
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1608
            aCompo.SetVersionL(midletParameters.bufVersion);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1609
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1610
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1611
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1612
        TBool status = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1613
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1614
        //Since "C" drive is not removable
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1615
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1616
        if (midletParameters.iDrive != EDriveC)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1617
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1618
            status = IsInstalledAppRemovableL(midletParameters.iDrive);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1619
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1620
        if (status)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1621
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1622
            RDEBUG( "IsInstalledAppRemovableL(midletParameters.iDrive); True");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1623
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1624
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1626
            RDEBUG( "IsInstalledAppRemovableL(midletParameters.iDrive); False");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1627
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1628
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
        //check for status drive
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1630
        aCompo.SetAppRemovableStatus(status);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1631
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1632
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1633
    RDEBUG( "CApplicationManagementServer::JavaInstallL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1635
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1636
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1637
// CApplicationManagementServer::SisInstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1638
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1639
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1640
void CApplicationManagementServer::SisInstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1641
        const CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1642
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1643
    TRequestStatus s;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1644
    CDialogWait* wait = CDialogWait::NewL();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1645
    // set state to install progress
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1646
    aCompo.SetStatusNode(EDelivered_InstallProgress);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1647
    TInt err(KErrNone);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1648
    TRAP(err,InstallL( aCompo,wait->iStatus ));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1649
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1650
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1651
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1652
        delete wait;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1653
        User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1654
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1655
    RDEBUG_2("ApplicationManagementSession: SisInstallL failed with code before startwait %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1656
            wait->iStatus.Int() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1657
    wait->StartWait();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1658
    RDEBUG_2("ApplicationManagementSession: SisInstallL failed with code after startwait %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1659
                wait->iStatus.Int() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1660
    RDEBUG( "wait->StartWait() CApplicationManagementServer::SisInstallL Step1");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1661
    if (!CApplicationManagementUtility::iSilentSession && CApplicationManagementUtility::mCurrDlg)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1662
        m_Dlg->closeAMWaitDialog();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1663
    delete m_Dlg;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1664
    m_Dlg=NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1665
    RDEBUG( "wait->StartWait() CApplicationManagementServer::SisInstallL Step2");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1666
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1667
    m_Window->lower();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1668
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1669
    TInt usifdeplid = -1;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1670
    if (iResults && wait->iStatus.Int()!=KErrCancel)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1671
        iResults->GetIntByNameL(Usif::KSifOutParam_ComponentId, usifdeplid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1672
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1673
    RDEBUG( "wait->StartWait() CApplicationManagementServer::SisInstallL Step3");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1674
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1675
    iComp->SetComponentId(usifdeplid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1676
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1677
    TRequestStatus s1 = wait->iStatus;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1678
    delete wait;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1679
    RDEBUG_2("ApplicationManagementSession: SisInstallL with code %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1680
                    s1.Int() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1681
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1682
    if(s1 == KErrCancel)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1683
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1684
        s1 = KStatusUserCancelled;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1685
        RDEBUG( "KErrCancel visited operation cancelled");
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1686
        mUserCancelled=1;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1687
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1688
    if (s1 != KErrNone)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1689
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1690
        RDEBUG_2("ApplicationManagementSession: SisInstallL failed with code %d",
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1691
                s1.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1692
        // set state to install failed with data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1693
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1694
        User::Leave(s1.Int());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1695
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1696
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1697
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1698
        // set state to install sucessful
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1699
        aCompo.SetStatusNode(EIdle);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1700
        RDEBUG("ApplicationManagementSession: SisInstallL successfull" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1701
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1702
    RDEBUG( "CApplicationManagementServer::SisInstallL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1703
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1704
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1705
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1706
// CApplicationManagementServer::DoTheInstallL()
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1707
// ---------------------------------------------------- --------------------------------------------	
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1708
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1709
void CApplicationManagementServer::DoTheInstallL(CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1710
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1711
    RDEBUG( "CApplicationManagementServer::DoTheInstallL: Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1712
    TInt error(KErrNone);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1713
    iComp = &aCompo;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1714
    
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1715
    TDeploymentComponentName name = aCompo.ComponentName();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1716
    if(name.Compare(KNullDesC8())==0)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1717
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1718
        name = aCompo.UserId();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1719
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1720
    TBuf<KDeploymentComponentNameMaxLength> nameBuf;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1721
    nameBuf.Copy(name);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1722
    m_appName = QString::fromUtf16(nameBuf.Ptr(), nameBuf.Length());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1723
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1724
    TRequestStatus stat = KErrCompletion;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1725
    if (!aCompo.DriveSelected()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1726
            && !CApplicationManagementUtility::iSilentSession)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1727
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1728
        // displaying install confirm notes
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1729
        CDialogWait* ao = CDialogWait::NewL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1730
        AppMgmtNotifier* note = new AppMgmtNotifier();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1731
        int err = KErrNone;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1732
        TRAP( err, QT_TRYCATCH_LEAVING(note->showInstallDialog(iComp, ao->iStatus)));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1733
        ao->StartWait();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1734
        stat = ao->iStatus;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1735
        delete ao;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1736
        m_Window->lower();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1737
        delete note;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1738
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1739
    aCompo.SetDriveSelectionStatus(false);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1740
    if (stat == KErrCompletion)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1741
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1742
        if (CDeploymentComponent::IsJavaMimeL(aCompo.Data().MimeType())
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1743
                || CDeploymentComponent::IsJavaMimeL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1744
                        aCompo.MetaData().MimeType()))
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1745
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1746
            TRAP( error, JavaInstallL( aCompo ) );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1747
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1748
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1749
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1750
            TRAP( error, SisInstallL( aCompo ) );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1751
            if(error==KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1752
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1753
                SetSisAppVersionAndDriveL(aCompo);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1754
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1755
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1756
      
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1757
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1758
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1759
        if (error == KErrNone)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1760
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1761
            InstallCompleteL(aCompo, ETrue);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1762
            CDeploymentComponent *old = DoDataUpdateCheckL(aCompo);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1763
            if (old)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1764
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1765
                if (aCompo.State() == EDCSDelivered)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1766
                    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1767
                    if (old->State() == EDCSActive || old->State()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1768
                            == EDCSInactive)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1769
                        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1770
                        RDEBUG("AMSession: DoTheInstallL ** deleting old node **" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1771
                        iStorage->RemoveL(old->InternalId());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1772
                        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1773
                    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1774
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1775
            iStorage->InstalledL(aCompo);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1776
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1777
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1778
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1779
            InstallCompleteL(aCompo, EFalse);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1780
            User::Leave(error);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1781
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1782
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1783
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1784
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1785
        aCompo.SetStatusNode(EDelivered_InstallFailedwithOutData);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1786
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1787
    
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1788
    RDEBUG( "CApplicationManagementServer::DoTheInstallL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1789
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1790
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1791
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1792
// CApplicationManagementServer::DoDataUpdateCheckL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1793
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1794
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1795
CDeploymentComponent *CApplicationManagementServer::DoDataUpdateCheckL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1796
        CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1797
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1798
    CDeploymentComponent *old = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1799
    if (aCompo.Uid() != TUid::Null() && HasUidL(aCompo.Uid(), old, &aCompo))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1800
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1801
        // check for Uid component.. Legacy code removed.
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1802
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1803
    return old;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1804
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1805
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1806
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1807
// CApplicationManagementServer::SetDataL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1808
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1809
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1810
void CApplicationManagementServer::SetDataL(CDeploymentComponent &aCompo,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1811
        const TDesC8 &aData, const TDesC8 &aMime)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1812
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1813
    aCompo.SetDataL(aData, aMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1814
    DoDataUpdateCheckL(aCompo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1815
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1816
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1817
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1818
// CApplicationManagementServer::FullUpdateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1819
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1820
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1821
void CApplicationManagementServer::FullUpdateL(const TUint32 sid,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1822
        const TUint32 tid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1823
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1824
    CDeploymentComponent &scompo = iStorage->ComponentL(sid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1825
    CDeploymentComponent &tcompo = iStorage->ComponentL(tid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1826
    FullUpdateL(scompo, tcompo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1827
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1828
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1829
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1830
// CApplicationManagementServer::FullUpdateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1831
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1832
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1833
void CApplicationManagementServer::FullUpdateL(CDeploymentComponent &scompo,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1834
        const CDeploymentComponent &tcompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1835
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1836
    if (scompo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1837
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1838
        if (tcompo.State() == EDCSActive || tcompo.State() == EDCSInactive)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1839
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1840
            TRequestStatus s2;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1841
            InstallL(scompo, s2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1842
            User::WaitForRequest(s2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1843
            if (s2 != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1844
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1845
                RDEBUG_2( "ApplicationManagementSession: FullUpdateL failed with code %d", s2.Int() );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1846
                User::Leave(s2.Int());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1847
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1848
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1849
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1850
                InstallCompleteL(scompo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1851
                // Before deleting old node ,copy node values which are not set in new node from old node
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1852
                if (scompo.ComponentId() == KNullDesC8)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1853
                    scompo.SetIdL(tcompo.ComponentId());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1854
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1855
                if (scompo.ComponentName() == KNullDesC8)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1856
                    scompo.SetNameL(tcompo.ComponentName());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1857
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1858
                if (scompo.ComponentVersion() == KNullDesC8)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1859
                    scompo.SetVersionL(tcompo.ComponentVersion());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1860
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1861
                //Tag tcompo state for deletion. Cant delete now, since nsmldmtree woudnt be updated
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1862
                //Remove the const'ness since state needs to be updated.
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1863
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1864
                iStorage->SetDeploymentComponentState(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1865
                        const_cast<CDeploymentComponent &> (tcompo),
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1866
                        EDCSDelete);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1867
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1868
                iStorage->InstalledL(scompo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1869
                RDEBUG( "ApplicationManagementSession: FullUpdateL ok" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1870
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1871
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1872
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1873
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1874
            RDEBUG_2( "ApplicationManagementSession: ERROR FullUpdateL called for illegal state component: %d!", scompo.State() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1875
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1876
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1877
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1878
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1879
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1880
        RDEBUG( "ApplicationManagementSession: ERROR FullUpdateL called for illegal state message!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1881
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1882
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1883
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1884
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1885
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1886
// CApplicationManagementServer::IsDataFileB64EncodedL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1887
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1888
TBool CApplicationManagementServer::IsDataFileB64EncodedL(RFile &aFile,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1889
        TInt& aLength)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1890
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1891
    RDEBUG("CApplicationManagementServer::IsDataFileB64EncodedL()  : start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1892
    TBool encoded = ETrue; // assume b64 encoded
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1893
    TInt bufSize(KBase64BufSize);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1894
    TInt offset(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1895
    HBufC8 *dataBuf = HBufC8::NewLC(bufSize);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1896
    TPtr8 dataPtr = dataBuf->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1897
    aFile.Size(aLength);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1898
    aFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1899
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1900
    while (encoded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1901
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1902
        aFile.Read(dataPtr);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1903
        if (!dataPtr.Length())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1904
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1905
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1906
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1907
        offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1908
        aFile.Seek(ESeekCurrent, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1909
        RDEBUG_2("OFFSET: %d", offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1910
        encoded = CheckB64Encode(dataPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1911
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1912
    RDEBUG_2("Encoded: %d", encoded);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1913
    CleanupStack::PopAndDestroy(dataBuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1914
    offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1915
    aFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1916
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1917
    RDEBUG("CApplicationManagementServer::IsDataFileB64EncodedL()  : end");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1918
    return encoded;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1919
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1920
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1921
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1922
// CApplicationManagementServer::CheckB64Encode( const TDesC8& aData )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1923
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1924
TBool CApplicationManagementServer::CheckB64Encode(const TDesC8& aData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1925
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1926
    TInt inputIndex = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1927
    TInt inputLen = aData.Length();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1928
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1929
    while (inputIndex < inputLen)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1930
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1931
        const TUint8& p = aData[inputIndex];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1932
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1933
        if ((p >= 48 && p <= 57) || (p >= 65 && p <= 90) || (p >= 97 && p
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1934
                <= 122) || p == 43 || p == 47 || p == 61 || p == 10 || p
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1935
                == 13)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1936
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1937
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1938
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1939
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1940
            return EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1941
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1942
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1943
        inputIndex++;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1944
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1945
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1946
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1947
    return ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1948
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1949
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1950
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1951
// CApplicationManagementServer::GetAMServerDownloadDBL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1952
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1953
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1954
void CApplicationManagementServer::GetAMServerDownloadDBL(TUint32 internalid,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1955
        TInt& finalresult, TDes8& aTargetURI)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1956
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1957
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step1" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1958
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1959
    TBuf<50> internalidbuf;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1960
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1961
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step2" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1962
    internalidbuf.Num(internalid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1963
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1964
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step3" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1965
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1966
    RPointerArray<CAMDbItem> aItemArray;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1967
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1968
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step4" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1969
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1970
    iAMServerDB->GetEntryForLUIDL(aItemArray, internalidbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1971
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1972
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step5" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1973
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  1974
    if (aItemArray.Count() != 0)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1975
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1976
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step6" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1977
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1978
        finalresult = aItemArray[0]->iResult;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1979
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1980
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step7" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1981
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1982
        if (finalresult < KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1983
            User::Leave(KErrGeneral);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1984
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1985
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step8" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1986
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1987
        if (*aItemArray[0]->iTargetURI == KNullDesC8())
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1988
            User::Leave(KErrGeneral);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1989
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1990
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step9" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1991
        aTargetURI.Copy(*aItemArray[0]->iTargetURI);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1992
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1993
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1994
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step10" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1995
    aItemArray.ResetAndDestroy();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1996
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1997
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1998
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1999
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2000
// CApplicationManagementServer::DeleteGenericAlertForIDL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2001
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2002
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2003
void CApplicationManagementServer::DeleteGenericAlertForIDL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2004
        TUint32 internalid)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2005
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2006
    iAMServerDB->DeleteFromDatabaseL(internalid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2007
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2008
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2009
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2010
// CApplicationManagementServer::DecodeB64DataFileL( RFile& aDataFile, RFile& aDestinationFile )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2011
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2012
void CApplicationManagementServer::DecodeB64DataFileL(RFile& aSourceFile,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2013
        RFile& aDestinationFile)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2014
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2015
    RDEBUG( "CApplicationManagementServer::DecodeB64DataFileL(): Start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2016
    // Create buffers
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2017
    //TInt b64bufferSize = 131072;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2018
    TInt decodedBufferSize = ((KBase64BufSize * 3) / 4 + 16);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2019
    HBufC8 *dataBuf = HBufC8::NewLC(KBase64BufSize);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2020
    TPtr8 dataPtr = dataBuf->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2021
    HBufC8* targetBuf = HBufC8::NewLC(decodedBufferSize);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2022
    TPtr8 targetPtr(targetBuf->Des());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2023
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2024
    TInt offset(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2025
    TInt length(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2026
    TBool reading(ETrue);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2027
    aSourceFile.Size(length);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2028
    RDEBUG_2( "CApplicationManagementServer::DecodeB64DataFileL(): b64 file total size: (%d)", length );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2029
    aSourceFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2030
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2031
    // Initialize decoder
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2032
    TImCodecB64 B64Coder;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2033
    B64Coder.Initialise();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2034
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2035
    while (reading)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2036
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2037
        aSourceFile.Read(dataPtr);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2038
        if (!dataPtr.Length())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2039
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2040
            // EOF
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2041
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2042
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2043
        offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2044
        aSourceFile.Seek(ESeekCurrent, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2045
        RDEBUG_2("OFFSET: %d", offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2046
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2047
        // decode data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2048
        B64Coder.Decode(dataPtr, targetPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2049
        // write decoded data to temporary file
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2050
        aDestinationFile.Write(targetPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2051
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2052
    CleanupStack::PopAndDestroy(targetBuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2053
    CleanupStack::PopAndDestroy(dataBuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2054
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2055
    offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2056
    aDestinationFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2057
    RDEBUG( "CApplicationManagementServer::DecodeB64DataFileL(): end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2058
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2059
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2060
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2061
// CApplicationManagementServer::DecodeB64DataLC( const TDesC8& aData )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2062
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2063
HBufC8* CApplicationManagementServer::DecodeB64DataLC(const TDesC8 &aData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2064
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2065
    RDEBUG( "CApplicationManagementServer::DecodeB64DataLC(): Start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2066
    TImCodecB64 B64Coder;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2067
    B64Coder.Initialise();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2068
    HBufC8 *target = HBufC8::NewLC((aData.Length() * 3) / 4 + 16);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2069
    TPtr8 targetPtr(target->Des());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2070
    B64Coder.Decode(aData, targetPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2071
    RDEBUG( "CApplicationManagementServer::DecodeB64DataLC(): End" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2072
    return target;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2073
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2074
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2075
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2076
//  CApplicationManagementServer::EncodeDataL( const TDesC8& aData, CBufBase &aTarget )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2077
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2078
void CApplicationManagementServer::EncodeDataL(const TDesC8& aData,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2079
        CBufBase &aTarget)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2080
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2081
    TInt outLen(aData.Length() * 2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2082
    aTarget.ExpandL(0, outLen);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2083
    TImCodecB64 B64Coder;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2084
    B64Coder.Initialise();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2085
    TPtr8 target(aTarget.Ptr(0));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2086
    TInt decoded(B64Coder.Encode(aData, target));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2087
    TInt s(target.Length());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2088
    aTarget.ResizeL(s);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2089
    aTarget.Compress();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2090
    if (!decoded)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2091
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2092
        RDEBUG( "CApplicationManagementServer::EncodeDataL(): Encoding b64 failed?" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2093
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2094
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2095
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2096
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2097
// CApplicationManagementSession::CApplicationManagementSession
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2098
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2099
inline CApplicationManagementSession::CApplicationManagementSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2100
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2101
    RDEBUG_2( "CApplicationManagementSession::CApplicationManagementSession 0x%x", this);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2102
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2103
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2104
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2105
// CApplicationManagementSession::CApplicationManagementSession
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2106
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2107
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2108
inline CApplicationManagementSession::CApplicationManagementSession(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2109
        const TCertInfo &aInfo) :
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2110
    iCertInfo(aInfo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2111
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2112
    RDEBUG( "CApplicationManagementSession::CApplicationManagementSession (cert) " );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2113
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2114
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2115
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2116
// CApplicationManagementSession::Server()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2117
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2118
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2119
inline CApplicationManagementServer& CApplicationManagementSession::Server() const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2120
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2121
    return *static_cast<CApplicationManagementServer*> (const_cast<CServer2*> (CSession2::Server()));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2122
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2123
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2124
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2125
// CApplicationManagementSession::CreateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2126
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2127
// 2nd phase construct for sessions - called by the CServer framework
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2128
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2129
void CApplicationManagementSession::CreateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2130
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2131
    RDEBUG_2( "ApplicationManagementSession: CApplicationManagementSession::CreateL: 0x%x", this );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2132
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2133
    Server().AddSession();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2134
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2135
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2136
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2137
// CApplicationManagementSession::~CApplicationManagementSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2138
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2139
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2140
CApplicationManagementSession::~CApplicationManagementSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2141
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2142
    RDEBUG_3("CApplicationManagementSession::~CApplicationManagementSession 0x%X - 0x%X", reinterpret_cast<TUint>(this),
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2143
            reinterpret_cast<TUint>(this)+sizeof( CApplicationManagementSession ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2144
    RDEBUG_2("CApplicationManagementSession::~CApplicationManagementSession iCertInfo offs 0x%X",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2145
            reinterpret_cast<TUint>(&this->iCertInfo) - reinterpret_cast<TUint>(this) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2146
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2147
    Server().DropSession();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2148
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2149
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2150
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2151
// CApplicationManagementSession::ServiceL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2152
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2153
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2154
void CApplicationManagementSession::ServiceL(const RMessage2& aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2155
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2156
    if (aMessage.Function() == EPerformRfs)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2157
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2158
        TRAPD( err, Server().PerformRFSL() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2159
        aMessage.Complete(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2160
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2161
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2162
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2163
        TBool handled(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2164
        TInt err(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2165
        TRAP( err, handled = PreDispatchMessageL( aMessage ) );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2166
        if (!handled)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2167
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2168
            TRAP(err,DispatchMessageL(aMessage));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2169
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2170
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2171
        // Some of the functions contains operations that already complete message
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2172
        // doing Complete() twice will cause panic
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2173
        if (aMessage.Handle())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2174
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2175
            aMessage.Complete(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2176
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2177
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2178
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2179
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2180
// CApplicationManagementSession::PreDispatchMessageL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2181
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2182
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2183
TBool CApplicationManagementSession::PreDispatchMessageL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2184
        const RMessage2 &aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2185
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2186
    TBool ret(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2187
    // These succeed regardless of certificate....
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2188
    switch (aMessage.Function())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2189
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2190
        case EGetStateChangingIdsCountOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2191
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2192
            // gets count of items list of ids that are potentially changing state
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2193
            StateChangeComponentIdsCountL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2194
            ret = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2195
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2196
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2197
        case EGetStateChangingIdsOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2198
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2199
            // gets list of ids that are potentially changing state
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2200
            StateChangeComponentIdsL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2201
            ret = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2202
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2203
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2204
        case ECompleteStateChangeOperation: // completes change of state
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2205
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2206
            StateChangeCompleteL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2207
            ret = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2208
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2209
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2210
        default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2211
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2212
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2213
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2214
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2215
    return ret;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2216
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2217
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2218
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2219
// CApplicationManagementSession::DispatchMessageL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2220
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2221
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2222
void CApplicationManagementSession::DispatchMessageL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2223
        const RMessage2& aMessage)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2224
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2225
    RDEBUG_2( "CApplicationManagementSession::DispatchMessageL; %d" ,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2226
            aMessage.Function() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2227
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2228
    TBool go(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2229
    if (iTrustAdded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2230
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2231
        go = Server().CheckCertL(iCertInfo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2232
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2233
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2234
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2235
        go = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2236
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2237
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2238
    if (go)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2239
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2240
        switch (aMessage.Function())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2241
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2242
            case EAddTrust:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2243
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2244
                RDEBUG_2( "CApplicationManagementSession::DispatchMessageL; EAddTrust this=0x%x", this );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2245
                AddTrustL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2246
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2247
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2248
            case EDeplCompCountOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2249
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2250
                ComponentCountL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2251
                return;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2252
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2253
            case EDeplCompIdsOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2254
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2255
                ComponentIdsL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2256
                return;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2257
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2258
            case EDeplCompDeliverCompleteOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2259
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2260
                DeliverCompleteL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2261
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2262
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2263
            case EDeplCompGetOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2264
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2265
                GetComponentL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2266
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2267
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2268
            case EInstallOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2269
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2270
                InstallL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2271
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2272
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2273
            case EDeplCompAttrUpdateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2274
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2275
                UpdateL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2276
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2277
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2278
            case EDeplCompGetDataOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2279
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2280
                GetDataL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2281
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2282
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2283
            case EDeplCompGetDataLengthOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2284
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2285
                GetDataLengthL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2286
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2287
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2288
            case EDeplCompRemoveOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2289
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2290
                RemoveL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2291
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2292
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2293
            case EDeplCompDeliverStartOperation2:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2294
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2295
                Deliver2L(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2296
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2297
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2298
            case EDeplCompUpdateDataOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2299
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2300
                UpdateDataL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2301
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2302
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2303
            case EDeplCompUpdateStreamedDataOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2304
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2305
                UpdateStreamedDataL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2306
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2307
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2308
            case EDeplCompDownloadOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2309
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2310
                DownloadL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2311
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2312
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2313
            case EDeplCompUpdateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2314
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2315
                FullUpdateL(aMessage);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2316
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2317
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2318
            case EDeplCompGetUserIdOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2319
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2320
                GetUserIdL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2321
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2322
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2323
            case EDeplCompStartDownloadOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2324
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2325
                StartDownloadL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2326
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2327
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2328
            case EDeplCompDeactivateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2329
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2330
                DeactivateL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2331
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2332
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2333
            case EDeplCompActivateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2334
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2335
                ActivateL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2336
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2337
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2338
            case EDeplCompGetTemporaryInstFile:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2339
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2340
                GetTemporaryInstFileL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2341
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2342
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2343
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2344
            case EDeplCompGetFinalResultForGA:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2345
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2346
                GetFinalResultForGAL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2347
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2348
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2349
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2350
            case EDeplCompGenericAlertSent:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2351
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2352
                GenericAlertSentForIdL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2353
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2354
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2355
            case ECheckStatusNodes:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2356
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2357
                CheckStatusNodesValuesL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2358
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2359
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2360
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2361
            default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2362
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2363
                User::Leave(KErrNotSupported);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2364
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2365
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2366
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2367
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2368
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2369
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2370
        RDEBUG_2( "CApplicationManagementSession::DispatchMessageL; Policy prevented action this=0x%x", this );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2371
        User::Leave(KErrAccessDenied);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2372
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2373
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2374
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2375
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2376
// CApplicationManagementSession::GenericAlertSentForIdL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2377
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2378
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2379
void CApplicationManagementSession::GenericAlertSentForIdL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2380
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2381
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2382
    TUint32 luid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2383
    TPckg<TUint32> pk(luid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2384
    TInt read(aMessage.Read(0, pk));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2385
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2386
    Server().DeleteGenericAlertForIDL(luid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2387
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2388
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2389
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2390
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2391
// CApplicationManagementSession::GetFinalResultForGAL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2392
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2393
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2394
void CApplicationManagementSession::GetFinalResultForGAL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2395
        const RMessage2& aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2396
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2397
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2398
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 1" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2399
    TUint32 luid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2400
    TPckg<TUint32> pk(luid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2401
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2402
    TInt finalresult = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2403
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2404
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 2" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2405
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2406
    HBufC8 *targetURI = HBufC8::NewL(512);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2407
    TPtr8 ptr = targetURI->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2408
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2409
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 3" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2410
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2411
    TInt read(aMessage.Read(0, pk));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2412
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2413
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 4" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2414
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2415
    Server().GetAMServerDownloadDBL(luid, finalresult, ptr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2416
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2417
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 5" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2418
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2419
    RDEBUG_2( "ApplicationManagementServer: GetFinalResultForGAL Count is %d", finalresult );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2420
    TPckg<TInt> p1(finalresult);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2421
    aMessage.WriteL(1, p1);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2422
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2423
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 6" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2424
    aMessage.WriteL(2, ptr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2425
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2426
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 7" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2427
    if (targetURI)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2428
        delete targetURI;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2429
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2430
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2431
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2432
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2433
// CApplicationManagementSession::ComponentCountL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2434
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2435
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2436
void CApplicationManagementSession::ComponentCountL(const RMessage2& aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2437
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2438
    RDEBUG( "CApplicationManagementSession: ComponentCountL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2439
    TDeploymentComponentState st;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2440
    TPckg<TDeploymentComponentState> pk(st);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2441
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2442
    TInt read(aMessage.Read(1, pk));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2443
    RDEBUG_3( "CApplicationManagementSession: ComponentCountL State is %d, read %d", st, read);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2444
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2445
    const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2446
    RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2447
    CleanupClosePushL(arr);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2448
    if ((st == EDCSActive) || (st == EDCSInactive))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2449
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2450
        ActiveComponentsL(arrt, arr, st);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2451
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2452
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2453
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2454
        TInt count(arrt.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2455
        for (TInt i(0); i < count; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2456
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2457
            CDeploymentComponent &compo = Server().Storage()->ComponentL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2458
                    arrt[i]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2459
            if (st == EDCSNone || compo.State() == st)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2460
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2461
                arr.Append(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2462
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2463
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2464
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2465
    TInt n(arr.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2466
    CleanupStack::PopAndDestroy(&arr);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2467
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2468
    RDEBUG_2( "ApplicationManagementServer: ComponentCountL Count is %d", n );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2469
    TPckg<TInt> p(n);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2470
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2471
    aMessage.WriteL(0, p);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2472
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2473
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2474
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2475
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2476
// CApplicationManagementSession::ActiveComponentsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2477
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2478
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2479
void CApplicationManagementSession::ActiveComponentsL(
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2480
        const RComponentIdArray &aArrt, RComponentIdArray &aArr,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2481
        TDeploymentComponentState &aState) const
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2482
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2483
    Swi::RSisRegistrySession sisses;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2484
    TInt r(sisses.Connect());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2485
    User::LeaveIfError(r);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2486
    CleanupClosePushL(sisses);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2487
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2488
    RArray<TUid> uids;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2489
    sisses.InstalledUidsL(uids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2490
    CleanupClosePushL(uids);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2491
    TInt cont(aArrt.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2492
    TInt uidc(uids.Count());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2493
    RArray<TUid> juids;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2494
    Server().JavaUidsL(juids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2495
    CleanupClosePushL(juids);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2496
    TInt juidc(juids.Count());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2497
    RComponentIdArray rem;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2498
    CleanupClosePushL(rem);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2499
    for (TInt i(0); i < cont; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2500
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2501
        CDeploymentComponent &compo =
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2502
                Server().Storage()->ComponentL(aArrt[i]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2503
        TDeploymentComponentState state = compo.State();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2504
        if (state == aState)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2505
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2506
            TBool add(EFalse);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2507
            const TUid &uid(compo.Uid());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2508
            for (TInt j(0); add == EFalse && j < uidc; j++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2509
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2510
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2511
                if (uids[j] == uid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2512
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2513
                    RDEBUG( "CApplicationManagementSession::ActiveComponentsL Entered" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2514
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2515
                    // Check if this registry entry is present
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2516
                    Swi::RSisRegistrySession sisSession;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2517
                    User::LeaveIfError(sisSession.Connect());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2518
                    CleanupClosePushL(sisSession);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2519
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2520
                    Swi::RSisRegistryEntry sisEntry;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2521
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2522
                    //Opens the base package entry by specifying a UID. 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2523
                    User::LeaveIfError(sisEntry.Open(sisSession, compo.Uid()));
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2524
                    CleanupClosePushL(sisEntry);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2525
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2526
                    add = sisEntry.IsPresentL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2527
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2528
                    if (add)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2529
                        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2530
                        // If Present update the Version, name and other info to that deployement component. Since application would have got an update
2
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2531
                        // by some other means
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2532
                        TVersion version = sisEntry.VersionL();
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2533
                        TBuf8<KVersionLength> pkgDes;
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2534
                        pkgDes.AppendNum(version.iMajor);
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2535
                        pkgDes.Append(KLiteralPeriod);
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2536
                        pkgDes.AppendNum(version.iMinor);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2537
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2538
                        HBufC *packagename = sisEntry.PackageNameL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2539
                        TBuf8<512> packagename8;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2540
                        packagename8.Copy(*packagename);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2541
                        delete packagename;
2
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2542
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2543
                        compo.SetNameL(packagename8);
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2544
                        compo.SetVersionL(pkgDes);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2545
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2546
                        Server().Storage()->UpdateL(compo);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2547
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2548
                        RDEBUG( "CApplicationManagementSession::ActiveComponentsL ETrue" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2549
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2550
                        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2551
                    else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2552
                        RDEBUG( "CApplicationManagementSession::ActiveComponentsL EFalse" );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2553
                    CleanupStack::PopAndDestroy(2, &sisSession);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2554
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2555
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2556
            if (!add) // go throug java suites
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2557
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2558
                for (TInt k(0); add == EFalse && k < juidc; k++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2559
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2560
                    if (juids[k] == uid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2561
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2562
                        add = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2563
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2564
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2565
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2566
            if (add)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2567
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2568
                aArr.Append(aArrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2569
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2570
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2571
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2572
                RDEBUG8_3( "ApplicationManagementServer: ActiveComponentCountL skipping 0x%x, %S",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2573
                        compo.Uid() ,&compo.ComponentId() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2574
                rem.Append(aArrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2575
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2576
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2577
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2578
    TInt rc(rem.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2579
    for (TInt t(0); t < rc; t++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2580
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2581
        RDEBUG_2( "ApplicationManagementServer: ActiveComponentCountL removing non existing %d", rem[t] );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2582
        CDeploymentComponent &compo = Server().Storage()->ComponentL(rem[t]);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2583
        if (!compo.AppRemovable())
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2584
            Server().RemoveInternalL(compo, EFalse);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2585
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2586
    CleanupStack::PopAndDestroy(&rem);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2587
    CleanupStack::PopAndDestroy(&juids);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2588
    CleanupStack::PopAndDestroy(&uids);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2589
    CleanupStack::PopAndDestroy(&sisses);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2590
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2591
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2592
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2593
// CApplicationManagementSession::ComponentIdsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2594
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2595
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2596
void CApplicationManagementSession::ComponentIdsL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2597
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2598
    RDEBUG( "CApplicationManagementSession: ComponentIdsL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2599
    TDeploymentComponentState st;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2600
    TPckg<TDeploymentComponentState> pk(st);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2601
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2602
    TInt read(aMessage.Read(1, pk));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2603
    RDEBUG_3( "CApplicationManagementSession: ComponentIdsL State is %d, read %d", st, read);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2604
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2605
    const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2606
    TInt buflen(0);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2607
    TUint32* buf = NULL;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2608
    if (st == EDCSNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2609
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2610
        buflen = arrt.Count();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2611
        buf = new (ELeave) TUint32[buflen];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2612
        CleanupArrayDeletePushL(buf);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2613
        for (TInt i(0); i < buflen; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2614
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2615
            RDEBUG_2("ApplicationManagementSession: ComponentIdsL Adding %d!!", arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2616
            buf[i] = arrt[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2617
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2618
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2619
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2620
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2621
        RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2622
        if (st == EDCSActive)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2623
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2624
            ActiveComponentsL(arrt, arr, st);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2625
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2626
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2627
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2628
            TInt artc(arrt.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2629
            for (TInt i(0); i < artc; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2630
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2631
                CDeploymentComponent &compo = Server().Storage()->ComponentL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2632
                        arrt[i]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2633
                if (compo.State() == st)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2634
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2635
                    arr.Append(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2636
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2637
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2638
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2639
        buflen = arr.Count();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2640
        buf = new (ELeave) TUint32[buflen];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2641
        CleanupArrayDeletePushL(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2642
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2643
        TUint32 len(aMessage.GetDesMaxLength(0) / 4);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2644
        if (buflen == len)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2645
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2646
            RDEBUG( "CApplicationManagementSession: ComponentIdsL Right count!!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2647
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2648
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2649
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2650
            RDEBUG_3( "CApplicationManagementSession: ComponentIdsL Wrong count (is %d, should be %d)!!", len, buflen);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2651
            if (len < buflen)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2652
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2653
                buflen = len;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2654
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2655
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2656
        for (TInt i(0); i < buflen; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2657
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2658
            RDEBUG_2( "CApplicationManagementSession: ComponentIdsL Adding %d!!",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2659
                    arr[i] );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2660
            buf[i] = arr[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2661
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2662
        arr.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2663
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2664
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2665
    TPtrC8 p((TUint8*) buf, buflen * sizeof(TUint32));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2666
    aMessage.WriteL(0, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2667
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2668
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2669
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2670
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2671
#ifdef _DEBUG
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2672
HBufC* Des8to16LC(const TDesC8 &aDes)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2673
    {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2674
    HBufC *b = HBufC::NewLC(aDes.Length());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2675
    TPtr p(b->Des());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2676
    p.Copy(aDes);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2677
    return b;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2678
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2679
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2680
HBufC* ToStringLC(TDeploymentComponent &aComp)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2681
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2682
    HBufC *b = HBufC::NewLC(aComp.iId.Length() + aComp.iName.Length()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2683
            + aComp.iVersion.Length() + 10 + 50);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2684
    TPtr p(b->Des());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2685
    _LIT( KFormat, "Id: '%S', Name: '%S', Version: '%S', State: %d, OldState: %d");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2686
    p.Format(KFormat, &*Des8to16LC(aComp.iId), &*Des8to16LC(aComp.iName),
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2687
            &*Des8to16LC(aComp.iVersion), aComp.iState, aComp.iOldState);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2688
    CleanupStack::PopAndDestroy(3);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2689
    return b;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2690
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2691
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2692
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2693
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2694
// CApplicationManagementSession::Deliver2L()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2695
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2696
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2697
void CApplicationManagementSession::Deliver2L(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2698
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2699
    RDEBUG( "ApplicationManagementSession: Deliver2L" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2700
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2701
    TDeploymentComponentIPC comp;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2702
    TPckg<TDeploymentComponentIPC> pcomp(comp);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2703
    TInt read2(aMessage.Read(0, pcomp));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2704
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2705
    HBufC8 *data = HBufC8::NewLC(aMessage.GetDesLength(1));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2706
    TPtr8 pbuf(data->Des());
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2707
    TInt read(aMessage.Read(1, pbuf));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2708
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2709
    CDeploymentComponent *compo = NULL;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2710
    if (iTrustAdded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2711
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2712
        compo = Server().Storage()->NewComponentL(EDCSDelivered,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2713
                comp.iUserId, &iCertInfo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2714
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2715
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2716
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2717
        compo
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2718
                = Server().Storage()->NewComponentL(EDCSDelivered,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2719
                        comp.iUserId);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2720
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2721
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2722
    compo->Set(comp.iComponent);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2723
    compo->Data().SetDataL(pbuf, comp.iMimeType);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2724
    Server().Storage()->UpdateL(*compo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2725
    compo->CopyStateTo(comp.iComponent);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2726
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2727
#ifdef _DEBUG
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2728
    RDEBUG_2( "Deliver2L: TDeploymentComponent is '%S'",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2729
            ToStringLC( comp.iComponent ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2730
    CleanupStack::PopAndDestroy();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2731
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2732
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2733
    TPckg<TDeploymentComponent> pcomp2(comp.iComponent);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2734
    aMessage.Write(0, pcomp2);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2735
    CleanupStack::PopAndDestroy(data);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2736
    TInt n(compo->InternalId());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2737
    TPckg<TUint32> p(n);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2738
    aMessage.WriteL(2, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2739
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2740
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2741
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2742
// CApplicationManagementSession::DeliverCompleteL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2743
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2744
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2745
void CApplicationManagementSession::DeliverCompleteL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2746
        const RMessage2& aMessage) const
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2747
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2748
    RDEBUG( "ApplicationManagementSession: DeliverCompleteL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2749
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2750
    TPckg<TUint32> pid(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2751
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2752
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2753
    RDEBUG_2( "ApplicationManagementSession: DeliverCompleteL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2754
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2755
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2756
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2757
    HBufC8 *opts = HBufC8::NewLC(aMessage.GetDesLength(1));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2758
    TPtr8 popts(opts->Des());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2759
    TInt read1(aMessage.Read(1, popts));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2760
    compo.SetInstallOptsL(*opts);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2761
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2762
    HBufC8 *meta = HBufC8::NewLC(aMessage.GetDesLength(2));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2763
    TPtr8 pmeta(meta->Des());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2764
    TInt read2(aMessage.Read(2, pmeta));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2765
    compo.SetMetaDataL(*meta, KNullDesC8);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2766
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2767
    CleanupStack::PopAndDestroy(meta);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2768
    CleanupStack::PopAndDestroy(opts);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2769
    Server().Storage()->UpdateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2770
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2771
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2772
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2773
// CApplicationManagementSession::GetComponentL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2774
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2775
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2776
void CApplicationManagementSession::GetComponentL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2777
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2778
    RDEBUG( "ApplicationManagementSession: GetComponentL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2779
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2780
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2781
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2782
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2783
    RDEBUG_2( "ApplicationManagementSession: GetComponentL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2784
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2785
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2786
    TDeploymentComponent comp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2787
    compo.CopyStateTo(comp);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2788
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2789
    TPckg<TDeploymentComponent> pcomp(comp);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2790
    aMessage.Write(1, pcomp);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2791
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2792
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2793
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2794
// CApplicationManagementSession::StartDownloadL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2795
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2796
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2797
void CApplicationManagementSession::StartDownloadL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2798
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2799
    RDEBUG( "ApplicationManagementSession: StartDownloadL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2800
    TUint32 id = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2801
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2802
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2803
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2804
    TPckgBuf<TDownloadTarget> target;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2805
    read = aMessage.Read(1, target);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2806
    RDEBUG_2( "ApplicationManagementSession: StartDownloadL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2807
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2808
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2809
    compo.SetDownloadTarget(target());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2810
    Server().AddDownloadL(&compo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2811
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2812
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2813
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2814
// CApplicationManagementSession::DeactivateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2815
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2816
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2817
void CApplicationManagementSession::DeactivateL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2818
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2819
    RDEBUG( "ApplicationManagementSession: DeactivateL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2820
    TUint32 id = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2821
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2822
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2823
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2824
    RDEBUG_2( "ApplicationManagementSession: DeactivateL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2825
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2826
    Server().Storage()->DeactivateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2827
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2828
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2829
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2830
// CApplicationManagementSession::ActivateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2831
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2832
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2833
void CApplicationManagementSession::ActivateL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2834
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2835
    RDEBUG( "ApplicationManagementSession: ActivateL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2836
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2837
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2838
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2839
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2840
    RDEBUG_2( "ApplicationManagementSession: ActivateL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2841
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2842
    Server().Storage()->ActivateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2843
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2844
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2845
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2846
// CApplicationManagementSession::GetUserIdL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2847
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2848
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2849
void CApplicationManagementSession::GetUserIdL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2850
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2851
    RDEBUG( "ApplicationManagementSession: GetUserIdL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2852
    TUint32 id = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2853
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2854
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2855
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2856
    RDEBUG_2( "ApplicationManagementSession: GetUserIdL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2857
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2858
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2859
    aMessage.Write(1, compo.UserId());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2860
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2861
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2862
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2863
// CApplicationManagementSession::GetTemporaryInstFileL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2864
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2865
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2866
void CApplicationManagementSession::GetTemporaryInstFileL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2867
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2868
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2869
    // TIpcArgs( &id, &itemid, &filehandle )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2870
    RDEBUG( "ApplicationManagementSession: GetTemporaryInstFileL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2871
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2872
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2873
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2874
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2875
    TDeplCompAttrType item;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2876
    TPckg<TDeplCompAttrType> itemid(item);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2877
    read = aMessage.Read(1, itemid);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2878
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2879
    RDEBUG_2( "ApplicationManagementSession: GetTemporaryInstFileL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2880
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2881
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2882
    TFileName fileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2883
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2884
    if (item == EDCData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2885
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2886
        fileName.Copy(compo.Data().DataFileName());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2887
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2888
    else if (item == EDCMetaData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2889
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2890
        fileName.Copy(compo.MetaData().DataFileName());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2891
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2892
    else
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2893
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2894
        RDEBUG_2( "ApplicationManagementSession: GetTemporaryInstFileL: Not supported type: (%d)", item);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2895
        User::Leave(KErrNotSupported);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2896
        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2897
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2898
    RDEBUG_2( "ApplicationManagementSession: GetTemporaryInstFileL: (%S)", &fileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2899
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2900
    RFs fs;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2901
    User::LeaveIfError(fs.Connect());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2902
    User::LeaveIfError(fs.ShareProtected());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2903
    CleanupClosePushL(fs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2904
    RFile file;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2905
    User::LeaveIfError(file.Open(fs, fileName, EFileWrite));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2906
    CleanupClosePushL(file);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2907
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2908
    // Takes care of completing with session (RFs), 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2909
    // SendReceieve returns session handle at client side
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2910
    User::LeaveIfError(file.TransferToClient(aMessage, 2));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2911
    CleanupStack::PopAndDestroy(2, &fs); // fs , file	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2912
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2913
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2914
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2915
// CApplicationManagementSession::PackageSizeL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2916
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2917
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2918
TInt CApplicationManagementSession::PackageSizeL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2919
        Swi::RSisRegistrySession& aSession, Swi::RSisRegistryEntry& aEntry)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2920
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2921
    RPointerArray<Swi::CSisRegistryPackage> listPackages;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2922
    TInt size(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2923
    TInt err(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2924
    CleanupClosePushL(listPackages);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2925
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2926
    aEntry.AugmentationsL(listPackages);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2927
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2928
    for (TInt index(0); index < listPackages.Count(); index++)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2929
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2930
        TRAP(err, AugmentationSizeL( aSession, *listPackages[index]))
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2931
        if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2932
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2933
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2934
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2935
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2936
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2937
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2938
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2939
        size = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2940
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2941
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2942
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2943
        TRAP(err, size += aEntry.SizeL() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2944
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2945
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2946
    listPackages.ResetAndDestroy();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2947
    CleanupStack::PopAndDestroy(&listPackages);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2948
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2949
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2950
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2951
        //We leave if there was an error, 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2952
        // but we have to clean up the listPackages before the leave.
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2953
        User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2954
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2955
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2956
    return size;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2957
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2958
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2959
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2960
// CAppMngrSisxInfo::AugmentationSizeL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2961
// Returns the Size of the package
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2962
// (other items were commented in a header).
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2963
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2964
//  
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2965
TInt CApplicationManagementSession::AugmentationSizeL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2966
        Swi::RSisRegistrySession& aSession,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2967
        const Swi::CSisRegistryPackage& aPackage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2968
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2969
    TInt size(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2970
    Swi::RSisRegistryEntry regEntry;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2971
    CleanupClosePushL(regEntry);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2972
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2973
    regEntry.OpenL(aSession, aPackage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2974
    size += PackageSizeL(aSession, regEntry);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2975
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2976
    CleanupStack::PopAndDestroy(&regEntry);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2977
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2978
    return size;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2979
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2980
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2981
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2982
// CApplicationManagementSession::LookupSisRegistryL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2983
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2984
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2985
void CApplicationManagementSession::LookupSisRegistryL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2986
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2987
    Swi::RSisRegistrySession sisses;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2988
    TInt r(sisses.Connect());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2989
    RPointerArray<Swi::CSisRegistryPackage> pkgs(12);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2990
    sisses.InstalledPackagesL(pkgs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2991
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2992
    TInt count(pkgs.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  2993
    for (TInt i(0); i < count; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2994
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2995
        Swi::CSisRegistryPackage* p = pkgs[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2996
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2997
        RDEBUG_5(" Found package: %d, '%S', uid: 0x%X, size: %d" ,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2998
                i, &p->Name(), p->Uid().iUid, AugmentationSizeL( sisses, *p ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2999
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3000
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3001
    sisses.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3002
    pkgs.ResetAndDestroy();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3003
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3004
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3005
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3006
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3007
// CApplicationManagementSession::InstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3008
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3009
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3010
void CApplicationManagementSession::InstallL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3011
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3012
    RDEBUG( "ApplicationManagementSession: InstallL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3013
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3014
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3015
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3016
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3017
    TDeploymentComponentState targetst;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3018
    TPckg<TDeploymentComponentState> pk(targetst);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3019
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3020
    read = aMessage.Read(1, pk);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3021
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3022
    RDEBUG_3( "ApplicationManagementSession: InstallL id is %d, targetstate %d",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3023
            id, targetst );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3024
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3025
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3026
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3027
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3028
        Server().DoTheInstallL(compo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3029
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3030
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3031
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3032
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3033
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3034
    RDEBUG_2( "ApplicationManagementSession: InstallL success. New compo state (%d)", compo.State());
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3035
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3036
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3037
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3038
// CApplicationManagementSession::UpdateDataL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3039
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3040
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3041
void CApplicationManagementSession::UpdateDataL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3042
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3043
    RDEBUG( "ApplicationManagementSession: UpdateDataL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3044
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3045
    TDeplCompDataIPC ipc;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3046
    TPckg<TDeplCompDataIPC> pipc(ipc);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3047
    TInt read(aMessage.Read(0, pipc));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3048
    RDEBUG_2( "ApplicationManagementSession: UpdateDataL id is %d", ipc.iInternalId );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3049
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3050
    HBufC8 *buf = HBufC8::NewLC(aMessage.GetDesLength(1));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3051
    TPtr8 pbuf(buf->Des());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3052
    TInt read2(aMessage.Read(1, pbuf));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3053
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3054
    CDeploymentComponent &compo = Server().Storage()->ComponentL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3055
            ipc.iInternalId);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3056
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3057
    if (Server().CheckB64Encode(pbuf))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3058
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3059
        RDEBUG( "ApplicationManagementSession: UpdateDataL data is base64 encoded");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3060
        // b64 encoded data, decode it 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3061
        HBufC8* tmp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3062
        tmp = Server().DecodeB64DataLC(pbuf);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3063
        pbuf.Copy(*tmp);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3064
        pbuf = buf->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3065
        CleanupStack::PopAndDestroy(tmp);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3066
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3067
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3068
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3069
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3070
        if (ipc.iAttrType == EDCData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3071
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3072
            compo.SetDataL(pbuf, ipc.iDataMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3073
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3074
        else if (ipc.iAttrType == EDCMetaData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3075
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3076
            compo.SetMetaDataL(pbuf, ipc.iDataMime);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3077
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3078
        else
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3079
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3080
            RDEBUG_2( "ApplicationManagementSession::UpdateDataL -  ERROR UpdateDataL called for illegal item: %d!", ipc.iAttrType );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3081
            User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3082
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3083
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3084
        Server().Storage()->UpdateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3085
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3086
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3087
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3088
        RDEBUG( "ApplicationManagementSession::UpdateDataL -  ERROR UpdateDataL called for illegal state message!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3089
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3090
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3091
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3092
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3093
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3094
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3095
// CApplicationManagementSession::UpdateStreamedDataL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3096
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3097
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3098
void CApplicationManagementSession::UpdateStreamedDataL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3099
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3100
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3101
    RDEBUG( "ApplicationManagementSession: UpdateStreamedDataL() Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3102
    TDeplCompDataIPC ipc;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3103
    TPckg<TDeplCompDataIPC> pipc(ipc);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3104
    TInt read(aMessage.Read(0, pipc));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3105
    RDEBUG_2( "ApplicationManagementSession: UpdateStreamedDataL id is %d", ipc.iInternalId );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3106
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3107
    CDeploymentComponent &compo = Server().Storage()->ComponentL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3108
            ipc.iInternalId);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3109
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3110
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3111
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3112
        RFs fs;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3113
        User::LeaveIfError(fs.Connect());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3114
        CleanupClosePushL(fs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3115
        RFile file;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3116
        TFileName dataFileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3117
        TInt length(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3118
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3119
        if (ipc.iAttrType == EDCData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3120
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3121
            dataFileName.Copy(compo.Data().DataFileName());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3122
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3123
        else if (ipc.iAttrType == EDCMetaData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3124
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3125
            dataFileName.Copy(compo.MetaData().DataFileName());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3126
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3127
        else
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3128
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3129
            RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL -  ERROR called for illegal item: %d!", ipc.iAttrType );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3130
            User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3131
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3132
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3133
        RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL(): using dataFile: (%S)", &dataFileName );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3134
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3135
        // EFileWrite So we can delete the original decoded data file
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3136
        User::LeaveIfError(file.Open(fs, dataFileName, EFileWrite));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3137
        CleanupClosePushL(file);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3138
        if (Server().IsDataFileB64EncodedL(file, length))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3139
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3140
            RDEBUG( "CApplicationManagementServer::UpdateStreamedDataL(): data is decoded" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3141
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3142
            TFileName tempFileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3143
            TBuf<30> privatePath;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3144
            fs.PrivatePath(privatePath);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3145
            RFile tempFile;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3146
            TInt err(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3147
            err = tempFile.Temp(fs, privatePath, tempFileName, EFileWrite);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3148
            if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3149
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3150
                RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL(): created tempFile: (%S)", &tempFileName );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3151
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3152
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3153
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3154
                User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3155
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3156
            CleanupClosePushL(tempFile);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3157
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3158
            TRAP( err, Server().DecodeB64DataFileL( file, tempFile ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3159
            if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3160
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3161
                RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL -  failed to decode datafile: %d", err );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3162
                CleanupStack::PopAndDestroy(2, &file);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3163
                compo.ResetDataL(fs); // Remove both files if exists
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3164
                User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3165
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3166
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3167
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3168
                // close both files, delete decode file and rename temp file to correct one
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3169
                CleanupStack::PopAndDestroy(2, &file);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3170
                fs.Delete(dataFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3171
                err = fs.Rename(tempFileName, dataFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3172
                RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL -  successfully decoded datafile: %d", err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3173
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3174
            CleanupStack::PopAndDestroy(&fs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3175
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3176
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3177
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3178
            RDEBUG( "ApplicationManagementSession::UpdateStreamedDataL(): data is NOT decoded" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3179
            CleanupStack::PopAndDestroy(2, &fs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3180
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3181
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3182
        if (ipc.iAttrType == EDCData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3183
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3184
            compo.SetDataL(ipc.iDataMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3185
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3186
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3187
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3188
            compo.SetMetaDataL(ipc.iDataMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3189
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3190
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3191
        Server().Storage()->UpdateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3192
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3193
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3194
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3195
        RDEBUG( "ApplicationManagementSession::UpdateStreamedDataL -  ERROR called for illegal state message!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3196
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3197
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3198
    RDEBUG( "ApplicationManagementSession: UpdateStreamedDataL() End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3199
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3200
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3201
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3202
// CApplicationManagementSession::UpdateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3203
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3204
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3205
void CApplicationManagementSession::UpdateL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3206
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3207
    RDEBUG( "ApplicationManagementSession: UpdateL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3208
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3209
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3210
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3211
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3212
    RDEBUG_2("ApplicationManagementSession: UpdateL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3213
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3214
    TDeplCompAttrType item;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3215
    TPckg<TDeplCompAttrType> itemid(item);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3216
    TInt read1(aMessage.Read(1, itemid));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3217
    HBufC8 *buf = HBufC8::NewLC(aMessage.GetDesLength(2));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3218
    TPtr8 pbuf(buf->Des());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3219
    TInt read2(aMessage.Read(2, pbuf));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3220
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3221
    CDeploymentComponent &c = Server().Storage()->ComponentL(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3222
    TDeploymentComponentState st(c.State());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3223
    if (st == EDCSDelivered || st == EDCSDownload)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3224
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3225
        switch (item)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3226
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3227
            case EDCId:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3228
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3229
                c.SetIdL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3230
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3231
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3232
            case EDCName:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3233
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3234
                c.SetNameL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3235
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3236
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3237
            case EDCVersion:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3238
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3239
                c.SetVersionL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3240
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3241
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3242
            case EDCDescriptionRef:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3243
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3244
                c.SetDescriptionL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3245
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3246
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3247
            case EDCInstallOptions:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3248
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3249
                c.SetInstallOptsL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3250
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3251
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3252
            case EDCMetaData:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3253
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3254
                c.SetMetaDataL(pbuf, KNullDesC8);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3255
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3256
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3257
            case EDCPkgID:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3258
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3259
                c.SetPkgIDL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3260
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3261
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3262
            case EDCPkgType:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3263
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3264
                c.SetPkgTypeL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3265
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3266
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3267
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3268
            default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3269
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3270
                if (st == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3271
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3272
                    switch (item)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3273
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3274
                        case EDCData:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3275
                            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3276
                            c.SetDataL(pbuf, KNullDesC8);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3277
                            if (c.State() == EDCSDownload)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3278
                                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3279
                                //	Server().StartDownload( *compo );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3280
                                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3281
                            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3282
                            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3283
                        default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3284
                            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3285
                            RDEBUG_2("ApplicationManagementSession: ERROR UpdateL called for illegal item type!!!! %d", item );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3286
                            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3287
                            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3288
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3289
                    }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3290
                else if (st == EDCSDownload)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3291
                    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3292
                    switch (item)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3293
                        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3294
                        case EDCId:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3295
                            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3296
                            c.SetIdL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3297
                            break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3298
                            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3299
                        case EDCName:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3300
                            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3301
                            c.SetNameL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3302
                            break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3303
                            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3304
                        case EDCVersion:
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3305
                            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3306
                            c.SetVersionL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3307
                            break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3308
                            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3309
                        case EDCDownloadURI:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3310
                            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3311
                            c.SetDownloadURIL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3312
                            break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3313
                            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3314
                        case EDCConRef:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3315
                            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3316
                            TPckgBuf<TInt> aInt;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3317
                            aInt.Copy(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3318
                            c.SetIAPL(aInt());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3319
                            break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3320
                            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3321
                        default:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3322
                            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3323
                            RDEBUG_2( "ApplicationManagementSession: ERROR UpdateL called for illegal item type!!!! %d", item );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3324
                            User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3325
                            break;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3326
                            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3327
                        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3328
                    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3329
                break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3330
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3331
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3332
        Server().Storage()->UpdateL(c);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3333
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3334
    else if (st == EDCSActive || st == EDCSInactive)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3335
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3336
        switch (item)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3337
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3338
            case EDCName:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3339
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3340
                c.SetNameL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3341
                break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3342
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3343
            case EDCVersion:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3344
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3345
                c.SetVersionL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3346
                break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3347
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3348
            case EDCDescriptionRef:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3349
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3350
                c.SetDescriptionL(pbuf);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3351
                break;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3352
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3353
            default:
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3354
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3355
                RDEBUG_2( "ApplicationManagementSession: ERROR UpdateL called for illegal item type!!!! %d", item );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3356
                User::Leave(KErrArgument);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3357
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3358
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3359
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3360
        Server().Storage()->UpdateL(c);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3361
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3362
    else
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3363
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3364
        RDEBUG( "ApplicationManagementSession: ERROR UpdateL called for illegal state message!" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3365
        User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3366
        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3367
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3368
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3369
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3370
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3371
// CApplicationManagementSession::GetDataLengthL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3372
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3373
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3374
void CApplicationManagementSession::GetDataLengthL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3375
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3376
    RDEBUG( "ApplicationManagementSession: GetDataLengthL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3377
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3378
    TPckg<TUint32> pid(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3379
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3380
    TInt read(aMessage.Read(0, pid));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3381
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3382
    TInt length(0);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3383
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3384
    TDeplCompAttrType dt;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3385
    TPckg<TDeplCompAttrType> pdt(dt);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3386
    read = aMessage.Read(1, pdt);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3387
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3388
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3389
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3390
        if (dt == EDCInstallOptions)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3391
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3392
            if (compo.InstallOptsSet())
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3393
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3394
                length = sizeof(TAMInstallOptions);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3395
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3396
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3397
        else if (dt == EDCData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3398
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3399
            length = compo.Data().DataLengthL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3400
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3401
        else if (dt == EDCDataMime)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3402
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3403
            length = compo.Data().MimeType().Length();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3404
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3405
        else if (dt == EDCMetaData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3406
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3407
            length = compo.MetaData().DataLengthL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3408
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3409
        else if (dt == EDCMetaDataMime)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3410
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3411
            length = compo.MetaData().MimeType().Length();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3412
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3413
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3414
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3415
            RDEBUG_2( "ApplicationManagementSession: GetDataLengthL ERROR called with illegal type %d", dt );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3416
            User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3417
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3418
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3419
    else if (compo.State() == EDCSDownload)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3420
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3421
        if (dt == EDCDownloadURI)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3422
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3423
            length = compo.DownloadURI().Length();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3424
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3425
        else if (dt == EDCInstallOptions)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3426
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3427
            if (compo.InstallOptsSet())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3428
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3429
                length = sizeof(TAMInstallOptions);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3430
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3431
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3432
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3433
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3434
            RDEBUG_2( "ApplicationManagementSession: GetDataLengthL ERROR Download / called with illegal state component id %d",
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3435
                    compo.State() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3436
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3437
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3438
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3439
    else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3440
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3441
        RDEBUG_2( "ApplicationManagementSession: GetDataLengthL ERROR called with illegal state component id %d",
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3442
                compo.State() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3443
        User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3444
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3445
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3446
    TPckg<TInt> pcomp(length);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3447
    aMessage.Write(2, pcomp);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3448
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3449
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3450
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3451
// CApplicationManagementSession::GetDataL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3452
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3453
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3454
void CApplicationManagementSession::GetDataL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3455
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3456
    RDEBUG( "ApplicationManagementSession: GetDataL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3457
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3458
    TPckg<TUint32> pid(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3459
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3460
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3461
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3462
    TDeplCompAttrType dt;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3463
    TPckg<TDeplCompAttrType> pdt(dt);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3464
    read = aMessage.Read(1, pdt);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3465
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3466
    RDEBUG_3( "ApplicationManagementSession: GetDataL id is %d, and attribute %d", id, dt );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3467
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3468
    if (dt == EDCStatus)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3469
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3470
        TPckg<TInt> p(compo.Status());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3471
        aMessage.Write(2, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3472
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3473
    else if (compo.State() == EDCSDelivered)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3474
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3475
        if (dt == EDCInstallOptions)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3476
            {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3477
            if (compo.InstallOptsSet())
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3478
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3479
                TAMInstallOptionsPckgBuf pckg(compo.InstallOpts());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3480
                aMessage.Write(2, pckg);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3481
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3482
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3483
                {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3484
                aMessage.Write(2, KNullDesC8);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3485
                }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3486
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3487
        else if (dt == EDCData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3488
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3489
            aMessage.Write(2, compo.Data().Data());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3490
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3491
        else if (dt == EDCDataMime)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3492
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3493
            aMessage.Write(2, compo.Data().MimeType());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3494
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3495
        else if (dt == EDCMetaData)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3496
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3497
            aMessage.Write(2, compo.MetaData().Data());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3498
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3499
        else if (dt == EDCMetaDataMime)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3500
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3501
            aMessage.Write(2, compo.MetaData().MimeType());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3502
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3503
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3504
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3505
            RDEBUG_2( "ApplicationManagementSession: GetDataL ERROR called with illegal type %d", dt );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3506
            User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3507
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3508
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3509
    else if (compo.State() == EDCSDownload)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3510
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3511
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3512
        if (dt == EDCDownloadURI)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3513
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3514
            aMessage.Write(2, compo.DownloadURI());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3515
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3516
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3517
        else if (dt == EDCInstallOptions)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3518
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3519
            if (compo.InstallOptsSet())
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3520
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3521
                TAMInstallOptionsPckgBuf pckg(compo.InstallOpts());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3522
                aMessage.Write(2, pckg);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3523
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3524
            else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3525
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3526
                aMessage.Write(2, KNullDesC8);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3527
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3528
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3529
        else if (dt == EDCConRef)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3530
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3531
            TPckg<TInt> p(compo.GetIAP());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3532
            aMessage.Write(2, p);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3533
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3534
        else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3535
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3536
            RDEBUG_2( "ApplicationManagementSession:GetDataL ERROR called with illegal type %d", dt );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3537
            User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3538
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3539
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3540
    else
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3541
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3542
        RDEBUG_2("ApplicationManagementSession: GetDataL ERROR called with illegal state component id %d", compo.State() );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3543
        User::Leave(KErrArgument);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3544
        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3545
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3546
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3547
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3548
// CApplicationManagementSession::RemoveL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3549
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3550
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3551
void CApplicationManagementSession::RemoveL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3552
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3553
    RDEBUG( "ApplicationManagementSession: RemoveL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3554
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3555
    TPckg<TUint32> pid(id);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3556
    TInt read(aMessage.Read(0, pid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3557
    RDEBUG_2( "ApplicationManagementSession: RemoveL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3558
    RemoveInternalL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3559
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3560
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3561
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3562
// CApplicationManagementSession::RemoveInternalL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3563
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3564
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3565
void CApplicationManagementSession::RemoveInternalL(const TUint32 &aId) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3566
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3567
    CDeploymentComponent &compo = Server().Storage()->ComponentL(aId);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3568
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3569
    Server().RemoveInternalL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3570
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3571
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3572
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3573
// CApplicationManagementSession::DownloadL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3574
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3575
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3576
void CApplicationManagementSession::DownloadL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3577
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3578
    RDEBUG( "ApplicationManagementSession: DownloadL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3579
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3580
    TDCUserId userId;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3581
    aMessage.ReadL(1, userId);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3582
    CDeploymentComponent *compo = NULL;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3583
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3584
    if (iTrustAdded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3585
        {
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3586
        compo = Server().Storage()->NewComponentL(EDCSDownload, userId,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3587
                &iCertInfo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3588
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3589
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3590
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3591
        compo = Server().Storage()->NewComponentL(EDCSDownload, userId);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3592
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3593
    TUint32 i(compo->InternalId());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3594
    TPckg<TUint32> p(i);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3595
    aMessage.WriteL(0, p);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3596
    RDEBUG( "ApplicationManagementSession: DownloadL end" );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3597
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3598
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3599
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3600
// CApplicationManagementSession::FullUpdateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3601
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3602
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3603
void CApplicationManagementSession::FullUpdateL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3604
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3605
    RDEBUG( "ApplicationManagementSession: FullUpdateL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3606
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3607
    TUint32 sid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3608
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3609
    TPckg<TUint32> psid(sid);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3610
    TInt read(aMessage.Read(0, psid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3611
    TUint32 tid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3612
    TPckg<TUint32> ptid(tid);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3613
    TInt read2(aMessage.Read(1, ptid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3614
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3615
    RDEBUG_3( "ApplicationManagementSession: FullUpdateL sid is %d, tid is %d", sid, tid );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3616
    CApplicationManagementServer &server = Server();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3617
    server.FullUpdateL(sid, tid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3618
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3619
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3620
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3621
// CApplicationManagementSession::ServiceError()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3622
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3623
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3624
void CApplicationManagementSession::ServiceError(const RMessage2& aMessage,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3625
        TInt aError)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3626
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3627
    RDEBUG_2( "ApplicationManagementSession: CApplicationManagementSession::ServiceError %d", aError);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3628
    CSession2::ServiceError(aMessage, aError);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3629
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3630
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3631
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3632
// CApplicationManagementSession::AddTrustL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3633
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3634
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3635
void CApplicationManagementSession::AddTrustL(const RMessage2 &aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3636
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3637
    TPckg<TCertInfo> pkg(iCertInfo);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3638
    aMessage.ReadL(0, pkg);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3639
    iTrustAdded = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3640
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3641
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3642
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3643
// CApplicationManagementSession::StateChangeComponentIdsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3644
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3645
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3646
void CApplicationManagementSession::StateChangeComponentIdsL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3647
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3648
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3649
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3650
    RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3651
    Server().Storage()->GetStateChangeComponentIdsL(arr);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3652
    TInt buflen(arr.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3653
    TUint32* buf = new (ELeave) TUint32[buflen];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3654
    CleanupArrayDeletePushL(buf);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3655
    for (TInt i(0); i < buflen; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3656
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3657
        RDEBUG_2( "ApplicationManagementSession:ComponentIdsL Adding %d!!", arr[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3658
        buf[i] = arr[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3659
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3660
    TPtrC8 p((TUint8*) buf, buflen * sizeof(TUint32));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3661
    aMessage.WriteL(0, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3662
    arr.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3663
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3664
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsL end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3665
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3666
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3667
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3668
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3669
// CApplicationManagementSession::StateChangeComponentIdsCountL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3670
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3671
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3672
void CApplicationManagementSession::StateChangeComponentIdsCountL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3673
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3674
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3675
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsCountL" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3676
    RPointerArray<TPreInstalledAppParams> preInstalledAppParams;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3677
    CAMPreInstallApp* preInstallApp = CAMPreInstallApp::NewL();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3678
    preInstallApp->GetPreInstalledAppsL(preInstalledAppParams);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3679
    TInt count = 0;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3680
    for (count = 0; count < preInstalledAppParams.Count(); count++)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3681
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3682
        RDEBUG8_2("CApplicationManagementSession::DownloadL: Installed App Name is: %S",&(preInstalledAppParams[count]->iPreInstalledAppame));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3683
        RDEBUG8_2("CApplicationManagementSession::DownloadL: Installed App Vendor is: %S",&(preInstalledAppParams[count]->iPreInstalledAppVendorName));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3684
        RDEBUG_2("CApplicationManagementSession::DownloadL: Installed App UID is : '0x%X'",preInstalledAppParams[count]->iPreInstalledAppUid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3685
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3686
        TBool found = EFalse;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3687
        const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3688
        TInt countval(arrt.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3689
        for (TInt i(0); i < countval; i++)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3690
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3691
            CDeploymentComponent &compo = Server().Storage()->ComponentL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3692
                    arrt[i]);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3693
            if (compo.Uid()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3694
                    == preInstalledAppParams[count]->iPreInstalledAppUid)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3695
                {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3696
                RDEBUG( "CApplicationManagementSession: ActiveComponentsL found= TRUE" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3697
                found = ETrue;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3698
                }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3699
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3700
        if (!found)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3701
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3702
            RDEBUG( "CApplicationManagementSession: Adding Pre-installed app" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3703
            TDCUserId preInstalledAppName;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3704
            preInstalledAppName.Copy(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3705
                    preInstalledAppParams[count]->iPreInstalledAppame);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3706
            CDeploymentComponent *preInstallCompo = NULL;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3707
            RDEBUG8_2("CApplicationManagementSession: Installed App Name is: %S",&preInstalledAppName);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3708
            preInstallCompo = Server().Storage()->NewComponentL(EDCSActive,
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3709
                    preInstalledAppName);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3710
            preInstallCompo->SetUid(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3711
                    preInstalledAppParams[count]->iPreInstalledAppUid);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3712
            preInstallCompo->SetNameL(preInstalledAppName);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3713
            preInstallCompo->SetVersionL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3714
                    preInstalledAppParams[count]->iVersion);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3715
            preInstallCompo->SetMimeTypeL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3716
                    preInstalledAppParams[count]->iMimeType);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3717
            preInstallCompo->SetAppRemovableStatus(ETrue);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3718
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3719
            Server().Storage()->UpdateL(*preInstallCompo);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3720
            Server().Storage()->CheckForDuplicateNodesInDeployedL(
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3721
                    *preInstallCompo);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3722
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3723
        }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3724
    delete preInstallApp;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3725
    RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3726
    Server().Storage()->GetStateChangeComponentIdsL(arr);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3727
    TPckgBuf<TInt> buflen(arr.Count());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3728
    aMessage.WriteL(0, buflen);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3729
    arr.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3730
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsCountL end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3731
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3732
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3733
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3734
// CApplicationManagementSession::StateChangeCompleteL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3735
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3736
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3737
void CApplicationManagementSession::StateChangeCompleteL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3738
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3739
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3740
    RDEBUG( "CApplicationManagementSession: StateChangeCompleteL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3741
    TUint32 tid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3742
    TPckg<TUint32> ptid(tid);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3743
    TInt read2(aMessage.Read(0, ptid));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3744
    Server().Storage()->StateChangedL(tid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3745
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3746
void CApplicationManagementSession::CheckStatusNodesValuesL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3747
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3748
    const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3749
    TInt cont(arrt.Count());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3750
    TBool isUpdateRequired = ETrue;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3751
    for (TInt i(0); i < cont; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3752
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3753
        CDeploymentComponent &compo = Server().Storage()->ComponentL(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3754
        isUpdateRequired = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3755
        if (compo.Status() == EDownload_DownloadProgress)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3756
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3757
            compo.SetStatusNode(EDownload_DownloadFailed);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3758
            isUpdateRequired = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3759
            }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3760
        else if (compo.Status() == EDelivered_InstallProgress)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3761
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3762
            compo.SetStatusNode(EDelivered_InstalledFailedWithData);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3763
            isUpdateRequired = ETrue;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3764
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3765
        else if (compo.Status() == EDelivered_RemoveProgress)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3766
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3767
            compo.SetStatusNode(EDelivered_RemoveFailed);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3768
            isUpdateRequired = ETrue;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3769
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3770
        else if (compo.Status() == EDeployed_RemoveProgress)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3771
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3772
            compo.SetStatusNode(EDeployed_RemoveFailed);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3773
            isUpdateRequired = ETrue;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3774
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3775
        else if (compo.Status() == EDeployed_ActivateProgress)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3776
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3777
            compo.SetStatusNode(EDeployed_ActivateFailed);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3778
            isUpdateRequired = ETrue;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3779
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3780
        else if (compo.Status() == EDeployed_DeactivateProgress)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3781
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3782
            compo.SetStatusNode(EDeployed_DeactivateFailed);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3783
            isUpdateRequired = ETrue;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3784
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3785
        if (isUpdateRequired)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3786
            Server().Storage()->UpdateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3787
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3788
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3789
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3790
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3791
void CApplicationManagementServer::SetSisAppVersionAndDriveL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3792
        CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3793
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3794
    RDEBUG( "CApplicationManagementSession: SetSisAppVersionAndDriveL: Begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3795
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3796
    Swi::RSisRegistrySession sisSession;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3797
    User::LeaveIfError(sisSession.Connect());
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3798
    CleanupClosePushL(sisSession);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3799
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3800
    Swi::RSisRegistryEntry sisEntry;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3801
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3802
    //Opens the base package entry by specifying a UID. 
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3803
    User::LeaveIfError(sisEntry.Open(sisSession, aCompo.Uid()));
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3804
    CleanupClosePushL(sisEntry);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3805
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3806
    TUint drivesMask = sisEntry.InstalledDrivesL();
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3807
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3808
    TInt drive = EDriveA;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3809
    TDriveNumber installedDrive = EDriveC;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3810
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3811
    if (drivesMask)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3812
        {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3813
        // Select the highest drive as location drive. That's the case when 
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3814
        // all installation is not in same drive
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3815
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3816
        while (drivesMask >>= 1)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3817
            {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3818
            drive++;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3819
            }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3820
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3821
        RDEBUG_2( "drive -> SetSisAppVersionAndDriveL %d", drive);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3822
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3823
        installedDrive = (TDriveNumber) drive;
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3824
        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3825
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3826
    TBool status = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3827
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3828
    //Since "C" drive is not removable
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3829
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3830
    if (installedDrive != EDriveC)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3831
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3832
        status = IsInstalledAppRemovableL(installedDrive);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3833
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3834
    if (status)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3835
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3836
        RDEBUG( "IsInstalledAppRemovableL(SetSisAppVersionAndDriveL); True");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3837
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3838
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3839
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3840
        RDEBUG( "IsInstalledAppRemovableL(SetSisAppVersionAndDriveL); False");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3841
        }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3842
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3843
    //check for status drive
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3844
    aCompo.SetAppRemovableStatus(status);
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3845
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3846
    TVersion version = sisEntry.VersionL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3847
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3848
    if (aCompo.ComponentVersion() == KNullDesC8)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3849
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3850
        TBuf8<KVersionLength> pkgDes;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3851
        pkgDes.AppendNum(version.iMajor);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3852
        pkgDes.Append(KLiteralPeriod);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3853
        pkgDes.AppendNum(version.iMinor);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3854
        aCompo.SetVersionL(pkgDes);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3855
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3856
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3857
    CleanupStack::PopAndDestroy(2, &sisSession);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3858
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3859
    RDEBUG( "CApplicationManagementSession: SetSisAppVersionAndDriveL: End" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3860
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3861
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3862
TBool CApplicationManagementServer::IsInstalledAppRemovableL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3863
        TDriveNumber &iDrive)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3864
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3865
    RDEBUG( "IsInstalledAppRemovableL: Step1" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3866
    TBool removable = EFalse;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3867
    RFs rfs;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3868
    User::LeaveIfError(rfs.Connect());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3869
    CleanupClosePushL(rfs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3870
    TDriveList driveList;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3871
    TInt driveCount;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3872
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3873
    //Get all removeable drive, both physically and logically
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3874
    User::LeaveIfError(DriveInfo::GetUserVisibleDrives(rfs, driveList,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3875
            driveCount, KDriveAttRemovable));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3876
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3877
    TInt max(driveList.Length());
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3878
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3879
    RDEBUG_2( "driveList.Length() %d", max);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3880
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3881
    RDEBUG_2( "driveCount %d", driveCount);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3882
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3883
    TBuf<26> buf;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3884
    buf.Copy(driveList);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3885
    RDEBUG_2( "Drive Info (%S)", &buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3886
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3887
    for (TInt i = 0; i < max; ++i)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3888
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3889
        if (driveList[i])
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3890
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3891
            TUint status;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3892
            RDEBUG( "IsInstalledAppRemovableL: Step3" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3893
            DriveInfo::GetDriveStatus(rfs, i, status);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3894
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3895
            RDEBUG( "IsInstalledAppRemovableL: Step4" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3896
            //To make sure the drive is physically removeable not logically removeable  
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3897
            if (status & DriveInfo::EDriveRemovable)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3898
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3899
                RDEBUG( "IsInstalledAppRemovableL: Drive removable" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3900
                RDEBUG_2( "IsInstalledAppRemovableL: Drive removable Drive ID %d", i);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3901
                if (i == iDrive)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3902
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3903
                    RDEBUG( "IsInstalledAppRemovableL: Step5" );
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3904
                    removable = ETrue;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3905
                    break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3906
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3907
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3908
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3909
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3910
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3911
    CleanupStack::PopAndDestroy(&rfs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3912
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3913
    return removable;
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3914
    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3915
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3916
// -----------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3917
// CShutDown::CShutdown()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3918
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3919
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3920
inline CShutdown::CShutdown() :
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3921
    CTimer(-1)
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3922
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3923
    CActiveScheduler::Add(this);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3924
    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3925
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3926
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3927
// CShutDown::ConstructL()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3928
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3929
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3930
inline void CShutdown::ConstructL()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3931
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3932
    CTimer::ConstructL();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3933
    }
57
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3934
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3935
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3936
// CShutDown::Start()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3937
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3938
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3939
inline void CShutdown::Start()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3940
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3941
    RDEBUG( "ApplicationManagementServer: starting shutdown timeout" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3942
    After(KApplicationManagementShutdownDelay);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3943
    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3944
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3945
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3946
// CShutDown::RunL()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3947
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3948
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3949
void CShutdown::RunL()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3950
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3951
    RDEBUG( "ApplicationManagementServer timeout ... closing" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3952
    HbApplication::exit(0);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3953
    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3954
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3955
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3956
// CShutDown::Start()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3957
// ------------------------------------------------------------------------------------------------
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3958
inline void CShutdown::Stop()
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3959
    {
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3960
    RDEBUG( "ApplicationManagementServer: Stop" );
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3961
    HbApplication::exit(0);
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3962
    }
6757f1e2efd2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 55
diff changeset
  3963
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3964
//  End of File