0
|
1 |
// Copyright (c) 2010 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 |
#include "mediaclientpolicyserverclient.h"
|
|
17 |
#include <e32std.h>
|
|
18 |
#include "mediaclientvideotrace.h"
|
|
19 |
|
|
20 |
CMediaClientPolicyServerClient* CMediaClientPolicyServerClient::NewL()
|
|
21 |
{
|
|
22 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::NewL +++");
|
|
23 |
|
|
24 |
CMediaClientPolicyServerClient* self = new( ELeave ) CMediaClientPolicyServerClient();
|
|
25 |
|
|
26 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::NewL ---");
|
|
27 |
return self;
|
|
28 |
}
|
|
29 |
|
|
30 |
CMediaClientPolicyServerClient::~CMediaClientPolicyServerClient()
|
|
31 |
{
|
|
32 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::~CMediaClientPolicyServerClient +++");
|
|
33 |
iSession.Close();
|
|
34 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::~CMediaClientPolicyServerClient ---");
|
|
35 |
}
|
|
36 |
|
|
37 |
void CMediaClientPolicyServerClient::SetSurface(const TSurfaceId& aSurfaceId)
|
|
38 |
{
|
|
39 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::SetSurface +++");
|
|
40 |
|
|
41 |
if( aSurfaceId.IsNull() )
|
|
42 |
{
|
|
43 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::SetSurface NULL SurfaceId received");
|
|
44 |
}
|
|
45 |
else
|
|
46 |
{
|
|
47 |
iSurfaceId = aSurfaceId;
|
|
48 |
DEBUG_PRINTF5("CMediaClientPolicyServerClient::SetSurface - iSurfaceId %08x:%08x:%08x:%08x", iSurfaceId.iInternal[3], iSurfaceId.iInternal[2], iSurfaceId.iInternal[1], iSurfaceId.iInternal[0]);
|
|
49 |
}
|
|
50 |
|
|
51 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::SetSurface ---");
|
|
52 |
}
|
|
53 |
|
|
54 |
void CMediaClientPolicyServerClient::FocusChanged(TBool aForeground)
|
|
55 |
{
|
|
56 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::FocusChanged +++");
|
|
57 |
|
|
58 |
DEBUG_PRINTF5("CMediaClientPolicyServerClient::FocusChanged - iSurfaceId %08x:%08x:%08x:%08x", iSurfaceId.iInternal[3], iSurfaceId.iInternal[2], iSurfaceId.iInternal[1], iSurfaceId.iInternal[0]);
|
|
59 |
DEBUG_PRINTF2("CMediaClientPolicyServerClient::FocusChanged - Focus %d", aForeground);
|
|
60 |
|
|
61 |
if( iSurfaceId.IsNull() )
|
|
62 |
{
|
|
63 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::FocusChanged SurfaceId is NULL ... ignore focus change event");
|
|
64 |
}
|
|
65 |
else
|
|
66 |
{
|
|
67 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::FocusChanged Send focus change event to PS");
|
|
68 |
TFocusSurfaceChangedEvent focusChangedMessage;
|
|
69 |
focusChangedMessage.iSurfaceId = iSurfaceId;
|
|
70 |
focusChangedMessage.iForeground = aForeground;
|
|
71 |
TPckgBuf<TFocusSurfaceChangedEvent> buffer(focusChangedMessage);
|
|
72 |
TIpcArgs messageArguments(&buffer);
|
|
73 |
|
|
74 |
TInt error = iSession.SendMessage(KFocusSurfaceChanged, messageArguments);
|
|
75 |
|
|
76 |
if(error)
|
|
77 |
{
|
|
78 |
DEBUG_PRINTF2(" CMediaClientPolicyServerClient::FocusChanged SendMessage failed, error = %d", error);
|
|
79 |
}
|
|
80 |
}
|
|
81 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::FocusChanged ---");
|
|
82 |
}
|
|
83 |
|
|
84 |
TBool CMediaClientPolicyServerClient::IgnoreProcess(TSecureId aId)
|
|
85 |
{
|
|
86 |
DEBUG_PRINTF("CMediaClientPolicyServerClient::IgnoreProcess +++");
|
|
87 |
|
|
88 |
TBool ignore = (
|
|
89 |
(aId == 0x10281EF2) || // aknnfysrv
|
|
90 |
(aId == 0x10207218) || // akncapserver
|
|
91 |
(aId == 0x10003a4a) || // eiksrvs
|
|
92 |
(aId == 0x20022FC5) // Hbdevicedialogappserver
|
|
93 |
);
|
|
94 |
|
|
95 |
DEBUG_PRINTF2("CMediaClientPolicyServerClient::IgnoreProcess --- return %d", ignore);
|
|
96 |
return ignore;
|
|
97 |
}
|
|
98 |
|
|
99 |
TInt CMediaClientPolicyServerClient::Connect()
|
|
100 |
{
|
|
101 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::Connect +++");
|
|
102 |
TInt error = iSession.Connect();
|
|
103 |
DEBUG_PRINTF2(" CMediaClientPolicyServerClient::Connect --- return %d", error);
|
|
104 |
return error;
|
|
105 |
}
|
|
106 |
|
|
107 |
void CMediaClientPolicyServerClient::Close()
|
|
108 |
{
|
|
109 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::Close +++");
|
|
110 |
iSession.Close();
|
|
111 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::Close ---");
|
|
112 |
}
|
|
113 |
|
|
114 |
CMediaClientPolicyServerClient::CMediaClientPolicyServerClient()
|
|
115 |
{
|
|
116 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::CMediaClientPolicyServerClient +++");
|
|
117 |
iSurfaceId = TSurfaceId::CreateNullId();
|
|
118 |
DEBUG_PRINTF(" CMediaClientPolicyServerClient::CMediaClientPolicyServerClient ---");
|
|
119 |
}
|