Commit Graph

15 Commits

Author SHA1 Message Date
Arc Wang
a12b372dd2 [Wi-Fi DPP] Refine code
Remove unused code.
Rename some variables and methods for better readability.
Fix typos.
Reduce unnecessary variable scope and method scope.
Simplify some code logic.

Bug: 120645817
Test: atest com.android.settings.wifi.dpp
Change-Id: I8f30b3e445f25ada927e995befee1783d2270b91
2019-07-19 10:29:06 +08:00
Arc Wang
4a5ff58511 Supports to share Wi-Fi networks of WPA3 security SAE & OWE via QR code generator
When scanned a no password ZXing QR code, add both open network &
enhanced open network to configured Wi-Fi network list because this kind
of QR code may refer to a open network or an enhanced open network.

Bug: 124131581
Test: manual
Change-Id: Id9f85ef8dcdf72347be8106938437aecd0eed9f5
2019-04-09 10:36:07 +08:00
Arc Wang
b249fb7d13 Support to share Wi-Fi hotspot via QR code
1. QR code scanner (Wi-Fi Easy Connect) does not support sharing Wi-Fi hotspot
   at current stage
2. Wi-Fi hotspot QR code button only shows when Wi-Fi hotspot is enabled
3. The QR code has the security string "WPA" for hotspot's WPA2_PSK

Bug: 123151660
Test: atest WifiTetherSSIDPreferenceControllerTest
            WifiQrCodeTest WifiDppConfiguratorActivityTest
            WifiDppEnrolleeActivityTest
            WifiDppQrCodeGeneratorFragmentTest
            WifiDppQrCodeScannerFragmentTest
            WifiNetworkListFragmentTest
            WifiDppChooseSavedWifiNetworkFragmentTest

Change-Id: I2e89450180b82cc841ee3b15be52bfc6f9f6164d
2019-03-08 11:48:12 +08:00
TreeHugger Robot
6e245f4736 Merge "Fix Settings crash after clicking 'Share Wi-Fi' button" 2019-02-27 07:06:38 +00:00
Arc Wang
730a6c0f5e Fix Settings crash after clicking 'Share Wi-Fi' button
When connecting to an open network, Settings crash after
scanning Wi-Fi DPP QR code and clicking 'Share Wi-Fi' button.

When choosing default network for configurator usage, should
make sure if it supports Wi-Fi DPP or not.

Bug: 126456582
Test: manual test
      atest WifiQrCodeTest
            WifiDppConfiguratorActivityTest
            WifiDppEnrolleeActivityTest
            WifiDppQrCodeGeneratorFragmentTest
            WifiDppQrCodeScannerFragmentTest
            WifiNetworkListFragmentTest
            WifiDppChooseSavedWifiNetworkFragmentTest

Change-Id: I66ee9b01314b84213ecb3016e6e72ff71af8dfc7
2019-02-27 11:33:43 +08:00
Arc Wang
13f37337ed Improve UX of Wi-Fi QR code scanner enrollee flow
1. Do not start WifiSettings after enrollee success
2. Return WifiConfiguration to the calling object after enrollee success
3. In WifiDialog, do not show scan button if Save button is not visible to users
4. Fix scanner button may not respond problem by setting listener for scanner
   button of ssid field and password field
5. If SSID is assigned, only allow to enrollee for the network of assigned SSID

Bug: 124416152
Test: manual test
Change-Id: Ic5241c4767eaa8ea01782817d8302d8b0572ab36
2019-02-23 11:59:53 +08:00
Arc Wang
8de242ada6 Wi-Fi DPP code refine
1. call Activity#setResult only for RESULT_OK case
2. refine @VisibleForTesting usage
     remove redundant assignment otherwise = PRIVATE
     set all @VisibleForTesting annotated methods package scope
3. rename WifiQrCode#SECURITY_WPA to WifiQrCode#SECURITY_WPA_PSK

Bug: 120645817
Test: atest WifiQrCodeTest
      atest WifiDppConfiguratorActivityTest
      atest WifiDppEnrolleeActivityTest
      atest WifiDppQrCodeGeneratorFragmentTest
      atest WifiDppQrCodeScannerFragmentTest
      atest WifiNetworkListFragmentTest
      atest WifiDppChooseSavedWifiNetworkFragmentTest

Change-Id: Id5de7eadc73185716422fc0d197f82bdd025ce45
2019-01-29 17:33:45 +08:00
Salvador Martinez
2611190def Update configurator intent to be public
This updates the settings code to use the public intent instead.

Test: tests still pass
Bug: WIP
Change-Id: Id40f60b4c2209073aef8747faa5de4e7ff9692ae
2019-01-28 12:33:30 +08:00
Arc Wang
cfa78006a0 Filter out unsupported security type for DPP configuration.
There is different Wi-Fi security support between ZXing's Wi-Fi QR code
format and Wi-Fi DPP QR code format.

  ZXing's Wi-Fi QR code format: supports WEP / WPA / none security
  Wi-Fi DPP: supports WPA / SAE

So we will have different UI behavior for different security.

  WEP & none security: only support QR code generator
  WPA: supports both QR code generator & scanner
  SAE: only supports QR code scanner
  others: don't support. The share button is invisible

Bug: 123212410
Test: manual test
Change-Id: I87962d730282fc2c1b96223dca6feb79235fe5a1
2019-01-25 14:22:08 +08:00
Arc Wang
dcf3f2906f Fix Wi-Fi DPP activity crash after configuration change.
Both QR code and Wi-Fi network data may not come from intent.
After configuration change, the null data will crash the activity.

Bug: 120243131
Test: atest WifiDppConfiguratorActivityTest
Change-Id: I6abbfc5d25431789e8ac9f6ee9dfaaef15b2de33
2019-01-10 12:22:56 +08:00
Johnson Lu
7bdf8b3d37 Implement Wi-Fi DPP flow
1. As DPP configurator initiator.
2. As DPP enrollee initiator.
3. Pass whole DPP url to DPP API due to API cahnged.

Bug: 122331217
Test: manual test
Change-Id: I8005b78b82453badf253dbde8022ff20722b39fd
2019-01-08 13:42:42 +08:00
Arc Wang
cc8212edf6 Add connect() method in WifiNetworkConfig to connect Wi-fi.
This method uses data of ZXing Wi-Fi QR code to connect.

Bug: 118794978
Test: manual test
Change-Id: I249f2f638c8d2fe231c50ba50eae8dfc0dc40a5c
2019-01-02 06:08:09 +00:00
Johnson Lu
7414543635 Show QR Code picture for WiFi sharing
Bug: 118794858
Test: make RunSettingsRoboTests
Change-Id: Ic5a489840ba59262eb444f02d77bf066889a4220
2018-12-27 09:55:44 +08:00
Arc Wang
e1b6712926 Implement QR code parser WifiQrCodetest.
The parser supports standard WI-Fi DPP QR code & ZXing reader library's
Wi-Fi Network config format.

Bug: 118797380
Test: atest WifiQrCodetest
      atest RunSettingsRoboTests

Change-Id: Ia47b8f65a900099749a6aa24afa3abd21ede1582
2018-12-20 15:12:34 +08:00
Arc Wang
e43bb77e5d Use multiple actions to launch Wi-Fi DPP configurator with different mode.
Bug: 118797380
Bug: 118794858
Test: atest WifiDppConfiguratorActivityTest
      atest WifiDppQrCodeScannerFragmentTest
      atest atest RunSettingsRoboTests

Change-Id: I96aba3c5e3d57c89d6948d3bf3dd85f29f705778
2018-12-04 11:46:37 +08:00