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 <android-base/result.h> 23 #include "apex_database.h" 24 #include "apex_manifest.h" 25 26 namespace android { 27 namespace apex { 28 29 class ApexFile; 30 31 static constexpr int kMkdirMode = 0755; 32 33 namespace apexd_private { 34 35 std::string GetPackageMountPoint(const ApexManifest& manifest); 36 std::string GetPackageTempMountPoint(const ApexManifest& manifest); 37 std::string GetActiveMountPoint(const ApexManifest& manifest); 38 39 android::base::Result<void> BindMount(const std::string& target, 40 const std::string& source); 41 android::base::Result<MountedApexDatabase::MountedApexData> TempMountPackage( 42 const ApexFile& apex, const std::string& mount_point); 43 android::base::Result<void> Unmount( 44 const MountedApexDatabase::MountedApexData& data); 45 46 } // namespace apexd_private 47 } // namespace apex 48 } // namespace android 49 50 #endif // ANDROID_APEXD_APEXD_PRIVATE_H_ 51