blob: c96af1033d49ba47c9963b6b6ff94a425dcbfcd1 [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
22#include "apex_database.h"
Abhijeet Kaur216e36c2019-01-04 10:15:01 +000023#include "apex_manifest.h"
Andreas Gampe27adafa2018-11-29 12:20:08 -080024#include "status.h"
25
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
35using MountedApexData = MountedApexDatabase::MountedApexData;
36
37std::string GetPackageMountPoint(const ApexManifest& manifest);
38std::string GetActiveMountPoint(const ApexManifest& manifest);
39
40Status BindMount(const std::string& target, const std::string& source);
41
42bool IsMounted(const std::string& name, const std::string& full_path);
43
Andreas Gampedeece7e2018-12-13 11:24:51 -080044Status MountPackage(const ApexFile& apex, const std::string& mountPoint);
Andreas Gampe4510d492018-12-12 15:56:05 -080045Status UnmountPackage(const ApexFile& apex);
Andreas Gampe27adafa2018-11-29 12:20:08 -080046
47} // namespace apexd_private
48} // namespace apex
49} // namespace android
50
51#endif // ANDROID_APEXD_APEXD_PRIVATE_H_