1 /*
2  * Copyright (C) 2023 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 #ifndef MEDIA_QUALITY_STATUS_H
18 #define MEDIA_QUALITY_STATUS_H
19 
20 #include <binder/Parcel.h>
21 #include <binder/Parcelable.h>
22 #include <binder/Status.h>
23 #include <stdint.h>
24 
25 namespace android
26 {
27 
28 namespace telephony
29 {
30 
31 namespace imsmedia
32 {
33 
34 /** Native representation of android.telephony.imsmedia.MediaQualityStatus */
35 class MediaQualityStatus : public Parcelable
36 {
37 public:
38     MediaQualityStatus();
39     MediaQualityStatus(const MediaQualityStatus& status);
40     virtual ~MediaQualityStatus();
41     MediaQualityStatus& operator=(const MediaQualityStatus& status);
42     bool operator==(const MediaQualityStatus& status) const;
43     bool operator!=(const MediaQualityStatus& status) const;
44     virtual status_t writeToParcel(Parcel* out) const;
45     virtual status_t readFromParcel(const Parcel* in);
46     void setRtpInactivityTimeMillis(int32_t time);
47     int32_t getRtpInactivityTimeMillis();
48     void setRtcpInactivityTimeMillis(int32_t time);
49     int32_t getRtcpInactivityTimeMillis();
50     void setRtpPacketLossRate(int32_t rate);
51     int32_t getRtpPacketLossRate();
52     void setRtpJitterMillis(int32_t jitter);
53     int32_t getRtpJitterMillis();
54 
55 private:
56     /**
57      * The rtp inactivity observed as per thresholds set by the MediaQualityThreshold API
58      */
59     int32_t mRtpInactivityTimeMillis;
60     /**
61      * The rtcp inactivity observed as per thresholds set by the MediaQualityThreshold API
62      */
63     int32_t mRtcpInactivityTimeMillis;
64     /**
65      * The rtp packet loss rate observed as per thresholds set by the MediaQualityThreshold API
66      */
67     int32_t mRtpPacketLossRate;
68     /**
69      * The rtp jitter observed as per thresholds set by MediaQualityThreshold API
70      */
71     int32_t mRtpJitterMillis;
72 };
73 
74 }  // namespace imsmedia
75 
76 }  // namespace telephony
77 
78 }  // namespace android
79 
80 #endif