99 Commits

Author SHA1 Message Date
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Alex Buynytskyy
bd8444d1e3 Excessive battery usage fix.
Using wake to forcefully wake up the looper instead of 1s timeout.

Fixed: 168156055
Test: atest ApkVerityTest:com.android.apkverity.ApkVerityTest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: If65f65f9214b34bf057ed5f1877348d835251d14
Merged-In: If65f65f9214b34bf057ed5f1877348d835251d14
2020-09-24 21:50:38 +00:00
Jeongik Cha
388d5136b5 Add '-unstable' to solve ODR violation
The interface which is imported by an unstable interface is 'unstable'
as well. Until now, the ODR violation checker in aidl has omitted an
interface imported, but it will be checked, accordingly, fix the current
problem

Bug: 146436251
Test: m nothing
Change-Id: I3a9ae6e17e49c731e825ef00b9b9574c3f2e2719
Merged-In: I3a9ae6e17e49c731e825ef00b9b9574c3f2e2719
Exempt-From-Owner-Approval: cp from internal
2020-09-11 15:39:46 +09:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Songchun Fan
6618aa74a7 Merge "[IncrementalService] fix native lib check after OTA" into rvc-dev am: 9093346b9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12141813

Change-Id: I7c7fec04934ff6f4773d71673b7e10f43067787a
2020-07-15 16:48:42 +00:00
Songchun Fan
c8975312c5 [IncrementalService] fix native lib check after OTA
The lib dir should always be at the same dir level as the APK file.

Test: manual with OTA
Test: atest CtsExtractNativeLibsHostTestCases
BUG: 160826412
Change-Id: I87d715c4739c78bb56b85d375838db08bafa1594
2020-07-13 12:14:37 -07:00
TreeHugger Robot
84f65247cb Merge "Don't provide read logs for shell-initiated installations." into rvc-dev am: e0ba6d9dff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11778056

Change-Id: I866bc89927ae11a0da7069d33e3e06d5c1f1b51f
2020-06-15 16:42:24 +00:00
Alex Buynytskyy
0403545508 Don't provide read logs for shell-initiated installations.
Only if the application is profileable.

Bug: 158238023
Fixes: 158238023
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageParserTest
Change-Id: I8575830ec3f29850297fdbfbaa157072d6350a28
Merged-In: I8575830ec3f29850297fdbfbaa157072d6350a28
2020-06-12 13:30:45 -07:00
Orion Hodson
8c238bab8c Add explicit dependencies on jni_headers
Preparation for removing implicit include paths for jni.h from
soong.

Bug: 152482542
Test: m checkbuild
Change-Id: I7e7a0df96249fad3eb07977b87ae7953c4b22b5f
Merged-In: I7e7a0df96249fad3eb07977b87ae7953c4b22b5f
Exempt-From-Owner-Review: cherry pick
(cherry picked from commit b9b2b7a42654a006301fdb5ae8ce274b82f57be9)
2020-06-02 19:18:38 +01:00
Alex Buynytskyy
4115191cc4 Merge "Healthcheck: proper job allocation and test." into rvc-dev am: c4ac9d2321
Change-Id: I9257064a3c0a064f2217adbe8ab5c00f26027896
2020-06-01 16:04:42 +00:00
Alex Buynytskyy
46d3ddb311 Healthcheck: proper job allocation and test.
Bug: 153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest

Change-Id: Iede1f2297cc4f8e3c3f0acd43cee597f75dff179
2020-06-01 00:25:23 +00:00
TreeHugger Robot
27ee72a794 Merge "Lifecycle: detecting blocked and unhealthy, part 2." into rvc-dev am: 825ad11167
Change-Id: I5dd609fb62c658b056c2b32efe85354ec90ffea3
2020-05-29 19:19:06 +00:00
Alex Buynytskyy
4760d8ff75 Lifecycle: detecting blocked and unhealthy, part 2.
Part 2: continuous health checking, blocked and unhealthy states.

