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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -374,6 +382,21 @@ public abstract class CallDiagnosticService extends Service {
|
||||
getExecutor().execute(() -> onBluetoothCallQualityReportReceived(qualityReport));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)}.
|
||||
|
||||
Reference in New Issue
Block a user