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
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
This goal doesn't exist anymore. The build system automatically
translates it to "sdk".
Test: m win_sdk dist && inspect out/dist/apistubs
Change-Id: Ifc4fb07ce32ef21906e8bb8eae0003b1486a525a
The initial selection toolbar related architecture. Render service
part and the implementation will be revised in the follow up changes.
Bug: 190030331
Bug: 205822301
Test: manual. Can boot to home and get manager successfully.
Ignore-AOSP-First: new file for T
Change-Id: Iab5d5f2e5e48e6258a63fb0c479194c958ea61e8
Introduce a set of optional Java optimization and shrinking settings for
system server, based on the Soong variable added in aosp/1896612.
Opting in to optimizations can be achieved with either:
* Env:
export SYSTEM_OPTIMIZE_JAVA=true
* Make:
$(call add_soong_config_var_value,ANDROID,SYSTEM_OPTIMIZE_JAVA,true)
Note that the initial Proguard configuration is extremely conservative.
Follow-up work will refine the rules to both allow additional shrinking
while avoiding developer friction and overhead when adding services and
dynamically loaded jars.
As these optimiations can change the resulting stack traces, a parallel
effort is working to simplify retracing of stack traces for more
accurate debugging and diagnostics. Additional stabiliation and testing
will occur before any effort to enable these optimizations by default
for specific targets. Also note that there are no plans to enable
obfuscation for any of these targets.
Preliminary results:
* Conservative keep rules (this CL w/ opt-in flag):
* services.jar (19MB -> 15MB)
* services.odex (52MB -> 54MB) (mostly from increased inlining)
* Refined keep rules (follow-up CL):
* services.jar (19MB -> 12MB)
* services.odex (52MB -> 45MB)
Bug: 203088572
Test: SYSTEM_OPTIMIZE_JAVA=true m (validate services.jar/odex change)
Change-Id: I4130233310323611f63cd9bfcc0646080cf95875
Introduce a lint detector that finds the following issues:
1. Unused token of Binder.clearCallingIdentity()
- The token from Binder.clearCallingIdentity() has to be used in
Binder.restoreCallingIdentity().
2. Non-final token of Binder.clearCallingIdentity()
- The variable assigned to the result of Binder.clearCallingIdentity()
has to be final to prevent it from being overwritten.
3. Nested calls of Binder.clearCallingIdentity()
- The identity can be cleared again once it has been restored with the
result of the first call of Binder.clearCallingIdentity().
4. Binder.restoreCallingIdentity() is not in finally block
- Binder.restoreCallingIdentity() has to be in finally block to prevent
the calling application from running with the system identity.
5. Use of caller-aware methods after Binder.clearCallingIdentity()
- Caller-aware methods use the caller's identity to perform operations,
so after Binder.clearCallingIdentity() these methods will be using the
sysem identity instead of the original caller's identity.
The lint check is enabled on platform_service_defaults, which means it
will be enabled on all "services.XXX" modules. The linter issues
encountered in existing code are reported in the hotlist
"security_checker_bugs" (b/hotlists/3279139).
To compile a lint report, pick a service (e.g services.accessibility),
run the test command and view it as lint-report.html. The lint report
won't be generated if you just build the module (i.e m
services.accessibility won't produce the lint report).
Lint report can be found in out/soong/.intermediates/frameworks/base/services/accessibility/services.accessibility/android_common/lint
All tests pass in gradle, but need to run on Soong when it's implemented
(b/162368644).
Bug: 157626959
Test: m out/soong/.intermediates/frameworks/base/services/accessibility/services.accessibility/android_common/lint/lint-report.html
Test: google-chrome out/soong/.intermediates/frameworks/base/services/accessibility/services.accessibility/android_common/lint/lint-report.html
Test: ./gradlew test
Change-Id: I9814e9fbc36989c816900d900c6adec3e07802f7
The services/api/{current,removed,lint-baseline}.txt files used to
contain information for the merged system server stubs. Those files are
now created by the rules in api/Android.bp
('services-system-server-current.txt' and 'services-system-server-removed.txt').
Test: m checkapi
Bug: 177640454
Change-Id: I365be0a45126a6a056d5219e24ef93020c034c87
Use the stubs obtained by merging the system server stubs from
non updatable code in the system server, and the system server apis
exposed by mainline modules in SYSTEMSERVERCLASSPATH.
Test: builds
Bug: 177640454
Change-Id: I3687aeb0a4905418d07c819f1091266aaf708558
This thin AOSP service layer will trampoline all API calls to the vendor
UWB service.
In follow up CL's,
i. The AOSP service will perform all the permission checks
necessary for this API surface before forwarding the call to the vendor
UWB service.
ii. Similarly, it will perform necessary permission checks +
noteOp before forwarding the ranging callbacks from the vendor service
back to the apps.
Bug: 183904955
Test: atest android.uwb.cts.UwbManagerTest
Test: atest com.android.server.uwb
Change-Id: I2b367d1b6accc2f4e075cacb5c8e3c51f1faf5db