blob: ac11faff1ddfa395afbcb502f7129a0fc3ba63df [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
Kelvin Zhang1c4b9812022-04-06 17:29:00 -070041FeatureFlag DynamicPartitionControlStub::GetVirtualAbCompressionXorFeatureFlag() {
42 return FeatureFlag(FeatureFlag::Value::NONE);
43}
44
David Andersone35b4382022-03-08 23:18:29 -080045FeatureFlag
46DynamicPartitionControlStub::GetVirtualAbUserspaceSnapshotsFeatureFlag() {
47 return FeatureFlag(FeatureFlag::Value::NONE);
48}
49
Yifan Hongf5261562020-03-10 10:28:10 -070050bool DynamicPartitionControlStub::OptimizeOperation(
51 const std::string& partition_name,
52 const InstallOperation& operation,
53 InstallOperation* optimized) {
Alessio Balsini14980e22019-11-26 11:46:06 +000054 return false;
55}
56
Yifan Hongdaac7322019-11-07 10:48:26 -080057void DynamicPartitionControlStub::Cleanup() {}
58
59bool DynamicPartitionControlStub::PreparePartitionsForUpdate(
60 uint32_t source_slot,
61 uint32_t target_slot,
62 const DeltaArchiveManifest& manifest,
Yifan Hongf033ecb2020-01-07 18:13:56 -080063 bool update,
64 uint64_t* required_size) {
Yifan Hongdaac7322019-11-07 10:48:26 -080065 return true;
66}
67
Yifan Hong7b3910a2020-03-24 17:47:32 -070068bool DynamicPartitionControlStub::FinishUpdate(bool powerwash_required) {
Yifan Hongdaac7322019-11-07 10:48:26 -080069 return true;
70}
71
Yifan Hong90965502020-02-19 15:22:47 -080072std::unique_ptr<AbstractAction>
73DynamicPartitionControlStub::GetCleanupPreviousUpdateAction(
74 BootControlInterface* boot_control,
75 PrefsInterface* prefs,
76 CleanupPreviousUpdateActionDelegateInterface* delegate) {
77 return std::make_unique<NoOpAction>();
78}
79
Yifan Hong6a6d0f12020-03-11 13:20:52 -070080bool DynamicPartitionControlStub::ResetUpdate(PrefsInterface* prefs) {
81 return false;
82}
83
Tianjie99d570d2020-06-04 14:57:19 -070084bool DynamicPartitionControlStub::ListDynamicPartitionsForSlot(
Tianjie3a55fc22021-02-13 16:02:22 -080085 uint32_t slot,
86 uint32_t current_slot,
87 std::vector<std::string>* partitions) {
Tianjie99d570d2020-06-04 14:57:19 -070088 return true;
89}
90
91bool DynamicPartitionControlStub::GetDeviceDir(std::string* path) {
92 return true;
93}
94
Tianjie24f96092020-06-30 12:26:25 -070095bool DynamicPartitionControlStub::VerifyExtentsForUntouchedPartitions(
96 uint32_t source_slot,
97 uint32_t target_slot,
98 const std::vector<std::string>& partitions) {
99 return true;
100}
101
Kelvin Zhang34618522020-09-28 09:21:02 -0400102std::unique_ptr<android::snapshot::ISnapshotWriter>
103DynamicPartitionControlStub::OpenCowWriter(
104 const std::string& /*unsuffixed_partition_name*/,
105 const std::optional<std::string>& /*source_path*/,
106 bool /*is_append*/) {
107 return nullptr;
108}
109
Kelvin Zhang9d87d6d2020-10-23 17:03:59 -0400110bool DynamicPartitionControlStub::MapAllPartitions() {
111 return false;
112}
113
114bool DynamicPartitionControlStub::UnmapAllPartitions() {
115 return false;
116}
117
Kelvin Zhangeb9de162020-11-16 15:47:28 -0500118bool DynamicPartitionControlStub::IsDynamicPartition(
Kelvin Zhangebd115e2021-03-08 16:10:25 -0500119 const std::string& part_name, uint32_t slot) {
Kelvin Zhangeb9de162020-11-16 15:47:28 -0500120 return false;
121}
122
Yifan Hongb0cbd392021-02-04 11:11:45 -0800123bool DynamicPartitionControlStub::UpdateUsesSnapshotCompression() {
124 return false;
125}
126
Yifan Hongdaac7322019-11-07 10:48:26 -0800127} // namespace chromeos_update_engine