Bug: 153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ifdbff7dfa24b3bd9b96c534a40bb1226082749ca
2020-05-29 10:32:59 -07:00
Songchun Fan
b8e087607b Merge "[incremental] respect extractNativeLibs in native lib config" into rvc-dev am: f2a6af4b8a
Change-Id: Ibc96844cf6737663c48c9133b49bc9c972ed632f
2020-05-28 00:59:35 +00:00
Songchun Fan
f2a6af4b8a Merge "[incremental] respect extractNativeLibs in native lib config" into rvc-dev 2020-05-27 22:17:23 +00:00
Songchun Fan
14f6c3c735 [incremental] respect extractNativeLibs in native lib config
Makes sure the behavior is consistent with legacy installs:

When the flag is on, the native libs will be extracted to subdirs under
lib/.
When the flag is off, the lib/ subdirs will be created but the native
libs are not extracted.
When the flag is off, check if the native libs are uncompressed and well
aligned.

Test: atest android.extractnativelibs.cts.CtsExtractNativeLibsHostTest
BUG: 157173358
Change-Id: Idb57fd7ca1115f787faf5cde3056c32ff3f60890
2020-05-27 22:16:57 +00:00
Alex Buynytskyy
53ea003df2 Merge "Lifecycle: detecting blocked and unhealthy." into rvc-dev am: 4e5ff2eb7d
Change-Id: If0f24b8549fbf78aecf4586551528606064ecfe7
2020-05-27 04:17:10 +00:00
Alex Buynytskyy
8ef61aebee Lifecycle: detecting blocked and unhealthy.
Part 1: interfaces and PM implementation.

Bug: 153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I312dd919d2bb552bea3d72fb49fd1579882da14b
2020-05-26 19:34:39 +00:00
TreeHugger Robot
6bbe3e40a7 Merge "Don't restart non-system DataLoaders on reboot." into rvc-dev am: afdf940276
Change-Id: I48e7d1ed40e787fb63445d68aa0e198e555c0857
2020-05-18 21:46:51 +00:00
Alex Buynytskyy
ea96c1f624 Don't restart non-system DataLoaders on reboot.
This saves system's resources.
Healthcheck will automatically start data loader on pending reads.

Bug: 153874006
Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I160153f1d3e7e653db5de06b59d6fbbc3667fdf2
2020-05-18 11:40:43 -07:00
TreeHugger Robot
880974ebd0 Merge "Don't try to recreate IncrementalFileStorages on re-commit." into rvc-dev am: eb191392e6
Change-Id: I8ac2224ccd7d4a7d1e69da137e598800187bdf92
2020-05-13 16:14:40 +00:00
Alex Buynytskyy
4dbc0607ee Don't try to recreate IncrementalFileStorages on re-commit.
Bug: 156287164
Fixes 156287164
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest

Change-Id: I75e392a1fa84df8b6ac0b855233f9a2662998e96
2020-05-12 13:49:29 -07:00
Alex Buynytskyy
8186dcc0a3 Merge "Addressing CL comments." into rvc-dev am: 9bd14c445e
Change-Id: I5b32e751573a8f91433731426fd2f16be7502208
2020-05-10 05:15:34 +00:00
Alex Buynytskyy
d0855a3ad8 Addressing CL comments.
Bug: 153874006
Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ie8b86cdc382955840cc3718d79a45991cf89b879
2020-05-08 10:35:58 -07:00
Alex Buynytskyy
c25f3b1cd0 Merge "Lifecycle: detecting pending reads." into rvc-dev am: d59d694f11
Change-Id: I3e015fa74dc293a9de0f45c1e6574d15539aa840
2020-05-08 00:45:27 +00:00
Alex Buynytskyy
cca2c1110c Lifecycle: detecting pending reads.
Once pending read detected, try to start the dataloader.

Bug: 153874006
Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest

