Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2019 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | #include <stdint.h> |
| 18 | |
Yifan Hong | 9096550 | 2020-02-19 15:22:47 -0800 | [diff] [blame^] | 19 | #include <memory> |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 20 | #include <string> |
| 21 | |
| 22 | #include <base/logging.h> |
| 23 | |
| 24 | #include "update_engine/common/dynamic_partition_control_stub.h" |
| 25 | |
| 26 | namespace chromeos_update_engine { |
| 27 | |
| 28 | FeatureFlag DynamicPartitionControlStub::GetDynamicPartitionsFeatureFlag() { |
| 29 | return FeatureFlag(FeatureFlag::Value::NONE); |
| 30 | } |
| 31 | |
| 32 | FeatureFlag DynamicPartitionControlStub::GetVirtualAbFeatureFlag() { |
| 33 | return FeatureFlag(FeatureFlag::Value::NONE); |
| 34 | } |
| 35 | |
Alessio Balsini | 14980e2 | 2019-11-26 11:46:06 +0000 | [diff] [blame] | 36 | bool DynamicPartitionControlStub::ShouldSkipOperation( |
Yifan Hong | 6eec995 | 2019-12-04 13:12:01 -0800 | [diff] [blame] | 37 | const std::string& partition_name, const InstallOperation& operation) { |
Alessio Balsini | 14980e2 | 2019-11-26 11:46:06 +0000 | [diff] [blame] | 38 | return false; |
| 39 | } |
| 40 | |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 41 | void DynamicPartitionControlStub::Cleanup() {} |
| 42 | |
| 43 | bool DynamicPartitionControlStub::PreparePartitionsForUpdate( |
| 44 | uint32_t source_slot, |
| 45 | uint32_t target_slot, |
| 46 | const DeltaArchiveManifest& manifest, |
Yifan Hong | f033ecb | 2020-01-07 18:13:56 -0800 | [diff] [blame] | 47 | bool update, |
| 48 | uint64_t* required_size) { |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 49 | return true; |
| 50 | } |
| 51 | |
| 52 | bool DynamicPartitionControlStub::FinishUpdate() { |
| 53 | return true; |
| 54 | } |
| 55 | |
Yifan Hong | 2257ee1 | 2020-01-13 18:33:00 -0800 | [diff] [blame] | 56 | ErrorCode DynamicPartitionControlStub::CleanupSuccessfulUpdate() { |
| 57 | return ErrorCode::kError; |
| 58 | } |
| 59 | |
Yifan Hong | 9096550 | 2020-02-19 15:22:47 -0800 | [diff] [blame^] | 60 | std::unique_ptr<AbstractAction> |
| 61 | DynamicPartitionControlStub::GetCleanupPreviousUpdateAction( |
| 62 | BootControlInterface* boot_control, |
| 63 | PrefsInterface* prefs, |
| 64 | CleanupPreviousUpdateActionDelegateInterface* delegate) { |
| 65 | return std::make_unique<NoOpAction>(); |
| 66 | } |
| 67 | |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 68 | } // namespace chromeos_update_engine |