| Thomas Stuart | 9bfb243 | 2022-09-27 15:02:07 -0700 | [diff] [blame] | 1 | /* |
| Thomas Stuart | 6e418b3 | 2023-02-06 08:22:08 -0800 | [diff] [blame] | 2 | * Copyright (C) 2023 The Android Open Source Project |
| Thomas Stuart | 9bfb243 | 2022-09-27 15:02:07 -0700 | [diff] [blame] | 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 | |
| 17 | package android.telecom; |
| 18 | |
| Thomas Stuart | 9bfb243 | 2022-09-27 15:02:07 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
| 20 | |
| Thomas Stuart | 7aeccde | 2022-12-21 14:47:21 -0800 | [diff] [blame] | 21 | import java.util.List; |
| Thomas Stuart | 9bfb243 | 2022-09-27 15:02:07 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| Thomas Stuart | 6e418b3 | 2023-02-06 08:22:08 -0800 | [diff] [blame] | 24 | * CallEventCallback relays call updates (that do not require any action) from the Telecom framework |
| 25 | * out to the application. This can include operations which the app must implement on a Call due to |
| 26 | * the presence of other calls on the device, requests relayed from a Bluetooth device, |
| 27 | * or from another calling surface. |
| Thomas Stuart | 9bfb243 | 2022-09-27 15:02:07 -0700 | [diff] [blame] | 28 | */ |
| 29 | public interface CallEventCallback { |
| 30 | /** |
| Thomas Stuart | 7aeccde | 2022-12-21 14:47:21 -0800 | [diff] [blame] | 31 | * Telecom is informing the client the current {@link CallEndpoint} changed. |
| 32 | * |
| 33 | * @param newCallEndpoint The new {@link CallEndpoint} through which call media flows |
| Thomas Stuart | 6e418b3 | 2023-02-06 08:22:08 -0800 | [diff] [blame] | 34 | * (i.e. speaker, bluetooth, etc.). |
| Thomas Stuart | 7aeccde | 2022-12-21 14:47:21 -0800 | [diff] [blame] | 35 | */ |
| 36 | void onCallEndpointChanged(@NonNull CallEndpoint newCallEndpoint); |
| 37 | |
| 38 | /** |
| 39 | * Telecom is informing the client that the available {@link CallEndpoint}s have changed. |
| 40 | * |
| 41 | * @param availableEndpoints The set of available {@link CallEndpoint}s reported by Telecom. |
| 42 | */ |
| 43 | void onAvailableCallEndpointsChanged(@NonNull List<CallEndpoint> availableEndpoints); |
| 44 | |
| 45 | /** |
| 46 | * Called when the mute state changes. |
| 47 | * |
| 48 | * @param isMuted The current mute state. |
| 49 | */ |
| 50 | void onMuteStateChanged(boolean isMuted); |
| Thomas Stuart | 6e418b3 | 2023-02-06 08:22:08 -0800 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * Telecom is informing the client user requested call streaming but the stream can't be |
| 54 | * started. |
| 55 | * |
| 56 | * @param reason Code to indicate the reason of this failure |
| 57 | */ |
| 58 | void onCallStreamingFailed(@CallStreamingService.StreamingFailedReason int reason); |
| Thomas Stuart | 9bfb243 | 2022-09-27 15:02:07 -0700 | [diff] [blame] | 59 | } |