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