Andreas Gampe | 27adafa | 2018-11-29 12:20:08 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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_APEXD_APEXD_PRIVATE_H_ |
| 18 | #define ANDROID_APEXD_APEXD_PRIVATE_H_ |
| 19 | |
| 20 | #include <string> |
| 21 | |
| 22 | #include "apex_database.h" |
Abhijeet Kaur | 216e36c | 2019-01-04 10:15:01 +0000 | [diff] [blame] | 23 | #include "apex_manifest.h" |
Andreas Gampe | 27adafa | 2018-11-29 12:20:08 -0800 | [diff] [blame] | 24 | #include "status.h" |
| 25 | |
| 26 | namespace android { |
| 27 | namespace apex { |
| 28 | |
| 29 | class ApexFile; |
Andreas Gampe | 27adafa | 2018-11-29 12:20:08 -0800 | [diff] [blame] | 30 | |
| 31 | static constexpr int kMkdirMode = 0755; |
| 32 | |
| 33 | namespace apexd_private { |
| 34 | |
| 35 | using MountedApexData = MountedApexDatabase::MountedApexData; |
| 36 | |
| 37 | std::string GetPackageMountPoint(const ApexManifest& manifest); |
| 38 | std::string GetActiveMountPoint(const ApexManifest& manifest); |
| 39 | |
| 40 | Status BindMount(const std::string& target, const std::string& source); |
| 41 | |
| 42 | bool IsMounted(const std::string& name, const std::string& full_path); |
| 43 | |
Andreas Gampe | deece7e | 2018-12-13 11:24:51 -0800 | [diff] [blame] | 44 | Status MountPackage(const ApexFile& apex, const std::string& mountPoint); |
Andreas Gampe | 4510d49 | 2018-12-12 15:56:05 -0800 | [diff] [blame] | 45 | Status UnmountPackage(const ApexFile& apex); |
Andreas Gampe | 27adafa | 2018-11-29 12:20:08 -0800 | [diff] [blame] | 46 | |
| 47 | } // namespace apexd_private |
| 48 | } // namespace apex |
| 49 | } // namespace android |
| 50 | |
| 51 | #endif // ANDROID_APEXD_APEXD_PRIVATE_H_ |