blob: 09aa0404277ac50aae22f541d043c70f26496b1a [file] [log] [blame]
Yi Jin99c248f2017-08-25 18:11:58 -07001/*
2 * Copyright (C) 2017 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 */
Yi Jinb592e3b2018-02-01 15:17:04 -080016#pragma once
Yi Jin99c248f2017-08-25 18:11:58 -070017
Yi Jinb592e3b2018-02-01 15:17:04 -080018#ifndef INCIDENTD_UTIL_H
19#define INCIDENTD_UTIL_H
Yi Jin99c248f2017-08-25 18:11:58 -070020
Yi Jinb592e3b2018-02-01 15:17:04 -080021#include <android-base/unique_fd.h>
Yi Jin99c248f2017-08-25 18:11:58 -070022
Yi Jinb592e3b2018-02-01 15:17:04 -080023#include "Privacy.h"
Yi Jin99c248f2017-08-25 18:11:58 -070024
Yi Jinb592e3b2018-02-01 15:17:04 -080025using namespace android::base;
26
27const Privacy* get_privacy_of_section(int id);
Yi Jin99c248f2017-08-25 18:11:58 -070028
29class Fpipe {
30public:
31 Fpipe();
32 ~Fpipe();
33
34 bool init();
35 bool close();
36 int readFd() const;
37 int writeFd() const;
38
39private:
Yi Jinb592e3b2018-02-01 15:17:04 -080040 unique_fd mRead;
41 unique_fd mWrite;
Yi Jin99c248f2017-08-25 18:11:58 -070042};
43
Yi Jinb592e3b2018-02-01 15:17:04 -080044#endif // INCIDENTD_UTIL_H