Commit Graph

476 Commits

Author SHA1 Message Date
lesl
fd41cce94b wifi: Use new API for wifi data usage function
For wifi, a old API: buildTemplateWifiWildcard will includes the merged
wifi which is included to mobile usage. It should not double count
again. Call new API: buildTemplateWifi with
NetworkId: NetworkTemplate.WIFI_NETWORKID_ALL
and null subscriberId to get non-merged wifi usage.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppDataUsageTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppDataUsagePreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageUtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SettingsDumpServiceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageInfoControllerTest
Test: Manual Test, wifi data usage count correctly.
Bug: 176396812
Merged-In: Ia4d8fa67ea3cb75c2d35be9ab60e5c5ffa391ffb
Change-Id: Ia4d8fa67ea3cb75c2d35be9ab60e5c5ffa391ffb
2021-05-06 09:37:09 +08:00
Arc Wang
b33a59b860 [Wi-Fi] Add object comments for WifiTrackerLib migration
Migrating from Wi-Fi SettingsLib to to WifiTrackerLib, there are
both some Settings files of both version. Developers should
develop on new version files.

Bug: 152571756
Test: compile
Change-Id: I4446e2e333663bf69daa1ceff102775889021851
2020-04-27 14:28:13 +08:00
Arc Wang
fd3360d28b [Wi-Fi] Index Wi-Fi preferences.
This is a WifiTracker2 version of partial part of ag/9980423

- Disable the "Saved network" if the access points is empty.
- Disable the "Wifi data usage" if there is no wifi radio.

Bug: 146823365
Test: manual
      Search 'Saved networks' when there is a saved Wi-Fi network
      and when there is no saved Wi-Fi network.
      Search 'data usage' on the device which supports Wi-Fi and
      on the device which does not supports Wi-Fi.
Change-Id: If46e65585f1b272401666f78fd5e3a4cf49bef6e
2020-03-30 21:30:00 +08:00
Roshan Pius
a7e96dd80e Settings: Use new API for setting wifi scan always on
Bug: 148514485
Test: Manually verified the toggle from Settings
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I0a55b7212c97c11d50b0a05eec743e8ebe9ea6d8
2020-02-18 12:53:49 -08:00
Thomas Devaux
158d17fef6 Auto-open Captive Portal when user clicks on open network.
Rationale: many users are confused about what to do after tapping the captive
portal network in Settings, and since there is explicit user action to
connect to that network at that point, auto-opening the portal is
natural and makes it simpler.

Bug: 148538768
Test: manually with local AP with Captive Portal and:
> make RunSettingsRoboTests -j40
> atest com.android.server.ConnectivityServiceTest

Change-Id: I29573132cd3e46ff22e6f67bb3678516fabac47d
2020-02-12 00:45:46 +00:00
Roshan Pius
65291297a9 Settings: Use new API for wifi wakeup feature toggle
Bug: 148514485
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Test: Verified wifi wakeup feature toggle in wifi settings.
Change-Id: I1e7c0b3ca053a9b7d6105cad16362df38517b51e
2020-02-07 12:33:18 -08:00
Edgar Wang
4af4f276bd Merge "Make the fragment title can’t searchable" 2020-02-07 08:07:01 +00:00
Edgar Wang
0934babbfc Make the fragment title can’t searchable
we shouldn't take users so deep into the settings IA because it's easy
to feel lost in settings after clicking on a result without additional
context.

Bug: 143055215
Test: robotest & manual
Change-Id: I337cb5ead31e1e4e7bf9be78132e90630f83ee43
2020-02-06 19:07:11 +08:00
David Su
68913c5a8b Migrate to getNetworkSelectionStatus()
isNetworkEnabled() & isNetworkPermanentlyDisabled()
should not be formal APIs. Instead,
getNetworkSelectionStatus() with a set of constants
is sufficient as an API surface, and will be more
maintainable in the future.

Bug: 146046526
Test: atest SettingsUnitTests
Change-Id: If599ce88f68a87fa7186ef96156c2bb1fdc1c2c3
2020-01-30 20:36:53 -08:00
Arc Wang
c4b1d0f416 [Wi-Fi] Fix Wi-Fi wrong password notification can't launch editor
WifiPickerTracker gather WifiEntries at onStart but
WifiPickerTracker.getWifiEntries() may still have no WifiEntry
at onResume.

