diff --git a/uni_modules/uts-platform-api/utssdk/app-android/index.uts b/uni_modules/uts-platform-api/utssdk/app-android/index.uts index da8382833ffe83a701ee20c1ac7a95156fea65e0..e88d93b40a701e15f45a012c8f71ade98c7e45f0 100644 --- a/uni_modules/uts-platform-api/utssdk/app-android/index.uts +++ b/uni_modules/uts-platform-api/utssdk/app-android/index.uts @@ -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"] - if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { + if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length == 0) { callback(false, "已具备请求权限") return; } @@ -345,7 +345,7 @@ export function arrayPermissionFlowTest(callback : (ret : boolean, desc : string if (allRight) { // 交给目前的location 引擎,真实执行 // 测试权限api 返回值 - if (!UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { + if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length > 0) { // 预期当前基座具备了读写日历的权限 callback(false, "权限请求完成,getSystemPermissionDenied 失败") return; @@ -483,7 +483,7 @@ export function singlePermissionFlowTest(callback : (ret : boolean, desc : strin } let permissionNeed = ["android.permission.READ_PHONE_STATE"] - if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { + if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length == 0) { callback(false, "已具备权限") return; } @@ -491,7 +491,7 @@ export function singlePermissionFlowTest(callback : (ret : boolean, desc : strin UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) { if (allRight) { // 测试权限api 返回值 - if (!UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).isEmpty()) { + if (UTSAndroid.getSystemPermissionDenied(UTSAndroid.getUniActivity()!, permissionNeed).length > 0) { callback(false, "权限请求完成,getSystemPermissionDenied 失败") return; }