Commit Graph

49 Commits

Author SHA1 Message Date
Quang Luong
29bc66a352 Use WifiEntry.getStandardString() for Wi-Fi Type summary
Bug: 222337006
Test: manually verify NetworkDetails page shows Wi-Fi Type
Change-Id: I4576fe083f87f631c5f98c526422544055a9df20
2022-03-31 10:40:02 -07:00
Weng Su
0b82d67a04 wifi data usage: Query wifi usage per configuration
- Updated to use the AllNetworkKeys set instead of NetworkId.

- Fix crash issue when mDataUsageController is not created.

- See b/126299427#comment37 for a screenshot.

Bug: 126299427
Test: manual test
make RunSettingsRoboTests
ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiDetailPreferenceController2Test
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiDataUsageSummaryPreferenceControllerTest

Change-Id: I26289fde1f18d97631448edc71e034d33b865cc4
2022-02-11 06:32:04 +08:00
Weng Su
e8a4e13a80 Add new ACTION_WIFI_DETAILS_SETTINGS to Settings
- Need to export the interface to Quick Settings to launch Wi-Fi Network
details settings.

- Rename WifiNetworkDetailsFragment.class

Bug: 191475923
Test: manual test with the topic CLs.
make RunSettingsRoboTests
atest -c SettingsUnitTests:com.android.settings.wifi \
         SettingsUnitTests:com.android.settings.network

Change-Id: Id2fd8c9b3b113ffbb49168305b05c67392fa4d87
2021-07-19 09:29:33 +00:00
changbetty
5a23ca7c21 Disable EntityHeaderController animation for item move down issue
EntityHeaderController include the RecyclerView and it has animation by
default. When RecyclerView do the animation first then update the UI, it
will cause the issue.

Bug: 189071671
Test: manaul test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiDetailPreferenceController2Test

Change-Id: Ieb7e0a8f7658bface9af090ea061ca7265099fcd
2021-06-10 17:37:16 +08:00
Quang Luong
1c7ba38627 Add 6 GHz Wifi band to Wifi Network Details
Display 6 GHz for the frequency pref in Wifi Network Details
when connected to a 6 GHz network.

Bug: 184170532
Test: build
Change-Id: I7d10fe0e4c95e6f0ec66c3a179c3c46828eeb545
2021-06-07 11:30:07 -07:00
Weng Su
91ac1eb149 [Provider model] Update the Wi-Fi icons in the Settings
- Use the same Wi-Fi icons between "Network details" Settings and
Internet Panel

Bug: 188660580
Test: manual test
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiDetailPreferenceController2Test

Change-Id: Icefc08eb47d2d573e26ff82b6a141cf55ce787c5
2021-05-26 21:50:55 +08:00
Quang Luong
8f421b2dbf Refresh security pref in Network Details page
Security type of WifiEntry may change based on available
scans/configs/the current connection for entries that can support
multiple security types. Refresh the security string every time the
WifiEntry is updated.

Bug: 185914718
Test: manual inspection that connected wifi entry has the correct
security string

Change-Id: I5f3b7274f1e6b68de414493a6619555ee9b17e23
2021-05-10 17:48:53 -07:00
changbetty
e7d468f658 Fix a NPE when forget wifi network
To prevent the null activity. If activity is null, there is no need to
execute.

Bug: 184154325
Test: manual test
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiDetailPreferenceController2Test
Change-Id: I0dc32e7ea2a0d5a3f2a55ad8936578ed9fadd201
2021-05-04 22:26:51 +08:00
Wesley.CW Wang
50f314e45d Update StringUtil#formatElapsedTime method (2/3)
- Update the usage and the test case
 - Update discharging string to follow new string doc

Bug: 183689347
Test: make RunSettingsRoboTests
Change-Id: I1e14e7da8cb02755d8cf6e12626a0d94fad87121
2021-04-07 10:19:10 +00:00
changbetty
8fcb1f5974 Display WiFi Version number
- Display these type and hide the item in other case
   WIFI_STANDARD_11AX(6) WiFi 6
   WIFI_STANDARD_11AC(5) WiFi 5
   WIFI_STANDARD_11N (4) WiFi 4

-Screenshot
 https://photos.app.goo.gl/BbyZEQFyganEPfuw8

Bug: 117216087
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiDetailPreferenceController2Test

Change-Id: Ic360e501d2e3bd80ce3bcb3ddf529ec5d00c1bcc
2021-03-25 17:29:31 +08:00
Chiachang Wang
003e27d146 Remove hidden connectivity methods access
This commit resolves the hidden methods accesses for
LinkProperties, IpConfiguration and RouteInfo with atlernative
way for the connectivity mainline module preparation.

Bug: 172183305
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details2.WifiDetailPreferenceController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details.WifiDetailPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.UtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test

Change-Id: Iec4dab5d9fa12dedcf69a1cfe2a8be0956bc0d79
2021-03-18 14:31:28 +00:00
Chiachang Wang
17a8eacab4 Replace subnet mask calculation to Inet4AddressUtils
There is existing helper method in Inet4AddressUtils to calculate
the subnet mask from IPv4 prefix calculation. Replace the
implementation in caller side to simplify design in callers.

Bug: 172183305
Test: atest SettingsRoboTests
Test: Verify the method return the same value
Change-Id: I38d7d09be612fa4788cf4052bf304d17f0ae79f4
2021-02-23 03:05:51 +00:00
Chiachang Wang
384b88e3fb 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: I2fb674e0d7da0b11ba70177853fd6259bce372a3
2021-02-04 02:14:17 +00:00
Jeremy Goldman
9d87cd9126 SubscriptionsPreferenceController shows the unique sim description.
Bug: 148303118
Bug: 150370656
Test: atest -c SubscriptionsPreferenceControllerTest
Change-Id: I041536fe0148087a068c6000383b382b0ff4e17c
2021-01-22 07:02:52 +00:00
xshu
19eabbff63 Add randomized MAC (last used)
Makes it clear that when a network is disconnected, the randomized MAC
address shown is the last used one. (ie. it could change in the next
connection depending on whether enhanced MAC randomization is active)

Bug: 170166681
Test: Manually verified that the new text is shown for disconnected
networks.

Change-Id: I4aec47b2de68c077e6fdc7efa96d39e6666d4c86
2020-10-07 14:20:16 -07:00
Quang Luong
77e32049bd Merge "[Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default route" into rvc-qpr-dev am: db667a8971 am: 8704114f02
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12444567

Change-Id: I95ac03dcb6a45fbc8c71aae0d7c9fcae20f36ff2
2020-09-11 23:50:57 +00: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
e410325b37 [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.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 09:50:58 +08:00
Arc Wang
166ece8f1d [Wi-Fi] Remove WifiTrackerLib/AccessPoint constant & API usage
Bug: 152571756
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.dpp
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.details
Change-Id: I857cf0e261c1b07c3d7b6bc08632880ed8c71ee1
2020-07-22 07:53:52 +00: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