Commit Graph

207 Commits

Author SHA1 Message Date
Hai Zhang
3070d7cb82 Add services.permission java_library_static with Kotlin.
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
2022-11-16 12:51:32 -08:00
Sarp Misoglu
2d8b102ef1 Delete backup encryption code
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
2022-10-12 17:05:17 +00:00
Helen Qin
20ff355163 Framework credential manager developer APIs definitions.
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
2022-10-03 07:28:30 +00:00
Hui Wu
8ad644d560 Merge "Remove impl of cloudsearch api" into tm-qpr-dev am: aa0ffaee0d am: 9af4e0bd3d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20019599

Change-Id: I39d3d6c07594b2e99d773a0feb46127dfa19e55d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-23 07:42:46 +00:00
Hui Wu
9af4e0bd3d Merge "Remove impl of cloudsearch api" into tm-qpr-dev am: aa0ffaee0d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20019599

Change-Id: I8475cd36abd09908238d7e996dcc9f5dbf14b784
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 22:50:42 +00:00
Hui Wu
1a25dca0bc Remove impl of cloudsearch api
Bug: 246376638
Test: Manually Tested
Change-Id: I1740d5e1a0fb25a0fedea0a92e8a901684e35635
2022-09-22 15:08:56 -07:00
Treehugger Robot
8f1cdbf944 Merge "Treat R8 warnings as failures for system_server" am: 1f440e7a62 am: df2014cba1 am: 62fadfafd0 am: d0829e0307 am: 4a346a16ed
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2209838

Change-Id: Ifdd0cbabb1bf2da2eee3ccf0a496a567f660a959
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 01:19:06 +00:00
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
3dd7fc63cb Merge "Remove services.speech" am: 8a18f1ab63 am: dbff26398e am: 370eac8fe7 am: 8683a7b221 am: d796f4a4d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2107385

Change-Id: I654c7ed54a18781ef5ac68f5686f26eb238cecfb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 19:12:43 +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
Azhara Assanova
020ccc4160 Remove errorprone BinderIdentityTokenChecker
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
2022-05-31 10:55:16 +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
Roopa Sattiraju
ef5203ac9f Merge "Enabling Apex in BT" into tm-dev am: 82c71dd74d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16982210

Change-Id: I950a76475259464ab34040853ae5557dab73c4ef
2022-02-25 19:40:01 +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
TreeHugger Robot
d51db56c72 Merge changes from topic "remote-iorap-reland"
* changes:
  [Re-land] Remove scripts related to iorap
  [Re-land] Remove iorap framework codes
2022-02-24 17:36:50 +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
Eric Jeong
7ee89676b9 [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
2022-02-14 15:25: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