summaryrefslogtreecommitdiff
path: root/aosp/mock_dynamic_partition_control_android.h
AgeCommit message (Collapse)Author
2021-03-24Make dynamic partition control android return a writable fdKelvin Zhang
We can return a FileDescriptor object, which encapsulates logic needed to write to a COW. This way, filesystem verfication action can use the turend value directly for computing verity and hash the partition. Test: th Change-Id: Iafe9699ef0cc15961641fc94f8ad2820230a56e1
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-02-10Add DynamicPartitionControlInterface::UpdateUsesSnapshotCompressionYifan Hong
This function returns whether Virtual A/B compression is enabled for the ongoing update. Test: TH Bug: 178732971 Change-Id: I781802443afd1d8deac046a8da198658220f7ba0
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-17Add IsDynamicPartition API to easily check if a partition is dynamicKelvin Zhang
Test: treehugger Change-Id: I655e4d6114a25c58857679985cd5e08581c0faab
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