bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp
branchRCL_3
changeset 69 cf1b3ddbe9a1
parent 58 83ca720e2b9a
equal deleted inserted replaced
65:14754bf06654 69:cf1b3ddbe9a1
   355                                                               activity.iIsSeamless );
   355                                                               activity.iIsSeamless );
   356 
   356 
   357         activity.PostToOriginators(msg);
   357         activity.PostToOriginators(msg);
   358         activity.ClearPostedTo();
   358         activity.ClearPostedTo();
   359         activity.SetHandshakingFlag();
   359         activity.SetHandshakingFlag();
       
   360         
       
   361         
       
   362 #ifdef _DEBUG
       
   363         // Purely for debugging purposes
       
   364         CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
       
   365         if ( node.IsGoneDownRecoveryOngoing() )
       
   366             {
       
   367             S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableAndSetHandshakingFlag::DoL() Start mobility handshake while gone down recovery is active",(TInt*)&iContext.Node())
       
   368             // During the handshake, there is four different paths that 
       
   369             // needs to be considered for reseting the gone down recovery
       
   370             // flag. These are:
       
   371             // 1) Migration is done successfully
       
   372             // 2) Application rejects the migration
       
   373             // 3) While migrating, a new preferred carrier is found       
       
   374             // 4) Operation is cancelled or an error occurs
       
   375             //
       
   376             // For 1) and 2) the flag needs to be reset, where as for 3) we
       
   377             // can keep the flag set until the "loop" is exited with a valid
       
   378             // reselection (essentially this will be same as 1) but only
       
   379             // after a couple of retrials). For the last option 4) the
       
   380             // connection is tear down and reseting the flag is not needed.
       
   381             }
       
   382 #endif
       
   383         
   360         }
   384         }
   361 
   385 
   362     
   386     
   363     // -----------------------------------------------------------------------------
   387     // -----------------------------------------------------------------------------
   364     // CS60MobilityActivity::TSendMigrationRejected::DoL
   388     // CS60MobilityActivity::TSendMigrationRejected::DoL
   371         {
   395         {
   372         S60MCPRLOGSTRING1("S60MCPR<%x>::TSendMigrationRejected::DoL()",(TInt*)&iContext.Node())
   396         S60MCPRLOGSTRING1("S60MCPR<%x>::TSendMigrationRejected::DoL()",(TInt*)&iContext.Node())
   373         CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
   397         CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
   374         CS60MobilityActivity& activity = static_cast<CS60MobilityActivity&>(*iContext.iNodeActivity);
   398         CS60MobilityActivity& activity = static_cast<CS60MobilityActivity&>(*iContext.iNodeActivity);
   375         node.Policy()->ApplicationIgnoredTheCarrierL( activity.iPreferredAPId );
   399         node.Policy()->ApplicationIgnoredTheCarrierL( activity.iPreferredAPId );
       
   400         if (node.IsGoneDownRecoveryOngoing() )
       
   401             {
       
   402             // Too bad... Old link has gone down, and application rejected
       
   403             // the new one. Nothing but problems ahead, but who cares, if
       
   404             // the application doesn't. So reset the gone down recovery flag
       
   405             // and assume that everybody is happy with the choise.
       
   406             S60MCPRLOGSTRING1("S60MCPR<%x>::TSendMigrationRejected::DoL() Application rejected the carrier during gone down recovery -> reset flag",(TInt*)&iContext.Node())
       
   407             node.ClearGoneDownRecoveryOngoing();
       
   408             }
   376         }
   409         }
   377 
   410 
   378 
   411 
   379     // -----------------------------------------------------------------------------
   412     // -----------------------------------------------------------------------------
   380     // CS60MobilityActivity::TSendMigrationAccepted::DoL
   413     // CS60MobilityActivity::TSendMigrationAccepted::DoL
   447                       NetStateMachine::MStateTransition, CS60MobilityActivity::TContext )
   480                       NetStateMachine::MStateTransition, CS60MobilityActivity::TContext )
   448     void CS60MobilityActivity::TInformMigrationCompleted::DoL()
   481     void CS60MobilityActivity::TInformMigrationCompleted::DoL()
   449         {
   482         {
   450         S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationCompleted::DoL()",(TInt*)&iContext.Node())
   483         S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationCompleted::DoL()",(TInt*)&iContext.Node())
   451         __ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KS60MCprPanic, KPanicNoActivity));
   484         __ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KS60MCprPanic, KPanicNoActivity));
       
   485         CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
       
   486         if ( node.IsGoneDownRecoveryOngoing() )
       
   487             {
       
   488             // Now we are on a safe side, since the reselect has been done
       
   489             // IPCPr can and will complete NoBearer requests to the new
       
   490             // interface instead of the old one. Reset the flag.
       
   491             S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationCompleted::DoL() New bearer selected while in gone down recovery -> reset flag",(TInt*)&iContext.Node())
       
   492             node.ClearGoneDownRecoveryOngoing();
       
   493             }
   452         iContext.iNodeActivity->PostToOriginators(TCFMobilityProvider::TMigrationComplete().CRef());
   494         iContext.iNodeActivity->PostToOriginators(TCFMobilityProvider::TMigrationComplete().CRef());
   453         iContext.iNodeActivity->ClearPostedTo();
   495         iContext.iNodeActivity->ClearPostedTo();
   454         }
   496         }
   455     
   497     
   456     
   498     
   469         node.Policy()->UnregisterPreferredIAPNotificationL();
   511         node.Policy()->UnregisterPreferredIAPNotificationL();
   470         // Clear the mobility handshaking flag.
   512         // Clear the mobility handshaking flag.
   471         // 
   513         // 
   472         CS60MobilityActivity& activity = static_cast<CS60MobilityActivity&>(*iContext.iNodeActivity);
   514         CS60MobilityActivity& activity = static_cast<CS60MobilityActivity&>(*iContext.iNodeActivity);
   473         activity.ClearHandshakingFlag();
   515         activity.ClearHandshakingFlag();
       
   516         
       
   517         if ( node.IsGoneDownRecoveryOngoing() )
       
   518             {
       
   519             // Migration either errored or was cancelled while in gone down
       
   520             // recovery. Node will be destroyed, so there is no point in
       
   521             // such, but reset the flag anyway..
       
   522             S60MCPRLOGSTRING1("S60MCPR<%x>::TCancelAvailabilityRequest::DoL() Error in migration while in gone down recovery -> reset flag",(TInt*)&iContext.Node())
       
   523             node.ClearGoneDownRecoveryOngoing();
       
   524             }
       
   525         
   474         // At last we must set the activity in error since we're ready to go down.
   526         // At last we must set the activity in error since we're ready to go down.
   475         //
   527         //
   476         iContext.iNodeActivity->SetError( KErrCancel );
   528         iContext.iNodeActivity->SetError( KErrCancel );
   477         }
   529         }
   478 
   530