Commit Graph

411 Commits

Author SHA1 Message Date
Christine Franks
a1f56b5faa Merge "Restrict changing wi-fi networks" into oc-dr1-dev
am: a7e10e0316

Change-Id: Ifcb15f741c4bcb72c32789870bc50027d2fc4cbb
2017-07-26 02:52:52 +00:00
Christine Franks
a0dd987d20 Restrict changing wi-fi networks
Bug: 31852835
Test: manual - verify unrestricted as regular user, but that a password
is required in demo mode.
Change-Id: I60f95ccbb10ba728b384b9c8c2ae723934fb2928
2017-07-25 13:31:12 -07:00
Antony Sargent
5d137f0f2c Allow open password dialog for wrong-password wifi access points
When we're failing to connect to a wifi access point due to an incorrect
password, we want to allow an intent from a notification to open up the
wifi settings page and bring up the dialog for entering a different
password. We already have code in settings to do this for not-yet-saved
access points, so this CL just changes it slightly to also allow it for
saved access points.

Unfortunately WifiSettings can't be tested with Robolectric due to it
not supporting PreferenceScreen, so this adds a test to
WifiSettingsUiTest. There were some existing test failures in that file
which I've fixed while I was in there:

-The TestAccessPointBuilder class wasn't being found at runtime because
 it was getting stripped out at build time due to not being used in
 settings.

-The changingSecurityStateOnApShouldNotCauseMultipleListItems test was
 asserting that we don't end up with multiple entries for the same SSID
 in the access point list when changing the security state for the AP,
 but it was accidentally passing multiple AP's with the same name the
 first time.

Bug: 33245941
Test: runtest --path WifiSettingsUiTest.java
Change-Id: I929ca6892242059df157c01d6e9ea30e8d1c5e78
2017-07-25 20:25:59 +00:00
Fan Zhang
62a3220efb Use a grey shade under progress spinner in wifi settings
Change-Id: I1c3fa3a05fe66924989607d73e77ca2616a898e6
Fix: 62545533
Test: visual
2017-07-10 14:46:29 -07:00
Sundeep Ghuman
b963c1190f Merge "Don't scroll when removing saved networks." into oc-dr1-dev
am: 1e561edb45

Change-Id: I9fa78596bdcbaeac90aaee55ddcde3f698ad907f
2017-06-30 00:04:37 +00:00
Sundeep Ghuman
1e561edb45 Merge "Don't scroll when removing saved networks." into oc-dr1-dev 2017-06-29 23:56:51 +00:00
Shunta Sato
97419f8d52 Merge "Fix Wi-Fi list adds same AP repeatedly" into oc-dr1-dev
am: 9638e020e5

Change-Id: I4c947cddb3ee000bc51dd8ea2f9eefbc54927824
2017-06-29 20:38:03 +00:00
TreeHugger Robot
9638e020e5 Merge "Fix Wi-Fi list adds same AP repeatedly" into oc-dr1-dev 2017-06-29 20:31:18 +00:00
Sundeep Ghuman
14cc864122 Don't scroll when removing saved networks.
Bug: b/62374459
Test: Open saved networks from WifiSettings. Remove a saved network.
Screen should not scroll to the top of the list.

Change-Id: Ia78fc0b5435f659c8fe31abee8b76006d7986b66
2017-06-28 20:27:15 -07:00
Shunta Sato
22080a1df5 Fix Wi-Fi list adds same AP repeatedly
When switch AP security mode, several same APs are shown.

To fix this issue, append security type to preference
key for avoiding different APs have same key.
git fetch

Cherrypick of:
https://partner-android-review.googlesource.com/#/c/799829/

Bug: 37558394
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java

Change-Id: I39621636f14b29e45ba96ff76dc3c21a4996a136
2017-06-28 20:21:46 -07:00
Sundeep Ghuman
9ff2435ebc Merge "Scroll to top when connecting to network." into oc-dr1-dev
am: ea3d314a10

