Do not enable AFDO if the option is off, even if there is a profile file

The behaviour is accidentally changed during the Bazel migration.

Test: m
Change-Id: I44158f2518776c68938ad2ddab01431005a333b0
This commit is contained in:
Yi Kong 2023-07-27 14:04:05 +09:00
parent f97a42e5f2
commit 2dbe160d1a

View file

@ -131,6 +131,10 @@ func (c *Module) fdoProfileMutator(ctx android.BottomUpMutatorContext) {
return return
} }
if !c.afdo.afdoEnabled() {
return
}
ctx.VisitDirectDepsWithTag(FdoProfileTag, func(m android.Module) { ctx.VisitDirectDepsWithTag(FdoProfileTag, func(m android.Module) {
if ctx.OtherModuleHasProvider(m, FdoProfileProvider) { if ctx.OtherModuleHasProvider(m, FdoProfileProvider) {
info := ctx.OtherModuleProvider(m, FdoProfileProvider).(FdoProfileInfo) info := ctx.OtherModuleProvider(m, FdoProfileProvider).(FdoProfileInfo)