From 64e4aa949c599c23d928b80d31966d1f5133008d Mon Sep 17 00:00:00 2001 From: huangxiang Date: Mon, 16 Oct 2023 17:19:09 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20107600b=20from=20https://gitee.com/huan?= =?UTF-8?q?gxiangxxx/applications=5Fsystemui/pulls/403=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=BF=83=E4=B8=8E=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E4=B8=AD=E5=BF=83wlan=E7=8A=B6=E6=80=81=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangxiang --- .../src/main/ets/default/wifiModel.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/features/wificomponent/src/main/ets/default/wifiModel.ts b/features/wificomponent/src/main/ets/default/wifiModel.ts index 310fd6e9..5fd30ed8 100644 --- a/features/wificomponent/src/main/ets/default/wifiModel.ts +++ b/features/wificomponent/src/main/ets/default/wifiModel.ts @@ -71,12 +71,15 @@ export class WifiModel { onWifiStateChange(data: WifiState): void { Log.showInfo(TAG, `onWifiStateChange, data: ${JSON.stringify(data)}`); - let isWifiInactive = data == WifiState.STATE_OFF; - mWifiOpenStatus.set(!isWifiInactive); - if (!isWifiInactive) { - this.getWifiConnectInfo(); - } else { - this.setDisconnectedStatus(); + if (data == WifiState.STATE_OFF || data == WifiState.STATE_ON) { + let checkState = wifi.isWifiActive(); + Log.showInfo(TAG, `checkState, data: ${JSON.stringify(checkState)}`); + mWifiOpenStatus.set(checkState); + if (checkState) { + this.getWifiConnectInfo(); + } else { + this.setDisconnectedStatus(); + } } } -- Gitee