Loading src/java/com/android/internal/telephony/Connection.java +20 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,8 @@ public abstract class Connection { public static final int AUDIO_QUALITY_STANDARD = 1; public static final int AUDIO_QUALITY_HIGH_DEFINITION = 2; // the threshold used to compare mAudioCodecBitrateKbps and mAudioCodecBandwidth. public static final float THRESHOLD = 0.01f; /** * The telecom internal call ID associated with this connection. Only to be used for debugging Loading Loading @@ -247,6 +249,10 @@ public abstract class Connection { // Store the current audio code protected int mAudioCodec; // audio codec bitrate in kbps protected float mAudioCodecBitrateKbps; // audio codec bandwidth in kHz protected float mAudioCodecBandwidthKhz; @UnsupportedAppUsage private static String LOG_TAG = "Connection"; Loading Loading @@ -1430,6 +1436,20 @@ public abstract class Connection { return mAudioCodec; } /** * @return the audio codec bitrate in kbps. */ public float getAudioCodecBitrateKbps() { return mAudioCodecBitrateKbps; } /** * @return the audio codec bandwidth in kHz. */ public float getAudioCodecBandwidthKhz() { return mAudioCodecBandwidthKhz; } /** * @return The number verification status; only applicable for IMS calls. */ Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +19 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.telephony.ServiceState; import android.telephony.TelephonyManager; import android.telephony.ims.AudioCodecAttributes; import android.telephony.ims.ImsCallProfile; import android.telephony.ims.ImsStreamMediaProfile; import android.text.TextUtils; Loading Loading @@ -1069,6 +1070,24 @@ public class ImsPhoneConnection extends Connection implements mOwner.getPhone().getVoiceCallSessionStats().onAudioCodecChanged(this, mAudioCodec); } if (localCallProfile != null && localCallProfile.mMediaProfile.getAudioCodecAttributes() != null) { AudioCodecAttributes audioCodecAttributes = localCallProfile.mMediaProfile.getAudioCodecAttributes(); if (Math.abs(mAudioCodecBitrateKbps - audioCodecAttributes.getBitrateRangeKbps().getUpper()) > THRESHOLD) { mAudioCodecBitrateKbps = audioCodecAttributes.getBitrateRangeKbps().getUpper(); changed = true; } if (Math.abs(mAudioCodecBandwidthKhz - audioCodecAttributes.getBandwidthRangeKhz().getUpper()) > THRESHOLD) { mAudioCodecBandwidthKhz = audioCodecAttributes.getBandwidthRangeKhz().getUpper(); changed = true; } } int newAudioQuality = getAudioQualityFromCallProfile(localCallProfile, remoteCallProfile); if (getAudioQuality() != newAudioQuality) { Loading Loading
src/java/com/android/internal/telephony/Connection.java +20 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,8 @@ public abstract class Connection { public static final int AUDIO_QUALITY_STANDARD = 1; public static final int AUDIO_QUALITY_HIGH_DEFINITION = 2; // the threshold used to compare mAudioCodecBitrateKbps and mAudioCodecBandwidth. public static final float THRESHOLD = 0.01f; /** * The telecom internal call ID associated with this connection. Only to be used for debugging Loading Loading @@ -247,6 +249,10 @@ public abstract class Connection { // Store the current audio code protected int mAudioCodec; // audio codec bitrate in kbps protected float mAudioCodecBitrateKbps; // audio codec bandwidth in kHz protected float mAudioCodecBandwidthKhz; @UnsupportedAppUsage private static String LOG_TAG = "Connection"; Loading Loading @@ -1430,6 +1436,20 @@ public abstract class Connection { return mAudioCodec; } /** * @return the audio codec bitrate in kbps. */ public float getAudioCodecBitrateKbps() { return mAudioCodecBitrateKbps; } /** * @return the audio codec bandwidth in kHz. */ public float getAudioCodecBandwidthKhz() { return mAudioCodecBandwidthKhz; } /** * @return The number verification status; only applicable for IMS calls. */ Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +19 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.telephony.ServiceState; import android.telephony.TelephonyManager; import android.telephony.ims.AudioCodecAttributes; import android.telephony.ims.ImsCallProfile; import android.telephony.ims.ImsStreamMediaProfile; import android.text.TextUtils; Loading Loading @@ -1069,6 +1070,24 @@ public class ImsPhoneConnection extends Connection implements mOwner.getPhone().getVoiceCallSessionStats().onAudioCodecChanged(this, mAudioCodec); } if (localCallProfile != null && localCallProfile.mMediaProfile.getAudioCodecAttributes() != null) { AudioCodecAttributes audioCodecAttributes = localCallProfile.mMediaProfile.getAudioCodecAttributes(); if (Math.abs(mAudioCodecBitrateKbps - audioCodecAttributes.getBitrateRangeKbps().getUpper()) > THRESHOLD) { mAudioCodecBitrateKbps = audioCodecAttributes.getBitrateRangeKbps().getUpper(); changed = true; } if (Math.abs(mAudioCodecBandwidthKhz - audioCodecAttributes.getBandwidthRangeKhz().getUpper()) > THRESHOLD) { mAudioCodecBandwidthKhz = audioCodecAttributes.getBandwidthRangeKhz().getUpper(); changed = true; } } int newAudioQuality = getAudioQualityFromCallProfile(localCallProfile, remoteCallProfile); if (getAudioQuality() != newAudioQuality) { Loading