Commit Graph

45 Commits

Author SHA1 Message Date
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
Arc Wang
04854f8234 [Wi-Fi] Fix exception when WifiTracker2 callbacks to Wi-Fi Settings
When WifiTracker2 callbacks to Wi-Fi Settings, should check if the
activity is finishing at first.

Bug: 151677440
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiSettings2Test
Change-Id: I95737eae3f67e6471c75ba845b57af2d721d5d37
2020-03-20 18:02:02 +08:00
govenliu
907e402cfa [Wi-Fi] Add API to handle help button click event
Add API to launch help page when Openroaming help button is tapped.

Bug: 146669261
Test: Add openSubscriptionHelpPage_shouldCallStartActivityForResult unit test to check StartActivityForResult had been launched correctly.
Change-Id: If18248e7d985215e65dfdc5742cd9007efbbff1a
2020-03-19 23:22:36 +00:00
Arc Wang
f5e9927668 [Wi-Fi] Implement ConnectedWifiEntryPreference to show gear icon
click the gear icon will always switch to Wi-Fi detail screen.

Bug: 150911380
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ConnectedWifiEntryPreferenceTest
Change-Id: I640d180ae5684ffaa9b2adec7b1be401b2bfd89d
2020-03-06 19:27:08 +08:00
Quang Luong
834b0ade20 [WifiSettings2] Remove redundant save() call for new configs
Removing call to WifiManager#save() when configuring a new network
through tapping it in the wifi picker. Since WifiManager#connect()
already saves the passed in WifiConfiguration, the call to
WifiManager#save() is redundant.

Bug: 149579116
Test: build, manual verification by connecting to a new secure network
Change-Id: I9242e7fd7e9a459e8221b6bb491ab67833970e87
2020-02-28 12:58:36 -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
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
David Su
2ad3a3e0ab Merge "Migrate to getNetworkSelectionStatus()" 2020-02-06 18:15:44 +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
TreeHugger Robot
21276e72d6 Merge "[Wi-Fi] Fix strange split line when there is no connected network" 2020-02-04 07:16:39 +00:00
Arc Wang
9c11f68c8f [Wi-Fi] Fix strange split line when there is no connected network
Shows connected network preference only if connected network is available.

Bug: 147990798
Test: manual visual
Change-Id: I119a2617a33df628c4f2cd5087a674f7b9b653fc
2020-02-04 10:52:58 +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
David Su
fa6e9f7283 Rename WifiConfiguration.getHasEverConnected()
Renamed to hasEverConnected() to conform to API
guidelines.

Bug: 146046526
Test: make RunSettingsRoboTests -j40
Change-Id: Ie88945326977ea11a05721e40a81c338fee61cb6
2020-01-30 20:36:30 -08:00
TreeHugger Robot
ecebf0ef61 Merge "[Wi-Fi] Fix Wi-Fi wrong password notification can't launch editor" 2020-01-10 11:39:49 +00: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
Arc Wang
5efa92f95f [Wi-Fi] Remove redundant code in WifiSettings2
WifiPickerTracker get WifiEntries at onStart, it's no meaning
to getWifiEntry at WifiSettings2#onActivityCreated.

Bug: 143328194
Test: manual
      Edit a Wi-Fi network by clicking context menu 'Modify',
      rotate the WiFiDialog and see if any thing wrong

Change-Id: I9746879720b72723259e1b59e8b5e8bae183b8cc
2020-01-09 18:51:58 +08:00
Arc Wang
50afc70f8f [Wi-Fi] Edit a never connected WifiEntryPreference in WifiSettings2
If the Wi-Fi network is never connected after it's saved,
edit it instead of connecting when users click the WifiEntryPreference.

Bug: 143328194
Test: manual
      Click a saved wrong password Wi-Fi network

Change-Id: If974ce9225fe6b6ed5f8a3c6c0ff619532acc1c2
2020-01-09 18:36:33 +08:00
Jason Chiu
bcaac763d2 Merge "Add preference click metric logs for some special cases" 2020-01-03 03:30:15 +00:00
Arc Wang
d1dae54f27 Merge "[Wi-Fi] Implement getDialogMetricsCategory in WifiSettings2" 2020-01-03 01:45:42 +00:00
Quang Luong
41ece633c7 Merge "[Wi-Fi] Split WifiEntryCallback into separate callbacks for each action" 2020-01-03 00:54:19 +00: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
Arc Wang
5814737a49 [Wi-Fi] Implement getDialogMetricsCategory in WifiSettings2
It's necessary to implement getDialogMetricsCategory to show
dialog in WifiSettings2.

Bug: 143328194
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I65ac4168ef922be981624e7916316f189ab590c2
2020-01-01 01:16:04 +00: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
Arc Wang
b0e9d44478 [Wi-Fi] Support intent extra "wifi_start_connect_ssid" in WifiSettings2
This is a similar code merge of ag/575560 & ag/2588374

