1 /*
2  * Copyright (c) 2023 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 #include "message_parcel.h"
21 
22 namespace OHOS {
23 namespace AppExecFwk {
24 enum class CreateDirFlag : uint8_t {
25     // Create all data directories regardless of whether the device is unlocked.
26     // Inaccessible directories will fail to be created and errors will be ignored.
27     CREATE_DIR_ALL = 0,
28     // Only create directories that are inaccessible without unlocking.
29     CREATE_DIR_UNLOCKED = 1
30 };
31 
32 struct CreateDirParam : public Parcelable {
33     bool isPreInstallApp = false;
34     bool debug = false;
35     bool isDlpSandbox = false;
36     int32_t userId;
37     int32_t uid;
38     int32_t gid;
39     std::string bundleName;
40     std::vector<std::string> extensionDirs;
41     std::string apl;
42     CreateDirFlag createDirFlag = CreateDirFlag::CREATE_DIR_ALL;
43 
44     bool ReadFromParcel(Parcel &parcel);
45     virtual bool Marshalling(Parcel &parcel) const override;
46     static CreateDirParam *Unmarshalling(Parcel &parcel);
47 };
48 }  // namespace AppExecFwk
49 }  // namespace OHOS
50 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_CREATE_DIR_PARAM_H
51