|
1 // Copyright (c) 2002-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 |
|
14 #include "cmmmessagerouter.h" |
|
15 #include "cmmcustomstubext.h" |
|
16 #include "tflogger.h" |
|
17 #include <ctsy/pluginapi/cmmdatapackage.h> |
|
18 |
|
19 const TUint KPhoneInfoDescSize = 15; |
|
20 |
|
21 // ======== MEMBER FUNCTIONS ======== |
|
22 |
|
23 CMmCustomStubExt::CMmCustomStubExt() |
|
24 : iMessageRouter( NULL ), |
|
25 iFirstTime ( ETrue ), |
|
26 iVendorExtComplete( NULL ) |
|
27 { |
|
28 } |
|
29 |
|
30 CMmCustomStubExt::~CMmCustomStubExt() |
|
31 { |
|
32 } |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // CMmCustomStubExt::DoExtFuncL |
|
36 // |
|
37 // (other items were commented in a header) |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 TInt CMmCustomStubExt::DoExtFuncL( |
|
41 const TTsyReqHandle aTsyReqHandle, |
|
42 const TInt /*aIpc*/, |
|
43 const TDataPackage& /*aPackage*/ ) |
|
44 { |
|
45 TInt ret = KErrNotSupported; |
|
46 |
|
47 if( iFirstTime ) |
|
48 { |
|
49 // crate datapackage |
|
50 CMmDataPackage data; |
|
51 CMmDataPackage* package; |
|
52 package = NULL; |
|
53 |
|
54 // phone id |
|
55 TBuf8<KPhoneInfoDescSize> tmp; |
|
56 _LIT8( phoneid,"000000000000000" ); |
|
57 tmp.Copy( phoneid ); |
|
58 data.PackData( &tmp ); |
|
59 package = &data; |
|
60 iMessageRouter->MessageManager()->Complete( |
|
61 EMobilePhoneGetPhoneId, package, KErrNone ); |
|
62 |
|
63 // Create dummy IMSI |
|
64 TBuf8<KPhoneInfoDescSize> temp; |
|
65 _LIT8( imsi,"000000000000000" ); |
|
66 temp.Copy( imsi ); |
|
67 data.PackData( &temp ); |
|
68 package = &data; |
|
69 iMessageRouter->MessageManager()->Complete( |
|
70 EMobilePhoneGetSubscriberId, package, KErrNone ); |
|
71 |
|
72 iFirstTime = EFalse; |
|
73 } |
|
74 else |
|
75 { |
|
76 // test the new ReqComplete interface |
|
77 iVendorExtComplete->ReqCompleted( aTsyReqHandle, KErrNotSupported ); |
|
78 ret = KErrNone; |
|
79 } |
|
80 |
|
81 TFLOGSTRING2( "TSY: CMmCustomStubExt::DoExtFuncL. ret: %d ", ret ); |
|
82 return ret; |
|
83 } |
|
84 |
|
85 // --------------------------------------------------------------------------- |
|
86 // CMmCustomStubExt::SupportingIPC |
|
87 // |
|
88 // (other items were commented in a header) |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 TBool CMmCustomStubExt::SupportingIPC( |
|
92 TInt /*aIpc*/ ) |
|
93 { |
|
94 return iFirstTime; |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------------------------- |
|
98 // CMmCustomStubExt::InitializeL |
|
99 // |
|
100 // (other items were commented in a header) |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 void CMmCustomStubExt::InitializeL( |
|
104 MCustomVendorExtComplete& aMCustomVendorExtComplete ) |
|
105 { |
|
106 TFLOGSTRING( "TSY: CMmCustomStubExt::InitializeL. " ); |
|
107 |
|
108 iVendorExtComplete = &aMCustomVendorExtComplete; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CMmCustomStubExt::SetMessageRouter |
|
113 // |
|
114 // (other items were commented in a header) |
|
115 // --------------------------------------------------------------------------- |
|
116 // |
|
117 void CMmCustomStubExt::SetMessageRouter( |
|
118 CMmMessageRouter* aMessageRouter ) |
|
119 { |
|
120 TFLOGSTRING( "TSY: CMmCustomStubExt::SetMessageRouter. " ); |
|
121 iMessageRouter = aMessageRouter; |
|
122 iFirstTime = ETrue; |
|
123 } |
|
124 |
|
125 // --------------------------------------------------------------------------- |
|
126 // CMmCustomStubExt::RegisterNotification |
|
127 // Notification cannot be registered |
|
128 // (other items were commented in a header) |
|
129 // --------------------------------------------------------------------------- |
|
130 // |
|
131 TInt CMmCustomStubExt::RegisterNotification( |
|
132 const TInt /*aIpc*/ ) |
|
133 { |
|
134 return KErrNotSupported; |
|
135 } |
|
136 |
|
137 // --------------------------------------------------------------------------- |
|
138 // CMmCustomStubExt::DeregisterNotification |
|
139 // Because notification cannot be registered, they cannot unregister either |
|
140 // (other items were commented in a header) |
|
141 // --------------------------------------------------------------------------- |
|
142 // |
|
143 TInt CMmCustomStubExt::DeregisterNotification( |
|
144 const TInt /*aIpc*/ ) |
|
145 { |
|
146 return KErrNotSupported; |
|
147 } |
|
148 |
|
149 // --------------------------------------------------------------------------- |
|
150 // CMmCustomStubExt::ReqModeL |
|
151 // Dummy implementation for ReqModeL |
|
152 // (other items were commented in a header) |
|
153 // --------------------------------------------------------------------------- |
|
154 // |
|
155 CTelObject::TReqMode CMmCustomStubExt::ReqModeL( |
|
156 const TInt /*aIpc*/ ) |
|
157 { |
|
158 return 0; |
|
159 } |
|
160 |
|
161 // --------------------------------------------------------------------------- |
|
162 // CMmCustomStubExt::NumberOfSlotsL |
|
163 // Returns number of slots |
|
164 // (other items were commented in a header) |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 TInt CMmCustomStubExt::NumberOfSlotsL( |
|
168 const TInt /*aIpc*/ ) |
|
169 { |
|
170 return 2; |
|
171 } |
|
172 |
|
173 // --------------------------------------------------------------------------- |
|
174 // CMmCustomStubExt::CancelService |
|
175 // Cancel services |
|
176 // (other items were commented in a header) |
|
177 // --------------------------------------------------------------------------- |
|
178 // |
|
179 TInt CMmCustomStubExt::CancelService( |
|
180 const TInt /*aIpc*/, |
|
181 const TTsyReqHandle /*aTsyReqHandle*/ ) |
|
182 { |
|
183 return KErrGeneral; |
|
184 } |
|
185 |
|
186 // --------------------------------------------------------------------------- |
|
187 // CMmCustomStubExt::Complete |
|
188 // Completes request |
|
189 // (other items were commented in a header) |
|
190 // --------------------------------------------------------------------------- |
|
191 // |
|
192 TInt CMmCustomStubExt::Complete( TInt /*aReqHandleType*/, |
|
193 TInt /*aError*/, |
|
194 TInt /*aIPC*/ ) |
|
195 { |
|
196 return KErrNotSupported; |
|
197 } |
|
198 |
|
199 // --------------------------------------------------------------------------- |
|
200 // CMmCustomStubExt::GetRequiredPlatSecCaps |
|
201 // Return required platform security caps, EAlwaysPass |
|
202 // (other items were commented in a header) |
|
203 // --------------------------------------------------------------------------- |
|
204 // |
|
205 TSecurityPolicy CMmCustomStubExt::GetRequiredPlatSecCaps( |
|
206 const TInt /*aIpc*/ ) |
|
207 { |
|
208 return TSecurityPolicy( TSecurityPolicy::EAlwaysPass ); |
|
209 } |
|
210 |
|
211 // End of File |