telephonyserverplugins/simatktsy/src/CSatNotifyLaunchBrowser.cpp
branchRCL_3
changeset 66 07a122eea281
parent 65 630d2f34d719
equal deleted inserted replaced
65:630d2f34d719 66:07a122eea281
     1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 //
    18 //
    19 
    19 
    20 
    20 
    21 
    21 
    22 //INCLUDES
    22 //INCLUDES
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "CSatNotifyLaunchBrowserTraces.h"
       
    27 #endif
       
    28 
       
    29 #include <satcs.h>                  // Etel SAT IPC definitions
    23 #include <satcs.h>                  // Etel SAT IPC definitions
    30 #include "CSatTsy.h"                // Tsy class header
    24 #include "CSatTsy.h"                // Tsy class header
    31 #include "CSatNotifyLaunchBrowser.h"// Tsy class header
    25 #include "CSatNotifyLaunchBrowser.h"// Tsy class header
    32 #include "CSatNotificationsTsy.h"   // Class header
    26 #include "CSatNotificationsTsy.h"   // Class header
    33 #include "CBerTlv.h"                // Ber Tlv data handling
    27 #include "CBerTlv.h"                // Ber Tlv data handling
    34 #include "TTlv.h"					// TTlv class
    28 #include "TTlv.h"					// TTlv class
    35 #include "CSatDataPackage.h"        // Parameter packing 
    29 #include "CSatDataPackage.h"        // Parameter packing 
       
    30 #include "TfLogger.h"               // For TFLOGSTRING
    36 #include "TSatUtility.h"            // Utilities
    31 #include "TSatUtility.h"            // Utilities
    37 #include "CSatTsyReqHandleStore.h"  // Request handle class
    32 #include "CSatTsyReqHandleStore.h"  // Request handle class
    38 #include "cmmmessagemanagerbase.h"  // Message manager class for forwarding req.
    33 #include "cmmmessagemanagerbase.h"  // Message manager class for forwarding req.
    39 
    34 
    40 // -----------------------------------------------------------------------------
    35 // -----------------------------------------------------------------------------
    45 CSatNotifyLaunchBrowser* CSatNotifyLaunchBrowser::NewL
    40 CSatNotifyLaunchBrowser* CSatNotifyLaunchBrowser::NewL
    46         ( 
    41         ( 
    47         CSatNotificationsTsy* aNotificationsTsy 
    42         CSatNotificationsTsy* aNotificationsTsy 
    48         )
    43         )
    49     {
    44     {
    50     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_NEWL_1, "CSAT: CSatNotifyLaunchBrowser::NewL");
    45     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::NewL");
    51    	CSatNotifyLaunchBrowser* const satNotifyLaunchBrowser = 
    46    	CSatNotifyLaunchBrowser* const satNotifyLaunchBrowser = 
    52         new ( ELeave ) CSatNotifyLaunchBrowser( aNotificationsTsy );
    47         new ( ELeave ) CSatNotifyLaunchBrowser( aNotificationsTsy );
    53     CleanupStack::PushL( satNotifyLaunchBrowser );
    48     CleanupStack::PushL( satNotifyLaunchBrowser );
    54     satNotifyLaunchBrowser->ConstructL();
    49     satNotifyLaunchBrowser->ConstructL();
    55     CleanupStack::Pop( satNotifyLaunchBrowser );
    50     CleanupStack::Pop( satNotifyLaunchBrowser );
    56     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_NEWL_2, "CSAT: CSatNotifyLaunchBrowser::NewL, end of method");
    51     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::NewL, end of method");
    57     return satNotifyLaunchBrowser;
    52     return satNotifyLaunchBrowser;
    58     }
    53     }
    59 
    54 
    60 // -----------------------------------------------------------------------------
    55 // -----------------------------------------------------------------------------
    61 // CSatNotifyLaunchBrowser::~CSatNotifyLaunchBrowser
    56 // CSatNotifyLaunchBrowser::~CSatNotifyLaunchBrowser
    65 CSatNotifyLaunchBrowser::~CSatNotifyLaunchBrowser
    60 CSatNotifyLaunchBrowser::~CSatNotifyLaunchBrowser
    66         ( 
    61         ( 
    67 		// None
    62 		// None
    68         )
    63         )
    69     {
    64     {
    70     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_DTOR_1, "CSAT: CSatNotifyLaunchBrowser::~CSatNotifyLaunchBrowser");
    65     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::~CSatNotifyLaunchBrowser");
    71     }
    66     }
    72     
    67     
    73 // -----------------------------------------------------------------------------
    68 // -----------------------------------------------------------------------------
    74 // CSatNotifyLaunchBrowser::CSatNotifyLaunchBrowser
    69 // CSatNotifyLaunchBrowser::CSatNotifyLaunchBrowser
    75 // Default C++ constructor
    70 // Default C++ constructor
    91 void CSatNotifyLaunchBrowser::ConstructL
    86 void CSatNotifyLaunchBrowser::ConstructL
    92         (
    87         (
    93         // None
    88         // None
    94         )
    89         )
    95     {
    90     {
    96     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_CONSTRUCTL_1, "CSAT: CSatNotifyLaunchBrowser::ConstructL");
    91     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ConstructL");
    97     iSsStatus = CSatNotificationsTsy::ENotBusy;
    92     iSsStatus = CSatNotificationsTsy::ENotBusy;
    98     }
    93     }
    99     
    94     
   100 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
   101 // CSatNotifyLaunchBrowser::Notify
    96 // CSatNotifyLaunchBrowser::Notify
   107         (
   102         (
   108         const TTsyReqHandle aTsyReqHandle,
   103         const TTsyReqHandle aTsyReqHandle,
   109         const TDataPackage& aPackage   
   104         const TDataPackage& aPackage   
   110         )
   105         )
   111     {
   106     {
   112     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_NOTIFY_1, "CSAT: CSatNotifyLaunchBrowser::Notify");
   107     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::Notify");
   113     // Save data pointer to client side for completion
   108     // Save data pointer to client side for completion
   114     iLaunchBrowserV2Pckg = reinterpret_cast<RSat::TLaunchBrowserV2Pckg*>( 
   109     iLaunchBrowserV2Pckg = reinterpret_cast<RSat::TLaunchBrowserV2Pckg*>( 
   115         aPackage.Des1n() );
   110         aPackage.Des1n() );
   116     // Save the request handle
   111     // Save the request handle
   117     iNotificationsTsy->iSatTsy->SaveReqHandle( aTsyReqHandle, 
   112     iNotificationsTsy->iSatTsy->SaveReqHandle( aTsyReqHandle, 
   131 TInt CSatNotifyLaunchBrowser::CancelNotification
   126 TInt CSatNotifyLaunchBrowser::CancelNotification
   132         (
   127         (
   133         const TTsyReqHandle aTsyReqHandle
   128         const TTsyReqHandle aTsyReqHandle
   134         )
   129         )
   135     {
   130     {
   136     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_CANCELNOTIFICATION_1, "CSAT: CSatNotifyLaunchBrowser::CancelNotification");
   131     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::CancelNotification");
   137     
   132     
   138     // Reset the request handle
   133     // Reset the request handle
   139     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   134     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   140         ResetTsyReqHandle( CSatTsy::ESatNotifyLaunchBrowserPCmdReqType );
   135         ResetTsyReqHandle( CSatTsy::ESatNotifyLaunchBrowserPCmdReqType );
   141 	// Reset the data pointer
   136 	// Reset the data pointer
   158         (
   153         (
   159         CSatDataPackage* aDataPackage,  
   154         CSatDataPackage* aDataPackage,  
   160         TInt aErrorCode
   155         TInt aErrorCode
   161         )
   156         )
   162     {  
   157     {  
   163 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_1, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL");
   158 	TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL");
   164 	TInt ret( KErrNone );
   159 	TInt ret( KErrNone );
   165 	TInt returnValue( KErrNone );		
   160 	TInt returnValue( KErrNone );		
   166     // Unpack parameters
   161     // Unpack parameters
   167     TPtrC8* data;
   162     TPtrC8* data;
   168     aDataPackage->UnPackData( &data );
   163     aDataPackage->UnPackData( &data );
   186     if ( CSatTsy::ESatReqHandleUnknown != reqHandle )
   181     if ( CSatTsy::ESatReqHandleUnknown != reqHandle )
   187         {		
   182         {		
   188 		// Check if busy 
   183 		// Check if busy 
   189     	if ( CSatNotificationsTsy::ENotBusy != iSsStatus )
   184     	if ( CSatNotificationsTsy::ENotBusy != iSsStatus )
   190     		{
   185     		{
   191     		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_2, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, iSsStatus is busy");
   186     		TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, \
       
   187     			iSsStatus is busy");
   192 
   188 
   193         	if( CSatNotificationsTsy::EUssdBusy == iSsStatus)
   189         	if( CSatNotificationsTsy::EUssdBusy == iSsStatus)
   194     			{
   190     			{
   195     			// Ussd transaction ongoing
   191     			// Ussd transaction ongoing
   196     			CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd, 
   192     			CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd, 
   203 			        RSat::KMeBusyOnSs );		
   199 			        RSat::KMeBusyOnSs );		
   204     			}		
   200     			}		
   205     		}
   201     		}
   206     	else
   202     	else
   207     		{	    
   203     		{	    
   208 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_3, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL No SS Transaction ongoing");
   204 			TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL \
       
   205 				No SS Transaction ongoing");
   209 			// Complete right away if error has occured, otherwise continue..
   206 			// Complete right away if error has occured, otherwise continue..
   210 	        if ( KErrNone == aErrorCode )
   207 	        if ( KErrNone == aErrorCode )
   211 	            {			
   208 	            {			
   212 				// Launch browser structure
   209 				// Launch browser structure
   213 				RSat::TLaunchBrowserV2& launchBrowserV2 = 
   210 				RSat::TLaunchBrowserV2& launchBrowserV2 = 
   237             			break;
   234             			break;
   238             			}
   235             			}
   239             		case KLaunchBrowserCmdQualifierNotUsed:
   236             		case KLaunchBrowserCmdQualifierNotUsed:
   240             		case KLaunchBrowserCmdQualifierReserved:
   237             		case KLaunchBrowserCmdQualifierReserved:
   241             			{
   238             			{
   242             			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_4, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, Command Type not understood");
   239             			TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::\
       
   240             			    CompleteNotifyL, Command Type not understood");
   243             			CreateTerminalRespL( pCmdNumber, 
   241             			CreateTerminalRespL( pCmdNumber, 
   244             			    RSat::KCmdTypeNotUnderstood, KNoCause );
   242             			    RSat::KCmdTypeNotUnderstood, KNoCause );
   245                         ret = KErrCorrupt;
   243                         ret = KErrCorrupt;
   246             			break;
   244             			break;
   247             			}
   245             			}
   298 					launchBrowserV2.iAlphaId.iStatus = 
   296 					launchBrowserV2.iAlphaId.iStatus = 
   299 					    RSat::EAlphaIdNotPresent;
   297 					    RSat::EAlphaIdNotPresent;
   300 					
   298 					
   301 					if ( KErrNotFound != returnValue )
   299 					if ( KErrNotFound != returnValue )
   302 						{
   300 						{
   303 						OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_5, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, Alpha ID present");
   301 						TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::\
       
   302 					        CompleteNotifyL, Alpha ID present");
   304 						TUint8 alphaIdLength( alphaIdentifier.GetLength() );
   303 						TUint8 alphaIdLength( alphaIdentifier.GetLength() );
   305 						if ( alphaIdLength )
   304 						if ( alphaIdLength )
   306 							{
   305 							{
   307 							TPtrC8 sourceString;
   306 							TPtrC8 sourceString;
   308 
   307 
   317 							launchBrowserV2.iAlphaId.iStatus = 
   316 							launchBrowserV2.iAlphaId.iStatus = 
   318 							    RSat::EAlphaIdProvided;
   317 							    RSat::EAlphaIdProvided;
   319 							}
   318 							}
   320 						else
   319 						else
   321 							{
   320 							{
   322 							OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_6, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, Alpha ID is NULL");
   321 							TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::\
       
   322 							    CompleteNotifyL, Alpha ID is NULL");
   323 							launchBrowserV2.iAlphaId.iStatus = 
   323 							launchBrowserV2.iAlphaId.iStatus = 
   324 							    RSat::EAlphaIdNull;
   324 							    RSat::EAlphaIdNull;
   325 							}
   325 							}
   326 						}
   326 						}
   327 	        
   327 	        
   339 	        iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, ret );
   339 	        iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, ret );
   340 	        }
   340 	        }
   341         }// End of if ( reqHandle != CSatTsy::ESatReqHandleUnknown ) 
   341         }// End of if ( reqHandle != CSatTsy::ESatReqHandleUnknown ) 
   342 	else 
   342 	else 
   343         {
   343         {
   344         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_COMPLETENOTIFYL_7, "CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, Request not ongoing");
   344         TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::CompleteNotifyL, \
       
   345             Request not ongoing");  
   345         // Request not on, returning response immediately
   346         // Request not on, returning response immediately
   346 		CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd, 
   347 		CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd, 
   347 			KNoCause );
   348 			KNoCause );
   348 		}    
   349 		}    
   349 
   350 
   360 TInt CSatNotifyLaunchBrowser::TerminalResponseL
   361 TInt CSatNotifyLaunchBrowser::TerminalResponseL
   361         ( 
   362         ( 
   362         TDes8* aRsp
   363         TDes8* aRsp
   363         )
   364         )
   364     {
   365     {
   365     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_TERMINALRESPONSEL_1, "CSAT: CSatNotifyLaunchBrowser::TerminalResponseL");
   366     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::TerminalResponseL");
   366 	TInt   ret( KErrNone );
   367 	TInt   ret( KErrNone );
   367     TUint8 additionalInfo( KNoCause );
   368     TUint8 additionalInfo( KNoCause );
   368     RSat::TLaunchBrowserRspV2Pckg* aRspPckg = 
   369     RSat::TLaunchBrowserRspV2Pckg* aRspPckg = 
   369             reinterpret_cast<RSat::TLaunchBrowserRspV2Pckg*>( aRsp );
   370             reinterpret_cast<RSat::TLaunchBrowserRspV2Pckg*>( aRsp );
   370     RSat::TLaunchBrowserRspV2& rspV2 = ( *aRspPckg ) ();
   371     RSat::TLaunchBrowserRspV2& rspV2 = ( *aRspPckg ) ();
   385          ( RSat::KPartialComprehension != rspV2.iGeneralResult ) &&
   386          ( RSat::KPartialComprehension != rspV2.iGeneralResult ) &&
   386          ( RSat::KMissingInformation != rspV2.iGeneralResult ) &&
   387          ( RSat::KMissingInformation != rspV2.iGeneralResult ) &&
   387          ( RSat::KNetworkUnableToProcessCmd != rspV2.iGeneralResult ) &&
   388          ( RSat::KNetworkUnableToProcessCmd != rspV2.iGeneralResult ) &&
   388          ( RSat::KCmdNumberNotKnown != rspV2.iGeneralResult ) )
   389          ( RSat::KCmdNumberNotKnown != rspV2.iGeneralResult ) )
   389         {
   390         {
   390         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_TERMINALRESPONSEL_2, "CSAT: CSatNotifyLaunchBrowser::TerminalResponseL, Invalid General Result");
   391         TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::TerminalResponseL, \
       
   392             Invalid General Result");
   391         // Invalid general result
   393         // Invalid general result
   392         ret = KErrCorrupt;
   394         ret = KErrCorrupt;
   393         }
   395         }
   394 
   396 
   395     // Check that infotype is valid: from enum TBrowserError in etelsat.h
   397     // Check that infotype is valid: from enum TBrowserError in etelsat.h
   398          ( RSat::KBearerUnvailable != rspV2.iInfoType ) && 
   400          ( RSat::KBearerUnvailable != rspV2.iInfoType ) && 
   399          ( RSat::KBrowserUnavailable != rspV2.iInfoType ) && 
   401          ( RSat::KBrowserUnavailable != rspV2.iInfoType ) && 
   400          ( RSat::KMeUnableToReadProvisioningData != rspV2.iInfoType ) && 
   402          ( RSat::KMeUnableToReadProvisioningData != rspV2.iInfoType ) && 
   401          ( RSat::KNoSpecificBrowserError != rspV2.iInfoType ) )
   403          ( RSat::KNoSpecificBrowserError != rspV2.iInfoType ) )
   402         {
   404         {
   403         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_TERMINALRESPONSEL_3, "CSAT: CSatNotifyLaunchBrowser::TerminalResponseL, Invalid Info Type");
   405         TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::TerminalResponseL, \
       
   406             Invalid Info Type");
   404         ret = KErrCorrupt;
   407         ret = KErrCorrupt;
   405         }
   408         }
   406 
   409 
   407     // If there is Me (Mobile Equipment) error, additional info is needed
   410     // If there is Me (Mobile Equipment) error, additional info is needed
   408     if ( ( RSat::KMeProblem == rspV2.iInfoType ) )
   411     if ( ( RSat::KMeProblem == rspV2.iInfoType ) )
   412             {
   415             {
   413             additionalInfo = rspV2.iAdditionalInfo[0];
   416             additionalInfo = rspV2.iAdditionalInfo[0];
   414 			}
   417 			}
   415         else
   418         else
   416             {
   419             {
   417             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_TERMINALRESPONSEL_4, "CSAT: CSatNotifyLaunchBrowser::TerminalResponseL, Invalid Additional Info");
   420             TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::TerminalResponseL, \
       
   421                 Invalid Additional Info");
   418             // Invalid additional info field
   422             // Invalid additional info field
   419             ret = KErrCorrupt;
   423             ret = KErrCorrupt;
   420             }
   424             }
   421         }
   425         }
   422 
   426 
   436 		CSatDataPackage* aDataPackage
   440 		CSatDataPackage* aDataPackage
   437 		)
   441 		)
   438 	{
   442 	{
   439 	// Unpack parameters
   443 	// Unpack parameters
   440 	aDataPackage->UnPackData( iSsStatus );
   444 	aDataPackage->UnPackData( iSsStatus );
   441 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_SETSSSTATUS_1, "CSAT: CSatNotifyLaunchBrowser::SetSatTsySsStatus, status: %d", iSsStatus );
   445 	TFLOGSTRING2("CSAT: CSatNotifyLaunchBrowser::SetSatTsySsStatus, status: %d", 
       
   446 		iSsStatus );
   442 	}
   447 	}
   443     
   448     
   444 // -----------------------------------------------------------------------------
   449 // -----------------------------------------------------------------------------
   445 // CSatNotifyLaunchBrowser::ParseBrowserIdL
   450 // CSatNotifyLaunchBrowser::ParseBrowserIdL
   446 // Help method for CompleteNotify, sets the Browser ID
   451 // Help method for CompleteNotify, sets the Browser ID
   451         TUint8 aPCmdNumber,
   456         TUint8 aPCmdNumber,
   452         CBerTlv& aBerTlv,
   457         CBerTlv& aBerTlv,
   453         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   458         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   454         )
   459         )
   455     {
   460     {
   456     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEBROWSERIDL_1, "CSAT: CSatNotifyLaunchBrowser::ParseBrowserId");
   461     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseBrowserId");
   457     TInt ret( KErrNone );
   462     TInt ret( KErrNone );
   458     CTlv browserId; // optional
   463     CTlv browserId; // optional
   459 	TInt returnValue = aBerTlv.TlvByTagValue( &browserId, 
   464 	TInt returnValue = aBerTlv.TlvByTagValue( &browserId, 
   460 		KTlvBrowserIdentityTag );
   465 		KTlvBrowserIdentityTag );
   461 		
   466 		
   474 				browserId.GetShortInfo( ETLV_BrowserIdentity );
   479 				browserId.GetShortInfo( ETLV_BrowserIdentity );
   475 			}
   480 			}
   476 		}
   481 		}
   477 	else
   482 	else
   478 		{
   483 		{
   479 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEBROWSERIDL_2, "CSAT: CSatNotifyLaunchBrowser::ParseBrowserId, Browser ID not set");
   484 		TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseBrowserId, \
       
   485             Browser ID not set");
   480 		aLaunchBrowserV2.iBrowserId = RSat::EBrowserIdNotSet;
   486 		aLaunchBrowserV2.iBrowserId = RSat::EBrowserIdNotSet;
   481 		}
   487 		}
   482 	return ret;
   488 	return ret;
   483     }
   489     }
   484     
   490     
   492         TUint8 aPCmdNumber,
   498         TUint8 aPCmdNumber,
   493         CBerTlv& aBerTlv,
   499         CBerTlv& aBerTlv,
   494         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   500         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   495         )
   501         )
   496     {
   502     {
   497     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEURLL_1, "CSAT: CSatNotifyLaunchBrowser::ParseUrl");
   503     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseUrl");
   498     TInt ret( KErrNone );
   504     TInt ret( KErrNone );
   499     CTlv url; // mandatory
   505     CTlv url; // mandatory
   500 	TInt returnValue = aBerTlv.TlvByTagValue( &url, KTlvUrlTag );
   506 	TInt returnValue = aBerTlv.TlvByTagValue( &url, KTlvUrlTag );
   501 	
   507 	
   502 	if ( KErrNotFound != returnValue )
   508 	if ( KErrNotFound != returnValue )
   503 		{
   509 		{
   504 		if ( RSat::KUrlMaxSize < url.GetLength() )
   510 		if ( RSat::KUrlMaxSize < url.GetLength() )
   505 			{
   511 			{
   506 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEURLL_2, "CSAT: CSatNotifyLaunchBrowser::ParseUrl, False URL length");
   512 			TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseUrl, \
       
   513 			    False URL length");				
   507 			CreateTerminalRespL( aPCmdNumber, RSat::KMeUnableToProcessCmd, 
   514 			CreateTerminalRespL( aPCmdNumber, RSat::KMeUnableToProcessCmd, 
   508 			    KNoCause );
   515 			    KNoCause );
   509 			ret = KErrCorrupt;
   516 			ret = KErrCorrupt;
   510 			}
   517 			}
   511 		else
   518 		else
   513 			aLaunchBrowserV2.iUrl.Copy( url.GetData( ETLV_Url ) );
   520 			aLaunchBrowserV2.iUrl.Copy( url.GetData( ETLV_Url ) );
   514 			}
   521 			}
   515 		}
   522 		}
   516 	else
   523 	else
   517 		{
   524 		{
   518 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEURLL_3, "CSAT: CSatNotifyLaunchBrowser::ParseUrl, Required values missing");
   525 		TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseUrl, \
       
   526             Required values missing");								
   519 		CreateTerminalRespL( aPCmdNumber, RSat::KErrorRequiredValuesMissing, 
   527 		CreateTerminalRespL( aPCmdNumber, RSat::KErrorRequiredValuesMissing, 
   520 	        KNoCause );
   528 	        KNoCause );
   521 		ret = KErrCorrupt;
   529 		ret = KErrCorrupt;
   522 		}
   530 		}
   523 	return ret;
   531 	return ret;
   533         TUint8 aPCmdNumber,
   541         TUint8 aPCmdNumber,
   534         CBerTlv& aBerTlv,
   542         CBerTlv& aBerTlv,
   535         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   543         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   536         )
   544         )
   537     {
   545     {
   538     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEPROVISIONINGFILELISTL_1, "CSAT: CSatNotifyLaunchBrowser::ParseProvisioningFileList");
   546     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseProvisioningFileList");
   539     TInt ret( KErrNone );
   547     TInt ret( KErrNone );
   540     
   548     
   541     CTlv provisioningFileList; // optional
   549     CTlv provisioningFileList; // optional
   542 	TInt returnValue = aBerTlv.TlvByTagValueMulti( &provisioningFileList, 
   550 	TInt returnValue = aBerTlv.TlvByTagValueMulti( &provisioningFileList, 
   543 		KTlvProvisioningReferenceFileTag );
   551 		KTlvProvisioningReferenceFileTag );
   589 			stringLength = ( TUint8 ) fileRefData[pos - 1];
   597 			stringLength = ( TUint8 ) fileRefData[pos - 1];
   590 			// Test whether the text contains more than "MF"
   598 			// Test whether the text contains more than "MF"
   591 			if ( ( RSat::KFileRefMaxSize < stringLength ) || 
   599 			if ( ( RSat::KFileRefMaxSize < stringLength ) || 
   592 			     ( 4 > stringLength ) )
   600 			     ( 4 > stringLength ) )
   593 				{
   601 				{
   594 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEPROVISIONINGFILELISTL_2, "CSAT: CSatNotifyLaunchBrowser::ParseProvisioningFileList, False string length");
   602 				TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::\
       
   603 				    ParseProvisioningFileList, False string length");				
   595 			    CreateTerminalRespL( aPCmdNumber, RSat::KLaunchBrowserError, 
   604 			    CreateTerminalRespL( aPCmdNumber, RSat::KLaunchBrowserError, 
   596 				    RSat::KMeUnableToReadProvisioningData );
   605 				    RSat::KMeUnableToReadProvisioningData );
   597 				ret = KErrCorrupt;
   606 				ret = KErrCorrupt;
   598 				break;
   607 				break;
   599 				}
   608 				}
   607 				}
   616 				}
   608 				
   617 				
   609 			 // Adding the new fileref
   618 			 // Adding the new fileref
   610 			if ( KErrNoMemory == aLaunchBrowserV2.AddFileRef( newFileRef ) )
   619 			if ( KErrNoMemory == aLaunchBrowserV2.AddFileRef( newFileRef ) )
   611 				{
   620 				{
   612 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEPROVISIONINGFILELISTL_3, "CSAT: CSatNotifyLaunchBrowser::ParseProvisioningFileList, Menu items corrupted");
   621 				TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::\
       
   622 				    ParseProvisioningFileList, Menu items corrupted");
   613 				// Too many or long menuitems				
   623 				// Too many or long menuitems				
   614 			    CreateTerminalRespL( aPCmdNumber, RSat::KLaunchBrowserError, 
   624 			    CreateTerminalRespL( aPCmdNumber, RSat::KLaunchBrowserError, 
   615 				    RSat::KMeUnableToReadProvisioningData );
   625 				    RSat::KMeUnableToReadProvisioningData );
   616 				ret = KErrCorrupt;
   626 				ret = KErrCorrupt;
   617 				}
   627 				}
   633         TUint8 aPCmdNumber,
   643         TUint8 aPCmdNumber,
   634         CBerTlv& aBerTlv,
   644         CBerTlv& aBerTlv,
   635         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   645         RSat::TLaunchBrowserV2& aLaunchBrowserV2
   636         )
   646         )
   637     {
   647     {
   638     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEBEARERLISTL_1, "CSAT: CSatNotifyLaunchBrowser::ParseBearerList");
   648     TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseBearerList");
   639     TInt ret( KErrNone );
   649     TInt ret( KErrNone );
   640     // Bearers (optional)
   650     // Bearers (optional)
   641 	CTlv bearerList;
   651 	CTlv bearerList;
   642 	TInt returnValue = aBerTlv.TlvByTagValue( &bearerList, KTlvBearerTag );
   652 	TInt returnValue = aBerTlv.TlvByTagValue( &bearerList, KTlvBearerTag );
   643 	    
   653 	    
   658 					}
   668 					}
   659 				}
   669 				}
   660 				
   670 				
   661 			if ( 0x00 == aLaunchBrowserV2.iBearerList.Length() )
   671 			if ( 0x00 == aLaunchBrowserV2.iBearerList.Length() )
   662 				{
   672 				{
   663 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEBEARERLISTL_2, "CSAT: CSatNotifyLaunchBrowser::ParseBearerList, Bearer unvailable");
   673 				TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseBearerList,\
       
   674 				    Bearer unvailable");
   664 				CreateTerminalRespL( aPCmdNumber, RSat::KLaunchBrowserError, 
   675 				CreateTerminalRespL( aPCmdNumber, RSat::KLaunchBrowserError, 
   665 				    RSat::KBearerUnvailable );
   676 				    RSat::KBearerUnvailable );
   666 				ret = KErrCorrupt;
   677 				ret = KErrCorrupt;
   667 				}       
   678 				}       
   668 			}
   679 			}
   669 		else
   680 		else
   670 			{
   681 			{
   671 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_PARSEBEARERLISTL_3, "CSAT: CSatNotifyLaunchBrowser::ParseBearerList, Bearer List length exceeded");
   682 			TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::ParseBearerList,\
       
   683 			    Bearer List length exceeded");
   672 			CreateTerminalRespL( aPCmdNumber, RSat::KCmdDataNotUnderstood, 
   684 			CreateTerminalRespL( aPCmdNumber, RSat::KCmdDataNotUnderstood, 
   673 			    RSat::KCmdDataNotUnderstood );
   685 			    RSat::KCmdDataNotUnderstood );
   674 			ret = KErrCorrupt;
   686 			ret = KErrCorrupt;
   675 			}
   687 			}
   676 		}
   688 		}
   688         TUint8 aPCmdNumber,         
   700         TUint8 aPCmdNumber,         
   689         TUint8 aGeneralResult,      
   701         TUint8 aGeneralResult,      
   690         TUint8 aAdditionalInfo		
   702         TUint8 aAdditionalInfo		
   691 		)
   703 		)
   692     {
   704     {
   693 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLAUNCHBROWSER_CREATETERMINALRESPL_1, "CSAT: CSatNotifyLaunchBrowser::CreateTerminalRespL");
   705 	TFLOGSTRING("CSAT: CSatNotifyLaunchBrowser::CreateTerminalRespL");
   694     TTlv tlvSpecificData;
   706     TTlv tlvSpecificData;
   695     tlvSpecificData.AddTag( KTlvResultTag );
   707     tlvSpecificData.AddTag( KTlvResultTag );
   696     // Create General Result TLV here
   708     // Create General Result TLV here
   697     tlvSpecificData.AddByte( aGeneralResult );
   709     tlvSpecificData.AddByte( aGeneralResult );
   698     
   710