diff options
| author | 2021-12-15 18:36:53 +0000 | |
|---|---|---|
| committer | 2021-12-15 18:36:53 +0000 | |
| commit | 2012ff720262f7ac8eb92cc2bc91c4a9bf7f31c7 (patch) | |
| tree | 55c0dce29f152cdf35e45d42e2ba2e352d421164 | |
| parent | b6d0f141fdb58d46a1c000e020d0cd9d0f40ad04 (diff) | |
| parent | 2fee7409a22c23f4d75034ae697051d9aade6578 (diff) | |
Merge "Allow flag-guarded Java optimizations for SystemUI"
| -rw-r--r-- | packages/SystemUI/Android.bp | 33 | ||||
| -rw-r--r-- | packages/SystemUI/proguard.flags | 12 |
2 files changed, 36 insertions, 9 deletions
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp index 2f117fc72468..559c31a92004 100644 --- a/packages/SystemUI/Android.bp +++ b/packages/SystemUI/Android.bp @@ -234,9 +234,36 @@ android_library { plugins: ["dagger2-compiler"], } +soong_config_module_type_import { + from: "frameworks/base/services/Android.bp", + module_types: ["system_optimized_java_defaults"], +} + +system_optimized_java_defaults { + name: "SystemUI_app_defaults", + soong_config_variables: { + SYSTEM_OPTIMIZE_JAVA: { + optimize: { + enabled: true, + optimize: true, + shrink: true, + proguard_flags_files: ["proguard.flags"], + }, + conditions_default: { + optimize: { + proguard_flags_files: ["proguard.flags"], + }, + }, + }, + }, +} + android_app { name: "SystemUI", - defaults: ["platform_app_defaults"], + defaults: [ + "platform_app_defaults", + "SystemUI_app_defaults", + ], static_libs: [ "SystemUI-core", ], @@ -247,10 +274,6 @@ android_app { certificate: "platform", privileged: true, - optimize: { - proguard_flags_files: ["proguard.flags"], - }, - kotlincflags: ["-Xjvm-default=enable"], dxflags: ["--multi-dex"], diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags index 3517ebae10bf..ce63b446efb7 100644 --- a/packages/SystemUI/proguard.flags +++ b/packages/SystemUI/proguard.flags @@ -33,10 +33,14 @@ *; } --keep class com.android.systemui.dagger.GlobalRootComponent { *; } --keep class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { *; } --keep class com.android.systemui.dagger.Dagger** { *; } --keep class com.android.systemui.tv.Dagger** { *; } +-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent { !synthetic *; } +-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { !synthetic *; } +-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; } +-keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; } + +# Allows proguard to make private and protected methods and fields public as +# part of optimization. This lets proguard inline trivial getter/setter methods. +-allowaccessmodification # Removes runtime checks added through Kotlin to JVM code genereration to # avoid linear growth as more Kotlin code is converted / added to the codebase. |