1 /* 2 * Copyright (c) 2021-2022 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_COMMON_PROFILE_H 17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_COMMON_PROFILE_H 18 19 #include <string> 20 21 #include "nlohmann/json.hpp" 22 23 namespace OHOS { 24 namespace AppExecFwk { 25 namespace ProfileReader { 26 // common tag 27 const std::string PROFILE_KEY_NAME = "name"; 28 const std::string PROFILE_KEY_ORIGINAL_NAME = "originalName"; 29 const std::string PROFILE_KEY_LABEL = "label"; 30 const std::string PROFILE_KEY_ICON_ID = "iconId"; 31 const std::string PROFILE_KEY_LABEL_ID = "labelId"; 32 const std::string PROFILE_KEY_DESCRIPTION = "description"; 33 const std::string PROFILE_KEY_DESCRIPTION_ID = "descriptionId"; 34 const std::string PROFILE_KEY_TYPE = "type"; 35 const std::string PROFILE_KEY_SRCPATH = "srcPath"; 36 const std::string PROFILE_KEY_SRCLANGUAGE = "srcLanguage"; 37 const std::string PRIORITY = "priority"; 38 39 // bundle profile tag 40 const std::string BUNDLE_PROFILE_KEY_APP = "app"; 41 const std::string BUNDLE_PROFILE_KEY_DEVICE_CONFIG = "deviceConfig"; 42 const std::string BUNDLE_PROFILE_KEY_MODULE = "module"; 43 // sub BUNDLE_PROFILE_KEY_APP 44 const std::string BUNDLE_APP_PROFILE_KEY_BUNDLE_NAME = "bundleName"; 45 const std::string BUNDLE_APP_PROFILE_KEY_VENDOR = "vendor"; 46 const std::string BUNDLE_APP_PROFILE_KEY_VERSION = "version"; 47 const std::string BUNDLE_APP_PROFILE_KEY_API_VERSION = "apiVersion"; 48 const std::string BUNDLE_APP_PROFILE_KEY_SINGLETON = "singleton"; 49 const std::string BUNDLE_APP_PROFILE_KEY_REMOVABLE = "removable"; 50 const std::string BUNDLE_APP_PROFILE_KEY_USER_DATA_CLEARABLE = "userDataClearable"; 51 // sub BUNDLE_APP_PROFILE_KEY_VERSION 52 const std::string BUNDLE_APP_PROFILE_KEY_CODE = "code"; 53 const std::string BUNDLE_APP_PROFILE_KEY_MIN_COMPATIBLE_VERSION_CODE = "minCompatibleVersionCode"; 54 // sub BUNDLE_APP_PROFILE_KEY_API_VERSION 55 const std::string BUNDLE_APP_PROFILE_KEY_COMPATIBLE = "compatible"; 56 const std::string BUNDLE_APP_PROFILE_KEY_TARGET = "target"; 57 const std::string BUNDLE_APP_PROFILE_KEY_RELEASE_TYPE = "releaseType"; 58 const std::string APP_RELEASE_TYPE_VALUE_RELEASE = "Release"; 59 // sub BUNDLE_PROFILE_KEY_DEVICE_CONFIG 60 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DEFAULT = "default"; 61 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_PHONE = "phone"; 62 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_TABLET = "tablet"; 63 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_TV = "tv"; 64 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_CAR = "car"; 65 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_WEARABLE = "wearable"; 66 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_LITE_WEARABLE = "liteWearable"; 67 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_SMART_VISION = "smartVision"; 68 // sub BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DEFAULT 69 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_JOINT_USER_ID = "jointUserId"; 70 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_PROCESS = "process"; 71 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_KEEP_ALIVE = "keepAlive"; 72 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_ARK = "ark"; 73 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DIRECT_LAUNCH = "directLaunch"; 74 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_SUPPORT_BACKUP = "supportBackup"; 75 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DEBUG = "debug"; 76 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_COMPRESS_NATIVE_LIBS = "compressNativeLibs"; 77 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_NETWORK = "network"; 78 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_REQ_VERSION = "reqVersion"; 79 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_FLAG = "flag"; 80 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_COMPATIBLE = "compatible"; 81 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_TARGET = "target"; 82 // sub BUNDLE_DEVICE_CONFIG_PROFILE_KEY_NETWORK 83 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_USES_CLEAR_TEXT = "usesCleartext"; 84 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_SECURITY_CONFIG = "securityConfig"; 85 // sub BUNDLE_DEVICE_CONFIG_PROFILE_KEY_SECURITY_CONFIG 86 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DOMAIN_SETTINGS = "domainSettings"; 87 // sub BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DOMAIN_SETTINGS 88 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_CLEAR_TEXT_PERMITTED = "cleartextPermitted"; 89 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DOMAINS = "domains"; 90 // sub BUNDLE_DEVICE_CONFIG_PROFILE_KEY_DOMAINS 91 const std::string BUNDLE_DEVICE_CONFIG_PROFILE_KEY_SUB_DOMAINS = "subDomains"; 92 // sub BUNDLE_PROFILE_KEY_MODULE 93 const std::string BUNDLE_MODULE_PROFILE_KEY_PACKAGE = "package"; 94 const std::string BUNDLE_MODULE_PROFILE_KEY_SUPPORTED_MODES = "supportedModes"; 95 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_CAPABILITIES = "reqCapabilities"; 96 const std::string BUNDLE_MODULE_PROFILE_KEY_SUPPORTED_REQ_CAPABILITIES = "reqCapabilities"; 97 const std::string MODULE_SUPPORTED_MODES_VALUE_DRIVE = "drive"; 98 const std::string BUNDLE_MODULE_PROFILE_KEY_DEVICE_TYPE = "deviceType"; 99 const std::string BUNDLE_MODULE_PROFILE_KEY_COLOR_MODE = "colorMode"; 100 const std::string BUNDLE_MODULE_PROFILE_KEY_DISTRO = "distro"; 101 const std::string BUNDLE_MODULE_PROFILE_KEY_META_DATA = "metaData"; 102 const std::string BUNDLE_MODULE_PROFILE_KEY_ABILITIES = "abilities"; 103 const std::string BUNDLE_MODULE_PROFILE_KEY_JS = "js"; 104 const std::string BUNDLE_MODULE_PROFILE_KEY_COMMON_EVENTS = "commonEvents"; 105 const std::string BUNDLE_MODULE_PROFILE_KEY_SHORTCUTS = "shortcuts"; 106 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS = "defPermissions"; 107 const std::string BUNDLE_MODULE_PROFILE_KEY_DEFINE_PERMISSIONS = "definePermissions"; 108 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_NAME = "name"; 109 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_GRANTMODE = "grantMode"; 110 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_GRANTMODE_USER_GRANT = "user_grant"; 111 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_GRANTMODE_SYSTEM_GRANT = "system_grant"; 112 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_AVAILABLESCOPE = "availableScope"; 113 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_AVAILABLESCOPE_SIGNATURE = "signature"; 114 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_AVAILABLESCOPE_PRIVILEGED = "privileged"; 115 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_AVAILABLESCOPE_RESTRICTED = "restricted"; 116 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_LABEL = "label"; 117 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_LABEL_ID = "labelId"; 118 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_DESCRIPTION = "description"; 119 const std::string BUNDLE_MODULE_PROFILE_KEY_DEF_PERMISSIONS_DESCRIPTION_ID = "descriptionId"; 120 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS = "reqPermissions"; 121 const std::string BUNDLE_MODULE_PROFILE_KEY_REQUEST_PERMISSIONS = "requestPermissions"; 122 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_NAME = "name"; 123 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_REASON = "reason"; 124 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_USEDSCENE = "usedScene"; 125 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_ABILITY = "ability"; 126 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_WHEN = "when"; 127 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_WHEN_INUSE = "inuse"; 128 const std::string BUNDLE_MODULE_PROFILE_KEY_REQ_PERMISSIONS_WHEN_ALWAYS = "always"; 129 const std::string BUNDLE_MODULE_PROFILE_KEY_CUSTOMIZE_DATA = "customizeData"; 130 const std::string BUNDLE_MODULE_PROFILE_KEY_MAIN_ABILITY = "mainAbility"; 131 const std::string BUNDLE_MODULE_PROFILE_KEY_SRC_PATH = "srcPath"; 132 // sub BUNDLE_MODULE_PROFILE_KEY_DISTRO 133 const std::string BUNDLE_MODULE_PROFILE_KEY_DELIVERY_WITH_INSTALL = "deliveryWithInstall"; 134 const std::string BUNDLE_MODULE_PROFILE_KEY_MODULE_NAME = "moduleName"; 135 const std::string BUNDLE_MODULE_PROFILE_KEY_MODULE_TYPE = "moduleType"; 136 const std::string BUNDLE_MODULE_PROFILE_KEY_MODULE_INSTALLATION_FREE = "installationFree"; 137 // sub BUNDLE_MODULE_PROFILE_KEY_SKILLS 138 const std::string BUNDLE_MODULE_PROFILE_KEY_ACTIONS = "actions"; 139 const std::string BUNDLE_MODULE_PROFILE_KEY_ENTITIES = "entities"; 140 const std::string BUNDLE_MODULE_PROFILE_KEY_URIS = "uris"; 141 // sub BUNDLE_MODULE_PROFILE_KEY_URIS 142 const std::string BUNDLE_MODULE_PROFILE_KEY_SCHEME = "scheme"; 143 const std::string BUNDLE_MODULE_PROFILE_KEY_HOST = "host"; 144 const std::string BUNDLE_MODULE_PROFILE_KEY_PORT = "port"; 145 const std::string BUNDLE_MODULE_PROFILE_KEY_PATH = "path"; 146 const std::string BUNDLE_MODULE_PROFILE_KEY_PATHSTARTWITH = "pathStartWith"; 147 const std::string BUNDLE_MODULE_PROFILE_KEY_PATHREGX = "pathRegx"; 148 const std::string BUNDLE_MODULE_PROFILE_KEY_PATHREGEX = "pathRegex"; 149 const std::string BUNDLE_MODULE_PROFILE_KEY_TYPE = "type"; 150 // sub BUNDLE_MODULE_PROFILE_KEY_META_DATA 151 const std::string BUNDLE_MODULE_META_KEY_CUSTOMIZE_DATA = "customizeData"; 152 const std::string BUNDLE_MODULE_META_KEY_NAME = "name"; 153 const std::string BUNDLE_MODULE_META_KEY_VALUE = "value"; 154 const std::string BUNDLE_MODULE_META_KEY_EXTRA = "extra"; 155 // sub BUNDLE_MODULE_PROFILE_KEY_DISTRO_TYPE 156 const std::string MODULE_DISTRO_MODULE_TYPE_VALUE_ENTRY = "entry"; 157 const std::string MODULE_DISTRO_MODULE_TYPE_VALUE_FEATURE = "feature"; 158 const std::string MODULE_DISTRO_MODULE_TYPE_VALUE_HAR = "har"; 159 // sub BUNDLE_MODULE_PROFILE_KEY_ABILITIES 160 const std::string BUNDLE_MODULE_PROFILE_KEY_ICON = "icon"; 161 const std::string BUNDLE_MODULE_PROFILE_KEY_ICON_ID = "iconId"; 162 const std::string BUNDLE_MODULE_PROFILE_KEY_URI = "uri"; 163 const std::string BUNDLE_MODULE_PROFILE_KEY_LAUNCH_TYPE = "launchType"; 164 const std::string BUNDLE_MODULE_PROFILE_KEY_LAUNCH_THEME = "theme"; 165 const std::string BUNDLE_MODULE_PROFILE_KEY_VISIBLE = "visible"; 166 const std::string BUNDLE_MODULE_PROFILE_KEY_CONTINUABLE = "continuable"; 167 const std::string BUNDLE_MODULE_PROFILE_KEY_PERMISSIONS = "permissions"; 168 const std::string BUNDLE_MODULE_PROFILE_KEY_SKILLS = "skills"; 169 const std::string BUNDLE_MODULE_PROFILE_KEY_PROCESS = "process"; 170 const std::string BUNDLE_MODULE_PROFILE_KEY_DEVICE_CAP_ABILITY = "deviceCapability"; 171 const std::string BUNDLE_MODULE_PROFILE_KEY_FORM_ENABLED = "formEnabled"; 172 const std::string BUNDLE_MODULE_PROFILE_KEY_FORM = "form"; 173 const std::string BUNDLE_MODULE_PROFILE_KEY_ORIENTATION = "orientation"; 174 const std::string BUNDLE_MODULE_PROFILE_KEY_BACKGROUND_MODES = "backgroundModes"; 175 const std::string BUNDLE_MODULE_PROFILE_KEY_GRANT_PERMISSION = "grantPermission"; 176 const std::string BUNDLE_MODULE_PROFILE_KEY_URI_PERMISSION = "uriPermission"; 177 const std::string BUNDLE_MODULE_PROFILE_KEY_READ_PERMISSION = "readPermission"; 178 const std::string BUNDLE_MODULE_PROFILE_KEY_WRITE_PERMISSION = "writePermission"; 179 const std::string BUNDLE_MODULE_PROFILE_KEY_DIRECT_LAUNCH = "directLaunch"; 180 const std::string BUNDLE_MODULE_PROFILE_KEY_CONFIG_CHANGES = "configChanges"; 181 const std::string BUNDLE_MODULE_PROFILE_KEY_MISSION = "mission"; 182 const std::string BUNDLE_MODULE_PROFILE_KEY_TARGET_ABILITY = "targetAbility"; 183 const std::string BUNDLE_MODULE_PROFILE_KEY_MULTIUSER_SHARED = "multiUserShared"; 184 const std::string BUNDLE_MODULE_PROFILE_KEY_SUPPORT_PIP_MODE = "supportPipMode"; 185 const std::string BUNDLE_MODULE_PROFILE_KEY_FORMS_ENABLED = "formsEnabled"; 186 const std::string BUNDLE_MODULE_PROFILE_KEY_FORMS = "forms"; 187 // sub BUNDLE_MODULE_PROFILE_KEY_FORM 188 const std::string BUNDLE_MODULE_PROFILE_KEY_MODE = "mode"; 189 // sub BUNDLE_MODULE_PROFILE_KEY_FORM 190 const std::string BUNDLE_MODULE_PROFILE_FORM_ENTITY = "formEntity"; 191 const std::string BUNDLE_MODULE_PROFILE_FORM_MIN_HEIGHT = "minHeight"; 192 const std::string BUNDLE_MODULE_PROFILE_FORM_DEFAULT_HEIGHT = "defaultHeight"; 193 const std::string BUNDLE_MODULE_PROFILE_FORM_MIN_WIDTH = "minWidth"; 194 const std::string BUNDLE_MODULE_PROFILE_FORM_DEFAULT_WIDTH = "defaultWidth"; 195 // sub BUNDLE_MODULE_PROFILE_KEY_FORMS 196 const std::string BUNDLE_MODULE_PROFILE_FORMS_IS_DEFAULT = "isDefault"; 197 const std::string BUNDLE_MODULE_PROFILE_FORMS_COLOR_MODE = "colorMode"; 198 const std::string BUNDLE_MODULE_PROFILE_FORMS_SUPPORT_DIMENSIONS = "supportDimensions"; 199 const std::string BUNDLE_MODULE_PROFILE_FORMS_DEFAULT_DIMENSION = "defaultDimension"; 200 const std::string BUNDLE_MODULE_PROFILE_FORMS_LANDSCAPE_LAYOUTS = "landscapeLayouts"; 201 const std::string BUNDLE_MODULE_PROFILE_FORMS_PORTRAIT_LAYOUTS = "portraitLayouts"; 202 const std::string BUNDLE_MODULE_PROFILE_FORMS_UPDATEENABLED = "updateEnabled"; 203 const std::string BUNDLE_MODULE_PROFILE_FORMS_SCHEDULED_UPDATE_TIME = "scheduledUpdateTime"; 204 const std::string BUNDLE_MODULE_PROFILE_FORMS_UPDATE_DURATION = "updateDuration"; 205 const std::string BUNDLE_MODULE_PROFILE_FORMS_DEEP_LINK = "deepLink"; 206 const std::string BUNDLE_MODULE_PROFILE_FORMS_JS_COMPONENT_NAME = "jsComponentName"; 207 const std::string BUNDLE_MODULE_PROFILE_FORMS_VALUE = "value"; 208 const std::string BUNDLE_MODULE_PROFILE_FORMS_FORM_CONFIG_ABILITY = "formConfigAbility"; 209 const std::string BUNDLE_MODULE_PROFILE_FORMS_FORM_VISIBLE_NOTIFY = "formVisibleNotify"; 210 const std::string BUNDLE_MODULE_PROFILE_FORMS_SRC = "src"; 211 // sub BUNDLE_MODULE_PROFILE_KEY_JS 212 const std::string BUNDLE_MODULE_PROFILE_KEY_PAGES = "pages"; 213 const std::string BUNDLE_MODULE_PROFILE_KEY_WINDOW = "window"; 214 // sub BUNDLE_MODULE_PROFILE_KEY_COMMON_EVENTS 215 const std::string BUNDLE_MODULE_PROFILE_KEY_PERMISSION = "permission"; 216 const std::string BUNDLE_MODULE_PROFILE_KEY_DATA = "data"; 217 const std::string BUNDLE_MODULE_PROFILE_KEY_EVENTS = "events"; 218 const std::string MODULE_ABILITY_JS_TYPE_VALUE_NORMAL = "normal"; 219 const std::string MODULE_ABILITY_JS_TYPE_VALUE_FORM = "form"; 220 // sub BUNDLE_MODULE_PROFILE_KEY_WINDOW 221 const std::string BUNDLE_MODULE_PROFILE_KEY_DESIGN_WIDTH = "designWidth"; 222 const std::string BUNDLE_MODULE_PROFILE_KEY_AUTO_DESIGN_WIDTH = "autoDesignWidth"; 223 // sub BUNDLE_MODULE_PROFILE_KEY_SHORTCUTS 224 const std::string BUNDLE_MODULE_PROFILE_KEY_SHORTCUT_ID = "shortcutId"; 225 const std::string BUNDLE_MODULE_PROFILE_KEY_SHORTCUT_WANTS = "intents"; 226 // sub BUNDLE_MODULE_PROFILE_KEY_SHORTCUT_WANTS 227 const std::string BUNDLE_MODULE_PROFILE_KEY_TARGET_CLASS = "targetClass"; 228 const std::string BUNDLE_MODULE_PROFILE_KEY_TARGET_BUNDLE = "targetBundle"; 229 // sub BUNDLE_INSTALL_MARK 230 const std::string BUNDLE_INSTALL_MARK_BUNDLE = "installMarkBundle"; 231 const std::string BUNDLE_INSTALL_MARK_PACKAGE = "installMarkPackage"; 232 const std::string BUNDLE_INSTALL_MARK_STATUS = "installMarkStatus"; 233 const uint32_t VALUE_HOME_SCREEN = 1 << 0; 234 // 000010 represents supporting search box 235 const uint32_t VALUE_SEARCHBOX = 1 << 1; 236 const int32_t MAX_USAGE_RECORD_SIZE = 1000; 237 238 const std::string KEY_HOME_SCREEN = "homeScreen"; 239 const std::string KEY_SEARCHBOX = "searchbox"; 240 241 const std::string BUNDLE_MODULE_PROFILE_KEY_JS_TYPE_ETS = "ets"; 242 243 static std::map<std::string, uint32_t> formEntityMap; 244 245 extern thread_local int32_t parseResult; 246 247 // background modes 248 // different bits in the binary represent different services 249 // 0000001 represents data transmission services 250 constexpr uint32_t VALUE_DATA_TRANSFER = 1 << 0; 251 252 // 0000 0010 represents audio output service 253 constexpr uint32_t VALUE_AUDIO_PLAYBACK = 1 << 1; 254 255 // 0000 0100 represents audio input service 256 constexpr uint32_t VALUE_AUDIO_RECORDING = 1 << 2; 257 258 // 0000 1000 represents positioning navigation service 259 constexpr uint32_t VALUE_LOCATION = 1 << 3; 260 261 // 0001 0000 represents bluetooth scanning, connection, transmission service (wearing) 262 constexpr uint32_t VALUE_BLUETOOTH_INTERACTION = 1 << 4; 263 264 // 0010 0000 represents multi device connection services 265 constexpr uint32_t VALUE_MULTI_DEVICE_CONNECTION = 1 << 5; 266 267 // 0100 0000 represents WiFi scanning, connection, transmission services (clone, multi-screen) 268 constexpr uint32_t VALUE_WIFI_INTERACTION = 1 << 6; 269 270 // 1000 0000 represents audio call,VOIP service 271 constexpr uint32_t VALUE_VOIP = 1 << 7; 272 273 // 1 0000 0000 represents task Keeping service 274 constexpr uint32_t VALUE_TASK_KEEPING = 1 << 8; 275 276 // 10 0000 0000 represents picture in picture service 277 constexpr uint32_t VALUE_PICTURE_IN_PICTURE = 1 << 9; 278 279 // 100 0000 0000 represents screen fetch service 280 constexpr uint32_t VALUE_SCREEN_FETCH = 1 << 10; 281 282 const std::string KEY_DATA_TRANSFER = "dataTransfer"; 283 const std::string KEY_AUDIO_PLAYBACK = "audioPlayback"; 284 const std::string KEY_AUDIO_RECORDING = "audioRecording"; 285 const std::string KEY_LOCATION = "location"; 286 const std::string KEY_BLUETOOTH_INTERACTION = "bluetoothInteraction"; 287 const std::string KEY_MULTI_DEVICE_CONNECTION = "multiDeviceConnection"; 288 const std::string KEY_WIFI_INTERACTION = "wifiInteraction"; 289 const std::string KEY_VOIP = "voip"; 290 const std::string KEY_TASK_KEEPING = "taskKeeping"; 291 const std::string KEY_PICTURE_IN_PICTURE = "pictureInPicture"; 292 const std::string KEY_SCREEN_FETCH = "screenFetch"; 293 } // namespace ProfileReader 294 295 namespace Profile { 296 // common 297 const std::string ICON = "icon"; 298 const std::string ICON_ID = "iconId"; 299 const std::string LABEL = "label"; 300 const std::string LABEL_ID = "labelId"; 301 const std::string DESCRIPTION = "description"; 302 const std::string DESCRIPTION_ID = "descriptionId"; 303 const std::string META_DATA = "metadata"; 304 const std::string SKILLS = "skills"; 305 const std::string SRC_ENTRANCE = "srcEntrance"; 306 const std::string PERMISSIONS = "permissions"; 307 const std::string VISIBLE = "visible"; 308 const std::string SRC_LANGUAGE = "srcLanguage"; 309 const std::string PRIORITY = "priority"; 310 // module.json 311 const std::string APP = "app"; 312 const std::string MODULE = "module"; 313 // app 314 const std::string APP_BUNDLE_NAME = "bundleName"; 315 const std::string APP_DEBUG = "debug"; 316 const std::string APP_VENDOR = "vendor"; 317 const std::string APP_VERSION_CODE = "versionCode"; 318 const std::string APP_VERSION_NAME = "versionName"; 319 const std::string APP_MIN_COMPATIBLE_VERSION_CODE = "minCompatibleVersionCode"; 320 const std::string APP_MIN_API_VERSION = "minAPIVersion"; 321 const std::string APP_TARGET_API_VERSION = "targetAPIVersion"; 322 const std::string APP_API_RELEASETYPE = "apiReleaseType"; 323 const std::string APP_API_RELEASETYPE_DEFAULT_VALUE = "Release"; 324 const std::string APP_DISTRIBUTED_NOTIFICATION_ENABLED = "distributedNotificationEnabled"; 325 const std::string APP_ENTITY_TYPE = "entityType"; 326 const std::string APP_ENTITY_TYPE_DEFAULT_VALUE = "unspecified"; 327 const std::string APP_KEEP_ALIVE = "keepAlive"; 328 const std::string APP_REMOVABLE = "removable"; 329 const std::string APP_SINGLETON = "singleton"; 330 const std::string APP_USER_DATA_CLEARABLE = "userDataClearable"; 331 const std::string APP_PHONE = "phone"; 332 const std::string APP_TABLET = "tablet"; 333 const std::string APP_TV = "tv"; 334 const std::string APP_WEARABLE = "wearable"; 335 const std::string APP_LITE_WEARABLE = "liteWearable"; 336 const std::string APP_CAR = "car"; 337 const std::string APP_SMART_VISION = "smartVision"; 338 const std::string APP_ROUTER = "router"; 339 const std::string APP_ACCESSIBLE = "accessible"; 340 // module 341 const std::string MODULE_NAME = "name"; 342 const std::string MODULE_TYPE = "type"; 343 const std::string MODULE_PROCESS = "process"; 344 const std::string MODULE_MAIN_ELEMENT = "mainElement"; 345 const std::string MODULE_DEVICE_TYPES = "deviceTypes"; 346 const std::string MODULE_DELIVERY_WITH_INSTALL = "deliveryWithInstall"; 347 const std::string MODULE_INSTALLATION_FREE = "installationFree"; 348 const std::string MODULE_VIRTUAL_MACHINE = "virtualMachine"; 349 const std::string MODULE_VIRTUAL_MACHINE_DEFAULT_VALUE = "default"; 350 const std::string MODULE_UI_SYNTAX = "uiSyntax"; 351 const std::string MODULE_UI_SYNTAX_DEFAULT_VALUE = "hml"; 352 const std::string MODULE_PAGES = "pages"; 353 const std::string MODULE_ABILITIES = "abilities"; 354 const std::string MODULE_EXTENSION_ABILITIES = "extensionAbilities"; 355 const std::string MODULE_REQUEST_PERMISSIONS = "requestPermissions"; 356 const std::string MODULE_DEFINE_PERMISSIONS = "definePermissions"; 357 // module type 358 const std::string MODULE_TYPE_ENTRY = "entry"; 359 const std::string MODULE_TYPE_FEATURE = "feature"; 360 const std::string MODULE_TYPE_HAR = "har"; 361 // deviceConfig 362 const std::string MIN_API_VERSION = "minAPIVersion"; 363 const std::string DEVICE_CONFIG_DISTRIBUTED_NOTIFICATION_ENABLED = "distributedNotificationEnabled"; 364 const std::string DEVICE_CONFIG_KEEP_ALIVE = "keepAlive"; 365 const std::string DEVICE_CONFIG_REMOVABLE = "removable"; 366 const std::string DEVICE_CONFIG_SINGLETON = "singleton"; 367 const std::string DEVICE_CONFIG_USER_DATA_CLEARABLE = "userDataClearable"; 368 const std::string DEVICE_CONFIG_ACCESSIBLE = "accessible"; 369 // metadata 370 const std::string META_DATA_NAME = "name"; 371 const std::string META_DATA_VALUE = "value"; 372 const std::string META_DATA_RESOURCE = "resource"; 373 // metadata reserved 374 const std::string META_DATA_FORM = "ohos.extension.form"; 375 const std::string META_DATA_SHORTCUTS = "ohos.ability.shortcuts"; 376 const std::string META_DATA_COMMON_EVENTS = "ohos.extension.staticSubscriber"; 377 // ability 378 const std::string ABILITY_NAME = "name"; 379 const std::string ABILITY_LAUNCH_TYPE = "launchType"; 380 const std::string ABILITY_LAUNCH_TYPE_DEFAULT_VALUE = "singleton"; 381 const std::string ABILITY_BACKGROUNDMODES = "backgroundModes"; 382 const std::string ABILITY_CONTINUABLE = "continuable"; 383 // extension ability 384 const std::string EXTENSION_ABILITY_NAME = "name"; 385 const std::string EXTENSION_ABILITY_TYPE = "type"; 386 const std::string EXTENSION_URI = "uri"; 387 const std::string EXTENSION_ABILITY_READ_PERMISSION = "readPermission"; 388 const std::string EXTENSION_ABILITY_WRITE_PERMISSION = "writePermission"; 389 // requestPermission 390 const std::string REQUESTPERMISSION_NAME = "name"; 391 const std::string REQUESTPERMISSION_REASON = "reason"; 392 const std::string REQUESTPERMISSION_REASON_ID = "reasonId"; 393 const std::string REQUESTPERMISSION_USEDSCENE = "usedScene"; 394 const std::string REQUESTPERMISSION_ABILITIES = "abilities"; 395 const std::string REQUESTPERMISSION_WHEN = "when"; 396 // definePermission 397 const std::string DEFINEPERMISSION_NAME = "name"; 398 const std::string DEFINEPERMISSION_GRANT_MODE = "grantMode"; 399 const std::string DEFINEPERMISSION_AVAILABLE_LEVEL = "availableLevel"; 400 const std::string DEFINEPERMISSION_PROVISION_ENABLE = "provisionEnable"; 401 const std::string DEFINEPERMISSION_DISTRIBUTED_SCENE_ENABLE = "distributedSceneEnable"; 402 const std::string DEFINEPERMISSION_GRANT_MODE_DEFAULT_VALUE = "system_grant"; 403 const std::string DEFINEPERMISSION_AVAILABLE_LEVEL_DEFAULT_VALUE = "normal"; 404 // apl 405 const std::string AVAILABLELEVEL_NORMAL = "normal"; 406 const std::string AVAILABLELEVEL_SYSTEM_BASIC = "system_basic"; 407 const std::string AVAILABLELEVEL_SYSTEM_CORE = "system_core"; 408 409 extern thread_local int32_t parseResult; 410 } // namespace Profile 411 } // namespace AppExecFwk 412 } // namespace OHOS 413 #endif // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_COMMON_PROFILE_H 414