blob: 6d286802f0cf7f71292534aa64f90cf221a2eda0 [file] [log] [blame]
Colin Cross3f40fa42015-01-30 17:27:36 -08001// Copyright 2015 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Colin Cross635c3b02016-05-18 15:37:25 -070015package android
Colin Cross3f40fa42015-01-30 17:27:36 -080016
17import (
Colin Cross3f40fa42015-01-30 17:27:36 -080018 "encoding/json"
19 "fmt"
Colin Crossd8f20142016-11-03 09:43:26 -070020 "io/ioutil"
Colin Cross3f40fa42015-01-30 17:27:36 -080021 "os"
Colin Cross35cec122015-04-02 14:37:16 -070022 "path/filepath"
Colin Cross3f40fa42015-01-30 17:27:36 -080023 "runtime"
Dan Willemsen5951c8a2016-07-19 19:08:14 -070024 "strconv"
Dan Willemsen34cc69e2015-09-23 15:26:20 -070025 "strings"
Colin Crossc1e86a32015-04-15 12:33:28 -070026 "sync"
Colin Cross6ff51382015-12-17 16:39:19 -080027
28 "github.com/google/blueprint/proptools"
Colin Cross3f40fa42015-01-30 17:27:36 -080029)
30
Colin Cross6ff51382015-12-17 16:39:19 -080031var Bool = proptools.Bool
Jack He8cc71432016-12-08 15:45:07 -080032var String = proptools.String
Colin Cross6ff51382015-12-17 16:39:19 -080033
Colin Cross3f40fa42015-01-30 17:27:36 -080034// The configuration file name
Dan Willemsen87b17d12015-07-14 00:39:06 -070035const configFileName = "soong.config"
36const productVariablesFileName = "soong.variables"
Colin Cross3f40fa42015-01-30 17:27:36 -080037
38// A FileConfigurableOptions contains options which can be configured by the
39// config file. These will be included in the config struct.
40type FileConfigurableOptions struct {
Dan Willemsen322acaf2016-01-12 23:07:05 -080041 Mega_device *bool `json:",omitempty"`
Dan Albert4098deb2016-10-19 14:04:41 -070042 Ndk_abis *bool `json:",omitempty"`
Colin Cross3f40fa42015-01-30 17:27:36 -080043}
44
Colin Cross27385972015-09-18 10:57:10 -070045func (f *FileConfigurableOptions) SetDefaultConfig() {
46 *f = FileConfigurableOptions{}
Colin Cross3f40fa42015-01-30 17:27:36 -080047}
48
Colin Cross9272ade2016-08-17 15:24:12 -070049// A Config object represents the entire build configuration for Android.
Colin Crossc3c0a492015-04-10 15:43:55 -070050type Config struct {
51 *config
52}
53
Colin Cross9272ade2016-08-17 15:24:12 -070054// A DeviceConfig object represents the configuration for a particular device being built. For
55// now there will only be one of these, but in the future there may be multiple devices being
56// built
57type DeviceConfig struct {
58 *deviceConfig
59}
60
Colin Cross1332b002015-04-07 17:11:30 -070061type config struct {
Colin Cross3f40fa42015-01-30 17:27:36 -080062 FileConfigurableOptions
Colin Cross485e5722015-08-27 13:28:01 -070063 ProductVariables productVariables
Colin Cross3f40fa42015-01-30 17:27:36 -080064
Dan Willemsen87b17d12015-07-14 00:39:06 -070065 ConfigFileName string
66 ProductVariablesFileName string
67
Colin Crossa1ad8d12016-06-01 17:09:44 -070068 Targets map[OsClass][]Target
69 BuildOsVariant string
Dan Willemsen218f6562015-07-08 18:13:11 -070070
Colin Cross9272ade2016-08-17 15:24:12 -070071 deviceConfig *deviceConfig
72
Dan Willemsen87b17d12015-07-14 00:39:06 -070073 srcDir string // the path of the root source directory
74 buildDir string // the path of the build output directory
Colin Crossc1e86a32015-04-15 12:33:28 -070075
Dan Willemsene7680ba2015-09-11 17:06:19 -070076 envLock sync.Mutex
77 envDeps map[string]string
78 envFrozen bool
Dan Willemsen5ba07e82015-12-11 13:51:06 -080079
80 inMake bool
Colin Cross1e7d3702016-08-24 15:25:47 -070081
Colin Cross9272ade2016-08-17 15:24:12 -070082 OncePer
83}
84
85type deviceConfig struct {
86 config *config
87 targets []Arch
88 OncePer
Colin Cross3f40fa42015-01-30 17:27:36 -080089}
90
Colin Cross485e5722015-08-27 13:28:01 -070091type jsonConfigurable interface {
Colin Cross27385972015-09-18 10:57:10 -070092 SetDefaultConfig()
Colin Cross485e5722015-08-27 13:28:01 -070093}
Colin Cross3f40fa42015-01-30 17:27:36 -080094
Colin Cross485e5722015-08-27 13:28:01 -070095func loadConfig(config *config) error {
Dan Willemsen87b17d12015-07-14 00:39:06 -070096 err := loadFromConfigFile(&config.FileConfigurableOptions, config.ConfigFileName)
Colin Cross485e5722015-08-27 13:28:01 -070097 if err != nil {
98 return err
99 }
100
Dan Willemsen87b17d12015-07-14 00:39:06 -0700101 return loadFromConfigFile(&config.ProductVariables, config.ProductVariablesFileName)
Colin Cross485e5722015-08-27 13:28:01 -0700102}
103
104// loads configuration options from a JSON file in the cwd.
105func loadFromConfigFile(configurable jsonConfigurable, filename string) error {
Colin Cross3f40fa42015-01-30 17:27:36 -0800106 // Try to open the file
Colin Cross485e5722015-08-27 13:28:01 -0700107 configFileReader, err := os.Open(filename)
Colin Cross3f40fa42015-01-30 17:27:36 -0800108 defer configFileReader.Close()
109 if os.IsNotExist(err) {
110 // Need to create a file, so that blueprint & ninja don't get in
111 // a dependency tracking loop.
112 // Make a file-configurable-options with defaults, write it out using
113 // a json writer.
Colin Cross27385972015-09-18 10:57:10 -0700114 configurable.SetDefaultConfig()
115 err = saveToConfigFile(configurable, filename)
Colin Cross3f40fa42015-01-30 17:27:36 -0800116 if err != nil {
117 return err
118 }
119 } else {
120 // Make a decoder for it
121 jsonDecoder := json.NewDecoder(configFileReader)
Colin Cross485e5722015-08-27 13:28:01 -0700122 err = jsonDecoder.Decode(configurable)
Colin Cross3f40fa42015-01-30 17:27:36 -0800123 if err != nil {
Colin Cross485e5722015-08-27 13:28:01 -0700124 return fmt.Errorf("config file: %s did not parse correctly: "+err.Error(), filename)
Colin Cross3f40fa42015-01-30 17:27:36 -0800125 }
126 }
127
Colin Cross3f40fa42015-01-30 17:27:36 -0800128 // No error
129 return nil
130}
131
Colin Crossd8f20142016-11-03 09:43:26 -0700132// atomically writes the config file in case two copies of soong_build are running simultaneously
133// (for example, docs generation and ninja manifest generation)
Colin Cross485e5722015-08-27 13:28:01 -0700134func saveToConfigFile(config jsonConfigurable, filename string) error {
Colin Cross3f40fa42015-01-30 17:27:36 -0800135 data, err := json.MarshalIndent(&config, "", " ")
136 if err != nil {
137 return fmt.Errorf("cannot marshal config data: %s", err.Error())
138 }
139
Colin Crossd8f20142016-11-03 09:43:26 -0700140 f, err := ioutil.TempFile(filepath.Dir(filename), "config")
Colin Cross3f40fa42015-01-30 17:27:36 -0800141 if err != nil {
Colin Cross485e5722015-08-27 13:28:01 -0700142 return fmt.Errorf("cannot create empty config file %s: %s\n", filename, err.Error())
Colin Cross3f40fa42015-01-30 17:27:36 -0800143 }
Colin Crossd8f20142016-11-03 09:43:26 -0700144 defer os.Remove(f.Name())
145 defer f.Close()
Colin Cross3f40fa42015-01-30 17:27:36 -0800146
Colin Crossd8f20142016-11-03 09:43:26 -0700147 _, err = f.Write(data)
Colin Cross3f40fa42015-01-30 17:27:36 -0800148 if err != nil {
Colin Cross485e5722015-08-27 13:28:01 -0700149 return fmt.Errorf("default config file: %s could not be written: %s", filename, err.Error())
150 }
151
Colin Crossd8f20142016-11-03 09:43:26 -0700152 _, err = f.WriteString("\n")
Colin Cross485e5722015-08-27 13:28:01 -0700153 if err != nil {
154 return fmt.Errorf("default config file: %s could not be written: %s", filename, err.Error())
Colin Cross3f40fa42015-01-30 17:27:36 -0800155 }
156
Colin Crossd8f20142016-11-03 09:43:26 -0700157 f.Close()
158 os.Rename(f.Name(), filename)
159
Colin Cross3f40fa42015-01-30 17:27:36 -0800160 return nil
161}
162
Colin Crossce75d2c2016-10-06 16:12:58 -0700163// TestConfig returns a Config object suitable for using for tests
Colin Cross0d614dd2016-10-14 15:38:43 -0700164func TestConfig(buildDir string) Config {
165 return Config{&config{
166 buildDir: buildDir,
167 }}
Colin Crossce75d2c2016-10-06 16:12:58 -0700168}
169
Colin Cross3f40fa42015-01-30 17:27:36 -0800170// New creates a new Config object. The srcDir argument specifies the path to
171// the root source directory. It also loads the config file, if found.
Dan Willemsen87b17d12015-07-14 00:39:06 -0700172func NewConfig(srcDir, buildDir string) (Config, error) {
Colin Cross3f40fa42015-01-30 17:27:36 -0800173 // Make a config with default options
Colin Cross9272ade2016-08-17 15:24:12 -0700174 config := &config{
175 ConfigFileName: filepath.Join(buildDir, configFileName),
176 ProductVariablesFileName: filepath.Join(buildDir, productVariablesFileName),
Dan Willemsen87b17d12015-07-14 00:39:06 -0700177
Colin Cross9272ade2016-08-17 15:24:12 -0700178 srcDir: srcDir,
179 buildDir: buildDir,
180 envDeps: make(map[string]string),
181
182 deviceConfig: &deviceConfig{},
Colin Cross68f55102015-03-25 14:43:57 -0700183 }
Colin Cross3f40fa42015-01-30 17:27:36 -0800184
Colin Cross9272ade2016-08-17 15:24:12 -0700185 deviceConfig := &deviceConfig{
186 config: config,
187 }
188
189 config.deviceConfig = deviceConfig
190
Dan Willemsen34cc69e2015-09-23 15:26:20 -0700191 // Sanity check the build and source directories. This won't catch strange
192 // configurations with symlinks, but at least checks the obvious cases.
193 absBuildDir, err := filepath.Abs(buildDir)
194 if err != nil {
195 return Config{}, err
196 }
197
198 absSrcDir, err := filepath.Abs(srcDir)
199 if err != nil {
200 return Config{}, err
201 }
202
203 if strings.HasPrefix(absSrcDir, absBuildDir) {
204 return Config{}, fmt.Errorf("Build dir must not contain source directory")
205 }
206
Colin Cross3f40fa42015-01-30 17:27:36 -0800207 // Load any configurable options from the configuration file
Colin Cross9272ade2016-08-17 15:24:12 -0700208 err = loadConfig(config)
Colin Cross3f40fa42015-01-30 17:27:36 -0800209 if err != nil {
Colin Crossc3c0a492015-04-10 15:43:55 -0700210 return Config{}, err
Colin Cross3f40fa42015-01-30 17:27:36 -0800211 }
212
Dan Willemsen5ba07e82015-12-11 13:51:06 -0800213 inMakeFile := filepath.Join(buildDir, ".soong.in_make")
214 if _, err := os.Stat(inMakeFile); err == nil {
215 config.inMake = true
216 }
217
Colin Crossa1ad8d12016-06-01 17:09:44 -0700218 targets, err := decodeTargetProductVariables(config)
Dan Willemsen218f6562015-07-08 18:13:11 -0700219 if err != nil {
220 return Config{}, err
221 }
222
Dan Albert4098deb2016-10-19 14:04:41 -0700223 var archConfig []archConfig
Dan Willemsen322acaf2016-01-12 23:07:05 -0800224 if Bool(config.Mega_device) {
Dan Albert4098deb2016-10-19 14:04:41 -0700225 archConfig = getMegaDeviceConfig()
226 } else if Bool(config.Ndk_abis) {
227 archConfig = getNdkAbisConfig()
228 }
229
230 if archConfig != nil {
231 deviceTargets, err := decodeArchSettings(archConfig)
Dan Willemsen322acaf2016-01-12 23:07:05 -0800232 if err != nil {
233 return Config{}, err
234 }
Colin Crossa1ad8d12016-06-01 17:09:44 -0700235 targets[Device] = deviceTargets
Dan Willemsen322acaf2016-01-12 23:07:05 -0800236 }
237
Colin Crossa1ad8d12016-06-01 17:09:44 -0700238 config.Targets = targets
239 config.BuildOsVariant = targets[Host][0].String()
Dan Willemsen218f6562015-07-08 18:13:11 -0700240
Colin Cross9272ade2016-08-17 15:24:12 -0700241 return Config{config}, nil
Colin Cross3f40fa42015-01-30 17:27:36 -0800242}
243
Dan Willemsen218f6562015-07-08 18:13:11 -0700244func (c *config) RemoveAbandonedFiles() bool {
245 return false
246}
247
Dan Willemsenc2aa4a92016-05-26 15:13:03 -0700248func (c *config) BlueprintToolLocation() string {
249 return filepath.Join(c.buildDir, "host", c.PrebuiltOS(), "bin")
250}
251
Colin Cross3f40fa42015-01-30 17:27:36 -0800252// PrebuiltOS returns the name of the host OS used in prebuilts directories
Colin Cross1332b002015-04-07 17:11:30 -0700253func (c *config) PrebuiltOS() string {
Colin Cross3f40fa42015-01-30 17:27:36 -0800254 switch runtime.GOOS {
255 case "linux":
256 return "linux-x86"
257 case "darwin":
258 return "darwin-x86"
259 default:
260 panic("Unknown GOOS")
261 }
262}
263
264// GoRoot returns the path to the root directory of the Go toolchain.
Colin Cross1332b002015-04-07 17:11:30 -0700265func (c *config) GoRoot() string {
Colin Cross3f40fa42015-01-30 17:27:36 -0800266 return fmt.Sprintf("%s/prebuilts/go/%s", c.srcDir, c.PrebuiltOS())
267}
268
Colin Cross1332b002015-04-07 17:11:30 -0700269func (c *config) CpPreserveSymlinksFlags() string {
Colin Cross485e5722015-08-27 13:28:01 -0700270 switch runtime.GOOS {
Colin Cross3f40fa42015-01-30 17:27:36 -0800271 case "darwin":
272 return "-R"
273 case "linux":
274 return "-d"
275 default:
276 return ""
277 }
278}
Colin Cross68f55102015-03-25 14:43:57 -0700279
Colin Cross1332b002015-04-07 17:11:30 -0700280func (c *config) Getenv(key string) string {
Colin Cross68f55102015-03-25 14:43:57 -0700281 var val string
282 var exists bool
Colin Crossc1e86a32015-04-15 12:33:28 -0700283 c.envLock.Lock()
Colin Cross68f55102015-03-25 14:43:57 -0700284 if val, exists = c.envDeps[key]; !exists {
Dan Willemsene7680ba2015-09-11 17:06:19 -0700285 if c.envFrozen {
286 panic("Cannot access new environment variables after envdeps are frozen")
287 }
Colin Cross68f55102015-03-25 14:43:57 -0700288 val = os.Getenv(key)
289 c.envDeps[key] = val
290 }
Colin Crossc1e86a32015-04-15 12:33:28 -0700291 c.envLock.Unlock()
Colin Cross68f55102015-03-25 14:43:57 -0700292 return val
293}
294
Colin Cross99d7c232016-11-23 16:52:04 -0800295func (c *config) GetenvWithDefault(key string, defaultValue string) string {
296 ret := c.Getenv(key)
297 if ret == "" {
298 return defaultValue
299 }
300 return ret
301}
302
303func (c *config) IsEnvTrue(key string) bool {
304 value := c.Getenv(key)
305 return value == "1" || value == "y" || value == "yes" || value == "on" || value == "true"
306}
307
308func (c *config) IsEnvFalse(key string) bool {
309 value := c.Getenv(key)
310 return value == "0" || value == "n" || value == "no" || value == "off" || value == "false"
311}
312
Colin Cross1332b002015-04-07 17:11:30 -0700313func (c *config) EnvDeps() map[string]string {
Dan Willemsene7680ba2015-09-11 17:06:19 -0700314 c.envLock.Lock()
315 c.envFrozen = true
316 c.envLock.Unlock()
Colin Cross68f55102015-03-25 14:43:57 -0700317 return c.envDeps
318}
Colin Cross35cec122015-04-02 14:37:16 -0700319
Dan Willemsen5ba07e82015-12-11 13:51:06 -0800320func (c *config) EmbeddedInMake() bool {
321 return c.inMake
322}
323
Colin Cross35cec122015-04-02 14:37:16 -0700324// DeviceName returns the name of the current device target
325// TODO: take an AndroidModuleContext to select the device name for multi-device builds
Colin Cross1332b002015-04-07 17:11:30 -0700326func (c *config) DeviceName() string {
Dan Willemsen1d31ec32015-09-22 16:56:09 -0700327 return *c.ProductVariables.DeviceName
Colin Cross35cec122015-04-02 14:37:16 -0700328}
329
Dan Willemsendd0e2c32015-10-20 14:29:35 -0700330func (c *config) DeviceUsesClang() bool {
331 if c.ProductVariables.DeviceUsesClang != nil {
332 return *c.ProductVariables.DeviceUsesClang
333 }
Dan Willemsen0084d782016-03-01 14:54:24 -0800334 return true
Dan Willemsendd0e2c32015-10-20 14:29:35 -0700335}
336
Dan Willemsen34cc69e2015-09-23 15:26:20 -0700337func (c *config) ResourceOverlays() []SourcePath {
Colin Cross30e076a2015-04-13 13:58:27 -0700338 return nil
339}
340
341func (c *config) PlatformVersion() string {
342 return "M"
343}
344
Dan Albert073379e2016-11-10 10:46:36 -0800345func (c *config) PlatformSdkVersionInt() int {
346 return *c.ProductVariables.Platform_sdk_version
347}
348
Colin Cross30e076a2015-04-13 13:58:27 -0700349func (c *config) PlatformSdkVersion() string {
Dan Albert073379e2016-11-10 10:46:36 -0800350 return strconv.Itoa(c.PlatformSdkVersionInt())
Colin Cross30e076a2015-04-13 13:58:27 -0700351}
352
353func (c *config) BuildNumber() string {
354 return "000000"
355}
356
357func (c *config) ProductAaptConfig() []string {
358 return []string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}
359}
360
361func (c *config) ProductAaptPreferredConfig() string {
362 return "xhdpi"
363}
364
365func (c *config) ProductAaptCharacteristics() string {
366 return "nosdcard"
367}
368
Dan Willemsen34cc69e2015-09-23 15:26:20 -0700369func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath {
370 return PathForSource(ctx, "build/target/product/security")
Colin Cross30e076a2015-04-13 13:58:27 -0700371}
372
Dan Willemsen34cc69e2015-09-23 15:26:20 -0700373func (c *config) DefaultAppCertificate(ctx PathContext) SourcePath {
374 return c.DefaultAppCertificateDir(ctx).Join(ctx, "testkey")
Colin Cross30e076a2015-04-13 13:58:27 -0700375}
Colin Cross6ff51382015-12-17 16:39:19 -0800376
377func (c *config) AllowMissingDependencies() bool {
Dan Willemsenb5038162016-03-16 12:35:33 -0700378 return Bool(c.ProductVariables.Allow_missing_dependencies)
Colin Cross6ff51382015-12-17 16:39:19 -0800379}
Dan Willemsen322acaf2016-01-12 23:07:05 -0800380
Colin Cross1e7d3702016-08-24 15:25:47 -0700381func (c *config) DevicePrefer32BitExecutables() bool {
382 return Bool(c.ProductVariables.DevicePrefer32BitExecutables)
383}
384
Dan Willemsen7f730fd2016-01-14 11:22:23 -0800385func (c *config) SkipDeviceInstall() bool {
Dan Willemsen322acaf2016-01-12 23:07:05 -0800386 return c.EmbeddedInMake() || Bool(c.Mega_device)
387}
Colin Cross16b23492016-01-06 14:41:07 -0800388
389func (c *config) SanitizeHost() []string {
Colin Cross23ae82a2016-11-02 14:34:39 -0700390 return append([]string(nil), c.ProductVariables.SanitizeHost...)
Colin Cross16b23492016-01-06 14:41:07 -0800391}
392
393func (c *config) SanitizeDevice() []string {
Colin Cross23ae82a2016-11-02 14:34:39 -0700394 return append([]string(nil), c.ProductVariables.SanitizeDevice...)
395}
396
397func (c *config) SanitizeDeviceArch() []string {
398 return append([]string(nil), c.ProductVariables.SanitizeDeviceArch...)
Colin Cross16b23492016-01-06 14:41:07 -0800399}
Colin Crossa1ad8d12016-06-01 17:09:44 -0700400
401func (c *config) Android64() bool {
402 for _, t := range c.Targets[Device] {
403 if t.Arch.ArchType.Multilib == "lib64" {
404 return true
405 }
406 }
407
408 return false
409}
Colin Cross9272ade2016-08-17 15:24:12 -0700410
Colin Cross9d45bb72016-08-29 16:14:13 -0700411func (c *config) UseGoma() bool {
412 return Bool(c.ProductVariables.UseGoma)
413}
414
Dan Willemsena03cf6d2016-09-26 15:45:04 -0700415func (c *config) ClangTidy() bool {
416 return Bool(c.ProductVariables.ClangTidy)
417}
418
419func (c *config) TidyChecks() string {
420 if c.ProductVariables.TidyChecks == nil {
421 return ""
422 }
423 return *c.ProductVariables.TidyChecks
424}
425
Colin Cross0f4e0d62016-07-27 10:56:55 -0700426func (c *config) LibartImgHostBaseAddress() string {
427 return "0x60000000"
428}
429
430func (c *config) LibartImgDeviceBaseAddress() string {
431 switch c.Targets[Device][0].Arch.ArchType {
432 default:
433 return "0x70000000"
434 case Mips, Mips64:
435 return "0x30000000"
436 }
437}
438
Hiroshi Yamauchie2a10632016-12-19 13:44:41 -0800439func (c *config) ArtUseReadBarrier() bool {
440 return Bool(c.ProductVariables.ArtUseReadBarrier)
441}
442
Colin Cross9272ade2016-08-17 15:24:12 -0700443func (c *deviceConfig) Arches() []Arch {
444 var arches []Arch
445 for _, target := range c.config.Targets[Device] {
446 arches = append(arches, target.Arch)
447 }
448 return arches
449}
Dan Willemsend2ede872016-11-18 14:54:24 -0800450
Dan Willemsen4353bc42016-12-05 17:16:02 -0800451func (c *deviceConfig) VendorPath() string {
452 if c.config.ProductVariables.VendorPath != nil {
453 return *c.config.ProductVariables.VendorPath
454 }
455 return "vendor"
456}
457
Dan Willemsend2ede872016-11-18 14:54:24 -0800458func (c *deviceConfig) VndkVersion() string {
459 if c.config.ProductVariables.DeviceVndkVersion == nil {
460 return ""
461 }
462 return *c.config.ProductVariables.DeviceVndkVersion
463}
Jack He8cc71432016-12-08 15:45:07 -0800464
465func (c *deviceConfig) BtConfigIncludeDir() string {
466 return String(c.config.ProductVariables.BtConfigIncludeDir)
467}
468
469func (c *deviceConfig) BtHcilpIncluded() string {
470 return String(c.config.ProductVariables.BtHcilpIncluded)
471}
472
473func (c *deviceConfig) BtHciUseMct() bool {
474 return Bool(c.config.ProductVariables.BtHciUseMct)
475}