Convert ModuleProvder to generic providers API
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.
Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
diff --git a/bloaty/bloaty.go b/bloaty/bloaty.go
index 29a1460..43fb71d 100644
--- a/bloaty/bloaty.go
+++ b/bloaty/bloaty.go
@@ -85,10 +85,10 @@
func (singleton *sizesSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var deps android.Paths
ctx.VisitAllModules(func(m android.Module) {
- if !ctx.ModuleHasProvider(m, fileSizeMeasurerKey) {
+ filePaths, ok := android.SingletonModuleProvider(ctx, m, fileSizeMeasurerKey)
+ if !ok {
return
}
- filePaths := ctx.ModuleProvider(m, fileSizeMeasurerKey).(measuredFiles)
for _, path := range filePaths.paths {
filePath := path.(android.ModuleOutPath)
sizeFile := filePath.InSameDir(ctx, filePath.Base()+bloatyDescriptorExt)