Bug: 143328194
Test: manual
      Connect to a Wi-Fi network with wrong network.
      Click the fail notification and launch Wi-Fi picker.
      Check if the editor shows the specified Wi-Fi network.

Change-Id: I5bc8cd0ea51e7baf3d6d2d6d522a3973b74ef930
2019-12-27 14:11:36 +00:00
Arc Wang
46721efd99 [Wi-Fi] Support intent extra "wifi_enable_next_on_connect" in WifiSettings2
This is a similar code merge of ag/489459.

Bug: 143328194
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettings2Test
Change-Id: I666b3293f00aa1822a6fdcc3760ae19d27019597
2019-12-27 14:10:24 +00:00
Arc Wang
8692bb5924 [Wi-Fi] Apply WifiDialog2 in WifiSetings2
This change also implements context menu in WifiSettings2.

Bug: 70983952
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiSettings2Test
Change-Id: I13b5a3724207f76e2b24fd0c1c49a236ee0c44f0
2019-12-26 14:47:19 +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
Quang Luong
7719c8e3d8 Merge "Add call to WifiEntry.connect() when tapping on WifiEntryPreference" 2019-12-05 21:03:47 +00:00
Quang Luong
cf8856017f Add call to WifiEntry.connect() when tapping on WifiEntryPreference
Bug: 70983952
Test: manual - verifying saved network is connected to when preference
is tapped

Change-Id: Ieca38cfe0e457115c2e0bd832b987582073be7ce
2019-12-04 14:51:29 -08:00
Quang Luong
810f7861f0 Merge "Use WifiPickerTracker to get connected WifiEntry" 2019-12-03 20:03:10 +00: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
Quang Luong
38a8287abb Use WifiPickerTracker to get connected WifiEntry
Use WifiPickerTracker.getConnectedWifiEntry API to get a WifiEntry to
display at the top of the Wifi picker as the connected network.

Test: manual - visual verification of connected entry at the top of the
wifi picker.
Bug: 70983952

Change-Id: Iec6e1c9fe950397f62350194d8b24791a7eac30a
2019-11-08 17:01:39 -08:00
Arc Wang
5474667892 Merge "[Wi-Fi][A11Y] Fix TalkBack lose focus in WifiSettings & WifiSettings2" 2019-11-05 02:01:36 +00: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
Quang Luong
1a5b620a19 User WifiPickerTracker API for saved network preference text
Change the source of the saved network preference text from WifiManager
to WifiPickerTracker and update it through the
WifiPickerTrackerCallback.

Bug: 70983952
Test: atest WifiSettings2Test
Change-Id: Ia0a61f174a061892cd9376c16402e4983eaaa03c
2019-10-29 16:23:31 -07:00
Quang Luong
652fa61905 Use WifiPickerTracker instead of WifiTracker2
WifiTracker2 is being split into separate trackers for each fragment
that needs tracking functionality (Wifi picker, Saved Networks Page,
Network Details Page). For WifiSettings2, we will use WifiPickerTracker
which differs from WifiTracker2 by only having the functionality
required for the wifi picker.

Bug: 70983952
Test: WifiSettings2Test.java
Change-Id: Ia94fa534ead7c521156d1cccbb120a345d95e020
2019-10-29 14:17:03 -07: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
Quang Luong
c1436e8ef2 Add initial WifiTracker2 into WifiSettings2
Added WifiTracker2 into WifiSettings2, and made WifiSettings2 listen to
wifi state change callbacks from WifiTracker2 to update the WifiEntry
list.

Test: atest WifiSettings2Test, build and visual verification
Bug: 70983952

Change-Id: Ieda699d05d350553a526f9536de58937c49c7280
2019-08-23 11:51:46 -07:00
Quang Luong
b061428938 Copy WifiSettings base code into WifiSettings2 without WifiTracker
Copied main logic from WifiSettings into WifiSettings2, removing
all instances of WifiTracker in preparation of adding WifiTracker2.

Removed:
 - WifiDialog (to be added back in)
 - Context Menu (to be added back in)
 - Leftover SUW code (Next button)

WifiSettings2Test also copied directly from WifiSettingsTest, without
context menu test.

Bug: 70983952
Test: atest WifiSettings2Test

Change-Id: Ie1ef5bf0ca14f5989f4add2165422609f12c2c84
2019-07-31 11:46:15 -07: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
Chia-chi Yeh
065cd4be64 WifiSettings: rename WifiSettings2 to WifiSettings. 2010-02-03 15:56:55 +08:00
Chia-chi Yeh
48090d4066 WifiSettings: revise and add support for editing EAP networks.
Use arrays.xml to store translations for enumerations;
avoid race conditions happened when pop up menu or dialog;
avoid saving configurations with networks disabled;
use the same layout for all the dialogs;
support editing EAP networks;
only unlock keystore before connecting;
and many bug fixes I cannot remember.

The number of lines in the new code is about 1/3 of the old one,
and it improves the readability a lot!
2010-02-02 18:31:58 +08:00