Change-Id: Ia8169ccbb0f710317715e6fddb9bc6a718543766
2020-05-07 21:22:14 +00:00
Alex Buynytskyy
9c1aebb8d1 Merge "Additional lock to avoid access to deleted object." into rvc-dev am: 28d1236852
Change-Id: I51ba1e6068c9f1bf6f9bf73d07ab831a7094a8be
2020-05-05 05:24:36 +00:00
Alex Buynytskyy
b0ea448eeb Additional lock to avoid access to deleted object.
Bug: b/155692497
Fixes: 155692497
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ie02012bd5a6c0640d54c5390d3726a5405042408
2020-05-04 18:41:47 -07:00
Orion Hodson
8f1303d39e Remove unneeded dependency on libnativehelper
Bug: 151443957
Test: m service.incremental
Change-Id: I251796cf521ed3804b2c9018c43469289032e315
Merged-In: I251796cf521ed3804b2c9018c43469289032e315
(cherry picked from commit 90f0e7a53c00650783dc97fa41235b09a22d6414)
2020-04-30 09:16:32 +00:00
Alex Buynytskyy
7e0a1a8ec7 Unavailable DataLoader status.
This is a temporary failure, does not fail the session, but requires
caller to re-commit. E.g. there are connectivity issues which can be
fixed later.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I02791a2963130dbecb510c4a7cafcf04f6245761
2020-04-29 04:23:49 +00:00
Alex Buynytskyy
64067b25b1 Fix for Binder one-way deadlock.
Dispatch session destroy to be executed later.
We can't do anything blocking during one-way transaction processing.
This blocks all one-way transactions to this Binder, including other
status updates.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Test: atest IncrementalInstallerTest#testIncrementalInstallFails_onPrepareImageReturnsFalse
Change-Id: Ie4385d603fca8b5205775e849e92846cff672f56
2020-04-27 11:06:29 -07:00
Alex Buynytskyy
0bdbccf37c Corner cases handling.
- crash on disappearing dataloaders,
- more robust binder callbacks processing,
- heavy unbind lifting moved to a separate thread to unblock Binder.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ie06c3c4dbecbdd552dd868e2092bf0ee48f8547a
2020-04-23 22:28:36 -07:00
Alex Buynytskyy
ea1390ff32 Keep only service binding in DataLoaderManager.
This simplifies:
- resource management - no extra copies of controls,
- state management - all states in one place, no more hidden (bound but
not created) state.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I3d16a099c7f42fcf14637c5a8e96bd6f99e073d1
2020-04-23 19:38:44 +00:00
Yurii Zubrytskyi
510037b064 [cleanup] Enable clang-tidy and fix warnings
Moving out of a const variable doesn't really work, apparently

Bug: 153704006
Test: builds & boots
Change-Id: Id7322f7045c08a20d72dda50808c0be427064cdd
2020-04-22 22:34:24 -07:00
Yurii Zubrytskyi
efebb45ad7 [incfs] Use the new IncFs_MakeDirs() function
This gets rid of annoying warnings in logcat about not being
able to create a directory and then directory already existing

Bug: 153704006
Test: atest IncrementalServiceTest
Test: adb install megacity.apk
Change-Id: Ib718960287f93cb383c06c9b9e3d0abf1ec42916
2020-04-22 14:00:55 -07:00
Yurii Zubrytskyi
629051fd65 [incfs] Use MountRegistry to import existing mounts on start
This is a big cleanup in IncrementalService that makes it behave
nicely on runtime restart, and more:

- fixed a bunch of threading issues in createStorage/bind
- made public functions correctly accept any path in any
  bind mount and translate it to the proper root mount
- got rid of "using namespace" in headers, cleaned includes
- removed all unused functions
- set CLOEXEC bit on all duped FDs

Bug: 151241369
Test: atest PackageManagerShellCommandTest \
  PackageManagerShellCommandIncrementalTest \
  IncrementalServiceTest

