Integrate RELEASE_R8_GLOBAL_CHECK_NOT_NULL_FLAGS into soong
Include the new set of `checknotnull.flags` based on the build flag,
allowing `-convertchecknotnull` R8 optimizations for a class of common
null checks.
Bug: 280633711
Test: build-flag set RELEASE_R8_GLOBAL_CHECK_NOT_NULL_FLAGS && m
Flag: RELEASE_R8_GLOBAL_CHECK_NOT_NULL_FLAGS
Change-Id: Idf015a3ea5bd9f6e11213f683da008b5706668e0
diff --git a/java/dex.go b/java/dex.go
index 64465a2..1a61000 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -362,6 +362,11 @@
android.PathForSource(ctx, "build/make/core/proguard.flags"),
}
+ if ctx.Config().UseR8GlobalCheckNotNullFlags() {
+ flagFiles = append(flagFiles, android.PathForSource(ctx,
+ "build/make/core/proguard/checknotnull.flags"))
+ }
+
flagFiles = append(flagFiles, d.extraProguardFlagsFiles...)
// TODO(ccross): static android library proguard files