LuK1337 | 124a882 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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/adbroot/BnADBRootService.h> |
| 20 | #include <android/binder_status.h> |
| 21 | #include <log/log_properties.h> |
| 22 | #include <utils/Mutex.h> |
| 23 | |
| 24 | namespace aidl { |
| 25 | namespace android { |
| 26 | namespace adbroot { |
| 27 | |
| 28 | using ::android::Mutex; |
| 29 | |
| 30 | class ADBRootService : public BnADBRootService { |
| 31 | public: |
| 32 | ADBRootService(); |
| 33 | |
| 34 | static void Register(); |
| 35 | |
| 36 | ndk::ScopedAStatus isSupported(bool* _aidl_return) override; |
| 37 | ndk::ScopedAStatus setEnabled(bool enabled) override; |
| 38 | ndk::ScopedAStatus getEnabled(bool* _aidl_return) override; |
| 39 | |
| 40 | static char const* getServiceName() { return "adbroot_service"; } |
| 41 | private: |
| 42 | bool enabled_; |
| 43 | Mutex lock_; |
| 44 | }; |
| 45 | |
| 46 | } // namespace adbroot |
| 47 | } // namespace android |
| 48 | } // namespace aidl |