Check if there is a specified wrong password Wi-Fi network at
onWifiEntriesChanged.

Bug: 143328194
Test: manual
      Edit a Wi-Fi network with wrong password, click the wrong
      password notification, should see a Wi-Fi editor for the
      wrong password Wi-Fi network

Change-Id: I7de6e0e3eabb2cb00160709eca4951b655dc04d7
2020-01-10 17:21:00 +08:00
Jason Chiu
2d609759cd Add preference click metric logs for some special cases
Bug: 137559984
Test: visual, robotest
Change-Id: If8624b49abcd0000487065160ce4a7ba861f234c
2020-01-02 17:45:23 +08:00
Stanley Wang
0577751718 Index wi-fi preferences.
- Add xml file to index "Saved network" and "Wifi data usage"
preferences.
- Disable the "Saved network" if the access points is empty.
- Disable the "Wifi data usage" if there is no wifi radio.

Fixes: 146823365
Test: manual
Change-Id: I049d0463fd58f186dae1d5f54dcc914f52031da7
2019-12-30 19:50:18 +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
5f23a43660 [Wi-Fi] Fix transition mode problems
Replace SECURITY_PSK_SAE_TRANSITION & SECURITY_OWE_TRANSITION with
AccessPpoint#isPskSaeTransitionMode() &
AccessPpoint#isPskOweTransitionMode()

Bug: 144320676
Bug: 144320649
Bug: 144325162
Bug: 144321574
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi

Change-Id: Ic3c7ac1238a51b6e215ed63761720d2bc371d012
2019-12-06 18:17:07 +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
Arc Wang
f4d3ba1049 [Wi-Fi][A11Y] Fix TalkBack lose focus in WifiSettings & WifiSettings2
Use stable ID feature of RecycleView to keep preference focus.

Bug: 126132618
Test: WifiSettingsTest
      WifiSettings2Test
      manual visual

Change-Id: Id73157b0935186c9a59d1ef68190d853f671ebc2
2019-11-01 09:47:37 +08:00
Raff Tsai
129c98bba1 Remove summary loader in some fragments
- Summary Loader only works in injected items, but those fragments
are not injected to Settings UI. The SummaryLoader class them are
useless.

Bug: 141653158
Test: robolectric
Change-Id: I1ca0bf5a1f417b7fe86b28e96aff7d4aee2cf2d3
2019-10-01 10:02:26 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
govenliu
8d6e5d14cb [Wi-Fi] Add a new fragment for configuring a new AccessPoint network.
When configuring a new access point in Wi-Fi settings page, it's hard to figure out there are some other option items after you tapping the "Advanced options" button.

To improve it, use full screen fragment to present the configuration items, so user can see as many items as possible.

Bug: 31052996
Test: Mock this fragment and check each button status run as expected.
Change-Id: I1c8e552fcabb1414bb500d918ed61287bf4aece2
2019-08-10 21:01:01 +08:00
Quang Luong
b470e725c9 Added WifiSettings -> WifiSettings2 redirection behind feature flag
Use WifiSettings2 if settings_wifitracker2 feature flag is enabled.
WifiSettings2 will be used for changes to WifiSettings to incorporate
the WifiTracker2 refactor.

Bug: 70983952
Test: make, set feature flag, open Wifi settings to verify new page
opens.

Change-Id: I08edc227bf38ab4b3b785180bf123815bf95da81
2019-07-22 14:41:11 -07:00
Hai Shalom
98aa52dbec [OWE] Support OWE in transition mode
Support OWE in transition mode for devices with OWE support
and devices without OWE support. Scan results will return a
new type of network for OWE in transition networks on devices
that support OWE, and Open for devices that don't support OWE.
Handle the case where Open network is manually added to a device
that supports OWE.

Bug: 132139642
Test: Device with OWE: Connect to Open, OWE-Transition, OWE networks
Test: Device without OWE: Connect to Open, OWE-Transition
Test: Manually create Open network, connect to OWE-Transition
Change-Id: I1a584ccbfec8507803c527ea13933cff6f699ccb
2019-05-13 15:37:44 -07:00
cosmohsieh
a79783ca2a Improve some comments of strings and codes
1) Correct improper function comment about forget menu
2) Extends char limit of wifi_scan_always_turn_on_message_unknown for
translation.
3) Correct string comment on Saved networks summary

