Fix the flaky build breakage for droiddoc target.

ExpandSourcesSubDir was calling SourceFileProducer.Srcs(), and then
doing:
moduleSrcs = append(moduleSrcs[:j], moduleSrcs[j+1:]...)
This modifies the backing store of the slice, which may affect the
original data stored in the SourceFileProducer.  Make all Srcs
implementations return slice that points to a copy of the backing
array.

Test: m out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp
Bug: b/76179848 b/76397326
Change-Id: I2432ce196984814daafc5aa9a2746e81de74494c
Merged-In: I2432ce196984814daafc5aa9a2746e81de74494c
(cherry picked from commit e42777a05a)
This commit is contained in:
Nan Zhang
2018-03-27 16:19:42 -07:00
committed by Colin Cross
parent 0a7d85a896
commit 2e9f9a2220
3 changed files with 3 additions and 3 deletions

View File

@@ -180,7 +180,7 @@ type CompiledInterface interface {
}
func (compiler *baseCompiler) Srcs() android.Paths {
return compiler.srcs
return append(android.Paths{}, compiler.srcs...)
}
func (compiler *baseCompiler) appendCflags(flags []string) {