15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // INCLUDE FILES |
18 // INCLUDE FILES |
19 #include "ConnDlgPlugin.h" |
19 #include "ConnDlgPlugin.h" |
20 |
20 #include "AuthenticationDialog.h" |
|
21 #include "ReconnectDialog.h" |
|
22 #include "QosDialog.h" |
|
23 #include "NewIapDialog.h" |
|
24 #include "ActiveIapPlugin.h" |
|
25 |
|
26 #include "ActiveSelectConnectionPlugin.h" |
|
27 #include "CConnDlgPrivateCRKeys.h" |
21 #include <centralrepository.h> |
28 #include <centralrepository.h> |
22 |
29 |
23 #include "ConnectionDialogsUidDefs.h" |
30 #include "ConnectionDialogsUidDefs.h" |
24 #include "ConnectionDialogsLogger.h" |
31 #include "ConnectionDialogsLogger.h" |
25 |
32 |
26 #include <eikenv.h> |
33 #include <eikenv.h> |
27 #include <bautils.h> |
34 #include <bautils.h> |
28 #include <e32property.h> |
35 #include <e32property.h> |
29 #include <rmpm.h> |
36 #include <rmpm.h> |
30 #include <cmmanager.h> |
37 #include <startupdomainpskeys.h> |
31 #include <cmdestination.h> |
38 |
32 #include <commsdat.h> |
39 #include <CConnDlgPlugin.rsg> |
33 |
|
34 #include <data_caging_path_literals.hrh> |
40 #include <data_caging_path_literals.hrh> |
35 |
41 #include <vpnapi.h> |
36 |
|
37 // NOTE that the functionality this file is DEPRECATED |
|
38 // None on the methods have UI functionality, the plugins complete the requests |
|
39 // immediately when they are started |
|
40 |
42 |
41 using namespace CommsDat; |
43 using namespace CommsDat; |
42 |
44 |
43 // CONSTANTS |
45 // CONSTANTS |
44 |
46 |
|
47 // RSC file name. |
|
48 _LIT( KResourceFileName, "CConnDlgPlugin.rsc" ); |
|
49 |
|
50 // Panic string |
|
51 _LIT( KConnDlgPluginPanic, "CConnDlgPlugin" ); |
|
52 |
45 LOCAL_D const TInt KPluginGranularity = 4; |
53 LOCAL_D const TInt KPluginGranularity = 4; |
|
54 |
|
55 #if defined(_DEBUG) |
|
56 _LIT( KErrActiveObjectNull, "iActivePlugin not NULL" ); |
|
57 #endif |
|
58 |
46 |
59 |
47 |
60 |
48 LOCAL_C void CreateNotifiersL( |
61 LOCAL_C void CreateNotifiersL( |
49 CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers ); |
62 CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers ); |
50 |
63 |
147 // --------------------------------------------------------- |
159 // --------------------------------------------------------- |
148 // |
160 // |
149 |
161 |
150 void CConnDlgIapPlugin::StartL( const TDesC8& aBuffer, TInt aReplySlot, |
162 void CConnDlgIapPlugin::StartL( const TDesC8& aBuffer, TInt aReplySlot, |
151 const RMessagePtr2& aMessage ) |
163 const RMessagePtr2& aMessage ) |
152 { |
164 { |
|
165 if ( ScreenSaverOn() || AutolockOn() ) |
|
166 { |
|
167 // Screen saver or Autolock is active. Cancel the dialog. |
|
168 CLOG_WRITE( "CConnDlgAuthenticationPlugin::StartL: Screen saver or Autolock is active." ); |
|
169 aMessage.Complete( KErrCancel ); |
|
170 return; |
|
171 } |
|
172 |
|
173 iPrefs.Copy( (TPtrC8) aBuffer ); |
153 |
174 |
154 iCancelled = EFalse; |
175 iCancelled = EFalse; |
155 iReplySlot = aReplySlot; |
176 iReplySlot = aReplySlot; |
156 iMessage = aMessage; |
177 iMessage = aMessage; |
157 |
178 |
158 // The UI is deprectad, complete the request and return the best available iap |
179 // Check if there is a suitable active connection |
159 RCmManager cmManager; |
180 TInt iap( 0 ); |
160 cmManager.OpenL(); |
181 TInt bearer( ECommDbBearerWLAN ); // User conn. is always WLAN in 9.1 |
161 CleanupClosePushL( cmManager ); |
182 |
162 |
183 // Is there active User connection |
163 RArray<TUint32> destinationArray; |
184 TInt err = GetUserConnection( iap ); |
164 cmManager.AllDestinationsL( destinationArray ); |
185 |
165 CleanupClosePushL(destinationArray); |
186 if ( err != KErrNone || iap == 0 ) |
166 TInt error = KErrNotFound; |
187 { |
167 |
188 // Is there any active connection |
168 // loop the destinations and find the internet snap |
189 err = GetActiveConnection( iap, bearer ); |
169 for (TInt i = 0; i < destinationArray.Count(); ++i) |
190 } |
170 { |
191 |
171 RCmDestination destination = cmManager.DestinationL( destinationArray[i] ); |
192 if ( ( err == KErrNone ) && |
172 CleanupClosePushL(destination); |
193 ( iap != 0 ) && |
173 TUint32 purposeMetaData = destination.MetadataL( CMManager::ESnapMetadataPurpose ); |
194 ( iPrefs().iBearerSet & bearer ) ) |
174 |
195 { |
175 // If the internet snap was found, check out the IAPs |
196 // a suitable connection is already active |
176 if ( CMManager::ESnapPurposeInternet == purposeMetaData ) |
197 iIAP = iap; |
177 { |
198 CompleteL( KErrNone ); |
178 RMPM mpm; |
199 } |
179 User::LeaveIfError(mpm.Connect()); |
200 else |
180 TMpmSnapBuffer buffer; |
201 { |
181 buffer.Reset(); |
202 // display a dialog |
182 User::LeaveIfError( mpm.SortSNAP( destination.Id(), buffer )); |
203 __ASSERT_DEBUG( !iActivePlugin, |
183 mpm.Close(); |
204 User::Panic( KErrActiveObjectNull, KErrNone ) ); |
184 // if there are iaps in the list, return the first |
205 |
185 // if there are none, return an error |
206 iActivePlugin = CActiveCConnDlgIapPlugin::NewL( this, iPrefs() ); |
186 if ( buffer.Count() > 0 ) |
207 iActivePlugin->StartSearchIAPsL(); |
187 { |
208 } |
188 iIAP = buffer.iIapId[0]; |
209 } |
189 error = KErrNone; |
210 |
190 } |
211 |
191 CleanupStack::PopAndDestroy(); //destination |
|
192 break; |
|
193 } |
|
194 CleanupStack::PopAndDestroy(); //destination |
|
195 } |
|
196 CleanupStack::PopAndDestroy(); //destinationArray |
|
197 CleanupStack::PopAndDestroy(); //cmManager |
|
198 |
|
199 CompleteL( error ); |
|
200 } |
|
201 |
212 |
202 // --------------------------------------------------------- |
213 // --------------------------------------------------------- |
203 // void CConnDlgIapPlugin::Cancel() |
214 // void CConnDlgIapPlugin::Cancel() |
204 // --------------------------------------------------------- |
215 // --------------------------------------------------------- |
205 // |
216 // |
206 void CConnDlgIapPlugin::Cancel() |
217 void CConnDlgIapPlugin::Cancel() |
207 { |
218 { |
|
219 delete iActivePlugin; |
|
220 iActivePlugin = NULL; |
|
221 |
208 if ( !iCancelled ) |
222 if ( !iCancelled ) |
209 { |
223 { |
210 iCancelled = ETrue; |
224 iCancelled = ETrue; |
211 if ( !iMessage.IsNull() ) |
225 if ( !iMessage.IsNull() ) |
212 { |
226 { |
245 // --------------------------------------------------------- |
259 // --------------------------------------------------------- |
246 // CConnDlgIapPlugin* CConnDlgIapPlugin::NewL() |
260 // CConnDlgIapPlugin* CConnDlgIapPlugin::NewL() |
247 // --------------------------------------------------------- |
261 // --------------------------------------------------------- |
248 // |
262 // |
249 CConnDlgIapPlugin* CConnDlgIapPlugin::NewL( |
263 CConnDlgIapPlugin* CConnDlgIapPlugin::NewL( |
250 const TBool /*aResourceFileResponsible*/ ) |
264 const TBool aResourceFileResponsible ) |
251 { |
265 { |
252 CConnDlgIapPlugin* self = new (ELeave) CConnDlgIapPlugin(); |
266 CConnDlgIapPlugin* self = new (ELeave) CConnDlgIapPlugin(); |
|
267 CleanupStack::PushL( self ); |
|
268 self->ConstructL( KResourceFileName, aResourceFileResponsible ); |
|
269 CleanupStack::Pop(); |
|
270 |
253 return self; |
271 return self; |
|
272 } |
|
273 |
|
274 // --------------------------------------------------------- |
|
275 // CConnDlgIapPlugin::SetPreferredIapIdL |
|
276 // --------------------------------------------------------- |
|
277 // |
|
278 void CConnDlgIapPlugin::SetPreferredIapIdL( TUint32 aIAPId ) |
|
279 { |
|
280 CLOG_ENTERFN( "CConnDlgIapPlugin::SetPreferredIapIdL " ); |
|
281 |
|
282 iIAP = aIAPId; |
|
283 |
|
284 CLOG_LEAVEFN( "CConnDlgIapPlugin::SetPreferredIapIdL " ); |
|
285 } |
|
286 |
|
287 |
|
288 // --------------------------------------------------------- |
|
289 // CConnDlgIapPlugin::GetActiveConnection |
|
290 // --------------------------------------------------------- |
|
291 // |
|
292 TInt CConnDlgIapPlugin::GetActiveConnection( TInt& aIapId, |
|
293 TInt& aBearer ) |
|
294 { |
|
295 aIapId = 0; |
|
296 aBearer = 0; |
|
297 |
|
298 TInt err = RProperty::Get( KMPMActiveConnectionCategory, |
|
299 KMPMPSKeyActiveConnectionIap, |
|
300 aIapId ); |
|
301 |
|
302 CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionIap : %d" ), aIapId ); |
|
303 CLOG_WRITEF( _L( "err : %d" ), err ); |
|
304 |
|
305 if ( err == KErrNone ) |
|
306 { |
|
307 err = RProperty::Get( KMPMActiveConnectionCategory, |
|
308 KMPMPSKeyActiveConnectionBearer, |
|
309 aBearer ); |
|
310 } |
|
311 |
|
312 CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionBearer : %d" ), aBearer ); |
|
313 CLOG_WRITEF( _L( "err : %d" ), err ); |
|
314 CLOG_WRITEF( _L( "iPrefs().iBearerSet : %d" ), iPrefs().iBearerSet ); |
|
315 |
|
316 return err; |
|
317 } |
|
318 |
|
319 |
|
320 // --------------------------------------------------------- |
|
321 // CConnDlgIapPlugin::GetUserConnection |
|
322 // --------------------------------------------------------- |
|
323 // |
|
324 TInt CConnDlgIapPlugin::GetUserConnection( TInt& aIapId ) |
|
325 { |
|
326 aIapId = 0; |
|
327 |
|
328 TInt err = RProperty::Get( KMPMUserConnectionCategory, |
|
329 KMPMPSKeyUserConnectionIap, |
|
330 aIapId ); |
|
331 |
|
332 CLOG_WRITEF( _L( "KMPMPSKeyUserConnectionIap : %d" ), aIapId ); |
|
333 CLOG_WRITEF( _L( "err : %d" ), err ); |
|
334 |
|
335 return err; |
254 } |
336 } |
255 |
337 |
256 |
338 |
257 // --------------------------------------------------------- |
339 // --------------------------------------------------------- |
258 // CConnDlgAuthenticationPlugin::TNotifierInfo |
340 // CConnDlgAuthenticationPlugin::TNotifierInfo |
279 TInt aReplySlot, |
361 TInt aReplySlot, |
280 const RMessagePtr2& aMessage ) |
362 const RMessagePtr2& aMessage ) |
281 { |
363 { |
282 CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::StartL" ); |
364 CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::StartL" ); |
283 |
365 |
|
366 if ( ScreenSaverOn() || AutolockOn() ) |
|
367 { |
|
368 // Screen saver or Autolock is active. Cancel the dialog. |
|
369 CLOG_WRITE( "CConnDlgAuthenticationPlugin::StartL: Screen saver or Autolock is active." ); |
|
370 aMessage.Complete( KErrCancel ); |
|
371 return; |
|
372 } |
|
373 |
|
374 if ( aBuffer.Length() > iAuthPairBuff.Length() ) |
|
375 { |
|
376 CLOG_WRITE( "User::Panic, EConnDlgIllegalRequest" ); |
|
377 User::Panic( KConnDlgPluginPanic, EConnDlgIllegalRequest ); |
|
378 } |
|
379 |
|
380 iAuthPairBuff.Copy( aBuffer ); |
|
381 |
284 iReplySlot = aReplySlot; |
382 iReplySlot = aReplySlot; |
285 iMessage = aMessage; |
383 iMessage = aMessage; |
286 iCancelled = EFalse; |
384 iCancelled = EFalse; |
287 |
385 |
288 // The UI is deprecated, just complete the request |
386 GetAuthenticationL(); |
289 CompleteL(KErrNotSupported); |
|
290 |
387 |
291 CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::StartL" ); |
388 CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::StartL" ); |
292 } |
389 } |
293 |
390 |
294 |
391 |
306 iCancelled = ETrue; |
403 iCancelled = ETrue; |
307 if ( !iMessage.IsNull() ) |
404 if ( !iMessage.IsNull() ) |
308 { |
405 { |
309 iMessage.Complete( KErrCancel ); |
406 iMessage.Complete( KErrCancel ); |
310 } |
407 } |
|
408 delete iDialog; |
|
409 iDialog = NULL; |
311 } |
410 } |
312 |
411 |
313 CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::Cancel" ); |
412 CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::Cancel" ); |
|
413 } |
|
414 |
|
415 |
|
416 // --------------------------------------------------------- |
|
417 // void CConnDlgAuthenticationPlugin::GetAuthenticationL() |
|
418 // --------------------------------------------------------- |
|
419 // |
|
420 void CConnDlgAuthenticationPlugin::GetAuthenticationL() |
|
421 { |
|
422 CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::GetAuthenticationL" ); |
|
423 |
|
424 iDialog = CAuthenticationDialog::NewL( this, iAuthPairBuff().iUsername, |
|
425 iAuthPairBuff().iPassword ); |
|
426 |
|
427 |
|
428 iDialog->ExecuteLD( R_CONNDLG_AUTHENTICATION ); |
|
429 |
|
430 CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::GetAuthenticationL" ); |
314 } |
431 } |
315 |
432 |
316 |
433 |
317 // --------------------------------------------------------- |
434 // --------------------------------------------------------- |
318 // void CConnDlgAuthenticationPlugin::CompleteL( TInt aStatus ) |
435 // void CConnDlgAuthenticationPlugin::CompleteL( TInt aStatus ) |
336 // --------------------------------------------------------- |
458 // --------------------------------------------------------- |
337 // CConnDlgAuthenticationPlugin* CConnDlgAuthenticationPlugin::NewL() |
459 // CConnDlgAuthenticationPlugin* CConnDlgAuthenticationPlugin::NewL() |
338 // --------------------------------------------------------- |
460 // --------------------------------------------------------- |
339 // |
461 // |
340 CConnDlgAuthenticationPlugin* CConnDlgAuthenticationPlugin::NewL( |
462 CConnDlgAuthenticationPlugin* CConnDlgAuthenticationPlugin::NewL( |
341 const TBool /*aResourceFileResponsible*/ ) |
463 const TBool aResourceFileResponsible ) |
342 { |
464 { |
343 CConnDlgAuthenticationPlugin* self = new (ELeave) |
465 CConnDlgAuthenticationPlugin* self = new (ELeave) |
344 CConnDlgAuthenticationPlugin(); |
466 CConnDlgAuthenticationPlugin(); |
|
467 CleanupStack::PushL( self ); |
|
468 self->ConstructL( KResourceFileName, aResourceFileResponsible ); |
|
469 CleanupStack::Pop(); |
|
470 |
345 return self; |
471 return self; |
346 } |
472 } |
347 |
473 |
348 |
474 |
349 // --------------------------------------------------------- |
475 // --------------------------------------------------------- |
350 // CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin() |
476 // CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin() |
351 // --------------------------------------------------------- |
477 // --------------------------------------------------------- |
352 // |
478 // |
353 CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin() |
479 CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin() |
|
480 : iAuthPair( TAuthenticationPair() ) |
354 { |
481 { |
355 } |
482 } |
356 |
483 |
357 |
484 |
358 // --------------------------------------------------------- |
485 // --------------------------------------------------------- |
598 // --------------------------------------------------------- |
795 // --------------------------------------------------------- |
599 // void CConnDlgSelectConnectionPlugin::StartL |
796 // void CConnDlgSelectConnectionPlugin::StartL |
600 // --------------------------------------------------------- |
797 // --------------------------------------------------------- |
601 // |
798 // |
602 |
799 |
603 void CConnDlgSelectConnectionPlugin::StartL( const TDesC8& /*aBuffer*/, |
800 void CConnDlgSelectConnectionPlugin::StartL( const TDesC8& aBuffer, |
604 TInt aReplySlot, |
801 TInt aReplySlot, |
605 const RMessagePtr2& aMessage ) |
802 const RMessagePtr2& aMessage ) |
606 { |
803 { |
607 |
804 CLOG_ENTERFN( "CConnDlgSelectConnectionPlugin::StartL" ); |
|
805 |
|
806 if ( iActivePlugin ) |
|
807 { |
|
808 aMessage.Complete( KErrServerBusy ); |
|
809 return; |
|
810 } |
|
811 |
|
812 TInt iStartUpPhaseValue( EStartupUiPhaseUninitialized ); |
|
813 RProperty::Get( KPSUidStartup, KPSStartupUiPhase, iStartUpPhaseValue ); |
|
814 CLOG_WRITEF( _L( "CConnDlgSelectConnectionPlugin::Phone start up phase: %d" ), |
|
815 iStartUpPhaseValue ); |
|
816 // Don't show the dialog if phone boot up isn't complete or screen saver or Autolock is on. |
|
817 if ( iStartUpPhaseValue != EStartupUiPhaseAllDone || ScreenSaverOn() || AutolockOn() ) |
|
818 { |
|
819 CLOG_WRITE( "CConnDlgSelectConnectionPlugin::StartL: Screen saver or Autolock is active or start up phase not completed yet." ); |
|
820 aMessage.Complete( KErrCancel ); |
|
821 return; |
|
822 } |
|
823 |
|
824 iPrefs.Copy( ( TPtrC8 ) aBuffer ); |
|
825 |
|
826 iCancelled = ETrue; // This method could leave before displaying the dialog. |
608 iReplySlot = aReplySlot; |
827 iReplySlot = aReplySlot; |
609 iMessage = aMessage; |
828 iMessage = aMessage; |
610 |
829 |
611 // because the connection dialog is deprecated and removed functionality, |
830 __ASSERT_DEBUG( !iActivePlugin, |
612 // return the Internet SNAP and complete |
831 User::Panic( KErrActiveObjectNull, KErrNone ) ); |
613 RCmManager cmManager; |
832 |
614 cmManager.OpenL(); |
833 iElementID = iPrefs().iRank; |
615 CleanupClosePushL( cmManager ); |
834 iActivePlugin = CActiveSelectConnectionPlugin::NewL( this, |
616 |
835 iElementID, |
617 RArray<TUint32> destinationArray; |
836 iPrefs().iBearerSet ); |
618 cmManager.AllDestinationsL( destinationArray ); |
837 // Check if there is a suitable active connection |
619 CleanupClosePushL(destinationArray); |
838 TInt snap( 0 ); |
620 bool found = false; |
839 TInt iap( 0 ); |
621 |
840 TInt bearer( ECommDbBearerWLAN ); // User conn. is always WLAN in 9.1 |
622 // loop the destinations and find the internet snap |
841 |
623 for (TInt i = 0; i < destinationArray.Count() && !found; ++i) |
842 // Is there active User connection |
624 { |
843 TInt err = GetUserConnection( iap, snap ); |
625 RCmDestination destination = cmManager.DestinationL( destinationArray[i] ); |
844 |
626 CleanupClosePushL(destination); |
845 if ( ( err != KErrNone ) || ( iap == 0 && snap == 0 ) ) |
|
846 { |
|
847 // Is there any active connection |
|
848 err = GetActiveConnection( iap, snap, bearer ); |
|
849 } |
|
850 |
|
851 RVpnServ vpn; |
|
852 TInt vpnErr( KErrNone ); |
|
853 TInt policyCount( 0 ); |
|
854 TBool forceDialogForIntranetUsers( EFalse ); |
|
855 |
|
856 vpnErr = vpn.Connect(); |
|
857 if ( !vpnErr ) |
|
858 { |
|
859 vpnErr = vpn.EnumeratePolicies(policyCount); |
|
860 if ( !vpnErr && policyCount > 0 ) |
|
861 { |
|
862 forceDialogForIntranetUsers = ETrue; |
|
863 } |
|
864 vpn.Close(); |
|
865 } |
627 |
866 |
628 TUint32 purposeMetaData = destination.MetadataL( CMManager::ESnapMetadataPurpose ); |
867 if ( !forceDialogForIntranetUsers && |
629 if ( CMManager::ESnapPurposeInternet == purposeMetaData ) |
868 ( err == KErrNone ) && |
630 { |
869 ( iap != 0 || snap != 0 ) && |
631 iElementID = destination.ElementId(); |
870 ( iPrefs().iBearerSet & bearer ) && |
632 found = true; |
871 ( iPrefs().iDirection == 0 ) ) // JavaVM sets iDirection to "1" |
633 } |
872 { |
634 CleanupStack::PopAndDestroy(); //destination |
873 // a suitable connection is already active |
635 } |
874 SetElementIDL( iap, snap ); |
636 CleanupStack::PopAndDestroy(); //destinationArray |
875 CompleteL( KErrNone ); |
637 CleanupStack::PopAndDestroy(); //cmManager |
876 } |
638 |
877 else |
639 if (found) |
878 { |
640 { |
879 // display dialog |
641 CompleteL(KErrNone); |
880 iActivePlugin->ShowSelectConnectionL(); |
642 } |
881 iCancelled = EFalse; // Dialog is now up and running |
643 else |
882 } |
644 { |
883 } |
645 CompleteL(KErrNotFound); |
884 |
646 } |
885 |
647 } |
|
648 |
886 |
649 // --------------------------------------------------------- |
887 // --------------------------------------------------------- |
650 // void CConnDlgSelectConnectionPlugin::Cancel() |
888 // void CConnDlgSelectConnectionPlugin::Cancel() |
651 // --------------------------------------------------------- |
889 // --------------------------------------------------------- |
652 // |
890 // |
653 void CConnDlgSelectConnectionPlugin::Cancel() |
891 void CConnDlgSelectConnectionPlugin::Cancel() |
654 { |
892 { |
655 CLOG_ENTERFN( "CConnDlgSelectConnectionPlugin::Cancel" ); |
893 CLOG_ENTERFN( "CConnDlgSelectConnectionPlugin::Cancel" ); |
|
894 |
|
895 delete iActivePlugin; |
|
896 CLOG_WRITE( "iActivePlugin deleted" ); |
|
897 iActivePlugin = NULL; |
|
898 CLOG_WRITE( "iActivePlugin NULLed" ); |
656 |
899 |
657 if ( !iCancelled ) |
900 if ( !iCancelled ) |
658 { |
901 { |
659 CLOG_WRITE( "iCancelled == EFalse" ); |
902 CLOG_WRITE( "iCancelled == EFalse" ); |
660 iCancelled = ETrue; |
903 iCancelled = ETrue; |
699 // --------------------------------------------------------- |
942 // --------------------------------------------------------- |
700 // CConnDlgSelectConnectionPlugin* CConnDlgSelectConnectionPlugin::NewL() |
943 // CConnDlgSelectConnectionPlugin* CConnDlgSelectConnectionPlugin::NewL() |
701 // --------------------------------------------------------- |
944 // --------------------------------------------------------- |
702 // |
945 // |
703 CConnDlgSelectConnectionPlugin* CConnDlgSelectConnectionPlugin::NewL( |
946 CConnDlgSelectConnectionPlugin* CConnDlgSelectConnectionPlugin::NewL( |
704 const TBool /*aResourceFileResponsible*/ ) |
947 const TBool aResourceFileResponsible ) |
705 { |
948 { |
706 CConnDlgSelectConnectionPlugin* self = |
949 CConnDlgSelectConnectionPlugin* self = |
707 new (ELeave) CConnDlgSelectConnectionPlugin(); |
950 new (ELeave) CConnDlgSelectConnectionPlugin(); |
|
951 CleanupStack::PushL( self ); |
|
952 self->ConstructL( KResourceFileName, aResourceFileResponsible ); |
|
953 CleanupStack::Pop(); |
|
954 |
708 return self; |
955 return self; |
709 } |
956 } |
710 |
957 |
|
958 |
|
959 // --------------------------------------------------------- |
|
960 // CConnDlgSelectConnectionPlugin::SetSelectedIDsL |
|
961 // --------------------------------------------------------- |
|
962 // |
|
963 void CConnDlgSelectConnectionPlugin::SetElementIDL( TUint32 aIAPId, |
|
964 TUint32 aDestinationId ) |
|
965 { |
|
966 iElementID = iActivePlugin->GetElementIDL( aIAPId, aDestinationId ); |
|
967 } |
|
968 |
|
969 |
|
970 // --------------------------------------------------------- |
|
971 // CConnDlgSelectConnectionPlugin::GetUserConnection |
|
972 // --------------------------------------------------------- |
|
973 // |
|
974 TInt CConnDlgSelectConnectionPlugin::GetUserConnection( TInt& aIapId, |
|
975 TInt& aSnapId ) |
|
976 { |
|
977 aIapId = 0; |
|
978 aSnapId = 0; |
|
979 |
|
980 TInt err = RProperty::Get( KMPMUserConnectionCategory, |
|
981 KMPMPSKeyUserConnectionSnap, |
|
982 aSnapId ); |
|
983 |
|
984 if ( err != KErrNone || aSnapId == 0 ) |
|
985 { |
|
986 err = RProperty::Get( KMPMUserConnectionCategory, |
|
987 KMPMPSKeyUserConnectionIap, |
|
988 aIapId ); |
|
989 } |
|
990 |
|
991 CLOG_WRITEF( _L( "KMPMPSKeyUserConnectionSnap : %d" ), aSnapId ); |
|
992 CLOG_WRITEF( _L( "KMPMPSKeyUserConnectionIap : %d" ), aIapId ); |
|
993 CLOG_WRITEF( _L( "err : %d" ), err ); |
|
994 |
|
995 return err; |
|
996 } |
|
997 |
|
998 |
|
999 // --------------------------------------------------------- |
|
1000 // CConnDlgSelectConnectionPlugin::GetActiveConnection |
|
1001 // --------------------------------------------------------- |
|
1002 // |
|
1003 TInt CConnDlgSelectConnectionPlugin::GetActiveConnection( TInt& aIapId, |
|
1004 TInt& aSnapId, |
|
1005 TInt& aBearer ) |
|
1006 { |
|
1007 aIapId = 0; |
|
1008 aSnapId = 0; |
|
1009 aBearer = 0; |
|
1010 |
|
1011 TInt err = RProperty::Get( KMPMActiveConnectionCategory, |
|
1012 KMPMPSKeyActiveConnectionSnap, |
|
1013 aSnapId ); |
|
1014 |
|
1015 if ( err != KErrNone || aSnapId == 0 ) |
|
1016 { |
|
1017 err = RProperty::Get( KMPMActiveConnectionCategory, |
|
1018 KMPMPSKeyActiveConnectionIap, |
|
1019 aIapId ); |
|
1020 } |
|
1021 |
|
1022 CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionSnap : %d" ), aSnapId ); |
|
1023 CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionIap : %d" ), aIapId ); |
|
1024 CLOG_WRITEF( _L( "err : %d" ), err ); |
|
1025 |
|
1026 if ( err == KErrNone ) |
|
1027 { |
|
1028 err = RProperty::Get( KMPMActiveConnectionCategory, |
|
1029 KMPMPSKeyActiveConnectionBearer, |
|
1030 aBearer ); |
|
1031 } |
|
1032 |
|
1033 CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionBearer : %d" ), aBearer ); |
|
1034 CLOG_WRITEF( _L( "iPrefs().iBearerSet : %d" ), iPrefs().iBearerSet ); |
|
1035 CLOG_WRITEF( _L( "err : %d" ), err ); |
|
1036 |
|
1037 return err; |
|
1038 } |
711 |
1039 |
712 // End of File |
1040 // End of File |