Change-Id: I78adb370cf5261611ad0a56effae652c494e9592
2017-06-28 23:36:12 +00:00
Sundeep Ghuman
eb41c8cf15 Scroll to top when connecting to network.
Bug: b/34093572
Test: Open wifi picker. Select new network. Picker should scroll to top
of list to display the connected access point category.

Change-Id: Ie555f076a62e8cb589f8c6157d628b345cd84a4c
2017-06-26 16:57:27 -07:00
Shinji Sogo
d6db6d8938 Merge "Cleanup unused WifiP2pSettings code in WifiSettings" am: cd1f7a3146 am: 27ca1272a5
am: 879fd4b406

Change-Id: Ie7b7de6ab3e9d8ebf13beffffd0ca0aa4026e8ea
2017-06-16 19:06:38 +00:00
Shinji Sogo
879fd4b406 Merge "Cleanup unused WifiP2pSettings code in WifiSettings" am: cd1f7a3146
am: 27ca1272a5

Change-Id: I70f81796a7c29c416729cc7fd7b4fd8150fdc981
2017-06-16 19:00:18 +00:00
Sundeep Ghuman
60b814ba43 Allow WifiSettings to show old APs on app resume.
If we do not have any recent scan results, show the previous APs from
when the app was last paused, by not triggering a force update.

Accompanying changes are also made in WifiTracker to prevent
onAccessPointsChanged callbacks from being invoked until the tracker
receives a new 'SCAN_RESULTS_AVAILABLE' broadcast (ag/2409026).

Bug: b/38212080
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java
one minute later.

Change-Id: I4f9b2ec855e057e28235b0253ab42c6b4521bebc
Merged-In: I4f9b2ec855e057e28235b0253ab42c6b4521bebc
2017-06-14 19:07:05 -07:00
Sundeep Ghuman
4ae59dde43 Allow WifiSettings to show old APs on app resume.
MANUAL MERGE of ag/2398149 to avoid merge conflicts when trying to
submit to oc-dev.

If we do not have any recent scan results, show the previous APs from
when the app was last paused, by not triggering a force update.

Accompanying changes are also made in WifiTracker to prevent
onAccessPointsChanged callbacks from being invoked until the tracker
receives a new 'SCAN_RESULTS_AVAILABLE' broadcast (ag/2409026).

Bug: b/38212080
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java
one minute later.

Change-Id: I4f9b2ec855e057e28235b0253ab42c6b4521bebc
2017-06-14 19:05:21 -07:00
Shinji Sogo
ba1b520505 Cleanup unused WifiP2pSettings code in WifiSettings
Cleanup commented code giving access to WifiP2pSettings from option menu
is not needed anymore.

Bug: 38333540
Test: Manual test
Change-Id: I5884ec219ba09601d9602f026fa8ad89f765934f
2017-06-07 22:55:24 +00:00
Fan Zhang
015c7706e4 Hide saved network preference when there is none.
We already do this when wifi is enabled. This change brings same
behavior when wifi is off.

Change-Id: I44301fe46a6183735f8be71c80cfe719ad0e82b4
Fix: 62094681
Test: runtest --path tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java
2017-06-01 12:38:08 -07:00
Stephen Chen
a99b86c56a Update Wi-Fi Wakeup setting to check whether the feature is available.
Bug: 38037361
Test: make ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest
RunSettingsRoboTests -j40

Change-Id: I1c1b930546cc090d72f3047058a428acd1b2883a
2017-05-10 11:06:05 -07:00
Stephen Chen
f5d02aa765 Fix Disallow config Wi-Fi message for AFW Do mode.
Correctly displays the custom message set by the Test DPC tool
for devices in AFW Do mode.

This change also fixes an issue where when Wi-Fi is disabled, the
disabled message is not shown instantly on Settings app start.

