191 Commits

Author SHA1 Message Date
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Treehugger Robot
bdf15f2234 Merge "[services.incremental] Use shared libutils for remount" am: 44233c693c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1810680

Change-Id: I2614171ee4fc1822a2a3c1e7e50658487218a34d
2021-09-01 18:34:47 +00:00
Pirama Arumuga Nainar
cebf0493bf [services.incremental] Use shared libutils for remount
Bug: http://b/197965342

services.incremental depends on libbinder.so, which already depends on
libutils.so.  When linking services.incremental with libutils.a, the
linker tries to open objects from libutils.a to redefine undefined
symbols in libbinder.so.  This causes a linker failure with upstream
LLD.  Switching to shared libutils.so instead doesn't increase the
dependency closure for services.incremental.

Test: build with aosp/1809741 which has lld with the above behavior.
Change-Id: I2735461ae64ef2e4c0afc170f7b765c1b5b9432e
2021-08-31 21:20:27 -07:00
Liz Kammer
a4ddfbe33b Mark classes as final that have final destructors
Having a final destructor prevents the class from being inherited from,
adding the designation final to the class makes this behavior more
explicit. This is required to re-enable the error for
-Wno-final-dtor-non-final-class.

Test: m
Merged-In: Ia3126d30e19edfd17f7c8da368e9763ca5501e84
Change-Id: Id1d7c607af9cca0109e1f763052894cf179f4af1
2021-07-23 17:21:11 +00:00
Alex Buynytskyy
6e0b0fa671 Reduce timeout for DL to destroy.
10secs should be more than enough to stop whatever the DL is doing.
Besides, DL has its own set of IncFS FDs and should not crash.

Bug: 189222575
Fixes: 189222575
Test: atest IncrementalServiceTest
Change-Id: I73cb27d61c7418adeea7536c8263e6ba8c77fd3e
2021-06-28 23:06:49 +00:00
Alex Buynytskyy
4bafd4ddd8 Proper retrying DL installation sessions.
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-06-08 17:41:47 -07:00
Songchun Fan
0d68016aea [incremental/metrics] report uid of last read error
BUG: 187354818
Test: atest service.incremental_test
Change-Id: I632b747440ed4faef31266a3a7b18b7a382ff2cf
2021-05-28 03:08:39 +00:00
Patrick Baumann
43628ca24c Updates OWNERS files
Bug: 186864416
Test: Builds
Change-Id: I04dfc5c2c7143825334ebc62742e335b8c889492
2021-05-21 14:13:18 -07:00
Patrick Baumann
e6c0a4f8ce Updates OWNERS files
Bug: 186864416
Test: Builds
Change-Id: I04dfc5c2c7143825334ebc62742e335b8c889492
2021-05-14 15:45:42 +00:00
Alex Buynytskyy
98a3c8ffff Duplicate apk names on package update.
+minor fixes

Bug: 187710420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Change-Id: Iced479532b38bddcd8655df3ce08611434965cf4
2021-05-13 12:28:58 -07:00
Songchun Fan
f6c65bbf65 [incremental] use same sysfs name for setOptions
Otherwise we have errors during applyStorageParams:

05-10 15:35:32.363   562   625 E IncrementalService: applyStorageParams failed: Status(-8, EX_SERVICE_SPECIFIC): '-95: '
05-10 15:35:32.363   562   625 E incfs-dataloaderconnector: setStorageParams failed with error: -95
05-10 15:35:32.363   562   625 E incfs-dataloaderconnector: DataLoader supports UID
05-10 15:35:32.367     0     0 E incfs   : Can't change sysfs_name mount option on remount

