diff options
Diffstat (limited to 'cc/vndk.go')
-rw-r--r-- | cc/vndk.go | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -334,16 +334,24 @@ func processVndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { } } -func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool { +// Sanity check for modules that mustn't be VNDK +func shouldSkipVndkMutator(m *Module) bool { if !m.Enabled() { - return false + return true } - - if !mctx.Device() { - return false + if !m.Device() { + // Skip non-device modules + return true } - if m.Target().NativeBridge == android.NativeBridgeEnabled { + // Skip native_bridge modules + return true + } + return false +} + +func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool { + if shouldSkipVndkMutator(m) { return false } @@ -377,11 +385,8 @@ func VndkMutator(mctx android.BottomUpMutatorContext) { if !ok { return } - if !m.Enabled() { - return - } - if m.Target().NativeBridge == android.NativeBridgeEnabled { - // Skip native_bridge modules + + if shouldSkipVndkMutator(m) { return } |