blob: 1ba73d36dee93e1aacbbf4a20b03a7496d9c4ea0 [file] [log] [blame]
Sandeep Dhavale7bc10fb2022-10-04 21:44:18 +00001/*
2 * Copyright (C) 2022 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 "Fastboot.h"
18
19using ndk::ScopedAStatus;
20
21namespace aidl {
22namespace android {
23namespace hardware {
24namespace fastboot {
25
26ScopedAStatus Fastboot::getPartitionType(const std::string& in_partitionName,
27 FileSystemType* _aidl_return) {
28 if (in_partitionName.empty()) {
29 return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
30 "Invalid partition name");
31 }
32 *_aidl_return = FileSystemType::RAW;
33 return ScopedAStatus::ok();
34}
35
36ScopedAStatus Fastboot::doOemCommand(const std::string& in_oemCmd, std::string* _aidl_return) {
37 *_aidl_return = "";
38 if (in_oemCmd.empty()) {
39 return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "Invalid command");
40 }
41 return ScopedAStatus::fromExceptionCodeWithMessage(
42 EX_UNSUPPORTED_OPERATION, "Command not supported in default implementation");
43}
44
45ScopedAStatus Fastboot::getVariant(std::string* _aidl_return) {
46 *_aidl_return = "NA";
47 return ScopedAStatus::ok();
48}
49
50ScopedAStatus Fastboot::getOffModeChargeState(bool* _aidl_return) {
51 *_aidl_return = false;
52 return ScopedAStatus::ok();
53}
54
55ScopedAStatus Fastboot::getBatteryVoltageFlashingThreshold(int32_t* _aidl_return) {
56 *_aidl_return = 0;
57 return ScopedAStatus::ok();
58}
59
60ScopedAStatus Fastboot::doOemSpecificErase() {
61 return ScopedAStatus::fromExceptionCodeWithMessage(
62 EX_UNSUPPORTED_OPERATION, "Command not supported in default implementation");
63}
64
65} // namespace fastboot
66} // namespace hardware
67} // namespace android
68} // namespace aidl