telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp
branchRCL_3
changeset 7 fe8b59ab9fa0
parent 5 7ef16719d8cb
child 15 8b9e023e329f
--- a/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp	Mon Mar 15 12:45:06 2010 +0200
+++ b/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp	Wed Mar 31 23:24:02 2010 +0300
@@ -123,7 +123,8 @@
     return mmPhoneTsy;
     }
 
-CMmPhoneTsy::CMmPhoneTsy()
+CMmPhoneTsy::CMmPhoneTsy():
+    iReqHandleType(EMultimodePhoneReqHandleUnknown)
     {
     }
 
@@ -788,7 +789,7 @@
 // (other items were commented in a header).
 // ---------------------------------------------------------------------------
 //
-CMmPhoneTsy::CNosBootState* CMmPhoneTsy::NosBootState()
+CMmPhoneTsy::TNosBootState* CMmPhoneTsy::NosBootState()
     {
     return &iBootState;
     }
@@ -805,21 +806,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmPhoneTsy::SetNosBootState
-// Returns current Phonebook state
-// (other items were commented in a header).
-// ---------------------------------------------------------------------------
-//
-void CMmPhoneTsy::SetNosBootState(
-    CMmPhoneTsy::CNosBootState* aNewState )
-    {
-    iBootState.iSIMReady = aNewState->iSIMReady;
-    iBootState.iADNReady = aNewState->iADNReady;
-    iBootState.iSecReady = aNewState->iSecReady;
-    iBootState.iCachingActive = aNewState->iCachingActive;
-    }
-
-// ---------------------------------------------------------------------------
 // CMmPhoneTsy::OpenNewObjectByNameL
 // Creates new object and returns a pointer to it. The ETel
 // Server calls this method after some client has requested to open object
@@ -1140,8 +1126,13 @@
     TInt ret = KErrNone;
     TInt trapError = KErrNone;
 
-    //reset last tsy request type
-    iReqHandleType = EMultimodePhoneReqHandleUnknown;
+    // Ensure the ReqHandleType is unset.
+    // This will detect cases where this method indirectly calls itself
+    // (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
+    // Such cases are not supported because iReqHandleType is in the context of this class instance,
+    // not this request, and we don't want the values set by the inner request and the outer request
+    // interfering with each other.
+    __ASSERT_DEBUG(iReqHandleType==EMultimodePhoneReqHandleUnknown, User::Invariant());
 
     //before processing further the request, check if offline mode status
     //is enabled and if the given request can be perfomed in that case.
@@ -1177,10 +1168,10 @@
             iTsyReqHandleStore->SetTsyReqHandle( 
                 iReqHandleType, aTsyReqHandle );
 #endif //REQHANDLE_TIMER
+            // We've finished with this value now. Clear it so it doesn't leak
+            //  up to any other instances of this method down the call stack
+            iReqHandleType = EMultimodePhoneReqHandleUnknown;
             }
-
-        //reset last tsy request type
-        iReqHandleType = EMultimodePhoneReqHandleUnknown;
         }
 
     return KErrNone;
@@ -2478,7 +2469,7 @@
                 SetTypeOfResponse( EMultimodePhoneTerminateAllCalls, aTsyReqHandle );
 #else
                 iTsyReqHandleStore->SetTsyReqHandle( 
-                		iReqHandleType, aTsyReqHandle );
+                        EMultimodePhoneTerminateAllCalls, aTsyReqHandle );
 #endif //REQHANDLE_TIMER
                 }
             else