提交 5e1b769d 编写于 作者: 杜庆泉's avatar 杜庆泉

修复全部 android 编译告警

上级 e5d410a0
......@@ -227,7 +227,7 @@ export function stopAssetAudio() {
}
//@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("DEPRECATION")
export function goOtherActivity(imageDone : (event : string) => void) : boolean {
// 检查相关权限是否已经具备
......
......@@ -3,13 +3,13 @@ import AlertDialog from 'android.app.AlertDialog';
import DialogInterface from 'android.content.DialogInterface';
import EditText from 'android.widget.EditText';
//@UTSAndroid.Suppress("UNUSED_PARAMETER")
@UTSAndroid.Suppress("UNUSED_PARAMETER")
export function showAlert(_title : string | null, _message : string | null, _result : (index : Number) => void) {
let uiRunable = new DialogUIRunnable(null, _title!, _message!, "", false);
UTSAndroid.getUniActivity()!.runOnUiThread(uiRunable)
}
//@UTSAndroid.Suppress("UNUSED_PARAMETER")
@UTSAndroid.Suppress("UNUSED_PARAMETER")
export function showPrompt(_title : string | null, _message : string | null, _placeholder : string | null, success : (content : string) => void) {
let uiRunable = new DialogUIRunnable(success, _title!, _message!, _placeholder!, true);
UTSAndroid.getUniActivity()!.runOnUiThread(uiRunable)
......
......@@ -138,7 +138,7 @@ export class AppHookProxy implements UTSAndroidHookProxy {
}
//@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("DEPRECATION")
class ForeService extends Service {
constructor (){
......@@ -425,7 +425,7 @@ class DemoActivity extends Activity{
}
//@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("DEPRECATION")
class IntentRunable implements Runnable{
override run(){
console.log("IntentRunable = " + Thread.currentThread().getName())
......@@ -478,7 +478,7 @@ function initShortCut() {
}
//@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("DEPRECATION")
export function gotoDemoActivity():boolean {
// 这里的逻辑是为了判断 当前的自定义activity 是否注册了,并以此为条件判断是否是自定义基座
let hasXActivityIntegration = true
......
......@@ -175,7 +175,7 @@ export function gotoSystemPermissionActivityTest() {
/**
* 跳转系统拍照界面,并触发相关生命周期测试
*/
//@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("DEPRECATION")
export function gotoCameraTake(imageDone : (event : string) => void) : boolean {
let permissionNeed = ["android.permission.CAMERA"]
......
......@@ -79,7 +79,7 @@ class ScreenFileObserver extends FileObserver {
/**
* 开启截图监听
*/
//@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("DEPRECATION")
export function onUserCaptureScreen(callback: UserCaptureScreenCallback) {
// 检查相关权限是否已经具备
......
......@@ -435,7 +435,7 @@ export class UTSActivityComponentCallback extends UniActivityComponentCallback {
export function Scan(timeMillis : Number = 60000):number {
return timeMillis
}
@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
export function Scan1(timeMillis ?: Number):string {
if(timeMillis == null){
......@@ -443,7 +443,7 @@ export function Scan1(timeMillis ?: Number):string {
}
return timeMillis!.toString()
}
@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
export function Scan2(timeMillis ?: Number | null):string {
if(timeMillis == null){
......@@ -461,12 +461,12 @@ export class myClass {
console.log(name);
return name
}
@UTSAndroid.Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
to1(name?: String):string {
if(name == null){
return "null"
}
return name
return name!
}
}
......
......@@ -187,7 +187,7 @@ export function getLocation(locationOptions: LocationOptions):boolean {
/**
* 持续监听位置变化
*/
//@UTSAndroid.Suppress("UNUSED_PARAMETER")
@UTSAndroid.Suppress("UNUSED_PARAMETER")
export function watchPosition(_locationOptions: LocationOptions) {
//todo
}
......@@ -195,7 +195,7 @@ export function watchPosition(_locationOptions: LocationOptions) {
/**
* 关闭监听位置变化
*/
//@UTSAndroid.Suppress("UNUSED_PARAMETER")
@UTSAndroid.Suppress("UNUSED_PARAMETER")
export function clearWatch() {
//todo
}
\ No newline at end of file
import { describe, test, expect, Result } from './tests.uts'
//@UTSAndroid.Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
@UTSAndroid.Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
export function testForLoop(): Result {
return describe('ForLoop', () => {
test('syntax', () => {
......
......@@ -80,7 +80,7 @@ class A6 implements IJSONStringify{
}
@UTSAndroid.Suppress("DEPRECATION")
@UTSAndroid.Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
export function testJSON() : Result {
return describe("JSON", () => {
......
import { describe, test, expect, Result } from './tests.uts'
//@UTSAndroid.Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
@UTSAndroid.Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
export function testNumber() : Result {
return describe("Number", () => {
......
import { describe, test, expect, Result } from './tests.uts'
@UTSAndroid.Suppress("VARIABLE_WITH_REDUNDANT_INITIALIZER","NAME_SHADOWING")
export function testPromise() : Result {
return describe("Promise", () => {
test('constructor', () => {
......
import { describe, test, expect, Result } from './tests.uts'
@UTSAndroid.Suppress("VARIABLE_WITH_REDUNDANT_INITIALIZER","ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
export function testSet() : Result {
return describe("Set", () => {
test('size', () => {
......
import { describe, test, expect, Result } from './tests.uts'
@UTSAndroid.Suppress("UNNECESSARY_NOT_NULL_ASSERTION","DEPRECATION")
export function testString() : Result {
return describe("String", () => {
test('length', () => {
......@@ -221,6 +222,7 @@ export function testString() : Result {
expect("".indexOf("test")).toEqual(-1);
})
test('match', () => {
// #TEST String.match
const str = 'The quick brown fox jumps over the lazy dog. It barked.';
......
import { describe, test, expect, Result } from './tests.uts'
//@UTSAndroid.Suppress("USELESS_IS_CHECK")
@UTSAndroid.Suppress("USELESS_IS_CHECK")
export function testType() : Result {
return describe("Type", () => {
test("Object literal to type instance", () => {
......
......@@ -14,7 +14,7 @@ type User = {
}
@UTSAndroid.Suppress("UNNECESSARY_NOT_NULL_ASSERTION","ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE","UNUSED_VARIABLE","UNUSED_VALUE","VARIABLE_WITH_REDUNDANT_INITIALIZER")
export function testUTSJSONObject() : Result {
return describe("utsjsonobject", () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册