bearermanagement/S60MCPR/src/s60mcprsimpleselectactivity.cpp
changeset 18 fcbbe021d614
parent 0 5a93021fdf25
child 48 69385fa96b48
equal deleted inserted replaced
4:77415202bfc8 18:fcbbe021d614
   153             }
   153             }
   154 #endif //_DEBUG
   154 #endif //_DEBUG
   155 
   155 
   156 		TSelectionPrefs prefs;
   156 		TSelectionPrefs prefs;
   157 
   157 
   158 		ESock::RConnPrefList::TIter<TConnCSRPref> iterCSR = node.ConnPrefList().getIter<TConnCSRPref>();
   158         ESock::RConnPrefList::TIter<TConnCSRPref> iterCSR = node.ConnPrefList().getIter<TConnCSRPref>();
   159 		//There should be one and only one CSR pref
   159         //There should be one and only one CSR pref
   160 		ASSERT(iterCSR[0] != NULL && iterCSR[1] == NULL);
   160         ASSERT(iterCSR[0] != NULL && iterCSR[1] == NULL);
   161 		TConnCSRPref* csrprefs = iterCSR[0];
   161         TConnCSRPref* csrprefs = iterCSR[0];
   162 
   162 		prefs.SetSubSessionUniqueId(node.SubSessionUniqueId());
   163 		prefs.SetSubSessionUniqueId(csrprefs->SubSessionUniqueId());
       
   164 		prefs.SetFlags(csrprefs->Flags());
   163 		prefs.SetFlags(csrprefs->Flags());
   165 		prefs.SetScope(csrprefs->Scope());
   164 		prefs.SetScope(csrprefs->Scope());
   166 
   165 
   167 		/*** HACK ALERT!
   166 		/*** HACK ALERT!
   168 
   167 
   170 		TConnAPPref* nextAP = TConnAPPref::NewL(node.PolicyPrefs().IapId());
   169 		TConnAPPref* nextAP = TConnAPPref::NewL(node.PolicyPrefs().IapId());
   171 		CleanupStack::PushL(nextAP);
   170 		CleanupStack::PushL(nextAP);
   172 		node.ConnPrefList().AppendL(nextAP);
   171 		node.ConnPrefList().AppendL(nextAP);
   173 		CleanupStack::Pop();
   172 		CleanupStack::Pop();
   174 		/* END OF HACK */
   173 		/* END OF HACK */
   175 
       
   176 		
   174 		
   177         // Attach. 399 attach shouldn't be visible here.
   175         // Attach. 399 attach shouldn't be visible here.
   178         if ( prefs.Scope()&TSelectionPrefs::ESelectFromExisting )
   176         if ( prefs.Scope()&TSelectionPrefs::ESelectFromExisting )
   179             {
   177             {
   180             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Attach ",(TInt*)&iContext.Node())
   178             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Attach ",(TInt*)&iContext.Node())
   183             }
   181             }
   184         // Start
   182         // Start
   185         else
   183         else
   186             {
   184             {
   187             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Start",(TInt*)&iContext.Node())
   185             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Start",(TInt*)&iContext.Node())
       
   186 
   188             TCommDbConnPref ippprefs;
   187             TCommDbConnPref ippprefs;
   189             ippprefs.SetIapId( node.PolicyPrefs().IapId() );
   188             ippprefs.SetIapId( node.PolicyPrefs().IapId() );
   190             ippprefs.SetNetId( node.PolicyPrefs().NetId() );
   189             ippprefs.SetNetId( node.PolicyPrefs().NetId() );
   191             //node.MapPolicyPrefsToConnPrefL( node.PolicyPrefs(), tmppref );
   190             //node.MapPolicyPrefsToConnPrefL( node.PolicyPrefs(), tmppref );
   192             // don't use reference we want to preserve the original TSelectionPrefs.
   191             // don't use reference we want to preserve the original TSelectionPrefs.
   193             TSelectionPrefs newPrefs;
   192             TSelectionPrefs newPrefs;
   194             newPrefs = prefs;
   193             newPrefs = prefs;
   195             newPrefs.SetPrefs( ippprefs );
   194             newPrefs.SetPrefs( ippprefs );
   196             TCFSelector::TSimpleSelect msg(newPrefs);
   195             TCFSelector::TSimpleSelect msg(newPrefs);
   197             iContext.iNodeActivity->PostRequestTo(ac.iTierManager, msg);
   196             iContext.iNodeActivity->PostRequestTo(ac.iTierManager, msg);
   198 
       
   199             //TODO Clarify, if the SelectionChoices is actually needed...
       
   200             //if (ac.SelectionChoices().Count() == 0)
       
   201             //ac.SelectionChoices().Append(node.iIAPList[0]);
       
   202             }
   197             }
   203         }
   198         }
   204     }
   199     }
   205 
   200 
   206 // -----------------------------------------------------------------------------
   201 // -----------------------------------------------------------------------------
   294             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() SNAP Attach problem!!!!",(TInt*)&iContext.Node())
   289             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() SNAP Attach problem!!!!",(TInt*)&iContext.Node())
   295             __ASSERT_DEBUG(EFalse, User::Panic(KS60MCprPanic, KPanicUnsupportedMCPRState));
   290             __ASSERT_DEBUG(EFalse, User::Panic(KS60MCprPanic, KPanicUnsupportedMCPRState));
   296             }
   291             }
   297 #endif //_DEBUG
   292 #endif //_DEBUG
   298 
   293 
       
   294         TSelectionPrefs newPrefs;
       
   295         newPrefs = node.SelectionPrefs();
       
   296         newPrefs.SetSubSessionUniqueId( node.SubSessionUniqueId() );
       
   297         
   299         // Attach. 399 attach shouldn't be visible here.
   298         // Attach. 399 attach shouldn't be visible here.
   300         if ( node.SelectionPrefs().Scope()&TSelectionPrefs::ESelectFromExisting )
   299         if ( node.SelectionPrefs().Scope()&TSelectionPrefs::ESelectFromExisting )
   301             {
   300             {
   302             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Attach ",(TInt*)&iContext.Node())
   301             S60MCPRLOGSTRING1("S60MCPR<%x>::TSelectNextLayer::DoL() Attach ",(TInt*)&iContext.Node())
   303             TCFSelector::TSimpleSelect msg( node.SelectionPrefs() );
   302             TCFSelector::TSimpleSelect msg( newPrefs );
   304             iContext.iNodeActivity->PostRequestTo( ac.iTierManager, msg );
   303             iContext.iNodeActivity->PostRequestTo( ac.iTierManager, msg );
   305             }
   304             }
   306         // Start
   305         // Start
   307         else
   306         else
   308             {
   307             {
   310             TCommDbConnPref ippprefs;
   309             TCommDbConnPref ippprefs;
   311             ippprefs.SetIapId( node.PolicyPrefs().IapId() );
   310             ippprefs.SetIapId( node.PolicyPrefs().IapId() );
   312             ippprefs.SetNetId( node.PolicyPrefs().NetId() );
   311             ippprefs.SetNetId( node.PolicyPrefs().NetId() );
   313             //node.MapPolicyPrefsToConnPrefL( node.PolicyPrefs(), tmppref );
   312             //node.MapPolicyPrefsToConnPrefL( node.PolicyPrefs(), tmppref );
   314             // don't use reference we want to preserve the original TSelectionPrefs.
   313             // don't use reference we want to preserve the original TSelectionPrefs.
   315             TSelectionPrefs newPrefs;
       
   316             newPrefs = node.SelectionPrefs();
       
   317             newPrefs.SetPrefs( ippprefs );
   314             newPrefs.SetPrefs( ippprefs );
   318             TCFSelector::TSimpleSelect msg(newPrefs);
   315             TCFSelector::TSimpleSelect msg(newPrefs);
   319             iContext.iNodeActivity->PostRequestTo(ac.iTierManager, msg);
   316             iContext.iNodeActivity->PostRequestTo(ac.iTierManager, msg);
   320 
       
   321             //TODO Clarify, if the SelectionChoices is actually needed...
       
   322             //if (ac.SelectionChoices().Count() == 0)
       
   323             //ac.SelectionChoices().Append(node.iIAPList[0]);
       
   324             }
   317             }
   325         }
   318         }
   326 
   319 
   327     // -----------------------------------------------------------------------------
   320     // -----------------------------------------------------------------------------
   328     // Post ChooseBestIAP to MPM.
   321     // Post ChooseBestIAP to MPM.
   347         CChooseBestIAPCb* cb = new( ELeave ) CChooseBestIAPCb( node, iContext.iNodeActivity );
   340         CChooseBestIAPCb* cb = new( ELeave ) CChooseBestIAPCb( node, iContext.iNodeActivity );
   348 
   341 
   349         CleanupStack::PushL( cb );
   342         CleanupStack::PushL( cb );
   350 
   343 
   351         // Resolve application uid.
   344         // Resolve application uid.
   352         TSubSessionUniqueId subSessionUniqueId = node.SelectionPrefs().SubSessionUniqueId();
   345         TSubSessionUniqueId subSessionUniqueId = node.SubSessionUniqueId();
   353 
       
   354 		if ( !node.ConnPrefList().Count() )
       
   355 			{
       
   356             subSessionUniqueId = node.SelectionPrefs().SubSessionUniqueId();
       
   357             }
       
   358         else
       
   359             {
       
   360             subSessionUniqueId = node.SubSessionUniqueId();
       
   361             }
       
   362 
   346 
   363         TSecureId secureId( 0 );
   347         TSecureId secureId( 0 );
   364         
   348         
   365         // Note that we use Symbian internal API to resolve the uid. 
   349         // Note that we use Symbian internal API to resolve the uid. 
   366         AIPCClientInfo clientinfo;
   350         AIPCClientInfo clientinfo;