applicationmanagement/server/src/ApplicationManagementServer.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:31:32 +0100
branchRCL_3
changeset 58 5b858729772b
parent 57 6757f1e2efd2
permissions -rw-r--r--
Revert incorrect RCL_3 drop: 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__
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    19
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <e32svr.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <badesca.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <e32cmn.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <bautils.h> 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <featmgr.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <imcvcodc.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <uikon.hrh>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <e32property.h>
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    28
#include "ApplicationManagementConst.h"
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    29
#include "ampskeys.h"
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include <SWInstDefs.h>
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    31
#include "amprivateCRKeys.h"
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include <PolicyEngineClient.h>
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include <PolicyEngineXACML.h>
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    34
#include <pathinfo.h>
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    35
#include <driveinfo.h>
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    36
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
#include "ApplicationManagementCommon.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
#include "ApplicationManagementClientServer.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include "ApplicationManagementServer.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
#include "AMDeploymentComponent.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include "amsmlhelper.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
#include "ApplicationManagementUtility.h"
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
#include "ApplicationManagementUtilityFactory.h"
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    44
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
#include "debug.h"
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    46
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
#include "coemain.h"
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    48
#include <aknnotewrappers.h>
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    49
#include "SyncService.h"
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
#include "AMPreInstallApp.h"
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    51
#include <DevManInternalCRKeys.h>
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
using namespace NApplicationManagement;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
#ifdef __AM_CONNECT_INSTALLER_ONSTARTUP_	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
#pragma message("AM Connecting installer at startup")
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
#else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
#pragma message("AM Connecting installer when needed")
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
#endif
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    61
0
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");
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    65
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
//OMA SCOMO Specific
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
_LIT8(KDownloadState, "./SCOMO/Download/");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
_LIT8(KDeliveredState, "./SCOMO/Inventory/Delivered/");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
_LIT8(KDeployedState, "./SCOMO/Inventory/Deployed/");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    71
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    72
// CShutDown::CShutdown()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    73
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    74
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    75
inline CShutdown::CShutdown() :
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    76
    CTimer(-1)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    77
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    78
    CActiveScheduler::Add(this);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    79
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    80
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    81
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    82
// CShutDown::ConstructL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    83
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    84
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    85
inline void CShutdown::ConstructL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    86
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    87
    CTimer::ConstructL();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    88
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    89
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    90
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    91
// CShutDown::Start()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    92
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    93
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    94
inline void CShutdown::Start()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    95
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    96
    RDEBUG( "ApplicationManagementServer: starting shutdown timeout" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    97
    After(KApplicationManagementShutdownDelay);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    98
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    99
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   100
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   101
// CShutDown::RunL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   102
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   103
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   104
void CShutdown::RunL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   105
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   106
    RDEBUG( "ApplicationManagementServer timeout ... closing" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   107
    CActiveScheduler::Stop();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   108
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   109
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   110
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   111
// CShutDown::Start()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   112
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   113
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   114
inline void CShutdown::Stop()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   115
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   116
    RDEBUG( "ApplicationManagementServer: Stop" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   117
    CActiveScheduler::Stop();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   118
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   119
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   120
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   121
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   122
// CApplicationManagementServer::CreateServiceL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   123
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   124
CApaAppServiceBase* CApplicationManagementServer::CreateServiceL(
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   125
        TUid aServiceType) const
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   126
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   127
    RDEBUG( "ApplicationManagementServer CreateServiceL" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   128
    if (aServiceType.iUid == KAMServiceUid)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   129
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   130
        return ((CApaAppServiceBase*) (new (ELeave) CApplicationManagementSession));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   131
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   132
    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   133
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   134
        return CAknAppServer::CreateServiceL(aServiceType);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   135
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   136
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   137
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   138
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   139
// CApplicationManagementServer::SendServerToBackground()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   140
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   141
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   142
void CApplicationManagementServer::SendServerToBackground()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   143
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   144
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   145
    RDEBUG( "ApplicationManagementServer SendServerToBackground - Start " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   146
    TApaTaskList taskList(CEikonEnv::Static()->WsSession() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   147
    TApaTask task = taskList.FindApp(TUid::Uid(KAppMgmtServerUid));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   148
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   149
     TInt id = CEikonEnv::Static()->RootWin().Identifier();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   150
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   151
    RDEBUG_2( "CApplicationManagementServer:::SendServerToBackground %d", id );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   152
	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   153
    task.SetWgId(id);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   154
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   155
    if (task.Exists())
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   156
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   157
	RDEBUG( "ApplicationManagementServer SendServerToBackground - Start 1" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   158
        task.SendToBackground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   159
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   160
    RDEBUG( "ApplicationManagementServer SendServerToBackground - End " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   161
    TInt amServerEnabled = 0;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   162
    RProperty::Set(KUidPSApplicationManagementKeys, KAMServerUIEnabled,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   163
            amServerEnabled);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   164
    RDEBUG( "ApplicationManagementServer SendServerToBackground - End 2 " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   165
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   166
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   167
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   168
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   169
// CApplicationManagementServer::BringServertoForeground()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   170
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   171
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   172
void CApplicationManagementServer::BringServertoForeground()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   173
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   174
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   175
    RDEBUG( "CApplicationManagementServer:::BringServertoForeground " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   176
    TApaTaskList taskList(CEikonEnv::Static()->WsSession() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   177
    TApaTask task = taskList.FindApp(TUid::Uid(KAppMgmtServerUid));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   178
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   179
    TInt id = CEikonEnv::Static()->RootWin().Identifier();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   180
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   181
    RDEBUG_2( "CApplicationManagementServer:::BringServertoForeground %d", id );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   182
	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   183
    task.SetWgId(id);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   184
    if (task.Exists())
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   185
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   186
	RDEBUG( "ApplicationManagementServer SendServerToBackground - BringServertoForeground " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   187
        task.BringToForeground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   188
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   189
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   190
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   191
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   192
// CApplicationManagementServer::BringServertoForeground()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   193
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   194
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   195
void CApplicationManagementServer::BringDMUItoForeground()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   196
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   197
    RDEBUG( "ApplicationManagementServer DownloadComplete - DM UI Broughtto foreground Start " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   198
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   199
    TApaTaskList taskList(CEikonEnv::Static()->WsSession() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   200
    TApaTask task = taskList.FindApp(KPSUidNSmlDMSyncApp);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   201
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   202
    const TInt id = task.WgId();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   203
    task.SetWgId(id);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   204
    RDEBUG_2( "CApplicationManagementServer:::BringDMUItoForeground %d", id );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   205
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   206
    if (task.Exists())
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   207
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   208
        RDEBUG( "ApplicationManagementServer DownloadComplete - DM UI Broughtto foreground " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   209
        task.BringToForeground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   210
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   211
    }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
// CApplicationManagementServer::ComponentDownloadComplete()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
// ------------------------------------------------------------------------------------------------
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   216
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
void CApplicationManagementServer::ComponentDownloadComplete(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
        CDeploymentComponent *aComponent, TInt iapid, HBufC8 *aServerId)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
    TInt err = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
    TRAP( err, DownloadCompleteL( aComponent, iapid, aServerId ));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
// CApplicationManagementServer::DownloadCompleteL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
void CApplicationManagementServer::DownloadCompleteL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
        CDeploymentComponent *aComponent, TInt iapid, HBufC8 *aServerId)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
    RDEBUG( "ApplicationManagementServer DownloadComplete - start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
    __ASSERT_DEBUG( aComponent, User::Invariant() );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   233
    iStorage->UpdateL( *aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
    TInt errdownload = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
    TInt errInstall = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
    TInt status = KStatusSuccess;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   237
    if ( !aComponent->DownloadFailed() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   239
        CDeploymentComponent *old = DoDataUpdateCheckL( *aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
        TDownloadTarget trgt = aComponent->DownloadTarget();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
        switch (trgt)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
            case EDeliver:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
            case EInstall:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
            case EInstallAndActivate:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
                TRAP(errInstall,DoTheInstallL( *aComponent));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
                if (trgt == EInstall && errInstall == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
                    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   253
                    iStorage->DeactivateL( *aComponent);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
                    }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   255
                /* to avoid duplicates in deployed tree if user delivered upgrade package
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   256
                 * by using "Install/InstallActivate" operation. if upgrade package is delivered 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   257
                 * by Update/UpdateandActivate" , this been handled in next switch case
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   258
                 */
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   259
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
            case EUpdate:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
            case EUpdateAndActivate:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
                if (old)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
                    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   268
                    FullUpdateL( *aComponent, *old);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
                    if (trgt == EUpdate)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
                        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   271
                        iStorage->DeactivateL( *aComponent);
0
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
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
            default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   281
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
        errdownload = aComponent->DownloadStatus();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
    RDEBUG( "ApplicationManagementServer DownloadComplete - Start Send to background" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
    //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
   290
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   291
    SendServerToBackground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   292
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   293
    // Bring DM UI to foreground provided operation is in non silent mode.
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   294
    TInt operNonSilent = KErrNotFound;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   295
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   296
    RProperty::Get(KUidPSApplicationManagementKeys, KAMOperationNonSilent,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   297
            operNonSilent);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   298
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   299
    if (operNonSilent==1 || operNonSilent==KErrNotFound)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   300
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   301
        RDEBUG( "ApplicationManagementServer DownloadComplete - DM UI Bring " );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   302
        BringDMUItoForeground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   303
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   304
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
    iOMASCOMOEnabled = IsOMASCOMOEnabledL();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   306
		
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   307
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
    if (iOMASCOMOEnabled)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   310
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   311
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   312
				status = GetErrorStatus(errdownload,errInstall); 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   313
		      
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
        TInt ASyncSupported = -1;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   316
        CRepository *repository = CRepository::NewLC( KUidPSApplicationManagementKeys );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
        repository->Get(KAsyncEnabled, ASyncSupported);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
        CleanupStack::PopAndDestroy();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   319
        
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   320
        // For Sync Reporting
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   321
        if (!ASyncSupported)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   322
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   323
            
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   324
            // Update Central Repository with proper error code for Sync
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   325
            
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   326
           
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   327
            CRepository *repository= CRepository::NewLC ( KUidPSApplicationManagementKeys ) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
            repository->Set(KAMSyncStatus, status);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
            CleanupStack::PopAndDestroy();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   330
                        
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
            RProperty counter;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   332
            
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   333
            TInt r=counter.Attach(KUidPSApplicationManagementKeys,
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
                    KSyncNotifier, EOwnerThread);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
            User::LeaveIfError(r);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
40
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   337
            TBuf8<256> targetURI;
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   338
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   339
            TDeploymentComponentState state = aComponent->State();
f2101057ffeb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 20
diff changeset
   340
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   341
            if (state == EDCSDownload)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   342
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   343
                targetURI.Append(KDownloadState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   344
                targetURI.Append(aComponent->UserId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   345
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   346
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   347
                if (state == EDCSDelivered)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   348
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   349
                    targetURI.Append(KDeliveredState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   350
                    targetURI.Append(aComponent->UserId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   351
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   352
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   353
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   354
                    if (state == EDCSActive|| state == EDCSInactive)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   355
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   356
                        targetURI.Append(KDeployedState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   357
                        targetURI.Append(aComponent->UserId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   358
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   359
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   360
						//Set Targeturi to cenrep
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   361
		
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   362
						CRepository* cenrep = NULL;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   363
  					TInt errr(KErrNone);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   364
	  				TRAP(errr, cenrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys ));	  	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   365
	  				if(errr == KErrNone)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   366
	  				{
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   367
    					errr = cenrep->Set( KNSmlDMSCOMOTargetRef, targetURI );    	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   368
    					delete cenrep;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   369
    					cenrep = NULL;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   370
    				}
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   371
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   372
            TInt err = counter.Set(KErrCancel);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   373
            User::LeaveIfError(err);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   374
            counter.Close();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   375
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   376
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   377
        else// Do AsyncReporting
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   378
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   379
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   380
            // Get deployement component entries
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   381
            TInt internalid = aComponent->InternalId();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   382
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   383
            TBuf8<256> targetURI;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   384
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   385
            TDeploymentComponentState state = aComponent->State();
0
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
            if (state == EDCSDownload)
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
                targetURI.Append(KDownloadState);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
                targetURI.Append(aComponent->UserId());
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
                }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   392
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   393
                if (state == EDCSDelivered)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   394
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   395
                    targetURI.Append(KDeliveredState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   396
                    targetURI.Append(aComponent->UserId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   397
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   398
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   399
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   400
                    if (state == EDCSActive|| state == EDCSInactive)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   401
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   402
                        targetURI.Append(KDeployedState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   403
                        targetURI.Append(aComponent->UserId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   404
                        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
            //Save Entry to database with status and target URI of deployment component
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
            TInt index;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
            iAMServerDB->SaveToDatabaseL(index, internalid, status,
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   410
                    targetURI, iapid);
0
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
            EnableDMNetworkMonL(iapid, aServerId);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   414
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
    if (iDownloadMngr->DownloadCount() == 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   418
        
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
        RDEBUG_2( "CApplicationManagementServer::ConstructL - ERROR leaving cannot connect installer: %d", iSessionCount );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   420
        
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
        // 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
   422
        //  the session count.
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   423
        
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   424
        if(iSessionCount != 0 )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   426
            iSessionCount--; 
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   428
       
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
        if (iSessionCount == 0)
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   430
            {  
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   431
		       iShutdown.Stop();
0
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
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   434
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
    RDEBUG( "ApplicationManagementServer DownloadComplete - end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
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
// CApplicationManagementServer::IsOMASCOMOEnabledL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
TBool CApplicationManagementServer::IsOMASCOMOEnabledL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
    TInt adapterValue;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   445
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   446
    CRepository *repository = CRepository::NewLC ( KCRUidPrivateApplicationManagementKeys ) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
    repository->Get(KAMAdapterValue, adapterValue);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
    CleanupStack::PopAndDestroy();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   449
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   450
    if(adapterValue ==0 || adapterValue == 1)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   451
     return EFalse;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
    else
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   453
     return ETrue;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   454
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
// CApplicationManagementServer::GetErrorStatus()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
// ------------------------------------------------------------------------------------------------
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   460
TInt CApplicationManagementServer::GetErrorStatus(TInt aErrorDownload, TInt aErrorInstall)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   461
{
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   462
	       TInt status = KStatusSuccess;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   463
	       
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   464
	       if (aErrorDownload!=KErrNone)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   465
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   466
                if (aErrorDownload == KStatusUserCancelled || aErrorDownload
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   467
                        == KStatusDowloadFailedOOM || aErrorDownload
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   468
                         == KStatusUnSupportedEnvironment || aErrorDownload 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   469
                        ==KStatusAlternateDownldAuthFail || aErrorDownload == KStatusAltDowldUnavailable)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   470
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   471
                    status = aErrorDownload;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   472
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   473
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   474
                    status = KStatusDownloadFailed;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   475
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   476
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   477
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   478
                if (aErrorInstall!=KErrNone)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   479
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   480
                    if (aErrorInstall == SwiUI::KSWInstErrSecurityFailure)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   481
                        status = KStatusPkgValidationFailed;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   482
                    if (aErrorInstall == SwiUI::KSWInstErrInsufficientMemory)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   483
                        status = KStatusInstallFailedOOM;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   484
                    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   485
                        status = KStatusInstallFailed;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   486
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   487
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   488
                    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   489
           return status;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   490
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   491
}
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   492
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   493
   
0
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
// CApplicationManagementServer::EnableDMNetworkMonL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
// ------------------------------------------------------------------------------------------------
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   497
void CApplicationManagementServer::EnableDMNetworkMonL(TInt iapid, HBufC8 *aServerId)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   498
{
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   499
						TInt retryenabled = 1;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   500
						_LIT( KNetMon,"\\dmnetworkmon.exe" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   501
            
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   502
            // Enable DM Network Monitoring for retry of Generic alert in case of N/W loss
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   503
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   504
            CRepository *repository= CRepository::NewLC ( KCRUidDeviceManagementInternalKeys );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   505
            repository->Set(KDevManEnableDMNetworkMon, retryenabled);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   506
            repository->Set(KDevManServerIdKey, *aServerId);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   507
            repository->Set(KDevManIapIdKey, iapid);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   508
            CleanupStack::PopAndDestroy();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   509
               
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   510
						// create NetMon EXE
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   511
            RProcess rp;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   512
            TInt err = rp.Create(KNetMon,KNullDesC);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   513
            User::LeaveIfError(err);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   514
            TRequestStatus stat;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   515
            rp.Rendezvous(stat);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   516
                            
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   517
            if (stat!=KRequestPending)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   518
              rp.Kill(0);     // abort startup
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   519
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   520
              rp.Resume();    // logon OK - start the server
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   521
            TInt r=(rp.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   522
                        rp.Close();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   523
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   524
	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   525
}
0
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
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
// CApplicationManagementServer::CApplicationManagementServer
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   531
inline CApplicationManagementServer::CApplicationManagementServer()
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
// CApplicationManagementServer::AddSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
// ------------------------------------------------------------------------------------------------
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
void CApplicationManagementServer::AddSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
    // A new session is being created
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
    RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::AddSession" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
    ++iSessionCount;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
    // Cancel the shutdown timer if it was running
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
    iShutdown.Cancel();
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
// CApplicationManagementServer::DropSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
void CApplicationManagementServer::DropSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
    // A session is being destroyed
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
    RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::DropSession" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
    // Start the shutdown timer if it is the last session
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   559
    if ( --iSessionCount == 0)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
        if (iDownloadMngr->DownloadCount() > 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
            RDEBUG( "ApplicationManagementServer: CApplicationManagementServer::DropSession download in progress" );
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
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
            iShutdown.Start();
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
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
    }
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
// -----------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
// CApplicationManagementServer::AddDownloadL( CDeploymentComponent *aComponent )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
// -----------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   575
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
void CApplicationManagementServer::AddDownloadL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
        CDeploymentComponent *aComponent)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
    __ASSERT_DEBUG( aComponent, User::Invariant() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
    iDownloadMngr->AddDownloadL(aComponent);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   581
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   582
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   583
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   584
// CApplicationManagementServer::NewLC
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   585
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   586
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   587
CApplicationManagementServer* CApplicationManagementServer::NewL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   588
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   589
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   590
    CApplicationManagementServer* self=new(ELeave) CApplicationManagementServer;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   591
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   592
    return self;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
    }
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
// ------------------------------------------------------------------------------------------------
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   596
// CApplicationManagementServer::CreateServiceSecurityCheckL
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   597
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   598
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   599
CPolicyServer::TCustomResult CApplicationManagementServer::CreateServiceSecurityCheckL(
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   600
        TUid aServiceType, const RMessage2& aMsg, TInt& aAction,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   601
        TSecurityInfo& aMissing)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   603
    TInt32 trustRange = EAddTrust;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   604
    TInt32 performRFS = EPerformRfs;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   605
    TInt32 last = ELast;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   606
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   607
    if ( (aServiceType.iUid >= trustRange)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   608
            && (aServiceType.iUid < performRFS ))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   609
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   610
        if (aMsg.HasCapability(TCapability(ECapabilityTrustedUI) ) )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   611
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   612
            return CPolicyServer::EPass;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   613
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   614
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   615
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   616
            return CPolicyServer::EFail;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   617
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   618
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   619
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   620
    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   621
        if ( (aServiceType.iUid >= performRFS) && (aServiceType.iUid < last))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   622
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   623
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   624
            if (aMsg.HasCapability(TCapability(ECapabilityDiskAdmin))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   625
                    && (aMsg.SecureId().iId == 0x101f9a02 ))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   626
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   627
                return CPolicyServer::EPass;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   628
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   629
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   630
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   631
                return CPolicyServer::EFail;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   632
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   633
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   634
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   635
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   636
            if (aServiceType.iUid == last)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   637
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   638
                return CPolicyServer::EFail;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   639
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   640
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   641
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   642
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   643
                return CAknAppServer::CreateServiceSecurityCheckL(
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   644
                        aServiceType, aMsg, aAction, aMissing);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   645
                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   649
// ------------------------------------------------------------------------------------------------
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
// CApplicationManagementServer::~CApplicationManagementServer
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
CApplicationManagementServer::~CApplicationManagementServer()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
    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
   656
            reinterpret_cast<TUint>(this)+sizeof( CApplicationManagementServer ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
    FeatureManager::UnInitializeLib();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
    iInstaller.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
    delete iStorage;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
    delete iUtility;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
    delete iAMServerDB;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
    RProperty::Delete(KUidPSApplicationManagementKeys, KAMServerUIEnabled);
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
    RProperty::Delete(KUidPSApplicationManagementKeys, KAMOperationNonSilent);
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
    RProperty::Delete(KUidPSApplicationManagementKeys, KSyncNotifier);
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
    RProperty::Delete(KUidPSApplicationManagementKeys, KDMUINotClosed);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   672
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
    iInstallFile.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
    iInstallRFs.Close();
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
    delete iDownloadMngr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   677
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
// CApplicationManagementServer::HandleAllClientsClosed
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   682
void CApplicationManagementServer::HandleAllClientsClosed()
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
    // Do Nothing
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
    RDEBUG( "CApplicationManagementServer::HandleAllClientsClosed" );
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
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
// CApplicationManagementServer::ConstructL
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   692
void CApplicationManagementServer::ConstructL(const TDesC &aServerName)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
    {
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
    // 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
   696
    RDEBUG( "CApplicationManagementServer::ConstructL - Start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   697
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   698
    iOMASCOMOEnabled = ETrue;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   699
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   700
    CAknAppServer::ConstructL(aServerName);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   701
    TRAPD( errf, FeatureManager::InitializeLibL() )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   702
    ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
    if (errf != KErrNone)
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
        User::Leave(errf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   707
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
    RDEBUG( "CApplicationManagementServer::ConstructL - start" );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   709
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
    iStorage = CDeliveryComponentStorage::NewL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
    iUtility
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
            = ApplicationManagementUtilityFactory::CreateManagementUtilityL();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   714
    iDownloadMngr = CAMDownloadManager::NewL( *this);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
    iAMServerDB = CAMDownloaddb::NewL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   716
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
    // Define P&S Keys
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
    RProperty::Define(KUidPSApplicationManagementKeys, KAMServerUIEnabled,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
            RProperty::EInt);
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
    RProperty::Define(KUidPSApplicationManagementKeys, KAMOperationNonSilent,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
            RProperty::EInt);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
    RProperty::Define(KUidPSApplicationManagementKeys, KSyncNotifier,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
            RProperty::EInt);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
    RProperty::Define(KUidPSApplicationManagementKeys, KDMUINotClosed,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
            RProperty::EInt);
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
    RProperty syncproperty;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
    //Ignore error status
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
    syncproperty.Attach(KUidPSApplicationManagementKeys, KSyncNotifier,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
            EOwnerThread);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
    syncproperty.Set(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
    syncproperty.Close();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   737
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   738
    SendServerToBackground();
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
#ifdef __AM_CONNECT_INSTALLER_ONSTARTUP_	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
    TInt err( iInstaller.Connect() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
    if ( err != KErrNone )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
        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
   745
        User::LeaveIfError( err );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
#endif	
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   748
    RDEBUG( "CApplicationManagementServer::ConstructL - end" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   749
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   750
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   751
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   752
// CApplicationManagementServer::StartShutDownTimer()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   753
// ------------------------------------------------------------------------------------------------
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   754
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   755
void CApplicationManagementServer::StartShutDownTimerL()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   756
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   757
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   758
    RDEBUG( "CApplicationManagementServer::ConstructL - end" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   759
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
    iShutdown.ConstructL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
    // 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
   762
    iShutdown.Start();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
    RDEBUG( "CApplicationManagementServer::ConstructL - end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
// CApplicationManagementServer::CustomSecurityCheckL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
CPolicyServer::TCustomResult CApplicationManagementServer::CustomSecurityCheckL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
        const RMessage2& /*aMsg*/, TInt& /*aAction*/, TSecurityInfo& /*aMissing*/)
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
    return EPass;
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
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
// CApplicationManagementServer::InstallCompleteL()
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
void CApplicationManagementServer::InstallCompleteL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
        const CDeploymentComponent& aCompo, const TBool &aInstallSuccess)
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
    RDEBUG_2("CApplicationManagementServer::InstallCompleteL start (%d)", aInstallSuccess);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
    iInstallFile.Close();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   786
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
    // 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
   788
    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
   789
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
        TFileName fn, fn2;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
        GenerateTempFileNameL(iInstallRFs, aCompo, fn, fn2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
        RDEBUG_3("CApplicationManagementServer::InstallCompleteL delete files: (%S) (%S)", &fn, &fn2);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   793
        User::LeaveIfError(iInstallRFs.Delete(fn) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   794
        User::LeaveIfError(iInstallRFs.Delete(fn2) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   796
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
    if (aInstallSuccess)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
        // Remove temporary files from private directory 
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   800
        const_cast<CDeploymentComponent&>(aCompo).ResetDataL(iInstallRFs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   802
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
    iInstallRFs.Close();
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
    iInstallInProgress = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
#ifndef __AM_CONNECT_INSTALLER_ONSTARTUP_	
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   807
    iInstaller.Close() ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
    RDEBUG("CApplicationManagementServer::InstallCompleteL end");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
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
// CApplicationManagementServer::GenerateTempJarFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
void CApplicationManagementServer::GenerateTempJarFileNameL(RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
        const TDesC& aMetaSource, TFileName &aFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
    if (aMetaSource != KNullDesC)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
        RFile file;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   822
        User::LeaveIfError(file.Open(aFs, aMetaSource, EFileRead) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
        CleanupClosePushL(file);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
        TFileName temp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
        temp = ReadJarFileNameL(file);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
        GenerateTempFileNameL(aFs, temp, aFileName);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   827
        CleanupStack::PopAndDestroy( &file);
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::GenerateTempFileNameL()
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
void CApplicationManagementServer::GenerateTempFileNameL(const RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
        const TDesC& aSource, TFileName &aFileName) const
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
    if (aSource != KNullDesC)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
        aFileName.Copy(KInstallDir);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
        TParse p;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   842
        User::LeaveIfError(aFs.Parse(aSource, p) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   843
        aFileName.Append(p.NameAndExt() );
0
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
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
// CApplicationManagementServer::GenerateTempFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
// ------------------------------------------------------------------------------------------------
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
void CApplicationManagementServer::GenerateTempFileNameL(RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
        const CDeploymentComponent& aCompo, TFileName& aSource,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
        TFileName &aMetaSource, TFileName &aFileName,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
        TFileName &aMetaFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   856
    if ( !BaflUtils::FolderExists(aFs, KInstallDir) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
        aFs.MkDirAll(KInstallDir);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   861
    aMetaSource.Copy(aCompo.MetaData().DataFileName() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
    GenerateTempFileNameL(aFs, aMetaSource, aMetaFileName);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   863
    aSource.Copy(aCompo.Data().DataFileName() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   864
    GenerateTempJarFileNameL(aFs, aMetaSource, aFileName);
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
// CApplicationManagementServer::GenerateTempFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
void CApplicationManagementServer::GenerateTempFileNameL(RFs &aFs,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
        const CDeploymentComponent& aCompo, TFileName &aFileName,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
        TFileName &aMetaFileName) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
    TFileName ftemp, msource;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
    GenerateTempFileNameL(aFs, aCompo, ftemp, msource, aFileName,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
            aMetaFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
// CApplicationManagementServer::ReadJarFileNameL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
TFileName CApplicationManagementServer::ReadJarFileNameL(RFile& aFile) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   886
    TFileName jarFileName;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   887
    HBufC8* lineBuffer = HBufC8::NewLC(KMaxFileName+72); // lets hope all lines fit to this
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   888
    TPtr8 linePtr(lineBuffer->Des() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   889
    TInt length(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   890
    aFile.Size(length);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   891
    HBufC8* data = HBufC8::NewLC(length);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   892
    TPtr8 ptr(data->Des() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   893
    aFile.Read(ptr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
    RDesReadStream stream(*data);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
    CleanupClosePushL(stream);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   896
    TInt colonIndex = -1;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   897
    TInt err(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
    TInt found(KErrNotFound);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   899
    const TInt KJadNameValueSeparator = 0x3A; //':' 
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
    for (;;)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   902
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
        TRAP( err, ReadLineL(stream, linePtr) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
        if (err == KErrNone)
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
            RDEBUG8_2("Read line: (%S)", &linePtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
            found = linePtr.Find(KMIDletJarURL);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
            if (found != KErrNotFound && found == 0) // found
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
                TPtrC8 filename(linePtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
                colonIndex = linePtr.Locate(KJadNameValueSeparator);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
                if (colonIndex != KErrNotFound)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
                    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   914
                    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
   915
                    jarFileName.Copy(filename);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   916
                    jarFileName.Trim();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   917
                    break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   918
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   919
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   920
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   921
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   922
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   923
            User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   924
            }
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
    CleanupStack::PopAndDestroy(3, lineBuffer); // stream, data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
    return jarFileName;
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
// CApplicationManagementServer::ReadLineL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
// ------------------------------------------------------------------------------------------------
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
void CApplicationManagementServer::ReadLineL(RReadStream& aStream,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   935
        TDes8& aLineBuffer) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
    TBuf8<1> input;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
    const TUint32 LF = 10;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
    const TUint32 CR = 13;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
    TBool endOfLine(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
    TInt errRead(KErrNone);
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
    // reset
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
    aLineBuffer.Zero();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   946
    while ( !endOfLine)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
        TRAP(errRead, aStream.ReadL(input, 1));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
        if (errRead == KErrEof)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   951
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
            // EOF
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   953
            User::Leave(KErrEof);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   954
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
        // check special characters	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   956
        if (input[0] == LF)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   957
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   958
            // End of line
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   959
            endOfLine = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   960
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   961
        else
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   962
            if (input[0] == CR)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   963
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   964
                // Only end of line if not followed by a LF
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   965
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   966
            else
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   967
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   968
                // We put any other character in the buffer
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   969
                if (aLineBuffer.Length() < aLineBuffer.MaxLength())
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   970
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   971
                    aLineBuffer.Append(input[0]);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   972
                    }
0
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
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
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
// CApplicationManagementServer::PrepareInstallL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
TBool CApplicationManagementServer::PrepareInstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
        const CDeploymentComponent &aComponent, TFileName &aFileName)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   983
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   984
    RDEBUG( "CApplicationManagementServer::PrepareInstallL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   985
    TBool res(ETrue);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   986
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   987
#ifndef __AM_CONNECT_INSTALLER_ONSTARTUP_
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   988
    TInt err(iInstaller.Connect() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   989
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   990
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   991
        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
   992
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   993
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   994
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   995
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   996
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   997
    RDEBUG( "CApplicationManagementServer::PrepareInstallL - connected to installer" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   998
    // Copy data file name (install file)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   999
    if (aComponent.Data().DataFileName().Length() > 0)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1000
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1001
        aFileName.Copy(aComponent.Data().DataFileName() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1002
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1003
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1004
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1005
        // data file has not been created for component!	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1006
        User::Leave(KErrNotFound);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1007
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1008
    // Open RFs session
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1009
    User::LeaveIfError(iInstallRFs.Connect() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1010
    User::LeaveIfError(iInstallRFs.ShareProtected() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1011
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1012
    // set installoptions and correct mime type
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1013
    using namespace SwiUI;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1014
    iInstallOptions = aComponent.InstallOpts().iOptions;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1015
    TInstallReq req;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1016
	if (aComponent.Data().MimeType() == SwiUI::KSisMimeType) 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1017
	{
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1018
		//convert if MIME type is application/vnd.symbian.install to x-epoc/x-sisx-app
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1019
		//as installer doesn't support application/vnd.symbian.install MIME type from S60 3rd edition onwards.
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1020
		req.iMIME = SwiUI::KSisxMimeType;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1021
	}
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1022
	else 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1023
	{
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1024
		req.iMIME = aComponent.Data().MimeType();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1025
	}
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1026
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1027
	if (CDeploymentComponent::IsJavaMimeL(aComponent.MetaData().MimeType() ) ) {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1028
		// Check if both jad and jar files already exist in the phone	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1029
		if (CDeploymentComponent::IsJavaMimeL(aComponent.Data().MimeType() ) && aComponent.MetaData().MimeType() == SwiUI::KJadMIMEType) {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1030
			// Move both files to temporary location and use jad to install java application
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1031
			CFileMan *fm = CFileMan::NewL(iInstallRFs);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1032
			CleanupStack::PushL(fm);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1033
			TFileName source, metasource, metatarget;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1034
			aFileName.Copy(KNullDesC8() ); // reset
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1035
			GenerateTempFileNameL(iInstallRFs, aComponent, source, metasource,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1036
					aFileName, metatarget);
0
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
            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
  1039
            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
  1040
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1041
            // Copy datafile (jar)
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1042
            TInt copyer(fm->Copy(source, aFileName) );
0
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
            // Copy metadatafile (jad)
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1045
            TInt copyer2(fm->Copy(metasource, metatarget) );
0
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
            CleanupStack::PopAndDestroy(fm);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1049
            RDEBUG_3( "CApplicationManagementServer::PrepareInstallL - (%d)-(%d)", copyer, copyer2 );
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
            if (copyer == KErrNone && copyer2 == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1052
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1053
                res = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1054
                aFileName = metatarget;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1055
                req.iMIME = aComponent.MetaData().MimeType();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1056
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1057
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1058
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1059
                User::Leave(KErrWrite);
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
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1062
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1063
            if (aComponent.MetaData().MimeType() == SwiUI::KJadMIMEType)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1064
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1065
                aFileName.Copy(aComponent.MetaData().DataFileName() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1066
                req.iMIME = aComponent.MetaData().MimeType();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1067
                RDEBUG_2( "CApplicationManagementServer::PrepareInstallL - Using Jad file to install java application: %S", &aFileName );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1068
                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1069
        }
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
    if (aComponent.GetIAP() > -1)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1072
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1073
        req.iIAP = aComponent.GetIAP();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1074
        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
  1075
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1076
    else
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
        TInt iap = KErrNotFound;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1079
        TRAPD( err, SmlHelper::GetDefaultIAPFromDMProfileL( iap ) )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1080
        ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1081
        if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1082
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1083
            req.iIAP = iap;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1084
            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
  1085
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1086
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1087
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1088
            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
  1089
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1090
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1091
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1092
    iInstallReq = SwiUI::TInstallReqPckg(req);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1093
    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
  1094
    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
  1095
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1096
    User::LeaveIfError(iInstallFile.Open(iInstallRFs, aFileName, EFileRead) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1097
    TInt sz;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1098
    User::LeaveIfError(iInstallFile.Size(sz) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1099
    if ( !(sz > 0))
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
        res = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1102
        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
  1103
        }
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1106
    RDEBUG( "CApplicationManagementServer::PrepareInstallL end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1107
    return res;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1108
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1109
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
// CApplicationManagementServer::InstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1112
// ------------------------------------------------------------------------------------------------	
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
void CApplicationManagementServer::InstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
        const CDeploymentComponent &aComponent, TRequestStatus &aStatus)
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
    RDEBUG( "CApplicationManagementServer::InstallL (async): begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
    if (iInstallInProgress == EFalse)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
        TFileName fn;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1122
        if (PrepareInstallL(aComponent, fn) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1124
            RDEBUG_3( "CApplicationManagementServer::InstallL: Install '%S' sizeof opts: %d", &fn, sizeof (aComponent.InstallOpts()));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1125
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1126
            // Silent or Non Silent Installation is choosen based on DM session started in silent or non silent
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1127
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1128
            TInt err = KErrNone;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1129
            TInt nonSilentOperation = KErrNotFound;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1130
            RProperty::Get(KUidPSApplicationManagementKeys,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1131
                    KAMOperationNonSilent, nonSilentOperation);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1132
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1133
            if (!nonSilentOperation)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1135
                TRAP( err ,iInstaller.SilentInstall( aStatus, iInstallFile, iInstallReq, iInstallOptions ) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1136
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1139
                TRAP( err ,iInstaller.Install( aStatus, iInstallFile, iInstallReq ) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
            RDEBUG_2( "CApplicationManagementServer::InstallL: status: %d", err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
            User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
            iInstallInProgress = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
        else
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
            RDEBUG( "CApplicationManagementServer::InstallL - PrepareInstallL failed, leaving" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
            }
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
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
        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
  1155
        TRequestStatus * status = &aStatus;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
        User::RequestComplete(status, KErrInUse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
    RDEBUG( "CApplicationManagementServer::InstallL (async): end" );
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
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
// CApplicationManagementServer::PrepareInstallL()
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
void CApplicationManagementServer::InstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
        const CDeploymentComponent &aComponent)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1168
    RDEBUG( "CApplicationManagementServer::InstallL: begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
    if (iInstallInProgress == EFalse)
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
        TFileName fn;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1173
        if (PrepareInstallL(aComponent, fn) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1174
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
            iInstallInProgress = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
            RDEBUG_2( "CApplicationManagementServer::InstallL: Install '%S' ", &fn);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
            SwiUI::TInstallOptionsPckg pkg(aComponent.InstallOpts().iOptions);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1178
            TRAPD( err ,iInstaller.SilentInstall( fn, pkg ) )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1179
            ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1180
            User::LeaveIfError(err);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
            iInstallInProgress = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1184
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1185
            RDEBUG( "CApplicationManagementServer::InstallL - PrepareInstallL failed, leaving" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1186
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1187
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1188
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1189
    RDEBUG( "CApplicationManagementServer::InstallL: end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1191
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1192
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1193
// CApplicationManagementServer::UninstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1194
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1195
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1196
void CApplicationManagementServer::UninstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1197
        const CDeploymentComponent &aComponent, TRequestStatus &aStatus)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1198
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1199
    RDEBUG( "CApplicationManagementServer::UninstallL: begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1200
    if (iInstallInProgress == EFalse)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1202
        TInt err(iInstaller.Connect() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1203
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1204
        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
  1205
        using namespace SwiUI;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1206
        iUninstallOptions = aComponent.UninstallOpts();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1207
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1208
        TInt nonSilentOperation = KErrNotFound;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1209
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1210
        RProperty::Get(KPSUidNSmlDMSyncApp, KSilentSession,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1211
                nonSilentOperation);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1212
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1213
				iOMASCOMOEnabled = IsOMASCOMOEnabledL();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1214
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1215
        if (!iOMASCOMOEnabled)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1216
            nonSilentOperation = 0;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1217
        if (!nonSilentOperation)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1218
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1219
            TRAP( err ,iInstaller.SilentUninstall( aStatus, aComponent.Uid(),
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1220
                            iUninstallOptions, aComponent.MimeType() ) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1221
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1222
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1223
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1224
            TRAP( err ,iInstaller.Uninstall( aStatus, aComponent.Uid(), aComponent.MimeType() ) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1225
            CSyncService *syncService =
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1226
                    CSyncService::NewL(NULL, KDevManServiceStart);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1227
            if (syncService)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1228
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1229
                syncService->EnableProgressNoteL(EFalse);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1230
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1231
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1232
            delete syncService;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1233
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
        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
  1236
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1237
        iInstallInProgress = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1238
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
        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
  1242
        TRequestStatus * status = &aStatus;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1243
        User::RequestComplete(status, KErrInUse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
    RDEBUG( "CApplicationManagementServer::UninstallL: end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
// CApplicationManagementServer::PerformRFSL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1250
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1251
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1252
void CApplicationManagementServer::PerformRFSL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1254
    RDEBUG( "CApplicationManagementServer::PerformRFSL: begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1255
    const RComponentIdArray &arrt = iStorage->GetComponentIds();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1256
    TCertInfoPckg *corcert= NULL;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1257
    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
  1258
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
        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
  1260
        CDeploymentComponent &c = iStorage->ComponentL(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1261
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1262
        const RCertArray &certs = iStorage->Certificates();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1263
        TInt index = c.Owner();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1264
        TCertInfoPckg *certp = NULL;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1265
        if (index >= 0)
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1266
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1267
        	certp = certs[ c.Owner() ];
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1268
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1269
        if ( !corcert && certp)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1270
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1271
            if (CheckCertL( (*certp)() ) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1272
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1273
                corcert = certp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1274
                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
  1275
                RemoveInternalL(c);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1276
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1277
            else
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
                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
  1280
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
        else
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
            if (corcert == certp)
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::PerformRFSL Removing %d ", i );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
                RemoveInternalL(c);
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
            else
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
                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
  1292
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1294
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
    RDEBUG( "CApplicationManagementServer::PerformRFSL: end" );
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
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
// CApplicationManagementServer::RemoveInternalL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1302
void CApplicationManagementServer::RemoveInternalL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1303
        const CDeploymentComponent &aCompo, TBool aDoUninstall /* = ETrue */)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1304
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1305
    RDEBUG_2("CApplicationManagementServer: RemoveInternalL - Remove id: (%d)", aCompo.InternalId() );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1306
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1307
    aCompo.SetStatusNode(EDelivered_RemoveProgress);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1308
    TInt err(KErrNone);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1309
    TDeploymentComponentState st(aCompo.State() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1310
    if (st == EDCSDelivered || st == EDCSDownload)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1311
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1312
        TRAP(err,iStorage->RemoveL( aCompo.InternalId() ));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1313
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1314
    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1315
        if (st == EDCSActive || st == EDCSInactive)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1316
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
            if (aDoUninstall)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1319
                if (aCompo.Uid() != TUid::Null() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
                    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1321
                    //TInt err= KErrNone;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1322
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
                    TInt nonSilentOperation = KErrNotFound;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1324
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1325
                    RProperty::Get(KPSUidNSmlDMSyncApp, KSilentSession,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1326
                            nonSilentOperation);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1327
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1328
										iOMASCOMOEnabled = IsOMASCOMOEnabledL();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1329
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
                    if (!iOMASCOMOEnabled)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
                        nonSilentOperation = 0;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1332
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1333
                    if (nonSilentOperation!=0)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
                        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1335
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1336
                        BringServertoForeground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1337
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1338
                        TInt amServerEnabled = 1;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1339
                        err = RProperty::Set(KUidPSApplicationManagementKeys,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1340
                                KAMServerUIEnabled, amServerEnabled);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1341
                        User::LeaveIfError(err); // invalid
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1342
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1343
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1344
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1345
                    TRequestStatus s;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1346
                    TRAP(err,UninstallL( aCompo, s ));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1347
                    User::WaitForRequest(s);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1348
                    iInstallInProgress = EFalse;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1349
                    // Capturing Installer errors,if any
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1350
                    err = s.Int();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1351
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1352
                    TInt amServerEnabled = 0;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1353
                    RProperty::Set(KUidPSApplicationManagementKeys,
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1354
                            KAMServerUIEnabled, amServerEnabled);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1355
                    //User::LeaveIfError(err); // invalid
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1356
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1357
                    SendServerToBackground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1358
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1359
                    // Bring DM UI to foreground
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1360
                    if (nonSilentOperation!=0)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1361
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1362
                        BringDMUItoForeground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1363
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1364
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1365
                    if (s.Int() == KErrNone)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1366
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1367
                        RDEBUG("CApplicationManagementServer::RemoveInternalL Uninstalled");
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1368
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1369
                    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1370
                        if (s.Int() == KErrNotFound)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
                            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1372
                            RDEBUG( "CApplicationManagementServer: RemoveInternalL WARNING component was not found by uninstaller" );
0
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
                            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1376
                            RDEBUG_2("CApplicationManagementServer: RemoveInternalL ERROR uninstall failed %d", s.Int() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1377
                            
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
                            }
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( "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
  1383
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
                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
  1388
                }
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
             *   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
  1391
             *   
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
             */
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
            if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1395
                iStorage->RemoveL(aCompo.InternalId() );
0
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
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
        else
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
            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
  1401
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1403
    /*  
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1404
     * if error set state to remove failed
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1405
     * Finally call userleaveiferror()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1406
     * */
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1407
    if (err != KErrNone)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
        aCompo.SetStatusNode(EDelivered_RemoveFailed);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
    User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1415
// CApplicationManagementServer::CheckCertL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
TBool CApplicationManagementServer::CheckCertL(const TCertInfo &aInfo) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
    TBool go(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1422
    if (FeatureManager::FeatureSupported( KFeatureIdSapPolicyManagement) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
        //	#ifdef __SAP_POLICY_MANAGEMENT
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
        RPolicyEngine peng;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1427
        // The management session
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
        //
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1429
        TInt err(peng.Connect() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1430
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
        if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
            CleanupClosePushL(peng);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
            RPolicyRequest rq;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1435
            err = rq.Open(peng) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
            if (err == KErrNone)
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
                CleanupClosePushL(rq);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
                TRequestContext rc;
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
                using namespace PolicyEngineXACML;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
                using namespace NPolicyConstants;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
                rc.AddSubjectAttributeL(KTrustedSubject, aInfo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1446
                rc.AddResourceAttributeL(KResourceId, KApplicationManagement,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1447
                        KStringDataType);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
                TResponse resp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
                err = rq.MakeRequest(rc, resp);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
                if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
                    if (resp.GetResponseValue() == EResponsePermit
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1454
#ifdef _DEBUG
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1455
                            || resp.GetResponseValue()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
                                    == EResponseNotApplicable
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
#endif 
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
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
                        go = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1462
                    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1463
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
                        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
  1465
                        }
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
                else
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
                    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
  1470
                    }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1471
                CleanupStack::PopAndDestroy( &rq) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
                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
  1476
                }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1477
            CleanupStack::PopAndDestroy( &peng) ;
0
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
        else
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
            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
  1482
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
        User::LeaveIfError(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1487
        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
  1488
        go = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1489
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
    return go;
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
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
// CApplicationManagementServer::HasUidL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
TBool CApplicationManagementServer::HasUidL(const TUid &aUid,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
        CDeploymentComponent *& aCompo, CDeploymentComponent *aIgnored /* = NULL */)
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
    TBool found(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
    const RComponentIdArray &arrt = iStorage->GetComponentIds();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1502
    TInt count(arrt.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1503
    for (TInt i( 0); i < count; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
        CDeploymentComponent &compo = iStorage->ComponentL(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
        if (compo.Uid() == aUid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1508
            if ( &compo != aIgnored)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
                aCompo = &compo;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
                found = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
                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
  1513
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
            else
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( "ApplicationManagementServer: UidExistsL - Found ignored " );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1518
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1520
    if ( !found)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1521
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1522
        found = FindInstalledSisUidL(aUid);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1523
        if ( !found)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1524
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1525
            found = FindInstalledJavaUidL(aUid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1526
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1527
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1528
    return found;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1529
    }
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
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
// CApplicationManagementServer::FindInstalledSisUidL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
TBool CApplicationManagementServer::FindInstalledSisUidL(const TUid &aUid) const
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
    TBool found(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
    Swi::RSisRegistrySession sisses;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1539
    TInt r(sisses.Connect() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1540
    User::LeaveIfError(r) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1541
    CleanupClosePushL(sisses);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1543
    RArray<TUid> uids;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1544
    sisses.InstalledUidsL(uids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
    CleanupClosePushL(uids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1546
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1547
    TInt uidc(uids.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1548
    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
  1549
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1550
        if (uids[j] == aUid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1552
            found = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1553
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1554
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1555
    CleanupStack::PopAndDestroy( &uids);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1556
    CleanupStack::PopAndDestroy( &sisses);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1557
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1558
    return found;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1559
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1560
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1561
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1562
// CApplicationManagementServer::FindInstalledJavaUidL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1563
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1564
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1565
TBool CApplicationManagementServer::FindInstalledJavaUidL(const TUid &aUid) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1566
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1567
    TBool found(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1568
    iUtility->RefreshJavaRegistryL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1569
    found = iUtility->FindInstalledJavaUidL(aUid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1570
    return found;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1571
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1572
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1573
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1574
// CApplicationManagementServer::FindNewUid()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1575
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1576
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1577
TUid CApplicationManagementServer::FindNewUid(const RArray<TUid> &aUidsOrig,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1578
        const RArray<TUid> &aUidsNew) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1580
    TUid ret(TUid::Null() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1581
    TInt c1(aUidsOrig.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1582
    TInt c2(aUidsNew.Count() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
    if (c2 >= c1)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1584
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
        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
  1586
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
            if (aUidsOrig.Find(aUidsNew[i]) == KErrNotFound)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
                ret = aUidsNew[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
                }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1591
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
            }
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
    return ret;
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1598
// CApplicationManagementServer::JavaUidsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1599
// ------------------------------------------------------------------------------------------------	
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
void CApplicationManagementServer::JavaUidsL(RArray<TUid> &aUids) const
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
    iUtility->RefreshJavaRegistryL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1604
    iUtility->JavaUidsL(aUids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1605
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1606
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1607
void CApplicationManagementServer::CheckforDuplicateMidletsL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1608
        TMidletParameters& amidletParameters)
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
    RDEBUG( "CApplicationManagementServer::CheckforDuplicateMidletsL: Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1611
    const RComponentIdArray &arrt = iStorage->GetComponentIds();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1612
    TInt cont(arrt.Count() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1613
    for (TInt i( 0); i < cont; i++)
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1614
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1615
        CDeploymentComponent &compo = iStorage->ComponentL(arrt[i]);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1616
        if (((compo.State() == EDCSActive) || (compo.State() == EDCSInactive ))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1617
                && (compo.MidletName()== amidletParameters.iMidletName)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1618
                && (compo.MidletVendor()== amidletParameters.iMidletVenorName))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1619
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1620
            //remove old one
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1621
            iStorage->RemoveL(compo.InternalId() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1622
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1623
        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1624
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
    RDEBUG( "CApplicationManagementServer::CheckforDuplicateMidletsL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1626
    }
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
// CApplicationManagementServer::JavaInstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1630
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1631
void CApplicationManagementServer::JavaInstallL(CDeploymentComponent &aCompo)
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: Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1635
    TRequestStatus s;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1636
    TInt err(KErrNone);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1637
    // set state to install progress
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1638
    aCompo.SetStatusNode(EDelivered_InstallProgress);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1639
    TRAP(err,InstallL( aCompo,s ));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1640
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1641
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1642
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1643
        User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1644
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1645
    User::WaitForRequest(s);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1646
    SendServerToBackground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1647
    if (s != KErrNone)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1648
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1649
        RDEBUG_2( "ApplicationManagementSession: JavaInstallL failed with code %d",
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1650
                s.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1651
        // set state to install failed with data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1652
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1653
        User::Leave(s.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1654
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1655
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1656
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1657
        TMidletParameters midletParameters;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1658
        iUtility->RefreshJavaRegistryL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1659
        //Ignore if any error comes
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1660
        TRAPD(err,iUtility->GetInstalledMidletParametersL(midletParameters))
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1661
        ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1662
        TRAP(err,CheckforDuplicateMidletsL(midletParameters));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1663
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1664
        if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1665
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1666
            aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1667
            User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1668
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1669
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1670
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1671
            aCompo.SetStatusNode(EIdle);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1672
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1673
        aCompo.SetUid(midletParameters.iMidletUid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1674
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1675
        RDEBUG( "CApplicationManagementServer::JavaInstallL: Step1");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1676
        if (aCompo.ComponentVersion() == KNullDesC8)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1677
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1678
            aCompo.SetVersionL(midletParameters.bufVersion);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1679
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1680
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1681
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1682
        TBool status = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1683
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1684
        //Since "C" drive is not removable
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1685
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1686
        if (midletParameters.iDrive!=EDriveC)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1687
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1688
            status = IsInstalledAppRemovableL(midletParameters.iDrive);
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
        if (status)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1691
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1692
            RDEBUG( "IsInstalledAppRemovableL(midletParameters.iDrive); True");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1693
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1694
        else
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
            RDEBUG( "IsInstalledAppRemovableL(midletParameters.iDrive); False");
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1699
        //check for status drive
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1700
        aCompo.SetAppRemovableStatus(status);
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1703
    RDEBUG( "CApplicationManagementServer::JavaInstallL: End");
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
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1707
// CApplicationManagementServer::SisInstallL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1710
void CApplicationManagementServer::SisInstallL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1711
        const CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1712
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1713
    TRequestStatus s;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1714
    // set state to install progress
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1715
    aCompo.SetStatusNode(EDelivered_InstallProgress);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1716
    TInt err(KErrNone);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1717
    TRAP(err,InstallL( aCompo,s ));
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1718
    if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1719
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1720
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1721
        User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1722
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1723
    User::WaitForRequest(s);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1724
    if (s != KErrNone)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1725
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1726
        RDEBUG_2("ApplicationManagementSession: SisInstallL failed with code %d",
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1727
                s.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1728
        // set state to install failed with data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1729
        aCompo.SetStatusNode(EDelivered_InstalledFailedWithData);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1730
        User::Leave(s.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1731
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1732
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1733
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1734
        // set state to install sucessful
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1735
        aCompo.SetStatusNode(EIdle);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1736
        RDEBUG("ApplicationManagementSession: SisInstallL successfull" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1737
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1738
    RDEBUG( "CApplicationManagementServer::SisInstallL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1739
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1740
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1741
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1742
// CApplicationManagementServer::DoTheInstallL()
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1743
// ------------------------------------------------------------------------------------------------	
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1744
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1745
void CApplicationManagementServer::DoTheInstallL(CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1746
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1747
    RDEBUG( "CApplicationManagementServer::DoTheInstallL: Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1748
    TInt error(KErrNone);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1749
    if (CDeploymentComponent::IsJavaMimeL(aCompo.Data().MimeType() )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1750
            || CDeploymentComponent::IsJavaMimeL(aCompo.MetaData().MimeType() ) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1751
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1752
        TRAP( error, JavaInstallL( aCompo ) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1753
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1754
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1755
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1756
        TRAP( error, SisInstallL( aCompo ) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1757
        SetSisAppVersionAndDriveL(aCompo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1758
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1759
    
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1760
    SendServerToBackground();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1761
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1762
    if (error == KErrNone)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1763
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1764
        InstallCompleteL(aCompo, ETrue);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1765
        CDeploymentComponent *old = DoDataUpdateCheckL(aCompo);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1766
        if (old)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1767
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1768
            if (aCompo.State() == EDCSDelivered)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1769
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1770
                if (old->State() == EDCSActive || old->State()== EDCSInactive)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1771
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1772
                    RDEBUG("AMSession: DoTheInstallL ** deleting old node **" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1773
                    iStorage->RemoveL(old->InternalId() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1774
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1775
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1776
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1777
        iStorage->InstalledL(aCompo);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1778
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1779
    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1780
        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1781
        InstallCompleteL(aCompo, EFalse);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1782
        User::Leave(error);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1783
        }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1784
    RDEBUG( "CApplicationManagementServer::DoTheInstallL: End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1785
    }
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
// CApplicationManagementServer::DoDataUpdateCheckL()
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
CDeploymentComponent *CApplicationManagementServer::DoDataUpdateCheckL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1792
        CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1793
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1794
    CDeploymentComponent *old= NULL;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1795
    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
  1796
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1797
        // check for Uid component.. Legacy code removed.
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1798
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1799
    return old;
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
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
// CApplicationManagementServer::SetDataL()
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
void CApplicationManagementServer::SetDataL(CDeploymentComponent &aCompo,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1807
        const TDesC8 &aData, const TDesC8 &aMime)
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
    aCompo.SetDataL(aData, aMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1810
    DoDataUpdateCheckL(aCompo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1811
    }
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
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1814
// CApplicationManagementServer::FullUpdateL()
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
void CApplicationManagementServer::FullUpdateL(const TUint32 sid,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1818
        const TUint32 tid)
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
    CDeploymentComponent &scompo = iStorage->ComponentL(sid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1821
    CDeploymentComponent &tcompo = iStorage->ComponentL(tid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1822
    FullUpdateL(scompo, tcompo);
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1825
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1826
// CApplicationManagementServer::FullUpdateL()
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
void CApplicationManagementServer::FullUpdateL(CDeploymentComponent &scompo,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1830
        const CDeploymentComponent &tcompo)
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
    if (scompo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1833
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1834
        if (tcompo.State() == EDCSActive || tcompo.State() == EDCSInactive)
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
            TRequestStatus s2;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1837
            InstallL(scompo, s2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1838
            User::WaitForRequest(s2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1839
            if (s2 != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1840
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1841
                RDEBUG_2( "ApplicationManagementSession: FullUpdateL failed with code %d", s2.Int() );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1842
                User::Leave(s2.Int() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1843
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1844
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1845
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1846
                InstallCompleteL(scompo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1847
                // Before deleting old node ,copy node values which are not set in new node from old node
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1848
                if (scompo.ComponentId()== KNullDesC8)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1849
                scompo.SetIdL(tcompo.ComponentId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1850
                
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1851
                if (scompo.ComponentName()== KNullDesC8)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1852
                scompo.SetNameL(tcompo.ComponentName());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1853
                
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1854
                if (scompo.ComponentVersion()== KNullDesC8)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1855
                scompo.SetVersionL(tcompo.ComponentVersion());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1856
                
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1857
                //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
  1858
                //Remove the const'ness since state needs to be updated.
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1859
                
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1860
                iStorage->SetDeploymentComponentState(const_cast <CDeploymentComponent &>(tcompo),EDCSDelete);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1861
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1862
                iStorage->InstalledL( scompo );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1863
                RDEBUG( "ApplicationManagementSession: FullUpdateL ok" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1864
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1865
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1866
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1867
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1868
            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
  1869
            User::Leave(KErrArgument);
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( "ApplicationManagementSession: ERROR FullUpdateL called for illegal state message!" );
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
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
// CApplicationManagementServer::IsDataFileB64EncodedL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1881
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1882
TBool CApplicationManagementServer::IsDataFileB64EncodedL(RFile &aFile,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1883
        TInt& aLength)
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
    RDEBUG("CApplicationManagementServer::IsDataFileB64EncodedL()  : start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1886
    TBool encoded = ETrue; // assume b64 encoded
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1887
    TInt bufSize(KBase64BufSize);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1888
    TInt offset(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1889
    HBufC8 *dataBuf = HBufC8::NewLC(bufSize);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1890
    TPtr8 dataPtr = dataBuf->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1891
    aFile.Size(aLength);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1892
    aFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1893
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1894
    while (encoded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1895
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1896
        aFile.Read(dataPtr);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1897
        if ( !dataPtr.Length() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1898
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1899
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1900
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1901
        offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1902
        aFile.Seek(ESeekCurrent, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1903
        RDEBUG_2("OFFSET: %d", offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1904
        encoded = CheckB64Encode(dataPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1905
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1906
    RDEBUG_2("Encoded: %d", encoded);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1907
    CleanupStack::PopAndDestroy(dataBuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1908
    offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1909
    aFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1910
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1911
    RDEBUG("CApplicationManagementServer::IsDataFileB64EncodedL()  : end");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1912
    return encoded;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1913
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1914
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1915
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1916
// CApplicationManagementServer::CheckB64Encode( const TDesC8& aData )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1917
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1918
TBool CApplicationManagementServer::CheckB64Encode(const TDesC8& aData)
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
    TInt inputIndex = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1921
    TInt inputLen = aData.Length();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1922
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1923
    while (inputIndex < inputLen)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1924
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1925
        const TUint8& p = aData[ inputIndex ];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1926
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1927
        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
  1928
                <= 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
  1929
                == 13)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1930
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1931
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1932
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1933
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1934
            return EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1935
            }
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
        inputIndex++;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1938
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1941
    return ETrue;
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
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
// CApplicationManagementServer::GetAMServerDownloadDBL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1948
void CApplicationManagementServer::GetAMServerDownloadDBL(TUint32 internalid,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1949
        TInt& finalresult, TDes8& aTargetURI)
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
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step1" );
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
    TBuf<50> internalidbuf;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1954
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1955
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step2" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1956
    internalidbuf.Num(internalid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1957
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1958
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step3" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1959
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1960
    RPointerArray<CAMDbItem> aItemArray;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1961
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1962
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step4" );
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
    iAMServerDB->GetEntryForLUIDL(aItemArray, internalidbuf);
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
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step5" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1967
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1968
    if (aItemArray.Count()!=0)
0
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
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step6" );
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
        finalresult = aItemArray[0]->iResult;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1973
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1974
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step7" );
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
        if (finalresult < KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1977
            User::Leave(KErrGeneral);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1978
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1979
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step8" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1980
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1981
        if (*aItemArray[0]->iTargetURI == KNullDesC8())
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1982
            User::Leave(KErrGeneral);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1983
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1984
        RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step9" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1985
        aTargetURI.Copy(*aItemArray[0]->iTargetURI);
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
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1988
    RDEBUG( "CApplicationManagementServer::GetAMServerDownloadDBL(): Step10" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1989
    aItemArray.ResetAndDestroy();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1990
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1991
    }
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
// CApplicationManagementServer::DeleteGenericAlertForIDL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1995
// ------------------------------------------------------------------------------------------------	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1996
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1997
void CApplicationManagementServer::DeleteGenericAlertForIDL(TUint32 internalid)
0
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
    iAMServerDB->DeleteFromDatabaseL(internalid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2000
    }
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2003
// CApplicationManagementServer::DecodeB64DataFileL( RFile& aDataFile, RFile& aDestinationFile )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2004
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2005
void CApplicationManagementServer::DecodeB64DataFileL(RFile& aSourceFile,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2006
        RFile& aDestinationFile)
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
    RDEBUG( "CApplicationManagementServer::DecodeB64DataFileL(): Start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2009
    // Create buffers
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2010
    //TInt b64bufferSize = 131072;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2011
    TInt decodedBufferSize = ( (KBase64BufSize*3) / 4 + 16 );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2012
    HBufC8 *dataBuf = HBufC8::NewLC(KBase64BufSize);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2013
    TPtr8 dataPtr = dataBuf->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2014
    HBufC8* targetBuf = HBufC8::NewLC(decodedBufferSize);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2015
    TPtr8 targetPtr(targetBuf->Des() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2016
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2017
    TInt offset(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2018
    TInt length(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2019
    TBool reading(ETrue);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2020
    aSourceFile.Size(length);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2021
    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
  2022
    aSourceFile.Seek(ESeekStart, offset);
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
    // Initialize decoder
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2025
    TImCodecB64 B64Coder;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2026
    B64Coder.Initialise();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2027
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2028
    while (reading)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2029
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2030
        aSourceFile.Read(dataPtr);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2031
        if ( !dataPtr.Length() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2032
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2033
            // EOF
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2034
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2035
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2036
        offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2037
        aSourceFile.Seek(ESeekCurrent, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2038
        RDEBUG_2("OFFSET: %d", offset);
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
        // decode data
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2041
        B64Coder.Decode(dataPtr, targetPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2042
        // write decoded data to temporary file
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2043
        aDestinationFile.Write(targetPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2044
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2045
    CleanupStack::PopAndDestroy(targetBuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2046
    CleanupStack::PopAndDestroy(dataBuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2047
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2048
    offset = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2049
    aDestinationFile.Seek(ESeekStart, offset);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2050
    RDEBUG( "CApplicationManagementServer::DecodeB64DataFileL(): end" );
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2053
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2054
// CApplicationManagementServer::DecodeB64DataLC( const TDesC8& aData )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2055
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2056
HBufC8* CApplicationManagementServer::DecodeB64DataLC(const TDesC8 &aData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2057
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2058
    RDEBUG( "CApplicationManagementServer::DecodeB64DataLC(): Start" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2059
    TImCodecB64 B64Coder;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2060
    B64Coder.Initialise();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2061
    HBufC8 *target = HBufC8::NewLC( (aData.Length() * 3 ) / 4 + 16);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2062
    TPtr8 targetPtr(target->Des() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2063
    B64Coder.Decode(aData, targetPtr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2064
    RDEBUG( "CApplicationManagementServer::DecodeB64DataLC(): End" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2065
    return target;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2066
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2067
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2068
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2069
//  CApplicationManagementServer::EncodeDataL( const TDesC8& aData, CBufBase &aTarget )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2070
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2071
void CApplicationManagementServer::EncodeDataL(const TDesC8& aData,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2072
        CBufBase &aTarget)
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
    TInt outLen(aData.Length() * 2);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2075
    aTarget.ExpandL(0, outLen);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2076
    TImCodecB64 B64Coder;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2077
    B64Coder.Initialise();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2078
    TPtr8 target(aTarget.Ptr(0) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2079
    TInt decoded(B64Coder.Encode(aData, target) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2080
    TInt s(target.Length() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2081
    aTarget.ResizeL(s);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2082
    //	TInt s2( aTarget.Size());
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2083
    aTarget.Compress();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2084
    //	TInt s3( aTarget.Size() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2085
    if ( !decoded)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2086
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2087
        RDEBUG( "CApplicationManagementServer::EncodeDataL(): Encoding b64 failed?" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2088
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2089
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2090
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
// CApplicationManagementSession::CApplicationManagementSession
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
inline CApplicationManagementSession::CApplicationManagementSession()
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
    RDEBUG_2( "CApplicationManagementSession::CApplicationManagementSession 0x%x", this);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2097
    }
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2100
// CApplicationManagementSession::CApplicationManagementSession
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2101
// -------------------------------------------------------------------------------------------------------------------
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
inline CApplicationManagementSession::CApplicationManagementSession(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2104
        const TCertInfo &aInfo) :
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2105
    iCertInfo(aInfo)
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
    RDEBUG( "CApplicationManagementSession::CApplicationManagementSession (cert) " );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2108
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2109
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2110
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2111
// CApplicationManagementSession::Server()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2112
// -------------------------------------------------------------------------------------------------------------------
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
inline CApplicationManagementServer& CApplicationManagementSession::Server() const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2115
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2116
    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
  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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2120
// CApplicationManagementSession::CreateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2121
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2122
// 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
  2123
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2124
void CApplicationManagementSession::CreateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2125
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2126
    RDEBUG_2( "ApplicationManagementSession: CApplicationManagementSession::CreateL: 0x%x", this );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2127
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2128
    Server().AddSession();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2129
    CAknAppServiceBase::CreateL();
0
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
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
// CApplicationManagementSession::~CApplicationManagementSession()
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
CApplicationManagementSession::~CApplicationManagementSession()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2137
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2138
    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
  2139
            reinterpret_cast<TUint>(this)+sizeof( CApplicationManagementSession ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2140
    RDEBUG_2("CApplicationManagementSession::~CApplicationManagementSession iCertInfo offs 0x%X",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2141
            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
  2142
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2143
    Server().DropSession();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2144
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2145
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
// CApplicationManagementSession::ServiceL()
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
void CApplicationManagementSession::ServiceL(const RMessage2& aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2151
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2152
    if (aMessage.Function() == EPerformRfs)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2153
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2154
        TRAPD( err, Server().PerformRFSL() )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2155
        ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2156
        aMessage.Complete(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2157
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2158
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2159
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2160
        TBool handled(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2161
        TInt err(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2162
        TRAP( err, handled = PreDispatchMessageL( aMessage ) );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2163
        if ( !handled)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2164
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2165
            TRAP(err,DispatchMessageL(aMessage));
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2166
            }
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
        // 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
  2169
        // doing Complete() twice will cause panic
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2170
        if (aMessage.Handle() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2171
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2172
            aMessage.Complete(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2173
            }
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
    }
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
// CApplicationManagementSession::PreDispatchMessageL()
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
TBool CApplicationManagementSession::PreDispatchMessageL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2181
        const RMessage2 &aMessage)
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 ret(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2184
    // These succeed regardless of certificate....
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2185
    switch (aMessage.Function() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2186
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2187
        case EGetStateChangingIdsCountOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2188
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2189
            // 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
  2190
            StateChangeComponentIdsCountL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2191
            ret = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2192
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2193
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2194
        case EGetStateChangingIdsOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2195
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2196
            // 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
  2197
            StateChangeComponentIdsL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2198
            ret = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2199
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2200
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2201
        case ECompleteStateChangeOperation: // completes change of state
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2202
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2203
            StateChangeCompleteL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2204
            ret = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2205
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2206
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2207
        default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2208
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2209
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2210
            }
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
    return ret;
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2216
// CApplicationManagementSession::DispatchMessageL()
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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2219
void CApplicationManagementSession::DispatchMessageL(const RMessage2& aMessage)
0
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
    RDEBUG_2( "CApplicationManagementSession::DispatchMessageL; %d" ,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2222
            aMessage.Function() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2223
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2224
    TBool go(EFalse);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2225
    if (iTrustAdded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2226
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2227
        go = Server().CheckCertL(iCertInfo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2228
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2229
    else
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 = ETrue;
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2234
    if (go)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2235
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2236
        switch (aMessage.Function() )
0
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
            case EAddTrust:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2239
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2240
                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
  2241
                AddTrustL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2242
                break;
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
            case EDeplCompCountOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2245
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2246
                ComponentCountL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2247
                return;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2248
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2249
            case EDeplCompIdsOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2250
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2251
                ComponentIdsL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2252
                return;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2253
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2254
            case EDeplCompDeliverCompleteOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2255
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2256
                DeliverCompleteL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2257
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2258
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2259
            case EDeplCompGetOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2260
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2261
                GetComponentL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2262
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2263
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2264
            case EInstallOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2265
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2266
                InstallL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2267
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2268
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2269
            case EDeplCompAttrUpdateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2270
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2271
                UpdateL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2272
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2273
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2274
            case EDeplCompGetDataOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2275
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2276
                GetDataL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2277
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2278
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2279
            case EDeplCompGetDataLengthOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2280
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2281
                GetDataLengthL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2282
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2283
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2284
            case EDeplCompRemoveOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2285
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2286
                RemoveL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2287
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2288
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2289
            case EDeplCompDeliverStartOperation2:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2290
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2291
                Deliver2L(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2292
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2293
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2294
            case EDeplCompUpdateDataOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2295
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2296
                UpdateDataL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2297
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2298
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2299
            case EDeplCompUpdateStreamedDataOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2300
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2301
                UpdateStreamedDataL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2302
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2303
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2304
            case EDeplCompDownloadOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2305
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2306
                DownloadL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2307
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2308
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2309
            case EDeplCompUpdateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2310
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2311
                FullUpdateL(aMessage) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2312
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2313
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2314
            case EDeplCompGetUserIdOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2315
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2316
                GetUserIdL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2317
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2318
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2319
            case EDeplCompStartDownloadOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2320
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2321
                StartDownloadL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2322
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2323
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2324
            case EDeplCompDeactivateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2325
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2326
                DeactivateL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2327
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2328
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2329
            case EDeplCompActivateOperation:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2330
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2331
                ActivateL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2332
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2333
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2334
            case EDeplCompGetTemporaryInstFile:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2335
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2336
                GetTemporaryInstFileL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2337
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2338
                }
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
            case EDeplCompGetFinalResultForGA:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2341
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2342
                GetFinalResultForGAL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2343
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2344
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
            case EDeplCompGenericAlertSent:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2347
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2348
                GenericAlertSentForIdL(aMessage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2349
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2350
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2351
            case ECheckStatusNodes:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2352
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2353
                CheckStatusNodesValuesL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2354
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2355
                }
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
            default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2358
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2359
                User::Leave(KErrNotSupported);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2360
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2361
                }
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
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2364
    else
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
        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
  2367
        User::Leave(KErrAccessDenied);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2368
        }
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2371
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2372
// CApplicationManagementSession::GenericAlertSentForIdL()
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
void CApplicationManagementSession::GenericAlertSentForIdL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2376
        const RMessage2& aMessage) const
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
    TUint32 luid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2379
    TPckg<TUint32> pk(luid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2380
    TInt read(aMessage.Read(0, pk));
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
    Server().DeleteGenericAlertForIDL(luid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2383
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2384
    }
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2387
// CApplicationManagementSession::GetFinalResultForGAL()
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
void CApplicationManagementSession::GetFinalResultForGAL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2391
        const RMessage2& aMessage)
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
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 1" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2395
    TUint32 luid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2396
    TPckg<TUint32> pk(luid);
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
    TInt finalresult = KErrNone;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2399
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2400
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 2" );
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
    HBufC8 *targetURI = HBufC8::NewL(512);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2403
    TPtr8 ptr = targetURI->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2404
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2405
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 3" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2406
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2407
    TInt read(aMessage.Read(0, pk));
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 4" );
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
    Server().GetAMServerDownloadDBL(luid, finalresult, ptr);
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 5" );
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
    RDEBUG_2( "ApplicationManagementServer: GetFinalResultForGAL Count is %d", finalresult );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2416
    TPckg<TInt> p1(finalresult);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2417
    aMessage.WriteL(1, p1);
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( "CApplicationManagementSession: GetFinalResultForGAL Step 6" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2420
    aMessage.WriteL(2, ptr);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2421
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2422
    RDEBUG( "CApplicationManagementSession: GetFinalResultForGAL Step 7" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2423
    if (targetURI)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2424
        delete targetURI;
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
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2427
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2428
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2429
// CApplicationManagementSession::ComponentCountL()
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
void CApplicationManagementSession::ComponentCountL(const RMessage2& aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2433
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2434
    RDEBUG( "CApplicationManagementSession: ComponentCountL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2435
    TDeploymentComponentState st;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2436
    TPckg<TDeploymentComponentState> pk(st);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2437
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2438
    TInt read(aMessage.Read( 1, pk) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2439
    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
  2440
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2441
    const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2442
    RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2443
    CleanupClosePushL(arr);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2444
    if ((st == EDCSActive)||(st == EDCSInactive))
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2445
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2446
        ActiveComponentsL(arrt, arr,st);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2447
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2448
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2449
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2450
        TInt count(arrt.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2451
        for (TInt i( 0); i < count; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2452
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2453
            CDeploymentComponent &compo = Server().Storage()->ComponentL(arrt[i]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2454
            if (st == EDCSNone || compo.State() == st)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2455
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2456
                arr.Append(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2457
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2458
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2459
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2460
    TInt n(arr.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2461
    CleanupStack::PopAndDestroy( &arr);
0
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
    RDEBUG_2( "ApplicationManagementServer: ComponentCountL Count is %d", n );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2464
    TPckg<TInt> p(n);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2465
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2466
    aMessage.WriteL(0, p);
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
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2469
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
// CApplicationManagementSession::ActiveComponentsL()
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
void CApplicationManagementSession::ActiveComponentsL(
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2475
        const RComponentIdArray &aArrt, RComponentIdArray &aArr,TDeploymentComponentState &aState) const
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2476
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2477
    Swi::RSisRegistrySession sisses;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2478
    TInt r(sisses.Connect() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2479
    User::LeaveIfError(r) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2480
    CleanupClosePushL(sisses);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2481
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2482
    RArray<TUid> uids;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2483
    sisses.InstalledUidsL(uids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2484
    CleanupClosePushL(uids);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2485
    TInt cont(aArrt.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2486
    TInt uidc(uids.Count() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2487
    RArray<TUid> juids;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2488
    Server().JavaUidsL(juids);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2489
    CleanupClosePushL(juids);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2490
    TInt juidc(juids.Count() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2491
    RComponentIdArray rem;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2492
    CleanupClosePushL(rem);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2493
    for (TInt i( 0); i < cont; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2494
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2495
        CDeploymentComponent &compo = Server().Storage()->ComponentL(aArrt[i]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2496
        TDeploymentComponentState state = compo.State();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2497
        if (state == aState)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2498
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2499
            TBool add(EFalse);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2500
            const TUid &uid(compo.Uid() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2501
            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
  2502
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2503
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2504
                if (uids[j] == uid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2505
                    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2506
                   
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2507
                    RDEBUG( "CApplicationManagementSession::ActiveComponentsL Entered" );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2508
                    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2509
                    // Check if this registry entry is present
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2510
                    Swi::RSisRegistrySession sisSession;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2511
    								User::LeaveIfError(sisSession.Connect());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2512
    								CleanupClosePushL(sisSession);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2513
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2514
    								Swi::RSisRegistryEntry sisEntry;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2515
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2516
                    //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
  2517
                    User::LeaveIfError(sisEntry.Open(sisSession, compo.Uid()));
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2518
                    CleanupClosePushL(sisEntry);   
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2519
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2520
										add  = sisEntry.IsPresentL();	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2521
										
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2522
			  if(add)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2523
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2524
				
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2525
				// 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
  2526
                        // by some other means
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2527
				
2
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2528
                        TVersion version = sisEntry.VersionL();
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2529
                        TBuf8<KVersionLength> pkgDes;
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2530
                        pkgDes.AppendNum(version.iMajor);
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2531
                        pkgDes.Append(KLiteralPeriod);
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2532
                        pkgDes.AppendNum(version.iMinor);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2533
                        
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2534
				
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2535
				HBufC *packagename = sisEntry.PackageNameL();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2536
				TBuf8<512> packagename8;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2537
				packagename8.Copy(*packagename);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2538
				delete packagename;
2
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2539
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2540
                        compo.SetNameL(packagename8);
a5fecba4b1e4 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
  2541
                        compo.SetVersionL(pkgDes);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2542
				                        
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2543
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2544
                        Server().Storage()->UpdateL( compo );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2545
                        
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2546
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2547
				
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2548
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2549
				RDEBUG( "CApplicationManagementSession::ActiveComponentsL ETrue" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2550
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2551
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2552
			  }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2553
			  else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2554
			      RDEBUG( "CApplicationManagementSession::ActiveComponentsL EFalse" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2555
																	    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2556
	
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2557
                    CleanupStack::PopAndDestroy(2, &sisSession);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2558
                                   
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
                }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2561
            if ( !add) // go throug java suites
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2562
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2563
                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
  2564
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2565
                    if (juids[k] == uid)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2566
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2567
                        add = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2568
                        }
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
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2571
            if (add)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2572
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2573
                aArr.Append(aArrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2574
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2575
            else
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
                RDEBUG8_3( "ApplicationManagementServer: ActiveComponentCountL skipping 0x%x, %S",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2578
                        compo.Uid() ,&compo.ComponentId() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2579
                rem.Append(aArrt[i]);
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
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2582
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2583
    TInt rc(rem.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2584
    for (TInt t( 0); t < rc; t++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2585
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2586
        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
  2587
        CDeploymentComponent &compo = Server().Storage()->ComponentL(rem[t]);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2588
        if(!compo.AppRemovable())
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2589
        Server().RemoveInternalL(compo, EFalse);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2590
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2591
    CleanupStack::PopAndDestroy( &rem);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2592
    CleanupStack::PopAndDestroy( &juids);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2593
    CleanupStack::PopAndDestroy( &uids);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2594
    CleanupStack::PopAndDestroy( &sisses);
0
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
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
// CApplicationManagementSession::ComponentIdsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2599
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2600
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2601
void CApplicationManagementSession::ComponentIdsL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2602
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2603
    RDEBUG( "CApplicationManagementSession: ComponentIdsL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2604
    TDeploymentComponentState st;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2605
    TPckg<TDeploymentComponentState> pk(st);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2606
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2607
    TInt read(aMessage.Read( 1, pk) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2608
    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
  2609
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2610
    const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2611
    TInt buflen( 0);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2612
    TUint32* buf= NULL;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2613
    if (st == EDCSNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2614
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2615
        buflen = arrt.Count() ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2616
        buf = new ( ELeave ) TUint32[buflen];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2617
        CleanupArrayDeletePushL(buf);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2618
        for (TInt i( 0); i < buflen; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2619
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2620
            RDEBUG_2("ApplicationManagementSession: ComponentIdsL Adding %d!!", arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2621
            buf[i] = arrt[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2622
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2623
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2624
    else
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
        RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2627
        if (st == EDCSActive)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2628
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2629
            ActiveComponentsL(arrt, arr,st);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2630
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2631
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2632
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2633
            TInt artc(arrt.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2634
            for (TInt i( 0); i < artc; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2635
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2636
                CDeploymentComponent &compo = Server().Storage()->ComponentL(arrt[i]);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2637
                if (compo.State() == st)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2638
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2639
                    arr.Append(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2640
                    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2641
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2642
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2643
        buflen = arr.Count() ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2644
        buf = new ( ELeave ) TUint32[buflen];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2645
        CleanupArrayDeletePushL(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2646
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2647
        TUint32 len(aMessage.GetDesMaxLength( 0) / 4);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2648
        if (buflen == len)
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( "CApplicationManagementSession: ComponentIdsL Right count!!" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2651
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2652
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2653
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2654
            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
  2655
            if (len < buflen)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2656
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2657
                buflen = len;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2658
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2659
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2660
        for (TInt i( 0); i < buflen; i++)
0
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
            RDEBUG_2( "CApplicationManagementSession: ComponentIdsL Adding %d!!",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2663
                    arr[i] );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2664
            buf[i] = arr[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2665
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2666
        arr.Close();
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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2669
    TPtrC8 p( ( TUint8* ) buf, buflen * sizeof(TUint32));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2670
    aMessage.WriteL( 0, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2671
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2672
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2673
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2674
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2675
#ifdef _DEBUG
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2676
HBufC* Des8to16LC(const TDesC8 &aDes)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2677
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2678
    HBufC *b = HBufC::NewLC(aDes.Length() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2679
    TPtr p(b->Des() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2680
    p.Copy(aDes);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2681
    return b;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2682
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2683
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2684
HBufC* ToStringLC(TDeploymentComponent &aComp)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2685
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2686
    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
  2687
            + aComp.iVersion.Length() + 10 + 50);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2688
    TPtr p(b->Des() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2689
    _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
  2690
    p.Format(KFormat, &*Des8to16LC(aComp.iId), &*Des8to16LC(aComp.iName),
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2691
            &*Des8to16LC(aComp.iVersion), aComp.iState, aComp.iOldState) ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2692
    CleanupStack::PopAndDestroy( 3);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2693
    return b;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2694
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2695
#endif
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2698
// CApplicationManagementSession::Deliver2L()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2699
// -------------------------------------------------------------------------------------------------------------------
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
void CApplicationManagementSession::Deliver2L(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2702
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2703
    RDEBUG( "ApplicationManagementSession: Deliver2L" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2704
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2705
    TDeploymentComponentIPC comp;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2706
    TPckg< TDeploymentComponentIPC> pcomp(comp);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2707
    TInt read2(aMessage.Read( 0, pcomp) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2708
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2709
    HBufC8 *data = HBufC8::NewLC(aMessage.GetDesLength( 1) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2710
    TPtr8 pbuf(data->Des());
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2711
    TInt read(aMessage.Read( 1, pbuf) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2712
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2713
    CDeploymentComponent *compo= NULL;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2714
    if (iTrustAdded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2715
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2716
        compo = Server().Storage()->NewComponentL(EDCSDelivered, comp.iUserId, &iCertInfo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2717
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2718
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2719
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2720
        compo = Server().Storage()->NewComponentL(EDCSDelivered, comp.iUserId);
0
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2723
    compo->Set(comp.iComponent);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2724
    compo->Data().SetDataL(pbuf, comp.iMimeType);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2725
    Server().Storage()->UpdateL( *compo);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2726
    compo->CopyStateTo(comp.iComponent);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2727
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2728
#ifdef _DEBUG
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2729
    RDEBUG_2( "Deliver2L: TDeploymentComponent is '%S'",
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2730
            ToStringLC( comp.iComponent ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2731
    CleanupStack::PopAndDestroy();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2732
#endif
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2733
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2734
    TPckg< TDeploymentComponent> pcomp2(comp.iComponent);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2735
    aMessage.Write( 0, pcomp2);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2736
    CleanupStack::PopAndDestroy(data) ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2737
    TInt n(compo->InternalId() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2738
    TPckg<TUint32> p(n);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2739
    aMessage.WriteL( 2, p);
0
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2743
// CApplicationManagementSession::DeliverCompleteL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2744
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2745
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2746
void CApplicationManagementSession::DeliverCompleteL(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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2757
    HBufC8 *opts = HBufC8::NewLC(aMessage.GetDesLength( 1) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2758
    TPtr8 popts(opts->Des() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2759
    TInt read1(aMessage.Read( 1, popts) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2760
    compo.SetInstallOptsL( *opts);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2761
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2762
    HBufC8 *meta = HBufC8::NewLC(aMessage.GetDesLength( 2) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2763
    TPtr8 pmeta(meta->Des() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2764
    TInt read2(aMessage.Read( 2, pmeta) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2765
    compo.SetMetaDataL( *meta, KNullDesC8);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2766
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2767
    CleanupStack::PopAndDestroy(meta) ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2789
    TPckg< TDeploymentComponent> pcomp(comp);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2809
    compo.SetDownloadTarget(target() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
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);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2827
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2828
   
0
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
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
// CApplicationManagementSession::ActivateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2833
// -------------------------------------------------------------------------------------------------------------------
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
void CApplicationManagementSession::ActivateL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2836
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2837
    RDEBUG( "ApplicationManagementSession: ActivateL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2838
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2839
    TPckg<TUint32> pid(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2840
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2841
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2842
    RDEBUG_2( "ApplicationManagementSession: ActivateL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2843
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2844
    Server().Storage()->ActivateL(compo);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2845
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2846
    
0
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2850
// CApplicationManagementSession::GetUserIdL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2851
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2852
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2853
void CApplicationManagementSession::GetUserIdL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2854
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2855
    RDEBUG( "ApplicationManagementSession: GetUserIdL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2856
    TUint32 id = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2857
    TPckg<TUint32> pid(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2858
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2859
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2860
    RDEBUG_2( "ApplicationManagementSession: GetUserIdL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2861
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2862
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2863
    aMessage.Write( 1, compo.UserId() );
0
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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2866
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2867
0
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
// CApplicationManagementSession::GetTemporaryInstFileL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2870
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2871
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2872
void CApplicationManagementSession::GetTemporaryInstFileL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2873
        const RMessage2& aMessage) const
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
    // TIpcArgs( &id, &itemid, &filehandle )
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2876
    RDEBUG( "ApplicationManagementSession: GetTemporaryInstFileL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2877
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2878
    TPckg<TUint32> pid(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2879
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2880
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2881
    TDeplCompAttrType item;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2882
    TPckg<TDeplCompAttrType> itemid(item);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2883
    read = aMessage.Read( 1, itemid);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2884
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2885
    RDEBUG_2( "ApplicationManagementSession: GetTemporaryInstFileL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2886
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2887
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2888
    TFileName fileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2889
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2890
    if (item == EDCData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2891
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2892
        fileName.Copy(compo.Data().DataFileName() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2893
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2894
    else
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2895
        if (item == EDCMetaData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2896
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2897
            fileName.Copy(compo.MetaData().DataFileName() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2898
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2899
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2900
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2901
            RDEBUG_2( "ApplicationManagementSession: GetTemporaryInstFileL: Not supported type: (%d)", item);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2902
            User::Leave(KErrNotSupported);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2903
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2904
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2905
    RDEBUG_2( "ApplicationManagementSession: GetTemporaryInstFileL: (%S)", &fileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2906
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2907
    RFs fs;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2908
    User::LeaveIfError(fs.Connect() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2909
    User::LeaveIfError(fs.ShareProtected() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2910
    CleanupClosePushL(fs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2911
    RFile file;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2912
    User::LeaveIfError(file.Open(fs, fileName, EFileWrite) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2913
    CleanupClosePushL(file);
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
    // Takes care of completing with session (RFs), 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2916
    // SendReceieve returns session handle at client side
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2917
    User::LeaveIfError(file.TransferToClient(aMessage, 2) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2918
    CleanupStack::PopAndDestroy(2, &fs); // fs , file	
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2919
    }
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
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2922
// CApplicationManagementSession::PackageSizeL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2923
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2924
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2925
TInt CApplicationManagementSession::PackageSizeL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2926
        Swi::RSisRegistrySession& aSession, Swi::RSisRegistryEntry& aEntry)
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
    RPointerArray<Swi::CSisRegistryPackage> listPackages;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2929
    TInt size(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2930
    TInt err(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2931
    CleanupClosePushL(listPackages);
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
    aEntry.AugmentationsL(listPackages);
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
    for (TInt index(0); index < listPackages.Count(); index++)
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
        TRAP(err, AugmentationSizeL( aSession, *listPackages[index]))
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2938
        if (err != KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2939
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2940
            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2941
            }
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2944
    if (err != KErrNone)
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
        size = 0;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2947
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2948
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2949
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2950
        TRAP(err, size += aEntry.SizeL() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2951
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2952
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2953
    listPackages.ResetAndDestroy();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2954
    CleanupStack::PopAndDestroy( &listPackages);
0
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
    if (err != KErrNone)
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
        //We leave if there was an error, 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2959
        // 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
  2960
        User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2961
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2962
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2963
    return size;
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2966
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2967
// CAppMngrSisxInfo::AugmentationSizeL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2968
// Returns the Size of the package
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2969
// (other items were commented in a header).
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2970
// ------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2971
//  
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2972
TInt CApplicationManagementSession::AugmentationSizeL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2973
        Swi::RSisRegistrySession& aSession,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2974
        const Swi::CSisRegistryPackage& aPackage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2975
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2976
    TInt size(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2977
    Swi::RSisRegistryEntry regEntry;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2978
    CleanupClosePushL(regEntry);
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
    regEntry.OpenL(aSession, aPackage);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2981
    size += PackageSizeL(aSession, regEntry);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2982
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2983
    CleanupStack::PopAndDestroy( &regEntry);
0
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
    return size;
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2988
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2989
// CApplicationManagementSession::LookupSisRegistryL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2990
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2991
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2992
void CApplicationManagementSession::LookupSisRegistryL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2993
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2994
    Swi::RSisRegistrySession sisses;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2995
    TInt r(sisses.Connect() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2996
    RPointerArray<Swi::CSisRegistryPackage> pkgs(12);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2997
    sisses.InstalledPackagesL(pkgs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2998
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2999
    TInt count(pkgs.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3000
    for (TInt i( 0); i < count; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3001
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3002
        Swi::CSisRegistryPackage* p = pkgs[i];
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
        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
  3005
                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
  3006
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3007
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3008
    sisses.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3009
    pkgs.ResetAndDestroy();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3010
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3013
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3014
// CApplicationManagementSession::InstallL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3015
// -------------------------------------------------------------------------------------------------------------------
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
void CApplicationManagementSession::InstallL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3018
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3019
    RDEBUG( "ApplicationManagementSession: InstallL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3020
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3021
    TPckg<TUint32> pid(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3022
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3023
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3024
    TDeploymentComponentState targetst;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3025
    TPckg<TDeploymentComponentState> pk(targetst);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3026
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3027
    read = aMessage.Read( 1, pk) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3028
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3029
    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
  3030
            id, targetst );
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
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3033
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3034
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3035
        TInt err(KErrNone);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3036
	  		TRAP(err, Server().DoTheInstallL(compo)) ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3037
        TBuf8<256> targetURI;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3038
        TDeploymentComponentState state = compo.State();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3039
        if( state == EDCSDelivered)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3040
        	{
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3041
        			targetURI.Append(KDeliveredState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3042
              targetURI.Append(compo.UserId());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3043
          }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3044
          else if (state == EDCSActive|| state == EDCSInactive)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3045
          {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3046
          		targetURI.Append(KDeployedState);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3047
              targetURI.Append(compo.UserId());  
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3048
        	} 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3049
        	
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3050
        	//Set Targeturi to cenrep
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3051
        	CRepository* cenrep = NULL;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3052
	  			TRAP(err, cenrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys ));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3053
	  			if(err == KErrNone)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3054
	  			{		  				
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3055
    				err = cenrep->Set( KNSmlDMSCOMOTargetRef, targetURI );    				
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3056
    				delete cenrep;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3057
    				cenrep = NULL;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3058
    			} 
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3059
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3060
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3061
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3062
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3063
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3064
    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
  3065
    }
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
// CApplicationManagementSession::UpdateDataL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3071
void CApplicationManagementSession::UpdateDataL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3072
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3073
    RDEBUG( "ApplicationManagementSession: UpdateDataL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3074
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3075
    TDeplCompDataIPC ipc;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3076
    TPckg<TDeplCompDataIPC> pipc(ipc);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3077
    TInt read(aMessage.Read( 0, pipc) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3078
    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
  3079
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3080
    HBufC8 *buf = HBufC8::NewLC(aMessage.GetDesLength( 1) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3081
    TPtr8 pbuf(buf->Des() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3082
    TInt read2(aMessage.Read( 1, pbuf) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3083
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3084
    CDeploymentComponent &compo = Server().Storage()->ComponentL(ipc.iInternalId);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3085
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3086
    if (Server().CheckB64Encode(pbuf) )
0
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 data is base64 encoded");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3089
        // b64 encoded data, decode it 
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3090
        HBufC8* tmp;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3091
        tmp = Server().DecodeB64DataLC(pbuf);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3092
        pbuf.Copy( *tmp);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3093
        pbuf = buf->Des();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3094
        CleanupStack::PopAndDestroy(tmp);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3095
        }
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
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3098
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3099
        if (ipc.iAttrType == EDCData)
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
            compo.SetDataL(pbuf, ipc.iDataMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3102
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3103
        else
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3104
            if (ipc.iAttrType == EDCMetaData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3105
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3106
                compo.SetMetaDataL(pbuf, ipc.iDataMime);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3107
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3108
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3109
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3110
                RDEBUG_2( "ApplicationManagementSession::UpdateDataL -  ERROR UpdateDataL called for illegal item: %d!", ipc.iAttrType );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3111
                User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3112
                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3113
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3114
        Server().Storage()->UpdateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3115
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3116
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3117
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3118
        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
  3119
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3120
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3121
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3122
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3123
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3124
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3125
// CApplicationManagementSession::UpdateStreamedDataL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3128
void CApplicationManagementSession::UpdateStreamedDataL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3129
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3130
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3131
    RDEBUG( "ApplicationManagementSession: UpdateStreamedDataL() Start");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3132
    TDeplCompDataIPC ipc;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3133
    TPckg<TDeplCompDataIPC> pipc(ipc);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3134
    TInt read(aMessage.Read( 0, pipc) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3135
    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
  3136
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3137
    CDeploymentComponent &compo = Server().Storage()->ComponentL(ipc.iInternalId);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3138
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3139
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3140
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3141
        RFs fs;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3142
        User::LeaveIfError(fs.Connect() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3143
        CleanupClosePushL(fs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3144
        RFile file;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3145
        TFileName dataFileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3146
        TInt length(0);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3147
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3148
        if (ipc.iAttrType == EDCData)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3149
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3150
            dataFileName.Copy(compo.Data().DataFileName() ) ;
0
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
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3153
            if (ipc.iAttrType == EDCMetaData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3154
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3155
                dataFileName.Copy(compo.MetaData().DataFileName() ) ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3156
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3157
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3158
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3159
                RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL -  ERROR called for illegal item: %d!", ipc.iAttrType );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3160
                User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3161
                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3162
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3163
        RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL(): using dataFile: (%S)", &dataFileName );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3164
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3165
        // EFileWrite So we can delete the original decoded data file
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3166
        User::LeaveIfError(file.Open(fs, dataFileName, EFileWrite) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3167
        CleanupClosePushL(file) ;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3168
        if (Server().IsDataFileB64EncodedL(file, length) )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3169
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3170
            RDEBUG( "CApplicationManagementServer::UpdateStreamedDataL(): data is decoded" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3171
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3172
            TFileName tempFileName;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3173
            TBuf<30> privatePath;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3174
            fs.PrivatePath(privatePath);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3175
            RFile tempFile;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3176
            TInt err(KErrNone);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3177
            err = tempFile.Temp(fs, privatePath, tempFileName, EFileWrite);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3178
            if (err == KErrNone)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3179
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3180
                RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL(): created tempFile: (%S)", &tempFileName );
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
            else
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
                User::Leave(err);
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
            CleanupClosePushL(tempFile);
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
            TRAP( err, Server().DecodeB64DataFileL( file, tempFile ) );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3189
            if (err != KErrNone)
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
                RDEBUG_2( "ApplicationManagementSession::UpdateStreamedDataL -  failed to decode datafile: %d", err );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3192
                CleanupStack::PopAndDestroy( 2, &file);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3193
                compo.ResetDataL(fs); // Remove both files if exists
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3194
                User::Leave(err);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3195
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3196
            else
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
                // close both files, delete decode file and rename temp file to correct one
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3199
                CleanupStack::PopAndDestroy( 2, &file);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3200
                fs.Delete(dataFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3201
                err = fs.Rename(tempFileName, dataFileName);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3202
                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
  3203
                }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3204
            CleanupStack::PopAndDestroy( &fs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3205
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3206
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3207
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3208
            RDEBUG( "ApplicationManagementSession::UpdateStreamedDataL(): data is NOT decoded" );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3209
            CleanupStack::PopAndDestroy( 2, &fs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3210
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3211
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3212
        if (ipc.iAttrType == EDCData)
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
            compo.SetDataL(ipc.iDataMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3215
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3216
        else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3217
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3218
            compo.SetMetaDataL(ipc.iDataMime);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3219
            }
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
        Server().Storage()->UpdateL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3222
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3223
    else
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
        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
  3226
        User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3227
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3228
    RDEBUG( "ApplicationManagementSession: UpdateStreamedDataL() End");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3229
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3230
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
// CApplicationManagementSession::UpdateL()
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3235
void CApplicationManagementSession::UpdateL(const RMessage2& aMessage) const
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
    RDEBUG( "ApplicationManagementSession: UpdateL" );
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
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3240
    TPckg<TUint32> pid(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3241
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3242
    RDEBUG_2("ApplicationManagementSession: UpdateL id is %d", id );
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
    TDeplCompAttrType item;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3245
    TPckg<TDeplCompAttrType> itemid(item);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3246
    TInt read1(aMessage.Read( 1, itemid) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3247
    HBufC8 *buf = HBufC8::NewLC(aMessage.GetDesLength( 2) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3248
    TPtr8 pbuf(buf->Des() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3249
    TInt read2(aMessage.Read( 2, pbuf) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3250
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3251
    CDeploymentComponent &c = Server().Storage()->ComponentL(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3252
    TDeploymentComponentState st(c.State() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3253
    if (st == EDCSDelivered || st == EDCSDownload)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3254
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3255
        switch (item)
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 EDCId:
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.SetIdL(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 EDCName:
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.SetNameL(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
            case EDCVersion:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3268
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3269
                c.SetVersionL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3270
                break;
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
            case EDCDescriptionRef:
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
                c.SetDescriptionL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3275
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3276
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3277
            case EDCInstallOptions:
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
                c.SetInstallOptsL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3280
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3281
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3282
            case EDCMetaData:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3283
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3284
                c.SetMetaDataL(pbuf, KNullDesC8);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3285
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3286
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3287
            case EDCPkgID:
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
                c.SetPkgIDL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3290
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3291
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3292
            case EDCPkgType:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3293
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3294
                c.SetPkgTypeL(pbuf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3295
                break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3296
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3297
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3298
            default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3299
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3300
                if (st == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3301
                    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3302
                    switch (item)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3303
                        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3304
                        case EDCData:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3305
                            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3306
                            c.SetDataL(pbuf, KNullDesC8);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3307
                            if (c.State() == EDCSDownload)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3308
                                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3309
                                //	Server().StartDownload( *compo );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3310
                                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3311
                            break;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3312
                            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3313
                        default:
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3314
                            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3315
                            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
  3316
                            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3317
                            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3318
                        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3319
                    }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3320
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3321
                    if (st == EDCSDownload)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3322
                        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3323
                        switch (item)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3324
                            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3325
                            case EDCId:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3326
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3327
                                c.SetIdL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3328
                                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3329
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3330
                            case EDCName:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3331
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3332
                                c.SetNameL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3333
                                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3334
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3335
                            case EDCVersion:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3336
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3337
                                c.SetVersionL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3338
                                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3339
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3340
                            case EDCDownloadURI:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3341
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3342
                                c.SetDownloadURIL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3343
                                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3344
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3345
                            case EDCConRef:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3346
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3347
                                TPckgBuf<TInt> aInt;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3348
                                aInt.Copy(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3349
                                c.SetIAPL(aInt() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3350
                                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3351
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3352
                            default:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3353
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3354
                                RDEBUG_2( "ApplicationManagementSession: ERROR UpdateL called for illegal item type!!!! %d", item );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3355
                                User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3356
                                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3357
                                }
0
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
                break;
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
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3363
        Server().Storage()->UpdateL(c);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3364
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3365
    else
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3366
        if (st == EDCSActive ||st == EDCSInactive)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3367
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3368
            switch (item)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3369
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3370
                case EDCName:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3371
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3372
                    c.SetNameL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3373
                    break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3374
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3375
                case EDCVersion:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3376
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3377
                    c.SetVersionL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3378
                    break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3379
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3380
                case EDCDescriptionRef:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3381
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3382
                c.SetDescriptionL(pbuf);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3383
                break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3384
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3385
                default:
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3386
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3387
                    RDEBUG_2( "ApplicationManagementSession: ERROR UpdateL called for illegal item type!!!! %d", item );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3388
                    User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3389
                    break;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3390
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3391
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3392
            Server().Storage()->UpdateL(c);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3393
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3394
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3395
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3396
            RDEBUG( "ApplicationManagementSession: ERROR UpdateL called for illegal state message!" );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3397
            User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3398
            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3399
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3400
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3401
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3402
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3403
// CApplicationManagementSession::GetDataLengthL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3404
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3405
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3406
void CApplicationManagementSession::GetDataLengthL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3407
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3408
    RDEBUG( "ApplicationManagementSession: GetDataLengthL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3409
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3410
    TPckg<TUint32> pid(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3411
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3412
    TInt read(aMessage.Read( 0, pid) );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3413
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3414
    TInt length( 0);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3415
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3416
    TDeplCompAttrType dt;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3417
    TPckg< TDeplCompAttrType> pdt(dt);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3418
    read = aMessage.Read( 1, pdt) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3419
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3420
    if (compo.State() == EDCSDelivered)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3421
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3422
        if (dt == EDCInstallOptions)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3423
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3424
            if (compo.InstallOptsSet() )
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3425
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3426
                length = sizeof(TAMInstallOptions);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3427
                }
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
        else
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3430
            if (dt == EDCData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3431
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3432
                length = compo.Data().DataLengthL();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3433
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3434
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3435
                if (dt == EDCDataMime)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3436
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3437
                    length = compo.Data().MimeType().Length();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3438
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3439
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3440
                    if (dt == EDCMetaData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3441
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3442
                        length = compo.MetaData().DataLengthL();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3443
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3444
                    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3445
                        if (dt == EDCMetaDataMime)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3446
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3447
                            length = compo.MetaData().MimeType().Length();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3448
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3449
                        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3450
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3451
                            RDEBUG_2( "ApplicationManagementSession: GetDataLengthL ERROR called with illegal type %d", dt );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3452
                            User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3453
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3454
        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3455
    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3456
        if (compo.State() == EDCSDownload)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3457
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3458
            if (dt == EDCDownloadURI)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3459
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3460
                length = compo.DownloadURI().Length();
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3461
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3462
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3463
                if (dt == EDCInstallOptions)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3464
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3465
                    if (compo.InstallOptsSet() )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3466
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3467
                        length = sizeof(TAMInstallOptions);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3468
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3469
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3470
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3471
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3472
                    RDEBUG_2( "ApplicationManagementSession: GetDataLengthL ERROR Download / called with illegal state component id %d",
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3473
                            compo.State() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3474
                    User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3475
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3476
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3477
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3478
            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3479
            RDEBUG_2( "ApplicationManagementSession: GetDataLengthL ERROR called with illegal state component id %d",
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3480
                    compo.State() );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3481
            User::Leave(KErrArgument);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3482
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3483
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3484
    TPckg< TInt> pcomp(length);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3485
    aMessage.Write( 2, pcomp);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3486
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3487
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3488
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3489
// CApplicationManagementSession::GetDataL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3490
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3491
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3492
void CApplicationManagementSession::GetDataL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3493
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3494
    RDEBUG( "ApplicationManagementSession: GetDataL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3495
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3496
    TPckg<TUint32> pid(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3497
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3498
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3499
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3500
    TDeplCompAttrType dt;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3501
    TPckg< TDeplCompAttrType> pdt(dt);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3502
    read = aMessage.Read( 1, pdt) ;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3503
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3504
    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
  3505
    CDeploymentComponent &compo = Server().Storage()->ComponentL(id);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3506
    if (dt == EDCStatus)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3507
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3508
        TPckg<TInt> p(compo.Status() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3509
        aMessage.Write( 2, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3510
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3511
    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3512
        if (compo.State() == EDCSDelivered)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3513
            {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3514
            if (dt == EDCInstallOptions)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3515
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3516
                if (compo.InstallOptsSet() )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3517
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3518
                    TAMInstallOptionsPckgBuf pckg(compo.InstallOpts() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3519
                    aMessage.Write( 2, pckg);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3520
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3521
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3522
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3523
                    aMessage.Write( 2, KNullDesC8);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3524
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3525
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3526
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3527
                if (dt == EDCData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3528
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3529
                    aMessage.Write( 2, compo.Data().Data() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3530
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3531
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3532
                    if (dt == EDCDataMime)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3533
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3534
                        aMessage.Write( 2, compo.Data().MimeType() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3535
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3536
                    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3537
                        if (dt == EDCMetaData)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3538
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3539
                            aMessage.Write( 2, compo.MetaData().Data() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3540
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3541
                        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3542
                            if (dt == EDCMetaDataMime)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3543
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3544
                                aMessage.Write( 2, compo.MetaData().MimeType() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3545
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3546
                            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3547
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3548
                                RDEBUG_2( "ApplicationManagementSession: GetDataL ERROR called with illegal type %d", dt );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3549
                                User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3550
                                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3551
            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3552
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3553
            if (compo.State() == EDCSDownload)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3554
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3555
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3556
                if (dt == EDCDownloadURI)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3557
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3558
                    aMessage.Write( 2, compo.DownloadURI() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3559
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3560
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3561
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3562
                    if (dt == EDCInstallOptions)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3563
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3564
                        if (compo.InstallOptsSet() )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3565
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3566
                            TAMInstallOptionsPckgBuf
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3567
                                    pckg(compo.InstallOpts() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3568
                            aMessage.Write( 2, pckg);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3569
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3570
                        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3571
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3572
                            aMessage.Write( 2, KNullDesC8);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3573
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3574
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3575
                    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3576
                        if (dt == EDCConRef)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3577
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3578
                            TPckg<TInt> p(compo.GetIAP() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3579
                            aMessage.Write( 2, p);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3580
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3581
                        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3582
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3583
                            RDEBUG_2( "ApplicationManagementSession:GetDataL ERROR called with illegal type %d", dt );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3584
                            User::Leave(KErrArgument);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3585
                            }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3586
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3587
            else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3588
                {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3589
                RDEBUG_2("ApplicationManagementSession: GetDataL ERROR called with illegal state component id %d", compo.State() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3590
                User::Leave(KErrArgument);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3591
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3592
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3593
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3594
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3595
// CApplicationManagementSession::RemoveL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3596
// -------------------------------------------------------------------------------------------------------------------
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
void CApplicationManagementSession::RemoveL(const RMessage2& aMessage) const
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
    RDEBUG( "ApplicationManagementSession: RemoveL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3601
    TUint32 id;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3602
    TPckg<TUint32> pid(id);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3603
    TInt read(aMessage.Read( 0, pid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3604
    RDEBUG_2( "ApplicationManagementSession: RemoveL id is %d", id );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3605
    RemoveInternalL(id);
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
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
// CApplicationManagementSession::RemoveInternalL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3610
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3611
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3612
void CApplicationManagementSession::RemoveInternalL(const TUint32 &aId) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3613
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3614
    CDeploymentComponent &compo = Server().Storage()->ComponentL(aId);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3615
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3616
    Server().RemoveInternalL(compo);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3617
    }
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
// CApplicationManagementSession::DownloadL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3621
// -------------------------------------------------------------------------------------------------------------------
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
void CApplicationManagementSession::DownloadL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3624
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3625
    RDEBUG( "ApplicationManagementSession: DownloadL" );
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
    TDCUserId userId;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3628
    aMessage.ReadL( 1, userId);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3629
    CDeploymentComponent *compo= NULL;
0
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
    if (iTrustAdded)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3632
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3633
        compo = Server().Storage()->NewComponentL(EDCSDownload, userId, &iCertInfo);
0
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
    else
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
        compo = Server().Storage()->NewComponentL(EDCSDownload, userId);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3638
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3639
    TUint32 i(compo->InternalId() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3640
    TPckg<TUint32> p(i);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3641
    aMessage.WriteL(0, p);
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
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
// CApplicationManagementSession::FullUpdateL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3646
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3647
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3648
void CApplicationManagementSession::FullUpdateL(const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3649
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3650
    RDEBUG( "ApplicationManagementSession: FullUpdateL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3651
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3652
    TUint32 sid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3653
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3654
    TPckg<TUint32> psid(sid);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3655
    TInt read(aMessage.Read( 0, psid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3656
    TUint32 tid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3657
    TPckg<TUint32> ptid(tid);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3658
    TInt read2(aMessage.Read( 1, ptid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3659
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3660
    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
  3661
    CApplicationManagementServer &server = Server();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3662
    server.FullUpdateL(sid, tid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3663
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3664
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
// CApplicationManagementSession::ServiceError()
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
void CApplicationManagementSession::ServiceError(const RMessage2& aMessage,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3670
        TInt aError)
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
    RDEBUG_2( "ApplicationManagementSession: CApplicationManagementSession::ServiceError %d", aError);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3673
    CSession2::ServiceError(aMessage, aError);
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
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3676
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3677
// CApplicationManagementSession::AddTrustL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3678
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3679
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3680
void CApplicationManagementSession::AddTrustL(const RMessage2 &aMessage)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3681
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3682
    TPckg<TCertInfo> pkg(iCertInfo);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3683
    aMessage.ReadL( 0, pkg);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3684
    iTrustAdded = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3685
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3686
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3687
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3688
// CApplicationManagementSession::StateChangeComponentIdsL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3689
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3690
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3691
void CApplicationManagementSession::StateChangeComponentIdsL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3692
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3693
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3694
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3695
    RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3696
    Server().Storage()->GetStateChangeComponentIdsL(arr);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3697
    TInt buflen(arr.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3698
    TUint32* buf = new ( ELeave ) TUint32[buflen];
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3699
    CleanupArrayDeletePushL(buf);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3700
    for (TInt i( 0); i < buflen; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3701
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3702
        RDEBUG_2( "ApplicationManagementSession:ComponentIdsL Adding %d!!", arr[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3703
        buf[i] = arr[i];
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3704
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3705
    TPtrC8 p( ( TUint8* ) buf, buflen * sizeof(TUint32));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3706
    aMessage.WriteL( 0, p);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3707
    arr.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3708
    CleanupStack::PopAndDestroy(buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3709
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsL end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3710
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3711
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3712
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3713
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3714
// CApplicationManagementSession::StateChangeComponentIdsCountL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3715
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3716
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3717
void CApplicationManagementSession::StateChangeComponentIdsCountL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3718
        const RMessage2& aMessage) const
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3719
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3720
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsCountL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3721
    RComponentIdArray arr;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3722
    Server().Storage()->GetStateChangeComponentIdsL(arr);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3723
    TPckgBuf<TInt> buflen(arr.Count() );
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3724
    aMessage.WriteL( 0, buflen);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3725
    arr.Close();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3726
    RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsCountL end" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3727
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3728
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3729
// -------------------------------------------------------------------------------------------------------------------
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3730
// CApplicationManagementSession::StateChangeCompleteL()
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
void CApplicationManagementSession::StateChangeCompleteL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3734
        const RMessage2& aMessage) const
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
    RDEBUG( "CApplicationManagementSession: StateChangeCompleteL" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3737
    TUint32 tid;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3738
    TPckg<TUint32> ptid(tid);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3739
    TInt read2(aMessage.Read( 0, ptid) );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3740
    Server().Storage()->StateChangedL(tid);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3741
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3742
void CApplicationManagementSession::CheckStatusNodesValuesL()
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3743
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3744
    const RComponentIdArray &arrt = Server().Storage()->GetComponentIds();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3745
    TInt cont(arrt.Count() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3746
    TBool isUpdateRequired = ETrue;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3747
    for (TInt i( 0); i < cont; i++)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3748
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3749
        CDeploymentComponent &compo = Server().Storage()->ComponentL(arrt[i]);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3750
        isUpdateRequired = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3751
        if (compo.Status() == EDownload_DownloadProgress)
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
            compo.SetStatusNode(EDownload_DownloadFailed);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3754
            isUpdateRequired = ETrue;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3755
            }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3756
        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3757
            if (compo.Status() == EDelivered_InstallProgress)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3758
                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3759
                compo.SetStatusNode(EDelivered_InstalledFailedWithData);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3760
                isUpdateRequired = ETrue;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3761
                }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3762
            else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3763
                if (compo.Status() == EDelivered_RemoveProgress)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3764
                    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3765
                    compo.SetStatusNode(EDelivered_RemoveFailed);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3766
                    isUpdateRequired = ETrue;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3767
                    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3768
                else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3769
                    if (compo.Status() == EDeployed_RemoveProgress)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3770
                        {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3771
                        compo.SetStatusNode(EDeployed_RemoveFailed);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3772
                        isUpdateRequired = ETrue;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3773
                        }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3774
                    else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3775
                        if (compo.Status() == EDeployed_ActivateProgress)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3776
                            {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3777
                            compo.SetStatusNode(EDeployed_ActivateFailed);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3778
                            isUpdateRequired = ETrue;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3779
                            }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3780
                        else
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3781
                            if (compo.Status()
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3782
                                    == EDeployed_DeactivateProgress)
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3783
                                {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3784
                                compo.SetStatusNode(EDeployed_DeactivateFailed);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3785
                                isUpdateRequired = ETrue;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3786
                                }
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3787
        if (isUpdateRequired)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3788
            Server().Storage()->UpdateL(compo);
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
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3792
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3793
void CApplicationManagementServer::SetSisAppVersionAndDriveL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3794
        CDeploymentComponent &aCompo)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3795
    {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3796
    RDEBUG( "CApplicationManagementSession: SetSisAppVersionAndDriveL: Begin" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3797
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3798
        Swi::RSisRegistrySession sisSession;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3799
        User::LeaveIfError(sisSession.Connect());
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3800
        CleanupClosePushL(sisSession);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3801
        
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3802
        Swi::RSisRegistryEntry sisEntry;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3803
        
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3804
        //Opens the base package entry by specifying a UID. 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3805
        User::LeaveIfError(sisEntry.Open(sisSession, aCompo.Uid()));
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3806
        CleanupClosePushL(sisEntry);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3807
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3808
    TUint drivesMask = sisEntry.InstalledDrivesL();
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3809
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3810
    TInt drive= EDriveA;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3811
    TDriveNumber installedDrive = EDriveC;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3812
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3813
    if( drivesMask )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3814
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3815
    // Select the highest drive as location drive. That's the case when 
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3816
    // all installation is not in same drive
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3817
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3818
    while( drivesMask >>= 1 )
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3819
    {
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3820
    drive++;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3821
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3822
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3823
    RDEBUG_2( "drive -> SetSisAppVersionAndDriveL %d", drive);
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3824
    
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3825
    installedDrive = (TDriveNumber)drive;
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3826
    }
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3827
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3828
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3829
    TBool status = EFalse;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3830
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3831
    //Since "C" drive is not removable
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3832
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3833
    if (installedDrive!=EDriveC)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3834
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3835
        status = IsInstalledAppRemovableL(installedDrive);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3836
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3837
    if (status)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3838
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3839
        RDEBUG( "IsInstalledAppRemovableL(SetSisAppVersionAndDriveL); True");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3840
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3841
    else
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3842
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3843
        RDEBUG( "IsInstalledAppRemovableL(SetSisAppVersionAndDriveL); False");
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3844
        }
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3845
   
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3846
    //check for status drive
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3847
    aCompo.SetAppRemovableStatus(status);
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3848
    
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3849
    TVersion version = sisEntry.VersionL();
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3850
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3851
    if (aCompo.ComponentVersion() == KNullDesC8)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3852
        {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3853
        TBuf8<KVersionLength> pkgDes;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3854
        pkgDes.AppendNum(version.iMajor);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3855
        pkgDes.Append(KLiteralPeriod);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3856
        pkgDes.AppendNum(version.iMinor);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3857
        aCompo.SetVersionL(pkgDes);
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
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3860
    CleanupStack::PopAndDestroy(2, &sisSession);
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
    RDEBUG( "CApplicationManagementSession: SetSisAppVersionAndDriveL: End" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3863
    }
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
TBool CApplicationManagementServer::IsInstalledAppRemovableL(
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3866
        TDriveNumber &iDrive)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3867
    {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3868
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3869
    RDEBUG( "IsInstalledAppRemovableL: Step1" );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3870
    TBool removable=EFalse;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3871
    RFs rfs;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3872
    User::LeaveIfError(rfs.Connect() );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3873
    CleanupClosePushL(rfs);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3874
    TDriveList driveList;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3875
    TInt driveCount;
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
    //Get all removeable drive, both physically and logically
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3878
    User::LeaveIfError(DriveInfo::GetUserVisibleDrives(rfs, driveList,
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3879
            driveCount, KDriveAttRemovable));
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
    TInt max(driveList.Length());
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
    RDEBUG_2( "driveList.Length() %d", max);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3884
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3885
    RDEBUG_2( "driveCount %d", driveCount);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3886
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3887
    TBuf<26> buf;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3888
    buf.Copy(driveList);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3889
    RDEBUG_2( "Drive Info (%S)", &buf);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3890
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3891
    for (TInt i=0; i<max; ++i)
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3892
        {
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3893
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3894
        //RDEBUG( "IsInstalledAppRemovableL: Step2" );
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3895
        if (driveList[i])
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3896
            {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3897
            TUint status;
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3898
            RDEBUG( "IsInstalledAppRemovableL: Step3" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3899
            DriveInfo::GetDriveStatus(rfs, i, status);
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3900
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3901
            RDEBUG( "IsInstalledAppRemovableL: Step4" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3902
            //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
  3903
            if (status & DriveInfo::EDriveRemovable)
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3904
                {
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3905
                RDEBUG( "IsInstalledAppRemovableL: Drive removable" );
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3906
                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
  3907
                if (i == iDrive)
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
                    RDEBUG( "IsInstalledAppRemovableL: Step5" );
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3910
                    removable=ETrue;
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3911
                    break;
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
                }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3914
            }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3915
        }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3916
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3917
    CleanupStack::PopAndDestroy( &rfs);
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3918
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3919
    return removable;
58
5b858729772b Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  3920
0
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3921
    }
3ce708148e4d Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  3922
//  End of File