Bug: 130628569
Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings.wifi.WifiSettingsTest
Change-Id: I0e60e4f205c794367dfffc032cb4334dac4d1cdd
2019-04-21 15:35:58 +08:00
TreeHugger Robot
bb00e4c028 Merge "[PasspointV2] Set summary of saved networks preference" into qt-dev 2019-04-18 00:58:22 +00:00
cosmohsieh
e6e4b4d78d [PasspointV2] Set summary of saved networks preference
Summary text of "saved networks" preference has number of both normal
networks and subscriptions

Bug: 130259573
Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings.wifi.WifiSettingsTest
Change-Id: I8bdf41c1a85165298a2ccd9e688c30b0bd593bfa
2019-04-17 18:21:09 +08:00
cosmohsieh
faede7ceb9 Implement context menu for ConnectedAccessPointPreference
1) User wants to long press ConnectedAccessPointPreference to forget network if this
is a captive portal network.
2) Change context menu string

Bug: 113756562
Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: If5c45c45fe126f627eeb53a6c1873a070ad23ae8
(cherry picked from commit 9f8522565a)
2019-04-16 07:35:36 +00:00
clownshen
fafdfea72c Add Wi-Fi data usage field
Add Wi-Fi data usage field at Wi-Fi Setting to show out the total Wi-Fi
data usage for user.

Bug: 129474341
Test: atest WifiSettingsTest
Test: manual test
Change-Id: Iad5bee47bd83ed143a2730f042d77907344f4017
2019-04-03 17:04:36 +00:00
Quang Luong
cd0e0d79c5 Merge "Removed Write to NFC dialog" 2019-04-02 17:19:21 +00:00
Jason Chiu
1b5f5ef510 Add Wi-Fi connect listener in ConnectToWifiHandler
- Extract the connect listener from WifiSettings
- Add a listener to display a toast on failure to connect in ConnectToWifiHandler
- Also for the new AccessPoint.startOsuProvisioning() which accepts a connect listener

Bug: 123697580
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I29b2c1e2c58312d692675ecabf2818b4bbed3b51
2019-04-02 13:44:08 +08:00
Quang Luong
83b814742a Removed Write to NFC dialog
Write to NFC dialog should be removed since WPS isn't supported anymore

Test: atest WifiSettingsTests
Bug: 112745354
Change-Id: I2bccf0b234c5f3138c48700904c2d578072e8cd6
2019-03-29 16:12:32 -07:00
Quang Luong
1859a19302 Added connect listener to startOsuProvisioning()
Updated AccessPoint.startOsuProvisioning() call to accept a connect
listener to display a toast on failure to connect.

Bug: 123697580
Test: build
Change-Id: I0f29b2f5ccc8f2d4b8137639725dca1bcb106b26
2019-03-28 13:09:37 -07:00
cosmohsieh
2213816720 [Passpointv2] Fix Network detail page title
Sets original detail title if the chart header feautre on detail page don't
enable.

Bug: 128569047
Test: manual
Change-Id: I43a7b1bd11294b34b39b46e0d8f63a844af1585e
2019-03-27 09:43:45 +00:00
Arc Wang
e4359a9eee Merge "Fix Wi-Fi Easy Connect buttons UI defects" 2019-03-20 01:53:24 +00:00
Arc Wang
baf002d61a Fix Wi-Fi Easy Connect buttons UI defects
1. Apply attr/colorAccent to button icons for theme UI control
2. Apply attr/selectableItemBackground for button tapping ripple effect
3. Use ConstraintLayout to separate ssid EditText and scan button
4. Remove ButtonPreference and add AddNetworkPreference.
   ButtonPreference's naming and design look like a general purpose UI
   component but it's not. This change refactors the code.
5. In AddNetworkPreference, use settingslib layout file
   'preference_access_point' to fix UI alignment problems.

Bug: 126964552
Bug: 125434239
Bug: 126762937

Test: manual test
      atest com.android.settings.wifi.WifiSettingsTest
Change-Id: Ib899a1e10f96bb8427ff00d6b5dfca37a0642c44
2019-03-19 16:27:04 +08:00
cosmohsieh
976995fa36 [Passpointv2] Implement DataUsage header for Wi-Fi detail fragment
Change header to a data usage chart of the specified Wi-Fi network.

