blob: eaeafada190476e9c76870878f3bf6edaa4f1d0f [file] [log] [blame]
Jared Duke0504e562022-02-02 15:25:22 -08001# TODO(b/210510433): Refine and optimize this configuration. Note that this
Jared Duke4514bdf2021-11-18 13:18:21 -08002# configuration is only used when `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA=true`.
Jared Duke4514bdf2021-11-18 13:18:21 -08003
Jared Duke0504e562022-02-02 15:25:22 -08004# Preserve line number information for debugging stack traces.
5-keepattributes SourceFile,LineNumberTable
Jared Dukeedb13392021-12-14 11:10:20 -08006
7# Allows making private and protected methods/fields public as part of
8# optimization. This enables inlining of trivial getter/setter methods.
9-allowaccessmodification
10
Jared Duke0504e562022-02-02 15:25:22 -080011# Process entrypoint
12-keep class com.android.server.SystemServer {
13 public static void main(java.lang.String[]);
Jared Dukeedb13392021-12-14 11:10:20 -080014}
Jared Duke0504e562022-02-02 15:25:22 -080015
16# APIs referenced by dependent JAR files and modules
17-keep @interface android.annotation.SystemApi
18-keep @android.annotation.SystemApi class * {
19 public protected *;
20}
21-keepclasseswithmembers class * {
22 @android.annotation.SystemApi *;
23}
24
25# Derivatives of SystemService and other services created via reflection
26-keep,allowoptimization,allowaccessmodification class * extends com.android.server.SystemService {
27 public <methods>;
28}
29-keep,allowoptimization,allowaccessmodification class * extends com.android.server.devicepolicy.BaseIDevicePolicyManager {
30 public <init>(...);
31}
32-keep,allowoptimization,allowaccessmodification class com.android.server.wallpaper.WallpaperManagerService {
33 public <init>(...);
34}
35
Alan Stokes8c9302c2022-05-06 18:35:12 +010036# Accessed from com.android.compos APEX
37-keep,allowoptimization,allowaccessmodification class com.android.internal.art.ArtStatsLog {
38 public static void write(...);
39}
40
Jared Duke0504e562022-02-02 15:25:22 -080041# Binder interfaces
42-keep,allowoptimization,allowaccessmodification class * extends android.os.IInterface
43-keep,allowoptimization,allowaccessmodification class * extends android.os.IHwInterface
44
45# Global entities normally kept through explicit Manifest entries
46# TODO(b/210510433): Revisit and consider generating from frameworks/base/core/res/AndroidManifest.xml,
47# by including that manifest with the library rule that triggers optimization.
Jared Dukedc50c852022-02-25 13:50:58 -080048-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.Activity
49-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.Service
50-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.backup.BackupAgent
51-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.content.BroadcastReceiver
52-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.content.ContentProvider
53-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.preference.Preference
54-keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.view.View {
55 public <init>(...);
56}
Jared Duke0504e562022-02-02 15:25:22 -080057
58# Various classes subclassed in or referenced via JNI in ethernet-service
59-keep public class android.net.** { *; }
60-keep,allowoptimization,allowaccessmodification class com.android.net.module.util.* { *; }
61-keep,allowoptimization,allowaccessmodification public class com.android.server.net.IpConfigStore { *; }
62-keep,allowoptimization,allowaccessmodification public class com.android.server.net.BaseNetworkObserver { *; }
63
64# Referenced via CarServiceHelperService in car-frameworks-service (avoid removing)
65-keep public class com.android.server.utils.Slogf { *; }
66
67# Notification extractors
68# TODO(b/210510433): Revisit and consider generating from frameworks/base/core/res/res/values/config.xml.
69-keep,allowoptimization,allowaccessmodification public class com.android.server.notification.** implements com.android.server.notification.NotificationSignalExtractor
70
Chris Li61339d82022-06-15 12:07:39 +080071# OEM provided DisplayAreaPolicy.Provider defined in frameworks/base/core/res/res/values/config.xml.
72-keep,allowoptimization,allowaccessmodification class com.android.server.wm.** implements com.android.server.wm.DisplayAreaPolicy$Provider
73
Jared Duke0504e562022-02-02 15:25:22 -080074# JNI keep rules
75# TODO(b/210510433): Revisit and fix with @Keep, or consider auto-generating from
76# frameworks/base/services/core/jni/onload.cpp.
77-keep,allowoptimization,allowaccessmodification class com.android.server.broadcastradio.hal1.BroadcastRadioService { *; }
78-keep,allowoptimization,allowaccessmodification class com.android.server.broadcastradio.hal1.Convert { *; }
79-keep,allowoptimization,allowaccessmodification class com.android.server.broadcastradio.hal1.Tuner { *; }
80-keep,allowoptimization,allowaccessmodification class com.android.server.broadcastradio.hal1.TunerCallback { *; }
81-keep,allowoptimization,allowaccessmodification class com.android.server.location.gnss.GnssConfiguration$HalInterfaceVersion { *; }
82-keep,allowoptimization,allowaccessmodification class com.android.server.location.gnss.GnssPowerStats { *; }
83-keep,allowoptimization,allowaccessmodification class com.android.server.location.gnss.hal.GnssNative { *; }
Jared Dukedc50c852022-02-25 13:50:58 -080084-keep,allowoptimization,allowaccessmodification class com.android.server.pm.PackageManagerShellCommandDataLoader { *; }
Jared Duke0504e562022-02-02 15:25:22 -080085-keep,allowoptimization,allowaccessmodification class com.android.server.sensors.SensorManagerInternal$ProximityActiveListener { *; }
86-keep,allowoptimization,allowaccessmodification class com.android.server.sensors.SensorService { *; }
87-keep,allowoptimization,allowaccessmodification class com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareImpl$AudioSessionProvider$AudioSession { *; }
88-keep,allowoptimization,allowaccessmodification class com.android.server.soundtrigger_middleware.ExternalCaptureStateTracker { *; }
89-keep,allowoptimization,allowaccessmodification class com.android.server.storage.AppFuseBridge { *; }
90-keep,allowoptimization,allowaccessmodification class com.android.server.tv.TvInputHal { *; }
91-keep,allowoptimization,allowaccessmodification class com.android.server.usb.UsbAlsaJackDetector { *; }
92-keep,allowoptimization,allowaccessmodification class com.android.server.usb.UsbMidiDevice { *; }
93-keep,allowoptimization,allowaccessmodification class com.android.server.vibrator.VibratorController$OnVibrationCompleteListener { *; }
94-keep,allowoptimization,allowaccessmodification class com.android.server.vibrator.VibratorManagerService$OnSyncedVibrationCompleteListener { *; }
95-keepclasseswithmembers,allowoptimization,allowaccessmodification class com.android.server.** {
96 *** *FromNative(...);
97}
98-keep,allowoptimization,allowaccessmodification class com.android.server.input.InputManagerService {
99 <methods>;
100}
101-keep,allowoptimization,allowaccessmodification class com.android.server.usb.UsbHostManager {
102 *** usbDeviceRemoved(...);
103 *** usbDeviceAdded(...);
104}
105-keep,allowoptimization,allowaccessmodification class **.*NativeWrapper* { *; }
106
107# Miscellaneous reflection keep rules
108# TODO(b/210510433): Revisit and fix with @Keep.
109-keep,allowoptimization,allowaccessmodification class com.android.server.usage.AppStandbyController {
110 public <init>(...);
111}
112-keep,allowoptimization,allowaccessmodification class android.hardware.usb.gadget.** { *; }
113
114# Needed when optimizations enabled
115# TODO(b/210510433): Revisit and fix with @Keep.
116-keep,allowoptimization,allowaccessmodification class com.android.server.SystemService { *; }
117-keep,allowoptimization,allowaccessmodification class com.android.server.SystemService$TargetUser { *; }
118-keep,allowoptimization,allowaccessmodification class com.android.server.usage.StorageStatsManagerLocal { *; }
119-keep,allowoptimization,allowaccessmodification class com.android.internal.util.** { *; }
120-keep,allowoptimization,allowaccessmodification class android.os.** { *; }
Michael Bestas81f54422022-08-25 05:10:15 +0300121
122# SDK
123-keep,allowoptimization,allowaccessmodification class lineageos.** { *; }
124-keep,allowoptimization,allowaccessmodification class org.lineageos.** { *; }
Michael Bestasb1f18c62023-05-21 20:16:09 +0300125-keep,allowoptimization,allowaccessmodification class vendor.lineage.** { *; }