History log of /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1f6626d7488bba014b42bab8bbcd4720694df485 25-May-2017 Rebecca Silberstein <silberst@google.com> WifiStateMachine: add mode to softap update

Plumb the softap target mode in to WifiStateMachine so we can add it to
the softap state change broadcast.

Also cleaned up some of the error and stopping states noticed due to the
mode updates and tests. This removes extra calls to clear the requests
and uses the ap state change broadcast to notify registered callers
about the LOHS stopping instead of attempting to get intermediate state.

Bug: 62076211
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Icff0a9b30e1eb9e5aa945d289d274da7ec8910eb
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
2a70519406937402c761a6ce418c15e3b5598688 04-Mar-2017 Rebecca Silberstein <silberst@google.com> FrameworkFacade: add helper to ease testing

WifiController, RecommendedNetworkEvaluator and SavedNetworkEvaluator
all use ContentObservers in their implementations. The tests for these
classes started failing when a change was made to include the Context
object when registering ContentObservers. This changed caused the tests
for these methods to fail due to a mix of mocks and actual objects.
This CL adds a helper to FrameworkFacade that allow the tests to pass,
and even better, updates them to use ArgumentCaptors to get a handle on
the ContentObservers. This will allow the tests to be enhanced and
easily call the observers to test functionality for changes related to
the observers.

Bug: 35908602
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I2e4a39febf575c1335cec57b9e21e28cb3e0fffd
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
896151bcf9345f4db8cf3f6ccc64320f78aa6443 27-Jan-2017 Rebecca Silberstein <silberst@google.com> WifiController: send mode change before switching

When performing the following mode changes, do not force
WifiStateMachine to guess which mode it should be entering.

Sequence:
1. Enable wifi
2. Enable wifi location scans
3. Disable wifi (ScanMode)
4. Disable wifi location scans (wifi fully disabled)
5. Enable wifi (should go to ClientMode without
first entering ScanMode)

This sequence was an issue because WifiStateMachine was most recently in
ScanMode and supplicant was started before the new operational mode was
sent. This CL adds a mode switch call to WifiStateMachine before the
call to start supplicant if wifi was off and we are going to
ConnectMode.

Bug: 31986765
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: manually verified by performing the above sequence and inspecting
the logs
Test: passed wifi integration tests

Change-Id: I9e0f99c4c3df59330c1932370cc93d3047202f33
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
48bba582a6735feae2d0834011cd30d9bc2d1100 04-Jan-2017 Rebecca Silberstein <silberst@google.com> WifiStateMachine: erroneous wifi enabled updates

Update WifiStateMachine to only broadcast wifi availability when in
client mode. Prior to this fix, wifi would briefly enable/disable when
exiting airplane mode when location scans are enabled and wifi
(client mode) should be disabled.

This CL additionally fixes an issue in WifiController that works around
an assumption in WifiStateMachine that the default mode after supplicant
has started is client mode. The mode is now set before starting
supplicant so we do not erroneously enter client mode and then
immediately switch to scan only mode.

This CL addresses three known issues where wifi flickers on/off:
1 - wifi disabled, enable wifi location scans
2 - location scans enabled, wifi disabled, enter and exit airplane mode
3 - location scans enabled, wifi disabled, enter airplane mode, enable
and disable wifi, exit airplane mode

Bug: 28336982
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: manually confirmed wifi does not flash on after airplane mode
Change-Id: I9a1d4c7cf00e78c09e3f28e820e058c72c5114b9
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
a4fbb5f3e68204a07939a8b544693d6899beb3ed 06-Aug-2016 Christopher Wiley <wiley@google.com> Don't manipulate driver state from WifiController

After this change, all states related to driver state are noops
in the WifiStateMachine. They will be removed in the following change.

Bug: 30764863
Test: unittests pass on bullhead and upcoming devices
Test: WiFi continues to be able to connect/disconnect on bullhead

Change-Id: Ife8bb2d57a300350749d920ff89dee12ad86d310
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
24750cd1f8148d6a935bda96f3b17f22b0c1d8bd 03-Aug-2016 Rebecca Silberstein <silberst@google.com> WifiController: correct active state after ap mode

When a device is in AP mode and wifi is toggled, the device should end
the wifi hotspot and enter the connect mode for wifi. When wifi was
toggled in ApEnabledState, a wifi toggle would trigger a switch to
StaEnabledState. This state's enter method would trigger
WifiStateMachine to start supplicant, but would not indicate it should
be in connect mode. This is done by DeviceActiveState. This CL switches
the mPendingState in ApEnabledState from StaEnabledState to
DeviceActiveState.

Added a test to WifiControllerTest to cover this situation.

BUG: 30042498
Change-Id: I0792c06521e82e07a8c36648ebbd62c8babceaff
TEST: runtest frameworks-wifi
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
5f0238c0d7b4b037dcb1c397217eb65dcfbf53ce 26-May-2016 Rebecca Silberstein <silberst@google.com> DO NOT MERGE WifiController: Add CMD_RESET_WIFI command

(cherry-pick from master)

