1 /* 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 22 class FastbootDevice; 23 24 bool GetVersion(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 25 bool GetBootloaderVersion(FastbootDevice* device, const std::vector<std::string>& args, 26 std::string* message); 27 bool GetBasebandVersion(FastbootDevice* device, const std::vector<std::string>& args, 28 std::string* message); 29 bool GetOsVersion(FastbootDevice* device, const std::vector<std::string>& args, 30 std::string* message); 31 bool GetVndkVersion(FastbootDevice* device, const std::vector<std::string>& args, 32 std::string* message); 33 bool GetProduct(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 34 bool GetSerial(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 35 bool GetSecure(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 36 bool GetCurrentSlot(FastbootDevice* device, const std::vector<std::string>& args, 37 std::string* message); 38 bool GetSlotCount(FastbootDevice* device, const std::vector<std::string>& args, 39 std::string* message); 40 bool GetSlotSuccessful(FastbootDevice* device, const std::vector<std::string>& args, 41 std::string* message); 42 bool GetSlotUnbootable(FastbootDevice* device, const std::vector<std::string>& args, 43 std::string* message); 44 bool GetMaxDownloadSize(FastbootDevice* device, const std::vector<std::string>& args, 45 std::string* message); 46 bool GetUnlocked(FastbootDevice* device, const std::vector<std::string>& args, 47 std::string* message); 48 bool GetHasSlot(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 49 bool GetPartitionSize(FastbootDevice* device, const std::vector<std::string>& args, 50 std::string* message); 51 bool GetPartitionType(FastbootDevice* device, const std::vector<std::string>& args, 52 std::string* message); 53 bool GetPartitionIsLogical(FastbootDevice* device, const std::vector<std::string>& args, 54 std::string* message); 55 bool GetIsUserspace(FastbootDevice* device, const std::vector<std::string>& args, 56 std::string* message); 57 bool GetIsForceDebuggable(FastbootDevice* device, const std::vector<std::string>& args, 58 std::string* message); 59 bool GetHardwareRevision(FastbootDevice* device, const std::vector<std::string>& args, 60 std::string* message); 61 bool GetVariant(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 62 bool GetOffModeChargeState(FastbootDevice* device, const std::vector<std::string>& args, 63 std::string* message); 64 bool GetBatteryVoltage(FastbootDevice* device, const std::vector<std::string>& args, 65 std::string* message); 66 bool GetBatterySoC(FastbootDevice* device, const std::vector<std::string>& args, 67 std::string* message); 68 bool GetBatterySoCOk(FastbootDevice* device, const std::vector<std::string>& args, 69 std::string* message); 70 bool GetBatterySerialNumber(FastbootDevice* device, const std::vector<std::string>& args, 71 std::string* message); 72 bool GetBatteryPartStatus(FastbootDevice* device, const std::vector<std::string>& args, 73 std::string* message); 74 bool GetSuperPartitionName(FastbootDevice* device, const std::vector<std::string>& args, 75 std::string* message); 76 bool GetSnapshotUpdateStatus(FastbootDevice* device, const std::vector<std::string>& args, 77 std::string* message); 78 bool GetCpuAbi(FastbootDevice* device, const std::vector<std::string>& args, std::string* message); 79 bool GetSystemFingerprint(FastbootDevice* device, const std::vector<std::string>& args, 80 std::string* message); 81 bool GetVendorFingerprint(FastbootDevice* device, const std::vector<std::string>& args, 82 std::string* message); 83 bool GetDynamicPartition(FastbootDevice* device, const std::vector<std::string>& args, 84 std::string* message); 85 bool GetFirstApiLevel(FastbootDevice* device, const std::vector<std::string>& args, 86 std::string* message); 87 bool GetSecurityPatchLevel(FastbootDevice* device, const std::vector<std::string>& args, 88 std::string* message); 89 bool GetTrebleEnabled(FastbootDevice* device, const std::vector<std::string>& args, 90 std::string* message); 91 bool GetMaxFetchSize(FastbootDevice* /* device */, const std::vector<std::string>& /* args */, 92 std::string* message); 93 94 // Complex cases. 95 bool GetDmesg(FastbootDevice* device); 96 97 // Helpers for getvar all. 98 std::vector<std::vector<std::string>> GetAllPartitionArgsWithSlot(FastbootDevice* device); 99 std::vector<std::vector<std::string>> GetAllPartitionArgsNoSlot(FastbootDevice* device); 100