Bug: 124700353
Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings
Change-Id: Ide08ffd5e97ced5fe54707562690155414598dac
2019-03-14 16:41:08 +08:00
TreeHugger Robot
08a2a8183e Merge changes I54a3f033,I2e894501
* changes:
  Fix [a11y] Wi-Fi Easy Connect Talkback issues
  Support to share Wi-Fi hotspot via QR code
2019-03-12 00:42:40 +00:00
Quang Luong
0df143834a Use getTitle() for AccessPoint display name
Instead of getSsidStr(), AccessPoint display names should use
getTitle() to accomodate Passpoint networks which use a provider
name instead of a single ssid. This change allows the provider
name to be displayed in the network details page, the long
press wifi dialog, and the config editing dialog.

Bug: 118705403
Test: atest WifiSettingsTest
Change-Id: I930d6218c7e464ad20c0c61130e0cb9ce315d9a2
2019-03-08 14:42:29 -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
Quang Luong
9feca638d4 Handled exeption in forget() for removePasspointConfiguration()
Added a catch for the call to removePasspointConfiguration().

Bug: 70393078
Test: atest WifiSettingsTest
Change-Id: If0213006f3fe42c50657bc2dde89a8dce4cff2b6
2019-02-26 23:13:33 -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
Johnson Lu
3a5d9020e8 Remove feature flags of WiFi Sharing feature
Bug: 120744414
Test: Manual
Change-Id: I655ebb8d149d0976063845478bc667cc4d72d96d
2019-02-15 16:14:54 +08:00
Joel Galenson
ad0e49bd6e Move horizontal progress bar into SettingsLib.
Remove the horizontal progress bar as it is being moved into
SettingsLib.

Bug: 123538370
Test: See progress bar in wifi settings screen.
Change-Id: I8fc94b1f3a7a52559cfcf89f3e4a604784ec9995
2019-02-07 08:21:01 -08:00
Jason Chiu
da2ca2f092 Connect to network while clicking open or saved networks on slice
Test: make RunSettingsRoboTests -j
Fixes: 121342770
Change-Id: I0ffb925628dd271d054f990b9b176eb10372e6a3
2019-01-30 16:15:41 +08: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
Quang Luong
d3ba94b332 Added autoscroll to top when clicking on OSU entry
Bug: 118705403
Test: manual, build and click on OSU entry
Change-Id: I78c69e49afc577140b819f2a4e949440a81d63c6
2019-01-09 13:49:55 -08:00
Quang Luong
7f94b17280 Added support for OSU Provider provisioning action on click
Added a call to AccessPoint.startOsuProvisioning() to
onPreferenceTreeClick to open up an OSU provider flow when the user
clicks on an AccessPointPreference pertaining to an OSU provider
AccessPoint.

Bug: 118705403
Test: manual, build and tap on the OSU provider AP.
Change-Id: I3c321c2a6d2336a0cc92a30ae051146d2fc05fb7
2019-01-09 13:49:55 -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
8ff2852f74 Implement receiver flow of WiFi sharing feature II
Bug: 120630683
Test: atest RunSettingsRoboTests
Change-Id: Iabe56205ff9274382adbe5bba59a60d833a57214
2018-12-14 06:50:26 +00:00
Johnson Lu
5aef897e9b Implement receiver flow of WiFi sharing feature
1.Add a button to launch QR code scanner when add a network.
2.Scan button added in AddNetworkFragment / WifiDialog / WifiSettings.

Bug: 120630683
Test: make RunSettingsRoboTests
Change-Id: I340bfa2247e092f586dd90dfea37c355e681ffee
2018-12-11 14:25:07 +08:00
Hai Shalom
f2f00313bb packages/apps/Settings: Add logic and strings to support WPA3 and OWE
Add and update Wi-Fi security strings, and add logic to enable WPA3
and OWE. Modified WPA2-PSK to WPA2-Personal, and added WPA3-Personal,
Enhanced Open and WPA3-Enterprise.

Bug: 112195778
Test: Basic functional tests
Change-Id: Ia97761a7f0a9e2fee768dfaf3578a2f1090d29c6
2018-11-05 16:40:07 -08:00