115 newOutput = CTelephonyAudioRouting::ETTY; |
115 newOutput = CTelephonyAudioRouting::ETTY; |
116 } |
116 } |
117 else |
117 else |
118 { |
118 { |
119 if ( iAnyVideoCall ) |
119 if ( iAnyVideoCall ) |
120 { |
120 { |
121 if ( iAnswerToHandset ) |
121 if ( iAnswerToHandset ) |
122 { |
122 { |
123 newOutput = CTelephonyAudioRouting::EHandset; |
123 newOutput = CTelephonyAudioRouting::EHandset; |
124 } |
124 } |
125 else |
125 else |
126 { |
126 { |
127 newOutput = CTelephonyAudioRouting::ELoudspeaker; |
127 newOutput = CTelephonyAudioRouting::ELoudspeaker; |
128 } |
128 } |
129 } |
129 } |
130 else |
130 else |
131 { |
131 { |
132 newOutput = iOwner.RoutePreference(); |
132 newOutput = iOwner.RoutePreference(); |
133 } |
133 } |
134 } |
134 } |
135 SetAnswerToHandset( EFalse ); |
135 SetAnswerToHandset( EFalse ); |
136 |
136 |
163 |
163 |
164 |
164 |
165 switch ( curOutput ) |
165 switch ( curOutput ) |
166 { |
166 { |
167 case CTelephonyAudioRouting::ENotActive: |
167 case CTelephonyAudioRouting::ENotActive: |
168 // None |
168 // None |
169 break; |
169 break; |
170 case CTelephonyAudioRouting::EHandset: |
170 case CTelephonyAudioRouting::EHandset: |
171 case CTelephonyAudioRouting::ELoudspeaker: |
171 case CTelephonyAudioRouting::ELoudspeaker: |
172 // Wired audio accessory connected during call |
172 // Wired audio accessory connected during call |
173 if ( iOwner.IsWiredAvailable() ) |
173 if ( iOwner.IsWiredAvailable() ) |
174 { |
174 { |
175 newOutput = CTelephonyAudioRouting::EWiredAudioAccessory; |
175 newOutput = CTelephonyAudioRouting::EWiredAudioAccessory; |
176 } |
176 } |
177 // BT comes available during call |
177 // BT comes available during call |
178 else if ( iOwner.IsBTAvailable() ) |
178 else if ( iOwner.IsBTAvailable() ) |
179 { |
179 { |
180 newOutput = CTelephonyAudioRouting::EBTAudioAccessory; |
180 newOutput = CTelephonyAudioRouting::EBTAudioAccessory; |
181 } |
181 } |
182 else if ( iOwner.IsTTYAvailable() ) |
182 else if ( iOwner.IsTTYAvailable() ) |
183 { |
183 { |
184 newOutput = CTelephonyAudioRouting::ETTY; |
184 newOutput = CTelephonyAudioRouting::ETTY; |
185 } |
185 } |
186 else |
186 else |
187 { |
187 { |
188 // No changes |
188 // No changes |
189 } |
189 } |
190 break; |
190 break; |
191 case CTelephonyAudioRouting::EWiredAudioAccessory: |
191 case CTelephonyAudioRouting::EWiredAudioAccessory: |
192 if ( iOwner.IsBTAvailable() ) |
192 if ( iOwner.IsBTAvailable() ) |
193 { |
193 { |
194 // Not allowed direct from wired to BTA |
194 // Not allowed direct from wired to BTA |
195 // or BTA comes available during wired, No changes |
195 // or BTA comes available during wired, No changes |
196 } |
196 } |
197 if ( iOwner.IsWiredAvailable() ) |
197 if ( iOwner.IsWiredAvailable() ) |
198 { |
198 { |
199 // No changes |
199 // No changes |
200 } |
200 } |
201 else if ( iAnyVideoCall ) |
201 else if ( iAnyVideoCall ) |
202 { |
202 { |
203 newOutput = CTelephonyAudioRouting::ELoudspeaker; |
203 newOutput = CTelephonyAudioRouting::ELoudspeaker; |
204 } |
204 } |
205 else |
205 else |
206 { |
206 { |
207 // Wired detach |
207 // Wired detach |
208 newOutput = iOwner.RoutePreference(); |
208 newOutput = iOwner.RoutePreference(); |
209 } |
209 } |
210 break; |
210 break; |
211 case CTelephonyAudioRouting::EBTAudioAccessory: |
211 case CTelephonyAudioRouting::EBTAudioAccessory: |
212 if ( iOwner.IsWiredAvailable() ) |
212 if ( iOwner.IsWiredAvailable() ) |
213 { |
213 { |
214 newOutput = CTelephonyAudioRouting::EWiredAudioAccessory; |
214 newOutput = CTelephonyAudioRouting::EWiredAudioAccessory; |
215 } |
215 } |
216 else if ( iOwner.IsBTAvailable() ) |
216 else if ( iOwner.IsBTAvailable() ) |
217 { |
217 { |
218 // No changes |
218 // No changes |
219 } |
219 } |
220 else |
220 else |
221 { |
221 { |
222 newOutput = iOwner.RoutePreference(); |
222 newOutput = iOwner.RoutePreference(); |
223 } |
223 } |
224 break; |
224 break; |
225 case CTelephonyAudioRouting::ETTY: |
225 case CTelephonyAudioRouting::ETTY: |
226 if ( iOwner.IsTTYAvailable() ) |
226 if ( iOwner.IsTTYAvailable() ) |
227 { |
227 { |
228 // No changes |
228 // No changes |
229 } |
229 } |
230 else |
230 else |
231 { |
231 { |
232 newOutput = iOwner.RoutePreference(); |
232 newOutput = iOwner.RoutePreference(); |
233 } |
233 } |
234 break; |
234 break; |
235 default: |
235 default: |
236 break; |
236 break; |
237 } |
237 } |
238 |
238 |
239 if ( newOutput != curOutput ) |
239 if ( newOutput != curOutput ) |
261 TInt error = KErrNone; |
261 TInt error = KErrNone; |
262 CTelephonyAudioRouting::TAudioOutput curOutput = iOwner.Output(); |
262 CTelephonyAudioRouting::TAudioOutput curOutput = iOwner.Output(); |
263 CTelephonyAudioRouting::TAudioOutput newOutput = curOutput; |
263 CTelephonyAudioRouting::TAudioOutput newOutput = curOutput; |
264 |
264 |
265 if ( !iAnyVideoCall && |
265 if ( !iAnyVideoCall && |
266 curOutput != CTelephonyAudioRouting::EWiredAudioAccessory && |
266 curOutput != CTelephonyAudioRouting::EWiredAudioAccessory && |
267 curOutput != CTelephonyAudioRouting::EBTAudioAccessory ) |
267 curOutput != CTelephonyAudioRouting::EBTAudioAccessory ) |
268 { |
268 { |
269 newOutput = iOwner.RoutePreference(); |
269 newOutput = iOwner.RoutePreference(); |
270 } |
270 } |
271 if ( newOutput != curOutput ) |
271 if ( newOutput != curOutput ) |
272 { |
272 { |