From 4e997b5bb33a5c8c82d9f838ee135b68d9b10d5a Mon Sep 17 00:00:00 2001 From: Suchand Ghosh Date: Wed, 9 Dec 2015 12:33:05 +0530 Subject: IMS: Abandon audio focus if no other call exist. Sometimes call get disconnected due RTP inactive when user dials empty URI list. Here telephony set audio mode normal when foreground call get transit to conf call. This triggers audio to initiate end all calls. Add code to check if there is any more call exist before abandon audio focus. Change-Id: I518053cb3f3ed8ab877e875e25460c14275891b8 CRs-Fixed: 935317 --- src/com/android/server/telecom/CallAudioManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/android/server/telecom/CallAudioManager.java b/src/com/android/server/telecom/CallAudioManager.java index dcfb42ce..a946d809 100644 --- a/src/com/android/server/telecom/CallAudioManager.java +++ b/src/com/android/server/telecom/CallAudioManager.java @@ -586,7 +586,10 @@ final class CallAudioManager extends CallsManagerListenerBase AudioManager.STREAM_VOICE_CALL, mMostRecentlyUsedMode); } else if (!hasRingingForegroundCall() && mCallsManager.hasOnlyDisconnectedCalls()) { Log.v(this, "updateAudioStreamAndMode : no ringing call"); - abandonAudioFocus(); + // Request to set audio mode normal. Here confirm if any call exist. + if (!hasAnyCalls()) { + abandonAudioFocus(); + } } else { // mIsRinging is false, but there is a foreground ringing call present. Don't // abandon audio focus immediately to prevent audio focus from getting lost between @@ -779,6 +782,10 @@ final class CallAudioManager extends CallsManagerListenerBase return UserHandle.USER_OWNER; } + private boolean hasAnyCalls() { + return mCallsManager.hasAnyCalls(); + } + /** * Translates an {@link AudioManager} stream type to a human-readable string description. * -- cgit v1.2.3