contentstorage/srvsrc/cainstallstrategy.cpp
author hgs
Mon, 24 May 2010 20:50:46 +0300
changeset 95 c739008478cc
parent 92 782e3408c2ab
child 83 156f692b1687
permissions -rw-r--r--
201019_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
92
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 *
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 *
hgs
parents:
diff changeset
    14
 * Description:  ?Description
hgs
parents:
diff changeset
    15
 *
hgs
parents:
diff changeset
    16
 */
hgs
parents:
diff changeset
    17
#include <e32property.h>
hgs
parents:
diff changeset
    18
#include <SWInstallerInternalPSKeys.h>
hgs
parents:
diff changeset
    19
#include <javadomainpskeys.h>
hgs
parents:
diff changeset
    20
#include "cainstallstrategy.h"
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    23
//
hgs
parents:
diff changeset
    24
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    25
//
hgs
parents:
diff changeset
    26
CCaSwiInstallStrategy* CCaSwiInstallStrategy::NewL( RProperty& aProperty )
hgs
parents:
diff changeset
    27
    {
hgs
parents:
diff changeset
    28
    CCaSwiInstallStrategy* self = new ( ELeave ) CCaSwiInstallStrategy(
hgs
parents:
diff changeset
    29
            aProperty );
hgs
parents:
diff changeset
    30
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    31
    self->ConstructL();
hgs
parents:
diff changeset
    32
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
    33
    return self;
hgs
parents:
diff changeset
    34
    }
hgs
parents:
diff changeset
    35
hgs
parents:
diff changeset
    36
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    37
//
hgs
parents:
diff changeset
    38
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    39
//
hgs
parents:
diff changeset
    40
void CCaSwiInstallStrategy::NotifyListenerL(
hgs
parents:
diff changeset
    41
		RProperty& aProperty, MCaInstallListener& aListener )
hgs
parents:
diff changeset
    42
    {
hgs
parents:
diff changeset
    43
    TInt appUid;
hgs
parents:
diff changeset
    44
    User::LeaveIfError( aProperty.Get( KUidSystemCategory,
hgs
parents:
diff changeset
    45
            KUidSwiLatestInstallation, appUid ) );
hgs
parents:
diff changeset
    46
    if( appUid )
hgs
parents:
diff changeset
    47
        {
hgs
parents:
diff changeset
    48
        aListener.HandleInstallNotifyL(appUid );
hgs
parents:
diff changeset
    49
        }
hgs
parents:
diff changeset
    50
    }
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    53
//
hgs
parents:
diff changeset
    54
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    55
//
hgs
parents:
diff changeset
    56
CCaSwiInstallStrategy::CCaSwiInstallStrategy( RProperty& aProperty )
hgs
parents:
diff changeset
    57
    {
hgs
parents:
diff changeset
    58
    aProperty.Attach( KUidSystemCategory, KUidSwiLatestInstallation );
hgs
parents:
diff changeset
    59
    }
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    62
//
hgs
parents:
diff changeset
    63
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    64
//
hgs
parents:
diff changeset
    65
void CCaSwiInstallStrategy::ConstructL()
hgs
parents:
diff changeset
    66
    {
hgs
parents:
diff changeset
    67
    }
hgs
parents:
diff changeset
    68
hgs
parents:
diff changeset
    69
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    70
//
hgs
parents:
diff changeset
    71
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    72
//
hgs
parents:
diff changeset
    73
CCaJavaInstallStrategy* CCaJavaInstallStrategy::NewL( RProperty& aProperty )
hgs
parents:
diff changeset
    74
    {
hgs
parents:
diff changeset
    75
    CCaJavaInstallStrategy* self =
hgs
parents:
diff changeset
    76
            new ( ELeave ) CCaJavaInstallStrategy( aProperty );
hgs
parents:
diff changeset
    77
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    78
    self->ConstructL();
hgs
parents:
diff changeset
    79
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
    80
    return self;
hgs
parents:
diff changeset
    81
    }
hgs
parents:
diff changeset
    82
hgs
parents:
diff changeset
    83
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    84
//
hgs
parents:
diff changeset
    85
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    86
//
hgs
parents:
diff changeset
    87
void CCaJavaInstallStrategy::NotifyListenerL(
hgs
parents:
diff changeset
    88
		RProperty& aProperty, MCaInstallListener& aListener )
