Commit Graph

8 Commits

Author SHA1 Message Date
Arc Wang
7b1aded2a6 [Wi-Fi] Apply WifiTrackerLib objects in Wi-Fi Slice
This change uses WifiTrackerLib's WifiPickerTracker & WifiEntry
to replace SettingLib's WifiTracker & AccessPoint.

This change includes

1. WifiScanWorker has the callbacks similar to a lifecycle component
   but it's not a lifecycle component. Let WifiScanWorker implements
   LifecycleOwner and provides #getLifecycle() for WifiPickerTracker.

2. Remove captive portal related code because WifiEntry#connect will
   handle captive portal login if it's necessary.

3. Create WifiSliceItem to wrap WifiEntry because WifiEntry is an
   abstract object and it does not provide copy constructor.
   Without copy construcor, Wi-Fi Slice may show unexpected information
   when a WifiEntry is updated.

4. Use WifiTrackerLib's NetworkDetailsTracker & WifiEntry in
   WifiDialogActivity because it gets a WifiEntry key from Wi-Fi Slice.
   NetworkDetailsTracker can get the WifiEntry of th key.

Bug: 155613549
Bug: 152571756
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.slice
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I0718f4647cea007a9b701922f3121a388dd43918
2020-07-16 15:56:42 +08:00
David Su
6c6e77ed32 Rename removeDoubleQuotes to sanitizeSsid
Bug: 145745815
Test: compiles
Change-Id: Ic2fbb78b30d2c64d584cd94a79b2ed7e5e234440
2020-01-23 18:57:49 -08:00
Jason Chiu
fbf3d7574a Implement new design of Wi-Fi card
- always show Wi-Fi card
- collapse the card in the new UI session when connecting to a stable
  network
- hide toggle, show a level icon and subtext in the new collapsed mode
- show loading row when the AP list is not full

Test: robotest
Fixes: 147473096
Change-Id: I893064ef04d40d8e7cb8e62c1e72a2cb5e97f6ac
2020-01-21 17:26:29 +08:00
Jason Chiu
2c3e6c6434 Fix automatically directing the user to the captive portal in Wi-Fi Slice
The feature failed after the CL "Force the adapter to rebind cards with
a toggle".

Because toggle slices have been forced to rebind after starting another
activity and when any slice is updating. This unpins Wi-Fi slice and
stops WifiScanWorker and then clears the saved clicked network.

Solution:
1. Change ConnectToWifiHandler from activity to receiver and send
   broadcasts to it with FLAG_RECEIVER_FOREGROUND, so Wi-Fi slice won't
   be forced to rebind.
2. Seperate Wi-Fi scan worker and contextual Wi-Fi scan worker. Keep the
   original logic for the generic one, and then add the logic below to
   the contextual one.
3. Do not clear the saved clicked network when slice is unppined because
   it happens frequently in contextual homepage.
4. Introduce a static long in ContextualWifiScanWorker that updates once
   in every visible UI session. A session is when the screen is visible
   to user.
5. Use session token to determine whether auto-starting captive portal
   is needed.

Fixes: 128056349
Test: robotest, visual in homepage and network panel
Change-Id: I9e03c379806e124fa7253b2a635574b2433f6afc
2019-05-11 03:26:57 +00:00
Jason Chiu
6a6787cdc0 Add subtext for Wi-Fi items on Wi-Fi slice
- Sync the Wi-Fi slice items subtexts with Wi-Fi page, and add
  "Not connected" when the returned subtext is empty
- Wi-Fi slice header subtext just simply reveals on/off state
- Add a placeholder to the loading row to sync its height with other
  rows
- Show contextual Wi-Fi slice when the connected network is captive
  portal, is invalidated, or has limited connectivity

Bug: 130751985
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I0b2715295f00edc8dd7d6d75b7fdc18263675797
2019-05-03 16:18:42 +08:00
Jason Chiu
a73d7715d1 Automatically direct the user to the captive portal in Wi-Fi Slice
Save the SSID when the user clicks the network, and then automatically
start login page when the network gets the captive portal capability.

Fixes: 128056349
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: Ia25241a8243d7d6aae604f341b512350404d9fd1
2019-04-23 12:07:20 +08:00
Jason Chiu
8f6c06974c Add prompt to sign in at captive portal to Wi-Fi Slice
- Support signing in captive portal APs in WifiSlice
- Show ContextualWifiSlice when signing in is required
- Generifies SliceBackgroundWorker.getInstance() to return <T extends SliceBackgroundWorker>

Fixes: 128056349
Test: make RunSettingsRoboTests -j
Change-Id: Ib4d3942591a65e81018389e4c0bbddfea6854dbc
(cherry picked from commit dd9f92280b)
2019-04-04 16:51:02 +00:00
Jason Chiu
53d147dd5c Refactor WifiScanWorker
Extracted WifiScanWorker from WifiSlice

Bug: 128056349
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.slices
Change-Id: I9b3c809ee6c2b7466c959631840b257b91b49d88
2019-04-01 16:40:59 +08:00