Commit Graph

31 Commits

Author SHA1 Message Date
Chaohui Wang
f55f9932d9 Remove lifecycle-extensions from Settings
Bug: 259352947
Test: Make Settings
Change-Id: Ide9749494ae89ca401120eb5ffee9c0d87043c48
2022-11-16 18:56:05 +08:00
Etan Cohen
245ced4b78 [DPP] Fix intent dispatching
Bug: 139381558
Test: verified with test app WifiEasyConnect.apk
Change-Id: If0588695b591e7ba5ba664586813c4a264a9779e
2020-01-15 17:43:14 +00:00
Hai Shalom
457203e156 [DPP R2] Update ACTION_PROCESS_WIFI_EASY_CONNECT_URI intent
Update ACTION_PROCESS_WIFI_EASY_CONNECT_URI intent to include
additional information in case of a failure. The intent will
return an extra field with result code for R1 and R2 devices,
and additional details for R2 devices: SSID, channe list,
and band list.

Bug: 139381558
Test: Manual test
Change-Id: I6f1805f3b1ff72efc83961083c1311a24d6ebd3e
2019-12-25 20:06:38 -08:00
Hai Shalom
38ab4d342b [DPP R2] Added support for DPP R2 events
Added support for DPP R2 events that provide additional
details about the onboarding process of a remote enrollee.
Specifically, DPP R2 configurator waits for response from
the enrollee, which reports back the SSID, tried channels
and band support in case it cannot find the AP. When it
reports success, then it means that it is acutally connected.

Bug: 139381558
Test: Manual tests with DPP R1 and R2 enrollees
Test: atest DppManagerTest
Test: act.py -c ../WifiDppConfig.json -tc WifiDppTest
Change-Id: If19fc6906ec5abbdceef0742dc52b42c7d0acfe0
2019-12-19 17:57:41 -08:00
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
1df7f2d1c1 [Wi-Fi DPP] Improve TalkBack information for events
Title and summary may be changed after user operations or Wi-Fi Easy connect handshake,
setAccessibilityLiveRegion could specify accessibility services to announce these changes.

In WifiDppAddDeviceFragment, I set title before summary for correct TalkBack announce sequence.

Bug: 137069941
Test: manual
Change-Id: Id032cfcb86c350feeac808f070665ac26261ceb8
2019-07-09 17:30:01 +08:00
TreeHugger Robot
8d51b1b4e8 Merge "[Wi-Fi DPP] Improve Wi-Fi QR code error messages" 2019-06-19 10:05:45 +00:00
Arc Wang
c7d32d1cc1 [Wi-Fi DPP] Fix UI defects
1. Set scan icon minWidth 64dp instead of 48dp
2. Show finish button after Wi-Fi Easy Connect handshake successfully

Bug: 129666609
Bug: 135490433
Test: manual visual
Change-Id: Ifcdbe61b314a9cce3043965e9e5b67406c4616f9
2019-06-18 09:52:25 +08:00
Arc Wang
d2dc5438fa [Wi-Fi DPP] Improve Wi-Fi QR code error messages
Give all failures of Wi-Fi QR code format or data problem
with a correct error message.

Bug: 134033509
Test: manual visual
Change-Id: I5259d0d68e47d00a69e3e8107697605f3f187203
2019-06-13 16:24:14 +08:00
Arc Wang
8e3c49123d [Wi-Fi DPP] Refine Wi-Fi DPP UI layouts with SUW library
1. Use GlifLayout in all fragments
2. Fragments use 32dp icon instead of 48 dp
3. Replace ScrollView & ProgressBar & Header & Footer of original layout with GlifLayout design
4. Remove ActionBar (no more back button on screen top)

Bug: 129021867
Test: manual
Change-Id: I2fda48cb7f7819b2c8dd85c10d39e1f187463bd8
2019-05-21 13:59:39 +08:00
Arc Wang
70e3580f5d Fix [a11y] Wi-Fi Easy Connect Talkback issues
1. Remove android:contentDescription from ButtonPreference layout file
   'wifi_button_preference_widget.xml' because it should be a more
   general purpose component. Add ButtonPreference#setButtonContentDescription
   for this change.