hgs
parents:
diff changeset
    89
    {
hgs
parents:
diff changeset
    90
//TODO: temporary sollution until new notification mechanism from usif in wk14
hgs
parents:
diff changeset
    91
//    TInt state;
hgs
parents:
diff changeset
    92
//    User::LeaveIfError( aProperty.Get( KUidSystemCategory,
hgs
parents:
diff changeset
    93
//            KPSUidJavaLatestInstallationState, state ) );
hgs
parents:
diff changeset
    94
//	if( ( ( state & ESASwisInstall ) || ( state & ESASwisUninstall ) )
hgs
parents:
diff changeset
    95
//            && ( state & ESASwisStatusSuccess ) )
hgs
parents:
diff changeset
    96
//        {
hgs
parents:
diff changeset
    97
        TInt appUid;
hgs
parents:
diff changeset
    98
        User::LeaveIfError( aProperty.Get( KUidSystemCategory,
hgs
parents:
diff changeset
    99
                KPSUidJavaLatestInstallation, appUid ) );
hgs
parents:
diff changeset
   100
        aListener.HandleInstallNotifyL(appUid );
hgs
parents:
diff changeset
   101
//        }
hgs
parents:
diff changeset
   102
    }
hgs
parents:
diff changeset
   103
hgs
parents:
diff changeset
   104
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   105
//
hgs
parents:
diff changeset
   106
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   107
//
hgs
parents:
diff changeset
   108
CCaJavaInstallStrategy::CCaJavaInstallStrategy( RProperty& aProperty )
hgs
parents:
diff changeset
   109
    {
hgs
parents:
diff changeset
   110
    aProperty.Attach( KUidSystemCategory, KPSUidJavaLatestInstallationState );
hgs
parents:
diff changeset
   111
    }
hgs
parents:
diff changeset
   112
hgs
parents:
diff changeset
   113
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   114
//
hgs
parents:
diff changeset
   115
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   116
//
hgs
parents:
diff changeset
   117
void CCaJavaInstallStrategy::ConstructL()
hgs
parents:
diff changeset
   118
    {
hgs
parents:
diff changeset
   119
    }
hgs
parents:
diff changeset
   120
hgs
parents:
diff changeset
   121
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   122
//
hgs
parents:
diff changeset
   123
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   124
//
hgs
parents:
diff changeset
   125
CCaUsifUninstallStrategy* CCaUsifUninstallStrategy::NewL(
hgs
parents:
diff changeset
   126
        RProperty& aProperty )
hgs
parents:
diff changeset
   127
    {
hgs
parents:
diff changeset
   128
    CCaUsifUninstallStrategy* self =
hgs
parents:
diff changeset
   129
            new ( ELeave ) CCaUsifUninstallStrategy( aProperty );
hgs
parents:
diff changeset
   130
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
   131
    self->ConstructL();
hgs
parents:
diff changeset
   132
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
   133
    return self;
hgs
parents:
diff changeset
   134
    }
hgs
parents:
diff changeset
   135
hgs
parents:
diff changeset
   136
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   137
//
hgs
parents:
diff changeset
   138
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   139
//
hgs
parents:
diff changeset
   140
void CCaUsifUninstallStrategy::NotifyListenerL(
hgs
parents:
diff changeset
   141
		RProperty& aProperty, MCaInstallListener& aListener )
hgs
parents:
diff changeset
   142
    {
hgs
parents:
diff changeset
   143
    TInt appUid;
hgs
parents:
diff changeset
   144
    User::LeaveIfError( aProperty.Get( KPSUidSWInstallerUiNotification,
hgs
parents:
diff changeset
   145
            KSWInstallerUninstallation, appUid ) );
hgs
parents:
diff changeset
   146
    // if there is some value!=0 in iAppUid and appUid==0 that means
hgs
parents:
diff changeset
   147
    // application with uid==iAppUid was uninstalled, so we notify aListener
hgs
parents:
diff changeset
   148
    if( iAppUid && !appUid )
hgs
parents:
diff changeset
   149
        {
hgs
parents:
diff changeset
   150
        aListener.HandleInstallNotifyL( iAppUid );
hgs
parents:
diff changeset
   151
        }
hgs
parents:
diff changeset
   152
    iAppUid = appUid;
hgs
parents:
diff changeset
   153
    }
hgs
parents:
diff changeset
   154
hgs
parents:
diff changeset
   155
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   156
//
hgs
parents:
diff changeset
   157
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   158
//
hgs
parents:
diff changeset
   159
CCaUsifUninstallStrategy::CCaUsifUninstallStrategy( RProperty& aProperty )
hgs
parents:
diff changeset
   160
    {
hgs
parents:
diff changeset
   161
	aProperty.Attach(
hgs
parents:
diff changeset
   162
			KPSUidSWInstallerUiNotification, KSWInstallerUninstallation );
hgs
parents:
diff changeset
   163
    }
hgs
parents:
diff changeset
   164
hgs
parents:
diff changeset
   165
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   166
//
hgs
parents:
diff changeset
   167
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   168
//
hgs
parents:
diff changeset
   169
void CCaUsifUninstallStrategy::ConstructL()
hgs
parents:
diff changeset
   170
    {
hgs
parents:
diff changeset
   171
    }
hgs
parents:
diff changeset
   172