Commit Graph

198 Commits

Author SHA1 Message Date
Krzysztof Kosiński
4a21587a87 Merge "Explicitly discard released proto strings in test." 2022-09-30 05:19:11 +00:00
Krzysztof Kosiński
0658df7f02 Explicitly discard released proto strings in test.
In newer releases of the protobuf library, the release_* methods
are marked [[nodiscard]], which causes a compilation error here.

Bug: 203713560
Test: presubmit
Change-Id: If8c6392a5d36014f1839deaaf241b636610add71
2022-09-30 02:35:48 +00:00
Krzysztof Kosiński
e98eb9e6fe Explicitly discard released proto strings.
In newer releases of the protobuf library, the release_* methods
are marked [[nodiscard]], which causes a compilation error here.

Bug: 203713560
Test: presubmit
Change-Id: I44a9d52730bdc199e34cb25be959a955fff8f128
2022-09-25 08:12:47 +00:00
Ryan Prichard
8ebb1dd972 incfs: tolerate either ptrdiff_t or size_t for std::span
The out-of-date std::span in external/libcxx currently uses ptrdiff_t
as the type of size() and the second ctor argument. The C++20 std::span
actually uses size_t for these values instead. Try to accommodate both
versions of std::span until libc++ is upgraded.

Bug: http://b/175635923
Test: treehugger
Change-Id: Idc43f880b6eb21dad79e79fa456847d5865a1ed2
2022-09-01 13:28:54 -07:00
Alex Buynytskyy
a3a7732e89 Mark all installations using PMSC as "ADB".
This will allow tests to disable verification on case-by-case basis.

Bug: 224017187
Bug: 220086205
Test: atest PackageManagerShellCommandTest ResourcesHardeningTest PackageManagerShellCommandIncrementalTest ChecksumsTest
Change-Id: Ie0e77f1cbc52b7fe56e00e8b0b36f47b2422391b
2022-03-21 16:08:28 +00:00
Felka Chang
ca1bbb6254 Organize incremental test plan for PackageManager
This patch adds libincfs-test and service.incremental_test in the
presubmit process.

Test: atest service.incremental_test
Test: atest libincfs-test
Test: atest -p system/incremental_delivery/incfs
    http://ab/I24700010005521991

Bug: 180650365
Change-Id: Iaea12556d398893875c4ab3bb928477103fa7c18
2022-01-05 00:54:35 +08:00
Treehugger Robot
5c5f8ff629 Merge "[services.incremental] Use shared libutils for remount" am: 44233c693c am: bdf15f2234 am: 65ee23bba4 am: a00b50e072 am: cfa0cf527d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1810680

Change-Id: I33e5ac11f43881354caf318a68c47cd6f5763ece
2021-09-01 19:32:36 +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
Jackal Guo
ccc91c4fa9 Move CtsContentTestCases to group presubmit-large
The test config takes longer than 900 seconds 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: treehugger
Change-Id: Id9769bbc625b42257af603d69098ae69c0fabb80
2021-08-25 16:47:25 +08: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