Commit Graph

195 Commits

Author SHA1 Message Date
Treehugger Robot
4a346a16ed Merge "Treat R8 warnings as failures for system_server" am: 1f440e7a62 am: df2014cba1 am: 62fadfafd0 am: d0829e0307
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2209838

Change-Id: Iddc4b108ed4ddb23a0a1d872a0be00ee3caf030b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 00:49:42 +00:00
Jared Duke
06689ad1b2 Treat R8 warnings as failures for system_server
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
2022-09-07 13:13:01 -07:00
Joanne Chung
c4d1b9e6d6 Revert "[DO NOT MERGE] Remove selection toolbar code from build time" am: 888e79f7a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19204106

Change-Id: I2eed4842d349cb38bd488793cd4bfdf672d4c3cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 09:19:11 +00:00
Joanne Chung
888e79f7a0 Revert "[DO NOT MERGE] Remove selection toolbar code from build time"
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
2022-08-08 11:02:44 +00:00
Cole Faust
370eac8fe7 Merge "Remove services.speech" am: 8a18f1ab63 am: dbff26398e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2107385

Change-Id: I05b3c5280449d870fbf54318375489bbd127fd33
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 18:21:23 +00:00
Cole Faust
75c7c33ecd Remove services.speech
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
2022-05-25 13:16:26 -07:00
Joanne Chung
ade911b9c7 [DO NOT MERGE] Remove selection toolbar code from build time
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
2022-05-05 18:09:42 +08:00
Eric Jeong
a46adf380d [Re-land] Remove iorap framework codes
This reverts commit 2f393cdbce.

- It's decided to remove iorap from Android.
- This CL removes iorap framework codes.
- Removing iorap daemon and git repo will follow.

Bug: 211461392
Test: build okay
Change-Id: Ie1bebf1dfdce8b5db59c4e5a685c8f1afb46e266
Merged-In: Ie1bebf1dfdce8b5db59c4e5a685c8f1afb46e266
(cherry picked from commit 7ee89676b9)
2022-03-14 11:21:22 -07:00
TreeHugger Robot
edc7b17ce9 Merge changes from topic "tm-remove-iorapd" into tm-dev
* changes:
  [Re-land] Remove scripts related to iorap
  [Re-land] Remove iorap framework codes
2022-03-03 17:16:02 +00:00
Eric Jeong
540cc1fa17 [Re-land] Remove iorap framework codes
This reverts commit 2f393cdbce.

- It's decided to remove iorap from Android.
- This CL removes iorap framework codes.
- Removing iorap daemon and git repo will follow.

Bug: 211461392
Test: build okay
Change-Id: Ie1bebf1dfdce8b5db59c4e5a685c8f1afb46e266
Merged-In: Ie1bebf1dfdce8b5db59c4e5a685c8f1afb46e266
(cherry picked from commit 7ee89676b9)
2022-02-24 13:43:01 -08:00
Roopa Sattiraju
293ed88b2f Enabling Apex in BT
Bug: 217736913
Test: Compile, bringup and test user journeys
Change-Id: I3e796e3618ad9a077fa5e8ac387e314e896d1051
2022-02-24 20:42:33 +00:00
Remi NGUYEN VAN
f7c0b1fd9e Move networkstats JNI to connectivity module
Reorganize networkstats JNI so it can be included in the connectivity
module.

Bug: 197717846
Test: m
Change-Id: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
Merged-In: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
2022-02-18 16:20:47 +08:00
Jared Duke
d0975d8955 Merge "Restrict optional system_server optimizations to shrinking" am: 478baf2287 am: 62e8d5d941 am: f62fd7c1f8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1986966

Change-Id: I9a361feae3bf46ecb1b3639e1c84a5d677f94ff7
2022-02-16 16:55:42 +00:00
Jared Duke
ea03d1067b Restrict optional system_server optimizations to shrinking
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
2022-02-15 13:57:06 -08:00
Michael Wright
d2101ad401 Merge "Remove instances of identical operands in binary expression" 2022-02-14 14:45:08 +00:00
Michael Wright
f5af65021b Merge "Use Arrays.equals when comparing arrays." 2022-02-09 13:22:07 +00:00
Michael Wright
128ef9317f Merge changes I600ec645,Idfcc220d
* changes:
  Remove self-assignment from AutofillManagerService
  Use Arrays.hashCode in EventIndex hashCode()
2022-02-07 19:18:43 +00:00
Michael Wright
b9764480f4 Merge "Fix formatting string in PolicyVersionUpgrade" 2022-02-07 18:47:07 +00:00
Michael Wright
4353b0b03f Merge "Use correct contains method in PermissionManagerService." 2022-02-07 16:06:38 +00:00
Michael Wright
dda94e8f13 Merge "Avoid catching AssertionError for actual failures." 2022-02-07 16:05:56 +00:00
Michael Wright
48caf9d6a1 Merge "Fix possible NPE in DPMS." 2022-02-07 16:05:45 +00:00
Michael Wright
74faa3ffc5 Merge "Fix erroneous self comparison in KeyValueBackupTaskTest" 2022-02-07 12:05:58 +00:00
Remi NGUYEN VAN
92b2792a7c Move networkstats JNI to connectivity module
Reorganize networkstats JNI so it can be included in the connectivity
module.

Bug: 197717846
Test: m
Change-Id: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
2022-02-07 11:45:18 +09:00
Michael Wright
684f5a51b4 Remove instances of identical operands in binary expression
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
2022-02-04 21:41:04 +00:00
Michael Wright
3cc84d0caa Use Arrays.equals when comparing arrays.
Objects.equals uses reference equality, we actually want the equality of
the contents.

