From 2938a6bb266a400362b61f62e007ad2b623ba11a Mon Sep 17 00:00:00 2001 From: duqingquan Date: Mon, 22 Jul 2024 17:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20UTSArray=20isEmpty?= =?UTF-8?q?=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-platform-api/utssdk/app-android/index.uts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 da83828..e88d93b 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; } -- GitLab