@@ -29,19 +29,21 @@ struct Output {
29
29
}
30
30
31
31
fn resolve ( input : & Input ) -> Output {
32
+ let beamforming_supported = input. ucm_suffix == "omniknight.3mic" ;
32
33
Output {
33
34
ap_nc_allowed : input. ap_nc_featured_allowed
34
35
|| input. ap_nc_segmentation_allowed
35
36
|| input. ap_nc_feature_tier_allowed ,
36
37
style_transfer_supported : input. style_transfer_featured_allowed
37
- && input. ap_nc_segmentation_allowed ,
38
+ && input. ap_nc_segmentation_allowed
39
+ && !beamforming_supported,
38
40
// It's 'or' here because before the toggle of StyleTransfer is landed, users
39
41
// should be able to control the feature only by the feature flag and there
40
42
// would be only tests writing its system state currently.
41
43
// TODO(b/327530996): handle tests: enabled without featured allowed.
42
44
style_transfer_enabled : input. style_transfer_featured_allowed
43
45
|| input. style_transfer_enabled ,
44
- beamforming_supported : input . ucm_suffix == "omniknight.3mic" ,
46
+ beamforming_supported,
45
47
}
46
48
}
47
49
@@ -162,12 +164,17 @@ mod tests {
162
164
#[ test]
163
165
fn test_beamforming ( ) {
164
166
let mut s = S2 :: new ( ) ;
167
+ s. set_ap_nc_segmentation_allowed ( true ) ;
168
+ s. set_style_transfer_featured_allowed ( true ) ;
165
169
assert ! ( !s. output. beamforming_supported) ;
170
+ assert ! ( s. output. style_transfer_supported) ;
166
171
167
172
s. set_ucm_suffix ( "omniknight.3mic" ) ;
168
173
assert ! ( s. output. beamforming_supported) ;
174
+ assert ! ( !s. output. style_transfer_supported) ;
169
175
170
176
s. set_ucm_suffix ( "omniknight" ) ;
171
177
assert ! ( !s. output. beamforming_supported) ;
178
+ assert ! ( s. output. style_transfer_supported) ;
172
179
}
173
180
}
0 commit comments