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 | |
Yifan Hong | f526156 | 2020-03-10 10:28:10 -0700 | [diff] [blame] | 36 | bool DynamicPartitionControlStub::OptimizeOperation( |
| 37 | const std::string& partition_name, |
| 38 | const InstallOperation& operation, |
| 39 | InstallOperation* optimized) { |
Alessio Balsini | 14980e2 | 2019-11-26 11:46:06 +0000 | [diff] [blame] | 40 | return false; |
| 41 | } |
| 42 | |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 43 | void DynamicPartitionControlStub::Cleanup() {} |
| 44 | |
| 45 | bool DynamicPartitionControlStub::PreparePartitionsForUpdate( |
| 46 | uint32_t source_slot, |
| 47 | uint32_t target_slot, |
| 48 | const DeltaArchiveManifest& manifest, |
Yifan Hong | f033ecb | 2020-01-07 18:13:56 -0800 | [diff] [blame] | 49 | bool update, |
| 50 | uint64_t* required_size) { |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 51 | return true; |
| 52 | } |
| 53 | |
Yifan Hong | 7b3910a | 2020-03-24 17:47:32 -0700 | [diff] [blame^] | 54 | bool DynamicPartitionControlStub::FinishUpdate(bool powerwash_required) { |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 55 | return true; |
| 56 | } |
| 57 | |
Yifan Hong | 9096550 | 2020-02-19 15:22:47 -0800 | [diff] [blame] | 58 | std::unique_ptr<AbstractAction> |
| 59 | DynamicPartitionControlStub::GetCleanupPreviousUpdateAction( |
| 60 | BootControlInterface* boot_control, |
| 61 | PrefsInterface* prefs, |
| 62 | CleanupPreviousUpdateActionDelegateInterface* delegate) { |
| 63 | return std::make_unique<NoOpAction>(); |
| 64 | } |
| 65 | |
Yifan Hong | 6a6d0f1 | 2020-03-11 13:20:52 -0700 | [diff] [blame] | 66 | bool DynamicPartitionControlStub::ResetUpdate(PrefsInterface* prefs) { |
| 67 | return false; |
| 68 | } |
| 69 | |
Yifan Hong | daac732 | 2019-11-07 10:48:26 -0800 | [diff] [blame] | 70 | } // namespace chromeos_update_engine |