Skip to content

Commit 91bc6c2

Browse files
committed
Explicitly keep default constructor in rules without members
R8 implicitly keeps the default constructor when no member rules are specified. Future versions of R8 will require apps to explicitly keep the default constructors that are required for the build to work. This conservatively changes all keep rules that currently keep the default constructor to explicitly keep the default constructor. Future work will attempt to tighten up the rules that do not require the default constructor to be kept. Bug: 373579455 Test: existing Change-Id: Idbadcd81d516f851cc9bfa1333d76f1036803291
1 parent d4249b4 commit 91bc6c2

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

java/proguard.flags

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Keep classes and methods that have the @UsedForTesting annotation
2-
-keep @com.android.inputmethod.annotations.UsedForTesting class *
2+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
3+
-keep @com.android.inputmethod.annotations.UsedForTesting class * {
4+
void <init>();
5+
}
36
-keepclassmembers class * {
47
@com.android.inputmethod.annotations.UsedForTesting *;
58
}
69

710
# Keep classes and methods that have the @ExternallyReferenced annotation
8-
-keep @com.android.inputmethod.annotations.ExternallyReferenced class *
11+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
12+
-keep @com.android.inputmethod.annotations.ExternallyReferenced class * {
13+
void <init>();
14+
}
915
-keepclassmembers class * {
1016
@com.android.inputmethod.annotations.ExternallyReferenced *;
1117
}
@@ -17,11 +23,26 @@
1723

1824
# Keep classes that are used as a parameter type of methods that are also marked as keep
1925
# to preserve changing those methods' signature.
20-
-keep class com.android.inputmethod.latin.AssetFileAddress
21-
-keep class com.android.inputmethod.latin.Dictionary
22-
-keep class com.android.inputmethod.latin.NgramContext
23-
-keep class com.android.inputmethod.latin.makedict.ProbabilityInfo
24-
-keep class com.android.inputmethod.latin.utils.LanguageModelParam
26+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
27+
-keep class com.android.inputmethod.latin.AssetFileAddress {
28+
void <init>();
29+
}
30+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
31+
-keep class com.android.inputmethod.latin.Dictionary {
32+
void <init>();
33+
}
34+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
35+
-keep class com.android.inputmethod.latin.NgramContext {
36+
void <init>();
37+
}
38+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
39+
-keep class com.android.inputmethod.latin.makedict.ProbabilityInfo {
40+
void <init>();
41+
}
42+
# TODO(b/373579455): Evaluate if <init> needs to be kept.
43+
-keep class com.android.inputmethod.latin.utils.LanguageModelParam {
44+
void <init>();
45+
}
2546

2647
# TODO: remove once used in code.
2748
-keep class com.android.inputmethod.keyboard.KeyboardLayout { *; }

0 commit comments

Comments
 (0)