blob: 1706e08bbdb4604df43ea36470078f5fd1fad04a [file] [log] [blame]
Andreas Gampe27adafa2018-11-29 12:20:08 -08001/*
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
Mohammad Samiul Islambd6ab0f2019-06-20 15:55:27 +010022#include <android-base/result.h>
Andreas Gampe27adafa2018-11-29 12:20:08 -080023#include "apex_database.h"
Abhijeet Kaur216e36c2019-01-04 10:15:01 +000024#include "apex_manifest.h"
Andreas Gampe27adafa2018-11-29 12:20:08 -080025
26namespace android {
27namespace apex {
28
29class ApexFile;
Andreas Gampe27adafa2018-11-29 12:20:08 -080030
31static constexpr int kMkdirMode = 0755;
32
33namespace apexd_private {
34
Andreas Gampe27adafa2018-11-29 12:20:08 -080035std::string GetPackageMountPoint(const ApexManifest& manifest);
Nikita Ioffe264c4212019-09-13 16:30:17 +010036std::string GetPackageTempMountPoint(const ApexManifest& manifest);
Andreas Gampe27adafa2018-11-29 12:20:08 -080037std::string GetActiveMountPoint(const ApexManifest& manifest);
38
Mohammad Samiul Islambd6ab0f2019-06-20 15:55:27 +010039android::base::Result<void> BindMount(const std::string& target,
40 const std::string& source);
Nikita Ioffe264c4212019-09-13 16:30:17 +010041android::base::Result<MountedApexDatabase::MountedApexData> TempMountPackage(
42 const ApexFile& apex, const std::string& mount_point);
43android::base::Result<void> Unmount(
44 const MountedApexDatabase::MountedApexData& data);
Andreas Gampe27adafa2018-11-29 12:20:08 -080045
46} // namespace apexd_private
47} // namespace apex
48} // namespace android
49
50#endif // ANDROID_APEXD_APEXD_PRIVATE_H_