1 /*
2  * Copyright 2024 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 
17 package androidx.core.telecom.extensions
18 
19 import android.os.Build.VERSION_CODES
20 import android.telecom.Call
21 import androidx.annotation.RequiresApi
22 import androidx.core.telecom.util.ExperimentalAppActions
23 
24 /**
25  * Provides the capability for a remote surface (automotive, watch, etc...) to connect to extensions
26  * provided by calling applications.
27  *
28  * Extensions allow a calling application to support additional optional features beyond the Android
29  * platform provided features defined in [Call]. When a new [Call] has been created, this interface
30  * allows the remote surface to also define which extensions that it supports in its UI. If the
31  * calling application providing the [Call] also supports the extension, the extension will be
32  * marked as supported. At that point, the remote surface can receive state updates and send action
33  * requests to the calling application to change state.
34  */
35 public interface CallExtensions {
36     /**
37      * Connects extensions to the provided [call], allowing the [call] to support additional
38      * optional behaviors beyond the traditional call state management provided by [Call].
39      *
40      * @param call The [Call] to connect extensions on.
41      * @param init The scope used to initialize and manage extensions in the scope of the [Call].
42      * @see CallExtensionScope
43      */
44     @RequiresApi(VERSION_CODES.O)
45     @ExperimentalAppActions
connectExtensionsnull46     public suspend fun connectExtensions(call: Call, init: CallExtensionScope.() -> Unit)
47 }
48