From b2ee274567efbfee3fd1c1d5314442e3160cf9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= Date: Wed, 6 Jul 2022 08:18:12 +0000 Subject: [PATCH] =?UTF-8?q?update=20zh-cn/application-dev/device/sensor-gu?= =?UTF-8?q?idelines.md.=20reqPermissions=E6=9D=83=E9=99=90=20=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=BA=86=E4=B8=AD=E6=96=87=E5=BC=95=E5=8F=B7=20?= =?UTF-8?q?=EF=BC=9Breason=E5=AD=97=E6=AE=B5=20=E5=A4=9A=E5=87=BA=E4=B8=80?= =?UTF-8?q?=E4=B8=AA"=20=20=E5=88=A0=E9=99=A4=20Signed-off-by:=20=E9=99=88?= =?UTF-8?q?=E4=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/sensor-guidelines.md | 80 +++++++++++-------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/zh-cn/application-dev/device/sensor-guidelines.md b/zh-cn/application-dev/device/sensor-guidelines.md index bae53e67dc..6259723f56 100644 --- a/zh-cn/application-dev/device/sensor-guidelines.md +++ b/zh-cn/application-dev/device/sensor-guidelines.md @@ -34,40 +34,52 @@ 1. 获取设备上传感器的数据,需要在“config.json”里面进行配置请求权限。具体如下: ``` - ”reqPermissions“:[ - { - "name":"ohos.permission.ACCELEROMETER", - "reason"":"", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - { - "name":"ohos.permission.GYROSCOPE", - "reason"":"", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - { - "name":"ohos.permission.ACTIVITY_MOTION", - "reason"":"ACTIVITY_MOTION_TEST", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - { - "name":"ohos.permission.READ_HEALTH_DATA", - "reason"":"HEALTH_DATA_TEST", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - ] + "reqPermissions": [ + { + "name": "ohos.permission.ACCELEROMETER", + "reason": "", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GYROSCOPE", + "reason": "", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.ACTIVITY_MOTION", + "reason": "ACTIVITY_MOTION_TEST", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.READ_HEALTH_DATA", + "reason": "HEALTH_DATA_TEST", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + } + ] ``` 2. 持续监听传感器数据变化。 -- GitLab