equal
deleted
inserted
replaced
58 { |
58 { |
59 public: |
59 public: |
60 DTest2PowerHandler(); |
60 DTest2PowerHandler(); |
61 void PowerUp(); |
61 void PowerUp(); |
62 void PowerDown(TPowerState); |
62 void PowerDown(TPowerState); |
|
63 void ActDead(); |
|
64 private: |
|
65 TBool iActDead; |
63 }; |
66 }; |
64 |
67 |
65 class DTestFactory : public DLogicalDevice |
68 class DTestFactory : public DLogicalDevice |
66 // |
69 // |
67 // Test LDD factory |
70 // Test LDD factory |
84 protected: |
87 protected: |
85 virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer); |
88 virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer); |
86 virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2); |
89 virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2); |
87 DTest1PowerHandler power1; |
90 DTest1PowerHandler power1; |
88 DTest2PowerHandler power2; |
91 DTest2PowerHandler power2; |
|
92 private: |
|
93 TUint iPslShutdownTimeoutMsBackup; |
89 }; |
94 }; |
90 |
95 |
91 |
96 |
92 |
97 |
93 DECLARE_STANDARD_LDD() |
98 DECLARE_STANDARD_LDD() |
147 { |
152 { |
148 power1.Remove(); |
153 power1.Remove(); |
149 power2.Remove(); |
154 power2.Remove(); |
150 //try to remove a handler twice - should not cause any problems |
155 //try to remove a handler twice - should not cause any problems |
151 power2.Remove(); |
156 power2.Remove(); |
|
157 ((DTestPowerManager*)(Kern::PowerModel()))->iPslShutdownTimeoutMs = iPslShutdownTimeoutMsBackup; |
152 } |
158 } |
153 |
159 |
154 TInt DTest1::Request(TInt aReqNo, TAny* a1, TAny* a2) |
160 TInt DTest1::Request(TInt aReqNo, TAny* a1, TAny* a2) |
155 { |
161 { |
156 // |
162 // |
190 else |
196 else |
191 { |
197 { |
192 // 'Control' functions... |
198 // 'Control' functions... |
193 switch(aReqNo) |
199 switch(aReqNo) |
194 { |
200 { |
|
201 |
195 // DoControl |
202 // DoControl |
196 case RLddTest1::ESET_SLEEPTIME: |
203 case RLddTest1::ESET_SLEEPTIME: |
197 sleepTime = (TUint)a1; |
204 sleepTime = (TUint)a1; |
198 break; |
205 break; |
|
206 case RLddTest1::EPOWER_ACTDEAD_POWER2: |
|
207 power2.ActDead(); |
|
208 break; |
|
209 case RLddTest1::EPOWER_ESETPOWERDOWNTIMEOUT: |
|
210 iPslShutdownTimeoutMsBackup = ((DTestPowerManager*)(Kern::PowerModel()))->iPslShutdownTimeoutMs; |
|
211 ((DTestPowerManager*)(Kern::PowerModel()))->iPslShutdownTimeoutMs = (TUint)a1; |
|
212 break; |
199 } |
213 } |
200 } |
214 } |
201 |
215 |
202 return KErrNone; |
216 return KErrNone; |
203 } |
217 } |
207 // |
221 // |
208 // Power handler1 constructor |
222 // Power handler1 constructor |
209 // |
223 // |
210 } |
224 } |
211 |
225 |
212 DTest2PowerHandler::DTest2PowerHandler():DPowerHandler(KLitPower2) |
226 DTest2PowerHandler::DTest2PowerHandler():DPowerHandler(KLitPower2), iActDead(EFalse) |
213 { |
227 { |
214 // |
228 // |
215 // Power handler2 constructor |
229 // Power handler2 constructor |
216 // |
230 // |
217 } |
231 } |
274 TUint temp = NKern::TickCount(); |
288 TUint temp = NKern::TickCount(); |
275 kumemput(time_power2down, (const TUint *)&temp, sizeof(temp)); |
289 kumemput(time_power2down, (const TUint *)&temp, sizeof(temp)); |
276 |
290 |
277 Kern::RequestComplete(aStatus_down2, KErrNone); |
291 Kern::RequestComplete(aStatus_down2, KErrNone); |
278 |
292 |
279 PowerDownDone(); |
293 if(!iActDead) |
280 } |
294 { |
|
295 PowerDownDone(); |
|
296 } |
|
297 } |
|
298 |
|
299 void DTest2PowerHandler::ActDead() |
|
300 { |
|
301 iActDead = ETrue; |
|
302 } |
|
303 |