1 /*
2 * Copyright (C) 2020 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
19 namespace android {
20 namespace hardware {
21 namespace fastboot {
22 namespace V1_1 {
23 namespace implementation {
24
25 // Methods from ::android::hardware::fastboot::V1_1::IFastboot follow.
getPartitionType(const hidl_string &,getPartitionType_cb _hidl_cb)26 Return<void> Fastboot::getPartitionType(const hidl_string& /* partitionName */,
27 getPartitionType_cb _hidl_cb) {
28 _hidl_cb(FileSystemType::RAW, {Status::SUCCESS, ""});
29 return Void();
30 }
31
doOemCommand(const hidl_string &,doOemCommand_cb _hidl_cb)32 Return<void> Fastboot::doOemCommand(const hidl_string& /* oemCmd */, doOemCommand_cb _hidl_cb) {
33 _hidl_cb({Status::FAILURE_UNKNOWN, "Command not supported in default implementation"});
34 return Void();
35 }
36
getVariant(getVariant_cb _hidl_cb)37 Return<void> Fastboot::getVariant(getVariant_cb _hidl_cb) {
38 _hidl_cb("NA", {Status::SUCCESS, ""});
39 return Void();
40 }
41
getOffModeChargeState(getOffModeChargeState_cb _hidl_cb)42 Return<void> Fastboot::getOffModeChargeState(getOffModeChargeState_cb _hidl_cb) {
43 _hidl_cb(false, {Status::SUCCESS, ""});
44 return Void();
45 }
46
getBatteryVoltageFlashingThreshold(getBatteryVoltageFlashingThreshold_cb _hidl_cb)47 Return<void> Fastboot::getBatteryVoltageFlashingThreshold(
48 getBatteryVoltageFlashingThreshold_cb _hidl_cb) {
49 _hidl_cb(0, {Status::SUCCESS, ""});
50 return Void();
51 }
52
doOemSpecificErase(doOemSpecificErase_cb _hidl_cb)53 Return<void> Fastboot::doOemSpecificErase(doOemSpecificErase_cb _hidl_cb) {
54 _hidl_cb({Status::NOT_SUPPORTED, "Command not supported in default implementation"});
55 return Void();
56 }
57
HIDL_FETCH_IFastboot(const char *)58 extern "C" IFastboot* HIDL_FETCH_IFastboot(const char* /* name */) {
59 return new Fastboot();
60 }
61
62 } // namespace implementation
63 } // namespace V1_1
64 } // namespace fastboot
65 } // namespace hardware
66 } // namespace android
67