From f0581e65beef95eac4dc33734718f77052da2148 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Fri, 9 Feb 2024 00:14:25 +0000 Subject: [PATCH] proguard: add keep rules for @TestApi Test: build Bug: 319319578 Change-Id: I739a80c66de57d0ce68624246613722edf2d106f --- core/proguard.flags | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/proguard.flags b/core/proguard.flags index 9cbba0f317..aa406b983e 100644 --- a/core/proguard.flags +++ b/core/proguard.flags @@ -15,6 +15,13 @@ @com.android.internal.annotations.VisibleForTesting *; } +# Keep classes and members with platform @TestApi annotations, similar to +# @VisibleForTesting. +-keep @android.annotation.TestApi class * +-keepclassmembers class * { + @android.annotation.TestApi *; +} + # Keep classes and members with non-platform @VisibleForTesting annotations, but # only within platform-defined packages. This avoids keeping external, library-specific # test code that isn't actually needed for platform testing.