• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_BUNDLE_INFO_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_BUNDLE_INFO_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "parcel.h"
23 
24 #include "ability_info.h"
25 #include "application_info.h"
26 #include "hap_module_info.h"
27 
28 namespace OHOS {
29 namespace AppExecFwk {
30 
31 enum class BundleFlag {
32     // get bundle info except abilityInfos
33     GET_BUNDLE_DEFAULT = 0x00000000,
34     // get bundle info include abilityInfos
35     GET_BUNDLE_WITH_ABILITIES = 0x00000001,
36 };
37 
38 // configuration information about a bundle
39 struct BundleInfo : public Parcelable {
40     std::string name;         // bundle name
41     std::string label;        // name display on screen
42     std::string description;  // detail description. When ResourceKit ready replace with descriptionId
43     std::string vendor;
44     uint32_t versionCode = 0;
45     std::string versionName;
46     std::string jointUserId;
47     int32_t minSdkVersion = -1;  // The min SDK version this app can run on
48     int32_t maxSdkVersion = -1;  // The max SDK version this app can run on
49     std::string mainEntry;       // entry is path of ability main executable file
50     std::string cpuAbi;
51     std::string appId;
52     int compatibleVersion = 0;
53     int targetVersion = 0;
54     std::string releaseType;
55     int uid = -1;
56     int gid = -1;
57     std::string seInfo;
58     std::string entryModuleName;
59     bool isKeepAlive = false;
60     bool isNativeApp = false;
61     bool isDifferentName = false;
62     int64_t installTime = 0;    // the installation time is the number of seconds elapsed since January 1,
63                                 // 1970 00:00:00 UTC. The time will be recalculated if the application is reinstalled
64                                 // after being uninstalled.
65     int64_t updateTime = 0;     // the update time is the number of seconds elapsed since January 1,
66                                 // 1970 00:00:00 UTC. If the application is installed for the first time, the application
67                                 // update time is the same as the installation time.
68     ApplicationInfo applicationInfo;
69     std::vector<AbilityInfo> abilityInfos;
70     std::vector<HapModuleInfo> hapModuleInfos;
71     std::vector<std::string> reqPermissions;
72     std::vector<std::string> defPermissions;    // the permissions required for accessing the application.
73     std::vector<std::string> hapModuleNames;    // the "module.package" in each config.json
74     std::vector<std::string> moduleNames;       // the "module.name" in each config.json
75     std::vector<std::string> modulePublicDirs;  // the public paths of all modules of the application.
76     std::vector<std::string> moduleDirs;        // the paths of all modules of the application.
77     std::vector<std::string> moduleResPaths;    // the paths of all resources paths.
78 
79     bool ReadFromParcel(Parcel &parcel);
80     virtual bool Marshalling(Parcel &parcel) const override;
81     static BundleInfo *Unmarshalling(Parcel &parcel);
82 };
83 
84 }  // namespace AppExecFwk
85 }  // namespace OHOS
86 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_BUNDLE_INFO_H
87