idlefw/src/idleint/aiuiidleintegration.cpp
branchRCL_3
changeset 101 9e077f9a342c
parent 82 ace62b58f4b2
equal deleted inserted replaced
82:ace62b58f4b2 101:9e077f9a342c
   219 // CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL()
   219 // CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL()
   220 // ----------------------------------------------------------------------------
   220 // ----------------------------------------------------------------------------
   221 //
   221 //
   222 void CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL()
   222 void CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL()
   223 	{
   223 	{
   224     __PRINTS( "*** CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL" );
       
   225     
       
   226     if( !iIncallBubbleAllowed )
   224     if( !iIncallBubbleAllowed )
   227     	{
   225     	{
   228         TInt callStatus( 0 );
   226         TInt callStatus( 0 );
   229             	
   227             	
   230         TInt err( RProperty::Get( KPSUidCtsyCallInformation,
   228         TInt err( RProperty::Get( KPSUidCtsyCallInformation,
   232                                   callStatus ) );
   230                                   callStatus ) );
   233         
   231         
   234         // Call ongoing => show bubble
   232         // Call ongoing => show bubble
   235 	  	if( err == KErrNone && callStatus > EPSCTsyCallStateNone )
   233 	  	if( err == KErrNone && callStatus > EPSCTsyCallStateNone )
   236 	      	{
   234 	      	{
   237 			__PRINTS( "*** CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL - enable" );
   235 	       	iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue );                	
   238 
   236 	       	iIncallBubbleAllowed = ETrue;
   239             iIncallBubble->SetIncallBubbleAllowedInUsualL( ETrue );
       
   240             iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue );
       
   241             iIncallBubbleAllowed = ETrue;
       
   242 	       	}    
   237 	       	}    
   243     	}
   238     	}
   244 	}
   239 	}
   245 
   240 
   246 // ----------------------------------------------------------------------------
   241 // ----------------------------------------------------------------------------
   247 // CAiUiIdleIntegrationImpl::ClearCallBubbleL()
   242 // CAiUiIdleIntegrationImpl::ClearCallBubbleL()
   248 // ----------------------------------------------------------------------------
   243 // ----------------------------------------------------------------------------
   249 //
   244 //
   250 void CAiUiIdleIntegrationImpl::ClearCallBubbleL()
   245 void CAiUiIdleIntegrationImpl::ClearCallBubbleL()
   251 	{
   246 	{
   252     __PRINTS( "*** CAiUiIdleIntegrationImpl::ClearCallBubbleL" );
       
   253 
       
   254 	 if( iIncallBubbleAllowed )
   247 	 if( iIncallBubbleAllowed )
   255     	{
   248     	{
   256          __PRINTS( "*** CAiUiIdleIntegrationImpl::ClearCallBubbleL - disable" );
       
   257 
       
   258     	iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse );
   249     	iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse );
   259     	iIncallBubble->SetIncallBubbleAllowedInUsualL( EFalse );
       
   260     	iIncallBubbleAllowed = EFalse;
   250     	iIncallBubbleAllowed = EFalse;
   261     	}
   251     	}        
   262 	}
   252 	}
   263     
   253     
   264 // ----------------------------------------------------------------------------
   254 // ----------------------------------------------------------------------------
   265 // CAiUiIdleIntegration::NewL()
   255 // CAiUiIdleIntegration::NewL()
   266 // ----------------------------------------------------------------------------
   256 // ----------------------------------------------------------------------------
   290 	TInt err( self->iCallStatusObserver->Get( callStatus ) );
   280 	TInt err( self->iCallStatusObserver->Get( callStatus ) );
   291 	
   281 	
   292 	if ( err == KErrNone )
   282 	if ( err == KErrNone )
   293 		{
   283 		{
   294 		// Call ongoing => show bubble if not showing already
   284 		// Call ongoing => show bubble if not showing already
       
   285 		TBool allowed = EFalse;
       
   286 		
   295 		if ( !self->iIncallBubbleAllowed &&
   287 		if ( !self->iIncallBubbleAllowed &&
   296 		     self->iForeground &&
   288 		     self->iForeground &&
   297 		    ( callStatus > EPSCTsyCallStateNone ) )
   289 		    ( callStatus > EPSCTsyCallStateNone ) )
   298 			{
   290 			{
   299             TRAP_IGNORE( self->SetCallBubbleIfNeededL() );
   291 			allowed = ETrue;
       
   292     		
       
   293 			TRAP( err, 
       
   294                 self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) );
       
   295 			            		
       
   296 			if ( err == KErrNone )
       
   297     		    {
       
   298     			self->iIncallBubbleAllowed = allowed;
       
   299     		    }
   300 			}
   300 			}
   301 		// No call ongoing => hide if bubble is visible			
   301 		// No call ongoing => hide if bubble is visible			
   302 		else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone )
   302 		else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone )
   303 			{
   303 			{
   304     		TRAP_IGNORE( self->ClearCallBubbleL() );
   304 			allowed = EFalse;
       
   305 			
       
   306     		TRAP( err, 
       
   307                 self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) );
       
   308     		
       
   309     		if ( err == KErrNone )
       
   310     		    {
       
   311     			self->iIncallBubbleAllowed = allowed;
       
   312     		    }
   305 			}
   313 			}
   306 		}
   314 		}
   307 	
   315 	
   308 	return err;
   316 	return err;
   309 	}
   317 	}