• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# TODO(b/210510433): Refine and optimize this configuration. Note that this
2# configuration is only used when `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA=true`.
3
4# Preserve line number information for debugging stack traces.
5-keepattributes SourceFile,LineNumberTable
6
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
11# Process entrypoint
12-keep class com.android.server.SystemServer {
13  public static void main(java.lang.String[]);
14}
15
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
36# Accessed from com.android.compos APEX
37-keep,allowoptimization,allowaccessmodification class com.android.internal.art.ArtStatsLog {
38   public static void write(...);
39}
40
41# 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.
48-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}
57
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
71# 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
74# 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 { *; }
84-keep,allowoptimization,allowaccessmodification class com.android.server.pm.PackageManagerShellCommandDataLoader { *; }
85-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.** { *; }
121