提交 2938a6bb 编写于 作者: 杜庆泉's avatar 杜庆泉

移除 UTSArray isEmpty用法

上级 c140f1c7
...@@ -336,7 +336,7 @@ export function arrayPermissionFlowTest(callback : (ret : boolean, desc : string ...@@ -336,7 +336,7 @@ export function arrayPermissionFlowTest(callback : (ret : boolean, desc : string
*/ */
let permissionNeed = ["android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.READ_PHONE_STATE"] let permissionNeed = ["android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.READ_PHONE_STATE"]
if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length == 0) {
callback(false, "已具备请求权限") callback(false, "已具备请求权限")
return; return;
} }
...@@ -345,7 +345,7 @@ export function arrayPermissionFlowTest(callback : (ret : boolean, desc : string ...@@ -345,7 +345,7 @@ export function arrayPermissionFlowTest(callback : (ret : boolean, desc : string
if (allRight) { if (allRight) {
// 交给目前的location 引擎,真实执行 // 交给目前的location 引擎,真实执行
// 测试权限api 返回值 // 测试权限api 返回值
if (!UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length > 0) {
// 预期当前基座具备了读写日历的权限 // 预期当前基座具备了读写日历的权限
callback(false, "权限请求完成,getSystemPermissionDenied 失败") callback(false, "权限请求完成,getSystemPermissionDenied 失败")
return; return;
...@@ -483,7 +483,7 @@ export function singlePermissionFlowTest(callback : (ret : boolean, desc : strin ...@@ -483,7 +483,7 @@ export function singlePermissionFlowTest(callback : (ret : boolean, desc : strin
} }
let permissionNeed = ["android.permission.READ_PHONE_STATE"] let permissionNeed = ["android.permission.READ_PHONE_STATE"]
if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length == 0) {
callback(false, "已具备权限") callback(false, "已具备权限")
return; return;
} }
...@@ -491,7 +491,7 @@ export function singlePermissionFlowTest(callback : (ret : boolean, desc : strin ...@@ -491,7 +491,7 @@ export function singlePermissionFlowTest(callback : (ret : boolean, desc : strin
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) { UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
if (allRight) { if (allRight) {
// 测试权限api 返回值 // 测试权限api 返回值
if (!UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length > 0) {
callback(false, "权限请求完成,getSystemPermissionDenied 失败") callback(false, "权限请求完成,getSystemPermissionDenied 失败")
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册