2. Add a LinearLayout to group title & summary for better Talkback UX
3. Set android:contentDescription for Wi-Fi enrollee scan button
4. setTitle for Talkback actionbar back button of WifiDppQrCodeGeneratorFragment &
   WifiDppQrCodeScannerFragment
5. Auto trigger Talkback to speak title & summary in WifiDppAddDeviceFragment &
   WifiDppChooseSavedWifiNetworkFragment
6. Auto trigger Talkback to speak summary change in WifiDppAddDeviceFragment
7. Auto trigger Talkback to speak error message in WifiDppQrCodeScannerFragment

Bug: 126007405
Bug: 124424996
Bug: 124424445
Test: manual test

Change-Id: I54a3f033bb8871c47be12115ae8f97691fd83302
2019-03-08 12:05:50 +08:00
Arc Wang
957ce7f7aa Update strings for Wi-Fi DPP handshake running state
Bug: 125987679
Test: manual test
Change-Id: I55eddee5f3c0c28d1be23b5b9d8c0b56280be797
2019-02-25 15:06:16 +08:00
Arc Wang
8826721803 Add progress bar for Wi-Fi DPP handshaking
Bug: 124127483
Test: manual test
Change-Id: I1c3da5bab98da57ca8cf10509f339e99b01ebdbf
2019-02-22 11:42:08 +08:00
Arc Wang
7bdcadbe72 Handle different error codes in DPP
Show error message for corresponding Wi-Fi DPP error code. And

1. To update error message only from each fragment,
   remove some callbacks which calls from fragment to activity.
2. After clicking 'Share Wi-Fi' button, hide it before Wi-Fi DPP handshake completes.
3. Show 'Done' button for some error codes.
4. Use ViewModel to call startEasyConnectAsConfiguratorInitiator and
   startEasyConnectAsEnrolleeInitiator because a lifecycle object
   does not receive an Executor callback after configurator change.
5. In WifiDppQrCodeScannerFragment, show an error message for 10s instead of 2s
   since new added error messages may carry more information.
6. Show a different error message for enrollee handshake success but Wi-Fi
   connection fail case.
7. stop camera when scanned a Wi-Fi DPP QR code for enrollee.
8. In QR code scanner fragment, support to show error message after
    configuration change.

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

Change-Id: Id130215e9ddafac8bc4c68238deda48ce99b4255
2019-02-20 14:28:52 +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
Arc Wang
4ab826ac5b Set Wi-Fi DPP fragment icons.
1. set fragment icon for WifiDppChooseSavedWifiNetworkFragment
2. set fragment icon of success for WifiDppAddDeviceFragment

All Wi-Fi DPP fragment icons are VectorDrawable of instinct size
24dp draw on a 48dp canvas. Except for ic_devices_check_circle_green,
it's a LayerDrawable of different size. I dynamically change ImageView
layout width & height between these 2 different kind of drawable.

Bug: 122982132
Test: manual test
Change-Id: Idab8cd8b0798363e447da00dc6bc68a86498b8be
2019-01-29 17:02:14 +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
bf1fb10999 Add icons of WifiDppAddDeviceFragment.
Bug: 118797202
Test: manual test
Change-Id: Ia2ef9db3526f98b1c697a864cec34e1d4dcfc400
2019-01-22 16:27:23 +08:00
TreeHugger Robot
32d561653c Merge "Add a picture for Wi-Fi DPP add device fragment." 2019-01-21 04:58:35 +00:00
TreeHugger Robot
abd732a308 Merge "Update parameter for Easy Connect API in WiFi DPP flow" 2019-01-19 04:33:21 +00:00
Johnson Lu
1e8a21f258 Update parameter for Easy Connect API in WiFi DPP flow
Due to API changes, uses Executor instead of Handler for Easy Connect
API.

