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