Change-Id: Ided4415aabfbfca3925b5e71c91896055886ac4a
2020-04-22 00:49:02 -07:00
Yurii Zubrytskyi
529a37d3cb [incfs] Fix bad path::join() path preparation
Bug: 151241369
Test: atest IncrementalServiceTest
Change-Id: I6e7655634de722c46e96e66b58c0c4c8e5098874
2020-04-22 00:39:44 -07:00
Alex Buynytskyy
c2a645d717 Unblock the unmount on uninstallation.
Bug: b/153874006
Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I540ed36b87c40b8b58f0de727936c3efeb221198
2020-04-20 14:11:55 -07:00
Alex Buynytskyy
9a54579ac5 Cleaning up resources on mount destruction.
DataLoaderStub's lifetime is controlled externally, but we want to
release resources ASAP.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I34035f36d1fe4ed0e4916014d859feb7fe2c0a09
2020-04-17 22:07:10 -07:00
Alex Buynytskyy
ab65cb1824 Switching to FSM-based DL lifecycle.
This is a pure refactoring.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ieda2be08d7359fa69b2d328c85b3606de6d02b3d
2020-04-17 11:02:16 -07:00
TreeHugger Robot
3e188ae81d Merge "[incfs] Fix the block size calculation in .so extraction" into rvc-dev 2020-04-15 00:52:43 +00:00
Yurii Zubrytskyi
6c65a56d39 [incfs] Fix the block size calculation in .so extraction
Bug: 154044009
Test: adb install megacity.apk && adb shell cat *.so
Change-Id: I0069c8cfa74c83810152d917a2bac9cdaf24d6a7
2020-04-14 15:25:49 -07:00
Alex Buynytskyy
0b20266c12 DataLoader lifecycle.
- mark disconnected DataLoaders as non-existent (destroyed),
- remove storage destroy on DataLoader destroy,
- more robust destroy on destruct handling,
- less race-conditions.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ib77302aac546d66ce40c5345417c7b424a1d601b
2020-04-14 09:25:37 -07:00
Yurii Zubrytskyi
721ac4d350 [incfs] Correctly wait for async .so's extraction
StorageID for an installation changes as we go from a staging
directory to the final one. That's why the only correct way
of waiting for the extraction to complete is by the whole
MountID, even if later it would cause the call to wait on all
instances of the app.

+ measure the waiting timing

Bug: 153513507
Test: adb install megacity.apk
Change-Id: I83558f155867ae5503719ecb63d591fc969c3995
2020-04-13 11:34:32 -07:00
Alex Buynytskyy
6994166a09 Reconnect to DataLoaders on restart.
Bug: b/151241369
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I1532df63a2a36104dbd9cd90ee4e5f40bae00a6a
2020-04-11 21:40:37 -07:00
Yurii Zubrytskyi
8632140038 [incfs] Fix a crash in worker thread calling JNI
Worker thread has to initialize JNI separately to be able
to call into managed binders implemented in the same
system_server process, e.g. DataLoaderManager

Bug: 153513507
Test: adb install megacity.nov4.apk; adb install megacity.v4.apk
Change-Id: I668e8664361cd2fb3353ec50efd689c7d613658f
2020-04-10 13:47:54 -07:00
Yurii Zubrytskyi
da208016d6 [incfs] Make native library extraction async
IncrementalService can create the library files beforehand, but
delay filling in their data. As it takes quite a while in
general (over a second in cases when the phone is busy), it's
better to run the unzipping and filling in a separate thread
and only make sure it finishes before the whole installation
process is complete.
This speeds up the megacity.apk installation by ~250-300ms,
1000-1100ms -> 750-800ms

Bug: 153513507
Test: adb install megacity.apk

Change-Id: Ia44f7e45b9e0abaebdfb6fe5352f9dcf29ab4ece
2020-04-10 12:30:49 -07:00
TreeHugger Robot
771027008b Merge "Refactor: move dataLoader details to a separate class." into rvc-dev 2020-04-10 16:53:56 +00:00
Yurii Zubrytskyi
0cd8012b73 Get rid of two runtime static destructors
Bug: 153704006
Test: compiles
Change-Id: Icb44c2d2c1e26b13a4d03a4996bffe016a141286
2020-04-10 16:49:34 +00:00
Alex Buynytskyy
0ea4ff4d97 Refactor: move dataLoader details to a separate class.
Bug: b/151241369
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: If4e7d3bb9f0951dcaee4315f4be525883b7fc333
2020-04-09 22:55:49 -07:00