summaryrefslogtreecommitdiff
path: root/services/incremental/IncrementalService.h
AgeCommit message (Collapse)Author
2025-02-04[appops] Migrate native IAppOpsCallback to aidl Atneya Nair
Move IAppOpsCallback to frameworks/native for use in both java and native. Fix-up callsites with fully qualified package name and the correct arguments. Test: compiles Test: atest CtsMediaAudioPermissionTestCases Test: atest service.incremental_test Bug: 322692565 Flag: EXEMPT mechanical Change-Id: I8d5fff5ef86e0b2d68df4a95745fe430134fe1f0
2021-06-08Proper retrying DL installation sessions. Alex Buynytskyy
Plus more robust handling of broken DLs. Bug: 190012477 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest com.google.android.packageinstallerv2proxy.host.gts.IncrementalInstallerHostTest Change-Id: I5cb037d49cd2b140bed1045c99f072112495acfc
2021-05-08Avoid sysfs name clashes. Alex Buynytskyy
Bug: 187437944 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest ApkVerityInstallTest Change-Id: Idc8cb4d170b0bfd98ee3a10bdf57439801739757
2021-05-04[incremental] report new metrics from Incremental Service Songchun Fan
BUG: 184844615 Test: atest service.incremental_test Change-Id: Ibbfe68851a4adfd620db9652f1fda550a3c6fb2c
2021-04-26[incremental] expose more metrics fields Songchun Fan
Exposing more data loader states as per go/incremental-crash-reports-1-pager. BUG: 184844615 Test: atest service.incremental_test Test: atest android.cts.statsdatom.incremental.AppErrorAtomTests Change-Id: I532513453411b2ccdb21311d0bc3dee0641837db
2021-04-16[pm] remove incremental startable/unstartable code Songchun Fan
Also remove streaming health status reporting which could cause startable state change because it is also not needed any more. BUG: 171920377 Test: builds Change-Id: I7284e7a63df79da7dbf3d16ff64302b3d1ce1348
2021-04-08Installation hardening: reducing read timeout during installation. Alex Buynytskyy
And then restoring post-install. Bug: 160635296 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I0821458bf92db162518a2cbcb7499cd7544e64f2
2021-03-24[incfs] Space trimming for IncFS v1 Yurii Zubrytskyi
Run a manual timed job that trims all files one by one on the old version of IncFS, where it didn't do it automatically. Bug: 183435580 Fixes: 183436717 Test: atest libincfs-test service.incremental_test Change-Id: I57885b2826e383814822c767802f837135fd8464
2021-03-24[incfs] Fix the mount state callbacks processing Yurii Zubrytskyi
- use a never-existing storage ID as a job key - order the jobs in the map to not skip them on changes, or, worse, never hang in a loop - clear the local callbacks vector before moving to the next storage ID - try to resume from the closest place on the next processing iteration Bug: 183435580 Test: atest service.incremental_test Change-Id: I36cd5d30c656bed62c20bd7a7f84fb58046a0933
2021-03-23Reduce ifs lock scope. Alex Buynytskyy
Bug: 182214420 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: Ic36002205c93b316b28ba10ea8f5fbc50dcff70a
2021-03-23Unbind from DataLoader when not needed anymore. Alex Buynytskyy
+ simplify adding new callbacks on storage state + streamline lock story for ifs members Bug: 183101753 Fixes: 183101753 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I86fffa7101eeb42ebccca67ae7f5d133c1ab9dfa
2021-03-19Untangle listeners mess in IncrementalService Yurii Zubrytskyi
Listeners and some binder call parameters were using several different styles when passed around - copy, move, pointer, pointer to pointer. This CL tries to 'normalize' that. Bug: 183067554 Test: atest IncrementalServiceTest Change-Id: Ia28089aa9e4491b0f28e3e747489199cfccb5a1b
2021-03-19[incfs] Call the new isFullyLoaded api where possible Yurii Zubrytskyi
Replace the remaining calls to getFilledRanges() with isFullyLoaded() where we don't care about the progress Bug: 183067554 Test: atest IncrementalService Change-Id: Ic8dc2e3a0ef078353883feef7969b29e11dfa2d0
2021-03-18[incfs] Use the new libincfs API for file status checking Yurii Zubrytskyi
libincfs got a new set of functions for checking the file loaded status, which works more efficiently than getting filled ranges. Bug: 183067554 Test: atest IncrementalServiceTest Change-Id: I3b96bf409f1778c5a89e4802e2005197f70ce0cb
2021-03-16Limit read log reporting to 2hrs for non-system DLs (non-adb). Alex Buynytskyy
Bug: 182477087 Test: atest IncrementalServiceTest Change-Id: I98c9ed3a2e8a91d26bcb879ab7073903ff7bb2c5
2021-03-11DL lifecycle: handle slow DL binding. Alex Buynytskyy
Bug: 182214420 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I5959e01177ab702de1f754f4ba433004925ce98b
2021-03-09[incremental] expose duration since oldest pending read Songchun Fan
As requested by go/incremental-disablement-metrics, we will expose the duration since oldest pending read as part of the crash/ANR metrics. This is the first step that exposes the value to Incremental Service. BUG: 180951530 Test: unit test Change-Id: Ic67460072556ef01780a1794b40924ca2092060d
2021-02-20Potential deadlock mitigation. Alex Buynytskyy
+better error logging DataLoaders might report user statuses from lifecycle callbacks. Immediate processing of such might introduce infinite loops/deadlocks e.g. DataLoader_OnStop -> reportStatus(UNRECOVERABLE) -> fsmStep -> DataLoader_OnStop Bug: 160634487 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: Ic68657d7a8cd6c6855b6f5295276a42b3cb09117
2021-02-11DataLoader lifecycle. Alex Buynytskyy
- restarting DataLoaders for not fully downloaded mounts, - exponential backoff retry on DataLoader restart. Bug: 173223115 Bug: 160634487 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I5a93fd515ef0fec09452ce7bb4cd79fbd283d45f
2021-01-29Inherited installation support for Incremental. Alex Buynytskyy
Bug: 162345970 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I360f44bc52e05553eacc448faa26f603d9eaae59 Merged-In: I360f44bc52e05553eacc448faa26f603d9eaae59
2021-01-12Per package read timeouts. Alex Buynytskyy
Bug: 162345970 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest Change-Id: I2599db1ed8827fff16387c11254a5d607f27ea46
2020-11-09[incremental] add last pending reads info in dumpsys Songchun Fan
Example section of dumpsys output: lastPendingReads: fileId: 03300000000000000000000000000000 metadataHex: 0330 blockIndex: 857738 bootClockTsUs: 166877488 Test: manual BUG: 162600251 Change-Id: I37b04751c2a11972450ce7e9082116f8047e87df
2020-10-20[incremental/pm] set health listener on commit and on reboot Songchun Fan
This changes allow Incremental Service to directly report health status to package manager service. A health listener is created during package installation session to monitor incremental storage health. After commit, a new listener is created and will overwrite the old one. The new listener will listen to incremental storage health and report the status to package manager service, which will then send the status to IncrementalStates, where the startability state and unstartable reason might change, based on the health status code. During reboot, for each incremental package, if it is not fully loaded, the package manager service will register a health status listener to continue monitor the health status of this package. Test: unit test Test: manual BUG: 170435166 Change-Id: I220f230c523cfaf2c96019f9478554665e6af486
2020-10-01[incremental/pm] app states and transitions Songchun Fan
Based on go/incremental-states-design with basic setter/getters. Defines IncrementalStates class which handles state transitions. New (internal) Intent actions: PACKAGE_FULLY_LOADED, PACKAGE_STARTABLE, PACKAGE_UNSTARTABLE. BUG: 168043976 Test: unit tests Change-Id: I7b0ec2dd9f028ee620a9307a1e71ddf12ea5a9af
2020-09-21Installer digests for Incremental installations. Alex Buynytskyy
Bug: 160605420 Test: atest ChecksumsTest Change-Id: I9d46c218cccf87781e9b33711c4d02d94bf824f5
2020-09-15[incremental/pm] register progress listener Songchun 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-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-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
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 config Songchun 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-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-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[incfs] Use the new IncFs_MakeDirs() function Yurii 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 start Yurii 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-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-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 extraction Yurii 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-10[incfs] Fix a crash in worker thread calling JNI Yurii 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 async Yurii 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-09Refactor: move dataLoader details to a separate class. Alex Buynytskyy
Bug: b/151241369 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: If4e7d3bb9f0951dcaee4315f4be525883b7fc333
2020-04-08Merge "Uninitialized member fix :(" into rvc-dev TreeHugger Robot