Bug: 37134344
Bug: 37911257
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java
for off message testing, manual inspection using the Test DPC tool, and
verifying Guest mode behavior.

Change-Id: I61e48f605d75cb5665461536beeedcb32f6aa7f9
2017-05-02 18:05:00 -07:00
Sundeep Ghuman
87bf49a436 Force update APs when enabling wifi in WifiSettings.
This reverts commit b2bdc8f17b
and fixes a broken Espresso test case.

Reason for revert: Rolling forward after fix in ag/2133493, to fix b/37324736

Bug: b/37324736
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java

Change-Id: I9cdf8cb1043af5d527eccbd9cc56d3b02419d7ac
2017-04-25 15:12:00 -07:00
Sundeep Ghuman
b2bdc8f17b Revert "Force update APs when enabling wifi in WifiSettings."
This reverts commit 1c231d32b1.

Reason for revert: b/37530557 - ANR in Settings due to deadlock

Change-Id: I85d70aa957dca76189b7600d7b39cb9a09437e91
2017-04-20 17:49:20 +00:00
Sundeep Ghuman
1c231d32b1 Force update APs when enabling wifi in WifiSettings.
Bug: b/37324736
Test: See bug for repro steps.
Change-Id: I2a789e13781c64d2cc72b059685c5f3dfb9ff2ad
2017-04-18 20:28:50 -07:00
Sundeep Ghuman
bb46d23c8f Remove animations in WifiSettings.
This addresses jank issues when first showing the WifiSettings. Given
the new loading bar, animated transitions seem less relevant. Based on
user feedback, animations may be readded after a delay in ODR.

Bug: b/37429702
Test: Visual
Change-Id: I9a44820bb354885d0ef31d50278aee6a47727701
2017-04-18 16:45:04 -07:00
Sundeep Ghuman
60c1d4ec64 Fix startup jank in the Wifi Picker.
Synchronously fetch the latest APs during onResume and show these before
displaying the other wifi preferences. This fixes a visibile shuffling
issue. Additional Setting preferences are now programatically added
during onStart and hidden during onStop in order to avoid the animation
delay which causes a shuffling effect.

Bug: b/36406983
Test: Visual inspection. Animation jank is difficult to programatically
test.

Change-Id: I34b2d737a8e72e1dc296c170f753975fafce7a3e
2017-04-17 13:36:35 -07:00
TreeHugger Robot
0c4747401a Merge "Link to "scanning settings" when Wi-Fi is off." into oc-dev 2017-04-06 01:41:43 +00:00
Amin Shaikh
0820ee350f Link to "scanning settings" when Wi-Fi is off.
Always link to scanning settings when wifi is off. Previously, the link
was only shown when wifi was off and scanning settings were on.

Bug: 36033488
Test: m RunSettingsRoboTests and manually testing on device
Change-Id: I0abc6f4a25072c78fea6a971621cebc1a97b658b
2017-04-04 17:58:59 -07:00
Peter Qiu
36b68df4d4 wifi: allow manual connection to a Passpoint provided network
While connected to other WiFi network, a Passpoint AP with its
provider installed will shown as "<SSID> available via
<Provider Name>", since the installed provider contained
necessary credentials needed to connect to that AP.

This CL will trigger a connection to that AP when the user
taps on it for manual connection.

Bug: 36357280
Test: manual connecting to a Passpoint network while connected
      to other network

Change-Id: Idec440aa1606e80bcea56054e77ef2dc50a7ac93
2017-04-04 14:06:28 -07:00
Stephen Chen
19b74d9213 Improve responsiveness of toggling wifi and refactor user restriction logic.
Moved logic for handling wifi state changes into correct listener
method. Changed logic for handling isUiRestricted. This should
streamline toggling flow for WiFi both when Wifi Scanning is on and off,
and in guest mode.

Bug: 36724409
Bug: 36711085
Bug: 36398321

