• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_CREATE_DIR_PARAM_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_CREATE_DIR_PARAM_H
18 
19 #include <string>
20 
21 #include "bundle_dir.h"
22 #include "message_parcel.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 enum class CreateDirFlag : uint8_t {
27     // Create all data directories regardless of whether the device is unlocked.
28     // Inaccessible directories will fail to be created and errors will be ignored.
29     CREATE_DIR_ALL = 0,
30     // Only create directories that are inaccessible without unlocking.
31     CREATE_DIR_UNLOCKED = 1
32 };
33 
34 struct CreateDirParam : public Parcelable {
35     bool isPreInstallApp = false;
36     bool debug = false;
37     bool isDlpSandbox = false;
38     CreateDirFlag createDirFlag = CreateDirFlag::CREATE_DIR_ALL;
39     DataDirEl dataDirEl = DataDirEl::NONE;
40     int32_t userId = -1;
41     int32_t uid = -1;
42     int32_t gid = -1;
43     int32_t appIndex = 0;
44     std::string bundleName;
45     std::string apl;
46     std::vector<std::string> extensionDirs;
47     std::string uuid;
48 
49     bool ReadFromParcel(Parcel &parcel);
50     virtual bool Marshalling(Parcel &parcel) const override;
51     static CreateDirParam *Unmarshalling(Parcel &parcel);
52 };
53 }  // namespace AppExecFwk
54 }  // namespace OHOS
55 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_CREATE_DIR_PARAM_H
56