diff options
author | 2021-03-12 15:44:08 -0800 | |
---|---|---|
committer | 2021-03-19 16:39:11 +0000 | |
commit | 0a1c6d1bb44d830d4bc82d371c5f102d22916a58 (patch) | |
tree | 8472181eeec63ea885e3e5c5a98810672021a408 | |
parent | 45abbc309d74767efdced006742fcbae2eefaf60 (diff) |
Propagate call quality reports from Telephony to CallDiagnosticService.
Complete plumbing for call quality reports to get to the CDS.
Test: Manual network testing.
Test: Modify CTS tests to cover these cases.
Bug: 163085177
Change-Id: I2bb68d29c4ad11cc8738c26cd69404fde4348843
3 files changed, 43 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/CallDiagnosticService.java b/telecomm/java/android/telecom/CallDiagnosticService.java index f5357b19c4de..011dc17a1c1e 100644 --- a/telecomm/java/android/telecom/CallDiagnosticService.java +++ b/telecomm/java/android/telecom/CallDiagnosticService.java @@ -27,6 +27,8 @@ import android.os.Handler; import android.os.HandlerExecutor; import android.os.IBinder; import android.os.RemoteException; + +import android.telephony.CallQuality; import android.util.ArrayMap; import com.android.internal.telecom.ICallDiagnosticService; @@ -111,6 +113,12 @@ public abstract class CallDiagnosticService extends Service { @NonNull DisconnectCause disconnectCause) throws RemoteException { handleCallDisconnected(callId, disconnectCause); } + + @Override + public void callQualityChanged(String callId, CallQuality callQuality) + throws RemoteException { + handleCallQualityChanged(callId, callQuality); + } } /** @@ -375,6 +383,21 @@ public abstract class CallDiagnosticService extends Service { } /** + * Handles a change reported by Telecom to the call quality for a call. + * @param callId the call ID the change applies to. + * @param callQuality The new call quality. + */ + private void handleCallQualityChanged(@NonNull String callId, + @NonNull CallQuality callQuality) { + Log.i(this, "handleCallQualityChanged; call=%s, cq=%s", callId, callQuality); + CallDiagnostics callDiagnostics; + callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId); + if (callDiagnostics != null) { + callDiagnostics.onCallQualityReceived(callQuality); + } + } + + /** * Handles a request from a {@link CallDiagnostics} to send a device to device message (received * via {@link CallDiagnostics#sendDeviceToDeviceMessage(int, int)}. * @param callDiagnostics diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 6dab6df22cf9..2dc18e856349 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -44,6 +44,7 @@ import android.os.ParcelFileDescriptor; import android.os.Parcelable; import android.os.RemoteException; import android.os.SystemClock; +import android.telephony.CallQuality; import android.telephony.ims.ImsStreamMediaProfile; import android.util.ArraySet; import android.view.Surface; @@ -978,6 +979,23 @@ public abstract class Connection extends Conferenceable { public static final String EXTRA_DEVICE_TO_DEVICE_MESSAGE_VALUE = "android.telecom.extra.DEVICE_TO_DEVICE_MESSAGE_VALUE"; + /** + * Connection event used to communicate a {@link android.telephony.CallQuality} report from + * telephony to Telecom for relaying to + * {@link DiagnosticCall#onCallQualityReceived(CallQuality)}. + * @hide + */ + public static final String EVENT_CALL_QUALITY_REPORT = + "android.telecom.event.CALL_QUALITY_REPORT"; + + /** + * Extra sent with {@link #EVENT_CALL_QUALITY_REPORT} containing the + * {@link android.telephony.CallQuality} data. + * @hide + */ + public static final String EXTRA_CALL_QUALITY_REPORT = + "android.telecom.extra.CALL_QUALITY_REPORT"; + // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); diff --git a/telecomm/java/com/android/internal/telecom/ICallDiagnosticService.aidl b/telecomm/java/com/android/internal/telecom/ICallDiagnosticService.aidl index fc9879aaf0a8..4bd369f2c556 100644 --- a/telecomm/java/com/android/internal/telecom/ICallDiagnosticService.aidl +++ b/telecomm/java/com/android/internal/telecom/ICallDiagnosticService.aidl @@ -20,6 +20,7 @@ import android.telecom.BluetoothCallQualityReport; import android.telecom.CallAudioState; import android.telecom.DisconnectCause; import android.telecom.ParcelableCall; +import android.telephony.CallQuality; import com.android.internal.telecom.ICallDiagnosticServiceAdapter; /** @@ -34,6 +35,7 @@ oneway interface ICallDiagnosticService { void updateCallAudioState(in CallAudioState callAudioState); void removeDiagnosticCall(in String callId); void receiveDeviceToDeviceMessage(in String callId, int message, int value); + void callQualityChanged(in String callId, in CallQuality callQuality); void receiveBluetoothCallQualityReport(in BluetoothCallQualityReport qualityReport); void notifyCallDisconnected(in String callId, in DisconnectCause disconnectCause); } |