Test: make, test cases in tracking bug
Change-Id: I69fe07369db192c94f81dd678087ac4e8c35197b
2017-03-31 15:47:43 -07:00
TreeHugger Robot
555d12b427 Merge "Do not show progress bar when disabling wifi." into oc-dev 2017-03-30 18:08:46 +00:00
Stephen Chen
f5d1327e2a Do not show progress bar when disabling wifi.
Bug: 34286786
Test: make, test on device.
Change-Id: I109ac05ce3565abc3d80ecec2879c2f7c8bc1724
2017-03-29 16:54:22 -07:00
Stephen Chen
b19b8f37c9 Connect immediately after pressing on previously connected saved networks.
Bug: 34287193
Test: manual inspection
Change-Id: Idf7156fa48640a34ce11cbf2f9683cfc6525a7b5
2017-03-29 11:50:16 -07:00
Amin Shaikh
5e0c60d2ac Remove delayed processing of UI events in onStop
Bug: 36682492
Test: manually; test tracking in b/36403635
Change-Id: Ia369cd61a6473ae2af4891cf6b923900504921c1
2017-03-28 19:13:23 +00:00
Stephen Chen
11478573ec Expand Wifi Picker Menu by default.
Bug: 36575182
Test: make SettingsFunctionalTests and ran tests on device.
Change-Id: I256ea82a8e4478d81497b9a56cc4fb7755839f1c
2017-03-27 11:26:46 -07:00
TreeHugger Robot
f7fb763ed5 Merge "Populate summary for top level wifi picker options" 2017-03-27 15:48:55 +00:00
Zhihong Li
f52128f7cb Merge "Show correct Wi-Fi status when switching to multi window mode" am: 4cc1f72576 am: a4def43fad
am: 76fb361b9d

Change-Id: Ib19926feb7d3a2da0a8aaa9dc9c5ee3bcae6c2af
2017-03-25 04:26:06 +00:00
Zhihong Li
a4def43fad Merge "Show correct Wi-Fi status when switching to multi window mode"
am: 4cc1f72576

Change-Id: Id60415285629e6d7a712a9f441e6e7839732bf94
2017-03-25 04:21:03 +00:00
Treehugger Robot
4cc1f72576 Merge "Show correct Wi-Fi status when switching to multi window mode" 2017-03-25 04:14:58 +00:00
Amin Shaikh
04cae3b66a Populate summary for top level wifi picker options
Screenshot: https://drive.google.com/file/d/0B8qSkjrtrXEPLTh0ZTRnMWFWX2M/view

Bug: 36532777
Test: make RunSettingsRoboTests
Change-Id: I9b364ecc4d71de484216f848c853db91a2a08fa7
2017-03-24 17:49:06 +00:00
Amin Shaikh
bef3c6ddfd Update WriteWifiConfigToNfcDialog.
- Use the new WifiManager API to retrieve the WPS NFC token for the
current network.
- Add WifiManagerWrapper class to support testing because Robolectric
does not yet support testing Android O.

Bug: 35725168
Test: m RunSettingsRoboTests
Change-Id: I7805bdcbe02dc262083bcd371d4ad88d256f8089
2017-03-24 10:14:02 -07:00
Sundeep Ghuman
2df0bf9d5c Create a way to inject a WifiTracker into WifiSettings.
Bug: b/36403696
Test: Preliminary step to enable creation of Espresso tests b/36403696
Change-Id: I63c49cca0905a9d05964c11b3307ccf1859db7ec
2017-03-20 19:00:37 -07:00
Sundeep Ghuman
f35a55dee4 Add progress bar and delay to WifiSettings refresh.
This change shows the progress bar for 0.3 seconds before AccessPoints are
about to be refreshed and 1.7 afterwards for a total duration of roughly
2 seconds. This indirectly fixes issues with no longer having a refresh button,
indicates ongoing scanning to the user, and should help avoid user errors where
the user clicks on the wrong access point while the list is being updated.

