blob: cfc9e2eeff86d0490f1831f58cfd5f7e46ed6a6d [file] [log] [blame]
Yifan Hongdaac7322019-11-07 10:48:26 -08001//
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 Hong90965502020-02-19 15:22:47 -080019#include <memory>
Yifan Hongdaac7322019-11-07 10:48:26 -080020#include <string>
21
22#include <base/logging.h>
Kelvin Zhang34618522020-09-28 09:21:02 -040023#include <libsnapshot/cow_writer.h>
Yifan Hongdaac7322019-11-07 10:48:26 -080024
25#include "update_engine/common/dynamic_partition_control_stub.h"
26
27namespace chromeos_update_engine {
28
29FeatureFlag DynamicPartitionControlStub::GetDynamicPartitionsFeatureFlag() {
30 return FeatureFlag(FeatureFlag::Value::NONE);
31}
32
33FeatureFlag DynamicPartitionControlStub::GetVirtualAbFeatureFlag() {
34 return FeatureFlag(FeatureFlag::Value::NONE);
35}
36
Kelvin Zhangda1b3142020-09-24 17:09:02 -040037FeatureFlag DynamicPartitionControlStub::GetVirtualAbCompressionFeatureFlag() {
38 return FeatureFlag(FeatureFlag::Value::NONE);
39}
40
Yifan Hongf5261562020-03-10 10:28:10 -070041bool DynamicPartitionControlStub::OptimizeOperation(
42 const std::string& partition_name,
43 const InstallOperation& operation,
44 InstallOperation* optimized) {
Alessio Balsini14980e22019-11-26 11:46:06 +000045 return false;
46}
47
Yifan Hongdaac7322019-11-07 10:48:26 -080048void DynamicPartitionControlStub::Cleanup() {}
49
50bool DynamicPartitionControlStub::PreparePartitionsForUpdate(
51 uint32_t source_slot,
52 uint32_t target_slot,
53 const DeltaArchiveManifest& manifest,
Yifan Hongf033ecb2020-01-07 18:13:56 -080054 bool update,
55 uint64_t* required_size) {
Yifan Hongdaac7322019-11-07 10:48:26 -080056 return true;
57}
58
Yifan Hong7b3910a2020-03-24 17:47:32 -070059bool DynamicPartitionControlStub::FinishUpdate(bool powerwash_required) {
Yifan Hongdaac7322019-11-07 10:48:26 -080060 return true;
61}
62
Yifan Hong90965502020-02-19 15:22:47 -080063std::unique_ptr<AbstractAction>
64DynamicPartitionControlStub::GetCleanupPreviousUpdateAction(
65 BootControlInterface* boot_control,
66 PrefsInterface* prefs,
67 CleanupPreviousUpdateActionDelegateInterface* delegate) {
68 return std::make_unique<NoOpAction>();
69}
70
Yifan Hong6a6d0f12020-03-11 13:20:52 -070071bool DynamicPartitionControlStub::ResetUpdate(PrefsInterface* prefs) {
72 return false;
73}
74
Tianjie99d570d2020-06-04 14:57:19 -070075bool DynamicPartitionControlStub::ListDynamicPartitionsForSlot(
76 uint32_t current_slot, std::vector<std::string>* partitions) {
77 return true;
78}
79
80bool DynamicPartitionControlStub::GetDeviceDir(std::string* path) {
81 return true;
82}
83
Tianjie24f96092020-06-30 12:26:25 -070084bool DynamicPartitionControlStub::VerifyExtentsForUntouchedPartitions(
85 uint32_t source_slot,
86 uint32_t target_slot,
87 const std::vector<std::string>& partitions) {
88 return true;
89}
90
Kelvin Zhang34618522020-09-28 09:21:02 -040091std::unique_ptr<android::snapshot::ISnapshotWriter>
92DynamicPartitionControlStub::OpenCowWriter(
93 const std::string& /*unsuffixed_partition_name*/,
94 const std::optional<std::string>& /*source_path*/,
95 bool /*is_append*/) {
96 return nullptr;
97}
98
Kelvin Zhang9d87d6d2020-10-23 17:03:59 -040099bool DynamicPartitionControlStub::MapAllPartitions() {
100 return false;
101}
102
103bool DynamicPartitionControlStub::UnmapAllPartitions() {
104 return false;
105}
106
Yifan Hongdaac7322019-11-07 10:48:26 -0800107} // namespace chromeos_update_engine