59 |
59 |
60 if( iTelephonyAudioRouting ) // If 2nd phase construction has succeeded |
60 if( iTelephonyAudioRouting ) // If 2nd phase construction has succeeded |
61 { |
61 { |
62 CTelephonyAudioRouting::TAudioOutput currentMode = |
62 CTelephonyAudioRouting::TAudioOutput currentMode = |
63 iTelephonyAudioRouting->Output(); |
63 iTelephonyAudioRouting->Output(); |
64 if( currentMode != iAudioOutputAtStartup ) |
64 MUS_LOG1( "mus: [ENGINE] iAudioOutputAtStartup: %d", iAudioOutputAtStartup ); |
|
65 MUS_LOG1( "mus: [ENGINE] currentMode: %d", currentMode ); |
|
66 // When active call is dropped, audio output is set to ENotActive, |
|
67 // but in some cases Mush engine get deleted before OutputChanged() |
|
68 // notification comes. In that case we shouldn't touch output. |
|
69 if( currentMode != iAudioOutputAtStartup && |
|
70 currentMode != CTelephonyAudioRouting::ENotActive ) |
65 { |
71 { |
66 // As going down, let audiorouting api to show notification |
72 // As going down, let audiorouting api to show notification |
67 iTelephonyAudioRouting->SetShowNote( ETrue ); |
73 iTelephonyAudioRouting->SetShowNote( ETrue ); |
68 TRAPD( err, DoSetOutputL( iAudioOutputAtStartup ) ); |
74 TRAPD( err, DoSetOutputL( iAudioOutputAtStartup ) ); |
69 MUS_LOG1( "mus: [ENGINE] final route change completed: %d", err ) |
75 MUS_LOG1( "mus: [ENGINE] final route change completed: %d", err ) |
70 err++; |
76 err++; |
71 } |
77 } |
72 } |
78 } |
73 |
79 |
74 if ( iNotifier ) |
80 if ( iNotifier ) |
75 { |
81 { |
76 iNotifier->StopListening(); |
82 iNotifier->StopListening(); |
436 |
442 |
437 // Audio routing control |
443 // Audio routing control |
438 iTelephonyAudioRouting = CTelephonyAudioRouting::NewL( *this ); |
444 iTelephonyAudioRouting = CTelephonyAudioRouting::NewL( *this ); |
439 |
445 |
440 iAudioOutputAtStartup = iTelephonyAudioRouting->Output(); |
446 iAudioOutputAtStartup = iTelephonyAudioRouting->Output(); |
441 |
447 MUS_LOG1( "mus: [ENGINE] iAudioOutputAtStartup: %d", iAudioOutputAtStartup ); |
442 // Phone |
448 // Phone |
443 MUS_LOG( "mus: [ENGINE] Use static DLL" ) |
449 MUS_LOG( "mus: [ENGINE] Use static DLL" ) |
444 iPhoneCommandHandler = CPhCltCommandHandler::NewL(); |
450 iPhoneCommandHandler = CPhCltCommandHandler::NewL(); |
445 |
451 |
446 iCurrentVolume = GetVolumeL(); |
452 iCurrentVolume = GetVolumeL(); |