The permission and app op subsystems turned out to have a lot more
hidden references throughout the system server and it's infeasible to
define system APIs for all those references in U. So to allow
utilizing the new unified subsystem for them, we need to keep the new
subsystem in the non-updatable platform for now.
The Kotlin usage for the new subsystem was approved for the APEX
system server JAR inside Permission Mainline module, and we can
achieve the same criteria with a standalone Java library module in the
non-updatable platform, so that Kotlin is still jarjar'ed, shrunk and
only available within this module.
A caveat is that because R8 converts Java byte code to Dalvik byte
code, it can only be run when producing the final services.jar,
instead of directly when compiling this new java_library_static
module. Fortunately, services.jar has already enabled R8 shrinking
when SYSTEM_OPTIMIZE_JAVA is enabled, and when it's disabled due to
dependent JARs, we can still safely confine the shrinking within the
new module with a negated rule since no other JARs can depend on the
new code.
The BloatBuster check showed that on AAOS (with SYSTEM_OPTIMIZE_JAVA
disabled), the size of services.odex increased by 1 MB (21.3 MB ->
22.4 MB), but looking at installed-files.json from its build output,
the size of services.jar actually decreased by 2 MB (21.8 MB -> 19.4
MB). Since both of them are pinned in memory, and the new ODEX will
actually have better performance due to better optimization, it's
still a net improvement from the current situation. More details about
this is available at b/258943585#comment14.
An alternative is to create a standalone system server JAR that's also
loaded into SSCP. However, that approach is said to be causing a
slight boot time regression in b/155631167.
Bug: 182523293
Test: presubmit
Test: AyeAye BloatBuster
Test: CtsStrictJavaPackagesTestCases
Change-Id: Id35e19b941e9abbba0d039f993bbf4ec183554ab
Previously there was a plan to move the backup encryption logic to the
framework. However this plan was abandoned and encryption logic lives in
GMS now. This code is unused and out of date.
I'm removing this now because it blocks ag/19967045.
Test: m
atest BackupFrameworksServicesRoboTests
atest CtsBackupHostTestCases
Bug: 210083465
Change-Id: Ib5dc37898fde5c8ef9ea792931404a1915eda8aa
The CredentialManager module provides solution for developers to create
or get credential from a user that can be used to authenticate to the app.
It can potentially launch system level UI flows to collect user consent,
render a unified selector when more than one credential exists, and
perform anything else needed.
Check bug id for detailed design.
Note that this is still very early stage of productionizing the module
and proper test cases will be added subsequently when the service
gets more concrete business logic.
Bug: 246564035
CTS-Coverage-Bug: 246637346
Test: Local Build & Deployment
Change-Id: Ia5884a7f6a3908de3b8b4b29f154f98e25730bd7
Treating warnings as failures avoids unexpected issues at build and
runtime, particularly for missing class references. Unblock this by
adding explicit top-level references to several stub classes, and
suppressing a warning for optional jacococ class references (guarded
by a runtime check in CoverageService).
Test: m services (also w/ EMMA_INSTRUMENT(_FRAMEWORK)=true)
Bug: 242088131
Change-Id: Iee02a30eeccdcf785e90438d1557867ffda659e7
This reverts commit ade911b9c7.
Reason for revert: The feature is planned to run a study in QPR1
with the aim of launching in QPR-2. The code will be removed from
build time before QPR1 finalized.
Change-Id: Ida04260a1196121bb4084b527216aae1e4e6ec54
The checks in BinderIdentityTokenChecker are implemented in
AndroidFrameworkLintChecker in frameworks/base/tools/lint.
Bug: 157626959
Test: atest error_prone_android_framework_test
Test: m framework-minus-apex
Change-Id: Iac9128dbc7e915a12080e41a66d19f9390e4b58a
services.speech-sources had no files in it,
so services.speech was just being built as
an empty jar file.
Bug: 210751803
Test: m services.speech && unzip out/target/product/generic_arm64/obj/JAVA_LIBRARIES/services.speech_intermediates/javalib.jar produces "zipfile is empty"
Change-Id: Id98db9ee98d71f639ef6104ad7fece92940944a9
The feature punts to QPR so disable or remove code from the build
time.
Bug: 222185402
Test: build pass and can boot to home
Test: make sure the toolbar using local implementation
Change-Id: Idad82c3c46ddce0731a26f4599de01eecb0e52c3
Reorganize networkstats JNI so it can be included in the connectivity
module.
Bug: 197717846
Test: m
Change-Id: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
Merged-In: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
For the initial rollout of system_server R8 optimizations, we will
only apply code shrinking. This avoids the need for retracing in core
developer workflows, while providing modest benefits through code
shrinking.
Shrinking is still enabled in an opt-in basis for specific devices
via `SYSTEM_OPTIMIZE_JAVA=true`.
Bug: 210510433
Test: m SYSTEM_OPTIMIZE_JAVA=true
Change-Id: Ie9fb8138afd0cc60799e3154c709630a947968c0
Reorganize networkstats JNI so it can be included in the connectivity
module.
Bug: 197717846
Test: m
Change-Id: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
These are almost certainly all bugs. Removing them and enabling the
errorprone warning as an error going forward will hopefully avoid
further instances creeping in to the code base.
Bug: 217923092
Test: atest AdbDebuggingManagerTest AppTransitionControllerTest
errorprone build
Change-Id: I51fb57024eb19f1b4c96b2033bbafdb610ef2ebb
Objects.equals uses reference equality, we actually want the equality of
the contents.
Bug: 217923092
Test: errorprone build
Change-Id: Idd9f515c23c6fa322b1e24101a390923993bc3dc
This lets us make the errorprone warning an error, prevent erroneous
future instances.
Bug: 217923092
Test: errorprone build
Change-Id: I600ec645fafbdb550c8d3a11b6c877a32aa454fb
The format string had an extra '%s' which was presumably for the
Exception string, but Slog.e already captures that.
Bug: 217923092
Test: errorprone build
Change-Id: I523bd94b65f00bc0332a2c3e3c8ed28de2df1974
The hashCode method on arrays does not actually hash the array contents
but instead is just the identity of the array itself. This will return
erroneous results for objects that are equal but not the exact same
instance.
Bug: 217923092
Test: errorprone build
Change-Id: Idfcc220da5fb07a9b24a7b12795466303b14e35a
Hashtable#contains(String) is actually pre-generics method that maps to
Hashtable#containsValue(V). In this case, PermissionManagerService
actually wants to know if it contains a given key as the values in the
map are not Strings at all.
Bug: 217923092
Test: errorprone build
Change-Id: I1f315d1051aaab3831eaca34e12fc9858ee9aeda
ActivityManagerServiceUtilsTest was checking to make sure its test
method would actually validate input and correctly fail. Unfortunately,
it also caught the AssertionError for the test _actually_ failing.
Bug: 217923092
Test: errorprone build
ActivityManagerUtilsTest#testCheckShouldSamplePackage
Change-Id: Icd5a62c470b0f3d15de65f4b43d4355ba9c4661c
If there's no ActiveAdmin for the given user then the ternary
expression would return null, which immediately will throw an NPE as it
gets auto-unboxed into from Boolean to boolean.
Bug: 217923092
Test: errorprone build
Change-Id: I4043f0061e5a23e4d5aa408917f6d51b8bbf22ec
Have BpfInterfaceMapUpdater to update bpf interface map: adding
the interface and index mapping to bpf interface map when interface
added.
Bug: 215095957
Test: atest FrameworkNetTests
Change-Id: I2189a50c4869cfc0c33fc6f0228f40ee9f3ac1d4