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 package com.android.media.videoquality.bdrate;
18 
19 /**
20  * {@link RuntimeException} thrown when the BD-RATE result calculated is greater than the allowed
21  * threshold for the test.
22  *
23  * <p>This indicates that a device has failed the VEQ test.
24  */
25 public class VeqResultCheckFailureException extends RuntimeException {
26     private final double mThreshold;
27     private final double mBdResult;
28 
VeqResultCheckFailureException(String message, double threshold, double bdResult)29     public VeqResultCheckFailureException(String message, double threshold, double bdResult) {
30         super(message);
31         mThreshold = threshold;
32         this.mBdResult = bdResult;
33     }
34 
35     /** Returns the threshold value defined for the test. */
getThreshold()36     public double getThreshold() {
37         return mThreshold;
38     }
39 
40     /** Returns the calculated BD-RATE value. */
getBdResult()41     public double getBdResult() {
42         return mBdResult;
43     }
44 }
45