blob: 011dc17a1c1e4a58c4ff01a1c4836b1132211b7b [file] [log] [blame]
Tyler Gunnd5821842021-02-05 11:12:57 -08001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.telecom;
18
19import android.annotation.NonNull;
20import android.annotation.Nullable;
21import android.annotation.SdkConstant;
Tyler Gunn80196212021-03-11 22:43:09 -080022import android.annotation.SuppressLint;
Tyler Gunnd5821842021-02-05 11:12:57 -080023import android.annotation.SystemApi;
24import android.app.Service;
25import android.content.Intent;
Tyler Gunn80196212021-03-11 22:43:09 -080026import android.os.Handler;
27import android.os.HandlerExecutor;
Tyler Gunnd5821842021-02-05 11:12:57 -080028import android.os.IBinder;
29import android.os.RemoteException;
Tyler Gunn0a1c6d12021-03-12 15:44:08 -080030
31import android.telephony.CallQuality;
Tyler Gunnd5821842021-02-05 11:12:57 -080032import android.util.ArrayMap;
33
34import com.android.internal.telecom.ICallDiagnosticService;
35import com.android.internal.telecom.ICallDiagnosticServiceAdapter;
36
37import java.util.Map;
Tyler Gunn80196212021-03-11 22:43:09 -080038import java.util.concurrent.Executor;
Tyler Gunnd5821842021-02-05 11:12:57 -080039
40/**
41 * The platform supports a single OEM provided {@link CallDiagnosticService}, as defined by the
42 * {@code call_diagnostic_service_package_name} key in the
43 * {@code packages/services/Telecomm/res/values/config.xml} file. An OEM can use this API to help
44 * provide more actionable information about calling issues the user encounters during and after
45 * a call.
46 *
47 * <h1>Manifest Declaration</h1>
48 * The following is an example of how to declare the service entry in the
49 * {@link CallDiagnosticService} manifest file:
50 * <pre>
51 * {@code
52 * <service android:name="your.package.YourCallDiagnosticServiceImplementation"
53 * android:permission="android.permission.BIND_CALL_DIAGNOSTIC_SERVICE">
54 * <intent-filter>
55 * <action android:name="android.telecom.CallDiagnosticService"/>
56 * </intent-filter>
57 * </service>
58 * }
59 * </pre>
Tyler Gunn80196212021-03-11 22:43:09 -080060 * <p>
61 * <h2>Threading Model</h2>
Tyler Gunn066de602021-03-16 09:58:07 -070062 * By default, all incoming IPC from Telecom in this service and in the {@link CallDiagnostics}
Tyler Gunn80196212021-03-11 22:43:09 -080063 * instances will take place on the main thread. You can override {@link #getExecutor()} in your
64 * implementation to provide your own {@link Executor}.
Tyler Gunnd5821842021-02-05 11:12:57 -080065 * @hide
66 */
67@SystemApi
68public abstract class CallDiagnosticService extends Service {
69
70 /**
71 * Binder stub implementation which handles incoming requests from Telecom.
72 */
73 private final class CallDiagnosticServiceBinder extends ICallDiagnosticService.Stub {
74
75 @Override
76 public void setAdapter(ICallDiagnosticServiceAdapter adapter) throws RemoteException {
77 handleSetAdapter(adapter);
78 }
79
80 @Override
81 public void initializeDiagnosticCall(ParcelableCall call) throws RemoteException {
82 handleCallAdded(call);
83 }
84
85 @Override
86 public void updateCall(ParcelableCall call) throws RemoteException {
87 handleCallUpdated(call);
88 }
89
90 @Override
91 public void removeDiagnosticCall(String callId) throws RemoteException {
92 handleCallRemoved(callId);
93 }
94
95 @Override
96 public void updateCallAudioState(CallAudioState callAudioState) throws RemoteException {
Tyler Gunn80196212021-03-11 22:43:09 -080097 getExecutor().execute(() -> onCallAudioStateChanged(callAudioState));
Tyler Gunnd5821842021-02-05 11:12:57 -080098 }
99
100 @Override
101 public void receiveDeviceToDeviceMessage(String callId, int message, int value) {
102 handleReceivedD2DMessage(callId, message, value);
103 }
104
105 @Override
106 public void receiveBluetoothCallQualityReport(BluetoothCallQualityReport qualityReport)
107 throws RemoteException {
108 handleBluetoothCallQualityReport(qualityReport);
109 }
Tyler Gunnbc9ecbc2021-03-09 15:06:30 -0800110
111 @Override
112 public void notifyCallDisconnected(@NonNull String callId,
113 @NonNull DisconnectCause disconnectCause) throws RemoteException {
114 handleCallDisconnected(callId, disconnectCause);
115 }
Tyler Gunn0a1c6d12021-03-12 15:44:08 -0800116
117 @Override
118 public void callQualityChanged(String callId, CallQuality callQuality)
119 throws RemoteException {
120 handleCallQualityChanged(callId, callQuality);
121 }
Tyler Gunnd5821842021-02-05 11:12:57 -0800122 }
123
124 /**
Tyler Gunn066de602021-03-16 09:58:07 -0700125 * Listens to events raised by a {@link CallDiagnostics}.
Tyler Gunnd5821842021-02-05 11:12:57 -0800126 */
Tyler Gunn066de602021-03-16 09:58:07 -0700127 private CallDiagnostics.Listener mDiagnosticCallListener =
128 new CallDiagnostics.Listener() {
Tyler Gunnd5821842021-02-05 11:12:57 -0800129
130 @Override
Tyler Gunn066de602021-03-16 09:58:07 -0700131 public void onSendDeviceToDeviceMessage(CallDiagnostics callDiagnostics,
132 @CallDiagnostics.MessageType int message, int value) {
133 handleSendDeviceToDeviceMessage(callDiagnostics, message, value);
Tyler Gunnd5821842021-02-05 11:12:57 -0800134 }
135
136 @Override
Tyler Gunn066de602021-03-16 09:58:07 -0700137 public void onDisplayDiagnosticMessage(CallDiagnostics callDiagnostics,
138 int messageId,
Tyler Gunnd5821842021-02-05 11:12:57 -0800139 CharSequence message) {
Tyler Gunn066de602021-03-16 09:58:07 -0700140 handleDisplayDiagnosticMessage(callDiagnostics, messageId, message);
Tyler Gunnd5821842021-02-05 11:12:57 -0800141 }
142
143 @Override
Tyler Gunn066de602021-03-16 09:58:07 -0700144 public void onClearDiagnosticMessage(CallDiagnostics callDiagnostics,
145 int messageId) {
146 handleClearDiagnosticMessage(callDiagnostics, messageId);
Tyler Gunnd5821842021-02-05 11:12:57 -0800147 }
148 };
149
150 /**
151 * The {@link Intent} that must be declared as handled by the service.
152 */
153 @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
154 public static final String SERVICE_INTERFACE = "android.telecom.CallDiagnosticService";
155
156 /**
157 * Map which tracks the Telecom calls received from the Telecom stack.
158 */
159 private final Map<String, Call.Details> mCallByTelecomCallId = new ArrayMap<>();
Tyler Gunn066de602021-03-16 09:58:07 -0700160 private final Map<String, CallDiagnostics> mDiagnosticCallByTelecomCallId = new ArrayMap<>();
Tyler Gunn80196212021-03-11 22:43:09 -0800161 private final Object mLock = new Object();
Tyler Gunnd5821842021-02-05 11:12:57 -0800162 private ICallDiagnosticServiceAdapter mAdapter;
163
Tyler Gunn80196212021-03-11 22:43:09 -0800164 /**
165 * Handles binding to the {@link CallDiagnosticService}.
166 *
167 * @param intent The Intent that was used to bind to this service,
168 * as given to {@link android.content.Context#bindService
169 * Context.bindService}. Note that any extras that were included with
170 * the Intent at that point will <em>not</em> be seen here.
171 * @return
172 */
Tyler Gunnd5821842021-02-05 11:12:57 -0800173 @Nullable
174 @Override
175 public IBinder onBind(@NonNull Intent intent) {
176 Log.i(this, "onBind!");
177 return new CallDiagnosticServiceBinder();
178 }
179
180 /**
Tyler Gunn80196212021-03-11 22:43:09 -0800181 * Returns the {@link Executor} to use for incoming IPS from Telecom into your service
182 * implementation.
183 * <p>
184 * Override this method in your {@link CallDiagnosticService} implementation to provide the
185 * executor you want to use for incoming IPC.
186 *
187 * @return the {@link Executor} to use for incoming IPC from Telecom to
Tyler Gunn066de602021-03-16 09:58:07 -0700188 * {@link CallDiagnosticService} and {@link CallDiagnostics}.
Tyler Gunn80196212021-03-11 22:43:09 -0800189 */
190 @SuppressLint("OnNameExpected")
191 @NonNull public Executor getExecutor() {
192 return new HandlerExecutor(Handler.createAsync(getMainLooper()));
193 }
194
195 /**
Tyler Gunnd5821842021-02-05 11:12:57 -0800196 * Telecom calls this method on the {@link CallDiagnosticService} with details about a new call
197 * which was added to Telecom.
198 * <p>
Tyler Gunn066de602021-03-16 09:58:07 -0700199 * The {@link CallDiagnosticService} returns an implementation of {@link CallDiagnostics} to be
Tyler Gunnd5821842021-02-05 11:12:57 -0800200 * used for the lifespan of this call.
Tyler Gunn80196212021-03-11 22:43:09 -0800201 * <p>
202 * Calls to this method will use the {@link CallDiagnosticService}'s {@link Executor}; see
203 * {@link CallDiagnosticService#getExecutor()} for more information.
Tyler Gunnd5821842021-02-05 11:12:57 -0800204 *
205 * @param call The details of the new call.
Tyler Gunn066de602021-03-16 09:58:07 -0700206 * @return An instance of {@link CallDiagnostics} which the {@link CallDiagnosticService}
Tyler Gunnd5821842021-02-05 11:12:57 -0800207 * provides to be used for the lifespan of the call.
Tyler Gunn066de602021-03-16 09:58:07 -0700208 * @throws IllegalArgumentException if a {@code null} {@link CallDiagnostics} is returned.
Tyler Gunnd5821842021-02-05 11:12:57 -0800209 */
Tyler Gunn066de602021-03-16 09:58:07 -0700210 public abstract @NonNull CallDiagnostics onInitializeCallDiagnostics(@NonNull
Tyler Gunnd5821842021-02-05 11:12:57 -0800211 android.telecom.Call.Details call);
212
213 /**
Tyler Gunn066de602021-03-16 09:58:07 -0700214 * Telecom calls this method when a previous created {@link CallDiagnostics} is no longer
215 * needed. This happens when Telecom is no longer tracking the call in question.
Tyler Gunn80196212021-03-11 22:43:09 -0800216 * <p>
217 * Calls to this method will use the {@link CallDiagnosticService}'s {@link Executor}; see
218 * {@link CallDiagnosticService#getExecutor()} for more information.
219 *
Tyler Gunnd5821842021-02-05 11:12:57 -0800220 * @param call The diagnostic call which is no longer tracked by Telecom.
221 */
Tyler Gunn066de602021-03-16 09:58:07 -0700222 public abstract void onRemoveCallDiagnostics(@NonNull CallDiagnostics call);
Tyler Gunnd5821842021-02-05 11:12:57 -0800223
224 /**
225 * Telecom calls this method when the audio routing or available audio route information
226 * changes.
227 * <p>
228 * Audio state is common to all calls.
Tyler Gunn80196212021-03-11 22:43:09 -0800229 * <p>
230 * Calls to this method will use the {@link CallDiagnosticService}'s {@link Executor}; see
231 * {@link CallDiagnosticService#getExecutor()} for more information.
Tyler Gunnd5821842021-02-05 11:12:57 -0800232 *
233 * @param audioState The new audio state.
234 */
235 public abstract void onCallAudioStateChanged(
236 @NonNull CallAudioState audioState);
237
238 /**
239 * Telecom calls this method when a {@link BluetoothCallQualityReport} is received from the
240 * bluetooth stack.
Tyler Gunn80196212021-03-11 22:43:09 -0800241 * <p>
242 * Calls to this method will use the {@link CallDiagnosticService}'s {@link Executor}; see
243 * {@link CallDiagnosticService#getExecutor()} for more information.
244 *
Tyler Gunnd5821842021-02-05 11:12:57 -0800245 * @param qualityReport the {@link BluetoothCallQualityReport}.
246 */
247 public abstract void onBluetoothCallQualityReportReceived(
248 @NonNull BluetoothCallQualityReport qualityReport);
249
250 /**
251 * Handles a request from Telecom to set the adapater used to communicate back to Telecom.
252 * @param adapter
253 */
254 private void handleSetAdapter(@NonNull ICallDiagnosticServiceAdapter adapter) {
255 mAdapter = adapter;
256 }
257
258 /**
259 * Handles a request from Telecom to add a new call.
260 * @param parcelableCall
261 */
262 private void handleCallAdded(@NonNull ParcelableCall parcelableCall) {
263 String telecomCallId = parcelableCall.getId();
264 Log.i(this, "handleCallAdded: callId=%s - added", telecomCallId);
265 Call.Details newCallDetails = Call.Details.createFromParcelableCall(parcelableCall);
Tyler Gunn80196212021-03-11 22:43:09 -0800266 synchronized (mLock) {
267 mCallByTelecomCallId.put(telecomCallId, newCallDetails);
Tyler Gunnd5821842021-02-05 11:12:57 -0800268 }
Tyler Gunn80196212021-03-11 22:43:09 -0800269
270 getExecutor().execute(() -> {
Tyler Gunn066de602021-03-16 09:58:07 -0700271 CallDiagnostics callDiagnostics = onInitializeCallDiagnostics(newCallDetails);
272 if (callDiagnostics == null) {
Tyler Gunn80196212021-03-11 22:43:09 -0800273 throw new IllegalArgumentException(
274 "A valid DiagnosticCall instance was not provided.");
275 }
276 synchronized (mLock) {
Tyler Gunn066de602021-03-16 09:58:07 -0700277 callDiagnostics.setListener(mDiagnosticCallListener);
278 callDiagnostics.setCallId(telecomCallId);
279 mDiagnosticCallByTelecomCallId.put(telecomCallId, callDiagnostics);
Tyler Gunn80196212021-03-11 22:43:09 -0800280 }
281 });
Tyler Gunnd5821842021-02-05 11:12:57 -0800282 }
283
284 /**
285 * Handles an update to {@link Call.Details} notified by Telecom.
Tyler Gunn066de602021-03-16 09:58:07 -0700286 * Caches the call details and notifies the {@link CallDiagnostics} of the change via
287 * {@link CallDiagnostics#onCallDetailsChanged(Call.Details)}.
Tyler Gunnd5821842021-02-05 11:12:57 -0800288 * @param parcelableCall the new parceled call details from Telecom.
289 */
290 private void handleCallUpdated(@NonNull ParcelableCall parcelableCall) {
291 String telecomCallId = parcelableCall.getId();
292 Log.i(this, "handleCallUpdated: callId=%s - updated", telecomCallId);
293 Call.Details newCallDetails = Call.Details.createFromParcelableCall(parcelableCall);
Tyler Gunn066de602021-03-16 09:58:07 -0700294 CallDiagnostics callDiagnostics;
Tyler Gunn80196212021-03-11 22:43:09 -0800295 synchronized (mLock) {
Tyler Gunn066de602021-03-16 09:58:07 -0700296 callDiagnostics = mDiagnosticCallByTelecomCallId.get(telecomCallId);
Tyler Gunn80196212021-03-11 22:43:09 -0800297 mCallByTelecomCallId.put(telecomCallId, newCallDetails);
298 }
Tyler Gunn066de602021-03-16 09:58:07 -0700299 getExecutor().execute(() -> callDiagnostics.handleCallUpdated(newCallDetails));
Tyler Gunnd5821842021-02-05 11:12:57 -0800300 }
301
302 /**
303 * Handles a request from Telecom to remove an existing call.
304 * @param telecomCallId
305 */
306 private void handleCallRemoved(@NonNull String telecomCallId) {
307 Log.i(this, "handleCallRemoved: callId=%s - removed", telecomCallId);
308
309 if (mCallByTelecomCallId.containsKey(telecomCallId)) {
310 mCallByTelecomCallId.remove(telecomCallId);
311 }
Tyler Gunn80196212021-03-11 22:43:09 -0800312
Tyler Gunn066de602021-03-16 09:58:07 -0700313 CallDiagnostics callDiagnostics;
Tyler Gunn80196212021-03-11 22:43:09 -0800314 synchronized (mLock) {
315 if (mDiagnosticCallByTelecomCallId.containsKey(telecomCallId)) {
Tyler Gunn066de602021-03-16 09:58:07 -0700316 callDiagnostics = mDiagnosticCallByTelecomCallId.remove(telecomCallId);
Tyler Gunn80196212021-03-11 22:43:09 -0800317 } else {
Tyler Gunn066de602021-03-16 09:58:07 -0700318 callDiagnostics = null;
Tyler Gunn80196212021-03-11 22:43:09 -0800319 }
320 }
321
322 // Inform the service of the removed call.
Tyler Gunn066de602021-03-16 09:58:07 -0700323 if (callDiagnostics != null) {
324 getExecutor().execute(() -> onRemoveCallDiagnostics(callDiagnostics));
Tyler Gunnd5821842021-02-05 11:12:57 -0800325 }
326 }
327
328 /**
329 * Handles an incoming device to device message received from Telecom. Notifies the
Tyler Gunn066de602021-03-16 09:58:07 -0700330 * {@link CallDiagnostics} via {@link CallDiagnostics#onReceiveDeviceToDeviceMessage(int, int)}.
Tyler Gunnd5821842021-02-05 11:12:57 -0800331 * @param callId
332 * @param message
333 * @param value
334 */
335 private void handleReceivedD2DMessage(@NonNull String callId, int message, int value) {
336 Log.i(this, "handleReceivedD2DMessage: callId=%s, msg=%d/%d", callId, message, value);
Tyler Gunn066de602021-03-16 09:58:07 -0700337 CallDiagnostics callDiagnostics;
Tyler Gunn80196212021-03-11 22:43:09 -0800338 synchronized (mLock) {
Tyler Gunn066de602021-03-16 09:58:07 -0700339 callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId);
Tyler Gunn80196212021-03-11 22:43:09 -0800340 }
Tyler Gunn066de602021-03-16 09:58:07 -0700341 if (callDiagnostics != null) {
Tyler Gunn80196212021-03-11 22:43:09 -0800342 getExecutor().execute(
Tyler Gunn066de602021-03-16 09:58:07 -0700343 () -> callDiagnostics.onReceiveDeviceToDeviceMessage(message, value));
Tyler Gunn80196212021-03-11 22:43:09 -0800344 }
Tyler Gunnd5821842021-02-05 11:12:57 -0800345 }
346
347 /**
Tyler Gunnbc9ecbc2021-03-09 15:06:30 -0800348 * Handles a request from the Telecom framework to get a disconnect message from the
349 * {@link CallDiagnosticService}.
350 * @param callId The ID of the call.
351 * @param disconnectCause The telecom disconnect cause.
352 */
353 private void handleCallDisconnected(@NonNull String callId,
354 @NonNull DisconnectCause disconnectCause) {
355 Log.i(this, "handleCallDisconnected: call=%s; cause=%s", callId, disconnectCause);
Tyler Gunn066de602021-03-16 09:58:07 -0700356 CallDiagnostics callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId);
Tyler Gunnbc9ecbc2021-03-09 15:06:30 -0800357 CharSequence message;
358 if (disconnectCause.getImsReasonInfo() != null) {
Tyler Gunn066de602021-03-16 09:58:07 -0700359 message = callDiagnostics.onCallDisconnected(disconnectCause.getImsReasonInfo());
Tyler Gunnbc9ecbc2021-03-09 15:06:30 -0800360 } else {
Tyler Gunn066de602021-03-16 09:58:07 -0700361 message = callDiagnostics.onCallDisconnected(
Tyler Gunnbc9ecbc2021-03-09 15:06:30 -0800362 disconnectCause.getTelephonyDisconnectCause(),
363 disconnectCause.getTelephonyPreciseDisconnectCause());
364 }
365 try {
366 mAdapter.overrideDisconnectMessage(callId, message);
367 } catch (RemoteException e) {
368 Log.w(this, "handleCallDisconnected: call=%s; cause=%s; %s",
369 callId, disconnectCause, e);
370 }
371 }
372
373 /**
Tyler Gunnd5821842021-02-05 11:12:57 -0800374 * Handles an incoming bluetooth call quality report from Telecom. Notifies via
375 * {@link CallDiagnosticService#onBluetoothCallQualityReportReceived(
376 * BluetoothCallQualityReport)}.
377 * @param qualityReport The bluetooth call quality remote.
378 */
379 private void handleBluetoothCallQualityReport(@NonNull BluetoothCallQualityReport
380 qualityReport) {
381 Log.i(this, "handleBluetoothCallQualityReport; report=%s", qualityReport);
Tyler Gunn80196212021-03-11 22:43:09 -0800382 getExecutor().execute(() -> onBluetoothCallQualityReportReceived(qualityReport));
Tyler Gunnd5821842021-02-05 11:12:57 -0800383 }
384
385 /**
Tyler Gunn0a1c6d12021-03-12 15:44:08 -0800386 * Handles a change reported by Telecom to the call quality for a call.
387 * @param callId the call ID the change applies to.
388 * @param callQuality The new call quality.
389 */
390 private void handleCallQualityChanged(@NonNull String callId,
391 @NonNull CallQuality callQuality) {
392 Log.i(this, "handleCallQualityChanged; call=%s, cq=%s", callId, callQuality);
393 CallDiagnostics callDiagnostics;
394 callDiagnostics = mDiagnosticCallByTelecomCallId.get(callId);
395 if (callDiagnostics != null) {
396 callDiagnostics.onCallQualityReceived(callQuality);
397 }
398 }
399
400 /**
Tyler Gunn066de602021-03-16 09:58:07 -0700401 * Handles a request from a {@link CallDiagnostics} to send a device to device message (received
402 * via {@link CallDiagnostics#sendDeviceToDeviceMessage(int, int)}.
403 * @param callDiagnostics
Tyler Gunnd5821842021-02-05 11:12:57 -0800404 * @param message
405 * @param value
406 */
Tyler Gunn066de602021-03-16 09:58:07 -0700407 private void handleSendDeviceToDeviceMessage(@NonNull CallDiagnostics callDiagnostics,
Tyler Gunnd5821842021-02-05 11:12:57 -0800408 int message, int value) {
Tyler Gunn066de602021-03-16 09:58:07 -0700409 String callId = callDiagnostics.getCallId();
Tyler Gunnd5821842021-02-05 11:12:57 -0800410 try {
411 mAdapter.sendDeviceToDeviceMessage(callId, message, value);
412 Log.i(this, "handleSendDeviceToDeviceMessage: call=%s; msg=%d/%d", callId, message,
413 value);
414 } catch (RemoteException e) {
415 Log.w(this, "handleSendDeviceToDeviceMessage: call=%s; msg=%d/%d failed %s",
416 callId, message, value, e);
417 }
418 }
419
420 /**
Tyler Gunn066de602021-03-16 09:58:07 -0700421 * Handles a request from a {@link CallDiagnostics} to display an in-call diagnostic message.
422 * Originates from {@link CallDiagnostics#displayDiagnosticMessage(int, CharSequence)}.
423 * @param callDiagnostics
Tyler Gunnd5821842021-02-05 11:12:57 -0800424 * @param messageId
425 * @param message
426 */
Tyler Gunn066de602021-03-16 09:58:07 -0700427 private void handleDisplayDiagnosticMessage(CallDiagnostics callDiagnostics, int messageId,
Tyler Gunnd5821842021-02-05 11:12:57 -0800428 CharSequence message) {
Tyler Gunn066de602021-03-16 09:58:07 -0700429 String callId = callDiagnostics.getCallId();
Tyler Gunnd5821842021-02-05 11:12:57 -0800430 try {
431 mAdapter.displayDiagnosticMessage(callId, messageId, message);
432 Log.i(this, "handleDisplayDiagnosticMessage: call=%s; msg=%d/%s", callId, messageId,
433 message);
434 } catch (RemoteException e) {
435 Log.w(this, "handleDisplayDiagnosticMessage: call=%s; msg=%d/%s failed %s",
436 callId, messageId, message, e);
437 }
438 }
439
440 /**
Tyler Gunn066de602021-03-16 09:58:07 -0700441 * Handles a request from a {@link CallDiagnostics} to clear a previously shown diagnostic
Tyler Gunnd5821842021-02-05 11:12:57 -0800442 * message.
Tyler Gunn066de602021-03-16 09:58:07 -0700443 * Originates from {@link CallDiagnostics#clearDiagnosticMessage(int)}.
444 * @param callDiagnostics
Tyler Gunnd5821842021-02-05 11:12:57 -0800445 * @param messageId
446 */
Tyler Gunn066de602021-03-16 09:58:07 -0700447 private void handleClearDiagnosticMessage(CallDiagnostics callDiagnostics, int messageId) {
448 String callId = callDiagnostics.getCallId();
Tyler Gunnd5821842021-02-05 11:12:57 -0800449 try {
450 mAdapter.clearDiagnosticMessage(callId, messageId);
451 Log.i(this, "handleClearDiagnosticMessage: call=%s; msg=%d", callId, messageId);
452 } catch (RemoteException e) {
453 Log.w(this, "handleClearDiagnosticMessage: call=%s; msg=%d failed %s",
454 callId, messageId, e);
455 }
456 }
457}