Bug: 217923092
Test: errorprone build
Change-Id: Idd9f515c23c6fa322b1e24101a390923993bc3dc
2022-02-04 21:17:10 +00:00
Michael Wright
573d22a90c Remove self-assignment from AutofillManagerService
This lets us make the errorprone warning an error, prevent erroneous
future instances.

Bug: 217923092
Test: errorprone build
Change-Id: I600ec645fafbdb550c8d3a11b6c877a32aa454fb
2022-02-04 21:17:10 +00:00
Michael Wright
c92adae8a3 Fix formatting string in PolicyVersionUpgrade
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
2022-02-04 21:17:10 +00:00
Michael Wright
16451b0b8d Use Arrays.hashCode in EventIndex hashCode()
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
2022-02-04 21:17:10 +00:00
Michael Wright
400ea88281 Use correct contains method in PermissionManagerService.
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
2022-02-04 21:17:09 +00:00
Michael Wright
5c97595aaf Avoid catching AssertionError for actual failures.
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
2022-02-04 21:17:09 +00:00
Michael Wright
2e7197c2ae Fix possible NPE in DPMS.
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
2022-02-04 21:17:09 +00:00
Michael Wright
010aa30bc4 Fix erroneous self comparison in KeyValueBackupTaskTest
Bug: 217923092
Test: atest BackupFrameworksServicesRoboTests
Change-Id: I73c88df39b63b40a6ed008c5e7872604a5894fbc
2022-02-04 21:17:09 +00:00
Sharon Su
a5afd3736a Server implementation of WallpaperEffectsService API.
Test: cts tests
Bug: 213238425
CTS-Coverage-Bug: 213238425
Change-Id: Id94764483b80a62a9fcaf8b2205b63e5cb66473c
2022-02-01 22:09:36 +00:00
Shashwat Razdan
f898abc490 Adding System Server implementation of Cloud Search API
Bug: 210528288
Test: RBE Built redfin-eng and tested on a physical device
Change-Id: Idac2e83819f9aeee292a5d53f3304d47cfc88af5
2022-01-26 15:19:01 -08:00
Maciej Żenczykowski
3a79de0568 Merge "Monitor interface added and update bpf interface map" am: d6ba5ab1b5 am: 0e5a1b21cf am: 402c615d7a am: 4be38b0eac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954391

Change-Id: Ie21cd49b0b58dbe8c40f6964c427ec8f2b996408
2022-01-24 19:59:44 +00:00
markchien
eaca9e9ac4 Monitor interface added and update bpf interface map
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
2022-01-21 23:34:57 +08:00
Roopa Sattiraju
33a02acc17 Migrating frameworks/base BT files
Bug: 206121418
Test: Compile and Test

Merged-In: Idb55371e9d678296fe46e5f4231ec2d12ec8b978
Change-Id: Idb55371e9d678296fe46e5f4231ec2d12ec8b978
2022-01-17 20:48:03 -08:00
Roopa Sattiraju
1745d75157 Migrating frameworks/base BT files
Bug: 206121418
Test: Compile
Change-Id: Idb55371e9d678296fe46e5f4231ec2d12ec8b978
2022-01-17 11:52:07 -08:00
Anton Hansson
e73c58ed5a Merge "Remove references to win_sdk" am: dddbdc3b15 am: a9e069273a am: d8393273c3 am: a46d68e30e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1933148

Change-Id: I1ec863baceaa62ebedc669635928d5d981c30917
2022-01-05 19:40:51 +00:00
Anton Hansson
dd8ef67a61 Remove references to win_sdk
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
2022-01-04 08:57:28 +00:00
Joanne Chung
41c4a0ac71 Initial layout of selection toolbar.
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
2021-12-16 11:35:23 +08:00
Treehugger Robot
9c0a79c91c Merge "Allow flag-guarded Java optimizations for services" am: 4746631ed1 am: 44ee49d6c8 am: d225da2625 am: e4515cbf07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1897075

Change-Id: Ifcc878a119b077aacded22738f72a00a1b646376
2021-12-04 02:34:19 +00:00
Jared Duke
4514bdf1b7 Allow flag-guarded Java optimizations for services
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
2021-12-03 12:31:30 -08:00
Roshan Pius
c463a36ace UwbService: Move to packages/modules/Uwb
Also, load the uwb system service jar from uwb apex.

Bug: 194906542
Test: Compiles
Change-Id: Iffc8988c56ba3199c5159563b06120a84a0632dd
2021-08-10 11:35:09 -07:00
Azhara Assanova
a131ad97c1 Introduce Android lint checks around Binder.clearCallingIdentity()
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
2021-06-21 17:14:46 +00:00
Andrei Onea
98d33ff1dc Remove services-all-sources
This filegroup is no longer needed.

Test: m
Bug: 177640454
Change-Id: If63a86ae259f5e8bf7ddb1a5b17c6fb75358d655
2021-05-25 14:30:52 +00:00
Andrei Onea
8168dc28be Remove non-updatable-* prefix from .txt files
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
2021-04-30 13:27:48 +00:00
Andrei-Valentin Onea
cfb5663717 Merge "Replace source based system server stubs" am: e93cf9e566 am: fef2035b4f am: d2a270b4e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642060

Change-Id: I7208c8e14772a8b5ef5c090fb3913973d9350a3a
2021-04-28 20:22:58 +00:00
Andrei Onea
faa271aa5e Replace source based system server stubs
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
2021-04-23 16:23:16 +01:00
Roshan Pius
27e1a87a48 Uwb: Create a new Uwb system service
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
2021-04-13 08:47:31 -07:00