contentstorage/srvsrc/cainstallstrategy.cpp
changeset 124 e36b2f4799c0
parent 121 0b3699f6c654
equal deleted inserted replaced
121:0b3699f6c654 124:e36b2f4799c0
     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 <app/javadomainpskeys.h>
       
    20 #include <swi/swispubsubdefs.h>
       
    21 
       
    22 #include "cainstallstrategy.h"
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 CCaSwiInstallStrategy* CCaSwiInstallStrategy::NewL( RProperty& aProperty )
       
    29     {
       
    30     CCaSwiInstallStrategy* self = new ( ELeave ) CCaSwiInstallStrategy(
       
    31             aProperty );
       
    32     CleanupStack::PushL( self );
       
    33     self->ConstructL();
       
    34     CleanupStack::Pop( self );
       
    35     return self;
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 void CCaSwiInstallStrategy::NotifyListenerL(
       
    43 		RProperty& aProperty, MCaInstallListener& aListener )
       
    44     {
       
    45     TInt appUid;
       
    46     User::LeaveIfError( aProperty.Get( KUidSystemCategory,
       
    47             KUidSwiLatestInstallation, appUid ) );
       
    48     if( appUid )
       
    49         {
       
    50         aListener.HandleInstallNotifyL(appUid );
       
    51         }
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CCaSwiInstallStrategy::CCaSwiInstallStrategy( RProperty& aProperty )
       
    59     {
       
    60     aProperty.Attach( KUidSystemCategory, KUidSwiLatestInstallation );
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CCaSwiInstallStrategy::ConstructL()
       
    68     {
       
    69     }
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 CCaJavaInstallStrategy* CCaJavaInstallStrategy::NewL( RProperty& aProperty )
       
    76     {
       
    77     CCaJavaInstallStrategy* self =
       
    78             new ( ELeave ) CCaJavaInstallStrategy( aProperty );
       
    79     CleanupStack::PushL( self );
       
    80     self->ConstructL();
       
    81     CleanupStack::Pop( self );
       
    82     return self;
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 void CCaJavaInstallStrategy::NotifyListenerL(
       
    90 		RProperty& aProperty, MCaInstallListener& aListener )
       
    91     {
       
    92 //TODO: temporary sollution until new notification mechanism from usif in wk14
       
    93 //    TInt state;
       
    94 //    User::LeaveIfError( aProperty.Get( KUidSystemCategory,
       
    95 //            KPSUidJavaLatestInstallationState, state ) );
       
    96 //	if( ( ( state & ESASwisInstall ) || ( state & ESASwisUninstall ) )
       
    97 //            && ( state & ESASwisStatusSuccess ) )
       
    98 //        {
       
    99         TInt appUid;
       
   100         User::LeaveIfError( aProperty.Get( KUidSystemCategory,
       
   101                 KPSUidJavaLatestInstallation, appUid ) );
       
   102         aListener.HandleInstallNotifyL(appUid );
       
   103 //        }
       
   104     }
       
   105 
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 CCaJavaInstallStrategy::CCaJavaInstallStrategy( RProperty& aProperty )
       
   111     {
       
   112     aProperty.Attach( KUidSystemCategory, KPSUidJavaLatestInstallationState );
       
   113     }
       
   114 
       
   115 // ---------------------------------------------------------------------------
       
   116 //
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 void CCaJavaInstallStrategy::ConstructL()
       
   120     {
       
   121     }
       
   122 
       
   123 // ---------------------------------------------------------------------------
       
   124 //
       
   125 // ---------------------------------------------------------------------------
       
   126 //
       
   127 CCaUsifUninstallStrategy* CCaUsifUninstallStrategy::NewL(
       
   128         RProperty& aProperty )
       
   129     {
       
   130     CCaUsifUninstallStrategy* self =
       
   131             new ( ELeave ) CCaUsifUninstallStrategy( aProperty );
       
   132     CleanupStack::PushL( self );
       
   133     self->ConstructL();
       
   134     CleanupStack::Pop( self );
       
   135     return self;
       
   136     }
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 //
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 void CCaUsifUninstallStrategy::NotifyListenerL(
       
   143 		RProperty& aProperty, MCaInstallListener& aListener )
       
   144     {
       
   145     TInt status;
       
   146     // TODO: Temporary solution for incorrect USIF notifications     
       
   147     User::LeaveIfError( aProperty.Get( KUidSystemCategory,
       
   148             Swi::KUidSoftwareInstallKey, status ) );
       
   149     //if( status == ( Swi::ESwisStatusSuccess | Swi::ESwisUninstall ) )
       
   150     // notify subscribers on begenning and at the end of uninstallation
       
   151     if( status == Swi::ESwisUninstall || iUninstallStatus == Swi::ESwisUninstall /*&& !status*/ )
       
   152         {
       
   153         aListener.HandleInstallNotifyL( status );
       
   154         }    
       
   155     iUninstallStatus = status;
       
   156     }
       
   157 
       
   158 // ---------------------------------------------------------------------------
       
   159 //
       
   160 // ---------------------------------------------------------------------------
       
   161 //
       
   162 CCaUsifUninstallStrategy::CCaUsifUninstallStrategy( RProperty& aProperty )
       
   163     {
       
   164 	aProperty.Attach( KUidSystemCategory, Swi::KUidSoftwareInstallKey );
       
   165     }
       
   166 
       
   167 // ---------------------------------------------------------------------------
       
   168 //
       
   169 // ---------------------------------------------------------------------------
       
   170 //
       
   171 void CCaUsifUninstallStrategy::ConstructL()
       
   172     {
       
   173     }
       
   174