36 #include <s32mem.h> |
36 #include <s32mem.h> |
37 #include <s32strm.h> |
37 #include <s32strm.h> |
38 #include <s32file.h> |
38 #include <s32file.h> |
39 #include "../apgrfx/apprivate.h" |
39 #include "../apgrfx/apprivate.h" |
40 #include "apgnotif.h" |
40 #include "apgnotif.h" |
|
41 #include "ApLaunchChecker.h" |
|
42 #include "../aplist/aplapplistitem.h" |
|
43 |
|
44 #include "apsecutils.h" |
|
45 |
|
46 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
41 #include "../aplist/aplappregfinder.h" |
47 #include "../aplist/aplappregfinder.h" |
42 #include "ApLaunchChecker.h" |
|
43 #include "apsnnapps.h" |
48 #include "apsnnapps.h" |
44 #include "../aplist/aplapplistitem.h" |
49 #else |
45 |
50 #include "usif/scr/scr.h" |
46 #include "apsecutils.h" |
51 #endif |
47 |
52 |
48 const TInt KApaAppListServMaxBuffer=256; |
53 const TInt KApaAppListServMaxBuffer=256; |
49 #include "APSRECCACHE.h" |
54 #include "APSRECCACHE.h" |
50 const TInt KApaAppInfoArrayGranularity = 4; |
55 const TInt KApaAppInfoArrayGranularity = 4; |
51 const TInt KApaAppInfoDesMaxLength = sizeof(TApaAppInfo); |
56 const TInt KApaAppInfoDesMaxLength = sizeof(TApaAppInfo); |
145 self->ConstructL(); |
150 self->ConstructL(); |
146 CleanupStack::Pop(self); |
151 CleanupStack::Pop(self); |
147 return self; |
152 return self; |
148 } |
153 } |
149 |
154 |
|
155 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
150 CApaAppListServSession::CApaAppListServSession(RFs& aFs, CApaAppArcServer& aAppArcSrv, CApaAppList& aAppList) |
156 CApaAppListServSession::CApaAppListServSession(RFs& aFs, CApaAppArcServer& aAppArcSrv, CApaAppList& aAppList) |
151 : iFs(aFs), iAppArcSrv(aAppArcSrv), iAppList(aAppList), iApaAppInfoArray(KApaAppInfoArrayGranularity) |
157 : iFs(aFs), iAppArcSrv(aAppArcSrv), iAppList(aAppList), iApaAppInfoArray(KApaAppInfoArrayGranularity) |
152 { |
158 { |
153 |
159 |
154 } |
160 } |
|
161 #else |
|
162 CApaAppListServSession::CApaAppListServSession(RFs& aFs, CApaAppArcServer& aAppArcSrv, CApaAppList& aAppList) |
|
163 : iFs(aFs), iAppArcSrv(aAppArcSrv), iAppList(aAppList), iApaAppInfoArray(KApaAppInfoArrayGranularity), |
|
164 iNotificationRequested(EFalse) |
|
165 { |
|
166 |
|
167 } |
|
168 #endif |
155 |
169 |
156 void CApaAppListServSession::ConstructL() |
170 void CApaAppListServSession::ConstructL() |
157 { |
171 { |
|
172 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
158 iNonNativeApplicationsManager = CApsNonNativeApplicationsManager::NewL(iAppArcSrv,iFs); |
173 iNonNativeApplicationsManager = CApsNonNativeApplicationsManager::NewL(iAppArcSrv,iFs); |
|
174 #endif |
159 } |
175 } |
160 |
176 |
161 |
177 |
162 CApaAppListServSession::~CApaAppListServSession() |
178 CApaAppListServSession::~CApaAppListServSession() |
163 { |
179 { |
|
180 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
164 delete iNonNativeApplicationsManager; |
181 delete iNonNativeApplicationsManager; |
|
182 #endif |
165 iApaAppInfoArray.ResetAndDestroy(); |
183 iApaAppInfoArray.ResetAndDestroy(); |
166 iApaAppInfoArray.Close(); |
184 iApaAppInfoArray.Close(); |
167 } |
185 } |
168 |
186 |
169 CApaAppList& CApaAppListServSession::AppList() |
187 CApaAppList& CApaAppListServSession::AppList() |
249 break; |
267 break; |
250 case EAppListServApplicationLanguage: |
268 case EAppListServApplicationLanguage: |
251 ApplicationLanguageL(aMessage); |
269 ApplicationLanguageL(aMessage); |
252 break; |
270 break; |
253 case EAppListServAppInfoProvidedByRegistrationFile: // private OpCode for CEikApplication's use only |
271 case EAppListServAppInfoProvidedByRegistrationFile: // private OpCode for CEikApplication's use only |
|
272 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
254 AppInfoProvidedByRegistrationFileL(aMessage); |
273 AppInfoProvidedByRegistrationFileL(aMessage); |
|
274 #else |
|
275 ASSERT(0); // panic debug only |
|
276 User::Leave(KErrNotSupported); |
|
277 #endif |
255 break; |
278 break; |
256 case EAppListServAppIconFileName: |
279 case EAppListServAppIconFileName: |
257 IconFileNameL(aMessage); |
280 IconFileNameL(aMessage); |
258 break; |
281 break; |
259 case EAppListServAppViewIconFileName: |
282 case EAppListServAppViewIconFileName: |
260 ViewIconFileNameL(aMessage); |
283 ViewIconFileNameL(aMessage); |
261 break; |
284 break; |
262 case EAppListServPrepareNonNativeApplicationsUpdates: |
285 case EAppListServPrepareNonNativeApplicationsUpdates: |
|
286 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
263 iNonNativeApplicationsManager->PrepareNonNativeApplicationsUpdatesL(); |
287 iNonNativeApplicationsManager->PrepareNonNativeApplicationsUpdatesL(); |
|
288 #else |
|
289 ASSERT(0); // panic debug only |
|
290 User::Leave(KErrNotSupported); |
|
291 #endif |
264 break; |
292 break; |
265 case EAppListServRegisterNonNativeApplication: |
293 case EAppListServRegisterNonNativeApplication: |
|
294 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
266 iNonNativeApplicationsManager->RegisterNonNativeApplicationL(aMessage); |
295 iNonNativeApplicationsManager->RegisterNonNativeApplicationL(aMessage); |
|
296 #else |
|
297 ASSERT(0); // panic debug only |
|
298 User::Leave(KErrNotSupported); |
|
299 #endif |
267 break; |
300 break; |
268 case EAppListServDeregisterNonNativeApplication: |
301 case EAppListServDeregisterNonNativeApplication: |
|
302 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
269 iNonNativeApplicationsManager->DeregisterNonNativeApplicationL(aMessage); |
303 iNonNativeApplicationsManager->DeregisterNonNativeApplicationL(aMessage); |
|
304 #else |
|
305 ASSERT(0); // panic debug only |
|
306 User::Leave(KErrNotSupported); |
|
307 #endif |
270 break; |
308 break; |
271 case EAppListServCommitNonNativeApplications: |
309 case EAppListServCommitNonNativeApplications: |
|
310 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
272 iNonNativeApplicationsManager->CommitNonNativeApplicationsUpdatesL(aMessage); |
311 iNonNativeApplicationsManager->CommitNonNativeApplicationsUpdatesL(aMessage); |
273 completeMessage=EFalse; |
312 completeMessage=EFalse; |
|
313 #else |
|
314 ASSERT(0); // panic debug only |
|
315 User::Leave(KErrNotSupported); |
|
316 #endif |
274 break; |
317 break; |
275 case EAppListServRollbackNonNativeApplications: |
318 case EAppListServRollbackNonNativeApplications: |
|
319 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
276 iNonNativeApplicationsManager->RollbackNonNativeApplicationsUpdates(); |
320 iNonNativeApplicationsManager->RollbackNonNativeApplicationsUpdates(); |
|
321 #else |
|
322 ASSERT(0); // panic debug only |
|
323 User::Leave(KErrNotSupported); |
|
324 #endif |
277 break; |
325 break; |
278 case EAppListServGetAppType: |
326 case EAppListServGetAppType: |
279 GetAppTypeL(aMessage); |
327 GetAppTypeL(aMessage); |
280 break; |
328 break; |
281 case EAppListServForceRegistration: |
329 case EAppListServForceRegistration: |
282 ForceRegistrationL(aMessage); |
330 ForceRegistrationL(aMessage); |
|
331 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
283 completeMessage=EFalse; |
332 completeMessage=EFalse; |
|
333 #endif |
284 break; |
334 break; |
285 case EMatchesSecurityPolicy: |
335 case EMatchesSecurityPolicy: |
286 MatchesSecurityPolicyL(aMessage); |
336 MatchesSecurityPolicyL(aMessage); |
287 break; |
337 break; |
288 case EAppListServSetAppShortCaption: |
338 case EAppListServSetAppShortCaption: |
293 iApaAppInfoArray.ResetAndDestroy(); |
343 iApaAppInfoArray.ResetAndDestroy(); |
294 iApaAppInfoArray.Compress(); |
344 iApaAppInfoArray.Compress(); |
295 #endif |
345 #endif |
296 break; |
346 break; |
297 case EDebugAddFailingNonNativeApplicationsUpdate: |
347 case EDebugAddFailingNonNativeApplicationsUpdate: |
|
348 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
298 #ifdef _DEBUG |
349 #ifdef _DEBUG |
299 iNonNativeApplicationsManager->ForceFailInNonNativeApplicationsUpdatesL(); |
350 iNonNativeApplicationsManager->ForceFailInNonNativeApplicationsUpdatesL(); |
300 #endif |
351 #endif |
|
352 #endif |
301 break; |
353 break; |
302 case EDebugAddPanicingNonNativeApplicationsUpdate: |
354 case EDebugAddPanicingNonNativeApplicationsUpdate: |
|
355 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
303 #ifdef _DEBUG |
356 #ifdef _DEBUG |
304 iNonNativeApplicationsManager->ForcePanicInNonNativeApplicationsUpdatesL(); |
357 iNonNativeApplicationsManager->ForcePanicInNonNativeApplicationsUpdatesL(); |
305 #endif |
358 #endif |
|
359 #endif |
306 break; |
360 break; |
307 case EDebugAddRollbackPanicingNonNativeApplicationsUpdate: |
361 case EDebugAddRollbackPanicingNonNativeApplicationsUpdate: |
|
362 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
308 #ifdef _DEBUG |
363 #ifdef _DEBUG |
309 iNonNativeApplicationsManager->ForcePanicInNonNativeApplicationsRollbackL(); |
364 iNonNativeApplicationsManager->ForcePanicInNonNativeApplicationsRollbackL(); |
310 #endif |
365 #endif |
311 break; |
366 #endif |
|
367 break; |
|
368 |
|
369 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
370 case EAppListServUpdateAppList: |
|
371 UpdateAppListL(aMessage); |
|
372 break; |
|
373 case EAppListUpdatedAppsInfo: |
|
374 UpdatedAppsInfoL(aMessage); |
|
375 break; |
|
376 #endif |
312 default: |
377 default: |
313 aMessage.Panic(KApaPanicCli,EClientBadRequest); |
378 aMessage.Panic(KApaPanicCli,EClientBadRequest); |
314 break; |
379 break; |
315 } |
380 |
316 |
381 } |
|
382 |
317 if (completeMessage && !aMessage.IsNull()) |
383 if (completeMessage && !aMessage.IsNull()) |
318 aMessage.Complete(KErrNone); |
384 aMessage.Complete(KErrNone); |
319 } |
385 } |
320 |
386 |
321 |
387 |
353 delete iOpaqueData_pendingDispatchToClient; |
419 delete iOpaqueData_pendingDispatchToClient; |
354 } |
420 } |
355 |
421 |
356 void CApaAppArcServSession::ServiceL(const RMessage2& aMessage) |
422 void CApaAppArcServSession::ServiceL(const RMessage2& aMessage) |
357 { |
423 { |
|
424 #ifdef APPARC_SHOW_TRACE |
|
425 TFullName* name = new(ELeave) TFullName(); |
|
426 RThread client; |
|
427 if ( aMessage.Client( client ) == KErrNone ) |
|
428 { |
|
429 client.FullName( *name ); |
|
430 client.Close(); |
|
431 } |
|
432 RDebug::Print( _L("[Apparc] CApaAppListServSession::ServiceL(0x%08x) - START - op code: %04d, client: %S"), this, aMessage.Function(), name ); |
|
433 delete name; |
|
434 #endif |
|
435 |
358 TBool completeMessage = ETrue; |
436 TBool completeMessage = ETrue; |
359 switch (aMessage.Function()) |
437 switch (aMessage.Function()) |
360 { |
438 { |
361 case EAppListServStartAppWithoutReturningThreadId: |
439 case EAppListServStartAppWithoutReturningThreadId: |
362 ASSERT(0); // panic debug only |
440 ASSERT(0); // panic debug only |
470 const TUid serviceUid(TUid::Uid(aMessage.Int1())); |
548 const TUid serviceUid(TUid::Uid(aMessage.Int1())); |
471 AppForDocumentPassedByFileHandleL(aMessage, &serviceUid); |
549 AppForDocumentPassedByFileHandleL(aMessage, &serviceUid); |
472 } |
550 } |
473 break; |
551 break; |
474 case EAppListServRegisterNonNativeApplicationType: |
552 case EAppListServRegisterNonNativeApplicationType: |
|
553 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
475 RegisterNonNativeApplicationTypeL(aMessage); |
554 RegisterNonNativeApplicationTypeL(aMessage); |
|
555 #else |
|
556 ASSERT(0); // panic debug only |
|
557 User::Leave(KErrNotSupported); |
|
558 #endif |
476 break; |
559 break; |
477 case EAppListServDeregisterNonNativeApplicationType: |
560 case EAppListServDeregisterNonNativeApplicationType: |
|
561 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
478 DeregisterNonNativeApplicationTypeL(aMessage); |
562 DeregisterNonNativeApplicationTypeL(aMessage); |
|
563 #else |
|
564 ASSERT(0); // panic debug only |
|
565 User::Leave(KErrNotSupported); |
|
566 #endif |
479 break; |
567 break; |
480 case EAppListServPreferredBufSize: |
568 case EAppListServPreferredBufSize: |
481 aMessage.Complete(PreferredBufSize()); |
569 aMessage.Complete(PreferredBufSize()); |
482 break; |
570 break; |
483 case EAppListServRecognizeFiles: |
571 case EAppListServRecognizeFiles: |
534 REComSession::FinalClose(); |
622 REComSession::FinalClose(); |
535 #endif |
623 #endif |
536 break; |
624 break; |
537 default: |
625 default: |
538 iAppListSession->DoServiceL(aMessage); |
626 iAppListSession->DoServiceL(aMessage); |
|
627 #ifdef APPARC_SHOW_TRACE |
|
628 RDebug::Print( _L("[Apparc] CApaAppListServSession::ServiceL(0x%08x) - END - op code: %04d, completeMessage: %d"), this, aMessage.Function(), completeMessage ); |
|
629 #endif |
539 return; |
630 return; |
540 } |
631 } |
541 |
632 |
|
633 #ifdef APPARC_SHOW_TRACE |
|
634 RDebug::Print( _L("[Apparc] CApaAppListServSession::ServiceL(0x%08x) - END - op code: %04d, completeMessage: %d"), this, aMessage.Function(), completeMessage ); |
|
635 #endif |
542 if (completeMessage && !aMessage.IsNull()) |
636 if (completeMessage && !aMessage.IsNull()) |
543 aMessage.Complete(KErrNone); |
637 aMessage.Complete(KErrNone); |
544 } |
638 } |
545 |
639 |
546 |
640 |
564 TInt preferredBufferSize = 0; |
658 TInt preferredBufferSize = 0; |
565 TRAPD(err, preferredBufferSize = iServ.DataRecognizerPreferredBufSizeL()); |
659 TRAPD(err, preferredBufferSize = iServ.DataRecognizerPreferredBufSizeL()); |
566 return (err==KErrNone) ? Min(iMaxBufSize, preferredBufferSize) : iMaxBufSize; |
660 return (err==KErrNone) ? Min(iMaxBufSize, preferredBufferSize) : iMaxBufSize; |
567 } |
661 } |
568 |
662 |
|
663 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
569 void CApaAppArcServSession::RegisterNonNativeApplicationTypeL(const RMessage2& aMessage) |
664 void CApaAppArcServSession::RegisterNonNativeApplicationTypeL(const RMessage2& aMessage) |
570 { |
665 { |
571 const TUid applicationType(TUid::Uid(aMessage.Int0())); |
666 const TUid applicationType(TUid::Uid(aMessage.Int0())); |
572 HBufC* const nativeExecutable=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1))); |
667 HBufC* const nativeExecutable=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1))); |
573 {TPtr nativeExecutable_asWritable(nativeExecutable->Des()); |
668 {TPtr nativeExecutable_asWritable(nativeExecutable->Des()); |
579 void CApaAppArcServSession::DeregisterNonNativeApplicationTypeL(const RMessage2& aMessage) |
674 void CApaAppArcServSession::DeregisterNonNativeApplicationTypeL(const RMessage2& aMessage) |
580 { |
675 { |
581 const TUid applicationType(TUid::Uid(aMessage.Int0())); |
676 const TUid applicationType(TUid::Uid(aMessage.Int0())); |
582 iServ.DeregisterNonNativeApplicationTypeL(applicationType); |
677 iServ.DeregisterNonNativeApplicationTypeL(applicationType); |
583 } |
678 } |
|
679 #endif |
584 |
680 |
585 void CApaAppListServSession::GetAppTypeL(const RMessage2& aMessage) |
681 void CApaAppListServSession::GetAppTypeL(const RMessage2& aMessage) |
586 { |
682 { |
|
683 const TUid KTypeIDToNonNativeUidMapping[2][2]={ {TUid::Uid(0xB031C52A), TUid::Uid(0x10210E26)}, //Java |
|
684 {TUid::Uid(0x7BDB6DA1), TUid::Uid(0x10282821)}}; //Widget |
|
685 |
587 TInt uid = aMessage.Int0(); |
686 TInt uid = aMessage.Int0(); |
588 CApaAppData* appData = iAppList.AppDataByUid(TUid::Uid(uid)); |
687 CApaAppData* appData = iAppList.AppDataByUid(TUid::Uid(uid)); |
589 if (!appData) |
688 if (!appData) |
|
689 { |
590 aMessage.Complete(KErrNotFound); |
690 aMessage.Complete(KErrNotFound); |
|
691 } |
591 else |
692 else |
592 { |
693 { |
593 TPckgBuf<TUid> typeUid(appData->NonNativeApplicationType()); |
694 TUid typeId(appData->NonNativeApplicationType()); |
594 aMessage.WriteL(1,typeUid); |
695 |
|
696 //Check if non-native type to non-native UID mapping available. Otherwise |
|
697 //return whatever returned by NonNativeApplicationType. |
|
698 TUid nonNativeUid=typeId; |
|
699 TInt numMappings= (sizeof(KTypeIDToNonNativeUidMapping)/ (2*sizeof(TUid))); |
|
700 |
|
701 for(TInt index=0; index<numMappings; index++) |
|
702 { |
|
703 if(typeId == KTypeIDToNonNativeUidMapping[index][0]) |
|
704 { |
|
705 nonNativeUid = KTypeIDToNonNativeUidMapping[index][1]; |
|
706 break; |
|
707 } |
|
708 } |
|
709 |
|
710 TPckgBuf<TUid> nonNativeUidBuf(nonNativeUid); |
|
711 aMessage.WriteL(1,nonNativeUidBuf); |
595 aMessage.Complete(KErrNone); |
712 aMessage.Complete(KErrNone); |
596 } |
713 } |
597 } |
714 } |
598 |
715 |
|
716 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
717 void CleanupAndDestroyAppInfoArray(TAny* aRPArray) |
|
718 { |
|
719 RPointerArray<Usif::CApplicationRegistrationData>* rpArray = (static_cast<RPointerArray<Usif::CApplicationRegistrationData>*>(aRPArray)); |
|
720 rpArray->ResetAndDestroy(); |
|
721 rpArray->Close(); |
|
722 } |
|
723 #endif |
|
724 |
599 void CApaAppListServSession::ForceRegistrationL(const RMessage2& aMessage) |
725 void CApaAppListServSession::ForceRegistrationL(const RMessage2& aMessage) |
600 { |
726 { |
|
727 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
601 TInt bufferSize = aMessage.GetDesLength(0); |
728 TInt bufferSize = aMessage.GetDesLength(0); |
602 User::LeaveIfError(bufferSize); |
729 User::LeaveIfError(bufferSize); |
603 HBufC8* const buffer=HBufC8::NewLC(bufferSize); |
730 HBufC8* const buffer=HBufC8::NewLC(bufferSize); |
604 TPtr8 buffer_asWritable(buffer->Des()); |
731 TPtr8 buffer_asWritable(buffer->Des()); |
605 aMessage.ReadL(0,buffer_asWritable); |
732 aMessage.ReadL(0,buffer_asWritable); |
621 CleanupStack::PopAndDestroy(buffer); |
748 CleanupStack::PopAndDestroy(buffer); |
622 |
749 |
623 // Trigger a rescan, when rescan completes it will complete iNotifyOnScanCompleteMsg |
750 // Trigger a rescan, when rescan completes it will complete iNotifyOnScanCompleteMsg |
624 iNotifyOnScanCompleteMsg=aMessage; |
751 iNotifyOnScanCompleteMsg=aMessage; |
625 iAppArcSrv.UpdateAppsByForceRegistration(); |
752 iAppArcSrv.UpdateAppsByForceRegistration(); |
626 } |
753 #else |
627 |
754 const TUid KUidSisLaunchServer={0x1020473f}; |
|
755 |
|
756 if(aMessage.SecureId().iId != KUidSisLaunchServer.iUid) |
|
757 User::Leave(KErrNotSupported); |
|
758 |
|
759 //Get the size of the updated apps info buffer |
|
760 TInt bufferSize = aMessage.GetDesLength(0); |
|
761 |
|
762 //Allocate the buffer of bufferSize and read. |
|
763 HBufC8* const buffer=HBufC8::NewLC(bufferSize); |
|
764 TPtr8 buffer_asWritable(buffer->Des()); |
|
765 aMessage.ReadL(0,buffer_asWritable); |
|
766 |
|
767 RDesReadStream readStream(*buffer); |
|
768 CleanupClosePushL(readStream); |
|
769 |
|
770 //Read the number of application information available in the buffer. |
|
771 const TUint count=readStream.ReadUint32L(); |
|
772 |
|
773 RPointerArray<Usif::CApplicationRegistrationData> appsInfo; |
|
774 TCleanupItem cleanup(CleanupAndDestroyAppInfoArray, &appsInfo); |
|
775 CleanupStack::PushL(cleanup); |
|
776 |
|
777 //Read one applciation information at a time and create list of application information. |
|
778 for(TUint index=0; index<count; index++) |
|
779 { |
|
780 Usif::CApplicationRegistrationData* appData= Usif::CApplicationRegistrationData::NewL(); |
|
781 CleanupStack::PushL(appData); |
|
782 readStream>>*appData; |
|
783 appsInfo.AppendL(appData); |
|
784 CleanupStack::Pop(appData); |
|
785 } |
|
786 CleanupStack::Pop(); //Remove cleanup |
|
787 CleanupStack::PopAndDestroy(2, buffer); //delete readStream, buffer |
|
788 |
|
789 iAppList.UpdateApplistByForceRegAppsL(appsInfo); |
|
790 #endif |
|
791 } |
|
792 |
628 void CApaAppArcServSession::AppForDocumentPassedByFileHandleL(const RMessage2& aMessage, const TUid* aServiceUid) |
793 void CApaAppArcServSession::AppForDocumentPassedByFileHandleL(const RMessage2& aMessage, const TUid* aServiceUid) |
629 { |
794 { |
630 #if defined(__PROFILE) |
795 #if defined(__PROFILE) |
631 TProfile profile; |
796 TProfile profile; |
632 RDebug::ProfileReset(5,1); |
797 RDebug::ProfileReset(5,1); |
755 TApaAppEntry dummy; |
920 TApaAppEntry dummy; |
756 CApaAppData* app = NULL; |
921 CApaAppData* app = NULL; |
757 if (!FindAppInList(app, dummy, aUid)) |
922 if (!FindAppInList(app, dummy, aUid)) |
758 User::Leave(KErrNotFound); |
923 User::Leave(KErrNotFound); |
759 |
924 |
760 return *app; |
925 return *app; |
761 } |
926 } |
|
927 |
|
928 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
929 /** |
|
930 locate app in list, return EFalse if it isn't present |
|
931 search is regardless of screen mode. |
|
932 @internalComponent |
|
933 */ |
|
934 TBool CApaAppListServSession::FindAppInList(CApaAppData*& aApp, TApaAppEntry& aEntry, TUid aAppUid) |
|
935 { |
|
936 // Look for the app with aAppUid in the applist we keep |
|
937 const CApaAppList& list = iAppList; |
|
938 aApp = list.AppDataByUid(aAppUid); |
|
939 if (aApp) |
|
940 aEntry = aApp->AppEntry(); |
|
941 |
|
942 // If the app list is currently in flux, try to nail down the app by looking for it specifically |
|
943 const TBool appPendingOnLangChange = (aApp && list.IsLanguageChangePending() && aApp->IsPending()); |
|
944 |
|
945 if ((!aApp || appPendingOnLangChange) && !list.IsIdleUpdateComplete()) |
|
946 { |
|
947 // 1. App wasn't found, but an app scan is currently in progress, |
|
948 // so try to find and add the specific app we're looking for to the list |
|
949 |
|
950 // 2. On language change event, current app scan could not yet update the found app, |
|
951 // so try to update the specific app we're looking for, in the list. |
|
952 if(aAppUid != KNullUid) |
|
953 { |
|
954 CApaAppData* app = NULL; |
|
955 TRAPD(err, app = FindSpecificAppL(aAppUid)); |
|
956 if (!err && app) |
|
957 { |
|
958 // app has been found and added to the app list |
|
959 aApp = app; |
|
960 aEntry = aApp->AppEntry(); |
|
961 } |
|
962 } |
|
963 } |
|
964 |
|
965 return (aApp != NULL); |
|
966 } |
|
967 |
|
968 #else |
|
969 /** |
|
970 locate app in list, return EFalse if it isn't present |
|
971 search is regardless of screen mode. |
|
972 @internalComponent |
|
973 */ |
|
974 TBool CApaAppListServSession::FindAppInList(CApaAppData*& aApp, TApaAppEntry& aEntry, TUid aAppUid) |
|
975 { |
|
976 // Look for the application with aAppUid in the applist |
|
977 const CApaAppList& list = iAppList; |
|
978 aApp = list.AppDataByUid(aAppUid); |
|
979 |
|
980 TBool appListChanging= (list.IsLanguageChangePending()||!list.IsIdleUpdateComplete()); |
|
981 //If the application is not in the applist and applist is still getting updated then find the |
|
982 //requested application specifically and add to applist. |
|
983 TInt err=KErrNone; |
|
984 if( (!aApp && appListChanging) || (aApp && aApp->IsLangChangePending())) |
|
985 TRAP(err, aApp=FindSpecificAppL(aAppUid)); |
|
986 |
|
987 if (!err && aApp) |
|
988 aEntry = aApp->AppEntry(); |
|
989 |
|
990 return (aApp != NULL); |
|
991 } |
|
992 |
|
993 #endif |
762 |
994 |
763 void CApaAppListServSession::SendArrayL(const MArrayItemWriter& aArrayItemWriter,const RMessage2& aMessage) const |
995 void CApaAppListServSession::SendArrayL(const MArrayItemWriter& aArrayItemWriter,const RMessage2& aMessage) const |
764 { |
996 { |
765 const TInt sizeOfBuffer=aMessage.Int1(); |
997 const TInt sizeOfBuffer=aMessage.Int1(); |
766 const TInt arrayItemCount=aArrayItemWriter.ArrayItemCount(); |
998 const TInt arrayItemCount=aArrayItemWriter.ArrayItemCount(); |
1025 priority = KDataTypePriorityNormal; |
1257 priority = KDataTypePriorityNormal; |
1026 } |
1258 } |
1027 } |
1259 } |
1028 else |
1260 else |
1029 { |
1261 { |
|
1262 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1263 Usif::RSoftwareComponentRegistry scrCon; |
|
1264 User::LeaveIfError(scrCon.Connect()); |
|
1265 CleanupClosePushL(scrCon); |
|
1266 TApaAppEntry appEntry=appData->AppEntry(); |
|
1267 |
|
1268 //If component id of an application is non-zero then it is installed by installer |
|
1269 //after phone marketed. |
|
1270 TBool isInstalledApp=(scrCon.GetComponentIdForAppL(appEntry.iUidType[2])!=0); |
|
1271 |
|
1272 //data priority for UnTrusted apps would be capped if it is greater than the threshold priority i.e, KMaxTInt16. |
|
1273 if (!isSidTrusted && isInstalledApp) |
|
1274 { |
|
1275 priority = KDataTypeUnTrustedPriorityThreshold; |
|
1276 } |
|
1277 CleanupStack::PopAndDestroy(); //scrCon |
|
1278 #else |
1030 TPtrC registrationFilePath = appData->RegistrationFileName(); |
1279 TPtrC registrationFilePath = appData->RegistrationFileName(); |
1031 TInt match = registrationFilePath.MatchF ( |
1280 TInt match = registrationFilePath.MatchF ( |
1032 KLitPathForUntrustedRegistrationResourceFiles ); |
1281 KLitPathForUntrustedRegistrationResourceFiles ); |
1033 //Check if registration file is in path for untrusted apps |
1282 //Check if registration file is in path for untrusted apps |
1034 //and its SID is untrusted |
1283 //and its SID is untrusted |
1205 aInfo.iCaption = app->Caption(); |
1455 aInfo.iCaption = app->Caption(); |
1206 aInfo.iShortCaption = app->ShortCaption(); |
1456 aInfo.iShortCaption = app->ShortCaption(); |
1207 } |
1457 } |
1208 |
1458 |
1209 TPtrC8 CApaAppArcServSession::DoRecognizeUnpackLC(HBufC*& aName, RChunk& aLocalChunk, const RMessage2& aMessage) |
1459 TPtrC8 CApaAppArcServSession::DoRecognizeUnpackLC(HBufC*& aName, RChunk& aLocalChunk, const RMessage2& aMessage) |
1210 { |
1460 { |
1211 ASSERT(aName==NULL); |
1461 ASSERT(aName==NULL); |
1212 |
1462 |
1213 aName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1))); |
1463 aName=HBufC::NewLC(User::LeaveIfError(aMessage.GetDesLength(1))); |
1214 TPtr name(aName->Des()); |
1464 TPtr name(aName->Des()); |
1215 aMessage.ReadL(1, name); |
1465 aMessage.ReadL(1, name); |
1242 User::Leave(error); |
1492 User::Leave(error); |
1243 } |
1493 } |
1244 |
1494 |
1245 TPtrC8 bufPtr(NULL,0); //Never executed. To make compiler happy |
1495 TPtrC8 bufPtr(NULL,0); //Never executed. To make compiler happy |
1246 return bufPtr; |
1496 return bufPtr; |
1247 } |
1497 } |
1248 |
1498 |
1249 void CApaAppArcServSession::RecognizeDataL(const RMessage2& aMessage) |
1499 void CApaAppArcServSession::RecognizeDataL(const RMessage2& aMessage) |
1250 // Recognize the data type of an object |
1500 // Recognize the data type of an object |
1251 { |
1501 { |
1252 HBufC* name=NULL; |
1502 HBufC* name=NULL; |
1253 RChunk localChunk; |
1503 RChunk localChunk; |
1254 |
1504 |
1255 TPtrC8 bufPtr=DoRecognizeUnpackLC(name, localChunk, aMessage); |
1505 TPtrC8 bufPtr=DoRecognizeUnpackLC(name, localChunk, aMessage); |
1256 |
1506 |
1257 const TDataRecognitionResult result = iServ.RecognizeDataL(*name, bufPtr); |
1507 const TDataRecognitionResult result = iServ.RecognizeDataL(*name, bufPtr); |
1258 |
1508 |
1259 CleanupStack::PopAndDestroy(2); // name & buffer or localChunk |
1509 CleanupStack::PopAndDestroy(2); // name & buffer or localChunk |
1260 aMessage.WriteL(0,TPckgC<TDataRecognitionResult>(result)); |
1510 aMessage.WriteL(0,TPckgC<TDataRecognitionResult>(result)); |
1261 } |
1511 } |
1262 |
1512 |
1263 |
1513 |
1264 void CApaAppArcServSession::RecognizeFilesL(const RMessage2& aMessage) |
1514 void CApaAppArcServSession::RecognizeFilesL(const RMessage2& aMessage) |
1265 { |
1515 { |
1266 // if there is an outstanding async. request, we even don't allow |
1516 // if there is an outstanding async. request, we even don't allow |
1531 aMessage.WriteL(0, TPckgC<TDataRecognitionResult>(result)); |
1781 aMessage.WriteL(0, TPckgC<TDataRecognitionResult>(result)); |
1532 } |
1782 } |
1533 |
1783 |
1534 void CApaAppArcServSession::RecognizeSpecificDataL(const RMessage2& aMessage) |
1784 void CApaAppArcServSession::RecognizeSpecificDataL(const RMessage2& aMessage) |
1535 // Determine whether an object is of a specific data type |
1785 // Determine whether an object is of a specific data type |
1536 { |
1786 { |
1537 HBufC* name=NULL; |
1787 HBufC* name=NULL; |
1538 RChunk localChunk; |
1788 RChunk localChunk; |
1539 |
1789 |
1540 TPtrC8 bufPtr=DoRecognizeUnpackLC(name, localChunk, aMessage); |
1790 TPtrC8 bufPtr=DoRecognizeUnpackLC(name, localChunk, aMessage); |
1541 TDataType dataType; |
1791 TDataType dataType; |
1542 {TPckg<TDataType> dataType_asDescriptor(dataType); |
1792 {TPckg<TDataType> dataType_asDescriptor(dataType); |
1543 aMessage.ReadL(0, dataType_asDescriptor);} |
1793 aMessage.ReadL(0, dataType_asDescriptor);} |
1544 aMessage.Complete(iServ.RecognizeDataL(*name,bufPtr,dataType)); |
1794 aMessage.Complete(iServ.RecognizeDataL(*name,bufPtr,dataType)); |
1545 CleanupStack::PopAndDestroy(2); // name & buffer or localChunk |
1795 CleanupStack::PopAndDestroy(2); // name & buffer or localChunk |
1546 } |
1796 } |
1547 |
1797 |
1548 void CApaAppArcServSession::RecognizeSpecificDataPassedByFileHandleL(const RMessage2& aMessage) |
1798 void CApaAppArcServSession::RecognizeSpecificDataPassedByFileHandleL(const RMessage2& aMessage) |
1549 { |
1799 { |
1550 RFile file; |
1800 RFile file; |
1551 CleanupClosePushL(file); |
1801 CleanupClosePushL(file); |
1700 TApaAppCapabilityBuf capabilityBuf; |
1950 TApaAppCapabilityBuf capabilityBuf; |
1701 aAppData.Capability(capabilityBuf); |
1951 aAppData.Capability(capabilityBuf); |
1702 return (capabilityBuf().iAttributes & TApaAppCapability::EControlPanelItem); |
1952 return (capabilityBuf().iAttributes & TApaAppCapability::EControlPanelItem); |
1703 } |
1953 } |
1704 |
1954 |
1705 /** |
|
1706 locate app in list, return EFalse if it isn't present |
|
1707 search is regardless of screen mode. |
|
1708 @internalComponent |
|
1709 */ |
|
1710 TBool CApaAppListServSession::FindAppInList(CApaAppData*& aApp, TApaAppEntry& aEntry, TUid aAppUid) |
|
1711 { |
|
1712 // Look for the app with aAppUid in the app list we keep |
|
1713 const CApaAppList& list = iAppList; |
|
1714 aApp = list.AppDataByUid(aAppUid); |
|
1715 if (aApp) |
|
1716 aEntry = aApp->AppEntry(); |
|
1717 |
|
1718 // If the app list is currently in flux, try to nail down the app by looking for it specifically |
|
1719 const TBool appPendingOnLangChange = (aApp && list.IsLanguageChangePending() && aApp->IsPending()); |
|
1720 if ((!aApp || appPendingOnLangChange) && !list.IsIdleUpdateComplete()) |
|
1721 { |
|
1722 // 1. App wasn't found, but an app scan is currently in progress, |
|
1723 // so try to find and add the specific app we're looking for to the list |
|
1724 |
|
1725 // 2. On language change event, current app scan could not yet update the found app, |
|
1726 // so try to update the specific app we're looking for, in the list. |
|
1727 if(aAppUid != KNullUid) |
|
1728 { |
|
1729 CApaAppData* app = NULL; |
|
1730 TRAPD(err, app = FindSpecificAppL(aAppUid)); |
|
1731 if (!err && app) |
|
1732 { |
|
1733 // app has been found and added to the app list |
|
1734 aApp = app; |
|
1735 aEntry = aApp->AppEntry(); |
|
1736 } |
|
1737 } |
|
1738 } |
|
1739 |
|
1740 return (aApp != NULL); |
|
1741 } |
|
1742 |
1955 |
1743 CApaAppData* CApaAppListServSession::FindSpecificAppL(TUid aAppUid) |
1956 CApaAppData* CApaAppListServSession::FindSpecificAppL(TUid aAppUid) |
1744 { |
1957 { |
1745 //Scans the drives and folder lists for the specific app |
1958 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
1746 CApaAppRegFinder* regFinder = CApaAppRegFinder::NewLC(iFs); |
1959 CApaAppData* app = iAppList.FindAndAddSpecificAppL(aAppUid); |
1747 CApaAppData* app = iAppList.FindAndAddSpecificAppL(regFinder, aAppUid); |
1960 #else |
1748 CleanupStack::PopAndDestroy(regFinder); |
1961 //Scans the drives and folder lists for the specific app |
|
1962 CApaAppRegFinder* regFinder = CApaAppRegFinder::NewLC(iFs); |
|
1963 CApaAppData* app = iAppList.FindAndAddSpecificAppL(regFinder, aAppUid); |
|
1964 CleanupStack::PopAndDestroy(regFinder); |
|
1965 #endif |
1749 return app; |
1966 return app; |
1750 } |
1967 } |
1751 |
1968 |
1752 void CApaAppListServSession::GetAppInfoL(const RMessage2& aMessage) |
1969 void CApaAppListServSession::GetAppInfoL(const RMessage2& aMessage) |
1753 { |
1970 { |
1789 if (!iNotifyMessage.IsNull()) |
2006 if (!iNotifyMessage.IsNull()) |
1790 aMessage.Panic(KApaPanicCli,ENotifierAlreadyPresent); |
2007 aMessage.Panic(KApaPanicCli,ENotifierAlreadyPresent); |
1791 else |
2008 else |
1792 { |
2009 { |
1793 const TBool completeImmediatelyIfNoScanImpendingOrInProgress=aMessage.Int0(); |
2010 const TBool completeImmediatelyIfNoScanImpendingOrInProgress=aMessage.Int0(); |
1794 if ((!completeImmediatelyIfNoScanImpendingOrInProgress) || |
2011 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
1795 iAppArcSrv.AppFsMonitor().AnyNotificationImpending() || |
2012 if ((!completeImmediatelyIfNoScanImpendingOrInProgress) || |
1796 iAppList.AppScanInProgress()) |
2013 iAppList.AppScanInProgress()) |
|
2014 #else |
|
2015 if ((!completeImmediatelyIfNoScanImpendingOrInProgress) || |
|
2016 iAppArcSrv.AppFsMonitor().AnyNotificationImpending() || |
|
2017 iAppList.AppScanInProgress()) |
|
2018 #endif |
1797 iNotifyMessage=aMessage; |
2019 iNotifyMessage=aMessage; |
1798 else |
2020 else |
1799 aMessage.Complete(KErrNone); |
2021 aMessage.Complete(KErrNone); |
1800 } |
2022 } |
1801 } |
2023 |
1802 |
2024 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2025 iNotificationRequested=ETrue; |
|
2026 #endif |
|
2027 } |
|
2028 |
|
2029 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2030 void CApaAppArcServSession::NotifyClients(TInt aReason, CArrayFixFlat<TApaAppUpdateInfo>* aUpdatedAppsInfo) |
|
2031 #else |
1803 void CApaAppArcServSession::NotifyClients(TInt aReason) |
2032 void CApaAppArcServSession::NotifyClients(TInt aReason) |
1804 { |
2033 #endif |
1805 iAppListSession->NotifyClients(aReason); |
2034 |
1806 } |
2035 { |
|
2036 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2037 iAppListSession->NotifyClients(aReason, aUpdatedAppsInfo); |
|
2038 #else |
|
2039 iAppListSession->NotifyClients(aReason); |
|
2040 #endif |
|
2041 } |
|
2042 |
1807 |
2043 |
1808 void CApaAppListServSession::CancelNotify() |
2044 void CApaAppListServSession::CancelNotify() |
1809 { |
2045 { |
|
2046 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2047 NotifyClients(KErrCancel, NULL); |
|
2048 #else |
1810 NotifyClients(KErrCancel); |
2049 NotifyClients(KErrCancel); |
1811 } |
2050 #endif |
1812 |
2051 } |
|
2052 |
|
2053 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2054 void CApaAppListServSession::NotifyClients(TInt aReason, CArrayFixFlat<TApaAppUpdateInfo>* aUpdatedAppsInfo) |
|
2055 #else |
1813 void CApaAppListServSession::NotifyClients(TInt aReason) |
2056 void CApaAppListServSession::NotifyClients(TInt aReason) |
|
2057 #endif |
1814 { |
2058 { |
1815 if (!iNotifyMessage.IsNull()) |
2059 if (!iNotifyMessage.IsNull()) |
1816 iNotifyMessage.Complete(aReason); |
2060 iNotifyMessage.Complete(aReason); |
1817 |
2061 |
1818 //Notify client for scan complete. |
2062 //Notify client for scan complete. |
1819 NotifyScanComplete(); |
2063 NotifyScanComplete(); |
1820 } |
2064 |
1821 |
2065 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2066 if(aUpdatedAppsInfo && iNotificationRequested) |
|
2067 { |
|
2068 //Append the updated applications information to iAppsUpdated |
|
2069 TInt count=aUpdatedAppsInfo->Count(); |
|
2070 for(TInt index=0; index<count; index++) |
|
2071 { |
|
2072 TRAPD(err, iAppsUpdated.AppendL((*aUpdatedAppsInfo)[index])); |
|
2073 if(err != KErrNone) |
|
2074 { |
|
2075 iAppsUpdated.Reset(); |
|
2076 break; |
|
2077 } |
|
2078 } |
|
2079 } |
|
2080 #endif |
|
2081 } |
|
2082 |
|
2083 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
1822 void CApaAppListServSession::AppInfoProvidedByRegistrationFileL(const RMessage2& aMessage) |
2084 void CApaAppListServSession::AppInfoProvidedByRegistrationFileL(const RMessage2& aMessage) |
1823 { |
2085 { |
1824 // get UID of required app |
2086 // get UID of required app |
1825 const TUid uid = TUid::Uid(aMessage.Int0()); |
2087 const TUid uid = TUid::Uid(aMessage.Int0()); |
1826 |
2088 |
1829 |
2091 |
1830 const TBool registrationFileUsed = app.RegistrationFileUsed(); |
2092 const TBool registrationFileUsed = app.RegistrationFileUsed(); |
1831 TPckgC<TBool> pckg(registrationFileUsed); |
2093 TPckgC<TBool> pckg(registrationFileUsed); |
1832 aMessage.WriteL(1, pckg); |
2094 aMessage.WriteL(1, pckg); |
1833 } |
2095 } |
|
2096 #endif |
|
2097 |
1834 |
2098 |
1835 void CApaAppListServSession::IconFileNameL(const RMessage2& aMessage) |
2099 void CApaAppListServSession::IconFileNameL(const RMessage2& aMessage) |
1836 { |
2100 { |
1837 // get UID of required app |
2101 // get UID of required app |
1838 const TUid uid=TUid::Uid(aMessage.Int0()); |
2102 const TUid uid=TUid::Uid(aMessage.Int0()); |
1839 |
2103 |
1840 // locate app in list |
2104 // locate app in list |
1841 const CApaAppData& app = FindAppInListL(uid); |
2105 const CApaAppData& app = FindAppInListL(uid); |
1842 |
2106 |
1843 if (!app.RegistrationFileUsed()) |
2107 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
1844 User::Leave(KErrNotSupported); |
2108 if (!app.RegistrationFileUsed()) |
1845 else |
2109 User::Leave(KErrNotSupported); |
1846 { |
2110 else |
1847 TPtrC iconFileName(app.IconFileName()); |
2111 { |
1848 if (iconFileName.Length() == 0) |
2112 #endif |
1849 User::Leave(KErrNotFound); |
2113 |
1850 else |
2114 TPtrC iconFileName(app.IconFileName()); |
1851 { |
2115 if (iconFileName.Length() == 0) |
1852 TFileName fileName = iconFileName; |
2116 User::Leave(KErrNotFound); |
1853 TPckgC<TFileName> pckg(fileName); |
2117 else |
1854 aMessage.WriteL(1, pckg); |
2118 { |
1855 } |
2119 TFileName fileName = iconFileName; |
1856 } |
2120 TPckgC<TFileName> pckg(fileName); |
|
2121 aMessage.WriteL(1, pckg); |
|
2122 } |
|
2123 |
|
2124 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2125 } |
|
2126 #endif |
|
2127 |
1857 } |
2128 } |
1858 |
2129 |
1859 void CApaAppListServSession::ViewIconFileNameL(const RMessage2& aMessage) |
2130 void CApaAppListServSession::ViewIconFileNameL(const RMessage2& aMessage) |
1860 { |
2131 { |
1861 // get UID of required app |
2132 // get UID of required app |
1866 TPtrC viewIconFileName; |
2137 TPtrC viewIconFileName; |
1867 |
2138 |
1868 // locate app in list |
2139 // locate app in list |
1869 const CApaAppData& app = FindAppInListL(uid); |
2140 const CApaAppData& app = FindAppInListL(uid); |
1870 |
2141 |
1871 if (!app.RegistrationFileUsed()) |
2142 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
1872 User::Leave(KErrNotSupported); |
2143 if (!app.RegistrationFileUsed()) |
1873 else |
2144 User::Leave(KErrNotSupported); |
1874 { |
2145 else |
1875 const CArrayPtr<CApaAppViewData>& viewDataArray = *app.Views(); |
2146 { |
1876 const TInt count = viewDataArray.Count(); |
2147 #endif |
1877 for (TInt ii=0; ii<count; ii++) |
2148 |
1878 { |
2149 const CArrayPtr<CApaAppViewData>& viewDataArray = *app.Views(); |
1879 const CApaAppViewData& appViewData = *viewDataArray[ii]; |
2150 const TInt count = viewDataArray.Count(); |
1880 if (appViewData.Uid() == viewUid) |
2151 for (TInt ii=0; ii<count; ii++) |
1881 { |
2152 { |
1882 viewIconFileName.Set(appViewData.IconFileName()); |
2153 const CApaAppViewData& appViewData = *viewDataArray[ii]; |
1883 break; |
2154 if (appViewData.Uid() == viewUid) |
1884 } |
2155 { |
1885 } |
2156 viewIconFileName.Set(appViewData.IconFileName()); |
1886 |
2157 break; |
1887 if (viewIconFileName.Length() == 0) |
2158 } |
1888 User::Leave(KErrNotFound); |
2159 } |
1889 else |
2160 |
1890 { |
2161 if (viewIconFileName.Length() == 0) |
1891 TFileName fileName = viewIconFileName; |
2162 User::Leave(KErrNotFound); |
1892 TPckgC<TFileName> pckg(fileName); |
2163 else |
1893 aMessage.WriteL(2, pckg); |
2164 { |
1894 } |
2165 TFileName fileName = viewIconFileName; |
1895 } |
2166 TPckgC<TFileName> pckg(fileName); |
|
2167 aMessage.WriteL(2, pckg); |
|
2168 } |
|
2169 |
|
2170 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2171 } |
|
2172 #endif |
|
2173 |
1896 } |
2174 } |
1897 |
2175 |
1898 void CApaAppArcServSession::GetAppServicesL(const RMessage2& aMessage) |
2176 void CApaAppArcServSession::GetAppServicesL(const RMessage2& aMessage) |
1899 { |
2177 { |
1900 const TInt initialBufSize = aMessage.Int2(); |
2178 const TInt initialBufSize = aMessage.Int2(); |
2089 //See if the session is intrested in scan complete notification. |
2367 //See if the session is intrested in scan complete notification. |
2090 if (!iNotifyOnScanCompleteMsg.IsNull()) |
2368 if (!iNotifyOnScanCompleteMsg.IsNull()) |
2091 { |
2369 { |
2092 iNotifyOnScanCompleteMsg.Complete(KErrNone); |
2370 iNotifyOnScanCompleteMsg.Complete(KErrNone); |
2093 } |
2371 } |
|
2372 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
2094 iNonNativeApplicationsManager->NotifyScanComplete(); |
2373 iNonNativeApplicationsManager->NotifyScanComplete(); |
|
2374 #endif |
2095 } //lint !e1762 Suppress member function could be made const |
2375 } //lint !e1762 Suppress member function could be made const |
2096 |
2376 |
|
2377 |
|
2378 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
2379 |
|
2380 //Update applist based on the information provided by the installers. |
|
2381 void CApaAppListServSession::UpdateAppListL(const RMessage2& aMessage) |
|
2382 { |
|
2383 //Create the update info array from the buffer. |
|
2384 TInt bufferSize = aMessage.GetDesLength(0); |
|
2385 User::LeaveIfError(bufferSize); |
|
2386 HBufC8* const buffer=HBufC8::NewLC(bufferSize); |
|
2387 TPtr8 buffer_asWritable(buffer->Des()); |
|
2388 aMessage.ReadL(0,buffer_asWritable); |
|
2389 |
|
2390 RDesReadStream readStream(*buffer); |
|
2391 CleanupClosePushL(readStream); |
|
2392 const TUint count=readStream.ReadUint32L(); |
|
2393 |
|
2394 RArray<TApaAppUpdateInfo> *appUpdateInfo=new (ELeave) RArray<TApaAppUpdateInfo>(5); |
|
2395 CleanupStack::PushL(appUpdateInfo); |
|
2396 |
|
2397 for(TUint index=0; index<count; index++) |
|
2398 { |
|
2399 TApaAppUpdateInfo appInfo; |
|
2400 readStream>>appInfo; |
|
2401 appUpdateInfo->AppendL(appInfo); |
|
2402 } |
|
2403 CleanupStack::Pop(appUpdateInfo); |
|
2404 CleanupStack::PopAndDestroy(2, buffer); //delete readStream, buffer |
|
2405 |
|
2406 iAppArcSrv.UpdateAppListL(appUpdateInfo, TUid::Uid(aMessage.SecureId())); |
|
2407 } |
|
2408 |
|
2409 |
|
2410 void CApaAppListServSession::UpdatedAppsInfoL(const RMessage2& aMessage) |
|
2411 { |
|
2412 //Read the buffer size |
|
2413 TInt sizeOfBuffer=aMessage.Int1(); |
|
2414 TInt count=iAppsUpdated.Count(); |
|
2415 TInt sizeRequired= sizeof(TInt)+(sizeof(TApaAppUpdateInfo) * count); |
|
2416 |
|
2417 TPckgBuf<TInt> pckg(sizeRequired); |
|
2418 |
|
2419 //If size of the buffer is not enough write the required size and leave. |
|
2420 if(sizeOfBuffer<sizeRequired) |
|
2421 { |
|
2422 aMessage.WriteL(1, pckg); |
|
2423 User::Leave(KErrOverflow); |
|
2424 } |
|
2425 |
|
2426 //If the passed buffer size is enough, create a buffer to write updates application information. |
|
2427 CBufFlat* buffer=CBufFlat::NewL(sizeRequired); |
|
2428 CleanupStack::PushL(buffer); |
|
2429 buffer->ExpandL(0, sizeRequired); |
|
2430 |
|
2431 RBufWriteStream writeStream; |
|
2432 writeStream.Open(*buffer); |
|
2433 |
|
2434 //Write count to stream. |
|
2435 writeStream.WriteUint32L(count); |
|
2436 |
|
2437 //Write updated applications information to stream. |
|
2438 for(TInt index=0; index<count; index++) |
|
2439 { |
|
2440 writeStream<<iAppsUpdated[index]; |
|
2441 } |
|
2442 //Write the buffer into passed buffer. |
|
2443 aMessage.WriteL(0, buffer->Ptr(0)); |
|
2444 //Write size of the buffer |
|
2445 aMessage.WriteL(1, pckg); |
|
2446 |
|
2447 CleanupStack::PopAndDestroy(buffer); |
|
2448 iAppsUpdated.Reset(); |
|
2449 iNotificationRequested=EFalse; |
|
2450 } |
|
2451 #endif |
|
2452 |
2097 // TSizeArrayItemWriter |
2453 // TSizeArrayItemWriter |
2098 |
2454 |
2099 TInt TSizeArrayItemWriter::ArrayItemCount() const |
2455 TInt TSizeArrayItemWriter::ArrayItemCount() const |
2100 { |
2456 { |
2101 return iArray.Count(); |
2457 return iArray.Count(); |