85
|
1 |
/*
|
98
|
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".
|
85
|
8 |
*
|
98
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Sis package installation event listener
|
|
15 |
*
|
|
16 |
*/
|
85
|
17 |
|
|
18 |
#include <sacls.h>
|
|
19 |
#include "cawidgetscannerinstallnotifier.h"
|
|
20 |
#include "cawidgetscannerplugin.h"
|
|
21 |
|
|
22 |
// ============================ MEMBER FUNCTIONS =============================
|
|
23 |
|
|
24 |
// -----------------------------------------------------------------------------
|
98
|
25 |
//
|
85
|
26 |
// -----------------------------------------------------------------------------
|
|
27 |
//
|
|
28 |
CCaWidgetScannerInstallNotifier::CCaWidgetScannerInstallNotifier(
|
98
|
29 |
CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) :
|
|
30 |
CActive( EPriorityNormal )
|
85
|
31 |
{
|
|
32 |
CActiveScheduler::Add( this );
|
|
33 |
|
|
34 |
iCallback = aCallback;
|
|
35 |
iCategory = aCategory;
|
|
36 |
iKey = aKey;
|
|
37 |
iProperty.Attach( iCategory, iKey );
|
98
|
38 |
SetActive();
|
85
|
39 |
iProperty.Subscribe( iStatus );
|
98
|
40 |
iHackFlag = EFalse;
|
85
|
41 |
}
|
|
42 |
|
|
43 |
// -----------------------------------------------------------------------------
|
98
|
44 |
//
|
85
|
45 |
// -----------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
void CCaWidgetScannerInstallNotifier::ConstructL()
|
|
48 |
{
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
98
|
52 |
//
|
85
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
CCaWidgetScannerInstallNotifier* CCaWidgetScannerInstallNotifier::NewL(
|
98
|
56 |
CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey )
|
85
|
57 |
{
|
98
|
58 |
CCaWidgetScannerInstallNotifier* self =
|
|
59 |
new ( ELeave ) CCaWidgetScannerInstallNotifier( aCallback,
|
|
60 |
aCategory, aKey );
|
85
|
61 |
CleanupStack::PushL( self );
|
98
|
62 |
self->ConstructL();
|
85
|
63 |
CleanupStack::Pop( self );
|
|
64 |
|
|
65 |
return self;
|
|
66 |
}
|
|
67 |
|
|
68 |
// ---------------------------------------------------------------------------
|
98
|
69 |
//
|
85
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
//
|
|
72 |
CCaWidgetScannerInstallNotifier::~CCaWidgetScannerInstallNotifier()
|
|
73 |
{
|
98
|
74 |
Cancel();
|
|
75 |
iProperty.Close();
|
85
|
76 |
}
|
|
77 |
|
|
78 |
// ---------------------------------------------------------------------------
|
98
|
79 |
//
|
85
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
void CCaWidgetScannerInstallNotifier::DoCancel()
|
|
83 |
{
|
98
|
84 |
iProperty.Cancel();
|
85
|
85 |
}
|
|
86 |
|
98
|
87 |
#ifdef COVERAGE_MEASUREMENT
|
|
88 |
#pragma CTC SKIP
|
|
89 |
#endif //COVERAGE_MEASUREMENT (error is ignored)
|
85
|
90 |
// ---------------------------------------------------------------------------
|
98
|
91 |
//
|
85
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
//
|
|
94 |
TInt CCaWidgetScannerInstallNotifier::RunError( TInt /*aError*/)
|
|
95 |
{
|
|
96 |
// No need to do anything
|
|
97 |
return KErrNone;
|
|
98 |
}
|
98
|
99 |
#ifdef COVERAGE_MEASUREMENT
|
|
100 |
#pragma CTC ENDSKIP
|
|
101 |
#endif //COVERAGE_MEASUREMENT
|
85
|
102 |
|
|
103 |
// ---------------------------------------------------------------------------
|
98
|
104 |
//
|
85
|
105 |
// ---------------------------------------------------------------------------
|
|
106 |
//
|
|
107 |
void CCaWidgetScannerInstallNotifier::RunL()
|
|
108 |
{
|
|
109 |
// Re-issue request before notifying
|
98
|
110 |
SetActive();
|
85
|
111 |
iProperty.Subscribe( iStatus );
|
|
112 |
|
|
113 |
TInt status;
|
|
114 |
User::LeaveIfError( iProperty.Get( KUidSystemCategory,
|
98
|
115 |
KSAUidSoftwareInstallKeyValue, status ) );
|
|
116 |
|
99
|
117 |
if( iHackFlag )
|
85
|
118 |
{
|
|
119 |
iHackFlag = EFalse;
|
|
120 |
iCallback->SynchronizeL();
|
|
121 |
}
|
99
|
122 |
else if( ( status & EInstOpStatusSuccess ) && (
|
|
123 |
( status & EInstOpInstall ) ||
|
|
124 |
( status & EInstOpUninstall ) ) )
|
85
|
125 |
{
|
|
126 |
iHackFlag = ETrue;
|
|
127 |
}
|
|
128 |
}
|
|
129 |
// End of File
|