Loading android/arch.go +4 −11 Original line number Diff line number Diff line Loading @@ -1169,7 +1169,7 @@ func decodeTargetProductVariables(config *config) (map[OsType][]Target, error) { targets := make(map[OsType][]Target) var targetErr error addTarget := func(os OsType, archName string, archVariant, cpuVariant *string, abi *[]string) { addTarget := func(os OsType, archName string, archVariant, cpuVariant *string, abi []string) { if targetErr != nil { return } Loading Loading @@ -1358,7 +1358,7 @@ func decodeArchSettings(os OsType, archConfigs []archConfig) ([]Target, error) { for _, config := range archConfigs { arch, err := decodeArch(os, config.arch, &config.archVariant, &config.cpuVariant, &config.abi) &config.cpuVariant, config.abi) if err != nil { return nil, err } Loading @@ -1373,7 +1373,7 @@ func decodeArchSettings(os OsType, archConfigs []archConfig) ([]Target, error) { } // Convert a set of strings from product variables into a single Arch struct func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi *[]string) (Arch, error) { func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi []string) (Arch, error) { stringPtr := func(p *string) string { if p != nil { return *p Loading @@ -1381,13 +1381,6 @@ func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi *[] return "" } slicePtr := func(p *[]string) []string { if p != nil { return *p } return nil } archType, ok := archTypeMap[arch] if !ok { return Arch{}, fmt.Errorf("unknown arch %q", arch) Loading @@ -1397,7 +1390,7 @@ func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi *[] ArchType: archType, ArchVariant: stringPtr(archVariant), CpuVariant: stringPtr(cpuVariant), Abi: slicePtr(abi), Abi: abi, Native: true, } Loading android/config.go +15 −29 Original line number Diff line number Diff line Loading @@ -202,10 +202,10 @@ func TestConfig(buildDir string, env map[string]string) Config { productVariables: productVariables{ DeviceName: stringPtr("test_device"), Platform_sdk_version: intPtr(26), AAPTConfig: &[]string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}, AAPTConfig: []string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}, AAPTPreferredConfig: stringPtr("xhdpi"), AAPTCharacteristics: stringPtr("nosdcard"), AAPTPrebuiltDPI: &[]string{"xhdpi", "xxhdpi"}, AAPTPrebuiltDPI: []string{"xhdpi", "xxhdpi"}, }, buildDir: buildDir, Loading Loading @@ -476,10 +476,7 @@ func (c *config) DeviceName() string { } func (c *config) ResourceOverlays() []string { if c.productVariables.ResourceOverlays == nil { return nil } return *c.productVariables.ResourceOverlays return c.productVariables.ResourceOverlays } func (c *config) PlatformVersionName() string { Loading Loading @@ -544,7 +541,7 @@ func (c *config) PlatformVersionCombinedCodenames() []string { } func (c *config) ProductAAPTConfig() []string { return stringSlice(c.productVariables.AAPTConfig) return c.productVariables.AAPTConfig } func (c *config) ProductAAPTPreferredConfig() string { Loading @@ -556,7 +553,7 @@ func (c *config) ProductAAPTCharacteristics() string { } func (c *config) ProductAAPTPrebuiltDPI() []string { return stringSlice(c.productVariables.AAPTPrebuiltDPI) return c.productVariables.AAPTPrebuiltDPI } func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath { Loading Loading @@ -734,10 +731,10 @@ func (c *config) ArtUseReadBarrier() bool { func (c *config) EnforceRROForModule(name string) bool { enforceList := c.productVariables.EnforceRROTargets if enforceList != nil { if len(*enforceList) == 1 && (*enforceList)[0] == "*" { if len(enforceList) == 1 && (enforceList)[0] == "*" { return true } return InList(name, *enforceList) return InList(name, enforceList) } return false } Loading @@ -745,7 +742,7 @@ func (c *config) EnforceRROForModule(name string) bool { func (c *config) EnforceRROExcludedOverlay(path string) bool { excluded := c.productVariables.EnforceRROExcludedOverlays if excluded != nil { for _, exclude := range *excluded { for _, exclude := range excluded { if strings.HasPrefix(path, exclude) { return true } Loading Loading @@ -830,10 +827,7 @@ func (c *deviceConfig) ExtraVndkVersions() []string { } func (c *deviceConfig) SystemSdkVersions() []string { if c.config.productVariables.DeviceSystemSdkVersions == nil { return nil } return *c.config.productVariables.DeviceSystemSdkVersions return c.config.productVariables.DeviceSystemSdkVersions } func (c *deviceConfig) PlatformSystemSdkVersions() []string { Loading Loading @@ -876,12 +870,12 @@ func (c *deviceConfig) NativeCoverageEnabled() bool { func (c *deviceConfig) CoverageEnabledForPath(path string) bool { coverage := false if c.config.productVariables.CoveragePaths != nil { if PrefixInList(path, *c.config.productVariables.CoveragePaths) { if PrefixInList(path, c.config.productVariables.CoveragePaths) { coverage = true } } if coverage && c.config.productVariables.CoverageExcludePaths != nil { if PrefixInList(path, *c.config.productVariables.CoverageExcludePaths) { if PrefixInList(path, c.config.productVariables.CoverageExcludePaths) { coverage = false } } Loading Loading @@ -962,28 +956,28 @@ func (c *config) IntegerOverflowDisabledForPath(path string) bool { if c.productVariables.IntegerOverflowExcludePaths == nil { return false } return PrefixInList(path, *c.productVariables.IntegerOverflowExcludePaths) return PrefixInList(path, c.productVariables.IntegerOverflowExcludePaths) } func (c *config) CFIDisabledForPath(path string) bool { if c.productVariables.CFIExcludePaths == nil { return false } return PrefixInList(path, *c.productVariables.CFIExcludePaths) return PrefixInList(path, c.productVariables.CFIExcludePaths) } func (c *config) CFIEnabledForPath(path string) bool { if c.productVariables.CFIIncludePaths == nil { return false } return PrefixInList(path, *c.productVariables.CFIIncludePaths) return PrefixInList(path, c.productVariables.CFIIncludePaths) } func (c *config) XOMDisabledForPath(path string) bool { if c.productVariables.XOMExcludePaths == nil { return false } return PrefixInList(path, *c.productVariables.XOMExcludePaths) return PrefixInList(path, c.productVariables.XOMExcludePaths) } func (c *config) VendorConfig(name string) VendorConfig { Loading Loading @@ -1035,11 +1029,3 @@ func (c *config) HiddenAPIFlags() string { func (c *config) HiddenAPIExtraAppUsageJars() []string { return c.productVariables.HiddenAPIExtraAppUsageJars } func stringSlice(s *[]string) []string { if s != nil { return *s } else { return nil } } android/module.go +2 −0 Original line number Diff line number Diff line Loading @@ -481,6 +481,8 @@ type ModuleBase struct { prefer32 func(ctx BaseModuleContext, base *ModuleBase, class OsClass) bool } func (a *ModuleBase) DepsMutator(BottomUpMutatorContext) {} func (a *ModuleBase) AddProperties(props ...interface{}) { a.registerProps = append(a.registerProps, props...) } Loading android/namespace.go +0 −3 Original line number Diff line number Diff line Loading @@ -366,9 +366,6 @@ type NamespaceModule struct { } } func (n *NamespaceModule) DepsMutator(context BottomUpMutatorContext) { } func (n *NamespaceModule) GenerateAndroidBuildActions(ctx ModuleContext) { } Loading android/neverallow_test.go +0 −6 Original line number Diff line number Diff line Loading @@ -222,9 +222,6 @@ func newMockCcLibraryModule() Module { return m } func (p *mockCcLibraryModule) DepsMutator(ctx BottomUpMutatorContext) { } func (p *mockCcLibraryModule) GenerateAndroidBuildActions(ModuleContext) { } Loading @@ -244,8 +241,5 @@ func newMockJavaLibraryModule() Module { return m } func (p *mockJavaLibraryModule) DepsMutator(ctx BottomUpMutatorContext) { } func (p *mockJavaLibraryModule) GenerateAndroidBuildActions(ModuleContext) { } Loading
android/arch.go +4 −11 Original line number Diff line number Diff line Loading @@ -1169,7 +1169,7 @@ func decodeTargetProductVariables(config *config) (map[OsType][]Target, error) { targets := make(map[OsType][]Target) var targetErr error addTarget := func(os OsType, archName string, archVariant, cpuVariant *string, abi *[]string) { addTarget := func(os OsType, archName string, archVariant, cpuVariant *string, abi []string) { if targetErr != nil { return } Loading Loading @@ -1358,7 +1358,7 @@ func decodeArchSettings(os OsType, archConfigs []archConfig) ([]Target, error) { for _, config := range archConfigs { arch, err := decodeArch(os, config.arch, &config.archVariant, &config.cpuVariant, &config.abi) &config.cpuVariant, config.abi) if err != nil { return nil, err } Loading @@ -1373,7 +1373,7 @@ func decodeArchSettings(os OsType, archConfigs []archConfig) ([]Target, error) { } // Convert a set of strings from product variables into a single Arch struct func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi *[]string) (Arch, error) { func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi []string) (Arch, error) { stringPtr := func(p *string) string { if p != nil { return *p Loading @@ -1381,13 +1381,6 @@ func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi *[] return "" } slicePtr := func(p *[]string) []string { if p != nil { return *p } return nil } archType, ok := archTypeMap[arch] if !ok { return Arch{}, fmt.Errorf("unknown arch %q", arch) Loading @@ -1397,7 +1390,7 @@ func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi *[] ArchType: archType, ArchVariant: stringPtr(archVariant), CpuVariant: stringPtr(cpuVariant), Abi: slicePtr(abi), Abi: abi, Native: true, } Loading
android/config.go +15 −29 Original line number Diff line number Diff line Loading @@ -202,10 +202,10 @@ func TestConfig(buildDir string, env map[string]string) Config { productVariables: productVariables{ DeviceName: stringPtr("test_device"), Platform_sdk_version: intPtr(26), AAPTConfig: &[]string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}, AAPTConfig: []string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}, AAPTPreferredConfig: stringPtr("xhdpi"), AAPTCharacteristics: stringPtr("nosdcard"), AAPTPrebuiltDPI: &[]string{"xhdpi", "xxhdpi"}, AAPTPrebuiltDPI: []string{"xhdpi", "xxhdpi"}, }, buildDir: buildDir, Loading Loading @@ -476,10 +476,7 @@ func (c *config) DeviceName() string { } func (c *config) ResourceOverlays() []string { if c.productVariables.ResourceOverlays == nil { return nil } return *c.productVariables.ResourceOverlays return c.productVariables.ResourceOverlays } func (c *config) PlatformVersionName() string { Loading Loading @@ -544,7 +541,7 @@ func (c *config) PlatformVersionCombinedCodenames() []string { } func (c *config) ProductAAPTConfig() []string { return stringSlice(c.productVariables.AAPTConfig) return c.productVariables.AAPTConfig } func (c *config) ProductAAPTPreferredConfig() string { Loading @@ -556,7 +553,7 @@ func (c *config) ProductAAPTCharacteristics() string { } func (c *config) ProductAAPTPrebuiltDPI() []string { return stringSlice(c.productVariables.AAPTPrebuiltDPI) return c.productVariables.AAPTPrebuiltDPI } func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath { Loading Loading @@ -734,10 +731,10 @@ func (c *config) ArtUseReadBarrier() bool { func (c *config) EnforceRROForModule(name string) bool { enforceList := c.productVariables.EnforceRROTargets if enforceList != nil { if len(*enforceList) == 1 && (*enforceList)[0] == "*" { if len(enforceList) == 1 && (enforceList)[0] == "*" { return true } return InList(name, *enforceList) return InList(name, enforceList) } return false } Loading @@ -745,7 +742,7 @@ func (c *config) EnforceRROForModule(name string) bool { func (c *config) EnforceRROExcludedOverlay(path string) bool { excluded := c.productVariables.EnforceRROExcludedOverlays if excluded != nil { for _, exclude := range *excluded { for _, exclude := range excluded { if strings.HasPrefix(path, exclude) { return true } Loading Loading @@ -830,10 +827,7 @@ func (c *deviceConfig) ExtraVndkVersions() []string { } func (c *deviceConfig) SystemSdkVersions() []string { if c.config.productVariables.DeviceSystemSdkVersions == nil { return nil } return *c.config.productVariables.DeviceSystemSdkVersions return c.config.productVariables.DeviceSystemSdkVersions } func (c *deviceConfig) PlatformSystemSdkVersions() []string { Loading Loading @@ -876,12 +870,12 @@ func (c *deviceConfig) NativeCoverageEnabled() bool { func (c *deviceConfig) CoverageEnabledForPath(path string) bool { coverage := false if c.config.productVariables.CoveragePaths != nil { if PrefixInList(path, *c.config.productVariables.CoveragePaths) { if PrefixInList(path, c.config.productVariables.CoveragePaths) { coverage = true } } if coverage && c.config.productVariables.CoverageExcludePaths != nil { if PrefixInList(path, *c.config.productVariables.CoverageExcludePaths) { if PrefixInList(path, c.config.productVariables.CoverageExcludePaths) { coverage = false } } Loading Loading @@ -962,28 +956,28 @@ func (c *config) IntegerOverflowDisabledForPath(path string) bool { if c.productVariables.IntegerOverflowExcludePaths == nil { return false } return PrefixInList(path, *c.productVariables.IntegerOverflowExcludePaths) return PrefixInList(path, c.productVariables.IntegerOverflowExcludePaths) } func (c *config) CFIDisabledForPath(path string) bool { if c.productVariables.CFIExcludePaths == nil { return false } return PrefixInList(path, *c.productVariables.CFIExcludePaths) return PrefixInList(path, c.productVariables.CFIExcludePaths) } func (c *config) CFIEnabledForPath(path string) bool { if c.productVariables.CFIIncludePaths == nil { return false } return PrefixInList(path, *c.productVariables.CFIIncludePaths) return PrefixInList(path, c.productVariables.CFIIncludePaths) } func (c *config) XOMDisabledForPath(path string) bool { if c.productVariables.XOMExcludePaths == nil { return false } return PrefixInList(path, *c.productVariables.XOMExcludePaths) return PrefixInList(path, c.productVariables.XOMExcludePaths) } func (c *config) VendorConfig(name string) VendorConfig { Loading Loading @@ -1035,11 +1029,3 @@ func (c *config) HiddenAPIFlags() string { func (c *config) HiddenAPIExtraAppUsageJars() []string { return c.productVariables.HiddenAPIExtraAppUsageJars } func stringSlice(s *[]string) []string { if s != nil { return *s } else { return nil } }
android/module.go +2 −0 Original line number Diff line number Diff line Loading @@ -481,6 +481,8 @@ type ModuleBase struct { prefer32 func(ctx BaseModuleContext, base *ModuleBase, class OsClass) bool } func (a *ModuleBase) DepsMutator(BottomUpMutatorContext) {} func (a *ModuleBase) AddProperties(props ...interface{}) { a.registerProps = append(a.registerProps, props...) } Loading
android/namespace.go +0 −3 Original line number Diff line number Diff line Loading @@ -366,9 +366,6 @@ type NamespaceModule struct { } } func (n *NamespaceModule) DepsMutator(context BottomUpMutatorContext) { } func (n *NamespaceModule) GenerateAndroidBuildActions(ctx ModuleContext) { } Loading
android/neverallow_test.go +0 −6 Original line number Diff line number Diff line Loading @@ -222,9 +222,6 @@ func newMockCcLibraryModule() Module { return m } func (p *mockCcLibraryModule) DepsMutator(ctx BottomUpMutatorContext) { } func (p *mockCcLibraryModule) GenerateAndroidBuildActions(ModuleContext) { } Loading @@ -244,8 +241,5 @@ func newMockJavaLibraryModule() Module { return m } func (p *mockJavaLibraryModule) DepsMutator(ctx BottomUpMutatorContext) { } func (p *mockJavaLibraryModule) GenerateAndroidBuildActions(ModuleContext) { }