Do not set config netId to argument netId in WifiServiceImpl#connect
WifiServiceImpl#connect() takes both a config and netId as arguments.
Usually the config argument is used when connecting to a new network,
and so the netId argument is INVALID_NETWORK_ID and the config SSID is
used to create the new internal config. If Settings tries to update and
connect to a saved config, then only the config's networkId is set
(null SSID) and the argument netId is INVALID_NETWORK_ID. By copying
the argument netId to the config netId, the config will have neither
SSID nor netId to match the internal config, and the config will not
be updated. Thus the config networkId and the netId argument should
remain separate.
Bug: 194634022
Test: atest WifiServiceImplTest, CTSVerifier -> Device Owner Tests ->
Wifi configuration lockdown, verify that wrong password is updated when
tapping on wrong password network and entering correct password in wifi
picker.
Change-Id: If85521d0d5e698d807234213e86e7fc265ee9cbd
2 files changed