author | Dario Sestito <darios@symbian.org> |
Fri, 22 Oct 2010 14:23:56 +0100 | |
branch | RCL_3 |
changeset 84 | 0553e2305d00 |
parent 83 | 26b2b12093af |
permissions | -rw-r--r-- |
66 | 1 |
/* |
2 |
* Copyright (c) 2008-2010 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: MidletAppInfo implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <caf/caf.h> // ContentAccess::CContent |
|
20 |
#include <AknsUtils.h> // AknsUtils |
|
21 |
#include <eikenv.h> // CEikonEnv |
|
22 |
#include <eikappui.h> // CEikAppUi |
|
23 |
#include <aknViewAppUi.h> // CAknViewAppUi |
|
24 |
#include <gulicon.h> // CGulIcon |
|
25 |
#include <browserlauncher.h> // CBrowserLauncher |
|
26 |
#include <javaregistryincludes.h> // JavaRegistry |
|
27 |
#include <x509certchain.h> // CX509CertChain |
|
28 |
#include <imcvcodc.h> // TImCodecB64 |
|
29 |
||
30 |
#include <appmngr2driveutils.h> // TAppMngr2DriveUtils |
|
31 |
#include <appmngr2drmutils.h> // TAppMngr2DRMUtils |
|
32 |
#include <appmngr2cleanuputils.h> // CleanupResetAndDestroyPushL |
|
33 |
||
34 |
#include <apgcli.h> // RApaLsSession |
|
35 |
||
36 |
#include <javaapplicationsettings.rsg> // Midlet resource IDs |
|
37 |
#include "appmngr2midletappinfo.h" // CAppMngr2MidletAppInfo |
|
38 |
#include "appmngr2midletruntime.h" // KAppMngr2MidletUid |
|
39 |
#include "javaapplicationsettings.hrh" // Midlet command IDs |
|
40 |
#include "appmngr2midletinfoiterator.h" // CAppMngr2MidletInfoIterator |
|
41 |
#include "appmngr2midletsettingsview.h" // CAppMngr2MidletSettingsView |
|
42 |
#include "appmngr2midletsettingshandler.h" // CAppMngr2MidletSettingsHandler |
|
43 |
#include "appmngr2midletresourcehandler.h" // CAppMngr2MidletResourceHandler |
|
44 |
||
45 |
#include "appmngr2midletstorageutil.h" // Storage util |
|
46 |
#include "exceptionbase.h" // java::util::ExceptionBase exception. |
|
47 |
#include "logger.h" // LOG |
|
48 |
#include "securitystoragedatadefs.h" |
|
49 |
||
50 |
||
51 |
// Parameter that is passed to command line when launching Browser. |
|
52 |
// 4 - Start/Continue the browser specifying a URL |
|
53 |
_LIT(KBrowserStartContinueParam, "4 "); |
|
54 |
||
55 |
// MIDlet suite attributes |
|
56 |
_LIT(KMIDletDataSize, "MIDlet-Data-Size"); |
|
57 |
_LIT(KMIDletDescription, "MIDlet-Description"); |
|
58 |
_LIT(KMIDletInfoURL, "MIDlet-Info-URL"); |
|
59 |
_LIT(KNokiaUpdateUrl, "Nokia-Update-URL"); |
|
60 |
_LIT(KNokiaUpdate, "Nokia-Update"); |
|
61 |
_LIT(KMIDletPermissions, "MIDlet-Permissions"); |
|
62 |
_LIT(KNokiaMIDletName, "Nokia-MIDlet-Localized-Name"); |
|
63 |
_LIT(KNokiaMIDletN, "Nokia-MIDlet-Localized-"); |
|
64 |
||
65 |
_LIT(KListSeparatorAndSpace, ", "); |
|
66 |
||
67 |
// ======== MEMBER FUNCTIONS ======== |
|
68 |
||
69 |
// --------------------------------------------------------------------------- |
|
70 |
// CAppMngr2MidletAppInfo::NewL() |
|
71 |
// --------------------------------------------------------------------------- |
|
72 |
// |
|
73 |
CAppMngr2MidletAppInfo* CAppMngr2MidletAppInfo::NewL( |
|
74 |
CAppMngr2Runtime& aRuntime, |
|
75 |
Java::CJavaRegistryPackageEntry* aEntry, |
|
76 |
RFs& aFs, |
|
77 |
CAppMngr2MidletResourceHandler& aResourceHandler) |
|
78 |
{ |
|
79 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::NewL"); |
|
80 |
CAppMngr2MidletAppInfo* self |
|
81 |
= CAppMngr2MidletAppInfo::NewLC(aRuntime, aEntry, aFs, aResourceHandler); |
|
82 |
CleanupStack::Pop(self); |
|
83 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::NewL"); |
|
84 |
return self; |
|
85 |
} |
|
86 |
||
87 |
// --------------------------------------------------------------------------- |
|
88 |
// CAppMngr2MidletAppInfo::NewLC() |
|
89 |
// --------------------------------------------------------------------------- |
|
90 |
// |
|
91 |
CAppMngr2MidletAppInfo* CAppMngr2MidletAppInfo::NewLC( |
|
92 |
CAppMngr2Runtime& aRuntime, |
|
93 |
Java::CJavaRegistryPackageEntry* aEntry, |
|
94 |
RFs& aFs, |
|
95 |
CAppMngr2MidletResourceHandler& aResourceHandler) |
|
96 |
{ |
|
97 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::NewLC"); |
|
98 |
CAppMngr2MidletAppInfo* self |
|
99 |
= new(ELeave) CAppMngr2MidletAppInfo(aRuntime, aFs, aResourceHandler); |
|
100 |
CleanupStack::PushL(self); |
|
101 |
self->ConstructL(aEntry); |
|
102 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::NewLC"); |
|
103 |
return self; |
|
104 |
} |
|
105 |
||
106 |
// --------------------------------------------------------------------------- |
|
107 |
// CAppMngr2MidletAppInfo::~CAppMngr2MidletAppInfo() |
|
108 |
// --------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
CAppMngr2MidletAppInfo::~CAppMngr2MidletAppInfo() |
|
111 |
{ |
|
112 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::~CAppMngr2MidletAppInfo"); |
|
113 |
||
114 |
CAknViewAppUi* appUi |
|
115 |
= static_cast<CAknViewAppUi*>(CEikonEnv::Static()->EikAppUi()); |
|
116 |
appUi->RemoveView(KMidletSuiteSettingsViewId); |
|
117 |
||
118 |
CancelCommand(); |
|
119 |
||
120 |
delete iEntry; |
|
121 |
iEntry = NULL; |
|
122 |
||
123 |
delete iJarPath; |
|
124 |
iJarPath = NULL; |
|
125 |
||
126 |
delete iJadPath; |
|
127 |
iJadPath = NULL; |
|
128 |
||
129 |
delete iDetails; |
|
130 |
iDetails = NULL; |
|
131 |
||
132 |
delete iVersion; |
|
133 |
iVersion = NULL; |
|
134 |
||
135 |
delete iMimeType; |
|
136 |
iMimeType = NULL; |
|
137 |
||
138 |
delete iDataSize; |
|
139 |
iDataSize = NULL; |
|
140 |
||
141 |
delete iDescription; |
|
142 |
iDescription = NULL; |
|
143 |
||
144 |
delete iInfoUrl; |
|
145 |
iInfoUrl = NULL; |
|
146 |
||
147 |
delete iUpdateUrl; |
|
148 |
iUpdateUrl = NULL; |
|
149 |
||
150 |
delete iLocalizedMIDletName; |
|
151 |
iLocalizedMIDletName = NULL; |
|
152 |
||
153 |
delete iContent; |
|
154 |
iContent = NULL; |
|
155 |
||
156 |
delete iPermissions; |
|
157 |
iPermissions = NULL; |
|
158 |
||
159 |
delete iAppBitmap; |
|
160 |
iAppBitmap = NULL; |
|
161 |
||
162 |
delete iAppMask; |
|
163 |
iAppMask = NULL; |
|
164 |
||
165 |
delete iInfoIterator; |
|
166 |
iInfoIterator = NULL; |
|
167 |
||
168 |
iCertificates.ResetAndDestroy(); |
|
169 |
||
170 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::~CAppMngr2MidletAppInfo"); |
|
171 |
} |
|
172 |
||
173 |
// --------------------------------------------------------------------------- |
|
174 |
// CAppMngr2MidletAppInfo::IconIndex() |
|
175 |
// --------------------------------------------------------------------------- |
|
176 |
// |
|
177 |
TInt CAppMngr2MidletAppInfo::IconIndex() const |
|
178 |
{ |
|
179 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::IconIndex"); |
|
180 |
if (iAppBitmap && iAppMask) |
|
181 |
{ |
|
182 |
return EAppMngr2UseSpecificIcon; |
|
183 |
} |
|
184 |
return 0; // Icon 0: qgn_menu_am_midlet |
|
185 |
} |
|
186 |
||
187 |
// --------------------------------------------------------------------------- |
|
188 |
// CAppMngr2MidletAppInfo::SpecificIconL() |
|
189 |
// --------------------------------------------------------------------------- |
|
190 |
// |
|
191 |
CGulIcon* CAppMngr2MidletAppInfo::SpecificIconL() const |
|
192 |
{ |
|
193 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::SpecificIconL"); |
|
194 |
CGulIcon* icon = NULL; |
|
195 |
if (iAppBitmap && iAppMask) |
|
196 |
{ |
|
197 |
icon = CGulIcon::NewL(iAppBitmap, iAppMask); |
|
198 |
icon->SetBitmapsOwnedExternally(ETrue); |
|
199 |
} |
|
200 |
return icon; |
|
201 |
} |
|
202 |
||
203 |
// --------------------------------------------------------------------------- |
|
204 |
// CAppMngr2MidletAppInfo::Name() |
|
205 |
// --------------------------------------------------------------------------- |
|
206 |
// |
|
207 |
const TDesC& CAppMngr2MidletAppInfo::Name() const |
|
208 |
{ |
|
209 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Name"); |
|
210 |
return *iLocalizedMIDletName; |
|
211 |
} |
|
212 |
||
213 |
// --------------------------------------------------------------------------- |
|
214 |
// CAppMngr2MidletAppInfo::Details() |
|
215 |
// --------------------------------------------------------------------------- |
|
216 |
// |
|
217 |
const TDesC& CAppMngr2MidletAppInfo::Details() const |
|
218 |
{ |
|
219 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Details"); |
|
220 |
if (iDetails) |
|
221 |
{ |
|
222 |
return *iDetails; |
|
223 |
} |
|
224 |
return KNullDesC; |
|
225 |
} |
|
226 |
||
227 |
// --------------------------------------------------------------------------- |
|
228 |
// CAppMngr2MidletAppInfo::IndicatorIconIndex() |
|
229 |
// --------------------------------------------------------------------------- |
|
230 |
// |
|
231 |
TInt CAppMngr2MidletAppInfo::IndicatorIconIndex() const |
|
232 |
{ |
|
233 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::IndicatorIconIndex"); |
|
234 |
if (iLocation == EAppMngr2LocationMemoryCard) |
|
235 |
{ |
|
236 |
return EAppMngr2IconQgnIndiAmInstMmcAdd; |
|
237 |
} |
|
238 |
if (iLocation == EAppMngr2LocationMassStorage) |
|
239 |
{ |
|
240 |
return EAppMngr2IconQgnIndiFmgrMsAdd; |
|
241 |
} |
|
242 |
return EAppMngr2NoIndicatorIcon; |
|
243 |
} |
|
244 |
||
245 |
// --------------------------------------------------------------------------- |
|
246 |
// CAppMngr2MidletAppInfo::GetMenuItemsL() |
|
247 |
// --------------------------------------------------------------------------- |
|
248 |
// |
|
249 |
void CAppMngr2MidletAppInfo::GetMenuItemsL( |
|
250 |
RPointerArray<CEikMenuPaneItem::SData>& aMenuCmds) |
|
251 |
{ |
|
252 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetMenuItemsL"); |
|
253 |
TInt resourceOffset = iResourceHandler.AddResourceFileL(); |
|
254 |
CEikMenuPaneItem::SData* menuItemData = new(ELeave) CEikMenuPaneItem::SData; |
|
255 |
CleanupStack::PushL(menuItemData); |
|
256 |
ReadMenuItemDataFromResourceL(MIDLET_SUITE_SETTINGS_MENU_ITEM, *menuItemData); |
|
257 |
aMenuCmds.AppendL(menuItemData); |
|
258 |
CleanupStack::Pop(menuItemData); |
|
259 |
||
260 |
if (InfoIteratorL().GetUpdateUrlL() != KNullDesC) |
|
261 |
{ |
|
262 |
menuItemData = new(ELeave) CEikMenuPaneItem::SData; |
|
263 |
CleanupStack::PushL(menuItemData); |
|
264 |
ReadMenuItemDataFromResourceL(MIDLET_START_UPDATE_MENU_ITEM, *menuItemData); |
|
265 |
aMenuCmds.AppendL(menuItemData); |
|
266 |
CleanupStack::Pop(menuItemData); |
|
267 |
} |
|
268 |
||
269 |
if (InfoIteratorL().GetInfoUrlL() != KNullDesC) |
|
270 |
{ |
|
271 |
menuItemData = new(ELeave) CEikMenuPaneItem::SData; |
|
272 |
CleanupStack::PushL(menuItemData); |
|
273 |
ReadMenuItemDataFromResourceL(MIDLET_GOTO_URL_MENU_ITEM, *menuItemData); |
|
274 |
aMenuCmds.AppendL(menuItemData); |
|
275 |
CleanupStack::Pop(menuItemData); |
|
276 |
} |
|
277 |
if (resourceOffset > 0) |
|
278 |
{ |
|
279 |
iResourceHandler.DeleteResourceFile(resourceOffset); |
|
280 |
} |
|
281 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetMenuItemsL"); |
|
282 |
} |
|
283 |
||
284 |
// --------------------------------------------------------------------------- |
|
285 |
// CAppMngr2MidletAppInfo::SupportsGenericCommand() |
|
286 |
// --------------------------------------------------------------------------- |
|
287 |
// |
|
288 |
TBool CAppMngr2MidletAppInfo::SupportsGenericCommand(TInt /*aCmdId*/) |
|
289 |
{ |
|
290 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::SupportsGenericCommand"); |
|
291 |
return ETrue; |
|
292 |
} |
|
293 |
||
294 |
// --------------------------------------------------------------------------- |
|
295 |
// CAppMngr2MidletAppInfo::HandleCommandL() |
|
296 |
// --------------------------------------------------------------------------- |
|
297 |
// |
|
298 |
void CAppMngr2MidletAppInfo::HandleCommandL( |
|
299 |
TInt aCommandId, TRequestStatus& aStatus) |
|
300 |
{ |
|
301 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::HandleCommandL"); |
|
302 |
switch (aCommandId) |
|
303 |
{ |
|
304 |
case EAppMngr2CmdViewDetails: |
|
305 |
{ |
|
306 |
ShowDetailsL(); |
|
307 |
TRequestStatus* status = &aStatus; |
|
308 |
User::RequestComplete(status, KErrNone); |
|
309 |
break; |
|
310 |
} |
|
311 |
case EAppMngr2CmdUninstall: |
|
312 |
{ |
|
313 |
UninstallL(aStatus); |
|
314 |
break; |
|
315 |
} |
|
316 |
case EAppMngrCmdSetSuiteSettings: |
|
317 |
{ |
|
318 |
ShowSettingsL(); |
|
319 |
TRequestStatus* status = &aStatus; |
|
320 |
User::RequestComplete(status, KErrNone); |
|
321 |
break; |
|
322 |
} |
|
323 |
case EAppMngrCmdStartUpdate: |
|
324 |
{ |
|
325 |
UpdateL(); |
|
326 |
TRequestStatus* status = &aStatus; |
|
327 |
User::RequestComplete(status, KErrNone); |
|
328 |
break; |
|
329 |
} |
|
330 |
case EAppMngrCmdGoToUrl: |
|
331 |
{ |
|
332 |
ShowInfoUrlL(); |
|
333 |
TRequestStatus* status = &aStatus; |
|
334 |
User::RequestComplete(status, KErrNone); |
|
335 |
break; |
|
336 |
} |
|
337 |
default: |
|
338 |
{ |
|
339 |
// Uknown command |
|
340 |
TRequestStatus* status = &aStatus; |
|
341 |
User::RequestComplete(status, KErrNotSupported); |
|
342 |
break; |
|
343 |
} |
|
344 |
} |
|
345 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::HandleCommandL"); |
|
346 |
} |
|
347 |
||
348 |
// --------------------------------------------------------------------------- |
|
349 |
// CAppMngr2MidletAppInfo::HandleCommandResultL() |
|
350 |
// --------------------------------------------------------------------------- |
|
351 |
// |
|
352 |
void CAppMngr2MidletAppInfo::HandleCommandResultL(TInt /*aStatus*/) |
|
353 |
{ |
|
354 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::HandleCommandResultL"); |
|
355 |
if (iSWInstLauncher) |
|
356 |
{ |
|
357 |
iSWInstLauncher->Close(); |
|
358 |
delete iSWInstLauncher; |
|
359 |
iSWInstLauncher = NULL; |
|
360 |
} |
|
361 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::HandleCommandResultL"); |
|
362 |
} |
|
363 |
||
364 |
// --------------------------------------------------------------------------- |
|
365 |
// CAppMngr2MidletAppInfo::CancelCommand() |
|
366 |
// --------------------------------------------------------------------------- |
|
367 |
// |
|
368 |
void CAppMngr2MidletAppInfo::CancelCommand() |
|
369 |
{ |
|
370 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::CancelCommand"); |
|
371 |
if (iSWInstLauncher) |
|
372 |
{ |
|
373 |
iSWInstLauncher->CancelAsyncRequest(SwiUI::ERequestUninstall); |
|
374 |
iSWInstLauncher->Close(); |
|
375 |
delete iSWInstLauncher; |
|
376 |
iSWInstLauncher = NULL; |
|
377 |
} |
|
378 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::CancelCommand"); |
|
379 |
} |
|
380 |
||
381 |
// ----------------------------------------------------------------------------- |
|
382 |
// CAppMngr2MidletAppInfo::HandleContentL() |
|
383 |
// ----------------------------------------------------------------------------- |
|
384 |
// |
|
385 |
TBool CAppMngr2MidletAppInfo::HandleContentL( |
|
386 |
const TDesC& /*aFileName*/, |
|
387 |
const CAiwGenericParamList& /*aParamList*/, |
|
388 |
TBool& /*aContinue */) |
|
389 |
{ |
|
390 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::HandleContentL"); |
|
391 |
return EFalse; |
|
392 |
} |
|
393 |
||
394 |
// ----------------------------------------------------------------------------- |
|
395 |
// CAppMngr2MidletAppInfo::HandleDownloadedContentHandlerReserved1() |
|
396 |
// ----------------------------------------------------------------------------- |
|
397 |
// |
|
398 |
TAny* CAppMngr2MidletAppInfo::DownloadedContentHandlerReserved1( |
|
399 |
TAny* /*aAnyParam*/) |
|
400 |
{ |
|
401 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngrMidletAppInfo::DownloadedContentHandlerReserved1"); |
|
402 |
return NULL; |
|
403 |
} |
|
404 |
||
405 |
// --------------------------------------------------------------------------- |
|
406 |
// CAppMngr2MidletAppInfo::JarFileName() |
|
407 |
// --------------------------------------------------------------------------- |
|
408 |
// |
|
409 |
const TDesC& CAppMngr2MidletAppInfo::JarFileName() const |
|
410 |
{ |
|
411 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::JarFileName"); |
|
412 |
if (iJarPath) |
|
413 |
{ |
|
414 |
return *iJarPath; |
|
415 |
} |
|
416 |
return KNullDesC; |
|
417 |
} |
|
418 |
||
419 |
// --------------------------------------------------------------------------- |
|
420 |
// CAppMngr2MidletAppInfo::JadFileName() |
|
421 |
// --------------------------------------------------------------------------- |
|
422 |
// |
|
423 |
const TDesC& CAppMngr2MidletAppInfo::JadFileName() const |
|
424 |
{ |
|
425 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::JadFileName"); |
|
426 |
if (iJadPath) |
|
427 |
{ |
|
428 |
return *iJadPath; |
|
429 |
} |
|
430 |
return KNullDesC; |
|
431 |
} |
|
432 |
||
433 |
// --------------------------------------------------------------------------- |
|
434 |
// CAppMngr2MidletAppInfo::MimeType() |
|
435 |
// --------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
const TDesC8& CAppMngr2MidletAppInfo::MimeType() const |
|
438 |
{ |
|
439 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::MimeType"); |
|
440 |
if (iMimeType) |
|
441 |
{ |
|
442 |
return *iMimeType; |
|
443 |
} |
|
444 |
return KNullDesC8; |
|
445 |
} |
|
446 |
||
447 |
// --------------------------------------------------------------------------- |
|
448 |
// CAppMngr2MidletAppInfo::Version() |
|
449 |
// --------------------------------------------------------------------------- |
|
450 |
// |
|
451 |
const TDesC& CAppMngr2MidletAppInfo::Version() const |
|
452 |
{ |
|
453 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Version"); |
|
454 |
if (iVersion) |
|
455 |
{ |
|
456 |
return *iVersion; |
|
457 |
} |
|
458 |
return KNullDesC; |
|
459 |
} |
|
460 |
||
461 |
// --------------------------------------------------------------------------- |
|
462 |
// CAppMngr2MidletAppInfo::Vendor() |
|
463 |
// --------------------------------------------------------------------------- |
|
464 |
// |
|
465 |
const TDesC& CAppMngr2MidletAppInfo::Vendor() const |
|
466 |
{ |
|
467 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Vendor"); |
|
468 |
return iEntry->Vendor(); |
|
469 |
} |
|
470 |
||
471 |
// --------------------------------------------------------------------------- |
|
472 |
// CAppMngr2MidletAppInfo::SecurityDomainCategory() |
|
473 |
// --------------------------------------------------------------------------- |
|
474 |
// |
|
475 |
const std::wstring CAppMngr2MidletAppInfo::SecurityDomainCategory() const |
|
476 |
{ |
|
477 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory "); |
|
478 |
return iSecurityDomainCategory; |
|
479 |
} |
|
480 |
||
481 |
// --------------------------------------------------------------------------- |
|
482 |
// CAppMngr2MidletAppInfo::SecurityDomainName() |
|
483 |
// --------------------------------------------------------------------------- |
|
484 |
// |
|
485 |
const std::wstring CAppMngr2MidletAppInfo::SecurityDomainName() const |
|
486 |
{ |
|
487 |
LOG(EJavaAppMngrPlugin, EInfo, " + CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainName "); |
|
488 |
LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainName "); |
|
489 |
return iSecurityDomainName; |
|
490 |
} |
|
491 |
||
492 |
// --------------------------------------------------------------------------- |
|
493 |
// CAppMngr2MidletAppInfo::() |
|
494 |
// --------------------------------------------------------------------------- |
|
495 |
// |
|
496 |
const TDesC& CAppMngr2MidletAppInfo::DataSize() const |
|
497 |
{ |
|
498 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::DataSize"); |
|
499 |
if (iDataSize) |
|
500 |
{ |
|
501 |
return *iDataSize; |
|
502 |
} |
|
503 |
return KNullDesC; |
|
504 |
} |
|
505 |
||
506 |
// --------------------------------------------------------------------------- |
|
507 |
// CAppMngr2MidletAppInfo::Description() |
|
508 |
// --------------------------------------------------------------------------- |
|
509 |
// |
|
510 |
const TDesC& CAppMngr2MidletAppInfo::Description() const |
|
511 |
{ |
|
512 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Description"); |
|
513 |
if (iDescription) |
|
514 |
{ |
|
515 |
return *iDescription; |
|
516 |
} |
|
517 |
return KNullDesC; |
|
518 |
} |
|
519 |
||
520 |
// --------------------------------------------------------------------------- |
|
521 |
// CAppMngr2MidletAppInfo::InfoUrl() |
|
522 |
// --------------------------------------------------------------------------- |
|
523 |
// |
|
524 |
const TDesC& CAppMngr2MidletAppInfo::InfoUrl() const |
|
525 |
{ |
|
526 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::InfoUrl"); |
|
527 |
if (iInfoUrl) |
|
528 |
{ |
|
529 |
return *iInfoUrl; |
|
530 |
} |
|
531 |
return KNullDesC; |
|
532 |
} |
|
533 |
||
534 |
// --------------------------------------------------------------------------- |
|
535 |
// CAppMngr2MidletAppInfo::UpdateUrl() |
|
536 |
// --------------------------------------------------------------------------- |
|
537 |
// |
|
538 |
const TDesC& CAppMngr2MidletAppInfo::UpdateUrl() const |
|
539 |
{ |
|
540 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::UpdateUrl"); |
|
541 |
if (iUpdateUrl) |
|
542 |
{ |
|
543 |
return *iUpdateUrl; |
|
544 |
} |
|
545 |
return KNullDesC; |
|
546 |
} |
|
547 |
||
548 |
// --------------------------------------------------------------------------- |
|
549 |
// CAppMngr2MidletAppInfo::Content() |
|
550 |
// --------------------------------------------------------------------------- |
|
551 |
// |
|
552 |
const TDesC& CAppMngr2MidletAppInfo::Content() const |
|
553 |
{ |
|
554 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Content"); |
|
555 |
if (iContent) |
|
556 |
{ |
|
557 |
return *iContent; |
|
558 |
} |
|
559 |
return KNullDesC; |
|
560 |
} |
|
561 |
||
562 |
// --------------------------------------------------------------------------- |
|
563 |
// CAppMngr2MidletAppInfo::Permissions() |
|
564 |
// --------------------------------------------------------------------------- |
|
565 |
// |
|
566 |
const TDesC& CAppMngr2MidletAppInfo::Permissions() const |
|
567 |
{ |
|
568 |
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::Permissions"); |
|
569 |
if (iPermissions) |
|
570 |
{ |
|
571 |
return *iPermissions; |
|
572 |
} |
|
573 |
return KNullDesC; |
|
574 |
} |
|
575 |
||
576 |
// --------------------------------------------------------------------------- |
|
577 |
// CAppMngr2MidletAppInfo::CAppMngr2MidletAppInfo() |
|
578 |
// --------------------------------------------------------------------------- |
|
579 |
// |
|
580 |
CAppMngr2MidletAppInfo::CAppMngr2MidletAppInfo(CAppMngr2Runtime& aRuntime, |
|
581 |
RFs& aFsSession, CAppMngr2MidletResourceHandler& aResourceHandler) : CAppMngr2AppInfo(aRuntime, aFsSession), iResourceHandler(aResourceHandler) |
|
582 |
{ |
|
583 |
} |
|
584 |
||
585 |
// --------------------------------------------------------------------------- |
|
586 |
// CAppMngr2MidletAppInfo::ConstructL() |
|
587 |
// --------------------------------------------------------------------------- |
|
588 |
// |
|
589 |
void CAppMngr2MidletAppInfo::ConstructL( |
|
590 |
Java::CJavaRegistryPackageEntry* aEntry) |
|
591 |
{ |
|
592 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ConstructL"); |
|
593 |
CAppMngr2AppInfo::ConstructL(); |
|
594 |
||
595 |
iEntry = aEntry; |
|
596 |
||
597 |
std::auto_ptr<AppMngr2MidletStorageUtil>storageUtils( |
|
598 |
new AppMngr2MidletStorageUtil()); |
|
599 |
storageUtils->populateSuiteInformation(iEntry->Uid()); |
|
600 |
||
601 |
_LIT(KJarPath, "JAR_PATH"); |
|
602 |
_LIT(KJadPath, "JAD_PATH"); |
|
603 |
||
604 |
try |
|
605 |
{ |
|
606 |
iJarPath = storageUtils->attribute(KJarPath); // Ownership taken. |
|
607 |
iJadPath = storageUtils->attribute(KJadPath); // Ownership taken. |
|
608 |
} |
|
609 |
catch (java::util::ExceptionBase) |
|
610 |
{ |
|
611 |
User::Leave(KErrNoMemory); |
|
612 |
} |
|
613 |
||
614 |
iDetails = SizeStringWithUnitsL(iEntry->UsedUserDiskSpace()); |
|
615 |
||
616 |
iLocation = TAppMngr2DriveUtils::LocationFromFileNameL(*iJarPath, iFs); |
|
617 |
iLocationDrive = TDriveUnit(*iJarPath); |
|
618 |
||
619 |
// Version |
|
620 |
TAppVersion ver = iEntry->Version(); |
|
621 |
TVersion verType(ver.iMajor, ver.iMinor, ver.iBuild); |
|
622 |
iVersion = verType.Name().AllocL(); |
|
623 |
||
624 |
// MIME type - AllFiles capability required. |
|
625 |
HBufC* mimeType = HBufC::NewLC(KMaxDataTypeLength); |
|
626 |
ContentAccess::CContent* pkgContent |
|
627 |
= ContentAccess::CContent::NewLC(iJarPath->Des(), |
|
628 |
ContentAccess::EContentShareReadOnly); |
|
629 |
TPtr mimePtr(mimeType->Des()); |
|
630 |
pkgContent->GetStringAttribute(ContentAccess::EMimeType, mimePtr); |
|
631 |
CleanupStack::PopAndDestroy(pkgContent); |
|
632 |
iMimeType = HBufC8::NewL(mimeType->Length()); |
|
633 |
iMimeType->Des().Copy(*mimeType); |
|
634 |
CleanupStack::PopAndDestroy(mimeType); |
|
635 |
||
636 |
// Data size |
|
637 |
const Java::MJavaAttribute* attribute |
|
638 |
= iEntry->AttributeL(KMIDletDataSize()); // no ownership |
|
639 |
if (attribute) |
|
640 |
{ |
|
641 |
iDataSize = attribute->Value().AllocL(); |
|
642 |
} |
|
643 |
// Description |
|
644 |
attribute = aEntry->AttributeL(KMIDletDescription()); // no ownership |
|
645 |
if (attribute) |
|
646 |
{ |
|
647 |
iDescription = attribute->Value().AllocL(); |
|
648 |
} |
|
649 |
// Info URL |
|
650 |
attribute = aEntry->AttributeL(KMIDletInfoURL()); // no ownership |
|
651 |
if (attribute) |
|
652 |
{ |
|
653 |
iInfoUrl = attribute->Value().AllocL(); |
|
654 |
} |
|
655 |
// Update URL |
|
656 |
attribute = aEntry->AttributeL(KNokiaUpdate()); // no ownership |
|
657 |
if (attribute) |
|
658 |
{ |
|
659 |
iUpdateUrl = attribute->Value().AllocL(); |
|
660 |
} |
|
661 |
else |
|
662 |
{ |
|
663 |
attribute = aEntry->AttributeL(KNokiaUpdateUrl()); // no ownership |
|
664 |
if (attribute) |
|
665 |
{ |
|
666 |
iUpdateUrl = attribute->Value().AllocL(); |
|
667 |
} |
|
668 |
} |
|
669 |
// Use localized midlet suite name if it exists |
|
670 |
attribute = aEntry->AttributeL(KNokiaMIDletName()); // no ownership |
|
671 |
if (attribute) |
|
672 |
{ |
|
673 |
iLocalizedMIDletName = attribute->Value().AllocL(); |
|
674 |
} |
|
675 |
else |
|
676 |
{ |
|
677 |
// Use non-localized name |
|
678 |
iLocalizedMIDletName = aEntry->Name().AllocL(); |
|
679 |
} |
|
680 |
||
681 |
RArray<TUid> midletUids; |
|
682 |
CleanupClosePushL(midletUids); |
|
683 |
iEntry->GetEmbeddedEntries(midletUids); |
|
684 |
||
685 |
||
686 |
// Content |
|
687 |
TBuf<50> attributeName; |
|
688 |
TInt contentLength(0); |
|
689 |
// Count length for content descriptor |
|
690 |
for (TInt i(0); i < midletUids.Count(); i++) |
|
691 |
{ |
|
692 |
// Localized MIDlet name |
|
693 |
attributeName = KNokiaMIDletN(); |
|
694 |
attributeName.AppendNum((i+1)); |
|
695 |
attribute = aEntry->AttributeL(attributeName); |
|
696 |
if (attribute) |
|
697 |
{ |
|
698 |
contentLength += attribute->Value().Length(); |
|
699 |
} |
|
700 |
else |
|
701 |
{ |
|
702 |
// Non-localized MIDlet name |
|
703 |
Java::CJavaRegistryApplicationEntry* midlet |
|
704 |
= (Java::CJavaRegistryApplicationEntry*) iEntry->EmbeddedEntryByNumberL(i); |
|
705 |
if (midlet) |
|
706 |
{ |
|
707 |
CleanupStack::PushL(midlet); |
|
708 |
contentLength += midlet->Name().Length(); |
|
709 |
CleanupStack::PopAndDestroy(midlet); |
|
710 |
} |
|
711 |
} |
|
712 |
contentLength += KListSeparatorAndSpace().Length(); |
|
713 |
} |
|
714 |
||
715 |
LOG1(EJavaAppMngrPlugin, EInfo, "contentLength is %d", contentLength); |
|
716 |
||
717 |
// Create content descriptor |
|
718 |
iContent = HBufC::NewL(contentLength); |
|
719 |
||
720 |
// Fill content descriptor |
|
721 |
TPtr ptrContent = iContent->Des(); |
|
722 |
for (TInt i(0); i < midletUids.Count(); i++) |
|
723 |
{ |
|
724 |
attributeName = KNokiaMIDletN(); |
|
725 |
attributeName.AppendNum((i+1)); |
|
726 |
attribute = aEntry->AttributeL(attributeName); |
|
727 |
if (attribute) |
|
728 |
{ |
|
729 |
// Localized MIDlet name |
|
730 |
if (ptrContent == KNullDesC) |
|
731 |
{ |
|
732 |
ptrContent.Append(attribute->Value()); |
|
733 |
} |
|
734 |
else |
|
735 |
{ |
|
736 |
ptrContent.Append(KListSeparatorAndSpace); |
|
737 |
ptrContent.Append(attribute->Value()); |
|
738 |
} |
|
739 |
} |
|
740 |
else |
|
741 |
{ |
|
742 |
// Non-localized MIDlet name |
|
743 |
Java::CJavaRegistryApplicationEntry* midlet |
|
744 |
= (Java::CJavaRegistryApplicationEntry*) iEntry->EmbeddedEntryByNumberL(i); |
|
745 |
if (midlet) |
|
746 |
{ |
|
747 |
CleanupStack::PushL(midlet); |
|
748 |
if (ptrContent == KNullDesC) |
|
749 |
{ |
|
750 |
ptrContent.Append(midlet->Name()); |
|
751 |
} |
|
752 |
else |
|
753 |
{ |
|
754 |
ptrContent.Append(KListSeparatorAndSpace); |
|
755 |
ptrContent.Append(midlet->Name()); |
|
756 |
} |
|
757 |
CleanupStack::PopAndDestroy(midlet); |
|
758 |
} |
|
759 |
} |
|
760 |
} |
|
761 |
||
762 |
// DRM |
|
763 |
iIsDRMProtected = TAppMngr2DRMUtils::IsDRMProtected(*iJarPath); |
|
764 |
iIsROMissingOrExpired = EFalse; |
|
765 |
if (iIsDRMProtected) |
|
766 |
{ |
|
767 |
iIsROMissingOrExpired |
|
768 |
= TAppMngr2DRMUtils::IsDRMRightsObjectExpiredOrMissingL( |
|
769 |
*iJarPath); |
|
770 |
} |
|
771 |
||
772 |
// MIDlet suite specific icons |
|
773 |
if (midletUids.Count() > 0) |
|
774 |
{ |
|
775 |
// Errors ignored so that the midlet is still displayed in the list with default icon. |
|
776 |
TRAPD(err, GetAppIconL(midletUids[0])); |
|
777 |
if (KErrNone != err) |
|
778 |
{ |
|
779 |
ELOG1(EJavaAppMngrPlugin, "GetAppIconL error %d", err); |
|
780 |
} |
|
781 |
} |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
782 |
|
66 | 783 |
CleanupStack::PopAndDestroy(&midletUids); |
784 |
||
785 |
// security domain |
|
786 |
CAppMngr2MidletSettingsHandler* settingsHandler |
|
787 |
= CAppMngr2MidletSettingsHandler::NewL(*iLocalizedMIDletName, iEntry->Uid(), iResourceHandler); |
|
788 |
CleanupStack::PushL(settingsHandler); |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
789 |
iSecurityDomainCategory = settingsHandler->GetSecurityDomainCategory(); |
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
790 |
iSecurityDomainName = settingsHandler->GetSecurityDomainName(); |
66 | 791 |
CleanupStack::PopAndDestroy(settingsHandler); |
792 |
if (iSecurityDomainCategory != UNIDENTIFIED_THIRD_PARTY_DOMAIN_CATEGORY) |
|
793 |
{ |
|
794 |
attribute = aEntry->AttributeL(KMIDletPermissions()); // no ownership |
|
795 |
if (attribute) |
|
796 |
{ |
|
797 |
iPermissions = attribute->Value().AllocL(); |
|
798 |
iPermissions->Des().TrimAll(); |
|
799 |
} |
|
800 |
} |
|
801 |
||
802 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ConstructL"); |
|
803 |
} |
|
804 |
||
805 |
// --------------------------------------------------------------------------- |
|
806 |
// CAppMngr2MidletAppInfo::UninstallL() |
|
807 |
// --------------------------------------------------------------------------- |
|
808 |
// |
|
809 |
void CAppMngr2MidletAppInfo::UninstallL(TRequestStatus& aStatus) |
|
810 |
{ |
|
811 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::UninstallL"); |
|
812 |
if (!iSWInstLauncher) |
|
813 |
{ |
|
814 |
SwiUI::RSWInstLauncher* swInstLauncher |
|
815 |
= new(ELeave) SwiUI::RSWInstLauncher; |
|
816 |
CleanupStack::PushL(swInstLauncher); |
|
817 |
User::LeaveIfError(swInstLauncher->Connect()); |
|
818 |
CleanupStack::Pop(swInstLauncher); |
|
819 |
iSWInstLauncher = swInstLauncher; |
|
820 |
swInstLauncher = NULL; |
|
821 |
} |
|
822 |
iSWInstLauncher->Uninstall(aStatus, iEntry->Uid(), SwiUI::KJarMIMEType()); |
|
823 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::UninstallL"); |
|
824 |
} |
|
825 |
||
826 |
// --------------------------------------------------------------------------- |
|
827 |
// CAppMngr2MidletAppInfo::ShowDetailsL() |
|
828 |
// --------------------------------------------------------------------------- |
|
829 |
// |
|
830 |
void CAppMngr2MidletAppInfo::ShowDetailsL() |
|
831 |
{ |
|
832 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ShowDetailsL"); |
|
833 |
TRAP_IGNORE(ReadCertificatesInfoL()); |
|
834 |
CAppMngr2MidletInfoIterator& iterator = InfoIteratorL(); // Not owned |
|
835 |
SwiUI::CommonUI::CCUIDetailsDialog* details |
|
836 |
= SwiUI::CommonUI::CCUIDetailsDialog::NewL(); |
|
837 |
||
838 |
if (iIsDRMProtected && !iIsROMissingOrExpired) |
|
839 |
{ |
|
840 |
RFile fileHandle; |
|
841 |
TInt err = fileHandle.Open( |
|
842 |
iFs, *iJarPath, EFileShareReadersOnly | EFileRead); |
|
843 |
CleanupClosePushL(fileHandle); |
|
844 |
||
845 |
if (iCertificates.Count()) |
|
846 |
{ |
|
847 |
details->ExecuteLD(iterator, iCertificates, fileHandle); |
|
848 |
} |
|
849 |
else |
|
850 |
{ |
|
851 |
details->ExecuteLD(iterator, fileHandle); |
|
852 |
} |
|
853 |
||
854 |
CleanupStack::PopAndDestroy(&fileHandle); |
|
855 |
} |
|
856 |
else |
|
857 |
{ |
|
858 |
if (iCertificates.Count()) |
|
859 |
{ |
|
860 |
details->ExecuteLD(iterator, iCertificates); |
|
861 |
} |
|
862 |
else |
|
863 |
{ |
|
864 |
details->ExecuteLD(iterator); |
|
865 |
} |
|
866 |
} |
|
867 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ShowDetailsL"); |
|
868 |
} |
|
869 |
||
870 |
||
871 |
// --------------------------------------------------------------------------- |
|
872 |
// CAppMngr2MidletAppInfo::ShowSettingsL() |
|
873 |
// --------------------------------------------------------------------------- |
|
874 |
// |
|
875 |
void CAppMngr2MidletAppInfo::ShowSettingsL() |
|
876 |
{ |
|
877 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ShowSettingsL"); |
|
878 |
CAknViewAppUi* appUi |
|
879 |
= static_cast<CAknViewAppUi*>(CEikonEnv::Static()->EikAppUi()); |
|
880 |
appUi->RemoveView(KMidletSuiteSettingsViewId); |
|
881 |
CAppMngr2MidletSettingsView* settingsView = CAppMngr2MidletSettingsView::NewL( |
|
882 |
*iLocalizedMIDletName, |
|
883 |
iEntry->Uid(), |
|
884 |
iResourceHandler); |
|
885 |
CleanupStack::PushL(settingsView); |
|
886 |
appUi->AddViewL(settingsView); // transfer ownership to CAknViewAppUi |
|
887 |
CleanupStack::Pop(settingsView); |
|
888 |
appUi->ActivateLocalViewL(KMidletSuiteSettingsViewId); |
|
889 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ShowSettingsL"); |
|
890 |
} |
|
891 |
||
892 |
// --------------------------------------------------------------------------- |
|
893 |
// CAppMngr2MidletAppInfo::UpdateL() |
|
894 |
// --------------------------------------------------------------------------- |
|
895 |
// |
|
896 |
void CAppMngr2MidletAppInfo::UpdateL() |
|
897 |
{ |
|
898 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::UpdateL"); |
|
899 |
CBrowserLauncher* launcher = CBrowserLauncher::NewLC(); |
|
900 |
// open browser with info url from jad |
|
901 |
const TDesC* url = &InfoIteratorL().GetUpdateUrlL(); |
|
902 |
||
903 |
HBufC* urlParam = HBufC::NewLC(url->Length() |
|
904 |
+ KBrowserStartContinueParam().Length()); |
|
905 |
TPtr urlParamPtr = urlParam->Des(); |
|
906 |
urlParamPtr.Append(KBrowserStartContinueParam); |
|
907 |
urlParamPtr.Append(*url); |
|
908 |
||
909 |
launcher->LaunchBrowserSyncEmbeddedL(urlParamPtr, this); |
|
910 |
||
911 |
CleanupStack::PopAndDestroy(urlParam); |
|
912 |
CleanupStack::PopAndDestroy(launcher); |
|
913 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::UpdateL"); |
|
914 |
} |
|
915 |
||
916 |
// --------------------------------------------------------------------------- |
|
917 |
// CAppMngr2MidletAppInfo::ShowInfoUrlL() |
|
918 |
// --------------------------------------------------------------------------- |
|
919 |
// |
|
920 |
void CAppMngr2MidletAppInfo::ShowInfoUrlL() |
|
921 |
{ |
|
922 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ShowInfoUrlL"); |
|
923 |
CBrowserLauncher* launcher = CBrowserLauncher::NewLC(); |
|
924 |
// open browser with info url from jad |
|
925 |
const TDesC* url = &InfoIteratorL().GetInfoUrlL(); |
|
926 |
||
927 |
HBufC* urlParam = HBufC::NewLC(url->Length() |
|
928 |
+ KBrowserStartContinueParam().Length()); |
|
929 |
TPtr urlParamPtr = urlParam->Des(); |
|
930 |
urlParamPtr.Append(KBrowserStartContinueParam); |
|
931 |
urlParamPtr.Append(*url); |
|
932 |
||
933 |
launcher->LaunchBrowserSyncEmbeddedL(urlParamPtr, this); |
|
934 |
||
935 |
CleanupStack::PopAndDestroy(urlParam); |
|
936 |
CleanupStack::PopAndDestroy(launcher); |
|
937 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ShowInfoUrlL"); |
|
938 |
} |
|
939 |
||
940 |
// --------------------------------------------------------------------------- |
|
941 |
// CAppMngr2MidletAppInfo::InfoIteratorL() |
|
942 |
// --------------------------------------------------------------------------- |
|
943 |
// |
|
944 |
CAppMngr2MidletInfoIterator& CAppMngr2MidletAppInfo::InfoIteratorL() |
|
945 |
{ |
|
946 |
if (!iInfoIterator) |
|
947 |
{ |
|
948 |
iInfoIterator = CAppMngr2MidletInfoIterator::NewL(*this, |
|
949 |
EAppMngr2StatusInstalled, iFs, iResourceHandler); |
|
950 |
} |
|
951 |
return *iInfoIterator; |
|
952 |
} |
|
953 |
||
954 |
// --------------------------------------------------------------------------- |
|
955 |
// CAppMngr2MidletAppInfo::ReadCertificatesInfoL() |
|
956 |
// --------------------------------------------------------------------------- |
|
957 |
// |
|
958 |
void CAppMngr2MidletAppInfo::ReadCertificatesInfoL() |
|
959 |
{ |
|
960 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ReadCertificatesInfoL"); |
|
961 |
if (iCertsRead) |
|
962 |
{ |
|
963 |
return; |
|
964 |
} |
|
965 |
||
966 |
// Creates certificate info |
|
967 |
for (TInt i(0); i < iEntry->NumberOfCertificateChains(); i++) |
|
968 |
{ |
|
969 |
CX509CertChain* certChain = new(ELeave)CX509CertChain(); |
|
970 |
CleanupStack::PushL(certChain); |
|
971 |
CArrayPtrFlat<CX509Certificate>* chain = NULL; |
|
972 |
// In case of leave, decode next certificate |
|
973 |
TRAPD(err, chain = certChain->DecodeCertsL(iEntry->CertificateChain(i))); |
|
974 |
if (err != KErrNone) |
|
975 |
{ |
|
976 |
CleanupStack::PopAndDestroy(certChain); |
|
977 |
continue; |
|
978 |
} |
|
979 |
CleanupStack::PushL(chain); // chain |
|
980 |
CleanupResetAndDestroyPushL(*chain); // *chain |
|
981 |
for (TInt certs(0); certs < chain->Count(); certs++) |
|
982 |
{ |
|
983 |
CX509Certificate* cert = NULL; |
|
984 |
cert = static_cast<CX509Certificate*>(chain->At(certs)); |
|
985 |
SwiUI::CommonUI::CCUICertificateInfo* commonCert = |
|
986 |
SwiUI::CommonUI::CCUICertificateInfo::NewL(*cert); |
|
987 |
iCertificates.Append(commonCert); // ownership transfered |
|
988 |
} |
|
989 |
CleanupStack::PopAndDestroy(chain); // *chain.ResetAndDestroy() |
|
990 |
CleanupStack::PopAndDestroy(chain); // chain |
|
991 |
CleanupStack::PopAndDestroy(certChain); |
|
992 |
} |
|
993 |
||
994 |
iCertsRead = ETrue; |
|
995 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ReadCertificatesInfoL"); |
|
996 |
} |
|
997 |
||
998 |
void CAppMngr2MidletAppInfo::GetAppIconL(TUid aMidletUid) |
|
999 |
{ |
|
1000 |
LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetAppIconL"); |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1001 |
|
66 | 1002 |
ASSERT(!iAppBitmap); |
1003 |
ASSERT(!iAppMask); |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1004 |
|
66 | 1005 |
RApaLsSession lsSession; |
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1006 |
User::LeaveIfError(lsSession.Connect()); |
66 | 1007 |
CleanupClosePushL(lsSession); |
1008 |
CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC(); |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1009 |
|
66 | 1010 |
TSize size = static_cast<CAppMngr2MidletRuntime&>(Runtime()).JavaRasterIconSize(); |
1011 |
TInt err = lsSession.GetAppIcon(aMidletUid, size, *apaBmp); |
|
1012 |
if (err == KErrNone) |
|
1013 |
{ |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1014 |
iAppBitmap = new (ELeave) CFbsBitmap(); |
66 | 1015 |
iAppMask = new (ELeave) CFbsBitmap(); |
1016 |
User::LeaveIfError(iAppBitmap->Duplicate(apaBmp->Handle())); |
|
1017 |
User::LeaveIfError(iAppMask->Duplicate(apaBmp->Mask()->Handle())); |
|
1018 |
} |
|
1019 |
CleanupStack::PopAndDestroy(apaBmp); |
|
1020 |
CleanupStack::PopAndDestroy(&lsSession); |
|
1021 |
||
1022 |
if (!iAppBitmap) |
|
1023 |
{ |
|
1024 |
AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), aMidletUid, |
|
1025 |
EAknsAppIconTypeList, iAppBitmap, iAppMask); |
|
1026 |
CleanupStack::Pop(2); // iAppBitmap, iAppMask |
|
1027 |
} |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1028 |
|
66 | 1029 |
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetAppIconL"); |
1030 |
} |