BUG: 187308584
Test: atest CtsContentTestCases:android.content.pm.cts.PackageManagerShellCommandIncrementalTest#testInstallWithIdSigNoMissingPages
Change-Id: Ic2146aa7855e13de9f96794639de556f64e93701
2021-05-11 10:18:22 -07:00
Alex Buynytskyy
e76e1ef510 Avoid sysfs name clashes.
Bug: 187437944
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest ApkVerityInstallTest
Change-Id: Idc8cb4d170b0bfd98ee3a10bdf57439801739757
2021-05-08 14:10:33 +00:00
Songchun Fan
e749b4b2c4 Merge "[incremental] report new metrics from Incremental Service" into sc-dev 2021-05-05 00:09:59 +00:00
Songchun Fan
0dc7772746 [incremental] report new metrics from Incremental Service
BUG: 184844615
Test: atest service.incremental_test
Change-Id: Ibbfe68851a4adfd620db9652f1fda550a3c6fb2c
2021-05-04 15:14:34 -07:00
Songchun Fan
30253adb74 Merge "[IncrementalService] add last read error in dumpsys" into sc-dev 2021-05-04 04:56:04 +00:00
Songchun Fan
7a76d7f713 Merge "[IncrementalService] use sysfs_name in mount options and dumpsys" into sc-dev 2021-05-04 00:14:40 +00:00
Songchun Fan
d48a25ee64 [IncrementalService] add last read error in dumpsys
BUG: 184844615
Test: dumpsys
Change-Id: I3e8178c8a62dc5d09c718b140bb48bda85a3bae5
2021-05-03 14:58:18 -07:00
Yurii Zubrytskyi
878714ab82 Add more info to IncrementalService::onDump()
+ suppress a couple lint warnings

Bug: 184844615
Test: manual + check the dump output
Change-Id: Ic1cf2a2fb519cc9e746c73816b1cb55f14d11279
2021-04-30 16:09:52 -07:00
Songchun Fan
f949c37e14 [IncrementalService] use sysfs_name in mount options and dumpsys
BUG: 184844615
Test: adb shell dumpsys incremental
Change-Id: Ib6bbbede6d4fbed0bcef8d37f377e706b9d1af28
2021-04-30 12:19:58 -07:00
Songchun Fan
03c3c1bbad Merge "[incremental] expose more metrics fields" into sc-dev 2021-04-27 00:34:08 +00:00
Songchun Fan
9471be56b4 [incremental] expose more metrics fields
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-26 14:17:36 -07:00
Alex Buynytskyy
de4b8230ab Retry on unavailable.
Bug: 182214420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: Iaf61b6825ced45ffdc7e9c87dfea830e50633476
2021-04-26 11:21:01 -07:00
TreeHugger Robot
18ecd98109 Merge "[pm] remove incremental startable/unstartable code" into sc-dev 2021-04-20 22:03:22 +00:00
TreeHugger Robot
5c6d0c5509 Merge "Move CtsInstalledLoadingProgressHostTests to group presubmit-large" into sc-dev 2021-04-20 02:32:47 +00:00
Steven Moreland
3c8c536978 reflect libbinder->libpermission: appops
Since libbinder is used in many places, lightening it up (vtables in
these classes contribute to private dirty memory).

Bug: 183654927
Test: boot
Change-Id: I73328013bfb701257eb88339f7da2cb92db6809e
2021-04-19 23:39:51 +00:00
easoncylee
25a14aff21 Move CtsInstalledLoadingProgressHostTests to group presubmit-large
The test config takes longer than 15mins to run. Move it to a dedicated
group for running slow presubmit Test Mapping test.

Some more context is in the referenced bug, e.g, b/174495337
The group will work exactly the same as presubmit for now.

Bug: 174654670
Bug: 174495337
Test: none
Change-Id: Id12caa8a87b6be142d49e8e871c6edb01ffbab6a
2021-04-19 03:00:20 +00:00
Songchun Fan
5ada1508c2 [pm] remove incremental startable/unstartable code
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-16 02:29:24 +00:00
Steven Moreland
c231a5b08d reflect libbinder->libpermission: appops
Since libbinder is used in many places, lightening it up (vtables in
these classes contribute to private dirty memory).

Bug: 183654927
Test: boot
Change-Id: I73328013bfb701257eb88339f7da2cb92db6809e
2021-04-13 01:03:50 +00:00
Alex Buynytskyy
f2af4d8806 Add storage state and installation ts to dump.
Bug: 160635296
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I524a92aa8c6a7b6961722dc3004a4bb323232297
2021-04-08 18:56:00 -07:00
Alex Buynytskyy
c144cc453a Installation hardening: reducing read timeout during installation.
And then restoring post-install.

Bug: 160635296
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest

