diff --git a/uni_modules/uts-advance/utssdk/app-android/index.uts b/uni_modules/uts-advance/utssdk/app-android/index.uts index 537976779266b08f65ee5cbeafb16fbd9d9994db..4154af850d34f47c858a35b36cbfaea605ad401d 100644 --- a/uni_modules/uts-advance/utssdk/app-android/index.uts +++ b/uni_modules/uts-advance/utssdk/app-android/index.uts @@ -228,6 +228,7 @@ export function stopAssetAudio() { } +@Suppress("DEPRECATION") export function goOtherActivity(imageDone : (event : string) => void) : boolean { // 检查相关权限是否已经具备 @@ -238,12 +239,14 @@ export function goOtherActivity(imageDone : (event : string) => void) : boolean return false; } + UTSAndroid.onAppActivityResult((requestCode : Int, resultCode : Int, data ?: Intent) => { let eventName = "onAppActivityResult - requestCode:" + requestCode + " -resultCode:" + resultCode + " -data:" + JSON.stringify(data); console.log(eventName); if ((requestCode == 1001) && (resultCode == Activity.RESULT_OK)) { if (data != null) { let bundle = data.getExtras(); + let mImageBitmap = bundle!.get("data") as Bitmap; let bitmapPath = UTSAndroid.getUniActivity()!.getExternalCacheDir()!.getPath() + "/photo.png" console.log(bitmapPath); @@ -465,7 +468,7 @@ export function arrayConvert():boolean{ let kotlinList = mutableListOf("hello","world") let utsArr1 = Array.fromNative(kotlinList) - if(!(utsArr1 instanceof UTSArray)){ + if(utsArr1[0] != "hello"){ return false } @@ -473,37 +476,36 @@ export function arrayConvert():boolean{ let kotlinArray = arrayOf("hello","world") let utsArr2 = Array.fromNative(kotlinArray) - if(!(utsArr2 instanceof UTSArray)){ + if(utsArr2[0] != "hello"){ return false } let b1 = byteArrayOf(-1,2,0,3,4,5) let c1 = Array.fromNative(b1) - if(!(c1 instanceof UTSArray)){ + + if(c1[0] != (-1 as Number).toByte()){ return false } let b2 = longArrayOf(-1,2,0,3,4,5) let c2 = Array.fromNative(b2) - if(!(c2 instanceof UTSArray)){ + if(c2[0] != (-1 as Number).toLong()){ return false } - let b3 = shortArrayOf(-1,2,0,3,4,5) let c3 = Array.fromNative(b3) - if(!(c3 instanceof UTSArray)){ + if(c3[0] != (-1 as Number).toShort()){ return false } let b4 = intArrayOf(-1,2,0,3,4,5) let c4 = Array.fromNative(b4) - if(!(c4 instanceof UTSArray)){ + if(c4[0] != (-1 as Number).toInt()){ return false } - return true } @@ -513,7 +515,8 @@ export function openFileWithProvider(url:String){ const uri = UTSAndroid.getFileProviderUri(file) console.log("uri",uri.toString()) const intent = new Intent(Intent.ACTION_VIEW, uri) - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 添加权限标志 + // 添加权限标志 + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) const context = UTSAndroid.getUniActivity()!; context.startActivity(intent); } diff --git a/uni_modules/uts-api-test/utssdk/app-android/index.uts b/uni_modules/uts-api-test/utssdk/app-android/index.uts index 78c98009da5a55edc3c1660ad0cb6131abfc3f04..cd6cdfb31c5900b3eff0e1acaae00a85907cbeaf 100644 --- a/uni_modules/uts-api-test/utssdk/app-android/index.uts +++ b/uni_modules/uts-api-test/utssdk/app-android/index.uts @@ -45,10 +45,10 @@ export function frequentlyObjectTest():boolean{ console.log(typeLogRet) let typeLogObj = JSON.parseObject(typeLogRet)! - // let typeLogObjPos = typeLogObj.getJSON("__$originalPosition")! - // if("ParamOptions" != typeLogObjPos['name']){ - // return false - // } + let typeLogObjPos = typeLogObj.getJSON("__$originalPosition")! + if("ParamOptions" != typeLogObjPos['name']){ + return false + } // /** // * 编译出来的位置信息可能有差异,排除单独验证后,排除掉这个字段 // */ diff --git a/uni_modules/uts-nativepage/utssdk/app-android/index.uts b/uni_modules/uts-nativepage/utssdk/app-android/index.uts index 65237691b0a717bee746d13ba8af78f28c2152ac..1038f610f54e4f58b57393e8521362601d309333 100644 --- a/uni_modules/uts-nativepage/utssdk/app-android/index.uts +++ b/uni_modules/uts-nativepage/utssdk/app-android/index.uts @@ -75,7 +75,7 @@ export class AppHookProxy implements UTSAndroidHookProxy { } - +@Suppress("DEPRECATION") class ForeService extends Service { constructor (){ @@ -130,6 +130,7 @@ class ForeService extends Service { return super.onStartCommand(intent, flags, startId); } + override onDestroy():void { super.onDestroy(); this.stopForeground(true);// 停止前台服务--参数:表示是否移除之前的通知 diff --git a/uni_modules/uts-tests/utssdk/Array.uts b/uni_modules/uts-tests/utssdk/Array.uts index a12dc0d0c74f440f57b3b6dd5733195d55bc5d0c..3c0fcd189fa7a210ba47f5a4e4c0bab2bae51c6b 100644 --- a/uni_modules/uts-tests/utssdk/Array.uts +++ b/uni_modules/uts-tests/utssdk/Array.uts @@ -187,7 +187,7 @@ export function testArray(): Result { // #ifndef APP-IOS const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])) as P[] s[0].x += 0; - const clearList = s.map((v : P, _, _a) : number => v.x) + const clearList = s.map((v : P, _, _) : number => v.x) expect(clearList.includes(0)).toEqual(true); // #endif // #ifdef APP-IOS diff --git a/uni_modules/uts-tests/utssdk/Date.uts b/uni_modules/uts-tests/utssdk/Date.uts index 8d74a5b33448c6a25dddec7d43572adc0f711e2e..2a304ba051ac41b598ee7d54e3ee955bf73c1cea 100644 --- a/uni_modules/uts-tests/utssdk/Date.uts +++ b/uni_modules/uts-tests/utssdk/Date.uts @@ -36,11 +36,11 @@ export function testDate() : Result { const date1 = new Date('01 Jan 1970 00:00:00 GMT'); const date2 = new Date('December 17, 1995 03:24:00'); - // #ifndef APP-IOS + // #ifdef APP-IOS expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800 (中国标准时间)"); expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800 (中国标准时间)"); // #endif - // #ifndef APP-ANDROID + // #ifdef APP-ANDROID expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800"); expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800"); // #endif