SoftApManager: Start state machine after initializing WifiNative
This otherwise causes a NPE when StateMachine invokes
WifiNative.deregisterWificondDeathHandler().
Bug: 70146335
Test: Unit tests
Test: Manual soft ap toggle.
Change-Id: I86c9429025ce2b926b207ee2e2324b3a7a386697
diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java
index 429e3c3..b79c901 100644
--- a/service/java/com/android/server/wifi/SoftApManager.java
+++ b/service/java/com/android/server/wifi/SoftApManager.java
@@ -106,8 +106,6 @@
WifiApConfigStore wifiApConfigStore,
@NonNull SoftApModeConfiguration apConfig,
WifiMetrics wifiMetrics) {
- mStateMachine = new SoftApStateMachine(looper);
-
mContext = context;
mWifiNative = wifiNative;
mCountryCode = countryCode;
@@ -124,6 +122,7 @@
mApConfig = config;
}
mWifiMetrics = wifiMetrics;
+ mStateMachine = new SoftApStateMachine(looper);
}
/**