提交 5a4ce19a 编写于 作者: Y yuyaozhi

Merge branch 'master' of https://gitee.com/yuyaozhi/docs

...@@ -135,7 +135,7 @@ zh-cn/application-dev/IDL/ @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingz ...@@ -135,7 +135,7 @@ zh-cn/application-dev/IDL/ @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingz
zh-cn/application-dev/device-usage-statistics/ @chenmingJay @ningningW @tangtiantian2021 @nan-xiansen @iceice1001 zh-cn/application-dev/device-usage-statistics/ @chenmingJay @ningningW @tangtiantian2021 @nan-xiansen @iceice1001
zh-cn/application-dev/ui/ @HelloCrease @huaweimaxuchu @tomatodevboy @niulihua zh-cn/application-dev/ui/ @HelloCrease @huaweimaxuchu @tomatodevboy @niulihua
zh-cn/application-dev/notification/ @RayShih @jayleehw @li-weifeng2 @currydavids zh-cn/application-dev/notification/ @RayShih @jayleehw @li-weifeng2 @currydavids
zh-cn/application-dev/windowmanager/ @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee zh-cn/application-dev/windowmanager/ @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/webgl/ @zengyawen @zhangqiang183 @wind_zj @zxg-gitee zh-cn/application-dev/webgl/ @zengyawen @zhangqiang183 @wind_zj @zxg-gitee
zh-cn/application-dev/media/audio-overview.md @zengyawen @liuyuehua1 @saga2020 @currydavids zh-cn/application-dev/media/audio-overview.md @zengyawen @liuyuehua1 @saga2020 @currydavids
zh-cn/application-dev/media/audio-playback.md @zengyawen @liuyuehua1 @saga2020 @currydavids zh-cn/application-dev/media/audio-playback.md @zengyawen @liuyuehua1 @saga2020 @currydavids
...@@ -186,9 +186,12 @@ zh-cn/application-dev/dfx/errormanager-guidelines.md @littlejerry1 @ccllee @chen ...@@ -186,9 +186,12 @@ zh-cn/application-dev/dfx/errormanager-guidelines.md @littlejerry1 @ccllee @chen
zh-cn/application-dev/dfx/errormanager-guidelines.md @littlejerry1 @ccllee @chengxingzhen @RayShih zh-cn/application-dev/dfx/errormanager-guidelines.md @littlejerry1 @ccllee @chengxingzhen @RayShih
zh-cn/application-dev/key-features/multi-device-app-dev/ @lingminghw @crazyracing0726 zh-cn/application-dev/key-features/multi-device-app-dev/ @lingminghw @crazyracing0726
zh-cn/application-dev/database/ @ge-yafang @feng-aiwen @gong-a-shi @logic42 zh-cn/application-dev/database/ @ge-yafang @feng-aiwen @gong-a-shi @logic42
zh-cn/application-dev/napi/native-window-guidelines.md @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee zh-cn/application-dev/napi/native-window-guidelines.md @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/napi/mindspore-lite-guidelines.md @ge-yafang @grbuzhidao @jianghui58 @auraxu zh-cn/application-dev/napi/mindspore-lite-guidelines.md @ge-yafang @principal87 @jianghui58
zh-cn/application-dev/napi/mindspore-lite-offline-model-guidelines.md @ge-yafang @grbuzhidao @jianghui58 @auraxu zh-cn/application-dev/napi/mindspore-lite-offline-model-guidelines.md @ge-yafang @principal87 @jianghui58
zh-cn/application-dev/reference/apis/js-apis-mindSporeLite.md @ge-yafang @principal87 @jianghui58
zh-cn/application-dev/ai/mindspore-lite-js-guidelines.md @ge-yafang @principal87 @jianghui58
zh-cn/application-dev/napi/neural-network-runtime-guidelines.md @ge-yafang @principal87 @win10wei
zh-cn/application-dev/napi/rawfile_guidelines.md @ningningW zh-cn/application-dev/napi/rawfile_guidelines.md @ningningW
zh-cn/application-dev/background-agent-scheduled-reminder/ @RayShih zh-cn/application-dev/background-agent-scheduled-reminder/ @RayShih
zh-cn/application-dev/background-task-management/ @ningningW @wangwenli_wolf @tangtiantian2021 @nan-xiansen zh-cn/application-dev/background-task-management/ @ningningW @wangwenli_wolf @tangtiantian2021 @nan-xiansen
...@@ -275,9 +278,9 @@ zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md @litt ...@@ -275,9 +278,9 @@ zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md @litt
zh-cn/application-dev/reference/apis/js-apis-application-StartOptions.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-application-StartOptions.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-application-Want.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-application-Want.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/application-models/windowextensionability.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee zh-cn/application-dev/application-models/windowextensionability.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md @ge-yafang @zhouyaoying @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-appmanager.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-appmanager.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-arraylist.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-arraylist.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-audio.md @liuyuehua1 @zengyawen @magekkkk @currydavids zh-cn/application-dev/reference/apis/js-apis-audio.md @liuyuehua1 @zengyawen @magekkkk @currydavids
...@@ -334,7 +337,7 @@ zh-cn/application-dev/reference/apis/js-apis-deque.md @gongjunsong @ge-yafang @f ...@@ -334,7 +337,7 @@ zh-cn/application-dev/reference/apis/js-apis-deque.md @gongjunsong @ge-yafang @f
zh-cn/application-dev/reference/apis/js-apis-device-info.md @mupceet @zengyawen @handyohos @nan-xiansen zh-cn/application-dev/reference/apis/js-apis-device-info.md @mupceet @zengyawen @handyohos @nan-xiansen
zh-cn/application-dev/reference/apis/js-apis-device-manager.md @intermilano @RayShih @william-ligang @liuhonggang123 zh-cn/application-dev/reference/apis/js-apis-device-manager.md @intermilano @RayShih @william-ligang @liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md @shuaytao @RayShih @wangzhen107 @inter515 zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md @shuaytao @RayShih @wangzhen107 @inter515
zh-cn/application-dev/reference/apis/js-apis-display.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-display.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @nianCode @zengyawen @JiDong-CS @murphy1984 zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @nianCode @zengyawen @JiDong-CS @murphy1984
zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @feng-aiwen @ge-yafang @gong-a-shi @logic42 zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @feng-aiwen @ge-yafang @gong-a-shi @logic42
zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001
...@@ -418,9 +421,8 @@ zh-cn/application-dev/reference/apis/js-apis-resource-manager.md @Buda-Liu @ning ...@@ -418,9 +421,8 @@ zh-cn/application-dev/reference/apis/js-apis-resource-manager.md @Buda-Liu @ning
zh-cn/application-dev/reference/apis/js-apis-router.md @huaweimaxuchu @HelloCrease @niulihua @tomatodevboy zh-cn/application-dev/reference/apis/js-apis-router.md @huaweimaxuchu @HelloCrease @niulihua @tomatodevboy
zh-cn/application-dev/reference/apis/js-apis-rpc.md @xuepianpian @RayShih @zhaopeng_gitee @vagrant_world zh-cn/application-dev/reference/apis/js-apis-rpc.md @xuepianpian @RayShih @zhaopeng_gitee @vagrant_world
zh-cn/application-dev/reference/apis/js-apis-runninglock.md @aqxyjay @zengyawen @aqxyjay @alien0208 zh-cn/application-dev/reference/apis/js-apis-runninglock.md @aqxyjay @zengyawen @aqxyjay @alien0208
zh-cn/application-dev/reference/apis/js-apis-screen.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-screen.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-screenshot.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-screenshot.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-securityLabel.md @panqinxu @zengyawen @bubble_mao @jinhaihw zh-cn/application-dev/reference/apis/js-apis-securityLabel.md @panqinxu @zengyawen @bubble_mao @jinhaihw
zh-cn/application-dev/reference/apis/js-apis-sensor.md @hellohyh001 @ningningW @butterls @star-wind-snow-and-rain zh-cn/application-dev/reference/apis/js-apis-sensor.md @hellohyh001 @ningningW @butterls @star-wind-snow-and-rain
zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
...@@ -461,6 +463,8 @@ zh-cn/application-dev/reference/apis/js-apis-testRunner.md @inter515 @littlejerr ...@@ -461,6 +463,8 @@ zh-cn/application-dev/reference/apis/js-apis-testRunner.md @inter515 @littlejerr
zh-cn/application-dev/reference/apis/js-apis-thermal.md @aqxyjay @zengyawen @aqxyjay @alien0208 zh-cn/application-dev/reference/apis/js-apis-thermal.md @aqxyjay @zengyawen @aqxyjay @alien0208
zh-cn/application-dev/reference/apis/js-apis-timer.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-timer.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-touchevent.md @mayunteng_1 @ningningW @cococoler @alien0208 zh-cn/application-dev/reference/apis/js-apis-touchevent.md @mayunteng_1 @ningningW @cococoler @alien0208
zh-cn/application-dev/reference/apis/js-apis-shortKey.md @mayunteng_1 @ningningW @cococoler @alien0208
zh-cn/application-dev/reference/apis/js-apis-devicestatus-cooperate.md @mayunteng_1 @ningningW @cococoler @alien0208
zh-cn/application-dev/reference/apis/js-apis-treemap.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-treemap.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-treeset.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-treeset.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-uitest.md @inter515 @ningningW @inter515 @jiyong zh-cn/application-dev/reference/apis/js-apis-uitest.md @inter515 @ningningW @inter515 @jiyong
...@@ -476,17 +480,19 @@ zh-cn/application-dev/reference/apis/js-apis-vector.md @gongjunsong @ge-yafang @ ...@@ -476,17 +480,19 @@ zh-cn/application-dev/reference/apis/js-apis-vector.md @gongjunsong @ge-yafang @
zh-cn/application-dev/reference/apis/js-apis-vibrator.md @hellohyh001 @ningningW @butterls @star-wind-snow-and-rain zh-cn/application-dev/reference/apis/js-apis-vibrator.md @hellohyh001 @ningningW @butterls @star-wind-snow-and-rain
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md @panqinxu @zengyawen @bubble_mao @jinhaihw zh-cn/application-dev/reference/apis/js-apis-volumemanager.md @panqinxu @zengyawen @bubble_mao @jinhaihw
zh-cn/application-dev/reference/apis/js-apis-wallpaper.md @feng-aiwen @ningningW @wangzhangjun @murphy1984 zh-cn/application-dev/reference/apis/js-apis-wallpaper.md @feng-aiwen @ningningW @wangzhangjun @murphy1984
zh-cn/application-dev/reference/apis/js-apis-screen-lock.md @feng-aiwen @ningningW @wangzhangjun @murphy1984
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-webgl.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-webgl.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-webgl2.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-webgl2.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-webSocket.md @zhang-hai-feng @zengyawen @jyh926 @gaoxi785 zh-cn/application-dev/reference/apis/js-apis-webSocket.md @zhang-hai-feng @zengyawen @jyh926 @gaoxi785
zh-cn/application-dev/reference/apis/js-apis-wifi.md @cheng_guohong @RayShih @cheng_guohong @quanli125 zh-cn/application-dev/reference/apis/js-apis-wifi.md @cheng_guohong @RayShih @cheng_guohong @quanli125
zh-cn/application-dev/reference/apis/js-apis-wifiext.md @cheng_guohong @RayShih @cheng_guohong @quanli125 zh-cn/application-dev/reference/apis/js-apis-wifiext.md @cheng_guohong @RayShih @cheng_guohong @quanli125
zh-cn/application-dev/reference/apis/js-apis-window.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-window.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-windowAnimationManager.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee zh-cn/application-dev/reference/apis/js-apis-windowAnimationManager.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-worker.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-worker.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-taskpool.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-taskpool.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-workScheduler.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-workScheduler.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-inner-application-WorkSchedulerExtensionContext.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-xml.md @gongjunsong @ge-yafang @flyingwolf @BlackStone zh-cn/application-dev/reference/apis/js-apis-xml.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-zlib.md @shuaytao @RayShih @wangzhen107 @inter515 zh-cn/application-dev/reference/apis/js-apis-zlib.md @shuaytao @RayShih @wangzhen107 @inter515
...@@ -532,6 +538,7 @@ zh-cn/application-dev/reference/apis/js-apis-curve.md @huaweimaxuchu @HelloCreas ...@@ -532,6 +538,7 @@ zh-cn/application-dev/reference/apis/js-apis-curve.md @huaweimaxuchu @HelloCreas
zh-cn/application-dev/reference/apis/js-apis-defaultAppManager.md @shuaytao @RayShih @wangzhen107 @inter515 zh-cn/application-dev/reference/apis/js-apis-defaultAppManager.md @shuaytao @RayShih @wangzhen107 @inter515
zh-cn/application-dev/reference/apis/js-apis-distributedBundle.md @shuaytao @RayShih @wangzhen107 @inter515 zh-cn/application-dev/reference/apis/js-apis-distributedBundle.md @shuaytao @RayShih @wangzhen107 @inter515
zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md @feng-aiwen @ge-yafang @gong-a-shi @logic42 zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md @feng-aiwen @ge-yafang @gong-a-shi @logic42
zh-cn/application-dev/reference/apis/js-apis-enterprise-applicationManager.md @liuzuming @ningningW @yangqing3
zh-cn/application-dev/reference/apis/js-apis-enterprise-accountManager.md @liuzuming @ningningW @yangqing3 zh-cn/application-dev/reference/apis/js-apis-enterprise-accountManager.md @liuzuming @ningningW @yangqing3
zh-cn/application-dev/reference/apis/js-apis-enterprise-adminManager.md @liuzuming @ningningW @yangqing3 zh-cn/application-dev/reference/apis/js-apis-enterprise-adminManager.md @liuzuming @ningningW @yangqing3
zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md @liuzuming @ningningW @yangqing3 zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md @liuzuming @ningningW @yangqing3
...@@ -554,8 +561,10 @@ zh-cn/application-dev/reference/apis/js-apis-net-sharing.md @zhang-hai-feng @zen ...@@ -554,8 +561,10 @@ zh-cn/application-dev/reference/apis/js-apis-net-sharing.md @zhang-hai-feng @zen
zh-cn/application-dev/reference/apis/js-apis-nfctech.md @cheng_guohong @RayShih @cheng_guohong @quanli125 zh-cn/application-dev/reference/apis/js-apis-nfctech.md @cheng_guohong @RayShih @cheng_guohong @quanli125
zh-cn/application-dev/reference/apis/js-apis-promptAction.md @huaweimaxuchu @HelloCrease @niulihua @tomatodevboy zh-cn/application-dev/reference/apis/js-apis-promptAction.md @huaweimaxuchu @HelloCrease @niulihua @tomatodevboy
zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceStandby.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceStandby.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md @chenmingJay @ningningW @nan-xiansen @iceice1001 zh-cn/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-stationary.md @mayunteng_1 @ningningW @cococoler @alien0208 zh-cn/application-dev/reference/apis/js-apis-stationary.md @mayunteng_1 @ningningW @cococoler @alien0208
zh-cn/application-dev/reference/apis/js-apis-system-capability.md taiyipei taiyipei BlackStone zh-cn/application-dev/reference/apis/js-apis-system-capability.md taiyipei taiyipei BlackStone
...@@ -610,6 +619,7 @@ zh-cn/application-dev/reference/errorcodes/errorcode-request.md @ningningW ...@@ -610,6 +619,7 @@ zh-cn/application-dev/reference/errorcodes/errorcode-request.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-resource-manager.md @ningningW zh-cn/application-dev/reference/errorcodes/errorcode-resource-manager.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-router.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-router.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-screenlock.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-runninglock.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-runninglock.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-sensor.md @ningningW zh-cn/application-dev/reference/errorcodes/errorcode-sensor.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-system-parameterV9.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-system-parameterV9.md @zengyawen
......
...@@ -6,7 +6,7 @@ Icons and labels are usually configured together. There is the application icon, ...@@ -6,7 +6,7 @@ Icons and labels are usually configured together. There is the application icon,
The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and entry labels. When you touch one of them, the corresponding UIAbility page is displayed. The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and entry labels. When you touch one of them, the corresponding UIAbility page is displayed.
**Figure 1** Icons and labels **Figure 1** Icons and labels
![application-component-configuration-stage](figures/application-component-configuration-stage.png) ![application-component-configuration-stage](figures/application-component-configuration-stage.png)
......
# InputMethodExtensionAbility Development # InputMethodExtensionAbility
## When to Use ## When to Use
[InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md), inherited from [ExtensionAbility](extensionability-overview.md), is used for developing input method applications. [InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md), inherited from [ExtensionAbility](extensionability-overview.md), is used for developing input method applications.
......
...@@ -401,7 +401,7 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i ...@@ -401,7 +401,7 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i
console.info(TAG, 'getBundleNameByUid: ' + callerBundleName); console.info(TAG, 'getBundleNameByUid: ' + callerBundleName);
// Identify the bundle name of the client. // Identify the bundle name of the client.
if (callerBundleName != 'com.example.connectextapp') { // The verification fails. if (callerBundleName != 'com.example.connectextapp') { // The verification fails.
console.info(TAG, 'The caller bundle is not in whitelist, reject'); console.info(TAG, 'The caller bundle is not in trustlist, reject');
return; return;
} }
// The verification is successful, and service logic is executed normally. // The verification is successful, and service logic is executed normally.
......
# WindowExtensionAbility # WindowExtensionAbility (for System Applications Only)
[WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md) is a type of ExtensionAbility component that allows a system application to be embedded in and displayed over another application. [WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md) is a type of ExtensionAbility component that allows a system application to be embedded in and displayed over another application.
...@@ -15,7 +15,7 @@ the context is [WindowExtensionContext](../reference/apis/js-apis-inner-applicat ...@@ -15,7 +15,7 @@ the context is [WindowExtensionContext](../reference/apis/js-apis-inner-applicat
> >
## Setting an Embedded UIAbility (for System Applications Only) ## Setting an Embedded UIAbility
The **WindowExtensionAbility** class provides **onConnect()**, **onDisconnect()**, and **onWindowReady()** lifecycle callbacks, which can be overridden. The **WindowExtensionAbility** class provides **onConnect()**, **onDisconnect()**, and **onWindowReady()** lifecycle callbacks, which can be overridden.
...@@ -79,7 +79,7 @@ To implement an embedded application, manually create a WindowExtensionAbility i ...@@ -79,7 +79,7 @@ To implement an embedded application, manually create a WindowExtensionAbility i
``` ```
## Starting an Embedded UIAbility (for System Applications Only) ## Starting an Embedded UIAbility
System applications can load the created WindowExtensionAbility through the AbilityComponent. System applications can load the created WindowExtensionAbility through the AbilityComponent.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
## Overview ## Overview
To accelerate test automation of OpenHarmony, arkXtest — an automated test framework that supports both the JavaScript (JS) and TypeScript (TS) programming languages — is provided. To accelerate test automation of OpenHarmony, arkXtest — an automated unit and UI test framework that supports both the JavaScript (JS) and TypeScript (TS) programming languages — is provided.
In this document you will learn about the key functions of arkXtest and how to use it to perform unit testing on application or system APIs and to write UI automated test scripts. In this document you will learn about the key functions of arkXtest and how to use it to perform unit testing on application or system APIs and to write UI automated test scripts.
...@@ -13,7 +13,7 @@ In this document you will learn about the key functions of arkXtest and how to u ...@@ -13,7 +13,7 @@ In this document you will learn about the key functions of arkXtest and how to u
arkXtest is part of the OpenHarmony toolkit and provides basic capabilities of writing and running OpenHarmony automated test scripts. In terms of test script writing, arkXtest offers a wide range of APIs, including basic process APIs, assertion APIs, and APIs related to UI operations. In terms of test script running, arkXtest offers such features as identifying, scheduling, and executing test scripts, as well as summarizing test script execution results. arkXtest is part of the OpenHarmony toolkit and provides basic capabilities of writing and running OpenHarmony automated test scripts. In terms of test script writing, arkXtest offers a wide range of APIs, including basic process APIs, assertion APIs, and APIs related to UI operations. In terms of test script running, arkXtest offers such features as identifying, scheduling, and executing test scripts, as well as summarizing test script execution results.
### Principles ### Implementation
arkXtest is divided into two parts: unit test framework and UI test framework. arkXtest is divided into two parts: unit test framework and UI test framework.
...@@ -27,16 +27,16 @@ arkXtest is divided into two parts: unit test framework and UI test framework. ...@@ -27,16 +27,16 @@ arkXtest is divided into two parts: unit test framework and UI test framework.
![](figures/TestFlow.PNG) ![](figures/TestFlow.PNG)
- UI Testing Framework - UI Test Framework
The UI test framework provides [UiTest APIs](../reference/apis/js-apis-uitest.md) for you to call in different test scenarios. The test scripts are executed on top of the unit test framework mentioned above. The UI test framework provides [UiTest APIs](../reference/apis/js-apis-uitest.md) for you to call in different test scenarios. The UI test scripts are executed on top of the aformentioned unit test framework.
The figure below shows the main functions of the UI test framework. The figure below shows the main functions of the UI test framework.
![](figures/Uitest.PNG) ![](figures/Uitest.PNG)
### Limitations and Constraints ### Constraints
- The features of the UI test framework are available only in OpenHarmony 3.1 and later versions. - The features of the UI test framework are available only in OpenHarmony 3.1 and later versions.
- The feature availability of the unit test framework varies by version. For details about the mappings between the features and versions, see [arkXtest](https://gitee.com/openharmony/testfwk_arkxtest/blob/master/README_en.md). - The feature availability of the unit test framework varies by version. For details about the mappings between the features and versions, see [arkXtest](https://gitee.com/openharmony/testfwk_arkxtest/blob/master/README_en.md).
...@@ -46,9 +46,9 @@ arkXtest is divided into two parts: unit test framework and UI test framework. ...@@ -46,9 +46,9 @@ arkXtest is divided into two parts: unit test framework and UI test framework.
### Environment Requirements ### Environment Requirements
Software for writing test scripts: DevEco Studio 3.0 or later Software: DevEco Studio 3.0 or later
Hardware for running test scripts: PC connected to an OpenHarmony device, such as the RK3568 development board Hardware: PC connected to an OpenHarmony device, such as the RK3568 development board
### Setting Up the Environment ### Setting Up the Environment
...@@ -57,7 +57,7 @@ Hardware for running test scripts: PC connected to an OpenHarmony device, such a ...@@ -57,7 +57,7 @@ Hardware for running test scripts: PC connected to an OpenHarmony device, such a
## Creating a Test Script ## Creating a Test Script
1. Open DevEco Studio and create a project, where the **ohos** directory is where the test script is located. 1. Open DevEco Studio and create a project, in which the **ohos** directory is where the test script is located.
2. Open the .ets file of the module to be tested in the project directory. Move the cursor to any position in the code, and then right-click and choose **Show Context Actions** > **Create Ohos Test** or press **Alt+Enter** and choose **Create Ohos Test** to create a test class. 2. Open the .ets file of the module to be tested in the project directory. Move the cursor to any position in the code, and then right-click and choose **Show Context Actions** > **Create Ohos Test** or press **Alt+Enter** and choose **Create Ohos Test** to create a test class.
## Writing a Unit Test Script ## Writing a Unit Test Script
...@@ -95,7 +95,7 @@ export default function abilityTest() { ...@@ -95,7 +95,7 @@ export default function abilityTest() {
The unit test script must contain the following basic elements: The unit test script must contain the following basic elements:
1. Import of the dependency package so that the dependent test APIs can be used. 1. Import of the dependencies so that the dependent test APIs can be used.
2. Test code, mainly about the related logic, such as API invoking. 2. Test code, mainly about the related logic, such as API invoking.
...@@ -105,7 +105,7 @@ The unit test script must contain the following basic elements: ...@@ -105,7 +105,7 @@ The unit test script must contain the following basic elements:
You write a UI test script based on the unit test framework, adding the invoking of APIs provided by the UI test framework to implement the corresponding test logic. You write a UI test script based on the unit test framework, adding the invoking of APIs provided by the UI test framework to implement the corresponding test logic.
In this example, the UI test script is written based on the preceding unit test script. First, add the dependency package, as shown below: In this example, the UI test script is written based on the preceding unit test script. First, import the dependency, as shown below:
```js ```js
import {Driver,ON,Component,MatchPattern} from '@ohos.uitest' import {Driver,ON,Component,MatchPattern} from '@ohos.uitest'
...@@ -158,11 +158,9 @@ export default function abilityTest() { ...@@ -158,11 +158,9 @@ export default function abilityTest() {
You can run a test script in DevEco Studio in any of the following modes: You can run a test script in DevEco Studio in any of the following modes:
1. Test package level: All test cases in the test package are executed. - Test package level: All test cases in the test package are executed.
- Test suite level: All test cases defined in the **describe** method are executed.
2. Test suite level: All test cases defined in the **describe** method are executed. - Test method level: The specified **it** method, that is, a single test case, is executed.
3. Test method level: The specified **it** method, that is, a single test case, is executed.
![](figures/Execute.PNG) ![](figures/Execute.PNG)
...@@ -176,7 +174,7 @@ After the test is complete, you can view the test result in DevEco Studio, as sh ...@@ -176,7 +174,7 @@ After the test is complete, you can view the test result in DevEco Studio, as sh
To run a test script in the CLI, execute **aa** commands with different execution control keywords. To run a test script in the CLI, execute **aa** commands with different execution control keywords.
Parameters in aa test commands The table below lists the keywords in **aa** test commands.
| Keyword | Abbreviation| Description | Example | | Keyword | Abbreviation| Description | Example |
| ------------- | ------------ | -------------------------------------- | ---------------------------------- | | ------------- | ------------ | -------------------------------------- | ---------------------------------- |
...@@ -187,18 +185,18 @@ Parameters in aa test commands ...@@ -187,18 +185,18 @@ Parameters in aa test commands
The framework supports multiple test case execution modes, which are triggered by the key-value pair following the **-s** keyword. The table below lists the available keys and values. The framework supports multiple test case execution modes, which are triggered by the key-value pair following the **-s** keyword. The table below lists the available keys and values.
| Key | Description | Value | Parameter | | Key | Description | Value | Example |
| ------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- | | ------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- |
| unittest | OpenHarmonyTestRunner object used for test case execution. | **OpenHarmonyTestRunner** or custom runner name. | - s unittest OpenHarmonyTestRunner | | unittest | **OpenHarmonyTestRunner** object used for test case execution. | **OpenHarmonyTestRunner** or custom runner name. | - s unittest OpenHarmonyTestRunner |
| class | Test suite or test case to be executed. | {describeName}#{itName}, {describeName} | -s class attributeTest#testAttributeIt | | class | Test suite or test case to be executed. | {describeName}#{itName}, {describeName} | -s class attributeTest#testAttributeIt |
| notClass | Test suite or test case that does not need to be executed. | {describeName}#{itName}, {describeName} | -s notClass attributeTest#testAttributeIt | | notClass | Test suite or test case that does not need to be executed. | {describeName}#{itName}, {describeName} | -s notClass attributeTest#testAttributeIt |
| itName | Test case to be executed. | {itName} | -s itName testAttributeIt | | itName | Test case to be executed. | {itName} | -s itName testAttributeIt |
| timeout | Timeout interval for executing a test case. | Positive integer (unit: ms). If no value is set, the default value 5000 is used. | -s timeout 15000 | | timeout | Timeout interval for executing a test case. | Positive integer (unit: ms). If no value is set, the default value 5000 is used. | -s timeout 15000 |
| breakOnError | Whether to enable break-on-error mode. When this mode is enabled, the test execution process exits if a test assertion error or any other error occurs.| **true**/**false** (default value) | -s breakOnError true | | breakOnError | Whether to enable break-on-error mode. When this mode is enabled, the test execution process exits if a test assertion failure or error occurs.| **true**/**false** (default value) | -s breakOnError true |
| random | Whether to execute test cases in random sequence.| **true**/**false** (default value) | -s random true | | random | Whether to execute test cases in random sequence.| **true**/**false** (default value) | -s random true |
| testType | Type of the test case to be executed. | function, performance, power, reliability, security, global, compatibility, user, standard, safety, resilience| -s testType function | | testType | Type of the test case to be executed. | function, performance, power, reliability, security, global, compatibility, user, standard, safety, resilience| -s testType function |
| level | Level of the test case to be executed. | 0, 1, 2, 3, 4 | -s level 0 | | level | Level of the test case to be executed. | 0, 1, 2, 3, 4 | -s level 0 |
| size | Size of the test case to be executed. | small, medium, large | -s size small | | size | Size of the test case to be executed. | small, medium, large | -s size small
| stress | Number of times that the test case is executed. | Positive integer | -s stress 1000 | | stress | Number of times that the test case is executed. | Positive integer | -s stress 1000 |
**Running Commands** **Running Commands**
...@@ -306,7 +304,7 @@ OHOS_REPORT_STATUS: consuming=4 ...@@ -306,7 +304,7 @@ OHOS_REPORT_STATUS: consuming=4
| OHOS_REPORT_STATUS: stream | Error information of the current test case.| | OHOS_REPORT_STATUS: stream | Error information of the current test case.|
| OHOS_REPORT_STATUS: test| Name of the current test case.| | OHOS_REPORT_STATUS: test| Name of the current test case.|
| OHOS_REPORT_STATUS_CODE | Execution result of the current test case. The options are as follows:<br>**0**: pass<br>**1**: error<br>**2**: fail| | OHOS_REPORT_STATUS_CODE | Execution result of the current test case. The options are as follows:<br>**0**: pass<br>**1**: error<br>**2**: fail|
| OHOS_REPORT_STATUS: consuming | Execution duration of the current test case.| | OHOS_REPORT_STATUS: consuming | Time spent in executing the current test case.|
- After the commands are executed, the log information similar to the following is displayed: - After the commands are executed, the log information similar to the following is displayed:
...@@ -324,7 +322,7 @@ OHOS_REPORT_STATUS: taskconsuming=16029 ...@@ -324,7 +322,7 @@ OHOS_REPORT_STATUS: taskconsuming=16029
| Failure | Number of failed test cases.| | Failure | Number of failed test cases.|
| Error | Number of test cases whose execution encounters errors. | | Error | Number of test cases whose execution encounters errors. |
| Pass | Number of passed test cases.| | Pass | Number of passed test cases.|
| Ignore | Number of test cases not executed.| | Ignore | Number of test cases not yet executed.|
| taskconsuming| Total time spent in executing the current test case.| | taskconsuming| Total time spent in executing the current test case.|
> When an error occurs in break-on-error mode, check the **Ignore** and interrupt information. > When an error occurs in break-on-error mode, check the **Ignore** and interrupt information.
...@@ -341,11 +339,11 @@ The logs added to the test case are displayed after the test case execution, rat ...@@ -341,11 +339,11 @@ The logs added to the test case are displayed after the test case execution, rat
**Possible Causes** **Possible Causes**
More than one asynchronous interface is called in the test case.<br>In principle, logs in the test case are printed before the test case execution is complete. More than one asynchronous API is called in the test case.<br>In principle, logs in the test case are printed before the test case execution is complete.
**Solution** **Solution**
If more than one asynchronous interface is called, you are advised to encapsulate the interface invoking into the promise mode If more than one asynchronous API is called, you are advised to encapsulate the API invoking into the promise mode.
#### Error "fail to start ability" is reported during test case execution #### Error "fail to start ability" is reported during test case execution
...@@ -373,7 +371,7 @@ After the test case execution is complete, the console displays the error messag ...@@ -373,7 +371,7 @@ After the test case execution is complete, the console displays the error messag
2. The time taken for API invocation is longer than the timeout interval set for test case execution. 2. The time taken for API invocation is longer than the timeout interval set for test case execution.
3. Test assertion fails, and a failure exception is thrown. As a result, the test case execution does not end until the timeout expires. 3. Test assertion fails, and a failure exception is thrown. As a result, the test case execution does not end until it times out.
**Solution** **Solution**
...@@ -388,11 +386,11 @@ After the test case execution is complete, the console displays the error messag ...@@ -388,11 +386,11 @@ After the test case execution is complete, the console displays the error messag
**Problem** **Problem**
The UI test case fails to be executed. The HiLog file contains the error message "Get windows failed/GetRootByWindow failed". The UI test case fails to be executed. The HiLog file contains the error message "Get windows failed/GetRootByWindow failed."
**Possible Causes** **Possible Causes**
The ArkUI feature is disabled. As a result, the control tree information on the test page is not generated. The ArkUI feature is disabled. As a result, the component tree information is not generated on the test page.
**Solution** **Solution**
...@@ -410,13 +408,13 @@ The UI test case fails to be executed. The HiLog file contains the error message ...@@ -410,13 +408,13 @@ The UI test case fails to be executed. The HiLog file contains the error message
**Possible Causes** **Possible Causes**
1. In the test case, the **await** operator is not added to the asynchronous interface provided by the UI test framework. 1. In the test case, the **await** operator is not added to the asynchronous API provided by the UI test framework.
2. The UI test case is executed in multiple processes. As a result, multiple UI test processes are started. The framework does not support multi-process invoking. 2. The UI test case is executed in multiple processes. As a result, multiple UI test processes are started. The framework does not support multi-process invoking.
**Solution** **Solution**
1. Check the case implementation and add the **await** operator to the asynchronous interface invoking. 1. Check the case implementation and add the **await** operator to the asynchronous API.
2. Do not execute UI test cases in multiple processes. 2. Do not execute UI test cases in multiple processes.
...@@ -424,11 +422,11 @@ The UI test case fails to be executed. The HiLog file contains the error message ...@@ -424,11 +422,11 @@ The UI test case fails to be executed. The HiLog file contains the error message
**Problem** **Problem**
The UI test case fails to be executed. The HiLog file contains the error message "does not exist on current UI! Check if the UI has changed after you got the widget object". The UI test case fails to be executed. The HiLog file contains the error message "does not exist on current UI! Check if the UI has changed after you got the widget object."
**Possible Causes** **Possible Causes**
After the target component is found in the code of the test case, the device UI changes. As a result, the found component is lost and the emulation operation cannot be performed. After the target component is found in the code of the test case, the device UI changes, resulting in loss of the found component and inability to perform emulation.
**Solution** **Solution**
......
...@@ -78,6 +78,8 @@ httpRequest.request( ...@@ -78,6 +78,8 @@ httpRequest.request(
// data.header carries the HTTP response header. Parse the content based on service requirements. // data.header carries the HTTP response header. Parse the content based on service requirements.
console.info('header:' + JSON.stringify(data.header)); console.info('header:' + JSON.stringify(data.header));
console.info('cookies:' + JSON.stringify(data.cookies)); // 8+ console.info('cookies:' + JSON.stringify(data.cookies)); // 8+
// Call the destroy() method to release resources after HttpRequest is complete.
httpRequest.destroy();
} else { } else {
console.info('error:' + JSON.stringify(err)); console.info('error:' + JSON.stringify(err));
// Unsubscribe from HTTP Response Header events. // Unsubscribe from HTTP Response Header events.
...@@ -158,4 +160,11 @@ httpRequest.request2( ...@@ -158,4 +160,11 @@ httpRequest.request2(
httpRequest.destroy(); httpRequest.destroy();
} }
); );
``` ```
\ No newline at end of file
## Samples
The following sample is provided to help you better understand how to develop the HTTP data request feature:
- [`Http`: Data Request (ArkTS) (API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Connectivity/Http)
- [HTTP Communication (ArkTS) (API9)](https://gitee.com/openharmony/codelabs/tree/master/NetworkManagement/SmartChatEtsOH)
# Device Usage Statistics Development (API Version 9) # Device Usage Statistics Development
## When to Use ## When to Use
...@@ -38,7 +38,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics'; ...@@ -38,7 +38,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
## How to Develop ## How to Develop
1. Before obtaining the device usage statistics, check whether the **ohos.permission.BUNDLE_ACTIVE_INFO** permission is configured. For details about how to configure a permission, see [Declaring Permissions](../security/accesstoken-guidelines.md). 1. Before obtaining the device usage statistics, check whether the **ohos.permission.BUNDLE_ACTIVE_INFO** permission is configured. For details about how to configure a permission, see [Declaring Permissions](../security/accesstoken-guidelines.md).
2. Query events of all applications based on the specified start time and end time. This requires the **ohos.permission.BUNDLE_ACTIVE_INFO** permission to be configured. 2. Query events of all applications based on the specified start time and end time. This requires the **ohos.permission.BUNDLE_ACTIVE_INFO** permission to be configured.
```js ```js
......
...@@ -21,7 +21,7 @@ Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only ...@@ -21,7 +21,7 @@ Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only
## Available APIs ## Available APIs
The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference]( ../reference/apis/js-apis-hitracemeter.md). The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference](../reference/apis/js-apis-hitracemeter.md).
**APIs for performance tracing** **APIs for performance tracing**
......
...@@ -4,17 +4,13 @@ ...@@ -4,17 +4,13 @@
Applicable to: OpenHarmony 3.2 Beta (API version 9) Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Symptom**
How do I flush HiLog information to disks?
**Solution** **Solution**
Run the **hilog -w start -f ckTest -l 1M -n 5 -m zlib -j 11** command. Run the **hilog -w start -f ckTest -l 1M -n 5 -m zlib -j 11** command.
The log file is saved in the **/data/log/hilog/** directory. The log file is saved in the **/data/log/hilog/** directory.
Parameter description: **Parameters:**
``` ```
-**-w**: Starts a log flushing task. **start** means to start the task, and **stop** means to stop the task. -**-w**: Starts a log flushing task. **start** means to start the task, and **stop** means to stop the task.
...@@ -25,3 +21,129 @@ Parameter description: ...@@ -25,3 +21,129 @@ Parameter description:
-**-j**: Specifies the task ID. The value ranges from **10** to **0xffffffffff**. -**-j**: Specifies the task ID. The value ranges from **10** to **0xffffffffff**.
For more details about parameters, run the **hilog --help** command. For more details about parameters, run the **hilog --help** command.
``` ```
## How do I print only HiLog information of the current application?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Solution**
Use the hilog command line tool to filter the logs of the current application.
**hilog -T xxx**: filtering logs by tag.
**hilog –D xxx**: filtering logs by domain.
**hilog -e**: matching log content based on the tag, domain, and pid by using regular expressions. Multi-layered filtering, combination filtering, and reverse filtering are supported.
## How do I locate the fault when the application crashes?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Solution**
Method 1: Locate the crash-related code based on the service log.
Method 2: View the error information in the crash file. The crash file is located at **/data/log/faultlog/faultlogger/**.
## Is HiLog or console recommended for log printing? How do I set the domain if HiLog is used?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
The console encapsulates the HiLog system with the default parameter configuration. It is mainly used in the application development and debugging phase.
HiLog is recommended because it supports log classification and processing in a unified manner. For details, see [@ohos.hilog (HiLog)](../reference/apis/js-apis-hilog.md#hilogisloggable).
The value of the **domain** parameter in the HiLog API ranges from **0x0** to **0xFFFF**. You are advised to customize the value as required.
## What is the maximum length of a log record when HiLog is used? Is it configurable?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
The maximum length of a log record is 1,024 characters, and it is not changeable.
## What is the purpose of using private in printing of formatted logs?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Symptom**
**private** is displayed in HiLog information when format parameters are of the %d or %s type in C++.
**Solution**
When format parameters such as **%d** and **%s** are directly used, the standard system uses **private** to replace the actual data for printing by default to prevent data leakage. To print the actual data, replace **%d** with **%{public}d** or replace **%s** with **%{public}s**.
## What should I do if the hilog.debug log cannot be printed?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Solution**
Run **hdc std shell hilog -b D** to turn on the debugging switch.
## Can I separate multiple strings by spaces in the tag parameter of the HiLog API?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
Yes.
## How does HiLog print the log information marked with the \{private\} tag?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Solution**
To print the log information marked with the \{private\} tag, run the command to disable the privacy mode: hdc shell hilog -p off
## What are the cash log collection and performance troubleshooting functions provided by the HiLog system?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Symptom**
What are the cash log collection and performance troubleshooting functions provided by the HiLog system?
**Solution**
FaultLogger: collects crash logs. For details, see [FaultLogger](../reference/apis/js-apis-faultLogger.md).
HiChecker: detects potential faults. For details, see [HiChecker](../reference/apis/js-apis-hichecker.md).
hiTraceMeter: implements performance tracing. For details, see [hiTraceMeter](../reference/apis/js-apis-hitracemeter.md).
## How do I control log output?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
**Symptom**
The output log varies according to environment requirements.
**Solution**
You can run the following command to adjust the log level to print the desired logs:
hdc shell hilog -L <D/I/W/E/F\>
## Is there a limit on the tag length of HiLog?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
The length of the entire tag is 32.
## How do I view the appfreeze information in the logs?
Applicable to: OpenHarmony 3.2 Beta (API version 9)
Try the following procedure:
1. Check the reason for the event. Fault location methods and examples are provided specifically to different reasons.
2. Check the MSG information.
3. Check the application stack information in OpenStacktraceCatcher as well as the HiLog information for the operation that leads to the event.
4. Check the PeerBinderCatcher process to see if the current process is suspended by the peer binder. If there is a synchronous wait related to the current process, the corresponding PeerBinder Stacktrace information will be logged. It contains the stack information of the peer process that leads to suspension of the current process.
5. Check the CPU usage of system processes and the memory usage of the current process.
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
## How do I read an XML file in rawfile and convert the data in it to the string type? ## How do I read an XML file in rawfile and convert the data in it to the string type?
Applicable to: OpenHarmony 3.2 Beta 5 (API version 9) Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution** **Solution**
Call **getRawFileContent** of the **ResourceManager** module to obtain the data in the XML file, and then use **String.fromCharCode** to convert the data to the string type. Call **getRawFileContent** of the **ResourceManager** module to obtain the data in the XML file, and then use **String.fromCharCode** to convert the data to the string type.
**Sample Code** **Example**
``` ```
resourceManager.getRawFileContent('test.xml', (error, value) => { resourceManager.getRawFileContent('test.xml', (error, value) => {
...@@ -21,7 +21,7 @@ resourceManager.getRawFileContent('test.xml', (error, value) => { ...@@ -21,7 +21,7 @@ resourceManager.getRawFileContent('test.xml', (error, value) => {
}); });
``` ```
**Reference** **Reference Link**
[Resource Manager](../reference/apis/js-apis-resource-manager.md) [Resource Manager](../reference/apis/js-apis-resource-manager.md)
...@@ -33,7 +33,7 @@ Applicable to: OpenHarmony 3.1 Beta 5 (API version 9) ...@@ -33,7 +33,7 @@ Applicable to: OpenHarmony 3.1 Beta 5 (API version 9)
The stage model allows an application to obtain a **ResourceManager** object based on **context** and call its resource management APIs without first importing the required bundle. This mode does not apply to the FA model. The stage model allows an application to obtain a **ResourceManager** object based on **context** and call its resource management APIs without first importing the required bundle. This mode does not apply to the FA model.
**Sample Code** **Example**
``` ```
const context = getContext(this) as any const context = getContext(this) as any
...@@ -63,13 +63,13 @@ To obtain the path of the **resource** directory, try either of the following wa ...@@ -63,13 +63,13 @@ To obtain the path of the **resource** directory, try either of the following wa
2. Use **ResourceManager** for access. This method applies to dynamic access, during which the **resource** directory dynamically changes when the application is running. 2. Use **ResourceManager** for access. This method applies to dynamic access, during which the **resource** directory dynamically changes when the application is running.
**Reference** **Reference Link**
[Resource Categories and Access](../quick-start/resource-categories-and-access.md) and [Resource Manager](../reference/apis/js-apis-resource-manager.md) [Resource Categories and Access](../quick-start/resource-categories-and-access.md) and [Resource Manager](../reference/apis/js-apis-resource-manager.md)
## Why does getPluralString return an incorrect value? ## Why does getPluralString return an incorrect value?
Applicable to: OpenHarmony 3.2 Beta 5 (API version 9) Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Symptom** **Symptom**
...@@ -81,19 +81,19 @@ The **getPluralString** API is effective only when the system language is Englis ...@@ -81,19 +81,19 @@ The **getPluralString** API is effective only when the system language is Englis
## How do I obtain the customized string fields in the resources directory? ## How do I obtain the customized string fields in the resources directory?
Applicable to: OpenHarmony 3.2 Beta 5 (API version 9) Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution** **Solution**
Use **getStringValue** of the **ResourceManager** module. Use **getStringValue** of the **ResourceManager** module.
**Reference** **Reference Link**
[Resource Manager](../reference/apis/js-apis-resource-manager.md#getstringvalue9) [Resource Manager](../reference/apis/js-apis-resource-manager.md#getstringvalue9)
## How do I reference resources such as images and text in AppScope? ## How do I reference resources such as images and text in AppScope?
Applicable to: OpenHarmony 3.2 Beta 5 (API version 9) Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution** **Solution**
...@@ -101,18 +101,50 @@ Reference resources in the **\$r\('app.type.name'\)** format. Wherein, **type** ...@@ -101,18 +101,50 @@ Reference resources in the **\$r\('app.type.name'\)** format. Wherein, **type**
## How do I convert resources to strings? ## How do I convert resources to strings?
Applicable to: OpenHarmony 3.2 Beta 5 (API version 9) Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution** **Solution**
For a qualifier directory, use **this.context.resourceManager.getStringSync\(\$r\('app.string.test'\).id\)** to covert resources to strings synchronously. Note that the **\$r\('app.string.test', 2\)** mode is not supported. For a qualifier directory, use **this.context.resourceManager.getStringSync\(\$r\('app.string.test'\).id\)** to covert resources to strings synchronously. Note that the **\$r\('app.string.test', 2\)** mode is not supported.
**Reference** **Reference Link**
[Resource Manager](../reference/apis/js-apis-resource-manager.md#getstringsync9) [Resource Manager](../reference/apis/js-apis-resource-manager.md#getstringsync9)
## Can $ be used to reference constants in the form\_config.json file? ## Can $ be used to reference constants in the form\_config.json file?
Applicable to: OpenHarmony 3.2 Beta 5 (API version 9) Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**\$** cannot be used to reference constants in the **form\_config.json** file. **\$** cannot be used to reference constants in the **form\_config.json** file.
## How does ArkTS parse XML files?
Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution**
1. Create the following XML file in the **rawfile** directory:
```
<?xml version="1.0" encoding="utf-8"?>
<user>
<name>Jacky</name>
<age>18</age>
</user>
```
2. Use **resourceManager.getRawFileContent** to obtain the byte arrays of the XML file.
```
import resourceManager from '@ohos.resourceManager';
resourceManager.getRawFileContent("test.xml", (error, value) => {
if (error != null) {
console.log("error is " + error);
return
}
let arrayBuffer = value.buffer; // unit8Array
var xmpParser = new xml.XmlPullParser(arrayBuffer);
var tagName = ""
//do something
}
```
...@@ -114,7 +114,7 @@ In effect, the **isStatusBarLightIcon** and **isNavigationBarLightIcon** attribu ...@@ -114,7 +114,7 @@ In effect, the **isStatusBarLightIcon** and **isNavigationBarLightIcon** attribu
**Reference** **Reference**
[window.SystemBarProperties](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md#systembarproperties) [window.SystemBarProperties](../reference/apis/js-apis-window.md#systembarproperties)
## How do I keep the screen always on? ## How do I keep the screen always on?
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
- Selecting and Saving User Files (FilePicker) - Selecting and Saving User Files (FilePicker)
- [Selecting User Files](select-user-file.md) - [Selecting User Files](select-user-file.md)
- [Saving User Files](save-user-file.md) - [Saving User Files](save-user-file.md)
- [Developing a FileManager Application (Available Only for System Applications)](dev-user-file-manager.md) - [Developing a FileManager Application (for System Applications Only)](dev-user-file-manager.md)
- [Managing External Storage Devices (Available Only for System Applications)](manage-external-storage.md) - [Managing External Storage Devices (for System Applications Only)](manage-external-storage.md)
- Distributed File System - Distributed File System
- [Distributed File System Overview](distributed-fs-overview.md) - [Distributed File System Overview](distributed-fs-overview.md)
- [Setting the Security Level of a Distributed File](set-security-label.md) - [Setting the Security Level of a Distributed File](set-security-label.md)
......
# Developing a FileManager Application (Available Only for System Applications) # Developing a FileManager Application (for System Applications Only)
OpenHarmony is prebuilt with the **FileManager** application. You can also develop your own **FileManager** as required. OpenHarmony is prebuilt with the **FileManager** application. You can also develop your own **FileManager** as required.
......
# Managing External Storage Devices (Available Only for System Applications) # Managing External Storage Devices (for System Applications Only)
External storage devices are pluggable. OpenHarmony provides the functions of listening for the device insertion and removal events and mounting/unmounting an external storage device. External storage devices are pluggable. OpenHarmony provides the functions of listening for the device insertion and removal events and mounting/unmounting an external storage device.
...@@ -28,13 +28,13 @@ The following table describes the broadcast related parameters. ...@@ -28,13 +28,13 @@ The following table describes the broadcast related parameters.
**Table 1** Broadcast parameters **Table 1** Broadcast parameters
| Broadcast| Parameter| | Broadcast| Parameter|
| -------- | -------- | | -------- | -------- |
| usual.event.data.VOLUME_REMOVED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.| | usual.event.data.VOLUME_REMOVED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.|
| usual.event.data.VOLUME_UNMOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.| | usual.event.data.VOLUME_UNMOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.|
| usual.event.data.VOLUME_MOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.<br>**fsUuid**: universally unique identifier (UUID) of the volume.<br>**path**: path where the volume is mounted.| | usual.event.data.VOLUME_MOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.<br>**fsUuid**: universally unique identifier (UUID) of the volume.<br>**path**: path where the volume is mounted.|
| usual.event.data.VOLUME_BAD_REMOVAL | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.| | usual.event.data.VOLUME_BAD_REMOVAL | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.|
| usual.event.data.VOLUME_EJECT | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.| | usual.event.data.VOLUME_EJECT | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.|
## How to Develop ## How to Develop
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
- [Developing Audio Call](audio-call-development.md) - [Developing Audio Call](audio-call-development.md)
- [Video Playback](video-playback.md) - [Video Playback](video-playback.md)
- [Video Recording](video-recording.md) - [Video Recording](video-recording.md)
- AVSession (for System Applications Only) - AVSession
- [AVSession Overview](avsession-overview.md) - [AVSession Overview](avsession-overview.md)
- Local AVSession - Local AVSession
- [Local AVSession Overview](local-avsession-overview.md) - [Local AVSession Overview](local-avsession-overview.md)
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
- Distributed AVSession - Distributed AVSession
- [Distributed AVSession Overview](distributed-avsession-overview.md) - [Distributed AVSession Overview](distributed-avsession-overview.md)
- [Using Distributed AVSession](using-distributed-avsession.md) - [Using Distributed AVSession](using-distributed-avsession.md)
- Camera (for System Applications Only) - Camera
- [Camera Overview](camera-overview.md) - [Camera Overview](camera-overview.md)
- Camera Development - Camera Development
- [Camera Development Preparations](camera-preparation.md) - [Camera Development Preparations](camera-preparation.md)
......
...@@ -26,11 +26,7 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md). ...@@ -26,11 +26,7 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| -------- | -------- | | -------- | -------- |
| getAllSessionDescriptors(callback: AsyncCallback&lt;Array&lt;Readonly&lt;AVSessionDescriptor&gt;&gt;&gt;): void | Obtains the descriptors of all AVSessions in the system.| | getAllSessionDescriptors(callback: AsyncCallback&lt;Array&lt;Readonly&lt;AVSessionDescriptor&gt;&gt;&gt;): void | Obtains the descriptors of all AVSessions in the system.|
| createController(sessionId: string, callback: AsyncCallback&lt;AVSessionController&gt;): void | Creates an AVSessionController.| | createController(sessionId: string, callback: AsyncCallback&lt;AVSessionController&gt;): void | Creates an AVSessionController.|
| getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void | Obtains valid commands supported by the AVSession.<br>Playback control commands listened by an audio and video application when it accesses the AVSession are considered as valid commands supported by the AVSession. For details, see [Provider of AVSession](using-avsession-developer.md).|
| getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void | Obtains the UIAbility that is configured in the AVSession and can be started.<br>The UIAbility configured here is started when a user operates the UI of the controller, for example, clicking a widget in Media Controller.|
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to an AVSession through the AVSessionController object.|
| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to the top session.| | sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to the top session.|
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to an AVSession through the AVSessionController object.|
| sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to the top session.| | sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to the top session.|
| getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback\<Array\<Readonly\<AVSessionDescriptor>>>): void<sup>10+<sup> | Obtains the descriptors of historical sessions.| | getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback\<Array\<Readonly\<AVSessionDescriptor>>>): void<sup>10+<sup> | Obtains the descriptors of historical sessions.|
...@@ -38,15 +34,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md). ...@@ -38,15 +34,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| getAVPlaybackState(callback: AsyncCallback&lt;AVPlaybackState&gt;): void | Obtains the information related to the playback state.| | getAVPlaybackState(callback: AsyncCallback&lt;AVPlaybackState&gt;): void<sup>10+<sup> | Obtains the information related to the playback state.|
| getAVMetadata(callback: AsyncCallback&lt;AVMetadata&gt;): void | Obtains the session metadata.| | getAVMetadata(callback: AsyncCallback&lt;AVMetadata&gt;): void<sup>10+<sup> | Obtains the session metadata.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void | Obtains the output device information.| | getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void<sup>10+<sup> | Obtains the output device information.|
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to the session corresponding to this controller.| | sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a key event to the session corresponding to this controller.|
| getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void | Obtains the **WantAgent** object saved by the application in the session.| | getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void<sup>10+<sup> | Obtains the **WantAgent** object saved by the application in the session.|
| isActive(callback: AsyncCallback&lt;boolean&gt;): void | Checks whether the session is activated.| | isActive(callback: AsyncCallback&lt;boolean&gt;): void<sup>10+<sup> | Checks whether the session is activated.|
| destroy(callback: AsyncCallback&lt;void&gt;): void | Destroys this controller. A controller can no longer be used after being destroyed.| | destroy(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Destroys this controller. A controller can no longer be used after being destroyed.|
| getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void | Obtains valid commands supported by the session.| | getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void<sup>10+<sup> | Obtains valid commands supported by the session.|
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to the session through the controller.| | sendControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a playback control command to the session through the controller.|
| sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a custom playback control command to the session through the controller.| | sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a custom playback control command to the session through the controller.|
| getAVQueueItems(callback: AsyncCallback&lt;Array&lt;AVQueueItem&gt;&gt;): void<sup>10+<sup> | Obtains the information related to the items in the playlist.| | getAVQueueItems(callback: AsyncCallback&lt;Array&lt;AVQueueItem&gt;&gt;): void<sup>10+<sup> | Obtains the information related to the items in the playlist.|
| getAVQueueTitle(callback: AsyncCallback&lt;string&gt;): void<sup>10+<sup> | Obtains the name of the playlist.| | getAVQueueTitle(callback: AsyncCallback&lt;string&gt;): void<sup>10+<sup> | Obtains the name of the playlist.|
......
...@@ -16,15 +16,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md). ...@@ -16,15 +16,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback&lt;AVSession&gt;): void | Creates an AVSession.<br>Only one AVSession can be created for a UIAbility.| | createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback&lt;AVSession&gt;): void<sup>10+<sup> | Creates an AVSession.<br>Only one AVSession can be created for a UIAbility.|
| setAVMetadata(data: AVMetadata, callback: AsyncCallback&lt;void&gt;): void | Sets AVSession metadata.| | setAVMetadata(data: AVMetadata, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets AVSession metadata.|
| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback&lt;void&gt;): void | Sets the AVSession playback state.| | setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets the AVSession playback state.|
| setLaunchAbility(ability: WantAgent, callback: AsyncCallback&lt;void&gt;): void | Starts a UIAbility.| | setLaunchAbility(ability: WantAgent, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Starts a UIAbility.|
| getController(callback: AsyncCallback&lt;AVSessionController&gt;): void | Obtains the controller of the AVSession.| | getController(callback: AsyncCallback&lt;AVSessionController&gt;): void<sup>10+<sup> | Obtains the controller of the AVSession.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void | Obtains the output device information.| | getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void<sup>10+<sup> | Obtains the output device information.|
| activate(callback: AsyncCallback&lt;void&gt;): void | Activates the AVSession.| | activate(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Activates the AVSession.|
| deactivate(callback: AsyncCallback&lt;void&gt;): void | Deactivates this session.| | deactivate(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Deactivates this session.|
| destroy(callback: AsyncCallback&lt;void&gt;): void | Destroys the AVSession.| | destroy(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Destroys the AVSession.|
| setAVQueueItems(items: Array&lt;AVQueueItem&gt;, callback: AsyncCallback&lt;void&gt;): void <sup>10+<sup> | Sets a playlist.| | setAVQueueItems(items: Array&lt;AVQueueItem&gt;, callback: AsyncCallback&lt;void&gt;): void <sup>10+<sup> | Sets a playlist.|
| setAVQueueTitle(title: string, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets a name for the playlist.| | setAVQueueTitle(title: string, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets a name for the playlist.|
| dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Dispatches a custom session event.| | dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Dispatches a custom session event.|
...@@ -343,21 +343,20 @@ To enable an audio and video application to access the AVSession service as a pr ...@@ -343,21 +343,20 @@ To enable an audio and video application to access the AVSession service as a pr
session.off('commonCommand'); session.off('commonCommand');
} }
``` ```
The code snippet below is used for destroying the AVSession object: The code snippet below is used for destroying the AVSession object:
```ts ```ts
async destroySession() { async destroySession() {
// It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet in step 1. // It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet in step 1.
let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION; let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION;
// Destroy the AVSession object. // Destroy the AVSession object.
session.destroy(function (err) { session.destroy(function (err) {
if (err) { if (err) {
console.error(`Failed to destroy session. Code: ${err.code}, message: ${err.message}`); console.error(`Failed to destroy session. Code: ${err.code}, message: ${err.message}`);
} else { } else {
console.info(`Destroy : SUCCESS `); console.info(`Destroy : SUCCESS `);
} }
}); });
} }
``` ```
\ No newline at end of file
# Native APIs # Native APIs
- [Introduction to Native APIs](introduction.md) - [Introduction to Native APIs](introduction.md)
- [Using N-APIs in Application Projects](napi-guidelines.md) - [Using Native APIs in Application Projects](napi-guidelines.md)
- [Drawing Development](drawing-guidelines.md) - [Drawing Development](drawing-guidelines.md)
- [Raw File Development](rawfile-guidelines.md) - [Raw File Development](rawfile-guidelines.md)
- [Native Window Development](native-window-guidelines.md) - [Native Window Development](native-window-guidelines.md)
......
...@@ -128,10 +128,7 @@ The following steps describe how to use the canvas and brush of the Native Drawi ...@@ -128,10 +128,7 @@ The following steps describe how to use the canvas and brush of the Native Drawi
```c++ ```c++
// Obtain the pixel address after drawing. The memory to which the address points contains the pixel data of the drawing on the canvas. // Obtain the pixel address after drawing. The memory to which the address points contains the pixel data of the drawing on the canvas.
void* bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap); void* bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap);
auto ret = memcpy_s(addr, addrSize, bitmapAddr, addrSize); std::copy(addr, addr + addrSize, static_cast<uint8_t*>(bitmapAddr));
if (ret != EOK) {
LOGI("memcpy_s failed");
}
// Destroy the canvas object. // Destroy the canvas object.
OH_Drawing_CanvasDestroy(cCanvas); OH_Drawing_CanvasDestroy(cCanvas);
// Destroy the bitmap object. // Destroy the bitmap object.
......
# Using N-APIs in Application Projects # Using Native APIs in Application Projects
In OpenHarmony, you can use the N-APIs in C APIs to implement interaction between ArkTS/TS/JS and C/C++. The N-API names are the same as those in the third-party **Node.js**. Currently, OpenHarmony supports some N-APIs. For details about the APIs supported, see [arkui_napi](https://gitee.com/openharmony/arkui_napi/blob/master/libnapi.ndk.json). In OpenHarmony, you can use the N-APIs in C APIs to implement interaction between ArkTS/TS/JS and C/C++. The N-API names are the same as those in the third-party **Node.js**. Currently, OpenHarmony supports some N-APIs. For details about the APIs supported, see [arkui_napi](https://gitee.com/openharmony/arkui_napi/blob/master/libnapi.ndk.json).
......
# Notification # Notification
- [Notification Overview](notification-overview.md) - [Notification Overview](notification-overview.md)
- [Notification Subscription (for System Applications Only)](notification-subscription.md) - [Subscribing to Notifications (for System Applications Only)](notification-subscription.md)
- [Enabling Notification](notification-enable.md) - [Enabling Notification](notification-enable.md)
- [Notification Badge](notification-badge.md) - [Managing the Notification Badge](notification-badge.md)
- Publishing a Notification - Publishing a Notification
- [Publishing a Basic Notification](text-notification.md) - [Publishing a Basic Notification](text-notification.md)
- [Publishing a Progress Notification](progress-bar-notification.md) - [Publishing a Progress Notification](progress-bar-notification.md)
......
# Notification Badge # Managing the Notification Badge
OpenHarmony provides APIs for setting the notification badge, which is displayed in the upper right corner of the application icon on the home screen to notify the user of the count of unread notifications. OpenHarmony provides APIs for setting the notification badge, which is displayed in the upper right corner of the application icon on the home screen to notify the user of the count of unread notifications.
...@@ -11,11 +11,11 @@ After a notification is read, the count on the badge is decremented by 1. If the ...@@ -11,11 +11,11 @@ After a notification is read, the count on the badge is decremented by 1. If the
1. The notification service provides two methods to increase the count on the notification badge: 1. The notification service provides two methods to increase the count on the notification badge:
- When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest). After the notification is received, the count on the badge is incremented. - When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest). After the notification is received, the count on the badge is incremented.
- Call the [setBadgeNumber](../reference/apis/js-apis-notificationManager.md#setbadgenumber) API to set the count on the badge. - Call the [setBadgeNumber()](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10) API to set the count on the badge.
2. To decrease the count on the badge, call the **setBadgeNumber** API. 2. To decrease the count on the badge, call the [setBadgeNumber()](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10) API.
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
...@@ -32,37 +32,37 @@ After a notification is read, the count on the badge is decremented by 1. If the ...@@ -32,37 +32,37 @@ After a notification is read, the count on the badge is decremented by 1. If the
2. Increase the count on the badge. 2. Increase the count on the badge.
When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest). For details, see [Publishing a Basic Notification](text-notification.md). When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest). For details, see [Publishing a Basic Notification](text-notification.md).
In this example, the **setBadgeNumber** API is called to add a badge. This API is called after a new notification is published. In this example, the **setBadgeNumber** API is called to add a badge. This API is called after a new notification is published.
```ts ```ts
function setBadgeNumberCallback(err) { function setBadgeNumberCallback(err) {
if (err) { if (err) {
console.info(`Set badge failed code is ${err.code}, message is ${err.message}`); console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
} else { return;
console.info(`Set badge success`); }
} console.info(`Succeeded in seting badge number.`);
} }
let badgeNumber = 10 let badgeNumber = 10;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback); notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
``` ```
3. Reduce the count on the badge. 3. Decrease the count on the badge.
After a notification is read, the application needs to call the API to set the number of remaining unread notifications. The badge is then updated. After a notification is read, the application needs to call the API to set the number of remaining unread notifications. The badge is then updated.
```ts ```ts
function setBadgeNumberCallback(err) { function setBadgeNumberCallback(err) {
if (err) { if (err) {
console.info(`Set badge failed code is ${err.code}, message is ${err.message}`); console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
} else { return;
console.info(`Set badge success`); }
} console.info(`Succeeded in seting badge number.`);
} }
let badgeNumber = 9 let badgeNumber = 9;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback); notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
``` ```
......
# Notification Subscription (for System Applications Only) # Subscribing to Notifications (for System Applications Only)
To receive notifications, an application must subscribe to notifications first. The notification subsystem provides two types of subscription APIs, allowing applications to subscribe to notifications from all applications or notifications from a specific application. To receive notifications, an application must subscribe to notifications first. The notification subsystem provides two types of subscription APIs, allowing applications to subscribe to notifications from all applications or notifications from a specific application.
...@@ -13,14 +13,14 @@ The major APIs for notification subscription are described as follows. For detai ...@@ -13,14 +13,14 @@ The major APIs for notification subscription are described as follows. For detai
**Table 1** Major APIs for notification subscription **Table 1** Major APIs for notification subscription
| Name | Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback&lt;void&gt;): void | Subscribes to notifications from a specific application.| | subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback&lt;void&gt;): void | Subscribes to notifications from a specific application.|
| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback&lt;void&gt;): void | Subscribes to notifications from all applications. | | subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback&lt;void&gt;): void | Subscribes to notifications from all applications. |
**Table 2** Callbacks for notification subscription **Table 2** Callbacks for notification subscription
| Name | Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| onConsume?:(data: SubscribeCallbackData) =&gt; void | Callback for receiving notifications. | | onConsume?:(data: SubscribeCallbackData) =&gt; void | Callback for receiving notifications. |
| onCancel?:(data: SubscribeCallbackData) =&gt; void | Callback for canceling notifications. | | onCancel?:(data: SubscribeCallbackData) =&gt; void | Callback for canceling notifications. |
......
...@@ -13,7 +13,7 @@ Below you can see the process of adding a **WantAgent** object to a notification ...@@ -13,7 +13,7 @@ Below you can see the process of adding a **WantAgent** object to a notification
For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/js-apis-app-ability-wantAgent.md). For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/js-apis-app-ability-wantAgent.md).
| Name| Description| | API | Description|
| -------- | -------- | | -------- | -------- |
| getWantAgent(info: WantAgentInfo, callback: AsyncCallback&lt;WantAgent&gt;): void | Creates a **WantAgent** object.| | getWantAgent(info: WantAgentInfo, callback: AsyncCallback&lt;WantAgent&gt;): void | Creates a **WantAgent** object.|
| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback&lt;CompleteData&gt;): void | Triggers a **WantAgent** object.| | trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback&lt;CompleteData&gt;): void | Triggers a **WantAgent** object.|
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- [HAR](har-package.md) - [HAR](har-package.md)
- HSP - HSP
- [In-Application HSP Development](in-app-hsp.md) - [In-Application HSP Development](in-app-hsp.md)
- [Inter-Application HSP Development (for System Applications Only)](cross-app-hsp.md) - [Inter-Application HSP Development](cross-app-hsp.md)
- Atomic Service - Atomic Service
- [Atomic Service Development](atomicService.md) - [Atomic Service Development](atomicService.md)
- [Atomic Service Space Management (for System Applications Only)](atomicService-aging.md) - [Atomic Service Space Management (for System Applications Only)](atomicService-aging.md)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
To develop an application based on the [stage model](application-configuration-file-overview-stage.md), it will be helpful if you have a basic understanding of the structure of the application package created after the application is built and packaged, as well as the related basic concepts. To develop an application based on the [stage model](application-configuration-file-overview-stage.md), it will be helpful if you have a basic understanding of the structure of the application package created after the application is built and packaged, as well as the related basic concepts.
- In development, an application contains one or more modules. You can [create modules](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/ohos-adding-deleting-module-0000001218760594-V3) in the application project in [DevEco Studio](https://developer.harmonyos.com/en/develop/deveco-studio/). As a basic functional unit of an OpenHarmony application/service, a module contains source code, resource files, third-party libraries, and application/service configuration files, and can be built and run independently. Modules can be classified as Ability or Library. A module of the Ability type is built into a Harmony Ability Package (HAP) file, and a module of the Library type is built into a [Harmony Archive (HAR)](har-package.md) file or a [Harmony Shared Package (HSP)](shared-guide.md). - In development, an application contains one or more modules. You can [create modules](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/add_new_module-0000001053223741-V3) in the application project in [DevEco Studio](https://developer.harmonyos.com/en/develop/deveco-studio/). As a basic functional unit of an OpenHarmony application/service, a module contains source code, resource files, third-party libraries, and application/service configuration files, and can be built and run independently. Modules can be classified as Ability or Library. A module of the Ability type is built into a Harmony Ability Package (HAP) file, and a module of the Library type is built into a [Harmony Archive (HAR)](har-package.md) file or a [Harmony Shared Package (HSP)](shared-guide.md).
A module can contain one or more [UIAbility](../application-models/uiability-overview.md) components, as shown in the figure below. A module can contain one or more [UIAbility](../application-models/uiability-overview.md) components, as shown in the figure below.
**Figure 1** Relationship between modules and UIAbility components **Figure 1** Relationship between modules and UIAbility components
......
# $ Syntax: Two-Way Synchronization of Built-in Components # $$ Syntax: Two-Way Synchronization of Built-in Components
The $$ operator provides a TS variable by-reference to a built-in component so that the variable value and the internal state of that component are kept in sync. The $$ operator provides a TS variable by-reference to a built-in component so that the variable value and the internal state of that component are kept in sync.
......
...@@ -226,7 +226,7 @@ The **metadata** tag represents the custom metadata of the HAP file. The tag val ...@@ -226,7 +226,7 @@ The **metadata** tag represents the custom metadata of the HAP file. The tag val
## abilities ## abilities
UIAbility configuration of the module, which is valid only for the current UIAbility component. The **abilities** tag represents the UIAbility configuration of the module, which is valid only for the current UIAbility component.
**By default, application icons cannot be hidden from the home screen in OpenHarmony.** **By default, application icons cannot be hidden from the home screen in OpenHarmony.**
...@@ -242,7 +242,7 @@ This requirement on application icons is intended to prevent malicious applicati ...@@ -242,7 +242,7 @@ This requirement on application icons is intended to prevent malicious applicati
**Setting the application icon to be displayed on the home screen**: **Setting the application icon to be displayed on the home screen**:
Set **icon**, **label**, and **skills** under **abilities** in the **module.json5** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**. Set **icon**, **label**, and **skills** under **abilities** in the **module.json5** file. Make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
``` ```
{ {
......
...@@ -205,7 +205,7 @@ This requirement on application icons is intended to prevent malicious applicati ...@@ -205,7 +205,7 @@ This requirement on application icons is intended to prevent malicious applicati
**Setting the application icon to be displayed on the home screen**: **Setting the application icon to be displayed on the home screen**:
Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**. Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. Make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
``` ```
{ {
......
...@@ -210,6 +210,9 @@ ...@@ -210,6 +210,9 @@
- [@ohos.multimedia.camera (Camera Management)](js-apis-camera.md) - [@ohos.multimedia.camera (Camera Management)](js-apis-camera.md)
- [@ohos.multimedia.image (Image Processing)](js-apis-image.md) - [@ohos.multimedia.image (Image Processing)](js-apis-image.md)
- [@ohos.multimedia.media (Media)](js-apis-media.md) - [@ohos.multimedia.media (Media)](js-apis-media.md)
- [@ohos.multimedia.systemSoundManager (System Sound Management)](js-apis-systemSoundManager.md)
- multimedia
- [ringtonePlayer (Ringtone Player)](js-apis-inner-multimedia-ringtonePlayer.md)
- Resource Manager - Resource Manager
- [@ohos.i18n (Internationalization)](js-apis-i18n.md) - [@ohos.i18n (Internationalization)](js-apis-i18n.md)
...@@ -238,6 +241,7 @@ ...@@ -238,6 +241,7 @@
- [PermissionRequestResult](js-apis-permissionrequestresult.md) - [PermissionRequestResult](js-apis-permissionrequestresult.md)
- Data Management - Data Management
- [@ohos.data.cloudData (Device-Cloud Synergy)](js-apis-data-cloudData.md)
- [@ohos.data.dataAbility (DataAbility Predicates)](js-apis-data-ability.md) - [@ohos.data.dataAbility (DataAbility Predicates)](js-apis-data-ability.md)
- [@ohos.data.dataShare (DataShare)](js-apis-data-dataShare.md) - [@ohos.data.dataShare (DataShare)](js-apis-data-dataShare.md)
- [@ohos.data.dataSharePredicates (DataShare Predicates)](js-apis-data-dataSharePredicates.md) - [@ohos.data.dataSharePredicates (DataShare Predicates)](js-apis-data-dataSharePredicates.md)
...@@ -319,6 +323,7 @@ ...@@ -319,6 +323,7 @@
- [@ohos.InputMethodExtensionAbility (InputMethodExtensionAbility)](js-apis-inputmethod-extension-ability.md) - [@ohos.InputMethodExtensionAbility (InputMethodExtensionAbility)](js-apis-inputmethod-extension-ability.md)
- [@ohos.InputMethodExtensionContext (InputMethodExtensionContext)](js-apis-inputmethod-extension-context.md) - [@ohos.InputMethodExtensionContext (InputMethodExtensionContext)](js-apis-inputmethod-extension-context.md)
- [@ohos.InputMethodSubtype (Input Method Subtype)](js-apis-inputmethod-subtype.md) - [@ohos.InputMethodSubtype (Input Method Subtype)](js-apis-inputmethod-subtype.md)
- [@ohos.logLibrary (Log Library)](js-apis-loglibrary.md)
- [@ohos.pasteboard (Pasteboard)](js-apis-pasteboard.md) - [@ohos.pasteboard (Pasteboard)](js-apis-pasteboard.md)
- [@ohos.screenLock (Screenlock)](js-apis-screen-lock.md) - [@ohos.screenLock (Screenlock)](js-apis-screen-lock.md)
- [@ohos.systemDateTime (System Time and Time Zone)](js-apis-system-date-time.md) - [@ohos.systemDateTime (System Time and Time Zone)](js-apis-system-date-time.md)
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
- [Common Events of the Ability Subsystem](commonEvent-ability.md) - [Common Events of the Ability Subsystem](commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](commonEvent-bundleManager.md) - [Common Events of the Bundle Management Subsystem](commonEvent-bundleManager.md)
- [Common Events of the Notification Service](commonEvent-ans.md) - [Common Events of the Notification Service](commonEvent-ans.md)
- [Common Events of the Resource Scheduling Subsystem](commonEvent-resourceschedule.md) - [Common Events of the Resource Scheduler Subsystem](commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](commonEvent-telephony.md) - [Common Events of the Telephony Subsystem](commonEvent-telephony.md)
- [Common Events of the USB Subsystem](commonEvent-usb.md) - [Common Events of the USB Subsystem](commonEvent-usb.md)
# Common Events of the Resource Scheduling Subsystem # Common Events of the Resource Scheduler Subsystem
This document lists the common system events provided by the resource scheduling subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events. This document lists the common system events provided by the resource scheduler subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events.
## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED ## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
Indicates that the system idle mode has changed. Indicates that the system idle mode has changed.
......
...@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example** **Example**
...@@ -74,7 +74,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; ...@@ -74,7 +74,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
try { try {
atManager.checkAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS").then((data) => { atManager.checkAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS').then((data) => {
console.log(`checkAccessToken success, data->${JSON.stringify(data)}`); console.log(`checkAccessToken success, data->${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.log(`checkAccessToken fail, err->${JSON.stringify(err)}`); console.log(`checkAccessToken fail, err->${JSON.stringify(err)}`);
...@@ -111,14 +111,14 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -111,14 +111,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example** **Example**
```js ```js
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let data = atManager.verifyAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS"); let data = atManager.verifyAccessTokenSync(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
console.log(`data->${JSON.stringify(data)}`); console.log(`data->${JSON.stringify(data)}`);
``` ```
...@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. | | 12100001 | The parameter is invalid. The tokenID is 0, the permissionName exceeds 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | The specified permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
...@@ -169,7 +169,7 @@ let atManager = abilityAccessCtrl.createAtManager(); ...@@ -169,7 +169,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1; let permissionFlags = 1;
try { try {
atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags).then(() => { atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags).then(() => {
console.log('grantUserGrantedPermission success'); console.log('grantUserGrantedPermission success');
}).catch((err) => { }).catch((err) => {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`); console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
...@@ -221,7 +221,7 @@ let atManager = abilityAccessCtrl.createAtManager(); ...@@ -221,7 +221,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1; let permissionFlags = 1;
try { try {
atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags, (err, data) => { atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags, (err, data) => {
if (err) { if (err) {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`); console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else { } else {
...@@ -280,7 +280,7 @@ let atManager = abilityAccessCtrl.createAtManager(); ...@@ -280,7 +280,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1; let permissionFlags = 1;
try { try {
atManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags).then(() => { atManager.revokeUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags).then(() => {
console.log('revokeUserGrantedPermission success'); console.log('revokeUserGrantedPermission success');
}).catch((err) => { }).catch((err) => {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`); console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
...@@ -332,7 +332,7 @@ let atManager = abilityAccessCtrl.createAtManager(); ...@@ -332,7 +332,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1; let permissionFlags = 1;
try { try {
atManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags, (err, data) => { atManager.revokeUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags, (err, data) => {
if (err) { if (err) {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`); console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else { } else {
...@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | The specified permission does not exist. |
| 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. |
...@@ -389,7 +389,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; ...@@ -389,7 +389,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
try { try {
atManager.getPermissionFlags(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS").then((data) => { atManager.getPermissionFlags(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS').then((data) => {
console.log(`getPermissionFlags success, data->${JSON.stringify(data)}`); console.log(`getPermissionFlags success, data->${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.log(`getPermissionFlags fail, err->${JSON.stringify(err)}`); console.log(`getPermissionFlags fail, err->${JSON.stringify(err)}`);
...@@ -443,7 +443,7 @@ Subscribes to permission state changes of the specified applications and permiss ...@@ -443,7 +443,7 @@ Subscribes to permission state changes of the specified applications and permiss
| ------------------ | --------------------- | ---- | ------------------------------------------------------------ | | ------------------ | --------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type to subscribe to. The value is **'permissionStateChange'**, which indicates the permission grant state change. | | type | string | Yes | Event type to subscribe to. The value is **'permissionStateChange'**, which indicates the permission grant state change. |
| tokenIDList | Array&lt;number&gt; | Yes | Token IDs of the applications to observe. If this parameter is left empty, the permission grant state changes of all applications are observed. | | tokenIDList | Array&lt;number&gt; | Yes | Token IDs of the applications to observe. If this parameter is left empty, the permission grant state changes of all applications are observed. |
| permissionList | Array&lt;Permissions&gt; | Yes | Permissions to observe. If this parameter is left empty, the grant state changes of all permissions are observed. | | permissionList | Array&lt;Permissions&gt; | Yes | List of permission names. If this parameter is left empty, the grant state changes of all permissions are subscribed to. |
| callback | Callback&lt;[PermissionStateChangeInfo](#permissionstatechangeinfo9)&gt; | Yes| Callback invoked to return the permission grant state change.| | callback | Callback&lt;[PermissionStateChangeInfo](#permissionstatechangeinfo9)&gt; | Yes| Callback invoked to return the permission grant state change.|
**Error codes** **Error codes**
...@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100004 | The interface is called repeatedly with the same input. | | 12100004 | The interface is called repeatedly with the same input. |
| 12100005 | The registration time has exceeded the limitation. | | 12100005 | The registration time has exceeded the limitation. |
| 12100007 | Service is abnormal. | | 12100007 | Service is abnormal. |
...@@ -461,16 +461,16 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -461,16 +461,16 @@ For details about the error codes, see [Application Access Control Error Codes](
**Example** **Example**
```js ```js
import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl'; import {Permissions} from '@ohos.abilityAccessCtrl';
import bundleManager from '@ohos.bundle.bundleManager'; import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100); let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array<number> = [appInfo.accessTokenId]; let tokenIDList: Array<number> = [appInfo.accessTokenId];
let permissionList: Array<Permissions> = ["ohos.permission.DISTRIBUTED_DATASYNC"]; let permissionList: Array<Permissions> = ['ohos.permission.DISTRIBUTED_DATASYNC'];
try { try {
atManager.on('permissionStateChange', tokenIDList, permissionList, (data) => { atManager.on('permissionStateChange', tokenIDList, permissionList, (data) => {
console.debug("receive permission state change, data:" + JSON.stringify(data)); console.debug('receive permission state change, data:' + JSON.stringify(data));
}); });
} catch(err) { } catch(err) {
console.log(`catch err->${JSON.stringify(err)}`); console.log(`catch err->${JSON.stringify(err)}`);
...@@ -505,20 +505,20 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -505,20 +505,20 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenIDs or permissionNames in the list are all invalid. | | 12100001 | The parameter is invalid. The tokenIDs or permissionNames in the list are all invalid. |
| 12100004 | The interface is not used together with "on". | | 12100004 | The interface is not used together with 'on'. |
| 12100007 | Service is abnormal. | | 12100007 | Service is abnormal. |
| 12100008 | Out of memory. | | 12100008 | Out of memory. |
**Example** **Example**
```js ```js
import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl'; import {Permissions} from '@ohos.abilityAccessCtrl';
import bundleManager from '@ohos.bundle.bundleManager'; import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100); let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array<number> = [appInfo.accessTokenId]; let tokenIDList: Array<number> = [appInfo.accessTokenId];
let permissionList: Array<Permissions> = ["ohos.permission.DISTRIBUTED_DATASYNC"]; let permissionList: Array<Permissions> = ['ohos.permission.DISTRIBUTED_DATASYNC'];
try { try {
atManager.off('permissionStateChange', tokenIDList, permissionList); atManager.off('permissionStateChange', tokenIDList, permissionList);
} catch(err) { } catch(err) {
...@@ -558,7 +558,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; ...@@ -558,7 +558,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let promise = atManager.verifyAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS"); let promise = atManager.verifyAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
promise.then(data => { promise.then(data => {
console.log(`promise: data->${JSON.stringify(data)}`); console.log(`promise: data->${JSON.stringify(data)}`);
}); });
...@@ -599,10 +599,10 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -599,10 +599,10 @@ For details about the error codes, see [Application Access Control Error Codes](
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
try { try {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"], (err, data)=>{ atManager.requestPermissionsFromUser(this.context, ['ohos.permission.CAMERA'], (err, data)=>{
console.info("data:" + JSON.stringify(data)); console.info('data:' + JSON.stringify(data));
console.info("data permissions:" + data.permissions); console.info('data permissions:' + data.permissions);
console.info("data authResults:" + data.authResults); console.info('data authResults:' + data.authResults);
}); });
} catch(err) { } catch(err) {
console.log(`catch err->${JSON.stringify(err)}`); console.log(`catch err->${JSON.stringify(err)}`);
...@@ -650,12 +650,12 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -650,12 +650,12 @@ For details about the error codes, see [Application Access Control Error Codes](
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
try { try {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"]).then((data) => { atManager.requestPermissionsFromUser(this.context, ['ohos.permission.CAMERA']).then((data) => {
console.info("data:" + JSON.stringify(data)); console.info('data:' + JSON.stringify(data));
console.info("data permissions:" + data.permissions); console.info('data permissions:' + data.permissions);
console.info("data authResults:" + data.authResults); console.info('data authResults:' + data.authResults);
}).catch((err) => { }).catch((err) => {
console.info("data:" + JSON.stringify(err)); console.info('data:' + JSON.stringify(err));
}) })
} catch(err) { } catch(err) {
console.log(`catch err->${JSON.stringify(err)}`); console.log(`catch err->${JSON.stringify(err)}`);
...@@ -694,7 +694,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; ...@@ -694,7 +694,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let promise = atManager.verifyAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS"); let promise = atManager.verifyAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
promise.then(data => { promise.then(data => {
console.log(`promise: data->${JSON.stringify(data)}`); console.log(`promise: data->${JSON.stringify(data)}`);
}); });
...@@ -727,14 +727,14 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -727,14 +727,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example** **Example**
```js ```js
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application. let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let data = atManager.checkAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS"); let data = atManager.checkAccessTokenSync(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
console.log(`data->${JSON.stringify(data)}`); console.log(`data->${JSON.stringify(data)}`);
``` ```
......
...@@ -247,7 +247,7 @@ Cancels the listener for changes in the list of enabled accessibility extension ...@@ -247,7 +247,7 @@ Cancels the listener for changes in the list of enabled accessibility extension
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Listening type. The value is fixed at **'enabledAccessibilityExtensionListChange'**, indicating listening for changes in the list of enabled accessibility extension abilities.| | type | string | Yes| Listening type. The value is fixed at **'enabledAccessibilityExtensionListChange'**, indicating listening for changes in the list of enabled accessibility extension abilities.|
| callback | Callback&lt;void&gt; | No| Callback invoked when the list of enabled accessibility extension abilities changes.| | callback | Callback&lt;void&gt; | No| Callback for the event.|
**Example** **Example**
...@@ -425,7 +425,7 @@ Cancels the listener for attribute changes. This API uses an asynchronous callba ...@@ -425,7 +425,7 @@ Cancels the listener for attribute changes. This API uses an asynchronous callba
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | Callback&lt;T&gt; | No| Callback invoked when the list of enabled accessibility extension abilities changes.| | callback | Callback&lt;T&gt; | No| Callback for the event.|
**Example** **Example**
......
...@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an ...@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an
**Parameters** **Parameters**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
|AsyncCallback&lt;boolean&gt; |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| |AsyncCallback&lt;boolean&gt; |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a ...@@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| | Promise&lt;boolean&gt; | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API ...@@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| | Promise&lt;boolean&gt; | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -128,9 +128,9 @@ Checks whether this application is running on a RAM constrained device. This API ...@@ -128,9 +128,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Parameters** **Parameters**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| AsyncCallback&lt;boolean&gt; |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| | AsyncCallback&lt;boolean&gt; |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
**Error codes** **Error codes**
...@@ -164,9 +164,9 @@ Obtains the memory size of this application. This API uses a promise to return t ...@@ -164,9 +164,9 @@ Obtains the memory size of this application. This API uses a promise to return t
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;number&gt; | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| | Promise&lt;number&gt; | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
...@@ -198,9 +198,9 @@ Obtains the memory size of this application. This API uses an asynchronous callb ...@@ -198,9 +198,9 @@ Obtains the memory size of this application. This API uses an asynchronous callb
**Parameters** **Parameters**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
|AsyncCallback&lt;number&gt; |Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| |AsyncCallback&lt;number&gt; |Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
...@@ -298,6 +298,82 @@ appManager.getRunningProcessInformation((err, data) => { ...@@ -298,6 +298,82 @@ appManager.getRunningProcessInformation((err, data) => {
}); });
``` ```
## appManager.isSharedBundleRunning
isSharedBundleRunning(bundleName: string, versionCode: number): Promise\<boolean>;
Checks whether the shared library is in use. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_RUNNING_INFO
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the shared library.|
| versionCode | number | Yes | Version number of the shared library. |
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<boolean> | Promise used to return the result. The value **true** means that the shared library is in use, and **false** means the opposite.|
**Example**
```ts
import appManager from '@ohos.app.ability.appManager';
appManager.isSharedBundleRunning(bundleName, versionCode).then((data) => {
console.log('The shared bundle running is: ${JSON.stringify(data)}');
}).catch((error) => {
console.error('error: ${JSON.stringify(error)}');
});
```
## appManager.isSharedBundleRunning
isSharedBundleRunning(bundleName: string, versionCode: number, callback: AsyncCallback\<boolean>): void;
Checks whether the shared library is in use. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_RUNNING_INFO
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the shared library.|
| versionCode | number | Yes | Version number of the shared library. |
**Return value**
| Type| Description|
| -------- | -------- |
|AsyncCallback\<boolean>> | Callback used to return the result. The value **true** means that the shared library is in use, and **false** means the opposite.|
**Example**
```ts
import appManager from '@ohos.app.ability.appManager';
appManager.isSharedBundleRunning(bundleName, versionCode, (err, data) => {
if (err) {
console.error('err: ${JSON.stringify(err)}');
} else {
console.log('The shared bundle running is: ${JSON.stringify(data)}');
}
});
```
## appManager.on ## appManager.on
on(type: 'applicationState', observer: ApplicationStateObserver): number; on(type: 'applicationState', observer: ApplicationStateObserver): number;
...@@ -641,7 +717,7 @@ Obtains applications that are running in the foreground. This API uses a promise ...@@ -641,7 +717,7 @@ Obtains applications that are running in the foreground. This API uses a promise
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise\<Array\<[AppStateData](js-apis-inner-application-appStateData.md)>> | Promise used to return an array holding the application state data. | | Promise\<Array\<[AppStateData](js-apis-inner-application-appStateData.md)>> | Promise used to return an array holding the application state data.|
**Error codes** **Error codes**
...@@ -731,11 +807,11 @@ Kills a process by bundle name and account ID. This API uses an asynchronous cal ...@@ -731,11 +807,11 @@ Kills a process by bundle name and account ID. This API uses an asynchronous cal
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.| | bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| | accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.| | callback | AsyncCallback\<void\> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
......
...@@ -315,7 +315,7 @@ class MyUIAbility extends UIAbility { ...@@ -315,7 +315,7 @@ class MyUIAbility extends UIAbility {
onShare(wantParam:{ [key: string]: Object }): void; onShare(wantParam:{ [key: string]: Object }): void;
Called when an ability shares data. Called when this UIAbility sets data to share. **ohos.extra.param.key.contentTitle** indicates the title of the content to share in the sharing box, and **ohos.extra.param.key.shareAbstract** provides an abstract description of the content, **ohos.extra.param.key.shareUrl** indicates the online address of the service. You need to set these three items as objects, with the key set to **title**, **abstract**, and **url**, respectively.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
...@@ -332,9 +332,9 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant'; ...@@ -332,9 +332,9 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant';
class MyUIAbility extends UIAbility { class MyUIAbility extends UIAbility {
onShare(wantParams) { onShare(wantParams) {
console.log('onShare'); console.log('onShare');
wantParams['ohos.extra.param.key.contentTitle'] = {title: "W3"}; wantParams['ohos.extra.param.key.contentTitle'] = {title: "OA"};
wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for huawei employee"}; wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for company employee"};
wantParams['ohos.extra.param.key.shareUrl'] = {url: "w3.huawei.com"}; wantParams['ohos.extra.param.key.shareUrl'] = {url: "oa.example.com"};
} }
} }
``` ```
......
...@@ -116,8 +116,8 @@ struct SnapshotExample { ...@@ -116,8 +116,8 @@ struct SnapshotExample {
Image(this.pixmap) Image(this.pixmap)
.width(300).height(300) .width(300).height(300)
// ...Component // ...Component
// ...Components // ...Component
// ...Components // ...Component
Button("click to generate UI snapshot") Button("click to generate UI snapshot")
.onClick(() => { .onClick(() => {
componentSnapshot.get("root") componentSnapshot.get("root")
......
...@@ -9,7 +9,6 @@ The **ApplicationInfo** module defines the application information. A system app ...@@ -9,7 +9,6 @@ The **ApplicationInfo** module defines the application information. A system app
## ApplicationInfo ## ApplicationInfo
**System capability**: SystemCapability.BundleManager.BundleFramework.Core **System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | | -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
| name | string | Yes | No | Application name. | | name | string | Yes | No | Application name. |
...@@ -27,9 +26,9 @@ The **ApplicationInfo** module defines the application information. A system app ...@@ -27,9 +26,9 @@ The **ApplicationInfo** module defines the application information. A system app
| removable | boolean | Yes | No | Whether the application is removable. | | removable | boolean | Yes | No | Whether the application is removable. |
| accessTokenId | number | Yes | No | Access token ID of the application. | | accessTokenId | number | Yes | No | Access token ID of the application. |
| uid | number | Yes | No | UID of the application. | | uid | number | Yes | No | UID of the application. |
| iconResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details. | | iconResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details. |
| labelResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details. | | labelResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details. |
| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details.| | descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details.|
| appDistributionType | string | Yes | No | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**. | | appDistributionType | string | Yes | No | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**. |
| appProvisionType | string | Yes | No | Type of the application signing certificate file. The options are **debug** and **release**. | | appProvisionType | string | Yes | No | Type of the application signing certificate file. The options are **debug** and **release**. |
| systemApp | boolean | Yes | No | Whether the application is a system application. | | systemApp | boolean | Yes | No | Whether the application is a system application. |
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
> **NOTE** > **NOTE**
> >
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs provided by this module are system APIs.
## Modules to Import ## Modules to Import
...@@ -110,17 +109,18 @@ Enumerates the camera error codes, which are returned when an API call is incorr ...@@ -110,17 +109,18 @@ Enumerates the camera error codes, which are returned when an API call is incorr
**System capability**: SystemCapability.Multimedia.Camera.Core **System capability**: SystemCapability.Multimedia.Camera.Core
| Name | Value | Description | | Name | Value | Description |
| ------------------------- | ---- | ------------ | | ------------------------- | ---- | ------------ |
| INVALID_ARGUMENT | 7400101 | A parameter is missing or the parameter type is incorrect. | | INVALID_ARGUMENT | 7400101 | A parameter is missing or the parameter type is incorrect. |
| OPERATION_NOT_ALLOWED | 7400102 | The operation is not allowed. | | OPERATION_NOT_ALLOWED | 7400102 | The operation is not allowed. |
| SESSION_NOT_CONFIG | 7400103 | The session is not configured. | | SESSION_NOT_CONFIG | 7400103 | The session is not configured. |
| SESSION_NOT_RUNNING | 7400104 | The session is not running. | | SESSION_NOT_RUNNING | 7400104 | The session is not running. |
| SESSION_CONFIG_LOCKED | 7400105 | The session configuration is locked. | | SESSION_CONFIG_LOCKED | 7400105 | The session configuration is locked. |
| DEVICE_SETTING_LOCKED | 7400106 | The device setting is locked. | | DEVICE_SETTING_LOCKED | 7400106 | The device setting is locked. |
| CONFILICT_CAMERA | 7400107 | The device is already started. | | CONFLICT_CAMERA | 7400107 | The device is already started. |
| DEVICE_DISABLED | 7400108 | The camera is disabled for security reasons. | | DEVICE_DISABLED | 7400108 | The camera is disabled for security reasons. |
| SERVICE_FATAL_ERROR | 7400201 | An error occurs in the camera service. | | DEVICE_PREEMPTED | 7400109 | The camera is preempted. |
| SERVICE_FATAL_ERROR | 7400201 | An error occurs in the camera service. |
## CameraManager ## CameraManager
...@@ -203,7 +203,7 @@ isCameraMuteSupported(): boolean ...@@ -203,7 +203,7 @@ isCameraMuteSupported(): boolean
Checks whether the camera can be muted. Checks whether the camera can be muted.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core **System capability**: SystemCapability.Multimedia.Camera.Core
...@@ -225,7 +225,7 @@ muteCamera(mute: boolean): void ...@@ -225,7 +225,7 @@ muteCamera(mute: boolean): void
Mutes or unmutes the camera. Mutes or unmutes the camera.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core **System capability**: SystemCapability.Multimedia.Camera.Core
...@@ -562,7 +562,7 @@ on(type: 'cameraMute', callback: AsyncCallback\<boolean\>): void ...@@ -562,7 +562,7 @@ on(type: 'cameraMute', callback: AsyncCallback\<boolean\>): void
Listens for camera mute status changes. This API uses an asynchronous callback to return the result. Listens for camera mute status changes. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core **System capability**: SystemCapability.Multimedia.Camera.Core
...@@ -630,6 +630,20 @@ Enumerates the camera connection types. ...@@ -630,6 +630,20 @@ Enumerates the camera connection types.
| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB.| | CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB.|
| CAMERA_CONNECTION_REMOTE | 2 | Remote camera.| | CAMERA_CONNECTION_REMOTE | 2 | Remote camera.|
## HostDeviceType
Enumerates the remote camera types.
**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core
| Name | Value | Description |
| ---------------------------- | ---- | ------------- |
| UNKNOWN_TYPE | 0 | Unknown type. |
| PHONE | 0x0E | Camera of a smartphone.|
| TABLET | 0x11 | Camera of a tablet.|
## CameraDevice ## CameraDevice
Defines the camera device information. Defines the camera device information.
...@@ -642,6 +656,8 @@ Defines the camera device information. ...@@ -642,6 +656,8 @@ Defines the camera device information.
| cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. | | cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. |
| cameraType | [CameraType](#cameratype) | Yes | Camera type. | | cameraType | [CameraType](#cameratype) | Yes | Camera type. |
| connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.| | connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.|
| hostDeviceName | string | Yes | Name of the remote device.<br>**System API**: This is a system API.|
| hostDeviceType | [hostDeviceType](#hostdevicetype) | Yes | Type of the remote device.<br>**System API**: This is a system API.|
## Size ## Size
...@@ -1754,7 +1770,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure ...@@ -1754,7 +1770,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------| ---- | ------------------- | | -------- | -------------------------------| ---- | ------------------- |
| exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If calling the API fails, an error code defined in [CameraErrorCode](#cameraerrorcode) will be returned. If the value passed is not within the supported range, the nearest critical point is used.| | exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If the value passed is not within the supported range, the nearest critical point is used. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned. |
**Error codes** **Error codes**
...@@ -1788,7 +1804,7 @@ Obtains the exposure value in use. ...@@ -1788,7 +1804,7 @@ Obtains the exposure value in use.
| Type | Description | | Type | Description |
| ---------- | ----------------------------- | | ---------- | ----------------------------- |
| number | Exposure value obtained. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned.| | number | Exposure value obtained. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned. |
**Error codes** **Error codes**
......
# @ohos.data.cloudData (Device-Cloud Synergy)
The **cloudData** module provides the capability of synchronizing the structured data (in RDB stores) between the device and cloud. The cloud serves as the central node of data. The devices synchronize data with the data in the cloud to implement cloud data backup and data consistency between the devices with the same account.
This module provides the following common functions:
- [Config](#config): provides methods for configuring device-cloud synergy, including enabling and disabling cloud synchronization, clearing data, and notifying data changes.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```js
import cloudData from '@ohos.data.cloudData';
```
## Action
Enumerates the actions for clearing the cloud information about the local data.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
| Name | Description |
| --------- | ---------------------------- |
| CLEAR_CLOUD_INFO | Clear the cloud ID information.|
| CLEAR_CLOUD_DATA_AND_INFO |Clear all cloud data, including cloud ID information and data downloaded from the cloud (excluding the data modified or generated locally). |
## Config
Provides methods for configuring device-cloud synergy, including enabling and disabling cloud synchronization, clearing data, and notifying data changes.
### enableCloud
static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}, callback: AsyncCallback&lt;void&gt;):void
Enables device-cloud synergy. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
| accountId | string | Yes | ID of the target cloud. |
| switches | {[bundleName: string]: boolean} | Yes | Device-cloud synergy switches for applications. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Example**
```js
let account = 'test_id';
let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
try {
cloudData.Config.enableCloud(account, switches, function (err) {
if (err === undefined) {
console.info('Succeeded in enabling cloud');
} else {
console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
}
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### enableCloud
static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}): Promise&lt;void&gt;
Enables device-cloud synergy. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
| accountId | string | Yes | ID of the target cloud. |
| switches | {[bundleName: string]: boolean} | Yes | Device-cloud synergy switches for applications. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
**Return value**
| Type | Description |
| ------------------- | ------------------------- |
| Promise&lt;void&gt; | Promise that returns no value.|
**Example**
```js
let account = 'test_id';
let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
try {
cloudData.Config.enableCloud(account, switches).then(() => {
console.info('Succeeded in enabling cloud');
}).catch((err) => {
console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### disableCloud
static disableCloud(accountId: string, callback: AsyncCallback&lt;void&gt;):void
Disables device-cloud synergy. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ---------------- |
| accountId | string | Yes | ID of the target cloud.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Example**
```js
let account = 'test_id';
try {
cloudData.Config.disableCloud(account, function (err) {
if (err === undefined) {
console.info('Succeeded in disabling cloud');
} else {
console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
}
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### disableCloud
static disableCloud(accountId: string): Promise&lt;void&gt;
Disables device-cloud synergy. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ---------------- |
| accountId | string | Yes | ID of the target cloud.|
**Return value**
| Type | Description |
| ------------------- | ------------------------- |
| Promise&lt;void&gt; | Promise that returns no value.|
**Example**
```js
let account = 'test_id';
try {
cloudData.Config.disableCloud(account).then(() => {
console.info('Succeeded in disabling cloud');
}).catch((err) => {
console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### changeAppCloudSwitch
static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean, callback: AsyncCallback&lt;void&gt;):void
Changes the device-cloud synergy switch for an application. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------------- | ---- | ---------------------------- |
| accountId | string | Yes | ID of the target cloud.|
| bundleName| string | Yes | Name of the target application.|
| status | boolean | Yes | Setting of the device-cloud synergy switch for the application. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Example**
```js
let account = 'test_id';
let bundleName = 'test_bundleName';
try {
cloudData.Config.changeAppCloudSwitch(account, bundleName, true, function (err) {
if (err === undefined) {
console.info('Succeeded in changing App cloud switch');
} else {
console.error(`Failed to change App cloud switch. Code: ${err.code}, message: ${err.message}`);
}
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### changeAppCloudSwitch
static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean): Promise&lt;void&gt;
Changes the device-cloud synergy switch for an application. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------------- | ---- | ---------------------------- |
| accountId | string | Yes | ID of the target cloud.|
| bundleName| string | Yes | Name of the target application.|
| status | boolean | Yes | Setting of the device-cloud synergy switch for the application. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
**Return value**
| Type | Description |
| ------------------- | ------------------------- |
| Promise&lt;void&gt; | Promise that returns no value.|
**Example**
```js
let account = 'test_id';
let bundleName = 'test_bundleName';
try {
cloudData.Config.changeAppCloudSwitch(account, bundleName, true).then(() => {
console.info('Succeeded in changing App cloud switch');
}).catch((err) => {
console.error(`Failed to change App cloud switch. Code is ${err.code}, message is ${err.message}`);
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### notifyDataChange
static notifyDataChange(accountId: string,bundleName:string, callback: AsyncCallback&lt;void&gt;):void
Notifies the data changes in the cloud. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Server
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ---------------- |
| accountId | string | Yes | ID of the target cloud.|
| bundleName | string | Yes | Name of the target application. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Example**
```js
let account = 'test_id';
let bundleName = 'test_bundleName';
try {
cloudData.Config.notifyDataChange(account, bundleName, function (err) {
if (err === undefined) {
console.info('Succeeded in notifying the change of data');
} else {
console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
}
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
### notifyDataChange
static notifyDataChange(accountId: string,bundleName:string): Promise&lt;void&gt;
Notifies the data changes in the cloud. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
**System capability**: SystemCapability.DistributedDataManager.CloudSync.Server
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ---------------- |
| accountId | string | Yes | ID of the target cloud.|
| bundleName | string | Yes | Name of the target application. |
**Return value**
| Type | Description |
| ------------------- | ------------------------- |
| Promise&lt;void&gt; | Promise that returns no value.|
**Example**
```js
let account = 'test_id';
let bundleName = 'test_bundleName';
try {
cloudData.Config.notifyDataChange(account, bundleName).then(() => {
console.info('Succeeded in notifying the change of data');
}).catch((err) => {
console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
});
} catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
}
```
# @ohos.data.dataSharePredicates (DataShare Predicates) # @ohos.data.dataSharePredicates (Data Share Predicates)
You can use **DataSharePredicates** to specify conditions for [updating](js-apis-data-dataShare.md#update), [deleting](js-apis-data-dataShare.md#delete), and [querying](js-apis-data-dataShare.md#query) data when **DataShare** is used to manage data. You can use **DataSharePredicates** to specify conditions for [updating](js-apis-data-dataShare.md#update), [deleting](js-apis-data-dataShare.md#delete), and [querying](js-apis-data-dataShare.md#query) data when **DataShare** is used to manage data.
...@@ -18,13 +18,13 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates'; ...@@ -18,13 +18,13 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
``` ```
## DataSharePredicates ## DataSharePredicates
Provides methods for setting different **DataSharePredicates** objects. Provides methods for setting different **DataSharePredicates** objects. This type is not multi-thread safe. If a **DataSharePredicates** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
### equalTo ### equalTo
equalTo(field: string, value: ValueType): DataSharePredicates equalTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is equal to the specified value. Sets a **DataSharePredicates** object to match the data that is equal to the specified value.
Currently, only the relational database (RDB) and key-value database (KVDB, schema) support this **DataSharePredicates** object. Currently, only the relational database (RDB) and key-value database (KVDB, schema) support this **DataSharePredicates** object.
...@@ -54,10 +54,11 @@ predicates.equalTo("NAME", "Rose") ...@@ -54,10 +54,11 @@ predicates.equalTo("NAME", "Rose")
notEqualTo(field: string, value: ValueType): DataSharePredicates notEqualTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is not equal to the specified value. Sets a **DataSharePredicates** object to match the data that is not equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -88,6 +89,7 @@ Adds a left parenthesis to this **DataSharePredicates**. ...@@ -88,6 +89,7 @@ Adds a left parenthesis to this **DataSharePredicates**.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
...@@ -116,6 +118,7 @@ Adds a right parenthesis to this **DataSharePredicates** object. ...@@ -116,6 +118,7 @@ Adds a right parenthesis to this **DataSharePredicates** object.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
...@@ -144,6 +147,7 @@ Adds the OR condition to this **DataSharePredicates** object. ...@@ -144,6 +147,7 @@ Adds the OR condition to this **DataSharePredicates** object.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
...@@ -190,10 +194,11 @@ predicates.equalTo("NAME", "lisi") ...@@ -190,10 +194,11 @@ predicates.equalTo("NAME", "lisi")
contains(field: string, value: string): DataSharePredicates contains(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that contains the specified value. Sets a **DataSharePredicates** object to match the data that contains the specified value.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -220,10 +225,11 @@ predicates.contains("NAME", "os") ...@@ -220,10 +225,11 @@ predicates.contains("NAME", "os")
beginsWith(field: string, value: string): DataSharePredicates beginsWith(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that begins with the specified value. Sets a **DataSharePredicates** object to match the data that begins with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -250,10 +256,11 @@ predicates.beginsWith("NAME", "os") ...@@ -250,10 +256,11 @@ predicates.beginsWith("NAME", "os")
endsWith(field: string, value: string): DataSharePredicates endsWith(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that ends with the specified value. Sets a **DataSharePredicates** object to match the data that ends with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -280,10 +287,11 @@ predicates.endsWith("NAME", "os") ...@@ -280,10 +287,11 @@ predicates.endsWith("NAME", "os")
isNull(field: string): DataSharePredicates isNull(field: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data whose value is null. Sets a **DataSharePredicates** object to match the data whose value is null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -309,10 +317,11 @@ predicates.isNull("NAME") ...@@ -309,10 +317,11 @@ predicates.isNull("NAME")
isNotNull(field: string): DataSharePredicates isNotNull(field: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data whose value is not null. Sets a **DataSharePredicates** object to match the data whose value is not null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -338,10 +347,11 @@ predicates.isNotNull("NAME") ...@@ -338,10 +347,11 @@ predicates.isNotNull("NAME")
like(field: string, value: string): DataSharePredicates like(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that matches the specified wildcard expression. Sets a **DataSharePredicates** object to match the data that matches the specified wildcard expression.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -368,10 +378,11 @@ predicates.like("NAME", "%os%") ...@@ -368,10 +378,11 @@ predicates.like("NAME", "%os%")
unlike(field: string, value: string): DataSharePredicates unlike(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that does not match the specified wildcard expression. Sets a **DataSharePredicates** object to match the data that does not match the specified wildcard expression.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -398,10 +409,11 @@ predicates.unlike("NAME", "%os%") ...@@ -398,10 +409,11 @@ predicates.unlike("NAME", "%os%")
glob(field: string, value: string): DataSharePredicates glob(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that matches the specified wildcard expression. Sets a **DataSharePredicates** object to match the data that matches the specified wildcard expression.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -428,10 +440,11 @@ predicates.glob("NAME", "?h*g") ...@@ -428,10 +440,11 @@ predicates.glob("NAME", "?h*g")
between(field: string, low: ValueType, high: ValueType): DataSharePredicates between(field: string, low: ValueType, high: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is within the specified range, including the start and end values. Sets a **DataSharePredicates** object to match the data that is within the specified range, including the start and end values.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -459,10 +472,11 @@ predicates.between("AGE", 10, 50) ...@@ -459,10 +472,11 @@ predicates.between("AGE", 10, 50)
notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is out of the specified range, excluding the start and end values. Sets a **DataSharePredicates** object to match the data that is out of the specified range, excluding the start and end values.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -490,10 +504,11 @@ predicates.notBetween("AGE", 10, 50) ...@@ -490,10 +504,11 @@ predicates.notBetween("AGE", 10, 50)
greaterThan(field: string, value: ValueType): DataSharePredicates greaterThan(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is greater than the specified value. Sets a **DataSharePredicates** object to match the data that is greater than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -520,10 +535,11 @@ predicates.greaterThan("AGE", 10) ...@@ -520,10 +535,11 @@ predicates.greaterThan("AGE", 10)
lessThan(field: string, value: ValueType): DataSharePredicates lessThan(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is less than the specified value. Sets a **DataSharePredicates** object to match the data that is less than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -550,10 +566,11 @@ predicates.lessThan("AGE", 50) ...@@ -550,10 +566,11 @@ predicates.lessThan("AGE", 50)
greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is greater than or equal to the specified value. Sets a **DataSharePredicates** object to match the data that is greater than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -580,10 +597,11 @@ predicates.greaterThanOrEqualTo("AGE", 10) ...@@ -580,10 +597,11 @@ predicates.greaterThanOrEqualTo("AGE", 10)
lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is less than or equal to the specified value. Sets a **DataSharePredicates** object to match the data that is less than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -672,6 +690,7 @@ Sets a **DataSharePredicates** object to filter out duplicate data records. ...@@ -672,6 +690,7 @@ Sets a **DataSharePredicates** object to filter out duplicate data records.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
...@@ -725,6 +744,7 @@ Sets a **DataSharePredicates** object group the records according to the specifi ...@@ -725,6 +744,7 @@ Sets a **DataSharePredicates** object group the records according to the specifi
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -754,6 +774,7 @@ Sets a **DataSharePredicates** object to list data by the specified index. ...@@ -754,6 +774,7 @@ Sets a **DataSharePredicates** object to list data by the specified index.
Currently, only the RDB supports this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -779,7 +800,7 @@ predicates.indexedBy("SALARY_INDEX") ...@@ -779,7 +800,7 @@ predicates.indexedBy("SALARY_INDEX")
in(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates in(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is within the specified value. Sets a **DataSharePredicates** object to match the data that is within the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -809,10 +830,11 @@ predicates.in("AGE", [18, 20]) ...@@ -809,10 +830,11 @@ predicates.in("AGE", [18, 20])
notIn(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates notIn(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data that is not in the specified value. Sets a **DataSharePredicates** object to match the data that is not in the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -839,10 +861,11 @@ predicates.notIn("NAME", ["Lisa", "Rose"]) ...@@ -839,10 +861,11 @@ predicates.notIn("NAME", ["Lisa", "Rose"])
prefixKey(prefix: string): DataSharePredicates prefixKey(prefix: string): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data with the specified key prefix. Sets a **DataSharePredicates** object to match the data with the specified key prefix.
Currently, only the KVDB supports this **DataSharePredicates** object. Currently, only the KVDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
...@@ -868,10 +891,11 @@ predicates.prefixKey("NAME") ...@@ -868,10 +891,11 @@ predicates.prefixKey("NAME")
inKeys(keys: Array&lt;string&gt;): DataSharePredicates inKeys(keys: Array&lt;string&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to search for the data whose keys are within the given range. Sets a **DataSharePredicates** object to match the data whose keys are within the given range.
Currently, only the KVDB supports this **DataSharePredicates** object. Currently, only the KVDB supports this **DataSharePredicates** object.
**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
......
# @ohos.data.ValuesBucket (Value Bucket) # @ohos.data.ValuesBucket (Data Set)
The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to insert data into a database. The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to insert data into a database.
...@@ -6,7 +6,6 @@ The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to ...@@ -6,7 +6,6 @@ The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to
> >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> >
> The APIs provided by this module are system APIs.
## Modules to Import ## Modules to Import
...@@ -30,7 +29,7 @@ Enumerates the value types allowed by the database. ...@@ -30,7 +29,7 @@ Enumerates the value types allowed by the database.
## ValuesBucket ## ValuesBucket
Defines the types of the key and value in a KV pair. Defines the types of the key and value in a KV pair. This type is not multi-thread safe. If a **ValuesBucket** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
......
...@@ -43,5 +43,5 @@ let applicationStateObserver = { ...@@ -43,5 +43,5 @@ let applicationStateObserver = {
console.log('onProcessStateChanged onProcessStateChanged: ${JSON.stringify(processData)}'); console.log('onProcessStateChanged onProcessStateChanged: ${JSON.stringify(processData)}');
} }
}; };
let observerCode = appManager.registerApplicationStateObserver(applicationStateObserver); let observerCode = appManager.on('applicationState', applicationStateObserver);
``` ```
...@@ -63,7 +63,6 @@ Provides the device information. ...@@ -63,7 +63,6 @@ Provides the device information.
| screenDensity<sup>4+</sup> | number | Screen density.| | screenDensity<sup>4+</sup> | number | Screen density.|
| screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br>- **rect**: rectangular screen<br>- **circle**: round screen| | screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br>- **rect**: rectangular screen<br>- **circle**: round screen|
| apiVersion<sup>4+</sup> | number | API version.| | apiVersion<sup>4+</sup> | number | API version.|
| releaseType<sup>4+</sup> | string | Release type. The value includes both the release type and the API version, for example, Beta1.<br>Available release types are as follows:<br>- **Canary**: Releases of this type are compatible with each other under the same API version, but not with those of the **beta** and **release** type.<br>- **Beta**: Releases of this type are compatible with each other under the same API version, but not with those of the **release** type.<br>- **Release**: Releases of this type are compatible with the latest five API versions.|
| deviceType<sup>4+</sup> | string | Device type.| | deviceType<sup>4+</sup> | string | Device type.|
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册