sl@0
|
1 |
// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "MmfAudioPolicySession.h"
|
sl@0
|
17 |
#include "MmfPolicyClientServer.h"
|
sl@0
|
18 |
#include "MmfAudioPolicyServer.h"
|
sl@0
|
19 |
#include "MmfDevSoundInfo.h"
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
const TInt KEventQLimit=16; // maximum number of pending events per session
|
sl@0
|
23 |
|
sl@0
|
24 |
CMMFAudioPolicySession* CMMFAudioPolicySession::NewL()
|
sl@0
|
25 |
{
|
sl@0
|
26 |
CMMFAudioPolicySession* self = new(ELeave) CMMFAudioPolicySession();
|
sl@0
|
27 |
CleanupStack::PushL(self);
|
sl@0
|
28 |
self->ConstructL();
|
sl@0
|
29 |
CleanupStack::Pop();
|
sl@0
|
30 |
return self;
|
sl@0
|
31 |
}
|
sl@0
|
32 |
|
sl@0
|
33 |
void CMMFAudioPolicySession::ConstructL()
|
sl@0
|
34 |
{
|
sl@0
|
35 |
iAudioPolicyRequest = new (ELeave) CMMFAudioPolicyRequest();
|
sl@0
|
36 |
}
|
sl@0
|
37 |
|
sl@0
|
38 |
CMMFAudioPolicySession::CMMFAudioPolicySession() : iEventsQue(_FOFF(TMMFAudioPolicyEventHolder,iLink)),
|
sl@0
|
39 |
iNoMemoryEventHolder(TMMFAudioPolicyEvent(TMMFAudioPolicyEvent::EMMFAudioPolicyResourceNotification, KErrNoMemory, EMMFStateCompleted), EFalse)
|
sl@0
|
40 |
{
|
sl@0
|
41 |
}
|
sl@0
|
42 |
|
sl@0
|
43 |
void CMMFAudioPolicySession::CreateL(const CMmfIpcServer& aServer)
|
sl@0
|
44 |
{
|
sl@0
|
45 |
iServer = STATIC_CAST(CMMFAudioPolicyServer*, (CONST_CAST(CMmfIpcServer*, &aServer)));
|
sl@0
|
46 |
iServer->IncrementSessionCount();
|
sl@0
|
47 |
CMmfIpcSession::CreateL(aServer);
|
sl@0
|
48 |
iServer->IncrementSessionId();
|
sl@0
|
49 |
iPolicySessionId = iServer->PolicySessionId();
|
sl@0
|
50 |
// Get ptr to AudioPolicy from the server
|
sl@0
|
51 |
iAudioPolicy = iServer->AudioPolicy();
|
sl@0
|
52 |
iAudioPolicy->ReserveClientNumL(iServer->PolicySessionCount());
|
sl@0
|
53 |
}
|
sl@0
|
54 |
|
sl@0
|
55 |
CMMFAudioPolicyServer* CMMFAudioPolicySession::Server()
|
sl@0
|
56 |
{
|
sl@0
|
57 |
return STATIC_CAST(CMMFAudioPolicyServer*, iServer);
|
sl@0
|
58 |
}
|
sl@0
|
59 |
|
sl@0
|
60 |
CMMFAudioPolicySession::~CMMFAudioPolicySession()
|
sl@0
|
61 |
{
|
sl@0
|
62 |
delete iEventReceiver;
|
sl@0
|
63 |
iEventReceiver=NULL;
|
sl@0
|
64 |
ClearEventQ();
|
sl@0
|
65 |
iAudioPolicyPrioritySettings.iState = EMMFStateClosed;
|
sl@0
|
66 |
// Have session's CMMFAudioPolicyRequest object removed from list
|
sl@0
|
67 |
if (iAudioPolicy != NULL)
|
sl@0
|
68 |
{
|
sl@0
|
69 |
iAudioPolicy->RemoveFromList(iPolicySessionId);
|
sl@0
|
70 |
}
|
sl@0
|
71 |
delete iAudioPolicyRequest;
|
sl@0
|
72 |
if (iServer != NULL)
|
sl@0
|
73 |
{
|
sl@0
|
74 |
iServer->DecrementSessionCount();
|
sl@0
|
75 |
iServer->StopNotificationTimer();
|
sl@0
|
76 |
}
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
void CMMFAudioPolicySession::ClearEventQ()
|
sl@0
|
80 |
{
|
sl@0
|
81 |
while (!iEventsQue.IsEmpty())
|
sl@0
|
82 |
{
|
sl@0
|
83 |
TMMFAudioPolicyEventHolder* heldEvent = iEventsQue.First();
|
sl@0
|
84 |
iEventsQue.Remove(*heldEvent);
|
sl@0
|
85 |
if (heldEvent == &iNoMemoryEventHolder)
|
sl@0
|
86 |
{
|
sl@0
|
87 |
iNoMemoryEventUsed = EFalse;
|
sl@0
|
88 |
}
|
sl@0
|
89 |
if (heldEvent->iShallBeDeleted)
|
sl@0
|
90 |
{
|
sl@0
|
91 |
delete heldEvent;
|
sl@0
|
92 |
}
|
sl@0
|
93 |
--iEventQSize;
|
sl@0
|
94 |
}
|
sl@0
|
95 |
}
|
sl@0
|
96 |
|
sl@0
|
97 |
void CMMFAudioPolicySession::ServiceL(const RMmfIpcMessage& aMessage)
|
sl@0
|
98 |
{
|
sl@0
|
99 |
if (iEventQSize > KEventQLimit)
|
sl@0
|
100 |
{
|
sl@0
|
101 |
aMessage.Panic(KMMFAudioPolicyPanicCategory, EMMFAudioPolicySessionEventQueueOverflow);
|
sl@0
|
102 |
return;
|
sl@0
|
103 |
}
|
sl@0
|
104 |
|
sl@0
|
105 |
TBool complete = EFalse;
|
sl@0
|
106 |
switch(aMessage.Function())
|
sl@0
|
107 |
{
|
sl@0
|
108 |
case EMMFPolicyMakeRequest:
|
sl@0
|
109 |
MakeRequestL(aMessage);
|
sl@0
|
110 |
aMessage.Complete(KErrNone);
|
sl@0
|
111 |
break;
|
sl@0
|
112 |
case EMMFPolicySetDevSoundInfo:
|
sl@0
|
113 |
complete = SetDevSoundInfoL(aMessage);
|
sl@0
|
114 |
break;
|
sl@0
|
115 |
case EMMFPolicyUpdateState:
|
sl@0
|
116 |
complete = UpdateStateL(aMessage);
|
sl@0
|
117 |
break;
|
sl@0
|
118 |
case EMMFPolicyReceiveEvents:
|
sl@0
|
119 |
complete = ReceiveEventsL(aMessage);
|
sl@0
|
120 |
break;
|
sl@0
|
121 |
case EMMFPolicyCancelReceiveEvents:
|
sl@0
|
122 |
complete = CancelReceiveEvents();
|
sl@0
|
123 |
break;
|
sl@0
|
124 |
case EMMFPolicyGetPlayFormatsSupported:
|
sl@0
|
125 |
complete = GetPlayFormatsSupportedL(aMessage);
|
sl@0
|
126 |
break;
|
sl@0
|
127 |
case EMMFPolicyGetRecordFormatsSupported:
|
sl@0
|
128 |
complete = GetRecordFormatsSupportedL(aMessage);
|
sl@0
|
129 |
break;
|
sl@0
|
130 |
case EMMFPolicyGetPlayFormat:
|
sl@0
|
131 |
complete = GetPlayFormatL(aMessage);
|
sl@0
|
132 |
break;
|
sl@0
|
133 |
case EMMFPolicyGetRecordFormat:
|
sl@0
|
134 |
complete = GetRecordFormatL(aMessage);
|
sl@0
|
135 |
break;
|
sl@0
|
136 |
case EMMFPolicyLaunchRequests:
|
sl@0
|
137 |
complete = LaunchRequest();
|
sl@0
|
138 |
break;
|
sl@0
|
139 |
case EMMFPolicyRequestResourceNotification:
|
sl@0
|
140 |
complete = RequestResourceNotificationL(aMessage);
|
sl@0
|
141 |
break;
|
sl@0
|
142 |
case EMMFPolicyCancelRequestResourceNotification:
|
sl@0
|
143 |
complete = CancelRequestResourceNotificationL(aMessage);
|
sl@0
|
144 |
break;
|
sl@0
|
145 |
case EMMFPolicyStopNotification:
|
sl@0
|
146 |
complete = StopNotificationL(aMessage);
|
sl@0
|
147 |
break;
|
sl@0
|
148 |
case EMMFPolicyGetResourceNotificationEvent:
|
sl@0
|
149 |
complete = GetResourceNotificationEventL(aMessage);
|
sl@0
|
150 |
break;
|
sl@0
|
151 |
default:
|
sl@0
|
152 |
User::Leave(KErrNotSupported);
|
sl@0
|
153 |
break;
|
sl@0
|
154 |
}
|
sl@0
|
155 |
if(complete)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
aMessage.Complete(KErrNone);
|
sl@0
|
158 |
}
|
sl@0
|
159 |
}
|
sl@0
|
160 |
|
sl@0
|
161 |
void CMMFAudioPolicySession::MakeRequestL(const RMmfIpcMessage& aMessage)
|
sl@0
|
162 |
{
|
sl@0
|
163 |
TMMFAudioPolicyPrioritySettingsPckg settingsPckg;
|
sl@0
|
164 |
MmfMessageUtil::ReadL(aMessage, 0, settingsPckg);
|
sl@0
|
165 |
|
sl@0
|
166 |
iAudioPolicyRequest->SetPriority(settingsPckg().iPriority);
|
sl@0
|
167 |
iAudioPolicyRequest->SetPref(settingsPckg().iPref);
|
sl@0
|
168 |
iAudioPolicyRequest->SetState(settingsPckg().iState);
|
sl@0
|
169 |
|
sl@0
|
170 |
iAudioPolicyRequest->SetCapabilities(settingsPckg().iCapabilities);
|
sl@0
|
171 |
|
sl@0
|
172 |
// Set session Id in Request
|
sl@0
|
173 |
iAudioPolicyRequest->SetPolicySessionId(iPolicySessionId);
|
sl@0
|
174 |
iAudioPolicy->MakeRequest(iAudioPolicyRequest);
|
sl@0
|
175 |
}
|
sl@0
|
176 |
|
sl@0
|
177 |
TBool CMMFAudioPolicySession::UpdateStateL(const RMmfIpcMessage& aMessage)
|
sl@0
|
178 |
{
|
sl@0
|
179 |
TMMFAudioPolicyPrioritySettingsPckg settingsPckg;
|
sl@0
|
180 |
MmfMessageUtil::ReadL(aMessage, 0, settingsPckg);
|
sl@0
|
181 |
|
sl@0
|
182 |
iAudioPolicy->ModifyEntry(iPolicySessionId, settingsPckg().iState);
|
sl@0
|
183 |
return ETrue;
|
sl@0
|
184 |
}
|
sl@0
|
185 |
|
sl@0
|
186 |
void CMMFAudioPolicySession::SendEventToClient(const TMMFAudioPolicyEvent& aEvent)
|
sl@0
|
187 |
{
|
sl@0
|
188 |
if (iEventReceiver)
|
sl@0
|
189 |
{
|
sl@0
|
190 |
iEventReceiver->SendEvent(aEvent);
|
sl@0
|
191 |
delete iEventReceiver;
|
sl@0
|
192 |
iEventReceiver=NULL;
|
sl@0
|
193 |
}
|
sl@0
|
194 |
else
|
sl@0
|
195 |
{
|
sl@0
|
196 |
if (++iEventQSize > KEventQLimit) // check if Q is not full
|
sl@0
|
197 |
{
|
sl@0
|
198 |
return; // we'll panic that bad client later
|
sl@0
|
199 |
}
|
sl@0
|
200 |
TMMFAudioPolicyEventHolder* heldEvent = new TMMFAudioPolicyEventHolder(aEvent, ETrue);
|
sl@0
|
201 |
|
sl@0
|
202 |
if (heldEvent==NULL && !iNoMemoryEventUsed)
|
sl@0
|
203 |
{
|
sl@0
|
204 |
heldEvent=&iNoMemoryEventHolder;
|
sl@0
|
205 |
iNoMemoryEventUsed = ETrue;
|
sl@0
|
206 |
}
|
sl@0
|
207 |
if (heldEvent)
|
sl@0
|
208 |
{
|
sl@0
|
209 |
iEventsQue.AddLast(*heldEvent);
|
sl@0
|
210 |
}
|
sl@0
|
211 |
}
|
sl@0
|
212 |
}
|
sl@0
|
213 |
|
sl@0
|
214 |
TBool CMMFAudioPolicySession::SetDevSoundInfoL(const RMmfIpcMessage& aMessage)
|
sl@0
|
215 |
{
|
sl@0
|
216 |
TMMFDevSoundInfoPckg devSoundInfoPckg;
|
sl@0
|
217 |
MmfMessageUtil::ReadL(aMessage, 0, devSoundInfoPckg);
|
sl@0
|
218 |
iDevSoundId = devSoundInfoPckg().iDevSoundId;
|
sl@0
|
219 |
return ETrue;
|
sl@0
|
220 |
}
|
sl@0
|
221 |
|
sl@0
|
222 |
TBool CMMFAudioPolicySession::ReceiveEventsL(const RMmfIpcMessage& aMessage)
|
sl@0
|
223 |
{
|
sl@0
|
224 |
if (iEventReceiver)
|
sl@0
|
225 |
User::Leave(KErrAlreadyExists);
|
sl@0
|
226 |
iEventReceiver = CMMFAudioPolicyEventReceiver::NewL(aMessage);
|
sl@0
|
227 |
#if defined(ALLOW_POLICY_DEBUG)
|
sl@0
|
228 |
RDebug::Print(_L("Sess. ID=%d listen to events"),iPolicySessionId);
|
sl@0
|
229 |
#endif
|
sl@0
|
230 |
//send the next cached event (if any) to the client
|
sl@0
|
231 |
if (!iEventsQue.IsEmpty())
|
sl@0
|
232 |
{
|
sl@0
|
233 |
TMMFAudioPolicyEventHolder* heldEvent = iEventsQue.First();
|
sl@0
|
234 |
iEventReceiver->SendEvent(heldEvent->iEvent);
|
sl@0
|
235 |
iEventsQue.Remove(*heldEvent);
|
sl@0
|
236 |
if (heldEvent == &iNoMemoryEventHolder)
|
sl@0
|
237 |
{
|
sl@0
|
238 |
iNoMemoryEventUsed = EFalse;
|
sl@0
|
239 |
}
|
sl@0
|
240 |
--iEventQSize;
|
sl@0
|
241 |
if (heldEvent->iShallBeDeleted)
|
sl@0
|
242 |
{
|
sl@0
|
243 |
delete heldEvent;
|
sl@0
|
244 |
}
|
sl@0
|
245 |
delete iEventReceiver;
|
sl@0
|
246 |
iEventReceiver=NULL;
|
sl@0
|
247 |
}
|
sl@0
|
248 |
return EFalse;
|
sl@0
|
249 |
}
|
sl@0
|
250 |
|
sl@0
|
251 |
TBool CMMFAudioPolicySession::CancelReceiveEvents()
|
sl@0
|
252 |
{
|
sl@0
|
253 |
delete iEventReceiver;
|
sl@0
|
254 |
iEventReceiver = NULL;
|
sl@0
|
255 |
return ETrue;
|
sl@0
|
256 |
}
|
sl@0
|
257 |
|
sl@0
|
258 |
TBool CMMFAudioPolicySession::GetPlayFormatsSupportedL(const RMmfIpcMessage& aMessage)
|
sl@0
|
259 |
{
|
sl@0
|
260 |
RMdaDevSound::TSoundFormatsSupportedBuf aPlayFormatsSupported;
|
sl@0
|
261 |
aPlayFormatsSupported = iAudioPolicy->MdaHwInfo()->GetPlayFormatsSupported();
|
sl@0
|
262 |
MmfMessageUtil::WriteL(aMessage, 0, aPlayFormatsSupported);
|
sl@0
|
263 |
return ETrue;
|
sl@0
|
264 |
}
|
sl@0
|
265 |
|
sl@0
|
266 |
TBool CMMFAudioPolicySession::GetRecordFormatsSupportedL(const RMmfIpcMessage& aMessage)
|
sl@0
|
267 |
{
|
sl@0
|
268 |
RMdaDevSound::TSoundFormatsSupportedBuf aRecordFormatsSupported;
|
sl@0
|
269 |
aRecordFormatsSupported = iAudioPolicy->MdaHwInfo()->GetRecordFormatsSupported();
|
sl@0
|
270 |
MmfMessageUtil::WriteL(aMessage, 0, aRecordFormatsSupported);
|
sl@0
|
271 |
return ETrue;
|
sl@0
|
272 |
}
|
sl@0
|
273 |
|
sl@0
|
274 |
TBool CMMFAudioPolicySession::GetPlayFormatL(const RMmfIpcMessage& aMessage)
|
sl@0
|
275 |
{
|
sl@0
|
276 |
RMdaDevSound::TCurrentSoundFormatBuf aPlayFormat;
|
sl@0
|
277 |
aPlayFormat = iAudioPolicy->MdaHwInfo()->GetPlayFormat();
|
sl@0
|
278 |
MmfMessageUtil::WriteL(aMessage, 0, aPlayFormat);
|
sl@0
|
279 |
return ETrue;
|
sl@0
|
280 |
}
|
sl@0
|
281 |
|
sl@0
|
282 |
TBool CMMFAudioPolicySession::GetRecordFormatL(const RMmfIpcMessage& aMessage)
|
sl@0
|
283 |
{
|
sl@0
|
284 |
RMdaDevSound::TCurrentSoundFormatBuf aRecordFormat;
|
sl@0
|
285 |
aRecordFormat = iAudioPolicy->MdaHwInfo()->GetRecordFormat();
|
sl@0
|
286 |
MmfMessageUtil::WriteL(aMessage, 0, aRecordFormat);
|
sl@0
|
287 |
return ETrue;
|
sl@0
|
288 |
}
|
sl@0
|
289 |
|
sl@0
|
290 |
TBool CMMFAudioPolicySession::LaunchRequest()
|
sl@0
|
291 |
{
|
sl@0
|
292 |
iAudioPolicy->LaunchRequest( iAudioPolicyRequest->PolicySessionId() );
|
sl@0
|
293 |
return ETrue;
|
sl@0
|
294 |
}
|
sl@0
|
295 |
|
sl@0
|
296 |
TBool CMMFAudioPolicySession::RequestResourceNotificationL(const RMmfIpcMessage& aMessage)
|
sl@0
|
297 |
{
|
sl@0
|
298 |
TMMFAudioPolicyResourceNotificationSettingsPckg notificationPckg;
|
sl@0
|
299 |
MmfMessageUtil::ReadL(aMessage, 0, notificationPckg);
|
sl@0
|
300 |
iAudioPolicyRequest->SetNotificationEvent(notificationPckg().iNotificationUid);
|
sl@0
|
301 |
iAudioPolicyRequest->SetRequestDataL(notificationPckg().iNotificationDelay);
|
sl@0
|
302 |
iAudioPolicy->SetNotification(iPolicySessionId,notificationPckg().iNotificationUid);
|
sl@0
|
303 |
return ETrue;
|
sl@0
|
304 |
}
|
sl@0
|
305 |
|
sl@0
|
306 |
TBool CMMFAudioPolicySession::CancelRequestResourceNotificationL(const RMmfIpcMessage& aMessage)
|
sl@0
|
307 |
{
|
sl@0
|
308 |
TMMFAudioPolicyResourceNotificationSettingsPckg notificationPckg;
|
sl@0
|
309 |
MmfMessageUtil::ReadL(aMessage, 0, notificationPckg);
|
sl@0
|
310 |
iAudioPolicyRequest->ResetNotificationEvent(notificationPckg().iNotificationUid);
|
sl@0
|
311 |
iAudioPolicy->SetNotification(iPolicySessionId,KNullUid);
|
sl@0
|
312 |
return ETrue;
|
sl@0
|
313 |
}
|
sl@0
|
314 |
|
sl@0
|
315 |
TBool CMMFAudioPolicySession::StopNotificationL(const RMmfIpcMessage& /*aMessage*/)
|
sl@0
|
316 |
{
|
sl@0
|
317 |
iServer->StopNotificationTimer();
|
sl@0
|
318 |
return ETrue;
|
sl@0
|
319 |
}
|
sl@0
|
320 |
|
sl@0
|
321 |
TBool CMMFAudioPolicySession::GetResourceNotificationEventL(const RMmfIpcMessage& aMessage) const
|
sl@0
|
322 |
{
|
sl@0
|
323 |
TMMFAudioPolicyResourceNotificationSettingsPckg notificationPckg;
|
sl@0
|
324 |
notificationPckg().iNotificationUid = iAudioPolicyRequest->NotificationEvent();
|
sl@0
|
325 |
MmfMessageUtil::WriteL(aMessage, 0, notificationPckg);
|
sl@0
|
326 |
return ETrue;
|
sl@0
|
327 |
}
|
sl@0
|
328 |
|
sl@0
|
329 |
CMMFAudioPolicyEventReceiver* CMMFAudioPolicyEventReceiver::NewL(const RMmfIpcMessage& aMessage)
|
sl@0
|
330 |
{
|
sl@0
|
331 |
return new(ELeave) CMMFAudioPolicyEventReceiver(aMessage);
|
sl@0
|
332 |
}
|
sl@0
|
333 |
|
sl@0
|
334 |
CMMFAudioPolicyEventReceiver::~CMMFAudioPolicyEventReceiver()
|
sl@0
|
335 |
{
|
sl@0
|
336 |
if (iNeedToCompleteMessage)
|
sl@0
|
337 |
{
|
sl@0
|
338 |
iMessage.Complete(KErrDied);
|
sl@0
|
339 |
}
|
sl@0
|
340 |
}
|
sl@0
|
341 |
|
sl@0
|
342 |
void CMMFAudioPolicyEventReceiver::SendEvent(const TMMFAudioPolicyEvent& aEvent)
|
sl@0
|
343 |
{
|
sl@0
|
344 |
TMMFAudioPolicyEventPckg eventpckg(aEvent);
|
sl@0
|
345 |
TInt err = MmfMessageUtil::Write(iMessage, 0, eventpckg);
|
sl@0
|
346 |
iMessage.Complete(err);
|
sl@0
|
347 |
iNeedToCompleteMessage = EFalse;
|
sl@0
|
348 |
}
|
sl@0
|
349 |
|
sl@0
|
350 |
void CMMFAudioPolicyEventReceiver::SendEvent(const TMMFEvent& aEvent)
|
sl@0
|
351 |
{
|
sl@0
|
352 |
TMMFEventPckg eventpckg(aEvent);
|
sl@0
|
353 |
TInt err = MmfMessageUtil::Write(iMessage, 0, eventpckg);
|
sl@0
|
354 |
iMessage.Complete(err);
|
sl@0
|
355 |
iNeedToCompleteMessage = EFalse;
|
sl@0
|
356 |
}
|
sl@0
|
357 |
|
sl@0
|
358 |
CMMFAudioPolicyEventReceiver::CMMFAudioPolicyEventReceiver(const RMmfIpcMessage& aMessage) :
|
sl@0
|
359 |
iMessage(aMessage), iNeedToCompleteMessage(ETrue)
|
sl@0
|
360 |
{
|
sl@0
|
361 |
}
|
sl@0
|
362 |
|
sl@0
|
363 |
CMMFAudioPolicyRequest::CMMFAudioPolicyRequest():
|
sl@0
|
364 |
iPolicySessionId(KErrNotFound),
|
sl@0
|
365 |
iReqDataPtr(KNullDesC8)
|
sl@0
|
366 |
{
|
sl@0
|
367 |
iNotificationEventUid = KNullUid;
|
sl@0
|
368 |
}
|
sl@0
|
369 |
|
sl@0
|
370 |
CMMFAudioPolicyRequest::~CMMFAudioPolicyRequest()
|
sl@0
|
371 |
{
|
sl@0
|
372 |
delete iRequestData;
|
sl@0
|
373 |
}
|
sl@0
|
374 |
|
sl@0
|
375 |
void CMMFAudioPolicyRequest::SetRequestDataL(const TDesC8& aRequestData)
|
sl@0
|
376 |
{
|
sl@0
|
377 |
iReqDataPtr.Set(KNullDesC8);
|
sl@0
|
378 |
if (aRequestData.Length() == 0)
|
sl@0
|
379 |
{
|
sl@0
|
380 |
return;
|
sl@0
|
381 |
}
|
sl@0
|
382 |
if (iRequestData==NULL || (iRequestData && iRequestData->Des().MaxLength()<aRequestData.Length()))
|
sl@0
|
383 |
{
|
sl@0
|
384 |
delete iRequestData;
|
sl@0
|
385 |
iRequestData = NULL;
|
sl@0
|
386 |
iRequestData = aRequestData.AllocL();
|
sl@0
|
387 |
}
|
sl@0
|
388 |
else
|
sl@0
|
389 |
{
|
sl@0
|
390 |
iRequestData->Des().Copy(aRequestData);
|
sl@0
|
391 |
}
|
sl@0
|
392 |
iReqDataPtr.Set(*iRequestData);
|
sl@0
|
393 |
}
|
sl@0
|
394 |
|
sl@0
|
395 |
|
sl@0
|
396 |
|