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