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