blob: a41c0113e933747e2345f7e5f541f51a01d00847 [file] [log] [blame]
Thomas Stuart9bfb2432022-09-27 15:02:07 -07001/*
Thomas Stuart6e418b32023-02-06 08:22:08 -08002 * Copyright (C) 2023 The Android Open Source Project
Thomas Stuart9bfb2432022-09-27 15:02:07 -07003 *
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
Thomas Stuart9bfb2432022-09-27 15:02:07 -070019import android.annotation.NonNull;
Thomas Stuart9ace3392023-02-15 15:01:09 -080020import android.os.Bundle;
Thomas Stuart9bfb2432022-09-27 15:02:07 -070021
Thomas Stuart7aeccde2022-12-21 14:47:21 -080022import java.util.List;
Thomas Stuart9bfb2432022-09-27 15:02:07 -070023
24/**
Thomas Stuart6e418b32023-02-06 08:22:08 -080025 * CallEventCallback relays call updates (that do not require any action) from the Telecom framework
26 * out to the application. This can include operations which the app must implement on a Call due to
27 * the presence of other calls on the device, requests relayed from a Bluetooth device,
28 * or from another calling surface.
Thomas Stuart9bfb2432022-09-27 15:02:07 -070029 */
30public interface CallEventCallback {
31 /**
Thomas Stuart7aeccde2022-12-21 14:47:21 -080032 * Telecom is informing the client the current {@link CallEndpoint} changed.
33 *
34 * @param newCallEndpoint The new {@link CallEndpoint} through which call media flows
Thomas Stuart6e418b32023-02-06 08:22:08 -080035 * (i.e. speaker, bluetooth, etc.).
Thomas Stuart7aeccde2022-12-21 14:47:21 -080036 */
37 void onCallEndpointChanged(@NonNull CallEndpoint newCallEndpoint);
38
39 /**
40 * Telecom is informing the client that the available {@link CallEndpoint}s have changed.
41 *
42 * @param availableEndpoints The set of available {@link CallEndpoint}s reported by Telecom.
43 */
44 void onAvailableCallEndpointsChanged(@NonNull List<CallEndpoint> availableEndpoints);
45
46 /**
47 * Called when the mute state changes.
48 *
49 * @param isMuted The current mute state.
50 */
51 void onMuteStateChanged(boolean isMuted);
Thomas Stuart6e418b32023-02-06 08:22:08 -080052
53 /**
54 * Telecom is informing the client user requested call streaming but the stream can't be
55 * started.
56 *
57 * @param reason Code to indicate the reason of this failure
58 */
59 void onCallStreamingFailed(@CallStreamingService.StreamingFailedReason int reason);
Thomas Stuart9ace3392023-02-15 15:01:09 -080060
61 /**
62 * Informs this {@link android.telecom.CallEventCallback} on events raised from a
Thomas Stuartef584292023-03-02 13:24:46 -080063 * {@link android.telecom.InCallService} presenting this call. These events and the
64 * associated extra keys for the {@code Bundle} parameter are mutually defined by a VoIP
65 * application and {@link android.telecom.InCallService}. This enables alternative calling
66 * surfaces, such as an automotive UI, to relay requests to perform other non-standard call
67 * actions to the app. For example, an automotive calling solution may offer the ability for
68 * the user to raise their hand during a meeting.
Thomas Stuart9ace3392023-02-15 15:01:09 -080069 *
Thomas Stuartef584292023-03-02 13:24:46 -080070 * @param event a string event identifier agreed upon between a VoIP application and an
71 * {@link android.telecom.InCallService}
72 * @param extras a {@link android.os.Bundle} containing information about the event, as agreed
73 * upon between a VoIP application and {@link android.telecom.InCallService}.
Thomas Stuart9ace3392023-02-15 15:01:09 -080074 */
75 void onEvent(@NonNull String event, @NonNull Bundle extras);
Thomas Stuart9bfb2432022-09-27 15:02:07 -070076}