Enable R8 code shrinking for system_server by default

Flip the setting that controls R8 shrinking for system_server from
opt-in to opt-out. This can be controlled by vendor makefiles and from
the command-line using the `SYSTEM_OPTIMIZE_JAVA` boolean build flag.

Note that this change only enables code shrinking for system_server,
and should not impact stack traces except for certain stack frames
involving synthetics.

Additional (vendor) code that is loaded dynamically into
system_server, that references system_server code, should use
system_server APIs that are expicitly annotated with
`@android.annotation.SystemApi`.

Additional (vendor) code added directly to services.jar,
which doesn't fall into existing keep patterns in the services
proguard.flags configuration and would otherwise be stripped, should be
annotated with `@com.android.internal.annotations.Keep`.

Results: services.jar (20MB -> 17MB)

Bug: 210510433
Test: atest
  CtsInstalledLoadingProgressHostTests
  CtsAutoFillServiceTestCases
  CtsAppSecurityHostTestCases
  CtsAppTestCases
Change-Id: Icc77c9451d9a4a83e02cb591693354988f8d0ec4
Merged-In: Icc77c9451d9a4a83e02cb591693354988f8d0ec4
1 file changed
tree: 6bee6a5eb7b7b3c7faf67358b950b77b36a46a87
  1. common/
  2. core/
  3. orchestrator/
  4. packaging/
  5. target/
  6. tests/
  7. tools/
  8. .gitignore
  9. banchanHelp.sh
  10. buildspec.mk.default
  11. Changes.md
  12. CleanSpec.mk
  13. Deprecation.md
  14. envsetup.sh
  15. finalize_branch_for_release.sh
  16. help.sh
  17. METADATA
  18. navbar.md
  19. OWNERS
  20. PREUPLOAD.cfg
  21. rbesetup.sh
  22. README.md
  23. tapasHelp.sh
  24. Usage.txt
README.md

Android Make Build System

This is the Makefile-based portion of the Android Build System.

For documentation on how to run a build, see Usage.txt

For a list of behavioral changes useful for Android.mk writers see Changes.md

For an outdated reference on Android.mk files, see build-system.html. Our Android.mk files look similar, but are entirely different from the Android.mk files used by the NDK build system. When searching for documentation elsewhere, ensure that it is for the platform build system -- most are not.

This Makefile-based system is in the process of being replaced with Soong, a new build system written in Go. During the transition, all of these makefiles are read by Kati, and generate a ninja file instead of being executed directly. That's combined with a ninja file read by Soong so that the build graph of the two systems can be combined and run as one.