1 /* |
1 /* |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
130 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
131 // |
131 // |
132 CATExtCommonSession::CATExtCommonSession( CATExtSrvCommon& aServer, |
132 CATExtCommonSession::CATExtCommonSession( CATExtSrvCommon& aServer, |
133 const TVersion& aVersion ) : |
133 const TVersion& aVersion ) : |
134 iServer( aServer ), |
134 iServer( aServer ), |
|
135 iEComSession( NULL ), |
135 iVersion( aVersion ) |
136 iVersion( aVersion ) |
136 { |
137 { |
137 } |
138 } |
138 |
139 |
139 // --------------------------------------------------------------------------- |
140 // --------------------------------------------------------------------------- |
156 if ( retTemp != KErrNone ) |
157 if ( retTemp != KErrNone ) |
157 { |
158 { |
158 TRACE_FUNC_EXIT |
159 TRACE_FUNC_EXIT |
159 User::Leave( retTemp ); |
160 User::Leave( retTemp ); |
160 } |
161 } |
161 REComSession& ecomSession = REComSession::OpenL(); |
162 iEComSession = &REComSession::OpenL(); |
162 CleanupClosePushL( ecomSession ); |
|
163 RImplInfoPtrArray implementations; |
163 RImplInfoPtrArray implementations; |
164 CleanupResetDestroyClosePushL( implementations ); |
164 CleanupResetDestroyClosePushL( implementations ); |
165 TUid ifUid = TUid::Uid( ATEXT_INTERFACE_COM_UID ); |
165 TUid ifUid = TUid::Uid( ATEXT_INTERFACE_COM_UID ); |
166 iEComSession.ListImplementationsL( ifUid, |
166 iEComSession->ListImplementationsL( ifUid, |
167 implementations ); |
167 implementations ); |
168 if ( implementations.Count() != 1 ) |
168 if ( implementations.Count() != 1 ) |
169 { |
169 { |
170 TRACE_FUNC_EXIT |
170 TRACE_FUNC_EXIT |
171 User::Leave( KErrGeneral ); |
171 User::Leave( KErrGeneral ); |
172 } |
172 } |
173 TUid pluginUid = implementations[0]->ImplementationUid(); |
173 TUid pluginUid = implementations[0]->ImplementationUid(); |
174 iCommonBase = CATExtCommonBase::NewL( pluginUid, *this, connectionName ); |
174 iCommonBase = CATExtCommonBase::NewL( pluginUid, *this, connectionName ); |
175 CleanupStack::PopAndDestroy( &implementations ); |
175 CleanupStack::PopAndDestroy( &implementations ); |
176 CleanupStack::Pop( &ecomSession ); |
|
177 CleanupStack::PopAndDestroy( &connectionName ); |
176 CleanupStack::PopAndDestroy( &connectionName ); |
178 iEComSession = ecomSession; |
|
179 TRACE_FUNC_EXIT |
177 TRACE_FUNC_EXIT |
180 } |
178 } |
181 |
179 |
182 // --------------------------------------------------------------------------- |
180 // --------------------------------------------------------------------------- |
183 // Synchronously closes the session |
181 // Synchronously closes the session |