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