Fix cannot enable SoftAp after Emergency Callback Mode

During Emergency mode, if a Soft AP enable request is
received, WifiServiceImpl's TetheredSoftApTracker will
record that SAP is enabling, and send the enable command
to ActiveModeWarden. However, ActiveModeWarden will
silently drop the command in Emergency mode.

Then, after emergency mode is exited, if another
Soft AP enable request is received, TetheredSoftApTracker
will mistakenly think that SAP is still enabling, causing
it to not send the enable command to ActiveModeWarden.

To fix this, in emergency mode, if ActiveModeWarden
receives a start SAP request, it will trigger the start
failure callback so that TetheredSoftApTracker doesn't
mistakenly think that SAP is being enabled.

Bug: 174542866
Test: atest FrameworksWifiTests
Test: 1. adb root
      2. adb shell cmd wifi set-emergency-callback-mode enabled
      3. Enable SAP in Settings (expected to fail)
      4. adb shell cmd wifi set-emergency-callback-mode disabled
      5. Enable SAP in Settings
      6. Verify SAP successfully started
Change-Id: Ie1645eedf3e3d6e55e02bdb507591cd74fe843bc
Merged-In: Ie1645eedf3e3d6e55e02bdb507591cd74fe843bc
2 files changed
tree: 0101315ee08f8956515f7b8ba072f73171cbb823
  1. apex/
  2. service/
  3. metrics_pdd_hook.py
  4. PREUPLOAD.cfg