diff --git a/uni_modules/uni-wifi/utssdk/app-android/index.uts b/uni_modules/uni-wifi/utssdk/app-android/index.uts index 937459d9ecf6a3bde9fae7ef721dd95d8e953145..048a77b4c6dd06d0f953d8cf3549116b120dcbda 100644 --- a/uni_modules/uni-wifi/utssdk/app-android/index.uts +++ b/uni_modules/uni-wifi/utssdk/app-android/index.uts @@ -598,6 +598,19 @@ export function offGetWifiList(callback : UTSCallback) { export function connectWifi(option : WifiConnectOption) { + if (option.maunal == true) { + // 指定了手动模式 + let manunalIntent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS); + UTSAndroid.getUniActivity()!.startActivity(manunalIntent); + + result.errCode = 0 + result.errMsg = "connectWifi:ok" + + option.success?.(result) + option.complete?.(result) + return + } + var result : UniWifiResult = { errCode: 12000, errMsg: "connectWifi:fail:not invoke startWifi", @@ -612,18 +625,7 @@ export function connectWifi(option : WifiConnectOption) { return } - if (option.maunal == true) { - // 指定了手动模式 - let manunalIntent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS); - UTSAndroid.getUniActivity()!.startActivity(manunalIntent); - - result.errCode = 0 - result.errMsg = "connectWifi:ok" - option.success?.(result) - option.complete?.(result) - return - } // 执行后续的逻辑 let scanWifiInfo : AndroidUniWifiInfo | null = null