236 const TUint flags = buf(); |
236 const TUint flags = buf(); |
237 User::LeaveIfError(aFile.Read(buf)); |
237 User::LeaveIfError(aFile.Read(buf)); |
238 const TUint aToUid = buf(); |
238 const TUint aToUid = buf(); |
239 User::LeaveIfError(aFile.Read(buf)); |
239 User::LeaveIfError(aFile.Read(buf)); |
240 const TUint root = buf(); |
240 const TUint root = buf(); |
|
241 User::LeaveIfError(aFile.Read(buf)); |
|
242 const TUint sid = buf(); |
241 if(KErrNone == Append(value)) //dont allow duplicates |
243 if(KErrNone == Append(value)) //dont allow duplicates |
242 { |
244 { |
243 const TInt index = IndexOf(value); |
245 const TInt index = IndexOf(value); |
244 iAppInfo[index].iFlags = static_cast<TAppInfo::TFlags>(flags); |
246 iAppInfo[index].iFlags = static_cast<TAppInfo::TFlags>(flags); |
245 iAppInfo[index].iParent = TUid::Uid(aToUid); |
247 iAppInfo[index].iParent = TUid::Uid(aToUid); |
246 iAppInfo[index].iRootWgId = static_cast<TInt>(root); |
248 iAppInfo[index].iRootWgId = static_cast<TInt>(root); |
|
249 iAppInfo[index].iSecureId = static_cast<TUint>(sid); |
247 } |
250 } |
248 } |
251 } |
249 } |
252 } |
250 |
253 |
251 void CAppInfoCache::WriteArrayL(RFile& aFile) const |
254 void CAppInfoCache::WriteArrayL(RFile& aFile) const |
257 const TAppInfo& info = iAppInfo[i]; |
260 const TAppInfo& info = iAppInfo[i]; |
258 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iUid))); |
261 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iUid))); |
259 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iFlags))); |
262 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iFlags))); |
260 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iParent.iUid))); |
263 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iParent.iUid))); |
261 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iRootWgId))); |
264 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iRootWgId))); |
|
265 User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iSecureId))); |
262 } |
266 } |
263 } |
267 } |
264 |
268 |
265 TInt CAppInfoCache::TAppInfo::Order(const TAppInfo& aNodeA, const TAppInfo& aNodeB) |
269 TInt CAppInfoCache::TAppInfo::Order(const TAppInfo& aNodeA, const TAppInfo& aNodeB) |
266 { |
270 { |
373 { |
377 { |
374 if(aSet) |
378 if(aSet) |
375 iAppInfo[index].iFlags |= aFlag; |
379 iAppInfo[index].iFlags |= aFlag; |
376 else |
380 else |
377 iAppInfo[index].iFlags &= ~aFlag; |
381 iAppInfo[index].iFlags &= ~aFlag; |
378 } |
382 } |
|
383 __ALFFXLOGSTRING2("CAppInfoCache::SetAppFlags - 0x%x, index: %d (alf)", aUid, index); |
379 } |
384 } |
380 |
385 |
381 |
386 |
382 TBool CAppInfoCache::GetAppFlags(const TUid& aUid, TUint aFlag) const |
387 TBool CAppInfoCache::GetAppFlags(const TUid& aUid, TUint aFlag) const |
383 { |
388 { |
384 return TBool(iAppInfo[IndexOf(aUid.iUid)].iFlags & aFlag); |
389 return TBool(iAppInfo[IndexOf(aUid.iUid)].iFlags & aFlag); |
385 } |
390 } |
386 |
391 |
387 |
392 |
388 void CAppInfoCache::SetAvkonUid(const TUid& aUid) |
393 void CAppInfoCache::SetAvkonUid(const TUid& aUid) |
389 { |
394 { |
|
395 __ALFFXLOGSTRING1("CAppInfoCache::SetAvkonUid 0x%x (alf)", aUid) |
390 SetAppFlags(aUid, TAppInfo::EAvkonApp, ETrue); |
396 SetAppFlags(aUid, TAppInfo::EAvkonApp, ETrue); |
391 } |
397 } |
392 |
398 |
393 void CAppInfoCache::RemoveAvkonUid(const TUid& aUid) |
399 void CAppInfoCache::RemoveAvkonUid(const TUid& aUid) |
394 { |
400 { |
|
401 __ALFFXLOGSTRING1("CAppInfoCache::RemoveAvkonUid 0x%x (alf)", aUid) |
395 SetAppFlags(aUid, TAppInfo::EAvkonApp, EFalse); |
402 SetAppFlags(aUid, TAppInfo::EAvkonApp, EFalse); |
396 } |
403 } |
397 |
404 |
398 |
405 |
399 TBool CAppInfoCache::AvkonUid(const TUid& aUid) const |
406 TBool CAppInfoCache::AvkonUid(const TUid& aUid) const |
418 |
425 |
419 void CAppInfoCache::SetParent(const TUid& aUid, const TUid& aParentUid) |
426 void CAppInfoCache::SetParent(const TUid& aUid, const TUid& aParentUid) |
420 { |
427 { |
421 iAppInfo[IndexOf(aUid.iUid)].iParent = aParentUid; |
428 iAppInfo[IndexOf(aUid.iUid)].iParent = aParentUid; |
422 } |
429 } |
|
430 |
|
431 void CAppInfoCache::SetSecureId( const TUid& aUid, const TSecureId& aSecureId ) |
|
432 { |
|
433 iAppInfo[IndexOf(aUid.iUid)].iSecureId = aSecureId.iId; |
|
434 } |
|
435 |
|
436 void CAppInfoCache::SetWgId( const TUid& aUid, TInt aWgId ) |
|
437 { |
|
438 iAppInfo[IndexOf(aUid.iUid)].iRootWgId = aWgId; |
|
439 } |
423 |
440 |
424 |
441 |
425 TInt CAppInfoCache::SetAction(const TUid& aUid, TInt aAction) |
442 TInt CAppInfoCache::SetAction(const TUid& aUid, TInt aAction) |
426 { |
443 { |
427 if (aAction==AknTransEffect::ENone || aUid == KNullUid) |
444 if (aAction==AknTransEffect::ENone || aUid == KNullUid) |
653 // --------------------------------------------------------------------------- |
670 // --------------------------------------------------------------------------- |
654 // |
671 // |
655 void CWsServerDrawerController::BeginFullscreen(TInt aType, const TUid aUid1, const TUid aUid2, TInt aData ) |
672 void CWsServerDrawerController::BeginFullscreen(TInt aType, const TUid aUid1, const TUid aUid2, TInt aData ) |
656 { |
673 { |
657 TUid toUid = iEngine->ToUid(); |
674 TUid toUid = iEngine->ToUid(); |
|
675 TSecureId toSid = iEngine->ToSid(); |
|
676 TInt toWg = iEngine->ToWg(); |
658 TUid fromUid = iEngine->FromUid(); |
677 TUid fromUid = iEngine->FromUid(); |
|
678 TSecureId fromSid = iEngine->FromSid(); |
|
679 TInt fromWg = iEngine->FromWg(); |
659 TInt flags = iEngine->Flags(); |
680 TInt flags = iEngine->Flags(); |
660 #ifdef WSSERVERDRAWER_TIME_LOG //time log |
681 #ifdef WSSERVERDRAWER_TIME_LOG //time log |
661 if(aFromGfx) |
682 if(aFromGfx) |
662 { |
683 { |
663 iLogger->Log1(_L("CWsServerDrawerController::BeginFullscreen from Gfx time %d"), iLogger->TimeMs()); |
684 iLogger->Log1(_L("CWsServerDrawerController::BeginFullscreen from Gfx time %d"), iLogger->TimeMs()); |
693 TBool isEmbeddedAppContext = |
714 TBool isEmbeddedAppContext = |
694 (iEngine->Action() == AknTransEffect::EEmbeddedApplicationExit) || |
715 (iEngine->Action() == AknTransEffect::EEmbeddedApplicationExit) || |
695 (iEngine->Action() == AknTransEffect::EEmbeddedApplicationStart); |
716 (iEngine->Action() == AknTransEffect::EEmbeddedApplicationStart); |
696 |
717 |
697 iAppInfoCache->SetUid(toUid); |
718 iAppInfoCache->SetUid(toUid); |
|
719 if ( toUid != TUid::Null() ) |
|
720 { |
|
721 iAppInfoCache->SetSecureId( toUid, toSid ); |
|
722 iAppInfoCache->SetWgId( toUid, toWg ); |
|
723 } |
698 iAppInfoCache->SetUid(fromUid); |
724 iAppInfoCache->SetUid(fromUid); |
|
725 if ( fromUid != TUid::Null() ) |
|
726 { |
|
727 iAppInfoCache->SetSecureId( fromUid, fromSid ); |
|
728 iAppInfoCache->SetWgId( fromUid, fromWg ); |
|
729 } |
699 |
730 |
700 if ((toUid != KNullUid) && !isEmbeddedAppContext) |
731 if ((toUid != KNullUid) && !isEmbeddedAppContext) |
701 { |
732 { |
702 //the ok is always reset in the begining |
733 //the ok is always reset in the begining |
703 if(flags & AknTransEffect::TParameter::EResetServerStats) |
734 if(flags & AknTransEffect::TParameter::EResetServerStats) |
747 |
778 |
748 //activation after exit is not allowed (also if exit didnt result in an effect) |
779 //activation after exit is not allowed (also if exit didnt result in an effect) |
749 if(iLastTypeTried == CStateHandler::EExit && |
780 if(iLastTypeTried == CStateHandler::EExit && |
750 fstype == CStateHandler::EActivation) |
781 fstype == CStateHandler::EActivation) |
751 { //the current uid is not valid |
782 { //the current uid is not valid |
752 return; // activation not ok if exiting |
783 __ALFFXLOGSTRING("CWsServerDrawerController::BeginFullscreen - Last tried type was exit. Abort."); |
|
784 return; // activation not ok if exiting |
753 } |
785 } |
754 |
786 |
755 iLastTypeTried = fstype; |
787 iLastTypeTried = fstype; |
756 |
788 |
757 //activation after exit is not allowed...even it was aborted |
789 //activation after exit is not allowed...even it was aborted |
758 if(iExitAborted && |
790 if(iExitAborted && |
759 CStateHandler::EActivation == fstype) |
791 CStateHandler::EActivation == fstype) |
760 { //the current uid is not valid |
792 { //the current uid is not valid |
|
793 __ALFFXLOGSTRING("CWsServerDrawerController::BeginFullscreen - Exit was aborted. Activation should not happen. Abort."); |
761 AbortTransition(); //if exit is aborted, we dont want either activation |
794 AbortTransition(); //if exit is aborted, we dont want either activation |
762 return; // activation not ok if exiting |
795 return; // activation not ok if exiting |
763 } |
796 } |
764 |
797 |
765 //dsa apps do not have effects |
798 //dsa apps do not have effects |
766 //this is one reason why for activation end cannot be called immediately after begin |
799 //this is one reason why for activation end cannot be called immediately after begin |
767 //we should know if its a dsa app before end can be called |
800 //we should know if its a dsa app before end can be called |
768 if(iDSAActive) |
801 if(iDSAActive) |
769 { |
802 { |
|
803 __ALFFXLOGSTRING("CWsServerDrawerController::BeginFullscreen - Phone is booting. Abort."); |
770 return; //Do nothing if dsa active. |
804 return; //Do nothing if dsa active. |
771 } |
805 } |
772 |
806 |
773 //Special argument calls does not initiate any FS effect and is caught here. |
807 //Special argument calls does not initiate any FS effect and is caught here. |
774 // TODO: remove && !iEngine->WaitingForRootWgId() when appuids available from wserv |
808 // TODO: remove && !iEngine->WaitingForRootWgId() when appuids available from wserv |
775 if(fstype == CStateHandler::ENone) |
809 if(fstype == CStateHandler::ENone) |
776 { |
810 { |
|
811 __ALFFXLOGSTRING("CWsServerDrawerController::BeginFullscreen - Phone is booting. Abort."); |
777 return; |
812 return; |
778 } |
813 } |
779 |
814 |
780 |
815 |
781 //Phone is booting, stop any FS effect. |
816 //Phone is booting, stop any FS effect. |
782 if(!StartCheck(flags)) |
817 if(!StartCheck(flags)) |
783 { |
818 { |
784 AbortTransition(); |
819 __ALFFXLOGSTRING("CWsServerDrawerController::BeginFullscreen - Phone is booting. Abort."); |
|
820 AbortTransition(); |
785 return; |
821 return; |
786 } |
822 } |
787 |
823 |
788 // if either toUid or fromUid is in the custom list for applications |
824 // if either toUid or fromUid is in the custom list for applications |
789 // that should be blocked then we abort all ongoing transitions. |
825 // that should be blocked then we abort all ongoing transitions. |
790 if(!(AllowedCustomUid(toUid) && AllowedCustomUid(fromUid))) |
826 if(!(AllowedCustomUid(toUid) && AllowedCustomUid(fromUid))) |
791 { |
827 { |
|
828 __ALFFXLOGSTRING2("CWsServerDrawerController::BeginFullscreen - Blocked uid 0x%x or 0x%x. Abort.", toUid, fromUid); |
792 AbortTransition(); |
829 AbortTransition(); |
793 return; |
830 return; |
794 } |
831 } |
795 |
832 |
796 // No effect if a second exit effect comes in while exit effect is ongoing. |
833 // No effect if a second exit effect comes in while exit effect is ongoing. |
824 //activation switch effects are not allowed for non avkon apps as they never will |
861 //activation switch effects are not allowed for non avkon apps as they never will |
825 //inform their foregound - so no transition. |
862 //inform their foregound - so no transition. |
826 if(CStateHandler::EActivation == fstype && currtype != CStateHandler::EStart && |
863 if(CStateHandler::EActivation == fstype && currtype != CStateHandler::EStart && |
827 !iAppInfoCache->AvkonUid(toUid)) |
864 !iAppInfoCache->AvkonUid(toUid)) |
828 { |
865 { |
|
866 __ALFFXLOGSTRING1("CWsServerDrawerController::BeginFullscreen - Non avkon app 0x%x. Abort.", toUid); |
829 return; |
867 return; |
830 } |
868 } |
831 |
869 |
832 if(iEngine->Action() == AknTransEffect::ELayoutSwitch) // ELayoutSwitchOut is for two phases solution |
870 if(iEngine->Action() == AknTransEffect::ELayoutSwitch) // ELayoutSwitchOut is for two phases solution |
833 { |
871 { |
935 // --------------------------------------------------------------------------- |
973 // --------------------------------------------------------------------------- |
936 // --------------------------------------------------------------------------- |
974 // --------------------------------------------------------------------------- |
937 // |
975 // |
938 void CWsServerDrawerController::EndExpired() |
976 void CWsServerDrawerController::EndExpired() |
939 { |
977 { |
940 __ALFFXLOGSTRING("CWsServerDrawerController::EndExpired >>"); |
978 __ALFFXLOGSTRING("CWsServerDrawerController::EndExpired (Alf)>>"); |
941 AbortTransition(EAbortFullscreen); |
979 AbortTransition(EAbortFullscreen); |
942 iExitAborted = EFalse; //This is not valid when we have a time-out |
980 iExitAborted = EFalse; //This is not valid when we have a time-out |
943 __ALFFXLOGSTRING("CWsServerDrawerController::EndExpired <<"); |
981 __ALFFXLOGSTRING("CWsServerDrawerController::EndExpired (Alf)<<"); |
944 } |
982 } |
945 |
983 |
946 // --------------------------------------------------------------------------- |
984 // --------------------------------------------------------------------------- |
947 // --------------------------------------------------------------------------- |
985 // --------------------------------------------------------------------------- |
948 // |
986 // |
949 void CWsServerDrawerController::EndFullscreen(TBool /*aFromGfx*/) |
987 void CWsServerDrawerController::EndFullscreen(TBool /*aFromGfx*/) |
950 { |
988 { |
|
989 __ALFFXLOGSTRING("CWsServerDrawerController::EndFullscreen (Alf)>>"); |
951 /* |
990 /* |
952 DSA end fix |
991 DSA end fix |
953 */ |
992 */ |
954 if(iDSAActive) |
993 if(iDSAActive) |
955 { |
994 { |
|
995 __ALFFXLOGSTRING("CWsServerDrawerController::EndFullscreen - DSA Active - ABORTING (Alf)"); |
956 AbortTransition(); |
996 AbortTransition(); |
957 return; //Do nothing if dsa active. |
997 return; //Do nothing if dsa active. |
958 } |
998 } |
959 |
999 |
960 |
1000 |
961 #ifdef WSSERVERDRAWER_TIME_LOG //time log |
1001 #ifdef WSSERVERDRAWER_TIME_LOG //time log |
962 iLogger->Log1(_L("CWsServerDrawerController::EndFullscreen time %d"), iLogger->TimeMs()); |
1002 iLogger->Log1(_L("CWsServerDrawerController::EndFullscreen time %d"), iLogger->TimeMs()); |
963 #endif //WSSERVERDRAWER_TIME_LOG |
1003 #endif //WSSERVERDRAWER_TIME_LOG |
964 |
1004 |
965 iStates->Signal(CStateBase::EEndFullscreen); |
1005 iStates->Signal(CStateBase::EEndFullscreen); |
|
1006 // the callback for FullScreenFinished will not come. this must be resetted here. |
|
1007 iLastTypeTried = CStateHandler::ENone; |
966 } |
1008 } |
967 |
1009 |
968 |
1010 |
969 // --------------------------------------------------------------------------- |
1011 // --------------------------------------------------------------------------- |
970 // --------------------------------------------------------------------------- |
1012 // --------------------------------------------------------------------------- |
971 // |
1013 // |
972 void CWsServerDrawerController::FullscreenFinished(TInt aHandle) |
1014 void CWsServerDrawerController::FullscreenFinished(TInt aHandle) |
973 { |
1015 { |
974 if(aHandle == iEngine->CurrentHandle()) // Filter away stray finish signals. |
1016 if(aHandle == iEngine->CurrentFullScreenHandle()) // Filter away stray finish signals. |
975 { |
1017 { |
976 iLastTypeTried = CStateHandler::ENone; |
1018 iLastTypeTried = CStateHandler::ENone; |
977 iStates->Signal(CStateBase::EFinishFullscreen); |
1019 iStates->Signal(CStateBase::EFinishFullscreen); |
978 } |
1020 } |
979 } |
1021 } |
1080 // --------------------------------------------------------------------------- |
1122 // --------------------------------------------------------------------------- |
1081 // --------------------------------------------------------------------------- |
1123 // --------------------------------------------------------------------------- |
1082 // |
1124 // |
1083 void CWsServerDrawerController::AbortTransition(TInt aToAbort) |
1125 void CWsServerDrawerController::AbortTransition(TInt aToAbort) |
1084 { |
1126 { |
1085 __ALFFXLOGSTRING("CWsServerDrawerController::AbortTransition >>"); |
1127 __ALFFXLOGSTRING("CWsServerDrawerController::AbortTransition (Alf) >>"); |
1086 if ( aToAbort == EAbortFullscreen ) |
1128 if ( aToAbort == EAbortFullscreen ) |
1087 { |
1129 { |
1088 iLastTypeTried = CStateHandler::ENone; |
1130 iLastTypeTried = CStateHandler::ENone; |
1089 iExitAborted = iStates->GetCurrentFullscreenType() == CStateHandler::EExit; |
1131 iExitAborted = iStates->GetCurrentFullscreenType() == CStateHandler::EExit; |
|
1132 __ALFFXLOGSTRING1("CWsServerDrawerController::AbortTransition , iExitAborted %d (Alf)", iExitAborted); |
1090 iStates->Signal(CStateBase::EAbortFullscreen); |
1133 iStates->Signal(CStateBase::EAbortFullscreen); |
|
1134 iExitAborted = EFalse; // end of story for exit effect. |
1091 } |
1135 } |
1092 else if ( aToAbort == EAbortControl ) |
1136 else if ( aToAbort == EAbortControl ) |
1093 { |
1137 { |
1094 iStates->Signal(CStateBase::EAbortComponent); |
1138 iStates->Signal(CStateBase::EAbortComponent); |
1095 } |
1139 } |
1096 else if( (aToAbort & EAbortControl) && (aToAbort & EAbortFullscreen) ) |
1140 else if( (aToAbort & EAbortControl) && (aToAbort & EAbortFullscreen) ) |
1097 { |
1141 { |
1098 iLastTypeTried = CStateHandler::ENone; |
1142 iLastTypeTried = CStateHandler::ENone; |
1099 iExitAborted = iStates->GetCurrentFullscreenType() == CStateHandler::EExit; |
1143 iExitAborted = iStates->GetCurrentFullscreenType() == CStateHandler::EExit; |
1100 iStates->Signal(CStateBase::EAbort); |
1144 __ALFFXLOGSTRING1("CWsServerDrawerController::AbortTransition , iExitAborted %d (Alf)", iExitAborted); |
|
1145 iStates->Signal(CStateBase::EAbort); |
|
1146 iExitAborted = EFalse; // end of story for exit effect. |
1101 } |
1147 } |
1102 __ALFFXLOGSTRING("CWsServerDrawerController::AbortTransition <<"); |
1148 __ALFFXLOGSTRING("CWsServerDrawerController::AbortTransition (Alf) <<"); |
1103 } |
1149 } |
1104 |
1150 |
1105 // --------------------------------------------------------------------------- |
1151 // --------------------------------------------------------------------------- |
1106 // --------------------------------------------------------------------------- |
1152 // --------------------------------------------------------------------------- |
1107 // |
1153 // |
1108 TBool CWsServerDrawerController::IsBlocked( const TUid& aFromUid, const TUid& aToUid ) |
1154 TBool CWsServerDrawerController::IsBlocked( const TUid& aFromUid, const TUid& aToUid ) |
1109 { |
1155 { |
1110 TBool result = iStates->IsBlocked( aFromUid, aToUid ); |
1156 TBool result = iStates->IsBlocked( aFromUid, aToUid ); |
1111 __ALFFXLOGSTRING1("CWsServerDrawerController::IsBlocked - return %d", result); |
1157 __ALFFXLOGSTRING1("CWsServerDrawerController::IsBlocked - return %d (Alf)", result); |
1112 return result; |
1158 return result; |
1113 } |
1159 } |
1114 |
1160 |