Test: manual test
Bug: 122331217
Change-Id: Iddda3e6c9079e2bba814be6a0097d60ee349a504
2019-01-18 07:17:55 +08:00
Arc Wang
e05fae643c Add a picture for Wi-Fi DPP add device fragment.
Bug: 122429170
Test: manual
Change-Id: I8a2e9feab238aa2636be25959988145ac8633c24
2019-01-17 23:04:37 +00:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Hai Shalom
e046e8af2a [DPP] Fix usage of "DPP" public API to "Easy Connect"
All DPP public API and constants renamed to use Easy Connect,
which is the WFA public technology name. Update the settings code to use the
new API names.

Bug: 122851551
Test: atest DppManagerTest
Test: act.py -c ../WifiDppConfig.json -tc WifiDppTest
Change-Id: Ib531393a81526c468c978e31f1c62c5022245d55
2019-01-14 15:49:59 -08:00
Arc Wang
a7d51370c8 Implement Wi-Fi DPP flow
1. Wi-Fi DPP hanshake fail UI
2. Show Wi-Fi DPP QR code information field on WifiDppAddDeviceFragment if it's available.
3. Click 'Choose Different Network' button will show WifiDppChooseSavedWifiNetworkFragment
4. After QR code scanner scans success, WifiDppConfiguratorActivity caches WifiQrCode instead
   of just a QR code string

Bug: 122429170
Test: manual test
Change-Id: I1ce1b014ff86903b5a7a8f3575cc98eb1079583c
2019-01-10 12:09:58 +08:00
Arc Wang
8eda83d071 Add more Wi-Fi DPP UI features.
1. Use ConstraintLayout to fix footer buttons at bottom
2. ScrollViews have all other UI components excepts footer buttons
3. Use style/SuwGlifButton for buttons
4. Fix scan fragment crash when rotating screen

Bug: 118794978
Test: manual test
Change-Id: I509b0156c4835c75da75fb7ac4c82f55a0b506a1
2019-01-09 18:25:31 +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
c8cd5d3834 Add more Wi-Fi DPP UI features.
1. Update strings and icons.
2. Add more UI features in WifiDppAddDeviceFragment &
   WifiDppChooseSavedWifiNetworkFragment.

Bug: 118794978
Test: manual test
Change-Id: I2bee3f66732a1083fb13c113695899272e98c23e
2019-01-04 12:17:02 +08:00
Arc Wang
221b7e0b77 Refine Wi-Fi DPP fragments.
1. WifiDppQrCodeBaseFragment only declairs common UI components between fragments.
2. Initiate UI components in onViewCreated of each View.
3. Remove the only one usage of @NonNull since it should be used consistently
   throughout the class if we want to use it.
4. Use android.R.id for icon/title/summary

Bug: 120645817
Test: atest WifiDppConfiguratorActivityTest
      atest WifiDppEnrolleeActivityTest
      atest WifiDppQrCodeGeneratorFragmentTest
      atest WifiDppQrCodeScannerFragmentTest

Change-Id: I54f99a3072533cec46f0e47753ee0331fecf2ada
2019-01-02 07:13:10 +00:00
Arc Wang
c8a65cbddf Support Wi-Fi DPP metrics categories in Wi-Fi DPP activities & fragments.
MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR
  MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_ENROLLEE

Bug: 118797380
Bug: 118794858
Bug: 118794978
Test: NA
Change-Id: I62fe09029d350fa976465ac872a4f53a64a74dcd
2018-12-14 08:16:52 +00:00
Arc Wang
f5d6089d35 Upload basic UI files for Wi-Fi DPP Settings development II.
Add 3 fragments:

  WifiDppQrCodeGeneratorFragment
  WifiDppChooseSavedWifiNetworkFragment
  WifiDppAddDeviceFragment

Bug: 118797380
     118797202
     118794978
     118796825
     118794858
Test: atest WifiDppConfiguratorActivityTest
      atest WifiDppQrCodeScannerFragmentTest
      atest atest RunSettingsRoboTests

Change-Id: I2fbc2f46f941d49b63e4ac74d92f94bf617d2b9b
2018-11-29 07:11:29 +00:00