summaryrefslogtreecommitdiff
path: root/services/incremental/IncrementalService.cpp
AgeCommit message (Collapse)Author
2020-09-21Installer digests for Incremental installations.Alex Buynytskyy
Bug: 160605420 Test: atest ChecksumsTest Change-Id: I9d46c218cccf87781e9b33711c4d02d94bf824f5
2020-09-15[incremental/pm] register progress listenerSongchun Fan
Incremental Serivce periodically polls loading progress and sends to Package Manager Service. Package Manager provides APIs for other interested parties to listen to the loading progress. BUG: 165841827 Test: unit test Change-Id: I44b9e17c2240b9efe53bc09fc728b6671f1f7dfe
2020-08-27Wait for APK to be fully downloaded for full APK digests.Alex Buynytskyy
Bug: 160605420 Test: atest ChecksumsTest Change-Id: Ib9fd591c67290786268b6dcdc57c7db153612e01
2020-08-25[incremental] storage is regarded as fully loaded if there's no file or only ↵Songchun Fan
empty files Test: atest service.incremental_test BUG: 165799231 Change-Id: I3b6be3918d53ce4ab0a30a4da493d9730a31ed3c
2020-08-22[IncrementalService] getLoadingProgress (v1)Songchun Fan
This is to unblock Launcher's work on progress ring. Currently it uses incfs getFilledBlocks(). Will switch to the new incfs progress reporting API once it is ready. Test: unit test Test: adb shell dumpsys incremental BUG: 165799231 Change-Id: Icd68124806454f888826294da36f109bca9771ac
2020-08-10Switch aidl::nullable to std::optionalJooyung Han
AIDL's @nullable is represented as std::optional in C++ backend. The previous aidl::nullable was a temporary solution to avoid merge-conflicts between rvc-dev and master branches. Bug: 151275535 Test: m Change-Id: I8fe5bfc1763087e7ff364b4408f862436492d1db
2020-07-13[IncrementalService] fix native lib check after OTASongchun Fan
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-06-12Don't provide read logs for shell-initiated installations.Alex Buynytskyy
Only if the application is profileable. Bug: 158238023 Fixes: 158238023 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageParserTest Change-Id: I8575830ec3f29850297fdbfbaa157072d6350a28 Merged-In: I8575830ec3f29850297fdbfbaa157072d6350a28
2020-06-01Healthcheck: proper job allocation and test.Alex Buynytskyy
Bug: 153874006 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Iede1f2297cc4f8e3c3f0acd43cee597f75dff179
2020-05-29Lifecycle: detecting blocked and unhealthy, part 2.Alex Buynytskyy
Part 2: continuous health checking, blocked and unhealthy states. Bug: 153874006 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ifdbff7dfa24b3bd9b96c534a40bb1226082749ca
2020-05-27Merge "[incremental] respect extractNativeLibs in native lib config" into ↵Songchun Fan
rvc-dev
2020-05-27[incremental] respect extractNativeLibs in native lib configSongchun Fan
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-26Lifecycle: detecting blocked and unhealthy.Alex Buynytskyy
Part 1: interfaces and PM implementation. Bug: 153874006 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: I312dd919d2bb552bea3d72fb49fd1579882da14b
2020-05-18Don't restart non-system DataLoaders on reboot.Alex Buynytskyy
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-12Don't try to recreate IncrementalFileStorages on re-commit.Alex Buynytskyy
Bug: 156287164 Fixes 156287164 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: I75e392a1fa84df8b6ac0b855233f9a2662998e96
2020-05-08Addressing CL comments.Alex Buynytskyy
Bug: 153874006 Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ie8b86cdc382955840cc3718d79a45991cf89b879
2020-05-07Lifecycle: detecting pending reads.Alex Buynytskyy
Once pending read detected, try to start the dataloader. Bug: 153874006 Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ia8169ccbb0f710317715e6fddb9bc6a718543766
2020-05-04Additional lock to avoid access to deleted object.Alex Buynytskyy
Bug: b/155692497 Fixes: 155692497 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ie02012bd5a6c0640d54c5390d3726a5405042408
2020-04-29Unavailable DataLoader status.Alex Buynytskyy
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-27Fix for Binder one-way deadlock.Alex Buynytskyy
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-23Corner cases handling.Alex Buynytskyy
- 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-23Keep only service binding in DataLoaderManager.Alex Buynytskyy
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-22[cleanup] Enable clang-tidy and fix warningsYurii Zubrytskyi
Moving out of a const variable doesn't really work, apparently Bug: 153704006 Test: builds & boots Change-Id: Id7322f7045c08a20d72dda50808c0be427064cdd
2020-04-22[incfs] Use the new IncFs_MakeDirs() functionYurii Zubrytskyi
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[incfs] Use MountRegistry to import existing mounts on startYurii Zubrytskyi
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-20Unblock the unmount on uninstallation.Alex Buynytskyy
Bug: b/153874006 Test: test PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: I540ed36b87c40b8b58f0de727936c3efeb221198
2020-04-17Cleaning up resources on mount destruction.Alex Buynytskyy
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-17Switching to FSM-based DL lifecycle.Alex Buynytskyy
This is a pure refactoring. Bug: b/153874006 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ieda2be08d7359fa69b2d328c85b3606de6d02b3d
2020-04-15Merge "[incfs] Fix the block size calculation in .so extraction" into rvc-devTreeHugger Robot
2020-04-14[incfs] Fix the block size calculation in .so extractionYurii Zubrytskyi
Bug: 154044009 Test: adb install megacity.apk && adb shell cat *.so Change-Id: I0069c8cfa74c83810152d917a2bac9cdaf24d6a7
2020-04-14DataLoader lifecycle.Alex Buynytskyy
- 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-13[incfs] Correctly wait for async .so's extractionYurii Zubrytskyi
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-11Reconnect to DataLoaders on restart.Alex Buynytskyy
Bug: b/151241369 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: I1532df63a2a36104dbd9cd90ee4e5f40bae00a6a
2020-04-10[incfs] Fix a crash in worker thread calling JNIYurii Zubrytskyi
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[incfs] Make native library extraction asyncYurii Zubrytskyi
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-10Merge "Refactor: move dataLoader details to a separate class." into rvc-devTreeHugger Robot
2020-04-10Get rid of two runtime static destructorsYurii Zubrytskyi
Bug: 153704006 Test: compiles Change-Id: Icb44c2d2c1e26b13a4d03a4996bffe016a141286
2020-04-09Refactor: move dataLoader details to a separate class.Alex Buynytskyy
Bug: b/151241369 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: If4e7d3bb9f0951dcaee4315f4be525883b7fc333
2020-04-08More setStorageParams improvements.Alex Buynytskyy
Using proper AppOp name: loader_usage_stats Bug: b/152633648 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Test: adb shell appops set 1000 LOADER_USAGE_STATS deny Change-Id: I199476ce29c81836c5402577ac225450cc5c9c82
2020-04-08Merge "Uninitialized member fix :(" into rvc-devTreeHugger Robot
2020-04-07Uninitialized member fix :(Alex Buynytskyy
Bug: b/153468113 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ida26dc1476c2b329f9aba4d605e65c43e2cafac2
2020-04-08Merge "Change the way how we call setStorageParams." into rvc-devTreeHugger Robot
2020-04-07Change the way how we call setStorageParams.Alex Buynytskyy
Now it's unified with callback FS connector - we are passing the callback pointer directly to dataloader. This restricts access only to methods we want and only by someone we want. Bug: b/153468113 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ib557ebbe7c6c5ce92140eb20534a3626b3ac96d3
2020-04-07Merge "[incfs] Add time measurement for native libs extraction" into rvc-devYurii Zubrytskyi
2020-04-07[incfs] Add time measurement for native libs extractionYurii Zubrytskyi
Use the "incremental.perflogging" boolean system property to enable it + a bunch of code cleanups Bug: 152913040 Test: manual Change-Id: I1cd259ff5821a47ce055003049f77cbf43eba24a
2020-04-06Appops permission monitoring for GET_USAGE_STATS.Alex Buynytskyy
This makes sure DataLoader won't be able to obtain read logs once user denies access. Bug: b/152633648 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Test: adb shell appops set 1000 GET_USAGE_STATS deny Change-Id: Ibbb74933b4ef0dd8f5fe27732743e5820b8ee4dc
2020-04-03Disallow read logs collection if user changes their mind.Alex Buynytskyy
Bug: b/152633648 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Test: adb shell appops set 1000 GET_USAGE_STATS deny Change-Id: I7fc8356f84fe30669483470579eedf546f81f297
2020-04-03[incfs] fix the storage loading for existing mountsYurii Zubrytskyi
IncrementalService used to keep the storage parameters in the directory metadata, but our current incfs doesn't support metadata on directories - so the storage id is encoded in its name. But the loading code used to think it's still in the metadata and couldn't load anything for that reason Bug: 151241369 Test: install an app and reboot the phone. It's still there Change-Id: Ic93f8f368b48fc5c5cc9bb726eff80478183596c
2020-04-02Merge changes from topic "LOADER_USAGE_STATS" into rvc-devAlex Buynytskyy
* changes: Checking LOADER_USAGE_STATS before enabling read logs. Revert "Update the current API dump"
2020-04-02Checking LOADER_USAGE_STATS before enabling read logs.Alex Buynytskyy
Bug: b/152633648 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: Ic747a51b97b785c627c95bddecc6834ef602ff30