Allow WifiController to safely restart the WiFi stack. This will
initially be used by the WifiLastResortWatchdog. The CMD_RESET_WIFI
message is only handled in the StaEnabledState where it would have been
attempting to connect. The process of bringing the wifi back up is
handled through the use of the new CMD_RESET_WIFI_CONTINUE command.
Tests are also added to verify that the new CMD_RESET_WIFI command
is ignored in other states (explicitly tests Emergency mode and
AP enabled).

BUG: 27856267
Change-Id: I778ccd6f7d555f6ee6abb195c1c16c106c2e66b7
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
9563500603c158373e2ee512c4d451783c104660 20-May-2016 Rebecca Silberstein <silberst@google.com> DO NOT MERGE WifiLockManager: create class to manage WifiLocks

( cherry-pick of Ib055078eb0a8555e9a7715d7ce10de1103e73130 from master)

Create new class to maintain WifiLocks requested by applications.

WifiLock management was closely tied to the WifiServiceImpl and made it
very difficult to write tests using different WifiLock modes in
DeviceIdle states. This CL moves the lock management to a new class,
WifiLockManager, and adds tests to check the behavior.

Bug: 28669096
Change-Id: Ib055078eb0a8555e9a7715d7ce10de1103e73130
Test: runtest frameworks-wifi
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
191fa5b445e8cfd0fa2c4aa7458776ab7a3972f7 09-May-2016 Rebecca Silberstein <silberst@google.com> WifiController: set to proper state after SoftAP

After receiving a CMD_AP_STOPPED message, WifiController should return
to the DeviceActive state or the appropriate Idle state. This CL sets
the correct pending state and also adds a check for the idle state.
A test is also added to confirm the DeviceActive state is entered after
the SoftAp state is completed.

Note: An additional test for the DeviceIdle path will be added at a
later point after some code refactoring (bug 28669096)

BUG: 28434530
Change-Id: Ie19e66b9c84ff545a622119890bc7705ebd74c46
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
3f2620fbec3b556148211c429af5cbcd9ea174a2 07-May-2016 Rebecca Silberstein <silberst@google.com> WifiSettingsStore: add methods for WifiSavedState

Add methods to get and set WifiSavedState in WifiSettingsStore. This
change allows us to better test state transitions in WifiController
since we can now mock out the calls easily.

BUG: 28434530
Change-Id: Ie2b6f0311462da0179ecd28665f78f4bf14a02f9
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
752bd0ed137ccc42cdfd911611f2d5f8d33be53c 11-Apr-2016 Sunil Dutt <usdutt@codeaurora.org> Check KEY_CONFIG_WIFI_DISABLE_IN_ECBM on ECBM notification

Wi-Fi disable on ECBM notification is controlled by the
configuration parameter KEY_CONFIG_WIFI_DISABLE_IN_ECBM.
Hence check for the same while processing the notification.

Bug: 27854016
Change-Id: If1724f825f1c8b47ec2f29ecd8abda45ef9bc393
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
b1b1211b3477e306a8626e7e6cf2d2aae7983396 18-Mar-2016 Mitchell Wills <mwills@google.com> Fix WifiController handling of emergency call mode

Fixes: 27724263
Change-Id: If6f6456cbe2419999cd3d26549a7904482b0af27
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
d7a1994f19f3bbec7df063488214a347fbcb5b92 16-Dec-2015 Sunil Dutt <usdutt@codeaurora.org> Wifi: Update WifiController state if Wifi turn On fails

If Wifi turn On fails due to failure in reloading firmware then
WifiStateMachine stays in InitialState, but WifiController is left
stuck in StaEnabledState, which in turn fails to turn on WLAN again.

Set Wifi state as failed to generate intent WIFI_STATE_CHANGED_ACTION so
that WifiController transitions to ApStaDisabledState.

Change-Id: I007d85179a0566e2f1b452ae8b564c4e8258987d
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
df21baf692e4906c26ce5ab38fa24904787807b5 24-Feb-2016 Peter Qiu <zqiu@google.com> WifiController: handle WiFi toggle events in ApEnabledState

This allows the WiFi toggle event to be handled when Soft AP
is enabled, which will stop the soft AP and transition to
StaEnabledState when soft AP is stopped.

Bug: 27325949
TEST=runtest frameworks-wifi
TEST=Manual Test
Manual Tests
1. Enable WiFi (connected to "GoogleGuest"), enable WiFi hotspot,
disable WiFi hotspot (toggle Hotspot), verify WiFi is enabled
and reconnected to "GoogleGuest".
2. Enable WiFi (connected to "GoogleGuest"), disable WiFi, enable
WiFi hotspot, toggle WiFi (which will enable WiFi), verify WiFi
is enabled and reconnected to "GoogleGuest".
3. Enable WiFi (connected to "GoogleGuest"), enable WiFi hotspot,
toggle WiFi (which will enable WiFi), verify WiFi is enabled
and reconnected to "GoogleGuest".

