Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 1 | /* |
| 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 Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 16 | #pragma once |
Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 17 | |
Yi Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 18 | #ifndef INCIDENTD_UTIL_H |
| 19 | #define INCIDENTD_UTIL_H |
Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 20 | |
Yi Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 21 | #include <android-base/unique_fd.h> |
Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 22 | |
Yi Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 23 | #include "Privacy.h" |
Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 24 | |
Yi Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 25 | using namespace android::base; |
| 26 | |
| 27 | const Privacy* get_privacy_of_section(int id); |
Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 28 | |
| 29 | class Fpipe { |
| 30 | public: |
| 31 | Fpipe(); |
| 32 | ~Fpipe(); |
| 33 | |
| 34 | bool init(); |
| 35 | bool close(); |
| 36 | int readFd() const; |
| 37 | int writeFd() const; |
| 38 | |
| 39 | private: |
Yi Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 40 | unique_fd mRead; |
| 41 | unique_fd mWrite; |
Yi Jin | 99c248f | 2017-08-25 18:11:58 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
Yi Jin | b592e3b | 2018-02-01 15:17:04 -0800 | [diff] [blame] | 44 | #endif // INCIDENTD_UTIL_H |