1 /*
2  * Copyright (C) 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 Licnse.
15  */
16 
17 package android.mediapc.cts.common;
18 
19 import android.hardware.camera2.CameraMetadata;
20 import android.os.Build;
21 
22 public class CameraRequirement {
23     public static class Camera240FpsRequirement extends Requirement {
24         private static final String TAG = Camera240FpsRequirement.class.getSimpleName();
25 
Camera240FpsRequirement(String id, RequiredMeasurement<?>... reqs)26         private Camera240FpsRequirement(String id, RequiredMeasurement<?>... reqs) {
27             super(id, reqs);
28         }
29 
setRear240FpsSupported(boolean rear240FpsSupported)30         public void setRear240FpsSupported(boolean rear240FpsSupported) {
31             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_240FPS_SUPPORTED,
32                     rear240FpsSupported);
33         }
34 
35         /**
36          * [2.2.7.2/7.5/H-1-9] MUST have a rear-facing primary camera supporting 720p
37          * or 1080p @ 240fps.
38          */
create240FpsReq()39         public static Camera240FpsRequirement create240FpsReq() {
40             RequiredMeasurement<Boolean> requirement = RequiredMeasurement
41                     .<Boolean>builder()
42                     .setId(RequirementConstants.REAR_CAMERA_240FPS_SUPPORTED)
43                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
44                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
45                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
46                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
47                     .build();
48 
49             return new Camera240FpsRequirement(RequirementConstants.R7_5__H_1_9, requirement);
50         }
51     }
52 
53     public static class CameraExtensionRequirement extends Requirement {
54         private static final String TAG =
55                 CameraExtensionRequirement.class.getSimpleName();
56 
57         public static int PRIMARY_REAR_CAMERA = 0;
58         public static int PRIMARY_FRONT_CAMERA = 1;
59 
CameraExtensionRequirement(String id, RequiredMeasurement<?>... reqs)60         private CameraExtensionRequirement(String id, RequiredMeasurement<?>... reqs) {
61             super(id, reqs);
62         }
63 
setCamera2NightExtensionSupported(int camera, boolean supported)64         public void setCamera2NightExtensionSupported(int camera, boolean supported) {
65             if (camera == PRIMARY_REAR_CAMERA) {
66                 this.setMeasuredValue(RequirementConstants.REAR_CAMERA2_EXTENSION_NIGHT_SUPPORTED,
67                         supported);
68             } else if (camera == PRIMARY_FRONT_CAMERA) {
69                 this.setMeasuredValue(RequirementConstants.FRONT_CAMERA2_EXTENSION_NIGHT_SUPPORTED,
70                         supported);
71             }
72         }
73 
setCameraXNightExtensionSupported(int camera, boolean supported)74         public void setCameraXNightExtensionSupported(int camera, boolean supported) {
75             if (camera == PRIMARY_REAR_CAMERA) {
76                 this.setMeasuredValue(RequirementConstants.REAR_CAMERAX_EXTENSION_NIGHT_SUPPORTED,
77                         supported);
78             } else if (camera == PRIMARY_FRONT_CAMERA) {
79                 this.setMeasuredValue(RequirementConstants.FRONT_CAMERAX_EXTENSION_NIGHT_SUPPORTED,
80                         supported);
81             }
82         }
83 
84         /**
85          * [2.2.7.2/7.5/H-1-15] MUST support Night mode extensions via both CameraX and
86          * Camera2 extensions for primary cameras.
87          */
createCameraExtensionReq()88         public static CameraExtensionRequirement createCameraExtensionReq() {
89             RequiredMeasurement<Boolean> rearCamera2NightRequirement = RequiredMeasurement
90                     .<Boolean>builder()
91                     .setId(RequirementConstants.REAR_CAMERA2_EXTENSION_NIGHT_SUPPORTED)
92                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
93                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
94                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
95                     .build();
96             RequiredMeasurement<Boolean> frontCamera2NightRequirement = RequiredMeasurement
97                     .<Boolean>builder()
98                     .setId(RequirementConstants.FRONT_CAMERA2_EXTENSION_NIGHT_SUPPORTED)
99                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
100                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
101                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
102                     .build();
103 
104             RequiredMeasurement<Boolean> rearCameraXNightRequirement = RequiredMeasurement
105                     .<Boolean>builder()
106                     .setId(RequirementConstants.REAR_CAMERAX_EXTENSION_NIGHT_SUPPORTED)
107                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
108                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
109                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
110                     .build();
111             RequiredMeasurement<Boolean> frontCameraXNightRequirement = RequiredMeasurement
112                     .<Boolean>builder()
113                     .setId(RequirementConstants.FRONT_CAMERAX_EXTENSION_NIGHT_SUPPORTED)
114                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
115                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
116                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
117                     .build();
118 
119             return new CameraExtensionRequirement(RequirementConstants.R7_5__H_1_15,
120                     rearCamera2NightRequirement, frontCamera2NightRequirement,
121                     rearCameraXNightRequirement, frontCameraXNightRequirement);
122         }
123     }
124 
125     public static class CameraUltraHdrRequirement extends Requirement {
126         private static final String TAG = CameraUltraHdrRequirement.class.getSimpleName();
127 
CameraUltraHdrRequirement(String id, RequiredMeasurement<?>... reqs)128         private CameraUltraHdrRequirement(String id, RequiredMeasurement<?>... reqs) {
129             super(id, reqs);
130         }
131 
setFrontCameraUltraHdrSupported(boolean ultraHdrSupported)132         public void setFrontCameraUltraHdrSupported(boolean ultraHdrSupported) {
133             this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_ULTRA_HDR_SUPPORTED,
134                     ultraHdrSupported);
135         }
136 
setRearCameraUltraHdrSupported(boolean ultraHdrSupported)137         public void setRearCameraUltraHdrSupported(boolean ultraHdrSupported) {
138             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_ULTRA_HDR_SUPPORTED,
139                     ultraHdrSupported);
140         }
141 
142         /**
143          * [2.2.7.2/7.5/H-1-20] MUST by default output JPEG_R for the primary rear
144          * and primary front cameras in the default camera app.
145          **/
createUltraHdrReq()146         public static CameraUltraHdrRequirement createUltraHdrReq() {
147 
148             RequiredMeasurement<Boolean> rearUltraHdrRequirement = RequiredMeasurement
149                     .<Boolean>builder()
150                     .setId(RequirementConstants.REAR_CAMERA_ULTRA_HDR_SUPPORTED)
151                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
152                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
153                     .build();
154 
155             RequiredMeasurement<Boolean> frontUltraHdrRequirement = RequiredMeasurement
156                     .<Boolean>builder()
157                     .setId(RequirementConstants.FRONT_CAMERA_ULTRA_HDR_SUPPORTED)
158                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
159                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
160                     .build();
161 
162             return new CameraUltraHdrRequirement(RequirementConstants.R7_5__H_1_20,
163                     rearUltraHdrRequirement, frontUltraHdrRequirement);
164         }
165     }
166 
167     public static class CameraLatencyRequirement extends Requirement {
168         private static final String TAG = CameraTimestampSourceRequirement.class.getSimpleName();
169 
CameraLatencyRequirement(String id, RequiredMeasurement<?>... reqs)170         private CameraLatencyRequirement(String id, RequiredMeasurement<?>... reqs) {
171             super(id, reqs);
172         }
173 
setRearCameraLatency(float latency)174         public void setRearCameraLatency(float latency) {
175             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_LATENCY, latency);
176         }
177 
setFrontCameraLatency(float latency)178         public void setFrontCameraLatency(float latency) {
179             this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_LATENCY, latency);
180         }
181 
182         /**
183          * [2.2.7.2/7.5/H-1-5] MUST have camera2 JPEG capture latency < 1000ms for 1080p resolution
184          * as measured by the CTS camera PerformanceTest under ITS lighting conditions
185          * (3000K) for both primary cameras.
186          */
createJpegLatencyReq()187         public static CameraLatencyRequirement createJpegLatencyReq() {
188             RequiredMeasurement<Float> rearJpegLatency = RequiredMeasurement
189                     .<Float>builder()
190                     .setId(RequirementConstants.REAR_CAMERA_LATENCY)
191                     .setPredicate(RequirementConstants.FLOAT_LTE)
192                     .addRequiredValue(Build.VERSION_CODES.R, 1000.0f)
193                     .addRequiredValue(Build.VERSION_CODES.S, 1000.0f)
194                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, 1000.0f)
195                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, 1000.0f)
196                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 1000.0f)
197                     .build();
198             RequiredMeasurement<Float> frontJpegLatency = RequiredMeasurement
199                     .<Float>builder()
200                     .setId(RequirementConstants.FRONT_CAMERA_LATENCY)
201                     .setPredicate(RequirementConstants.FLOAT_LTE)
202                     .addRequiredValue(Build.VERSION_CODES.R, 1000.0f)
203                     .addRequiredValue(Build.VERSION_CODES.S, 1000.0f)
204                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, 1000.0f)
205                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, 1000.0f)
206                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 1000.0f)
207                     .build();
208 
209             return new CameraLatencyRequirement(RequirementConstants.R7_5__H_1_5,
210                     rearJpegLatency, frontJpegLatency);
211         }
212 
213         /**
214          * [2.2.7.2/7.5/H-1-6] MUST have camera2 startup latency (open camera to first
215          * preview frame) < 600ms (S and below) or 500ms (T and above) as measured by the CTS camera
216          * PerformanceTest under ITS lighting conditions (3000K) for both primary cameras.
217          */
createLaunchLatencyReq()218         public static CameraLatencyRequirement createLaunchLatencyReq() {
219             RequiredMeasurement<Float> rearLaunchLatency = RequiredMeasurement
220                     .<Float>builder()
221                     .setId(RequirementConstants.REAR_CAMERA_LATENCY)
222                     .setPredicate(RequirementConstants.FLOAT_LTE)
223                     .addRequiredValue(Build.VERSION_CODES.R, 600.0f)
224                     .addRequiredValue(Build.VERSION_CODES.S, 600.0f)
225                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, 500.0f)
226                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, 500.0f)
227                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 500.0f)
228                     .build();
229             RequiredMeasurement<Float> frontLaunchLatency = RequiredMeasurement
230                     .<Float>builder()
231                     .setId(RequirementConstants.FRONT_CAMERA_LATENCY)
232                     .setPredicate(RequirementConstants.FLOAT_LTE)
233                     .addRequiredValue(Build.VERSION_CODES.R, 600.0f)
234                     .addRequiredValue(Build.VERSION_CODES.S, 600.0f)
235                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, 500.0f)
236                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, 500.0f)
237                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 500.0f)
238                     .build();
239 
240             return new CameraLatencyRequirement(RequirementConstants.R7_5__H_1_6,
241                     rearLaunchLatency, frontLaunchLatency);
242         }
243     }
244 
245     public static class CameraRawRequirement extends Requirement {
246         private static final String TAG = CameraRawRequirement.class.getSimpleName();
247 
CameraRawRequirement(String id, RequiredMeasurement<?>... reqs)248         private CameraRawRequirement(String id, RequiredMeasurement<?>... reqs) {
249             super(id, reqs);
250         }
251 
setRearRawSupported(boolean rearRawSupported)252         public void setRearRawSupported(boolean rearRawSupported) {
253             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_RAW_SUPPORTED,
254                     rearRawSupported);
255         }
256 
257         /**
258          * [2.2.7.2/7.5/H-1-8] MUST support CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_RAW and
259          * android.graphics.ImageFormat.RAW_SENSOR for the primary back camera.
260          */
createRawReq()261         public static CameraRawRequirement createRawReq() {
262             RequiredMeasurement<Boolean> requirement = RequiredMeasurement
263                     .<Boolean>builder()
264                     .setId(RequirementConstants.REAR_CAMERA_RAW_SUPPORTED)
265                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
266                     .addRequiredValue(Build.VERSION_CODES.S, true)
267                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
268                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
269                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
270                     .build();
271 
272             return new CameraRawRequirement(RequirementConstants.R7_5__H_1_8, requirement);
273         }
274     }
275 
276     public static class CameraTimestampSourceRequirement extends Requirement {
277         private static final String TAG = CameraTimestampSourceRequirement.class.getSimpleName();
278         private static final int TIMESTAMP_REALTIME =
279                 CameraMetadata.SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME;
280 
CameraTimestampSourceRequirement(String id, RequiredMeasurement<?>... reqs)281         private CameraTimestampSourceRequirement(String id, RequiredMeasurement<?>... reqs) {
282             super(id, reqs);
283         }
284 
setRearCameraTimestampSource(Integer timestampSource)285         public void setRearCameraTimestampSource(Integer timestampSource) {
286             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_TIMESTAMP_SOURCE,
287                     timestampSource);
288         }
289 
setFrontCameraTimestampSource(Integer timestampSource)290         public void setFrontCameraTimestampSource(Integer timestampSource) {
291             this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_TIMESTAMP_SOURCE,
292                     timestampSource);
293         }
294 
295         /**
296          * [2.2.7.2/7.5/H-1-4] MUST support CameraMetadata.SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
297          * for both primary cameras.
298          */
createTimestampSourceReq()299         public static CameraTimestampSourceRequirement createTimestampSourceReq() {
300             RequiredMeasurement<Integer> rearTimestampSource = RequiredMeasurement
301                     .<Integer>builder()
302                     .setId(RequirementConstants.REAR_CAMERA_TIMESTAMP_SOURCE)
303                     .setPredicate(RequirementConstants.INTEGER_EQ)
304                     .addRequiredValue(Build.VERSION_CODES.R, TIMESTAMP_REALTIME)
305                     .addRequiredValue(Build.VERSION_CODES.S, TIMESTAMP_REALTIME)
306                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, TIMESTAMP_REALTIME)
307                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, TIMESTAMP_REALTIME)
308                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, TIMESTAMP_REALTIME)
309                     .build();
310             RequiredMeasurement<Integer> frontTimestampSource = RequiredMeasurement
311                     .<Integer>builder()
312                     .setId(RequirementConstants.FRONT_CAMERA_TIMESTAMP_SOURCE)
313                     .setPredicate(RequirementConstants.INTEGER_EQ)
314                     .addRequiredValue(Build.VERSION_CODES.R, TIMESTAMP_REALTIME)
315                     .addRequiredValue(Build.VERSION_CODES.S, TIMESTAMP_REALTIME)
316                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, TIMESTAMP_REALTIME)
317                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, TIMESTAMP_REALTIME)
318                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, TIMESTAMP_REALTIME)
319                     .build();
320 
321             return new CameraTimestampSourceRequirement(RequirementConstants.R7_5__H_1_4,
322                     rearTimestampSource, frontTimestampSource);
323         }
324     }
325 
326     public static class ConcurrentRearFrontRequirement extends Requirement {
327         private static final String TAG = ConcurrentRearFrontRequirement.class.getSimpleName();
328 
ConcurrentRearFrontRequirement(String id, RequiredMeasurement<?>... reqs)329         private ConcurrentRearFrontRequirement(String id, RequiredMeasurement<?>... reqs) {
330             super(id, reqs);
331         }
332 
setConcurrentRearFrontSupported(boolean concurrentRearFrontSupported)333         public void setConcurrentRearFrontSupported(boolean concurrentRearFrontSupported) {
334             this.setMeasuredValue(RequirementConstants.CONCURRENT_REAR_FRONT_SUPPORTED,
335                     concurrentRearFrontSupported);
336         }
337 
338         /**
339          * [2.2.7.2/7.5/H-1-11] MUST implement concurrent front-back streaming on primary cameras.
340          */
createConcurrentRearFrontReq()341         public static ConcurrentRearFrontRequirement createConcurrentRearFrontReq() {
342             RequiredMeasurement<Boolean> requirement = RequiredMeasurement
343                     .<Boolean>builder()
344                     .setId(RequirementConstants.CONCURRENT_REAR_FRONT_SUPPORTED)
345                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
346                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
347                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
348                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
349                     .build();
350 
351             return new ConcurrentRearFrontRequirement(RequirementConstants.R7_5__H_1_11,
352                     requirement);
353         }
354     }
355 
356     public static class DynamicRangeTenBitsRequirement extends Requirement {
357         private static final String TAG =
358                 DynamicRangeTenBitsRequirement.class.getSimpleName();
359 
360         public static int PRIMARY_REAR_CAMERA = 0;
361         public static int PRIMARY_FRONT_CAMERA = 1;
362 
DynamicRangeTenBitsRequirement(String id, RequiredMeasurement<?>... reqs)363         private DynamicRangeTenBitsRequirement(String id, RequiredMeasurement<?>... reqs) {
364             super(id, reqs);
365         }
366 
setDynamicRangeTenBitsSupported(int camera, boolean supported)367         public void setDynamicRangeTenBitsSupported(int camera, boolean supported) {
368             if (camera == PRIMARY_REAR_CAMERA) {
369                 this.setMeasuredValue(RequirementConstants.REAR_CAMERA_DYNAMIC_TENBITS_SUPPORTED,
370                         supported);
371             } else if (camera == PRIMARY_FRONT_CAMERA) {
372                 this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_DYNAMIC_TENBITS_SUPPORTED,
373                         supported);
374             }
375         }
376 
377         /**
378          * [2.2.7.2/7.5/H-1-16] MUST support DYNAMIC_RANGE_TEN_BIT capability for
379          * the primary cameras.
380          */
createDynamicRangeTenBitsReq()381         public static DynamicRangeTenBitsRequirement createDynamicRangeTenBitsReq() {
382             RequiredMeasurement<Boolean> rearDynamicRangeTenBitsRequirement = RequiredMeasurement
383                     .<Boolean>builder()
384                     .setId(RequirementConstants.REAR_CAMERA_DYNAMIC_TENBITS_SUPPORTED)
385                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
386                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
387                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
388                     .build();
389             RequiredMeasurement<Boolean> frontDynamicRangeTenBitsRequirement = RequiredMeasurement
390                     .<Boolean>builder()
391                     .setId(RequirementConstants.FRONT_CAMERA_DYNAMIC_TENBITS_SUPPORTED)
392                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
393                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
394                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
395                     .build();
396             return new DynamicRangeTenBitsRequirement(RequirementConstants.R7_5__H_1_16,
397                     rearDynamicRangeTenBitsRequirement, frontDynamicRangeTenBitsRequirement);
398         }
399     }
400 
401     public static class HLGCombinationRequirement extends Requirement {
402         private static final String TAG =
403                 HLGCombinationRequirement.class.getSimpleName();
404 
HLGCombinationRequirement(String id, RequiredMeasurement<?>... reqs)405         private HLGCombinationRequirement(String id, RequiredMeasurement<?>... reqs) {
406             super(id, reqs);
407         }
408 
setHLGCombinationSupported(boolean supported)409         public void setHLGCombinationSupported(boolean supported) {
410             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_HLG_COMBINATION_SUPPORTED,
411                     supported);
412         }
413 
414         /**
415          * [2.2.7.2/7.5/H-1-19] MUST support PREVIEW_STABILIZATION for
416          * 1080p PRIV HLG10 + max-size JPEG
417          * 720p PRIV HLG10 + max-size JPEG
418          * for primary rear camera
419          */
createRearHLGCombinationReq()420         public static HLGCombinationRequirement createRearHLGCombinationReq() {
421             RequiredMeasurement<Boolean> rearHLGCombinationRequirement = RequiredMeasurement
422                     .<Boolean>builder()
423                     .setId(RequirementConstants.PRIMARY_CAMERA_HLG_COMBINATION_SUPPORTED)
424                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
425                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
426                     .build();
427             return new HLGCombinationRequirement(RequirementConstants.R7_5__H_1_19,
428                     rearHLGCombinationRequirement);
429         }
430     }
431 
432     public static class JpegRRequirement extends Requirement {
433         private static final String TAG =
434                 JpegRRequirement.class.getSimpleName();
435 
436         public static int PRIMARY_REAR_CAMERA = 0;
437         public static int PRIMARY_FRONT_CAMERA = 1;
438 
JpegRRequirement(String id, RequiredMeasurement<?>... reqs)439         private JpegRRequirement(String id, RequiredMeasurement<?>... reqs) {
440             super(id, reqs);
441         }
442 
setJpegRSupported(int camera, boolean supported)443         public void setJpegRSupported(int camera, boolean supported) {
444             if (camera == PRIMARY_REAR_CAMERA) {
445                 this.setMeasuredValue(RequirementConstants.PRIMARY_REAR_CAMERA_JPEG_R_SUPPORTED,
446                         supported);
447             } else if (camera == PRIMARY_FRONT_CAMERA) {
448                 this.setMeasuredValue(RequirementConstants.PRIMARY_FRONT_CAMERA_JPEG_R_SUPPORTED,
449                         supported);
450             }
451         }
452 
453         /**
454          * [2.2.7.2/7.5/H-1-18] MUST support JPEG_R for the primary cameras.
455          */
createJpegRReq()456         public static JpegRRequirement createJpegRReq() {
457             RequiredMeasurement<Boolean> rearJpegRRequirement = RequiredMeasurement
458                     .<Boolean>builder()
459                     .setId(RequirementConstants.PRIMARY_REAR_CAMERA_JPEG_R_SUPPORTED)
460                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
461                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
462                     .build();
463             RequiredMeasurement<Boolean> frontJpegRRequirement = RequiredMeasurement
464                     .<Boolean>builder()
465                     .setId(RequirementConstants.PRIMARY_FRONT_CAMERA_JPEG_R_SUPPORTED)
466                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
467                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
468                     .build();
469             return new JpegRRequirement(RequirementConstants.R7_5__H_1_18,
470                     rearJpegRRequirement, frontJpegRRequirement);
471         }
472     }
473 
474     public static class FaceDetectionRequirement extends Requirement {
475         private static final String TAG =
476                 FaceDetectionRequirement.class.getSimpleName();
477 
478         public static int PRIMARY_REAR_CAMERA = 0;
479         public static int PRIMARY_FRONT_CAMERA = 1;
480 
FaceDetectionRequirement(String id, RequiredMeasurement<?>... reqs)481         private FaceDetectionRequirement(String id, RequiredMeasurement<?>... reqs) {
482             super(id, reqs);
483         }
484 
setFaceDetectionSupported(int camera, boolean supported)485         public void setFaceDetectionSupported(int camera, boolean supported) {
486             if (camera == PRIMARY_REAR_CAMERA) {
487                 this.setMeasuredValue(RequirementConstants.REAR_CAMERA_FACE_DETECTION_SUPPORTED,
488                         supported);
489             } else if (camera == PRIMARY_FRONT_CAMERA) {
490                 this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_FACE_DETECTION_SUPPORTED,
491                         supported);
492             }
493         }
494 
495         /**
496          * [2.2.7.2/7.5/H-1-17] MUST support face detection capability
497          * (STATISTICS_FACE_DETECT_MODE_SIMPLE or STATISTICS_FACE_DETECT_MODE_FULL) for the primary
498          * cameras.
499          */
createFaceDetectionReq()500         public static FaceDetectionRequirement createFaceDetectionReq() {
501             RequiredMeasurement<Boolean> rearFaceDetectionRequirement = RequiredMeasurement
502                     .<Boolean>builder()
503                     .setId(RequirementConstants.REAR_CAMERA_FACE_DETECTION_SUPPORTED)
504                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
505                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
506                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
507                     .build();
508             RequiredMeasurement<Boolean> frontFaceDetectionRequirement = RequiredMeasurement
509                     .<Boolean>builder()
510                     .setId(RequirementConstants.FRONT_CAMERA_FACE_DETECTION_SUPPORTED)
511                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
512                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
513                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
514                     .build();
515             return new FaceDetectionRequirement(RequirementConstants.R7_5__H_1_17,
516                     rearFaceDetectionRequirement, frontFaceDetectionRequirement);
517         }
518     }
519 
520     public static class LogicalMultiCameraRequirement extends Requirement {
521         private static final String TAG =
522                 LogicalMultiCameraRequirement.class.getSimpleName();
523 
LogicalMultiCameraRequirement(String id, RequiredMeasurement<?>... reqs)524         private LogicalMultiCameraRequirement(String id, RequiredMeasurement<?>... reqs) {
525             super(id, reqs);
526         }
527 
setRearLogicalMultiCameraReqMet(boolean reqMet)528         public void setRearLogicalMultiCameraReqMet(boolean reqMet) {
529             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_LOGICAL_MULTI_CAMERA_REQ_MET,
530                     reqMet);
531         }
532 
533         /**
534          * [2.2.7.2/7.5/H-1-13] MUST support LOGICAL_MULTI_CAMERA capability for the primary
535          * rear-facing camera if there are greater than 1 RGB rear-facing cameras.
536          */
createLogicalMultiCameraReq()537         public static LogicalMultiCameraRequirement createLogicalMultiCameraReq() {
538             RequiredMeasurement<Boolean> rearRequirement = RequiredMeasurement
539                     .<Boolean>builder()
540                     .setId(RequirementConstants.REAR_CAMERA_LOGICAL_MULTI_CAMERA_REQ_MET)
541                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
542                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
543                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
544                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
545                     .build();
546 
547             return new LogicalMultiCameraRequirement(RequirementConstants.R7_5__H_1_13,
548                     rearRequirement);
549         }
550     }
551 
552     public static class PreviewStabilizationRequirement extends Requirement {
553         private static final String TAG =
554                 PreviewStabilizationRequirement.class.getSimpleName();
555 
PreviewStabilizationRequirement(String id, RequiredMeasurement<?>... reqs)556         private PreviewStabilizationRequirement(String id, RequiredMeasurement<?>... reqs) {
557             super(id, reqs);
558         }
559 
setRearPreviewStabilizationSupported(boolean supported)560         public void setRearPreviewStabilizationSupported(boolean supported) {
561             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_PREVIEW_STABILIZATION_SUPPORTED,
562                     supported);
563         }
564 
565         /**
566          * [2.2.7.2/7.5/H-1-12] MUST support CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION
567          * for the primary back camera.
568          */
createPreviewStabilizationReq()569         public static PreviewStabilizationRequirement createPreviewStabilizationReq() {
570             RequiredMeasurement<Boolean> rearRequirement = RequiredMeasurement
571                     .<Boolean>builder()
572                     .setId(RequirementConstants.REAR_CAMERA_PREVIEW_STABILIZATION_SUPPORTED)
573                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
574                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
575                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
576                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
577                     .build();
578 
579             return new PreviewStabilizationRequirement(RequirementConstants.R7_5__H_1_12,
580                     rearRequirement);
581         }
582     }
583 
584     public static class PrimaryCameraRequirement extends Requirement {
585         private static final long MIN_BACK_SENSOR_PERF_CLASS_RESOLUTION = 12000000;
586         private static final long MIN_FRONT_SENSOR_S_PERF_CLASS_RESOLUTION = 5000000;
587         private static final long MIN_FRONT_SENSOR_R_PERF_CLASS_RESOLUTION = 4000000;
588         private static final String TAG = PrimaryCameraRequirement.class.getSimpleName();
589 
PrimaryCameraRequirement(String id, RequiredMeasurement<?>... reqs)590         private PrimaryCameraRequirement(String id, RequiredMeasurement<?>... reqs) {
591             super(id, reqs);
592         }
593 
setPrimaryCameraSupported(boolean hasPrimaryCamera)594         public void setPrimaryCameraSupported(boolean hasPrimaryCamera) {
595             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_AVAILABLE,
596                     hasPrimaryCamera);
597         }
598 
setResolution(long resolution)599         public void setResolution(long resolution) {
600             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_RESOLUTION,
601                     resolution);
602         }
603 
setVideoSizeReqSatisfied(boolean videoSizeReqSatisfied)604         public void setVideoSizeReqSatisfied(boolean videoSizeReqSatisfied) {
605             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_VIDEO_SIZE_REQ_SATISFIED,
606                     videoSizeReqSatisfied);
607         }
608 
set720pVideoSizeReqSatisfied(boolean videoSizeReqSatisfied)609         public void set720pVideoSizeReqSatisfied(boolean videoSizeReqSatisfied) {
610             this.setMeasuredValue(
611                     RequirementConstants.PRIMARY_CAMERA_720p_VIDEO_SIZE_REQ_SATISFIED,
612                     videoSizeReqSatisfied);
613         }
614 
set1080pVideoSizeReqSatisfied(boolean videoSizeReqSatisfied)615         public void set1080pVideoSizeReqSatisfied(boolean videoSizeReqSatisfied) {
616             this.setMeasuredValue(
617                     RequirementConstants.PRIMARY_CAMERA_1080p_VIDEO_SIZE_REQ_SATISFIED,
618                     videoSizeReqSatisfied);
619         }
620 
setVideoFps(double videoFps)621         public void setVideoFps(double videoFps) {
622             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_VIDEO_FPS, videoFps);
623         }
624 
set720pVideoFps(double videoFps)625         public void set720pVideoFps(double videoFps) {
626             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_720p_VIDEO_FPS,
627                     videoFps);
628         }
629 
set1080pVideoFps(double videoFps)630         public void set1080pVideoFps(double videoFps) {
631             this.setMeasuredValue(RequirementConstants.PRIMARY_CAMERA_1080p_VIDEO_FPS,
632                     videoFps);
633         }
634 
635         /**
636          * [2.2.7.2/7.5/H-1-1] MUST have a primary rear facing camera with a resolution of at
637          * least 12 megapixels supporting video capture at 4k@30fps
638          */
createRearPrimaryCamera()639         public static PrimaryCameraRequirement createRearPrimaryCamera() {
640             RequiredMeasurement<Boolean> hasPrimaryCamera = RequiredMeasurement
641                     .<Boolean>builder()
642                     .setId(RequirementConstants.PRIMARY_CAMERA_AVAILABLE)
643                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
644                     .addRequiredValue(Build.VERSION_CODES.R, true)
645                     .addRequiredValue(Build.VERSION_CODES.S, true)
646                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
647                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
648                     .build();
649 
650             RequiredMeasurement<Long> cameraResolution = RequiredMeasurement
651                     .<Long>builder()
652                     .setId(RequirementConstants.PRIMARY_CAMERA_RESOLUTION)
653                     .setPredicate(RequirementConstants.LONG_GTE)
654                     .addRequiredValue(Build.VERSION_CODES.R, MIN_BACK_SENSOR_PERF_CLASS_RESOLUTION)
655                     .addRequiredValue(Build.VERSION_CODES.S, MIN_BACK_SENSOR_PERF_CLASS_RESOLUTION)
656                     .addRequiredValue(
657                             Build.VERSION_CODES.TIRAMISU, MIN_BACK_SENSOR_PERF_CLASS_RESOLUTION)
658                     .addRequiredValue(
659                             Build.VERSION_CODES.UPSIDE_DOWN_CAKE,
660                             MIN_BACK_SENSOR_PERF_CLASS_RESOLUTION)
661                     .build();
662 
663             RequiredMeasurement<Boolean> videoSizeReqSatisfied = RequiredMeasurement
664                     .<Boolean>builder()
665                     .setId(RequirementConstants.PRIMARY_CAMERA_VIDEO_SIZE_REQ_SATISFIED)
666                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
667                     .addRequiredValue(Build.VERSION_CODES.R, true)
668                     .addRequiredValue(Build.VERSION_CODES.S, true)
669                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
670                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
671                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
672                     .build();
673             // Split definitions of 720p and 1080p for future flexibility
674             RequiredMeasurement<Boolean> videoSize720pReqSatisfied = RequiredMeasurement
675                     .<Boolean>builder()
676                     .setId(RequirementConstants.PRIMARY_CAMERA_720p_VIDEO_SIZE_REQ_SATISFIED)
677                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
678                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
679                     .build();
680             RequiredMeasurement<Boolean> videoSize1080pReqSatisfied = RequiredMeasurement
681                     .<Boolean>builder()
682                     .setId(RequirementConstants.PRIMARY_CAMERA_1080p_VIDEO_SIZE_REQ_SATISFIED)
683                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
684                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
685                     .build();
686             RequiredMeasurement<Double> videoFps = RequiredMeasurement
687                     .<Double>builder()
688                     .setId(RequirementConstants.PRIMARY_CAMERA_VIDEO_FPS)
689                     .setPredicate(RequirementConstants.DOUBLE_GTE)
690                     .addRequiredValue(Build.VERSION_CODES.R, 29.9)
691                     .addRequiredValue(Build.VERSION_CODES.S, 29.9)
692                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, 29.9)
693                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, 29.9)
694                     .build();
695             RequiredMeasurement<Double> video720pFps = RequiredMeasurement
696                     .<Double>builder()
697                     .setId(RequirementConstants.PRIMARY_CAMERA_720p_VIDEO_FPS)
698                     .setPredicate(RequirementConstants.DOUBLE_GTE)
699                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 59.9)
700                     .build();
701             RequiredMeasurement<Double> video1080pFps = RequiredMeasurement
702                     .<Double>builder()
703                     .setId(RequirementConstants.PRIMARY_CAMERA_1080p_VIDEO_FPS)
704                     .setPredicate(RequirementConstants.DOUBLE_GTE)
705                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 59.9)
706                     .build();
707 
708             return new PrimaryCameraRequirement(RequirementConstants.R7_5__H_1_1,
709                     hasPrimaryCamera, cameraResolution, videoSizeReqSatisfied,
710                     videoFps, videoSize720pReqSatisfied, videoSize1080pReqSatisfied,
711                     video720pFps, video1080pFps);
712         }
713 
714         /**
715          * [2.2.7.2/7.5/H-1-2] MUST have a primary front facing camera with a resolution of
716          * at least 4 megapixels supporting video capture at 1080p@30fps.
717          */
createFrontPrimaryCamera()718         public static PrimaryCameraRequirement createFrontPrimaryCamera() {
719             RequiredMeasurement<Boolean> hasPrimaryCamera = RequiredMeasurement
720                     .<Boolean>builder()
721                     .setId(RequirementConstants.PRIMARY_CAMERA_AVAILABLE)
722                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
723                     .addRequiredValue(Build.VERSION_CODES.R, true)
724                     .addRequiredValue(Build.VERSION_CODES.S, true)
725                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
726                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
727                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
728                     .build();
729 
730             RequiredMeasurement<Long> cameraResolution = RequiredMeasurement
731                     .<Long>builder()
732                     .setId(RequirementConstants.PRIMARY_CAMERA_RESOLUTION)
733                     .setPredicate(RequirementConstants.LONG_GTE)
734                     .addRequiredValue(
735                             Build.VERSION_CODES.R, MIN_FRONT_SENSOR_R_PERF_CLASS_RESOLUTION)
736                     .addRequiredValue(
737                             Build.VERSION_CODES.S, MIN_FRONT_SENSOR_S_PERF_CLASS_RESOLUTION)
738                     .addRequiredValue(
739                             Build.VERSION_CODES.TIRAMISU, MIN_FRONT_SENSOR_S_PERF_CLASS_RESOLUTION)
740                     .addRequiredValue(
741                             Build.VERSION_CODES.UPSIDE_DOWN_CAKE,
742                             MIN_FRONT_SENSOR_S_PERF_CLASS_RESOLUTION)
743                     .addRequiredValue(
744                             Build.VERSION_CODES.VANILLA_ICE_CREAM,
745                             MIN_FRONT_SENSOR_S_PERF_CLASS_RESOLUTION)
746                     .build();
747 
748             RequiredMeasurement<Boolean> videoSizeReqSatisfied = RequiredMeasurement
749                     .<Boolean>builder()
750                     .setId(RequirementConstants.PRIMARY_CAMERA_VIDEO_SIZE_REQ_SATISFIED)
751                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
752                     .addRequiredValue(Build.VERSION_CODES.R, true)
753                     .addRequiredValue(Build.VERSION_CODES.S, true)
754                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
755                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
756                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
757                     .build();
758 
759             RequiredMeasurement<Double> videoFps = RequiredMeasurement
760                     .<Double>builder()
761                     .setId(RequirementConstants.PRIMARY_CAMERA_VIDEO_FPS)
762                     .setPredicate(RequirementConstants.DOUBLE_GTE)
763                     .addRequiredValue(Build.VERSION_CODES.R, 29.9)
764                     .addRequiredValue(Build.VERSION_CODES.S, 29.9)
765                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, 29.9)
766                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, 29.9)
767                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, 29.9)
768                     .build();
769             return new PrimaryCameraRequirement(RequirementConstants.R7_5__H_1_2,
770                     hasPrimaryCamera, cameraResolution, videoSizeReqSatisfied,
771                     videoFps);
772         }
773     }
774 
775     public static class StreamUseCaseRequirement extends Requirement {
776         private static final String TAG =
777                 StreamUseCaseRequirement.class.getSimpleName();
778 
StreamUseCaseRequirement(String id, RequiredMeasurement<?>... reqs)779         private StreamUseCaseRequirement(String id, RequiredMeasurement<?>... reqs) {
780             super(id, reqs);
781         }
782 
setRearStreamUseCaseSupported(boolean supported)783         public void setRearStreamUseCaseSupported(boolean supported) {
784             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_STREAM_USECASE_SUPPORTED,
785                     supported);
786         }
787 
setFrontStreamUseCaseSupported(boolean supported)788         public void setFrontStreamUseCaseSupported(boolean supported) {
789             this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_STREAM_USECASE_SUPPORTED,
790                     supported);
791         }
792 
793         /**
794          * [2.2.7.2/7.5/H-1-14] MUST support STREAM_USE_CASE capability for both primary
795          * front and primary back camera.
796          */
createStreamUseCaseReq()797         public static StreamUseCaseRequirement createStreamUseCaseReq() {
798             RequiredMeasurement<Boolean> rearRequirement = RequiredMeasurement
799                     .<Boolean>builder()
800                     .setId(RequirementConstants.REAR_CAMERA_STREAM_USECASE_SUPPORTED)
801                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
802                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
803                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
804                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
805                     .build();
806             RequiredMeasurement<Boolean> frontRequirement = RequiredMeasurement
807                     .<Boolean>builder()
808                     .setId(RequirementConstants.FRONT_CAMERA_STREAM_USECASE_SUPPORTED)
809                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
810                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
811                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
812                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
813                     .build();
814 
815             return new StreamUseCaseRequirement(RequirementConstants.R7_5__H_1_14,
816                     rearRequirement, frontRequirement);
817         }
818     }
819 
820     public static class UltraWideZoomRatioRequirement extends Requirement {
821         private static final String TAG =
822                 UltraWideZoomRatioRequirement.class.getSimpleName();
823 
UltraWideZoomRatioRequirement(String id, RequiredMeasurement<?>... reqs)824         private UltraWideZoomRatioRequirement(String id, RequiredMeasurement<?>... reqs) {
825             super(id, reqs);
826         }
827 
setRearUltraWideZoomRatioReqMet(boolean ultrawideZoomRatioReqMet)828         public void setRearUltraWideZoomRatioReqMet(boolean ultrawideZoomRatioReqMet) {
829             this.setMeasuredValue(RequirementConstants.REAR_CAMERA_ULTRAWIDE_ZOOMRATIO_REQ_MET,
830                     ultrawideZoomRatioReqMet);
831         }
832 
setFrontUltraWideZoomRatioReqMet(boolean ultrawideZoomRatioReqMet)833         public void setFrontUltraWideZoomRatioReqMet(boolean ultrawideZoomRatioReqMet) {
834             this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_ULTRAWIDE_ZOOMRATIO_REQ_MET,
835                     ultrawideZoomRatioReqMet);
836         }
837 
838         /**
839          * [2.2.7.2/7.5/H-1-10] MUST have min ZOOM_RATIO < 1.0 for the primary cameras if
840          * there is an ultrawide RGB camera facing the same direction.
841          */
createUltrawideZoomRatioReq()842         public static UltraWideZoomRatioRequirement createUltrawideZoomRatioReq() {
843             RequiredMeasurement<Boolean> rearRequirement = RequiredMeasurement
844                     .<Boolean>builder()
845                     .setId(RequirementConstants.REAR_CAMERA_ULTRAWIDE_ZOOMRATIO_REQ_MET)
846                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
847                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
848                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
849                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
850                     .build();
851             RequiredMeasurement<Boolean> frontRequirement = RequiredMeasurement
852                     .<Boolean>builder()
853                     .setId(RequirementConstants.FRONT_CAMERA_ULTRAWIDE_ZOOMRATIO_REQ_MET)
854                     .setPredicate(RequirementConstants.BOOLEAN_EQ)
855                     .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
856                     .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
857                     .addRequiredValue(Build.VERSION_CODES.VANILLA_ICE_CREAM, true)
858                     .build();
859 
860             return new UltraWideZoomRatioRequirement(RequirementConstants.R7_5__H_1_10,
861                     rearRequirement, frontRequirement);
862         }
863     }
864 }