Change-Id: I3561431f41612e2a015082b2b80b72bf737b879d
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
d4f347f7de30834317dd1561dc806eccb1c4f277 17-Feb-2016 Peter Qiu <zqiu@google.com> Integrate SoftApManager to WifiStateMachine

Refactor WifiStateMachine to use SoftApManager for managing soft AP
instance. This consolidate all soft AP related states in WifiStateMachine
to a single SoftApState.

While there, fix number of existing issues in WifiController:
- fix a possible race condition in WifiController where it will
transition to a new state before AP is completely stopped. Currently it is
being worked around in WifiStateMachine by having the soft AP states defer
the commands that might be issued during this race window. This doesn't
really scale and not really clear to the reader. Fix it by only transition
out of ApEnabledState when AP is completely stopped.
- fix a bug in WifiController where it doesn't transition out of
ApEnabledState when AP is stopped internally (either tether notification
timed out or WiFi becomes untethered), results in WifiController and
WifiStateMachine being out of sync.
- fix couple unintentional fall through case statements.

Bug: 26876260
TEST=run frameworks-wifi test
TEST=run autotests

Change-Id: I1d12690b51265dacd087f22f601b7b0ea0a1082e
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
79a4204d12f32d2f6a4dfc8500f5e74718cabb8d 14-Jan-2016 Vinit Deshpande <vinitd@google.com> Unit test for WifiController's emergency mode behaviors

Change-Id: Ic3d8618501632d449bbd3432b95542ac92f336e4
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
090aa74f2d36010abba6563a39c87ab7ba8a7473 14-Jan-2016 Vinit Deshpande <vinitd@google.com> Allow turning off Wi-Fi when emergency call is made

Bug: 24147407

Change-Id: I52db1b34df318d0754b1c316806712a61fc3a1f5
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
1f8a91389bf7d03635c43df52ca73d353d5a5e94 20-Oct-2015 Pavel Zhamaitsiak <pavelz@google.com> Disable Portable Wi-Fi hotspot in ECM

Bug: 24147407
Change-Id: I254f6f70375774ea9de51be369f6b17437ba20ef
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
69a6102e30eabffefa7bfad6a4f016de8110013a 11-Aug-2015 Mitchell Wills <mwills@google.com> Allow SAP enable while STA is enabled (and restore on disable)

This moves the logic of remembering if wifi was enabled when enabling
softap to WifiController and restores the remembered state when
disabling softap.

Bug: 22729316
Change-Id: I83cfe587a0f9660aa3382c485f2f5cf7660af05c
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
588e4ba694aba1b5b34aa2596809d8fa80ecb59d 14-Jul-2015 xinhe <xinhe@google.com> Need to disable 5GHz bands for WiFi tethering in Japan
Also fix the wificontroller dose not update state if Softap
start failed. This will block further enable STA or
re-enable AP.

b/22396383

Change-Id: Idb920a79bba7078cda3493211fd4108560dd261d
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
8366a82ee1bff4c66d3f3642bf0a60538de5d9da 22-Apr-2015 Jan Nordqvist <jannq@google.com> Clearing ANQP cache when stopping WiFi service, moved ANQP result handling to DriverStartedState.

Change-Id: I8b9aa953cbf1309ff2d0174c8a23946b3f7086a8
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
7b160c8a00773246660caeae9e27090c83ed6ed5 16-Sep-2014 David Christie <dnchrist@google.com> Fix bug where wifi scan only mode is non-functional after toggling airplane mode.
Bug: 17507663

Change-Id: I0d77c2e29b78fdfa8e9f4be31181145cb29c1499
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
13494d0692330ed0f91e7f4e03805473773e7807 08-Mar-2014 Vinit Deshapnde <vinitd@google.com> Fix Airplane Mode + reboot interaction for Wifi

This change fixes two problems - first, if you rebooted phone after
turning on Airplane mode, Wifi controller goes to ScanOnly mode which
may end up in Wifi radio transmissions. Secondly, because of this
incorrect state, the state machine doesn't turn on Wifi once Airplane
mode is turned off.

bug: 11409692
Change-Id: I5fc23f6691bc063fda6be734103a5f11db970946
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
155b9d09ef9b8ead3ca617afdd91e74070d3f0cb 09-Jan-2014 Vinit Deshpande <vinitd@google.com> Revert "Revert "Move Wifi services to a new git project""

This reverts commit 862f81faba40e9af8fb80744a22e968a298e814e.

Change-Id: I7b15e266a5948749026e01a61d8581746cfd0f5f
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
862f81faba40e9af8fb80744a22e968a298e814e 08-Jan-2014 Vinit Deshpande <vinitd@google.com> Revert "Move Wifi services to a new git project"

This reverts commit a07c419913bfae2a896fbc29e8f269ee08c4d910.

Change-Id: I1cd35cea1594cdbeae800b9130bc6f885f238b28
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java
a07c419913bfae2a896fbc29e8f269ee08c4d910 18-Dec-2013 Vinit Deshapnde <vinitd@google.com> Move Wifi services to a new git project

Bug: 12175455
Change-Id: I1fa07e29c6a9aae38d9e334d519a9f2445d15613
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiController.java