blob: 0b502e0c3ccb6db3a798368e76f26dc8fd47137f [file] [log] [blame]
josephjang72c410d2020-09-24 09:51:08 +08001/*
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
19namespace android {
20namespace hardware {
21namespace fastboot {
22namespace V1_1 {
23namespace implementation {
24
25// Methods from ::android::hardware::fastboot::V1_1::IFastboot follow.
26Return<void> Fastboot::getPartitionType(const hidl_string& /* partitionName */,
27 getPartitionType_cb _hidl_cb) {
28 _hidl_cb(FileSystemType::RAW, {Status::SUCCESS, ""});
29 return Void();
30}
31
32Return<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
37Return<void> Fastboot::getVariant(getVariant_cb _hidl_cb) {
38 _hidl_cb("NA", {Status::SUCCESS, ""});
39 return Void();
40}
41
42Return<void> Fastboot::getOffModeChargeState(getOffModeChargeState_cb _hidl_cb) {
43 _hidl_cb(false, {Status::SUCCESS, ""});
44 return Void();
45}
46
47Return<void> Fastboot::getBatteryVoltageFlashingThreshold(
48 getBatteryVoltageFlashingThreshold_cb _hidl_cb) {
49 _hidl_cb(0, {Status::SUCCESS, ""});
50 return Void();
51}
52
53Return<void> Fastboot::doOemSpecificErase(doOemSpecificErase_cb _hidl_cb) {
54 _hidl_cb({Status::NOT_SUPPORTED, "Command not supported in default implementation"});
55 return Void();
56}
57
58extern "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