blob: 787b7747b66f6005287625c0377b088d7603378c [file] [log] [blame]
Adam Shih4353cfb2023-03-22 11:26:34 +08001/*
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#pragma once
18
19#include <aidl/android/hardware/dumpstate/BnDumpstateDevice.h>
20#include <aidl/android/hardware/dumpstate/IDumpstateDevice.h>
21#include <android/binder_status.h>
22
23namespace aidl {
24namespace android {
25namespace hardware {
26namespace dumpstate {
27
28class Dumpstate : public BnDumpstateDevice {
29 public:
30 ::ndk::ScopedAStatus dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds,
31 IDumpstateDevice::DumpstateMode in_mode,
32 int64_t in_timeoutMillis) override;
33
34 ::ndk::ScopedAStatus getVerboseLoggingEnabled(bool* _aidl_return) override;
35
36 ::ndk::ScopedAStatus setVerboseLoggingEnabled(bool in_enable) override;
37
38 binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
39
40 private:
41 const std::string kAllSections = "all";
42
43 void dumpTextSection(int fd, std::string const& sectionName);
44 void dumpLogSection(int fd, int fdModem);
45
46 //bool getVerboseLoggingEnabledImpl();
47 //::ndk::ScopedAStatus dumpstateBoardImpl(const int fd, const bool full);
48};
49
50} // namespace dumpstate
51} // namespace hardware
52} // namespace android
53} // namespace aidl