blob: 4778d23509f1eece0a0a679da463f28537c111da [file] [log] [blame]
Hridya Valsarajudea91b42018-07-17 11:14:01 -07001/*
2 * Copyright (C) 2018 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#pragma once
17
18#include <functional>
19#include <string>
20#include <vector>
21
22class FastbootDevice;
23
24enum class FastbootResult {
25 OKAY,
26 FAIL,
27 INFO,
28 DATA,
29};
30
31// Execute a command with the given arguments (possibly empty).
32using CommandHandler = std::function<bool(FastbootDevice*, const std::vector<std::string>&)>;
33
34bool DownloadHandler(FastbootDevice* device, const std::vector<std::string>& args);
35bool SetActiveHandler(FastbootDevice* device, const std::vector<std::string>& args);
36bool ShutDownHandler(FastbootDevice* device, const std::vector<std::string>& args);
37bool RebootHandler(FastbootDevice* device, const std::vector<std::string>& args);
38bool RebootBootloaderHandler(FastbootDevice* device, const std::vector<std::string>& args);
39bool RebootFastbootHandler(FastbootDevice* device, const std::vector<std::string>& args);
40bool RebootRecoveryHandler(FastbootDevice* device, const std::vector<std::string>& args);
Hridya Valsaraju31d2c262018-07-20 13:35:50 -070041bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args);
David Anderson12211d12018-07-24 15:21:20 -070042bool EraseHandler(FastbootDevice* device, const std::vector<std::string>& args);
43bool FlashHandler(FastbootDevice* device, const std::vector<std::string>& args);
David Anderson0d4277d2018-07-31 13:27:37 -070044bool CreatePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args);
45bool DeletePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args);
46bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args);
David Anderson38b3c7a2018-08-15 16:27:42 -070047bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args);