In order to avoid excess UI movement, the progress bar off state is now set
to invisible rather than gone.

Bug: b/34774783
Test: Currently blocked on refactor, tracked in b/36403635 and will
start next week.
Change-Id: I2bb6b5b3d4611cdbfd7138c758785601896d05b9
2017-03-20 18:59:34 -07:00
Jay
241d902200 Merge "Improve Wi-Fi Settings UI in guest mode"
am: 31f64a1253

Change-Id: I15f05538344aa615a4f69eebf7fdec66efc3cf29
2017-03-15 19:18:43 +00:00
Jay
a620f52e64 Improve Wi-Fi Settings UI in guest mode
Progress bar is still seen along with a permission forbidden tip in
guest mode and it's confusing. It should be hidden because actually
nothing happens there.

When Wi-Fi is off, Wi-Fi OFF tip should be shown even in guest mode
becuase it should be consistent with Wi-Fi status.

Improves d8c3ca43163427a75c8b70114096238177f97af0.

Bug:31235488
Test: manual inspection.

Change-Id: I611719db253a0aec03d61e881af0e5dc3869d50b
Merged-In: If89728e293721cea45dcd717316d87f6df17ea7c
2017-03-15 11:11:15 -07:00
Stephen Chen
b77cbe5bb2 Fix Wi-Fi Settings Guest mode UI.
Progress bar should not show in guest mode when onViewCreated.

When Wi-Fi is off, Wi-Fi OFF tip should be shown even in guest
mode to be consistent with Wi-Fi status.

Bug: 35627922
Test: tracked in b/35324506
Change-Id: If89728e293721cea45dcd717316d87f6df17ea7c
2017-03-14 19:33:36 -07:00
Sundeep Ghuman
8f060d7148 Fix calculation of Access Point Level.
Bug: b/35854026
Test: make RunSettingsRoboTests
Change-Id: I5287e8c7b46a463cfa25659c756f6ca9175cb68c
2017-03-14 17:11:57 -07:00
Sundeep Ghuman
07db40434b Create the Wifi Network Details Page.
This page should not be searchable, as it corresponds to a specific
access point, thus click on a search result would not have an access
point in which to open.

Fix WifiPicker bugs b/35883232 and b/35951638 that deal with UI jank.

Bug: 34713316
Test: Tracked in b/35963536 and to be implemented in an immediate follow
up CL.
Change-Id: Iad7f26c7f04c3fc7d07a8e9188843eeb4d44cd36
2017-03-14 15:31:20 -07:00
Zhihong Li
9d12d101be Show correct Wi-Fi status when switching to multi window mode
In WifiSettings, when switching to multi window mode,
WifiSettings fragment is recreated and "onPause()" is called,
then WifiTracker stops and wrong Wi-Fi status is shown.

Move "WifiTracker.startTracking()" to "onStart()",
 "WifiTracker.stopTracking()" to "onStop()"
to make sure to show correct Wi-Fi status.

Bug: 36078677
Test: Manual test OK

Change-Id: I215f180b1082f6039c03de8b4a3ca27d1f364c75
2017-03-09 13:25:46 +09:00
Stephen Chen
9f5aaa4e5f Remove refresh button from WifiSettings.
Bug: 34891524
Test: b/34673204 for instrumentation tests. Verified button is removed.
Change-Id: I0b30d36bd6b3f0b1361ef4f7dc775ed3545a7bdc
2017-03-08 11:58:13 -08:00
Matthew Fritze
b759516cbf Create whitelist for the most popular settings
As a temporary solution to getting the most popular
settings to be the top rank, we have created a white list.
If a prioritized setting shows up somewhere in the results
then it will be given an elevated rank to be at the top.

Bug: 35048659
Test: make RunSettingsRoboTests
Change-Id: I92b563a17b42d8f91d980dd1d8e5f8f29ca5aa9c
2017-03-06 12:31:41 -08:00