Merge "Don't panic when DevicePrimaryArchType is called in a host only build"

This commit is contained in:
Colin Cross 2021-12-09 04:18:17 +00:00 committed by Gerrit Code Review
commit 9f5a9d1d54

View file

@ -892,8 +892,13 @@ func (c *config) Eng() bool {
return Bool(c.productVariables.Eng) return Bool(c.productVariables.Eng)
} }
// DevicePrimaryArchType returns the ArchType for the first configured device architecture, or
// Common if there are no device architectures.
func (c *config) DevicePrimaryArchType() ArchType { func (c *config) DevicePrimaryArchType() ArchType {
return c.Targets[Android][0].Arch.ArchType if androidTargets := c.Targets[Android]; len(androidTargets) > 0 {
return androidTargets[0].Arch.ArchType
}
return Common
} }
func (c *config) SanitizeHost() []string { func (c *config) SanitizeHost() []string {