summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/WifiVendorHal.java18
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java5
2 files changed, 19 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiVendorHal.java b/service/java/com/android/server/wifi/WifiVendorHal.java
index 8023bff49..464a34007 100644
--- a/service/java/com/android/server/wifi/WifiVendorHal.java
+++ b/service/java/com/android/server/wifi/WifiVendorHal.java
@@ -2884,6 +2884,7 @@ public class WifiVendorHal {
mLog.e("Unexpected number of iface info in list " + numIfacesOnEachRadio);
return;
}
+ Runnable runnable = null;
// 2 ifaces simultaneous on 2 radios.
if (radioModeInfoList.size() == 2 && numIfacesOnEachRadio == 1) {
// Iface on radio0 should be different from the iface on radio1 for DBS & SBS.
@@ -2892,22 +2893,31 @@ public class WifiVendorHal {
return;
}
if (radioModeInfo0.bandInfo != radioModeInfo1.bandInfo) {
- handler.onDbs();
+ runnable = () -> {
+ handler.onDbs();
+ };
} else {
- handler.onSbs(radioModeInfo0.bandInfo);
+ runnable = () -> {
+ handler.onSbs(radioModeInfo0.bandInfo);
+ };
}
// 2 ifaces time sharing on 1 radio.
} else if (radioModeInfoList.size() == 1 && numIfacesOnEachRadio == 2) {
IfaceInfo ifaceInfo0 = radioModeInfo0.ifaceInfos.get(0);
IfaceInfo ifaceInfo1 = radioModeInfo0.ifaceInfos.get(1);
if (ifaceInfo0.channel != ifaceInfo1.channel) {
- handler.onMcc(radioModeInfo0.bandInfo);
+ runnable = () -> {
+ handler.onMcc(radioModeInfo0.bandInfo);
+ };
} else {
- handler.onScc(radioModeInfo0.bandInfo);
+ runnable = () -> {
+ handler.onScc(radioModeInfo0.bandInfo);
+ };
}
} else {
// Not concurrency scenario, uninteresting...
}
+ if (runnable != null) mHalEventHandler.post(runnable);
}
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java
index 5a95b952f..aa44023ae 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java
@@ -3110,6 +3110,7 @@ public class WifiVendorHalTest {
radioModeInfos.add(radioModeInfo1);
mIWifiChipEventCallbackV12.onRadioModeChange(radioModeInfos);
+ mLooper.dispatchAll();
verify(mVendorHalRadioModeChangeHandler).onDbs();
verifyNoMoreInteractions(mVendorHalRadioModeChangeHandler);
@@ -3142,6 +3143,7 @@ public class WifiVendorHalTest {
radioModeInfos.add(radioModeInfo1);
mIWifiChipEventCallbackV12.onRadioModeChange(radioModeInfos);
+ mLooper.dispatchAll();
verify(mVendorHalRadioModeChangeHandler).onSbs(WifiScanner.WIFI_BAND_5_GHZ);
verifyNoMoreInteractions(mVendorHalRadioModeChangeHandler);
@@ -3171,6 +3173,7 @@ public class WifiVendorHalTest {
radioModeInfos.add(radioModeInfo0);
mIWifiChipEventCallbackV12.onRadioModeChange(radioModeInfos);
+ mLooper.dispatchAll();
verify(mVendorHalRadioModeChangeHandler).onScc(WifiScanner.WIFI_BAND_5_GHZ);
verifyNoMoreInteractions(mVendorHalRadioModeChangeHandler);
@@ -3200,6 +3203,7 @@ public class WifiVendorHalTest {
radioModeInfos.add(radioModeInfo0);
mIWifiChipEventCallbackV12.onRadioModeChange(radioModeInfos);
+ mLooper.dispatchAll();
verify(mVendorHalRadioModeChangeHandler).onMcc(WifiScanner.WIFI_BAND_BOTH);
verifyNoMoreInteractions(mVendorHalRadioModeChangeHandler);
@@ -3230,6 +3234,7 @@ public class WifiVendorHalTest {
radioModeInfos.add(radioModeInfo1);
mIWifiChipEventCallbackV12.onRadioModeChange(radioModeInfos);
+ mLooper.dispatchAll();
// Ignored....
verifyNoMoreInteractions(mVendorHalRadioModeChangeHandler);