summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-08-26 07:55:43 -0700
committerRoshan Pius <rpius@google.com>2019-08-26 08:00:41 -0700
commit8a12ed4598483421f6bc8af41f03c248e2b7204b (patch)
tree0a936945cc9551d4f5f9f12ea58724abb18f6cda /service
parent36aa13d2f3b0230dfbdb91baceece854e3fa4ee6 (diff)
WifiVendorHal: Post callback to invoke RadioModeChange callback
Avoid calling WifiNative callbacks directly from the Hwbinder thread. Bug: 139985227 Test: atest com.android.server.wifi.WifiVendorHalTest Change-Id: I704b7a32eef0b518173793ab43f5644be998fd75
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiVendorHal.java18
1 files changed, 14 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);
}
}