Ensure line numbers are preserved in default Proguard config
Explicitly keep the `LineNumberTable,SourceFile` attributes, ensuring
positional information is preserved for stack traces. While this isn't
required in R8's Proguard compat mode (still the default in soong), it
is needed for R8's full mode or when optimizations are enabled.
Bug: 215530220
Test: m
Change-Id: If1994e92f694c1a82317d79267714ad8114f3d99
diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags
index f9d2d30..7e7b270 100644
--- a/core/proguard_basic_keeps.flags
+++ b/core/proguard_basic_keeps.flags
@@ -2,6 +2,9 @@
# that isn't explicitly part of the API
-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
+# Preserve line number information for debugging stack traces.
+-keepattributes SourceFile,LineNumberTable
+
# Annotations are implemented as attributes, so we have to explicitly keep them.
# Keep all runtime-visible annotations like RuntimeVisibleParameterAnnotations
# and RuntimeVisibleTypeAnnotations, as well as associated defaults.