Change-Id: I0821458bf92db162518a2cbcb7499cd7544e64f2
2021-04-08 09:57:54 +00:00
Alex Buynytskyy
5ac5553879 More logging and better retry logic.
Bug: 183551663
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I1b6da82cd4472cc5671b0b60fb12222b4ed08e17
2021-03-25 13:23:33 -07:00
Yurii Zubrytskyi
4cd2492576 [incfs] Space trimming for IncFS v1
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 15:05:17 +00:00
Yurii Zubrytskyi
9acc9acea5 [incfs] Fix the mount state callbacks processing
- 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-24 12:22:39 +00:00
Alex Buynytskyy
fef3257d39 Merge "Reduce ifs lock scope." into sc-dev 2021-03-24 12:03:28 +00:00
Alex Buynytskyy
779c7e1cf8 Merge "Add properties to test readlogs timeout." into sc-dev 2021-03-24 05:57:24 +00:00
Alex Buynytskyy
50d83ff1b3 Reduce ifs lock scope.
Bug: 182214420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: Ic36002205c93b316b28ba10ea8f5fbc50dcff70a
2021-03-23 22:50:15 -07:00
Alex Buynytskyy
bcb2fe0cbb Add properties to test readlogs timeout.
Bug: 182477087
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I02bc11b11f9158c31a80b845adb0703a27459332
2021-03-23 16:50:26 -07:00
Yurii Zubrytskyi
d0980160a3 Merge "[incfs] Optimize path::join for appending" into sc-dev 2021-03-23 23:09:05 +00:00
Alex Buynytskyy
7b3e06e1c2 Add a first chance retry delay of 1s.
Bug: 182214420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: Iade9e1355ed0e5e761a3a98f3a7bca8215982315
2021-03-23 12:59:22 -07:00
Yurii Zubrytskyi
fe807fd921 [incfs] Optimize path::join for appending
Append path strings to the first argument if it's an rvalue

Bug: 183435580
Test: atest libincfs-test service.incremental_test
Change-Id: I52c4a1f0e4ad3547aeccac96a3393323e3be9adb
2021-03-23 12:11:11 -07:00
Alex Buynytskyy
cb163f9bb6 Unbind from DataLoader when not needed anymore.
+ 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-23 02:01:06 +00:00
Yurii Zubrytskyi
0583e7f5c9 [incfs] Allow multiple timed jobs at the same time point
Old code had a tiny chance of ignoring a job if it happens to
be scheduled to the exactly the same time as one already in the
queue. Not that it will ever happen, but better to fix it.

+ make the worker thread code slightly easier to reason about

Bug: 183243150
Test: atest IncrementalServiceTest
Change-Id: Ia3126d30e19edfd17f7c8da368e9763ca5501e84
2021-03-19 17:00:12 -07:00
Yurii Zubrytskyi
f4769e2f5b Untangle listeners mess in IncrementalService
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 04:29:08 +00:00
Yurii Zubrytskyi
883a27a373 [incfs] Call the new isFullyLoaded api where possible
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-19 04:28:47 +00:00
Yurii Zubrytskyi
f5a6fb9996 [incfs] Fix the unsafe memory copy in IncrementalService
Better to protect the memcpy() and zero-out the target

Bug: 183160959
Test: atest IncrementalService
Change-Id: I3daca749168a8c5a32b1eedc7992006cbe2e9eb4
2021-03-19 04:26:32 +00:00
Yurii Zubrytskyi
4375a74535 [incfs] Use a more efficient getBlockCount() for incfs v2
v2 IncFS driver gives a very lightweight function to check the
loading progress on a file, use it instead of counting the
filled ranges

+ remove the unused mockable toString(IncFsFileId)

Bug: 183067554
Test: atest IncrementalServiceTest
Change-Id: Icd3bd891d671b27654f4194787a15a00cba1eb80
2021-03-19 03:46:40 +00:00
Yurii Zubrytskyi
256a1a4504 [incfs] Use the new libincfs API for file status checking
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-18 14:24:21 -07:00
Yurii Zubrytskyi
65fc38a029 [incfs] Preallocate space for IncFS files
Use the new libincfs APIs to preallocate space for all files
created via the public makeFile() API. This way we ensure
the device won't run out of space much later

Bug: 182185202
Test: atest libincfs-test PackageManagerShellCommandTest \
 PackageManagerShellCommandIncrementalTest \
 IncrementalServiceTest
Change-Id: I70af97949b29ff5db63201b0e3487fe026e23160
2021-03-17 13:21:10 -07:00
Alex Buynytskyy
d7aa3464da Limit read log reporting to 2hrs for non-system DLs (non-adb).
Bug: 182477087
Test: atest IncrementalServiceTest
Change-Id: I98c9ed3a2e8a91d26bcb879ab7073903ff7bb2c5
2021-03-16 04:12:21 +00:00
Alex Buynytskyy
3a88d55f0f Merge "DL lifecycle: handle slow DL binding." into sc-dev 2021-03-12 20:20:06 +00:00