标签:sync wddm arm imp ssi abi 访问 service 自动
注意!!!访问远程设备的Data Ability除了上面讲的uri里添加DevcieId以外,必须注意下面几点:
"defPermissions": [
{ "name": "cn.ybzy.hmsdemo.DataAbilityShellProvider.PROVIDER", "grantMode": "system_grant" }
]
"reqPermissions": [
{ "name": "ohos.permission.GET_DISTRIBUTED_DEVICE_INFO" },
{ "name": "ohos.permission.DISTRIBUTED_DATASYNC" },
{ "name": "ohos.permission.READ_USER_STORAGE" },
{ "name": "cn.ybzy.hmsdemo.DataAbilityShellProvider.PROVIDER" }
]
requestPermissionsFromUser(new String[]{"ohos.permission.DISTRIBUTED_DATASYNC", "ohos.permission.servicebus.ACCESS_SERVICE", "com.huawei.hwddmp.servicebus.BIND_SERVICE"}, 0);
{
"visible": true, //最后的坑,创建Data Ability时候不会自动添加
"permissions": [ "cn.ybzy.hmsdemo.DataAbilityShellProvider.PROVIDER" ],
"name": "cn.ybzy.hmsdemo.SimpleDataAbility",
"icon": "$media:icon",
"description": "hap sample empty provider",
"type": "data", "uri": "dataability://cn.ybzy.hmsdemo.SimpleDataAbility"
}
作者:zhonghongfa
想了解更多内容,请访问51CTO和华为合作共建的鸿蒙社区:https://harmonyos.51cto.com
标签:sync wddm arm imp ssi abi 访问 service 自动
原文地址:https://www.cnblogs.com/HarmonyOS/p/14591553.html