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 { 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 std::string bundleName; 34 int32_t userId; 35 int32_t uid; 36 int32_t gid; 37 std::string apl; 38 bool isPreInstallApp = false; 39 bool debug = false; 40 CreateDirFlag createDirFlag = CreateDirFlag::CREATE_DIR_ALL; 41 42 bool ReadFromParcel(Parcel &parcel); 43 virtual bool Marshalling(Parcel &parcel) const override; 44 static CreateDirParam *Unmarshalling(Parcel &parcel); 45 }; 46 } // namespace AppExecFwk 47 } // namespace OHOS 48 #endif // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_CREATE_DIR_PARAM_H 49