909 // |
917 // |
910 void CNSmlNotifierObserver::HbNotifierObserverL(const TSyncMLAppLaunchNotifParams& aParam) |
918 void CNSmlNotifierObserver::HbNotifierObserverL(const TSyncMLAppLaunchNotifParams& aParam) |
911 { |
919 { |
912 |
920 |
913 LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int()); |
921 LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int()); |
914 |
922 TInt err = iDmDevdialog.OpenL(); |
915 _LIT(KHbNotifier,"com.nokia.hb.devicemanagementdialog/1.0"); |
923 User::LeaveIfError(err); |
916 |
924 iDmDevdialog.LaunchPkgZero(aParam.iProfileId,aParam.iJobId,aParam.iUimode,iResBuf,iStatus); |
917 _LIT(KNotifierId, "aasyncmlfw"); |
925 |
918 _LIT(KProfileId, "profileid"); |
|
919 _LIT(KUImode, "uimode"); |
|
920 _LIT(KServerdisplayname, "serverdisplayname"); |
|
921 |
|
922 CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL(); |
|
923 CleanupStack::PushL(varMap); |
|
924 |
|
925 HBufC* notifierid = HBufC::NewL(10); |
|
926 CleanupStack::PushL(notifierid); |
|
927 *notifierid =KNotifierId; |
|
928 |
|
929 |
|
930 HBufC* profileid = HBufC::NewL(10); |
|
931 CleanupStack::PushL(profileid); |
|
932 *profileid = KProfileId; |
|
933 |
|
934 HBufC* uimode = HBufC::NewL(10); |
|
935 CleanupStack::PushL(uimode); |
|
936 *uimode = KUImode; |
|
937 |
|
938 HBufC* serverdisplay = HBufC::NewL(20); |
|
939 CleanupStack::PushL(serverdisplay); |
|
940 *serverdisplay = KServerdisplayname; |
|
941 |
|
942 TBuf<256> servername; |
|
943 |
|
944 CNSmlDMSettings* settings = CNSmlDMSettings::NewLC(); |
|
945 CNSmlDMProfile* prof = settings->ProfileL( |
|
946 aParam.iProfileId); |
|
947 CleanupStack::PushL(prof); |
|
948 |
|
949 servername = prof->StrValue(EDMProfileDisplayName); |
|
950 |
|
951 CleanupStack::PopAndDestroy(2); |
|
952 |
|
953 TInt id =1000000; |
|
954 |
|
955 CHbSymbianVariant* notifieridvar = CHbSymbianVariant::NewL(&id, |
|
956 CHbSymbianVariant::EInt); |
|
957 |
|
958 |
|
959 CHbSymbianVariant* infoprofileid = CHbSymbianVariant::NewL(&aParam.iProfileId, |
|
960 CHbSymbianVariant::EInt); |
|
961 |
|
962 //CleanupStack::PushL(infoprofileid); |
|
963 |
|
964 CHbSymbianVariant* infouimode = CHbSymbianVariant::NewL(&aParam.iUimode, |
|
965 CHbSymbianVariant::EInt); |
|
966 |
|
967 CHbSymbianVariant* serverdisplayname = CHbSymbianVariant::NewL(&servername, |
|
968 CHbSymbianVariant::EDes); |
|
969 //CleanupStack::PushL(infouimode); |
|
970 |
|
971 varMap->Add(*notifierid, notifieridvar); |
|
972 varMap->Add(*profileid, infoprofileid); // takes ownership |
|
973 varMap->Add(*uimode, infouimode); |
|
974 varMap->Add(*serverdisplay, serverdisplayname); |
|
975 |
|
976 /*subscribe key value*/ |
|
977 TInt err = RProperty::Define(sosserverpsuid, EHbSOSNotifierKeyStatus, RProperty::EInt); |
|
978 |
|
979 err = RProperty::Define(sosserverpsuid, EHbSOSNotifierKeyStatusReturn, RProperty::EInt); |
|
980 |
|
981 err = iProperty.Attach(sosserverpsuid, EHbSOSNotifierKeyStatus); |
|
982 |
|
983 iProperty.Subscribe(iStatus); |
|
984 |
|
985 |
|
986 |
|
987 iDevDialog = CHbDeviceDialogSymbian::NewL(); |
|
988 iDevDialog->Show(KHbNotifier, *varMap); |
|
989 |
|
990 CleanupStack::PopAndDestroy(5); |
|
991 |
|
992 |
|
993 |
|
994 LOGSTRING2("CNSmlNotifierObserver hb notifier %d before subscribe", iStatus.Int()); |
|
995 |
|
996 |
|
997 |
|
998 LOGSTRING2("CNSmlNotifierObserver hb notifier %d after subscribe", iStatus.Int()); |
926 LOGSTRING2("CNSmlNotifierObserver hb notifier %d after subscribe", iStatus.Int()); |
999 |
927 |
1000 LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int()); |
928 LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int()); |
1001 } |
929 } |
1002 |
930 |
1039 // -------------------------------------------------------------------------- |
967 // -------------------------------------------------------------------------- |
1040 // |
968 // |
1041 void CNSmlNotifierObserver::RunL() |
969 void CNSmlNotifierObserver::RunL() |
1042 { |
970 { |
1043 |
971 |
1044 if (iDevDialog && iHbSyncmlNotifierEnabled) |
972 |
1045 { |
|
1046 |
|
1047 |
|
1048 TInt status = KErrNone; |
|
1049 |
|
1050 TInt err = RProperty::Get(sosserverpsuid,EHbSOSNotifierKeyStatusReturn , status); |
|
1051 |
|
1052 LOGSTRING2("status is %d", status); |
|
1053 |
|
1054 LOGSTRING2("err of ps key is %d", err); |
|
1055 |
|
1056 if(status == KErrCancel) |
|
1057 iStatus = KErrCancel; |
|
1058 |
|
1059 iDevDialog->Cancel(); |
|
1060 delete iDevDialog; |
|
1061 } |
|
1062 |
973 |
1063 LOGSTRING("CNSmlNotifierObserver RunL start"); |
974 LOGSTRING("CNSmlNotifierObserver RunL start"); |
1064 |
975 |
1065 TInt ret = iStatus.Int(); |
976 TInt ret = iStatus.Int(); |
1066 if ( ret == KErrCancel && iTimeOut ) |
977 if ( ret == KErrCancel && iTimeOut ) |