blob: 544a7b6d367284192749e5bdbe15700ef035d1ff [file] [log] [blame]
Felipe Leme75876a22016-10-27 16:31:27 -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 ANDROID_OS_DUMPSTATE_H_
18#define ANDROID_OS_DUMPSTATE_H_
19
20#include <mutex>
21#include <vector>
22
23#include <binder/BinderService.h>
24
25#include "android/os/BnDumpstate.h"
26#include "dumpstate.h"
27
28namespace android {
29namespace os {
30
31class DumpstateService : public BinderService<DumpstateService>, public BnDumpstate {
32 public:
33 DumpstateService();
34
35 static status_t Start();
36 static char const* getServiceName();
37
38 status_t dump(int fd, const Vector<String16>& args) override;
39 binder::Status setListener(const std::string& name, const sp<IDumpstateListener>& listener,
40 bool* set) override;
41
42 private:
43 Dumpstate& ds_;
44 std::mutex lock_;
45};
46
47} // namespace os
48} // namespace android
49
50#endif // ANDROID_OS_DUMPSTATE_H_