1 /*
2  * Copyright (C) 2020 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 com.android.internal.telephony.d2d;
18 
19 import android.annotation.NonNull;
20 import android.telephony.ims.RtpHeaderExtension;
21 import android.telephony.ims.RtpHeaderExtensionType;
22 
23 import java.util.Set;
24 
25 /**
26  * Abstracts out details of dealing with the RTP header extensions from the {@link RtpTransport} to
27  * facilitate easier testing.
28  */
29 public interface RtpAdapter {
30     public interface Callback {
31         /**
32          * Used to indicate when RTP header extensions are received.
33          * @param extensions The extensions.
34          */
onRtpHeaderExtensionsReceived(Set<RtpHeaderExtension> extensions)35         void onRtpHeaderExtensionsReceived(Set<RtpHeaderExtension> extensions);
36     }
37 
38     /**
39      * Used to retrieve the accepted RTP header extensions by the {@link RtpTransport}.
40      * @return the accepted RTP header extensions.
41      */
getAcceptedRtpHeaderExtensions()42     Set<RtpHeaderExtensionType> getAcceptedRtpHeaderExtensions();
43 
44     /**
45      * Used by the {@link RtpTransport} to send RTP header extension messages.
46      * @param rtpHeaderExtensions the rtp header extension messages to send.
47      */
sendRtpHeaderExtensions(@onNull Set<RtpHeaderExtension> rtpHeaderExtensions)48     void sendRtpHeaderExtensions(@NonNull Set<RtpHeaderExtension> rtpHeaderExtensions);
49 }
50