sl@0
|
1 |
// Copyright (c) 2001-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 "MmfBtAudioPolicy.h"
|
sl@0
|
17 |
#include "MmfBtAudioPolicySession.h"
|
sl@0
|
18 |
#include "MmfBtAudioPolicyServer.h"
|
sl@0
|
19 |
#include "MdaBtHwInfo.h"
|
sl@0
|
20 |
#include "MmfBtAudioPolicyRequest.h"
|
sl@0
|
21 |
|
sl@0
|
22 |
CAudioPolicy::~CAudioPolicy()
|
sl@0
|
23 |
{
|
sl@0
|
24 |
delete iMdaHwInfo;
|
sl@0
|
25 |
delete iAudioPolicyRequestArray;
|
sl@0
|
26 |
}
|
sl@0
|
27 |
|
sl@0
|
28 |
void CAudioPolicy::ConstructL()
|
sl@0
|
29 |
{
|
sl@0
|
30 |
// Create dynamic array for sessions list
|
sl@0
|
31 |
iAudioPolicyRequestArray = new(ELeave)CArrayFixFlat<CMMFAudioPolicyRequest>(CAudioPolicy::EGranularity);
|
sl@0
|
32 |
iMdaHwInfo = CMdaHwInfo::NewL();
|
sl@0
|
33 |
}
|
sl@0
|
34 |
|
sl@0
|
35 |
EXPORT_C CAudioPolicy* CAudioPolicy::NewL(CMMFAudioPolicyServer* aAudioPolicyServer)
|
sl@0
|
36 |
{
|
sl@0
|
37 |
|
sl@0
|
38 |
CAudioPolicy* self = new(ELeave)CAudioPolicy(aAudioPolicyServer);
|
sl@0
|
39 |
CleanupStack::PushL(self);
|
sl@0
|
40 |
self->ConstructL();
|
sl@0
|
41 |
CleanupStack::Pop();
|
sl@0
|
42 |
return(self);
|
sl@0
|
43 |
}
|
sl@0
|
44 |
|
sl@0
|
45 |
CAudioPolicy::CAudioPolicy(CMMFAudioPolicyServer* aAudioPolicyServer) :
|
sl@0
|
46 |
iAudioPolicyServer(aAudioPolicyServer)
|
sl@0
|
47 |
{
|
sl@0
|
48 |
}
|
sl@0
|
49 |
|
sl@0
|
50 |
void CAudioPolicy::MakeRequest(CMMFAudioPolicyRequest* aAudioPolicyRequest)
|
sl@0
|
51 |
{
|
sl@0
|
52 |
//Make sure there is sufficient space in the array to avoid expansion in AppendL()
|
sl@0
|
53 |
__ASSERT_ALWAYS(iAudioPolicyRequestArray->Count() < iAudioPolicyServer->PolicySessionCount(), Panic(EMMFAudioPolicyRequestArrayOverflow));
|
sl@0
|
54 |
TPolicyResponse responseValue;
|
sl@0
|
55 |
iSessionToAlert = NULL; // Reset
|
sl@0
|
56 |
|
sl@0
|
57 |
// Process Request by looking at priorities, preferences, special states...
|
sl@0
|
58 |
responseValue = ProcessRequest(aAudioPolicyRequest);
|
sl@0
|
59 |
|
sl@0
|
60 |
// Finally, check current profile settings (only if not denied thus far):
|
sl@0
|
61 |
// CheckAgainstProfiles(aAudioPolicyRequest, responseValue);
|
sl@0
|
62 |
if (responseValue == EDenied)
|
sl@0
|
63 |
{
|
sl@0
|
64 |
SetSessionToAlert(aAudioPolicyRequest->PolicySessionId(),
|
sl@0
|
65 |
NULL, TMMFAudioPolicyEvent::EMMFAudioPolicyPriorityTooLow,
|
sl@0
|
66 |
aAudioPolicyRequest->State());
|
sl@0
|
67 |
if(IsRegisteredNotification(aAudioPolicyRequest->PolicySessionId()))
|
sl@0
|
68 |
{
|
sl@0
|
69 |
TRAPD(err, iAudioPolicyRequestArray->AppendL(*aAudioPolicyRequest) );
|
sl@0
|
70 |
__ASSERT_ALWAYS(err==KErrNone, Panic(EMMFAudioPolicyRequestArrayOverflow) ); // we reserved space, so shouldn't hit this
|
sl@0
|
71 |
}
|
sl@0
|
72 |
}
|
sl@0
|
73 |
|
sl@0
|
74 |
// If a client needs to be notified (either a previous session that was booted off or a new
|
sl@0
|
75 |
// one that was denied) then send event for that session to the client:
|
sl@0
|
76 |
// NB KErrInUse, KErrDied OR KErrAccessDenied may be used to indicate this.
|
sl@0
|
77 |
if (iSessionToAlert != NULL)
|
sl@0
|
78 |
{
|
sl@0
|
79 |
//check the session is registered for notification of resource available
|
sl@0
|
80 |
if(!IsRegisteredNotification(iSessionToAlert))
|
sl@0
|
81 |
{
|
sl@0
|
82 |
RemoveFromList(iSessionToAlert);
|
sl@0
|
83 |
}
|
sl@0
|
84 |
iAudioPolicyEvent.iErrorCode = KErrInUse;
|
sl@0
|
85 |
iAudioPolicyEvent.iState = aAudioPolicyRequest->State();
|
sl@0
|
86 |
iAudioPolicyServer->SendEventToClient(iSessionToAlert, iSessionToBeLaunched, iAudioPolicyEvent);
|
sl@0
|
87 |
}
|
sl@0
|
88 |
//Resume of a Audio of the notified client ,since it is already in the list
|
sl@0
|
89 |
//no need to append and send response back to DevSound for request accepted.
|
sl@0
|
90 |
if(responseValue == EResume)
|
sl@0
|
91 |
{
|
sl@0
|
92 |
iAudioPolicyServer->StopNotificationTimer();
|
sl@0
|
93 |
iAudioPolicyEvent.iErrorCode = KErrNone;
|
sl@0
|
94 |
iAudioPolicyEvent.iEventType = TMMFAudioPolicyEvent::EMMFAudioPolicyNoEvent;
|
sl@0
|
95 |
iAudioPolicyEvent.iState = aAudioPolicyRequest->State();
|
sl@0
|
96 |
iAudioPolicyServer->SendEventToClient(aAudioPolicyRequest->PolicySessionId(), NULL, iAudioPolicyEvent);
|
sl@0
|
97 |
}
|
sl@0
|
98 |
// Add new policy to list, and send response back to DevSound for request accepted
|
sl@0
|
99 |
if (responseValue == EProceed)
|
sl@0
|
100 |
{
|
sl@0
|
101 |
//no possibility of expansion here as sufficient space for the array is reserved in advance during the creation of the policysession
|
sl@0
|
102 |
TRAPD(err, iAudioPolicyRequestArray->AppendL(*aAudioPolicyRequest) );
|
sl@0
|
103 |
__ASSERT_ALWAYS(err==KErrNone,Panic(EMMFAudioPolicyRequestArrayOverflow) ); // we reserved space, so shouldn't hit this
|
sl@0
|
104 |
iAudioPolicyEvent.iErrorCode = KErrNone;
|
sl@0
|
105 |
iAudioPolicyEvent.iEventType = TMMFAudioPolicyEvent::EMMFAudioPolicyNoEvent;
|
sl@0
|
106 |
iAudioPolicyEvent.iState = aAudioPolicyRequest->State();
|
sl@0
|
107 |
iAudioPolicyServer->SendEventToClient(aAudioPolicyRequest->PolicySessionId(), NULL, iAudioPolicyEvent);
|
sl@0
|
108 |
}
|
sl@0
|
109 |
if (responseValue == EStopThenProceed) // place on list, but dev Sound will launch request
|
sl@0
|
110 |
{
|
sl@0
|
111 |
//no possibility of expansion here as sufficient space for the array is reserved in advance during the creation of the policysession
|
sl@0
|
112 |
TRAPD(err, iAudioPolicyRequestArray->AppendL(*aAudioPolicyRequest) );
|
sl@0
|
113 |
__ASSERT_ALWAYS(err==KErrNone,Panic(EMMFAudioPolicyRequestArrayOverflow) ); // we reserved space, so shouldn't hit this
|
sl@0
|
114 |
}
|
sl@0
|
115 |
}
|
sl@0
|
116 |
|
sl@0
|
117 |
TPolicyResponse CAudioPolicy::ProcessRequest(CMMFAudioPolicyRequest* aAudioPolicyRequest)
|
sl@0
|
118 |
{
|
sl@0
|
119 |
TPolicyResponse responseValue(EProceed);
|
sl@0
|
120 |
iSessionToAlert = NULL; // Reset
|
sl@0
|
121 |
|
sl@0
|
122 |
// If there is no other item on list, return with proceed
|
sl@0
|
123 |
if (!iAudioPolicyRequestArray->Count())
|
sl@0
|
124 |
return EProceed;
|
sl@0
|
125 |
|
sl@0
|
126 |
// Handle Preferences, if any, otherwise just compare priorities:
|
sl@0
|
127 |
// HandlePreferences(aAudioPolicyRequest, preference, responseValue);
|
sl@0
|
128 |
if(IsNotified())
|
sl@0
|
129 |
{
|
sl@0
|
130 |
return EResume;
|
sl@0
|
131 |
}
|
sl@0
|
132 |
responseValue = ComparePriorities(aAudioPolicyRequest);
|
sl@0
|
133 |
|
sl@0
|
134 |
return responseValue;
|
sl@0
|
135 |
}
|
sl@0
|
136 |
|
sl@0
|
137 |
void CAudioPolicy::ModifyEntry(TInt aPolicySessionId, CMMFAudioPolicyRequest* aAudioPolicyRequest)
|
sl@0
|
138 |
{
|
sl@0
|
139 |
TMMFAudioPolicyState requestState = aAudioPolicyRequest->State();
|
sl@0
|
140 |
// If state is stopped or paused, remove item from list
|
sl@0
|
141 |
if ((aAudioPolicyRequest->State() == EMMFStatePaused) || (aAudioPolicyRequest->State() == EMMFStateStopped) || (aAudioPolicyRequest->State() == EMMFStateCompleted))
|
sl@0
|
142 |
{
|
sl@0
|
143 |
if(iSessionToBeLaunched == aPolicySessionId)
|
sl@0
|
144 |
{
|
sl@0
|
145 |
iSessionToBeLaunched = 0;
|
sl@0
|
146 |
}
|
sl@0
|
147 |
if((aAudioPolicyRequest->State() == EMMFStateStopped) && (!iSessionToBeLaunched))
|
sl@0
|
148 |
{
|
sl@0
|
149 |
TInt sessionToNotify = CheckSessionToNotify();
|
sl@0
|
150 |
if(sessionToNotify)
|
sl@0
|
151 |
{
|
sl@0
|
152 |
iAudioPolicyServer->StartNotificationTimer();
|
sl@0
|
153 |
iAudioPolicyEvent.iErrorCode = KErrNone;
|
sl@0
|
154 |
iAudioPolicyEvent.iEventType = TMMFAudioPolicyEvent::EMMFAudioPolicyResourceNotification;
|
sl@0
|
155 |
iAudioPolicyServer->SendEventToClient(sessionToNotify, NULL, iAudioPolicyEvent);
|
sl@0
|
156 |
}
|
sl@0
|
157 |
}
|
sl@0
|
158 |
if(aAudioPolicyRequest->NotificationEvent() != KMMFEventCategoryAudioResourceAvailable)
|
sl@0
|
159 |
{
|
sl@0
|
160 |
RemoveFromList(aPolicySessionId);
|
sl@0
|
161 |
return;
|
sl@0
|
162 |
}
|
sl@0
|
163 |
}
|
sl@0
|
164 |
|
sl@0
|
165 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
166 |
{
|
sl@0
|
167 |
// Find correct entry to replace state
|
sl@0
|
168 |
if ( ((*iAudioPolicyRequestArray)[index].PolicySessionId()) == aPolicySessionId)
|
sl@0
|
169 |
{
|
sl@0
|
170 |
(*iAudioPolicyRequestArray)[index].SetState(requestState);
|
sl@0
|
171 |
break;
|
sl@0
|
172 |
}
|
sl@0
|
173 |
}
|
sl@0
|
174 |
}
|
sl@0
|
175 |
|
sl@0
|
176 |
void CAudioPolicy::RemoveFromList(TInt aPolicySessionId)
|
sl@0
|
177 |
{
|
sl@0
|
178 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
179 |
{
|
sl@0
|
180 |
// Find correct entry to remove
|
sl@0
|
181 |
if ( (*iAudioPolicyRequestArray)[index].PolicySessionId() == aPolicySessionId)
|
sl@0
|
182 |
{
|
sl@0
|
183 |
iAudioPolicyRequestArray->Delete(index);
|
sl@0
|
184 |
break;
|
sl@0
|
185 |
}
|
sl@0
|
186 |
}
|
sl@0
|
187 |
}
|
sl@0
|
188 |
|
sl@0
|
189 |
TPolicyResponse CAudioPolicy::ComparePriorities(CMMFAudioPolicyRequest* aAudioPolicyRequest/*, TMMFAudioPolicyEvent& aEvent*/)
|
sl@0
|
190 |
{
|
sl@0
|
191 |
TPolicyResponse responseValue(EProceed);
|
sl@0
|
192 |
TInt requestPriority = aAudioPolicyRequest->Priority();
|
sl@0
|
193 |
|
sl@0
|
194 |
TBool requestCaps = aAudioPolicyRequest->Capabilities();
|
sl@0
|
195 |
|
sl@0
|
196 |
// Iterate through list and compare priorities:
|
sl@0
|
197 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
198 |
{
|
sl@0
|
199 |
// If there's even one on the list w/ a higher priority deny request and leave:
|
sl@0
|
200 |
|
sl@0
|
201 |
if ((*iAudioPolicyRequestArray)[index].Capabilities() > requestCaps)
|
sl@0
|
202 |
{
|
sl@0
|
203 |
responseValue = EDenied;
|
sl@0
|
204 |
break;
|
sl@0
|
205 |
}
|
sl@0
|
206 |
else if((*iAudioPolicyRequestArray)[index].Capabilities() == requestCaps)
|
sl@0
|
207 |
{
|
sl@0
|
208 |
if((*iAudioPolicyRequestArray)[index].Priority() >= requestPriority)
|
sl@0
|
209 |
{
|
sl@0
|
210 |
responseValue = EDenied;
|
sl@0
|
211 |
break;
|
sl@0
|
212 |
}
|
sl@0
|
213 |
}
|
sl@0
|
214 |
|
sl@0
|
215 |
|
sl@0
|
216 |
// Otherwise have the one on the list removed:
|
sl@0
|
217 |
SetSessionToAlert((*iAudioPolicyRequestArray)[index].PolicySessionId(),
|
sl@0
|
218 |
aAudioPolicyRequest->PolicySessionId(), TMMFAudioPolicyEvent::EMMFAudioPolicyPriorityTooLow, aAudioPolicyRequest->State());
|
sl@0
|
219 |
responseValue = EStopThenProceed;
|
sl@0
|
220 |
}
|
sl@0
|
221 |
return responseValue;
|
sl@0
|
222 |
}
|
sl@0
|
223 |
|
sl@0
|
224 |
void CAudioPolicy::HandlePreferences(CMMFAudioPolicyRequest* /*aAudioPolicyRequest*/, TInt /*aPref*/, TPolicyResponse& /*aResponse*/)
|
sl@0
|
225 |
{
|
sl@0
|
226 |
}
|
sl@0
|
227 |
|
sl@0
|
228 |
void CAudioPolicy::LaunchRequest()
|
sl@0
|
229 |
{
|
sl@0
|
230 |
if (iAudioPolicyEventToLaunch.iEventType == TMMFAudioPolicyEvent::EMMFAudioPolicySwitchToIdle)
|
sl@0
|
231 |
iAudioPolicyServer->LaunchRequest(iSessionToBeLaunched, iAudioPolicyEventToLaunch);
|
sl@0
|
232 |
}
|
sl@0
|
233 |
|
sl@0
|
234 |
// Sets up session information for sending an event on a denied (or killed) request
|
sl@0
|
235 |
void CAudioPolicy::SetSessionToAlert(TInt aSessionToAlert, TInt aSessionToBeLaunched, TMMFAudioPolicyEvent::TAudioPolicyEventType aEventType, TMMFAudioPolicyState aState )
|
sl@0
|
236 |
{
|
sl@0
|
237 |
iSessionToAlert = aSessionToAlert;
|
sl@0
|
238 |
iSessionToBeLaunched = aSessionToBeLaunched;
|
sl@0
|
239 |
iAudioPolicyEvent.iEventType = aEventType;
|
sl@0
|
240 |
|
sl@0
|
241 |
if (iSessionToBeLaunched != 0) // When currently playing item needs to be stopped
|
sl@0
|
242 |
{
|
sl@0
|
243 |
iAudioPolicyEventToLaunch.iEventType = TMMFAudioPolicyEvent::EMMFAudioPolicySwitchToIdle;
|
sl@0
|
244 |
iAudioPolicyEventToLaunch.iState = aState;
|
sl@0
|
245 |
}
|
sl@0
|
246 |
}
|
sl@0
|
247 |
|
sl@0
|
248 |
CArrayFixFlat<CMMFAudioPolicyRequest>* CAudioPolicy::AudioPolicyRequestArray()
|
sl@0
|
249 |
{
|
sl@0
|
250 |
return iAudioPolicyRequestArray;
|
sl@0
|
251 |
}
|
sl@0
|
252 |
|
sl@0
|
253 |
/**
|
sl@0
|
254 |
@internalTechnology
|
sl@0
|
255 |
|
sl@0
|
256 |
This function raises a panic
|
sl@0
|
257 |
|
sl@0
|
258 |
@param aError
|
sl@0
|
259 |
one of the several panics codes that may be raised by this dll
|
sl@0
|
260 |
|
sl@0
|
261 |
@panic EMMFAudioPolicyRequestArrayOverflow is raised when policyrequest array is full
|
sl@0
|
262 |
*/
|
sl@0
|
263 |
GLDEF_C void Panic(TMMFAudioPolicyPanicCodes aPanicCode)
|
sl@0
|
264 |
{
|
sl@0
|
265 |
User::Panic(KMMFAudioPolicyPanicCategory, aPanicCode);
|
sl@0
|
266 |
}
|
sl@0
|
267 |
|
sl@0
|
268 |
// checks based on the session ,Is the session is registered for Notification
|
sl@0
|
269 |
TBool CAudioPolicy::IsRegisteredNotification(TInt aSessionId)
|
sl@0
|
270 |
{
|
sl@0
|
271 |
TUid event;
|
sl@0
|
272 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
273 |
{
|
sl@0
|
274 |
if((*iAudioPolicyRequestArray)[index].PolicySessionId() == aSessionId)
|
sl@0
|
275 |
{
|
sl@0
|
276 |
event = (*iAudioPolicyRequestArray)[index].NotificationEvent();
|
sl@0
|
277 |
if (event == KMMFEventCategoryAudioResourceAvailable)
|
sl@0
|
278 |
{
|
sl@0
|
279 |
// only when the client is registered for KMMFEventCategoryAudioResourceAvailable event
|
sl@0
|
280 |
return ETrue;
|
sl@0
|
281 |
}
|
sl@0
|
282 |
break;
|
sl@0
|
283 |
}
|
sl@0
|
284 |
}
|
sl@0
|
285 |
return EFalse;
|
sl@0
|
286 |
}
|
sl@0
|
287 |
|
sl@0
|
288 |
// checks the state,whether any client is already send notification
|
sl@0
|
289 |
TBool CAudioPolicy::IsNotified()
|
sl@0
|
290 |
{
|
sl@0
|
291 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
292 |
{
|
sl@0
|
293 |
if((*iAudioPolicyRequestArray)[index].State() == EMMFStateNotified)
|
sl@0
|
294 |
{
|
sl@0
|
295 |
// In a instance only one client should have the state as EMMFStateNotified
|
sl@0
|
296 |
return ETrue;
|
sl@0
|
297 |
}
|
sl@0
|
298 |
}
|
sl@0
|
299 |
return EFalse;
|
sl@0
|
300 |
}
|
sl@0
|
301 |
|
sl@0
|
302 |
// get the next highest priority of the client to notify
|
sl@0
|
303 |
TInt CAudioPolicy::CheckSessionToNotify()
|
sl@0
|
304 |
{
|
sl@0
|
305 |
TInt nextHighestPriority= -100;
|
sl@0
|
306 |
TInt sessionToNotify = 0;
|
sl@0
|
307 |
TInt notificationIdx = -1;
|
sl@0
|
308 |
if(IsNotified())
|
sl@0
|
309 |
{
|
sl@0
|
310 |
return sessionToNotify;
|
sl@0
|
311 |
}
|
sl@0
|
312 |
// get the max priority and set the Index
|
sl@0
|
313 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
314 |
{
|
sl@0
|
315 |
if((nextHighestPriority <= (*iAudioPolicyRequestArray)[index].Priority()) && ((*iAudioPolicyRequestArray)[index].NotificationEvent() != KNullUid) && (!(*iAudioPolicyRequestArray)[index].IsEventNotified()))
|
sl@0
|
316 |
{
|
sl@0
|
317 |
nextHighestPriority = (*iAudioPolicyRequestArray)[index].Priority();
|
sl@0
|
318 |
sessionToNotify = (*iAudioPolicyRequestArray)[index].PolicySessionId();
|
sl@0
|
319 |
notificationIdx = index;
|
sl@0
|
320 |
}
|
sl@0
|
321 |
}
|
sl@0
|
322 |
// set the state as notified
|
sl@0
|
323 |
if(notificationIdx != -1)
|
sl@0
|
324 |
{
|
sl@0
|
325 |
(*iAudioPolicyRequestArray)[notificationIdx].SetEventFlag(ETrue);
|
sl@0
|
326 |
(*iAudioPolicyRequestArray)[notificationIdx].SetState(EMMFStateNotified);
|
sl@0
|
327 |
}
|
sl@0
|
328 |
return sessionToNotify;
|
sl@0
|
329 |
}
|
sl@0
|
330 |
|
sl@0
|
331 |
// send the message to the server
|
sl@0
|
332 |
void CAudioPolicy::DoSendNotification()
|
sl@0
|
333 |
{
|
sl@0
|
334 |
ResetNotification();
|
sl@0
|
335 |
TInt sessionToNotify = CheckSessionToNotify();
|
sl@0
|
336 |
if(sessionToNotify)
|
sl@0
|
337 |
{
|
sl@0
|
338 |
iAudioPolicyEvent.iErrorCode = KErrNone;
|
sl@0
|
339 |
iAudioPolicyEvent.iEventType = TMMFAudioPolicyEvent::EMMFAudioPolicyResourceNotification;
|
sl@0
|
340 |
iAudioPolicyServer->SendEventToClient(sessionToNotify, NULL, iAudioPolicyEvent);
|
sl@0
|
341 |
}
|
sl@0
|
342 |
}
|
sl@0
|
343 |
|
sl@0
|
344 |
// Set in the AudiopolicyRequestArray the uid registered
|
sl@0
|
345 |
TInt CAudioPolicy::SetNotification(TInt aSessionId, TUid aEventType)
|
sl@0
|
346 |
{
|
sl@0
|
347 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
348 |
{
|
sl@0
|
349 |
if((*iAudioPolicyRequestArray)[index].PolicySessionId() == aSessionId)
|
sl@0
|
350 |
{
|
sl@0
|
351 |
(*iAudioPolicyRequestArray)[index].SetNotificationEvent(aEventType);
|
sl@0
|
352 |
return ETrue;
|
sl@0
|
353 |
}
|
sl@0
|
354 |
}
|
sl@0
|
355 |
return EFalse;
|
sl@0
|
356 |
}
|
sl@0
|
357 |
|
sl@0
|
358 |
// cancel the state of the message notification to closed
|
sl@0
|
359 |
void CAudioPolicy::ResetNotification()
|
sl@0
|
360 |
{
|
sl@0
|
361 |
for (TInt index = 0; index < iAudioPolicyRequestArray->Count(); index++)
|
sl@0
|
362 |
{
|
sl@0
|
363 |
if((*iAudioPolicyRequestArray)[index].State() == EMMFStateNotified)
|
sl@0
|
364 |
{
|
sl@0
|
365 |
(*iAudioPolicyRequestArray)[index].SetState(EMMFStateClosed);
|
sl@0
|
366 |
}
|
sl@0
|
367 |
}
|
sl@0
|
368 |
}
|
sl@0
|
369 |
|