equal
deleted
inserted
replaced
68 { |
68 { |
69 CActiveScheduler::Add(this); |
69 CActiveScheduler::Add(this); |
70 iStatus = KErrNotFound; |
70 iStatus = KErrNotFound; |
71 } |
71 } |
72 |
72 |
73 static void DoGuardedOpL(const TAlfCommandParams& aInParams, |
73 static TInt DoGuardedOpErrL(const TAlfCommandParams& aInParams, |
74 TDes8& aOutParams, |
74 TDes8& aOutParams, |
75 RNotifier& aNotifier, |
75 RNotifier& aNotifier, |
76 const TDesC8* aInParams2 = 0 // ugly extension, really |
76 const TDesC8* aInParams2 = 0 // ugly extension, really |
77 ) |
77 ) |
78 { |
78 { |
111 { |
111 { |
112 TInt err = me->iStatus.Int(); |
112 TInt err = me->iStatus.Int(); |
113 User::WaitForRequest(me->iTimerStatus); |
113 User::WaitForRequest(me->iTimerStatus); |
114 aOutParams.Copy(*me->iRetBuf); |
114 aOutParams.Copy(*me->iRetBuf); |
115 delete me; |
115 delete me; |
116 User::LeaveIfError(err); |
116 return err; |
117 } |
117 } |
118 else |
118 else |
119 { |
119 { |
120 me->SetActive(); |
120 me->SetActive(); |
121 User::Leave( KErrTimedOut ); |
121 return KErrTimedOut; |
122 } |
122 } |
|
123 } |
|
124 |
|
125 static void DoGuardedOpL(const TAlfCommandParams& aInParams, |
|
126 TDes8& aOutParams, |
|
127 RNotifier& aNotifier, |
|
128 const TDesC8* aInParams2 = 0 // ugly extension, really |
|
129 ) |
|
130 { |
|
131 TInt err = DoGuardedOpErrL(aInParams, aOutParams, aNotifier, aInParams2); |
|
132 User::LeaveIfError(err); |
123 } |
133 } |
124 |
134 |
125 static TInt DoGuardedOp(const TAlfCommandParams& aInParams, |
135 static TInt DoGuardedOp(const TAlfCommandParams& aInParams, |
126 TDes8& aOutParams, |
136 TDes8& aOutParams, |
127 RNotifier& aNotifier) |
137 RNotifier& aNotifier) |
128 { |
138 { |
129 TInt ret = KErrNone; |
139 TInt ret = KErrNone; |
130 TRAP(ret, DoGuardedOpL(aInParams, aOutParams, aNotifier);) |
140 TInt err = KErrNone; |
|
141 TRAP(ret, err = DoGuardedOpErrL(aInParams, aOutParams, aNotifier);) |
|
142 if (ret == KErrNone) |
|
143 { |
|
144 ret = err; |
|
145 } |
131 return ret; |
146 return ret; |
132 } |
147 } |
133 |
148 |
134 ~CAlfGuardedSynchCall() |
149 ~CAlfGuardedSynchCall() |
135 { |
150 { |
174 void RunL() |
189 void RunL() |
175 { |
190 { |
176 iNotif.iLayoutMirrored = (iStatus.Int() > 0); |
191 iNotif.iLayoutMirrored = (iStatus.Int() > 0); |
177 SetActive(); |
192 SetActive(); |
178 TAlfCommandParams params={EAlfIsMirrorred,0,0,0}; |
193 TAlfCommandParams params={EAlfIsMirrorred,0,0,0}; |
179 TPckgC<TAlfCommandParams> pkg(params); |
194 iParams() = params; |
180 TBuf8<1> awkwardApiDummy; |
195 iNotif.iNotif.StartNotifierAndGetResponse(iStatus,TUid::Uid(KAlfAppFwProxyUid), iParams, iAwkwardApiDummy); |
181 iNotif.iNotif.StartNotifierAndGetResponse(iStatus,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy); |
|
182 } |
196 } |
183 |
197 |
184 void DoCancel() |
198 void DoCancel() |
185 { |
199 { |
186 // just wait for notifier completion |
200 // just wait for notifier completion |
187 User::WaitForRequest(iStatus); |
201 User::WaitForRequest(iStatus); |
188 } |
202 } |
189 |
203 |
190 private: |
204 private: |
191 CAppFwProxy& iNotif; |
205 CAppFwProxy& iNotif; |
|
206 |
|
207 TBuf8<1> iAwkwardApiDummy; |
|
208 TPckgBuf<TAlfCommandParams> iParams; |
192 }; |
209 }; |
193 |
210 |
194 CAppFwProxy():iLayoutMirrored(KErrNotFound) |
211 CAppFwProxy():iLayoutMirrored(KErrNotFound) |
195 {} |
212 {} |
196 |
213 |