sysstatemgmt/systemstarter/amastartsrc/amastartsess.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include "amastartsess.h"
       
    21 
       
    22 
       
    23 
       
    24 CAmaStartSession* CAmaStartSession::NewL( CAmaStartServer& aAmaStartServer )
       
    25 	{
       
    26 	DEBUGPRINT1A( ">CAmaStartSession::NewL" );
       
    27 	
       
    28 	CAmaStartSession* self = new(ELeave) CAmaStartSession( aAmaStartServer );
       
    29 	CleanupStack::PushL( self );
       
    30 	self->ConstructL();
       
    31 	CleanupStack::Pop();
       
    32 	
       
    33 	DEBUGPRINT1A( "CAmaStartSession::NewL>" );
       
    34 	return self;
       
    35 	}
       
    36 
       
    37 
       
    38 
       
    39 CAmaStartSession::~CAmaStartSession()
       
    40 	{
       
    41 	DEBUGPRINT1A( ">CAmaStartSession::~CAmaStartSession" );
       
    42 
       
    43 	iAmaStartSvr.DeregisterSession( iSessionIndex );
       
    44 	
       
    45 	DEBUGPRINT1A( "CAmaStartSession::~CAmaStartSession>" );
       
    46 	}
       
    47 
       
    48 
       
    49 
       
    50 /**
       
    51  * In the case of EAmaStartSrvExecuteCmdList, the RMessage is completed by the 
       
    52  * Executor call into the server's ListExecutionComplete method.
       
    53  */
       
    54 void CAmaStartSession::ServiceL( const RMessage2& aMessage )
       
    55 	{
       
    56 	DEBUGPRINT1A( ">CAmaStartSession::ServiceL" );
       
    57 	aMessage.HasCapabilityL( ECapabilityProtServ, __PLATSEC_DIAGNOSTIC_STRING( "CleSrv Platsec violation" ) );
       
    58 
       
    59 	switch( aMessage.Function() )
       
    60 		{
       
    61 		case EAmaStartSrvStartDsc:
       
    62 			{
       
    63 			StartDscL( aMessage );
       
    64 			}
       
    65 			break;
       
    66 			
       
    67 		case EAmaStartSrvStartDscCancel:
       
    68 			{
       
    69 			StartDscCancel();
       
    70 			aMessage.Complete(KErrCancel);
       
    71 			}
       
    72 			break;
       
    73 	
       
    74 		default:
       
    75 			aMessage.Complete( KErrUnknown );
       
    76 			break;			
       
    77 		}
       
    78 	DEBUGPRINT1A( "CAmaStartSession::ServiceL>" );
       
    79 	}
       
    80 	
       
    81 	
       
    82 
       
    83 CAmaStartSession::CAmaStartSession( CAmaStartServer& aAmaStartServer )
       
    84 : iAmaStartSvr( aAmaStartServer )
       
    85 	{
       
    86 	DEBUGPRINT1A( ">CAmaStartSession::CAmaStartSession> (Empty constructor)" );
       
    87 	}
       
    88 
       
    89 
       
    90 
       
    91 void CAmaStartSession::ConstructL()
       
    92 	{
       
    93 	DEBUGPRINT1A( ">CAmaStartSession::ConstructL" );
       
    94 	iAmaStartSvr.RegisterSessionL( iSessionIndex );
       
    95 	DEBUGPRINT1A( "CAmaStartSession::ConstructL>" );
       
    96 	}
       
    97 
       
    98 
       
    99 
       
   100 void CAmaStartSession::StartDscL( const RMessage2& aMessage )
       
   101 	{
       
   102 	DEBUGPRINT1A( ">CAmaStartSession::StartDscL" );
       
   103 	
       
   104 	iAmaStartSvr.StartDscL( TUid::Uid(aMessage.Int0()), aMessage, iSessionIndex );
       
   105 	
       
   106 	DEBUGPRINT1A( "CAmaStartSession::StartDscL>" );
       
   107 	}
       
   108 
       
   109 
       
   110 
       
   111 void CAmaStartSession::StartDscCancel()
       
   112 	{
       
   113 	DEBUGPRINT1A( ">CAmaStartSession::StartDscCancel" );
       
   114 	
       
   115 	iAmaStartSvr.StartDscCancel( iSessionIndex );
       
   116 	
       
   117 	DEBUGPRINT1A( "CAmaStartSession::StartDscCancel>" );
       
   118 	}