24 #include <aknsoundsystem.h> |
24 #include <aknsoundsystem.h> |
25 #include <AknDef.h> |
25 #include <AknDef.h> |
26 #include <ctsydomainpskeys.h> |
26 #include <ctsydomainpskeys.h> |
27 #include <apgtask.h> |
27 #include <apgtask.h> |
28 |
28 |
|
29 |
29 // User includes |
30 // User includes |
30 #include <aisystemuids.hrh> |
31 #include <aisystemuids.hrh> |
31 #include <aiutility.h> |
32 #include <aiutility.h> |
32 #include <aipspropertyobserver.h> |
33 #include <aipspropertyobserver.h> |
33 #include "activeidle2domainpskeys.h" |
34 #include "activeidle2domainpskeys.h" |
104 aKeySoundConfig.iContextResId ); |
105 aKeySoundConfig.iContextResId ); |
105 } |
106 } |
106 |
107 |
107 iEikEnv.SetSystem( ETrue ); |
108 iEikEnv.SetSystem( ETrue ); |
108 |
109 |
109 TInt wgId( iEikEnv.RootWin().Identifier() ); |
110 RWindowGroup& windowGroup = iEikEnv.RootWin(); |
|
111 windowGroup.AutoForeground(EFalse); |
|
112 TInt wgId( windowGroup.Identifier() ); |
110 TInt focusWgId( iEikEnv.WsSession().GetFocusWindowGroup() ); |
113 TInt focusWgId( iEikEnv.WsSession().GetFocusWindowGroup() ); |
111 |
114 |
112 if ( focusWgId == wgId ) |
115 if ( focusWgId == wgId ) |
113 { |
116 { |
114 __PRINTS( "*** CAiUiIdleIntegrationImpl::ConstructL - iForeground: 1" ); |
117 __PRINTS( "*** CAiUiIdleIntegrationImpl::ConstructL - iForeground: 1" ); |
216 // CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() |
219 // CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() |
217 // ---------------------------------------------------------------------------- |
220 // ---------------------------------------------------------------------------- |
218 // |
221 // |
219 void CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() |
222 void CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() |
220 { |
223 { |
|
224 __PRINTS( "*** CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL" ); |
|
225 |
221 if( !iIncallBubbleAllowed ) |
226 if( !iIncallBubbleAllowed ) |
222 { |
227 { |
223 TInt callStatus( 0 ); |
228 TInt callStatus( 0 ); |
224 |
229 |
225 TInt err( RProperty::Get( KPSUidCtsyCallInformation, |
230 TInt err( RProperty::Get( KPSUidCtsyCallInformation, |
227 callStatus ) ); |
232 callStatus ) ); |
228 |
233 |
229 // Call ongoing => show bubble |
234 // Call ongoing => show bubble |
230 if( err == KErrNone && callStatus > EPSCTsyCallStateNone ) |
235 if( err == KErrNone && callStatus > EPSCTsyCallStateNone ) |
231 { |
236 { |
232 iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue ); |
237 __PRINTS( "*** CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL - enable" ); |
233 iIncallBubbleAllowed = ETrue; |
238 |
|
239 iIncallBubble->SetIncallBubbleAllowedInUsualL( ETrue ); |
|
240 iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue ); |
|
241 iIncallBubbleAllowed = ETrue; |
234 } |
242 } |
235 } |
243 } |
236 } |
244 } |
237 |
245 |
238 // ---------------------------------------------------------------------------- |
246 // ---------------------------------------------------------------------------- |
239 // CAiUiIdleIntegrationImpl::ClearCallBubbleL() |
247 // CAiUiIdleIntegrationImpl::ClearCallBubbleL() |
240 // ---------------------------------------------------------------------------- |
248 // ---------------------------------------------------------------------------- |
241 // |
249 // |
242 void CAiUiIdleIntegrationImpl::ClearCallBubbleL() |
250 void CAiUiIdleIntegrationImpl::ClearCallBubbleL() |
243 { |
251 { |
|
252 __PRINTS( "*** CAiUiIdleIntegrationImpl::ClearCallBubbleL" ); |
|
253 |
244 if( iIncallBubbleAllowed ) |
254 if( iIncallBubbleAllowed ) |
245 { |
255 { |
|
256 __PRINTS( "*** CAiUiIdleIntegrationImpl::ClearCallBubbleL - disable" ); |
|
257 |
246 iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse ); |
258 iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse ); |
|
259 iIncallBubble->SetIncallBubbleAllowedInUsualL( EFalse ); |
247 iIncallBubbleAllowed = EFalse; |
260 iIncallBubbleAllowed = EFalse; |
248 } |
261 } |
249 } |
262 } |
250 |
263 |
251 // ---------------------------------------------------------------------------- |
264 // ---------------------------------------------------------------------------- |
252 // CAiUiIdleIntegration::NewL() |
265 // CAiUiIdleIntegration::NewL() |
253 // ---------------------------------------------------------------------------- |
266 // ---------------------------------------------------------------------------- |
277 TInt err( self->iCallStatusObserver->Get( callStatus ) ); |
290 TInt err( self->iCallStatusObserver->Get( callStatus ) ); |
278 |
291 |
279 if ( err == KErrNone ) |
292 if ( err == KErrNone ) |
280 { |
293 { |
281 // Call ongoing => show bubble if not showing already |
294 // Call ongoing => show bubble if not showing already |
282 TBool allowed = EFalse; |
|
283 |
|
284 if ( !self->iIncallBubbleAllowed && |
295 if ( !self->iIncallBubbleAllowed && |
285 self->iForeground && |
296 self->iForeground && |
286 ( callStatus > EPSCTsyCallStateNone ) ) |
297 ( callStatus > EPSCTsyCallStateNone ) ) |
287 { |
298 { |
288 allowed = ETrue; |
299 TRAP_IGNORE( self->SetCallBubbleIfNeededL() ); |
289 |
|
290 TRAP( err, |
|
291 self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); |
|
292 |
|
293 if ( err == KErrNone ) |
|
294 { |
|
295 self->iIncallBubbleAllowed = allowed; |
|
296 } |
|
297 } |
300 } |
298 // No call ongoing => hide if bubble is visible |
301 // No call ongoing => hide if bubble is visible |
299 else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone ) |
302 else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone ) |
300 { |
303 { |
301 allowed = EFalse; |
304 TRAP_IGNORE( self->ClearCallBubbleL() ); |
302 |
|
303 TRAP( err, |
|
304 self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); |
|
305 |
|
306 if ( err == KErrNone ) |
|
307 { |
|
308 self->iIncallBubbleAllowed = allowed; |
|
309 } |
|
310 } |
305 } |
311 } |
306 } |
312 |
307 |
313 return err; |
308 return err; |
314 } |
309 } |