blob: 7d681cfa90680868b98e38ba33fc612e25e62147 [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
Daniel Zheng0c1648c2023-04-12 10:57:44 -070041FeatureFlag
42DynamicPartitionControlStub::GetVirtualAbCompressionXorFeatureFlag() {
Kelvin Zhang1c4b9812022-04-06 17:29:00 -070043 return FeatureFlag(FeatureFlag::Value::NONE);
44}
45
David Andersone35b4382022-03-08 23:18:29 -080046FeatureFlag
47DynamicPartitionControlStub::GetVirtualAbUserspaceSnapshotsFeatureFlag() {
48 return FeatureFlag(FeatureFlag::Value::NONE);
49}
50
Yifan Hongf5261562020-03-10 10:28:10 -070051bool DynamicPartitionControlStub::OptimizeOperation(
52 const std::string& partition_name,
53 const InstallOperation& operation,
54 InstallOperation* optimized) {
Alessio Balsini14980e22019-11-26 11:46:06 +000055 return false;
56}
57
Yifan Hongdaac7322019-11-07 10:48:26 -080058void DynamicPartitionControlStub::Cleanup() {}
59
60bool DynamicPartitionControlStub::PreparePartitionsForUpdate(
61 uint32_t source_slot,
62 uint32_t target_slot,
63 const DeltaArchiveManifest& manifest,
Yifan Hongf033ecb2020-01-07 18:13:56 -080064 bool update,
Daniel Zhengeede4c82023-06-13 11:21:06 -070065 uint64_t* required_size,
66 ErrorCode* error) {
Yifan Hongdaac7322019-11-07 10:48:26 -080067 return true;
68}
69
Yifan Hong7b3910a2020-03-24 17:47:32 -070070bool DynamicPartitionControlStub::FinishUpdate(bool powerwash_required) {
Yifan Hongdaac7322019-11-07 10:48:26 -080071 return true;
72}
73
Yifan Hong90965502020-02-19 15:22:47 -080074std::unique_ptr<AbstractAction>
75DynamicPartitionControlStub::GetCleanupPreviousUpdateAction(
76 BootControlInterface* boot_control,
77 PrefsInterface* prefs,
78 CleanupPreviousUpdateActionDelegateInterface* delegate) {
79 return std::make_unique<NoOpAction>();
80}
81
Yifan Hong6a6d0f12020-03-11 13:20:52 -070082bool DynamicPartitionControlStub::ResetUpdate(PrefsInterface* prefs) {
83 return false;
84}
85
Tianjie99d570d2020-06-04 14:57:19 -070086bool DynamicPartitionControlStub::ListDynamicPartitionsForSlot(
Tianjie3a55fc22021-02-13 16:02:22 -080087 uint32_t slot,
88 uint32_t current_slot,
89 std::vector<std::string>* partitions) {
Tianjie99d570d2020-06-04 14:57:19 -070090 return true;
91}
92
93bool DynamicPartitionControlStub::GetDeviceDir(std::string* path) {
94 return true;
95}
96
Tianjie24f96092020-06-30 12:26:25 -070097bool DynamicPartitionControlStub::VerifyExtentsForUntouchedPartitions(
98 uint32_t source_slot,
99 uint32_t target_slot,
100 const std::vector<std::string>& partitions) {
101 return true;
102}
103
David Andersona4b7ba62023-05-10 21:41:37 -0700104std::unique_ptr<android::snapshot::ICowWriter>
Kelvin Zhang34618522020-09-28 09:21:02 -0400105DynamicPartitionControlStub::OpenCowWriter(
106 const std::string& /*unsuffixed_partition_name*/,
107 const std::optional<std::string>& /*source_path*/,
David Andersona4b7ba62023-05-10 21:41:37 -0700108 std::optional<uint64_t>) {
Kelvin Zhang34618522020-09-28 09:21:02 -0400109 return nullptr;
110}
111
Kelvin Zhang9d87d6d2020-10-23 17:03:59 -0400112bool DynamicPartitionControlStub::MapAllPartitions() {
113 return false;
114}
115
116bool DynamicPartitionControlStub::UnmapAllPartitions() {
117 return false;
118}
119
Kelvin Zhangeb9de162020-11-16 15:47:28 -0500120bool DynamicPartitionControlStub::IsDynamicPartition(
Kelvin Zhangebd115e2021-03-08 16:10:25 -0500121 const std::string& part_name, uint32_t slot) {
Kelvin Zhangeb9de162020-11-16 15:47:28 -0500122 return false;
123}
124
Yifan Hongb0cbd392021-02-04 11:11:45 -0800125bool DynamicPartitionControlStub::UpdateUsesSnapshotCompression() {
126 return false;
127}
128
Yifan Hongdaac7322019-11-07 10:48:26 -0800129} // namespace chromeos_update_engine