blob: ff3a457263f42de5328c0fc17b824248794a5bb5 [file] [log] [blame]
Felipe Leme218e1ff2016-07-19 17:07:22 -07001/*
2 * Copyright (C) 2016 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#ifndef BUGREPORT_H
18#define BUGREPORT_H
19
20#include <vector>
21
22#include "adb.h"
23
24class Bugreport {
25 public:
26 Bugreport() {
27 }
28 int DoIt(TransportType transport_type, const char* serial, int argc, const char** argv);
29
30 protected:
31 // Functions below are abstractions of external functions so they can be
32 // mocked on tests.
33 virtual int SendShellCommand(TransportType transport_type, const char* serial,
34 const std::string& command, bool disable_shell_protocol,
35 std::string* output = nullptr, std::string* err = nullptr);
36
37 virtual bool DoSyncPull(const std::vector<const char*>& srcs, const char* dst, bool copy_attrs,
38 const char* name);
39
40 private:
41 DISALLOW_COPY_AND_ASSIGN(Bugreport);
42};
43
44#endif // BUGREPORT_H