Commit Graph

32 Commits

Author SHA1 Message Date
Chiachang Wang
0f40c023f6 Replace NetworkUtils methods
NetworkUtils is moved to connectivity mainline module which is
not accessible for module outside. getNetworkPart() method is
used by wifi lib and Settings but no usage inside the module,
so move the method to framework lib to share with wifi lib and
Settings.

Also, NetworkUtils.numericToInetAddress() method is also hidden
and deprecated. It should be replaced by
InetAddresses.parseNumericAddress().

Update the corresponding usage to refer to these methods.

Bug: 172183305
Test: atest SettingsRoboTests
Change-Id: I8240b1c74b53d5d66850d9a3ec7d5e5c11558e6a
Merged-In: I2fb674e0d7da0b11ba70177853fd6259bce372a3
2021-02-22 15:35:17 +08:00
Arc Wang
20680c254c [Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default route
This change shows Pie+x Wi-Fi icon in Wi-Fi Details for a connected Wi-Fi
network which is not the default network when

  1. It's connection speed quality is bad.
  or
  2. It has certain internet connection problem.

Bug: 163627176
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiDetailPreferenceController2Test
      manual visual
Change-Id: I1f102471426a55c7dabd9110afba20f802abedbe
2020-08-28 11:43:55 +08:00
Arc Wang
2df3a3e7df [Wi-Fi] Support multi-SIM for SIM dependent EAP methods
Before this change, users are not able to choose SIM
card for SIM dependent EAP methods when a device supports
multi-SIM.

This change support to choose a SIM when adding an EAP
Wi-Fi network. And this change support to show the related
SIM information on Wi-Fi detail screen.

Bug: 142792009
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.WifiConfigControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.WifiConfigController2Test
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.details2.WifiDetailPreferenceController2Test
      Manually add an EAP Wi-Fi network of EAP-SIM type, observe the
      value in Wi-Fi detail screen.
Change-Id: I2910931166dc6541897663857c46abcc1b3115fa
2020-07-28 10:02:16 +08:00
Arc Wang
cef7d97031 [Wi-Fi] Fix MAC address title information display bug
Use WifiTrackerLib, we can use WifiEntry.getPrivacy()
to get the value for a Passpoint network.

Bug: 159672621
Test: manual visual
      Switch Privacy setting in Wi-Fi detail page, observe
      MAC address title.
Change-Id: I5411e727c5f48dc0d65a05706194569ca3bbebdc
2020-06-23 18:27:51 +08:00
Quang Luong
0ddc3675c4 Remove Connect/Disconnect button dependence on WifiEntry.isExpired()
WifiEntry.canConnect() may be true even if isExpired() is true, such as
in the case of connecting to renew a subscription. Thus, the
connect/disconnect button should only rely on canConnect() and
canDisconnect() (as well as the intermediate state of connecting) to
determine its visibility.

Bug: 150384136
Test: manually install expired passpoint profile and verify if the
connect button is visible and working.

Change-Id: Ibfdf285f3b97fd0de88804d4658df20bd67bf8e0
2020-04-30 20:36:32 -07:00
Arc Wang
c6c4d036da [Wi-Fi] Add IMSI privacy protection warning summary
If a SIM based Wi-Fi network is not provided with IMSI
protection, Wi-Fi detail UI shows the warning summary if
the Wi-Fi network is connected.

Bug: 148283447
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiSecondSummaryController2Test
      make RunSettingsRoboTests ROBOTEST_FILTER=LinkifySummaryPreferenceTest

Change-Id: I689a75d2f0a2ae6196b2ed5985b8ff141fbac8b4
2020-04-23 14:50:18 +08:00
Alex Johnston
d1a31ab6b3 Update Wi-Fi configs restrictions
* Update isNetworkLockedDown in WifiUtils
  to check the profile owner if the device
  is an organization-owned managed profile
  device.
* Update the logic to check if a Wi-Fi
  network can be forgotten (for both the
  device owner and profile owner of an
  organization-owned device).

Bug: 150197944
Bug: 153605361
Test: manual testing
      make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiDetailPreferenceController2Test
      make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiUtilsTest

Manual Testing Steps
A. Provision TestDPC in 'Device Owner' mode.
   - Create a Wi-Fi config in TestDPC.
   - Enable 'DO created Wi-Fi configs are
     modifiable only by DO'.
   - Go to Settings and verify that the network
     created cannot be modified and the 'Forget'
     button is not displayed.
B. Provision TestDPC in 'Profile Owner of an
   organization-owned managed profile' mode.
   - Create a Wi-Fi config in the work profile
     instance of TestDPC.
   - Enable 'DO created Wi-Fi configs are
     modifiable only by DO'.
   - Go to Settings and verify that the network
     created cannot be modified and the 'Forget'
     button is not displayed.
C. Provision CtsVerifier in 'Device Owner' mode.
   - Go to 'Device owner tests' > 'Wifi
     configuration lockdown'.
   - Create a Wi-Fi config then follow the
     instructions.

Change-Id: Ie3c71113441a3aca62563310ad0e53d89fa04226
2020-04-20 12:25:47 +01:00
TreeHugger Robot
56fb482acf Merge "Fix Passpoint network details privacy and ssid" into rvc-dev 2020-03-25 01:04:47 +00:00
Quang Luong
40c4303fb3 Fix Passpoint network details privacy and ssid
Allow changing the privacy setting for Passpoint networks, which are
considered subscriptions but not saved networks. Also use getSsid() for
the SSID pref.

Bug: 70983952
Test: manual build and visual verification
Change-Id: I8a4309421b28bccaf2bd62a23dca8cef133d5af1
2020-03-23 21:11:41 -07:00
Arc Wang
263930d8b4 [Wi-Fi] Fix ignored tests in WifiDetailPreferenceController2Test - I
Some tests are removed because WifiTracerLib listens to most intents
and callbacks to Settings APP, most of the receiving intent tests are
removed.

Bug: 151696220
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiDetailPreferenceController2Test
Change-Id: Id88a5c9276457e329840e72711bd06e51a03dd1f
2020-03-23 09:42:35 +08:00
Arc Wang
b8fb854e98 Merge "[Wi-Fi] Add STA+AP information in Hotspot & tethering footer" into rvc-dev 2020-03-11 04:00:49 +00:00
Quang Luong
bff2347964 Merge "Fix Tx link speed still showing after disconnecting from wifi network" into rvc-dev 2020-03-11 00:31:29 +00:00
Arc Wang
005fe6951c [Wi-Fi] Add STA+AP information in Hotspot & tethering footer
Use WifiManager#isStaApConcurrencySupported() to check if a
device supports STA+AP and shows the footer information.

Bug: 121328949
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TetherSettingsTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherFooterPreferenceControllerTest
Change-Id: I3446abb5cc9cdf76da8d17f5de31bd65715c165c
2020-03-10 18:15:13 +08:00
Quang Luong
d0a22bd699 Fix Tx link speed still showing after disconnecting from wifi network
Make sure the tx link speed preference in the Network Details page
disappears when the network is disconnected.

Bug: 151126855
Test: manually going to network details page and disconnecting and
verifying that the link speed disappears.

Change-Id: I3dfd66085db987535c201d38961e4bca709752c9
2020-03-10 00:09:52 -07:00
govenliu
a22a457750 [Wi-Fi] Apply WifiEntry onUpdate to support refresh WiFi detail page for OpenRoaming feature.
Issue: The preference UIs status didn't chage dynamically.
Solution: update the preference UI status when onUpdated is called.

Bug: 146669261
Test: 1.manually mofidy framework to test.
      2.The getAvailabilityStatus() already tested in
      WifiSubscriptionDetailPreferenceController2Test.
Change-Id: I51b5e67df7998d7d3e9ede9ead7aa49ad574c7a3
2020-03-03 17:26:46 +08:00
govenliu
7d8d8d3400 [Wi-Fi] Apply new mock for supporting WiFi detail page for OpenRoaming feature.
Issue: Openroaming detail page have new UI Mock.
Solution: Apply the mock design to rollback previous UI and add one Subcription preference.

Bug: 146669261
Test: manually push API and check.
Change-Id: Ie3243c9bcd371db1909834ef257c741454abec11
2020-02-24 15:40:23 +08:00
govenliu
824796d3b2 [Wi-Fi] Support WiFi detail page for OpenRoaming feature in AOSP setting.
Issue: Openroaming should have a specific detail page.
Solution: Apply the mock design to only reserve two preference items:
          1.Auto-connect
          2.Scription details

Bug: 146669261
Test: Add unit test case to test the new controller: WifiSubscriptionDetailPreferenceController2
Change-Id: Iba96500062f412f4cdcd1c8248544657770ab231
2020-02-19 22:22:47 +08:00
lucaslin
4ef8ec0e4c Add capport info to WiFi details(WifiDetailPreferenceController2)
Session expiration time and venue webpage can be obtained through the
captive portal API.

Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=WifiDetailPreferenceController2Test
      (Since WifiDetailPreferenceController2Test is ignore now,
      there is no test will be run in
      WifiDetailPreferenceController2Test)
Bug: 139269711
Change-Id: I80b93689539c6ba5edafa3d0029376deca7ac1f7
2020-02-19 17:31:41 +08:00
Arc Wang
5b42e7e5b2 [Wi-Fi] Update android R strings
For these features:
1. No user certificate for WPA-Enterprise 192-bit
2. Apps to add saved networks
3. Disconnect network

Bug: 149070448
Bug: 149069854
Bug: 148281247
Test: manual visual
Change-Id: I8ad9741446c93bd75142c612c6ca67a57f2cf9e2
2020-02-10 10:32:07 +08:00
Arc Wang
e16ce3dcea [Wi-Fi] Hide Connect button when passpoint is expired
If the passpoint is connected and expired, we still show
Disconnect button.

Bug: 148317997
Test: manual
      Observe a connected passpoint and see Disconnect button.
      Observe a disconnect passpoint and see no Connect button.
      Should add test case in WifiDetailPreferenceController2Test
      at later CL.

Change-Id: I07f22804eccce80c44ac709412cb594faaf6ccb0
2020-01-31 17:06:29 +08:00
Arc Wang
f591fe0901 [Wi-Fi] Remove passpoint methods in WifiEntryShell
Bug: 143326832
Test: build
Change-Id: I9d21909f18df03d50f69447c3f2014b75ecd2d8b
2020-01-31 15:19:35 +08:00
Arc Wang
33c6e65371 [Wi-Fi] Replace WifiEntryShell#getSecurityString with WifiEntry#getSecurityString
Bug: 143326832
Bug: 146407136
Bug: 147781156
Test: manual
      Check if security information correct

Change-Id: I32c247763783a38fed14eb06de863d9819cd6bdd
2020-01-17 17:12:05 +08:00
Arc Wang
9ac285cfac Merge "[Wi-Fi] Replace some WifiEntryShell methods with WifiEntry version" 2020-01-06 02:01:13 +00:00
Arc Wang
08b4204643 [Wi-Fi] Replace some WifiEntryShell methods with WifiEntry version
These WifiEntryShell methods are removed:

getNetworkId
hiddenSSID
isPasspoint

Bug: 143326832
Test: build
Change-Id: I6642992a90ea18328817cb58931cc370045b1e56
2020-01-02 18:11:32 +08:00
Arc Wang
3971d4e0c4 [Wi-Fi] Support disconnect button for connected Wi-Fi AP
Connect button becomes Disconnect button if the Wi-Fi AP
is connected.

Bug: 135891885
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiDetailPreferenceController2Test
Change-Id: I0e0d485385294658170da3d37bc1cc1f8748468f
2019-12-31 17:06:44 +08:00
Arc Wang
d5ec80afc5 [Wi-Fi] Split WifiEntryCallback into separate callbacks for each action
This change uses splitted WifiEntry callbacks.

Bug: 70983952
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I3b8e55b11d4f71e5548b4da82104dac1f5089b1b
2019-12-31 15:00:24 +08:00
Quang Luong
942af81d73 Merge "[Wi-Fi] Sync Connect button UI with WifiEntry connected state" 2019-12-30 06:02:23 +00:00
Arc Wang
b33190c017 [Wi-Fi] Replace AccessPoint with WifiEntry for WifiDialog2
Bug: 146407136
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.detail2

Change-Id: I65899b24c186e1bd1bb0d00db52c67264f30f3cb
2019-12-26 14:45:38 +08:00
Quang Luong
f07f79988d [Wi-Fi] Sync Connect button UI with WifiEntry connected state
The Connect button in the Network Details Page should be synced to the
connected state of WifiEntry and should toggle between not visible,
"Connect", and "Connecting..." accordingly.

Bug: 70983952
Test: manual - connect to in-range saved network through Network Details
page

Change-Id: Id34a840dd81fb99c8e64ad219b0b7af73946c1bf
2019-12-19 15:57:38 -08:00
Arc Wang
ce5e7a4626 [Wi-Fi] Launch WifiNetworkDetailsFragment2 for a connected Wi-Fi network
This change also remove redundant code of WifiNetworkDetailsFragment2
from WifiSettings.

Bug: 143326832
Test: Manual
      Click connected Wi-Fi network and check the UI of
      WifiNetworkDetailsFragment2
Change-Id: Id72c26116177f8e7063e433a6456557bd36c7927
2019-12-18 07:23:14 +00:00
Arc Wang
b60e91bf0b [Wi-Fi] Replace WifiTracker with WifiTracker2 in WifiDetailPreferenceController2
There are still many methods not implemented in WifiEntry. This change has below workarounds:

1. Add WifiEntryShell to provide dummy WifiEntry methods.
2. Add @Ignore to WifiDetailPreferenceController2Test.

Must remove these workarounds after we have more constructed WifiEntry methods.

Bug: 143326832
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.details2
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.savedaccesspoints2
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: Ic2edb424b9c645838558fe131991ccb9105dc64c
2019-12-18 15:21:59 +08:00
Arc Wang
75dc89b122 [Wi-Fi] Create WifiNetworkDetailsFragment related version 2 files for WifiTracker2 development
Create below version 2 files for WifiTracker2 development, we can
check the feature flag only a few times and easily remove version 1
files in the future.

    src/com/android/settings/wifi/details2/
    src/com/android/settings/wifi/savedaccesspoints2/
    tests/robotests/src/com/android/settings/wifi/details2/
    tests/robotests/src/com/android/settings/wifi/savedaccesspoints2/

Bug: 143326832
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi.details2
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi.savedaccesspoints2

Change-Id: I4d2caf1ce313871605252395764b02747240f217
2019-11-15 14:41:23 +08:00