From 0cc5facf79edb5704212fce744ecfba0a5fa5bfc Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 18 Jul 2022 14:41:23 -0700 Subject: [PATCH] Remove obsolete notice property. Bug: 192434786 Test: m droid dist Change-Id: I0f384ae895cebab9732448b82db600c67eb8f711 --- android/androidmk.go | 4 ---- android/module.go | 22 ---------------------- android/neverallow.go | 10 ---------- apex/androidmk.go | 4 ---- apex/apex_test.go | 2 -- apex/vndk_test.go | 1 - cc/testing.go | 4 ---- cc/vndk.go | 14 -------------- 8 files changed, 61 deletions(-) diff --git a/android/androidmk.go b/android/androidmk.go index d6fe06d93..006e43def 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -604,10 +604,6 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint } } - if len(base.noticeFiles) > 0 { - a.AddStrings("LOCAL_NOTICE_FILE", strings.Join(base.noticeFiles.Strings(), " ")) - } - if host { makeOs := base.Os().String() if base.Os() == Linux || base.Os() == LinuxBionic || base.Os() == LinuxMusl { diff --git a/android/module.go b/android/module.go index 7173c0d3c..4dbfdd318 100644 --- a/android/module.go +++ b/android/module.go @@ -515,7 +515,6 @@ type Module interface { ExportedToMake() bool InitRc() Paths VintfFragments() Paths - NoticeFiles() Paths EffectiveLicenseFiles() Paths AddProperties(props ...interface{}) @@ -831,9 +830,6 @@ type commonProperties struct { // names of other modules to install on target if this module is installed Target_required []string `android:"arch_variant"` - // relative path to a file to include in the list of notices for the device - Notice *string `android:"path"` - // The OsType of artifacts that this module variant is responsible for creating. // // Set by osMutator @@ -1423,7 +1419,6 @@ type ModuleBase struct { checkbuildFiles Paths packagingSpecs []PackagingSpec packagingSpecsDepSet *packagingSpecsDepSet - noticeFiles Paths // katiInstalls tracks the install rules that were created by Soong but are being exported // to Make to convert to ninja rules so that Make can add additional dependencies. katiInstalls katiInstalls @@ -2054,10 +2049,6 @@ func (m *ModuleBase) Owner() string { return String(m.commonProperties.Owner) } -func (m *ModuleBase) NoticeFiles() Paths { - return m.noticeFiles -} - func (m *ModuleBase) setImageVariation(variant string) { m.commonProperties.ImageVariation = variant } @@ -2317,19 +2308,6 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) } }) - m.noticeFiles = make([]Path, 0) - optPath := OptionalPath{} - notice := proptools.StringDefault(m.commonProperties.Notice, "") - if module := SrcIsModule(notice); module != "" { - optPath = ctx.ExpandOptionalSource(¬ice, "notice") - } else if notice != "" { - noticePath := filepath.Join(ctx.ModuleDir(), notice) - optPath = ExistentPathForSource(ctx, noticePath) - } - if optPath.Valid() { - m.noticeFiles = append(m.noticeFiles, optPath.Path()) - } - licensesPropertyFlattener(ctx) if ctx.Failed() { return diff --git a/android/neverallow.go b/android/neverallow.go index 357cae5b7..aa47bcaeb 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -58,7 +58,6 @@ func init() { AddNeverAllowRules(createMakefileGoalRules()...) AddNeverAllowRules(createInitFirstStageRules()...) AddNeverAllowRules(createProhibitFrameworkAccessRules()...) - AddNeverAllowRules(createNoticeDeprecationRules()...) } // Add a NeverAllow rule to the set of rules to apply. @@ -239,15 +238,6 @@ func createProhibitFrameworkAccessRules() []Rule { } } -func createNoticeDeprecationRules() []Rule { - return []Rule{ - NeverAllow(). - WithMatcher("notice", isSetMatcherInstance). - NotIn("vendor/linaro/linux-firmware/"). - Because("notice has been replaced by licenses/default_applicable_licenses"), - } -} - func neverallowMutator(ctx BottomUpMutatorContext) { m, ok := ctx.Module().(Module) if !ok { diff --git a/apex/androidmk.go b/apex/androidmk.go index 938c8edd3..3373211a0 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -168,10 +168,6 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo if len(newDataPaths) > 0 { fmt.Fprintln(w, "LOCAL_TEST_DATA :=", strings.Join(android.AndroidMkDataPaths(newDataPaths), " ")) } - - if fi.module != nil && len(fi.module.NoticeFiles()) > 0 { - fmt.Fprintln(w, "LOCAL_NOTICE_FILE :=", strings.Join(fi.module.NoticeFiles().Strings(), " ")) - } } else { modulePath = pathWhenActivated fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", pathWhenActivated) diff --git a/apex/apex_test.go b/apex/apex_test.go index 69205f846..52829417d 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -443,7 +443,6 @@ func TestBasicApex(t *testing.T) { srcs: ["mylib.cpp"], system_shared_libs: [], stl: "none", - notice: "custom_notice", static_libs: ["libstatic"], // TODO: remove //apex_available:platform apex_available: [ @@ -467,7 +466,6 @@ func TestBasicApex(t *testing.T) { srcs: ["mylib.cpp"], system_shared_libs: [], stl: "none", - notice: "custom_notice_for_static_lib", // TODO: remove //apex_available:platform apex_available: [ "//apex_available:platform", diff --git a/apex/vndk_test.go b/apex/vndk_test.go index d580e5aa6..21526c3eb 100644 --- a/apex/vndk_test.go +++ b/apex/vndk_test.go @@ -86,7 +86,6 @@ func TestVndkApexUsesVendorVariant(t *testing.T) { }, system_shared_libs: [], stl: "none", - notice: "custom_notice", } ` + vndkLibrariesTxtFiles("current") diff --git a/cc/testing.go b/cc/testing.go index 6b858d593..d70ec9bb5 100644 --- a/cc/testing.go +++ b/cc/testing.go @@ -194,7 +194,6 @@ func commonDefaultModules() string { native_coverage: false, system_shared_libs: [], stl: "none", - notice: "custom_notice", } cc_library { name: "libprofile-clang-extras", @@ -205,7 +204,6 @@ func commonDefaultModules() string { native_coverage: false, system_shared_libs: [], stl: "none", - notice: "custom_notice", } cc_library { name: "libprofile-extras_ndk", @@ -214,7 +212,6 @@ func commonDefaultModules() string { native_coverage: false, system_shared_libs: [], stl: "none", - notice: "custom_notice", sdk_version: "current", } cc_library { @@ -224,7 +221,6 @@ func commonDefaultModules() string { native_coverage: false, system_shared_libs: [], stl: "none", - notice: "custom_notice", sdk_version: "current", } diff --git a/cc/vndk.go b/cc/vndk.go index bf6148b1c..4cd4d4273 100644 --- a/cc/vndk.go +++ b/cc/vndk.go @@ -671,12 +671,8 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex snapshotArchDir := filepath.Join(snapshotDir, ctx.DeviceConfig().DeviceArch()) configsDir := filepath.Join(snapshotArchDir, "configs") - noticeDir := filepath.Join(snapshotArchDir, "NOTICE_FILES") includeDir := filepath.Join(snapshotArchDir, "include") - // set of notice files copied. - noticeBuilt := make(map[string]bool) - // paths of VNDK modules for GPL license checking modulePaths := make(map[string]string) @@ -762,16 +758,6 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex moduleNames[stem] = ctx.ModuleName(m) modulePaths[stem] = ctx.ModuleDir(m) - if len(m.NoticeFiles()) > 0 { - noticeName := stem + ".txt" - // skip already copied notice file - if _, ok := noticeBuilt[noticeName]; !ok { - noticeBuilt[noticeName] = true - snapshotOutputs = append(snapshotOutputs, combineNoticesRule( - ctx, m.NoticeFiles(), filepath.Join(noticeDir, noticeName))) - } - } - if ctx.Config().VndkSnapshotBuildArtifacts() { headers = append(headers, m.SnapshotHeaders()...) }