Fix wrong MarkInstantiatedAction in resource shrinker
Change-Id: Ib4a5718865730c39902b45c664eb8e9b95c4473d
diff --git a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
index 3640796..c78d348 100644
--- a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
+++ b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
@@ -703,7 +703,11 @@
.disallowMinification()
.disallowRepackaging()
.disallowOptimization());
- markClassAsInstantiatedWithReason(clazz, reason);
+ if (clazz.isAnnotation() || clazz.isInterface()) {
+ markTypeAsLive(clazz, reason);
+ } else {
+ markClassAsInstantiatedWithReason(clazz, reason);
+ }
for (ProgramMethod programInstanceInitializer : clazz.programInstanceInitializers()) {
// TODO(b/325884671): Only keep the actually framework targeted constructors.
applyMinimumKeepInfoWhenLiveOrTargeted(