summaryrefslogtreecommitdiff
path: root/aosp/dynamic_partition_control_android_unittest.cc
AgeCommit message (Collapse)Author
2021-05-05Rename postinstall_mount_device to readonly_target_pathKelvin Zhang
When postinstall_mount_device is initially introduced, it's only intended to be used by postinstall action, hence the name. Now we plan to use it for fs verification purpose as well, rename for better clarity. Test: th Change-Id: Iff996f2f513bb44694e39d758a69851793b9a565
2021-03-27Check the super partiton size in VAB caseTianjie
When the snapshot is used, we should check that the maximum size of all dynamic partition groups doesn't exceed the super partition size. Bug: 182431975 Test: primary payload fails as expected Pixel21 Change-Id: I5df8976e6b7e011284b29fd554dda80e31305698
2021-03-16Pass in source slot to ctor of dynamic controlKelvin Zhang
When DynamicPartitionControlAndroid is constructed, it initializes both source and target slot to -1. These values get updated during PreparePartitionsForUpdate call. And we only PreparePartitionsForUpdate() when applying an OTA or applocating space for an OTA(not when verifying OTA metadata). Which means if VerifyPayloadApplicable() is called before any call two other APIs, we could be using an "Uninitialiazed" dynamic partition control. To mitigate this problem, we pass in source_slot at ctor of DynamicPartitionControl, also make IsDynamicPartition() api take in a slot number to avoid reading uninitialized member fields. Bug: 181643302 Test: apply an OTA, abort, restart update_engine, verify a payload Change-Id: I9a8a0fe8a9aca48e91241e15bdec33a1c1228553
2021-03-02Fix incorrect mountable device path for VABCKelvin Zhang
Test: serve an OTA with postinstall, make sure postinstall works Bug: 181182967 Change-Id: Ifd44bb700c4bca28a391c64fbc9888c79612f26f
2021-02-17Use UpdateUsesSnapshotCompression to determine if VABC is usedKelvin Zhang
Test: th Change-Id: Ia04f92d46da34fcd28d7e97c24b6e02fd676e1c7
2021-01-25Correctly propagate not_in_payload flagKelvin Zhang
When mapping partitions, not_in_payload flag decides if the partition needs to be mapped as a snapshot backed by COW, propagate this flag. Test: treehugger Change-Id: I9f0073fb91067410978927e59bf51c4f2cd152e6
2020-11-23Do not map dynamic partitions on VABC devicesKelvin Zhang
With VABC, we no longer need to map all partitions before reading/writing, so don't try to map them. 1. modify GetPartitionDevice to return empty path for target partitions on VABC 2. Add a separate GetMountableTargetDevice for obtaining a mountable device path, specifically for postinstall Test: treehugger Change-Id: Ib1f608914fc49c677ce7389140ca79b028171191
2020-11-16Rename mock_dynamic_partition_control toKelvin Zhang
mock_dynamic_partition_control_android The mock contains android specific behaviors, so appending the filename with "android" Test: treehugger Change-Id: Ic6e53e07a4645e4f854c1fb22e0fa9f7f911bef3
2020-11-03update_engine: Create cros vs. aosp boundary clearAmin Hassani
Its time to make the boundary between Chrome OS and Android code more clear. This CL moves all CrOS only code to "chromeos" directory and the same for Android (in "android" directory). This way we would easily know which code is uses in which project and can keep the code cleaner and more maintainable. One big remaining problem is download_action* files. It seems like DownloadAction class does a lot of things that chrome OS needs and it depends on a lot of Chrome OS stuff, but Android is also using thie Action in a way that circumvent the Chrome OS stuff. For example Android checks for SystemState to be nullptr to not do things. This is really fragile and needs to change. Probably Android Team has to implement their own DownloadAction of some sort and not re use the Chrome OS one in a very fragile way. Removed a few android files that have not been used anywhere. Changed some clang-format and lint issues in order to pass preupload. BUG=b:171829801 TEST=cros_workon_make --board reef --test update_engine Change-Id: I3fff1d4a100a065a5c1484a845241b5521614d9f Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2508965 Tested-by: Amin Hassani <ahassani@chromium.org> Auto-Submit: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Reviewed-by: Tianjie Xu <xunchang@google.com> Reviewed-by: Kelvin Zhang <zhangkelvin@google.com> Commit-Queue: Amin Hassani <ahassani@chromium.org>