Commit Graph

411 Commits

Author SHA1 Message Date
Doris Ling
dad557305e Fix Network details title not being translated.
- use the title resource id instead of the actual string in the launch
intent so that it can react to language change.

Change-Id: I424dc026a9298d12627c05f97f27e9d4cba5a341
Fixes: 77896130
Test: run i18nscreenshots
2018-04-19 16:49:35 -07:00
Fan Zhang
01cfb9d8c5 Remove wrapper for ConnectionManager/IPackageManager
Bug: 76167422
Test: robotests
Change-Id: I5f051b0ce58b97a3cfd5d4bae469463dcd6d83ac
2018-04-02 17:09:10 -07:00
Fan Zhang
234854cb04 Remove more wrappers in favor of new Robolectric support
Bug: 76167422
Test: robotests
Change-Id: Ic71a181bee6f90f25f9fa2a748cf708887495394
2018-03-30 15:58:14 -07:00
Adam Newman
5178a9d07a Observe NetworkCallback instead of polling
Switch from polling for the first connected WiFi network to observing
the currently connected WiFi network and associating that with the
preference at the time the preference is created or updated.

Whenever the ConnectedAccessPointPreference is removed or UI is stopped
unregister the callback.

Bug:68031656
Test: make RunSettingsRoboTests
Change-Id: I5d1ed83b6a13e8a83fae04bfdce8d0f13c2ba0ac
2018-03-26 07:45:16 -07:00
Jyun LuoLai
e05884564e Modify connectivty related strings
Change-Id: I971c5f68ff3d881ad0285f87ab868a204edc9b7f
Fixes: 73960246
Test: Manual test & make RunSettingsRoboTests
2018-03-20 09:45:09 +08:00
Adam Newman
c6b4f3d92c Enable launching captive portal directly
Whenever a user has connected to a captive portal network, split the
ConnectedAccessPointPreference to allow directly signing into the
captive portal or modifying the network's settings. When in any other
network state, use the old behavior of a single tappable preference that
takes the user to settings.

Bug: 63929546
Bug: 68031656
Test: make RunSettingsRoboTests
Test: manual by connecting to Captive Portal and normal WiFi networks.

Change-Id: I444202a12138d90c94bda94945c121c8c0810536
(cherry picked from commit 7577624db7)
2018-03-15 21:05:25 +00:00
TreeHugger Robot
a0d8315762 Merge "Remove use of forceUpdate." 2018-02-21 20:16:00 +00:00
Fan Zhang
7cf99f5f12 Migrate more settings to use SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I08f6f380489646231d6d8ceb1488e2efb036bf69
2018-02-18 21:10:03 -08:00
Sundeep Ghuman
0f711f86a6 Remove use of forceUpdate.
Now that WifiTracker correctly handles eviction of stale scan results
only after scanning has resumed, it is no longer necessary to
conditionally fetch APs on app resumption.

Fix broken test.

Bug: 68030053
Test: runtest --path
tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java

Change-Id: Ib4c8d6e53cf760fcb5f00069da40c578171c09f4
2018-02-08 17:49:05 -08:00
TreeHugger Robot
96fc83d821 Merge "Delete WPS settings." 2018-02-08 00:16:35 +00:00
Andrew Sapperstein
26e35dac79 Delete WPS settings.
Removes the WPS PIN and Push button settings, all of
the strings, and related code.

Change-Id: I1c7a35ffc8491c57e07accba9b1b5f5407b01831
Fixes: 72421239
Test: deletes code, robotests
2018-02-07 13:57:57 -08:00
TreeHugger Robot
d0d7322138 Merge "Modify logging in WifiSettings." 2018-02-07 20:24:38 +00:00
TreeHugger Robot
d895f9374c Merge "Remove the second target for ConnectedApPreference" 2018-02-07 05:06:23 +00:00
Sundeep Ghuman
790dcdcd96 Modify logging in WifiSettings.
This now respects both the Log tag setting and the developer options
toggle.

Bug: NA
Test: NA
Change-Id: I444b00cb35a61d8779cc46c90b33e611d5b0ac06
2018-02-02 16:48:48 -08:00
Joe LaPenna
3810036691 Always show wifi wake setting.
Remove WIFI_WAKEUP_AVAILABLE config setting its available by default.
Remove check for NETWORK_RECOMMENDATIONS_ENABLED, the feature no longer
uses the recommender.

Test: make RunSettingsRoboTests RunSettingsLibRoboTests;
Test: atest SettingsBackupTest; manual/exploratory
Bug: 69624403
Bug: 67952636
Change-Id: Ia65f7f9349e77a13ad4af1dbd992b28a5cb16368
2018-02-01 16:08:55 -08:00
jackqdyulei
a2b151efbe Remove the second target for ConnectedApPreference
Also create new gear layout since previous one has its own
ripple, which conflicts the normal preference ripple.

Fixes: 72528535
Fixes: 72442172
Test: Screenshot | RunSettingsRoboTests

Change-Id: I6a253574d0a5c971104c157584d66c3312764a26
2018-01-29 15:29:57 -08:00
TreeHugger Robot
f92b2773d3 Merge "Move AccessPointPreference.generateApKey." 2018-01-29 22:40:43 +00:00
Sundeep Ghuman
9c8e6fb68f Move AccessPointPreference.generateApKey.
Move logic into AccessPoint.java.

Bug: 64989100
Test: runtest --path
tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java

Change-Id: I822a9675263191f22e84233bf2f83a610375a815
2018-01-24 14:39:19 -08:00
Fan Zhang
a958478501 Keep access point list updated once in short time
The function onAccessPointsChanged will be called many times
and access points will be updated many times in 300ms. So check
if the same event exists before calling postDelayed.

Fixes: 68230819
Test: Manual test
Change-Id: Id098e1b77c28b62a5495c3369ed950531e59dba2
2018-01-17 09:13:10 -08:00
Fan Zhang
87d120a7e1 Override switch bar string for wifi/battery saver screen
Bug: 69462439
Test: visual
Change-Id: I18d03ee1664f111222d7b9bb7ee893e4ce0e1343
2018-01-11 15:17:14 -08:00
Ben Lin
848f67d17a Add ability to show/hide Wi-Fi settings, and all related sub-settings.
This adds a new boolean flag, config_show_wifi_settings, which when set
to false will hide the "Wi-Fi" page in network & internet (there is no
key value associated with this preference page). It will also hide
nested pages from search results, such as Wi-Fi preferences.

Bug: 62379554
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=ConfigureWifiSettingsTest
and
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiSettingsTest
and
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiMasterSwitchPreferenceControllerTest
all pass.

Change-Id: Iedc6bc272e0cb2b561c6bf25968e70f355aaaa8e
2018-01-03 20:05:55 +00:00
jackqdyulei
0a40de6938 Revamp the network detail page
1. Update the title to be wifi name
2. Add "Advanced" category

Bug: 68029969
Test: Screenshot
Change-Id: Ie0502b22336de7af2c2b1b706b51f340685b2413
2017-12-18 11:12:29 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Pavel Grafov
d429225640 Block editing of locked down wifi network from details page.
Test: make ROBOTEST_FILTER=WifiDetailPreferenceControllerTest RunSettingsRoboTests
Bug: 68990370
Change-Id: Idceb064486afd93bc8b2f52d605a788520de8e56
2017-11-17 18:11:25 +00:00
Fan Zhang
7d5c9ace64 Add test and fix null keys in search providers.
- Add keys to some screens.
- Remove dynamic saved network/turst agent from search provider.
- Remove dynamic print services from printsettings.

Bug: 69384409
Test: atest
Change-Id: I62dce27d52585badb2a8953a05084e35dbae2f7d
2017-11-16 12:57:45 -08:00
jackqdyulei
fbede9c080 Add ConnectedAccessPointPreference
This preference contains:
1. All the logic from AccessPointPreference
2. Gear icon on the right

Bug: 68807544
Test: RunSettingsRoboTests & Screenshot
Change-Id: I128401d81b075c4e9c5ca711562de26e73147745
2017-11-06 12:27:26 -08:00
Eric Schwarzenbach
5345e0bd8d Merge "Show updated Speed Label on Wifi detail page." 2017-10-13 16:40:12 +00:00
Eric Schwarzenbach
389daf02ff Show updated Speed Label on Wifi detail page.
Fixes a bug where the detail page sometimes doesn't show a speed label
even when WifiSettings shows it. WifiSettings stores its connected
AccessPoint in a bundle on page load and connect. If that AccessPoint's
score cache doesn't have a score yet, it won't (can't) store it in the
bundle. If the score cache is then updated, it will display a score in
WifiSettings, but since the bundle has already been saved, the
AccessPoint that WifiNetworkDetailPage receives will not have a score.

This change modifies the preference to store the bundle only once the
user clicks the preference, so the detail page will be in sync with
WifiSettings.

Bug: 67607122
Test: manual
Change-Id: I6b33129b5a03b0e3e6d6e48ea48726e8dbe840b9
2017-10-10 15:22:56 -07:00
Tony Mantler
4e43cca7fd Delete usage of WifiTracker#getCurrentAccessPoints
Bug: 67640649
Test: RunSettingsRoboTests, manually search for saved AP
Change-Id: I5a243ccc49abf78551710011cabf0c7473270cc4
2017-10-10 15:12:02 -07:00
Tony Mantler
df2567cbad Make WifiTracker lifecycle aware
Bug: 66953027
Test: m -j checkbuild
Change-Id: I004c889b887a67614a5e0b6ae62fdbf8d6070ebd
2017-09-29 11:25:39 -07:00
Eric Schwarzenbach
79f3476021 Add since_visible_millis to Settings action logs.
This change adds a new action logging method on MetricsFeatureProvider
within Settings.

Uses the VisibilityLoggerMixin to calculate the elapsed time since
the fragment has been visible. Adds tagged data in
MetricsFeatureProvider#action() to store this elapsed time in
NOTIFICATION_SINCE_VISIBLE_MILLIS in MetricsEvents. Modifies the
LogWriter interface to accept variadic taggedData args in its action()
methods. Annotates the old subtype #action() methods as deprecated.

EventLogWriter also no longer casts the subtype values to strings before
sending them to MetricsLogger, so they are correctly stored as subtype
instead of package.

Bug: 65371699, 65631695
Test: make RunSettingsRoboTests
Change-Id: Iec6a61dd6a49ab237e2bdc4469fed45e89d9c380
2017-09-20 11:26:35 -07:00
Sundeep Ghuman
00685675c8 Merge "Gate WifiSettings verbose logging on toggle." into oc-mr1-dev am: 77aeb2a0a7
am: ea98db9946

Change-Id: I5b125c60c4cc39b8f8661b2eff6d19de0c1c5eff
2017-09-19 21:22:08 +00:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
Sundeep Ghuman
381987a8ce Gate WifiSettings verbose logging on toggle.
These aids in debugging bugreports, which are filed with verbose
logging.

Bug: b/64989100
Test: NA
Change-Id: Ife1940ddb5fdec997cc07304b8c160244ec8356b
2017-09-11 15:43:49 -07:00
Eric Schwarzenbach
5a7e46dd80 Add modify button to WifiNetworkDetailsFragment.
Adds pencil icon to Wifi Detail action bar to modify the network.
Modifies package/public visibility to allow the detail package to
use the WifiDialog. Listens for changes in WifiConfigurations to
propagate changes to the UI in WifiNetworkDetailsFragment.

Changes WifiNetworkDetail preference launch to conform to pattern
of other Settings apps. Removes unused WifiDetailActionBarObserver.

Bug: 36483704, 37082355
Test: make -j40 RunSettingsRoboTests
Change-Id: Ie9dc1892eaefdfad4a6bd7040bfc5dbf6236cfb4
2017-09-08 13:39:22 -07:00
Stephen Chen
fbc7a00a5c Merge "Make auto Wi-Fi summary text consistent with feature availability." into oc-mr1-dev am: 194638ac78
am: d2f9de37c7

Change-Id: Id8725588b14f6a74efbdb2065864f2fce1561873
2017-09-08 19:04:48 +00:00
TreeHugger Robot
194638ac78 Merge "Make auto Wi-Fi summary text consistent with feature availability." into oc-mr1-dev 2017-09-08 18:47:08 +00:00
Charles He
0a72c23393 Merge "Enforce wifi config lockdown on details page." into oc-mr1-dev am: 10adff1163
am: e7cf5e6221

Change-Id: I356a58cadd3e19e61d9585f08e47c9d4cdcf4318
2017-09-06 16:12:08 +00:00
Charles He
289af93896 Enforce wifi config lockdown on details page.
Fixes the bug that, on the new WifiDetailPreference page, the "Forget"
button is not disabled properly for wifi configs created and protected
by DevicePolicyManger.

Robolectric test to follow in a separate CL.

Test: manual, by locking down wifi config with TestDPC
Test: make RunSettingsRoboTests
Bug: 64971700
Bug: 65396674
Change-Id: I27740eabd5eb94415e4258c9c80f91df2d9ab476
2017-09-06 15:58:14 +00:00
Stephen Chen
8ffcbccbce Make auto Wi-Fi summary text consistent with feature availability.
"Turn Wi-Fi on automatically" feature is disabled when airplane mode or
battery saver mode is enabled, when Wi-Fi scanning is disabled, or when
network recommendations are disabled / scorer unset. This change
captures these negative cases in the summary text.

Bug: 65085700
Test: make ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest
RunSettingsRoboTests -j40
Change-Id: I2f2d22b5bef3ad03a28d34e79a27e6545cac557f
2017-09-05 13:51:58 -07:00
Sundeep Ghuman
8adf634a54 Merge "Scroll to top when user connects to a network." into oc-mr1-dev am: a253e1d416
am: 501975914c

Change-Id: Ic3489f58b427ee0be5b3ad39a801af02ec15835b
2017-08-25 00:57:11 +00:00
Sundeep Ghuman
055079ba38 Scroll to top when user connects to a network.
We now track when the user initiates a connection request, and upon
connection will scroll to the connected network.

Bug: 34093572
Test: Open wifi picker. Connect to a new or different network. The picker
should scroll to the top of list

Change-Id: I7bed31b0dd4f40333f76f8389612f7fd55f2620e
2017-08-16 17:51:31 -07:00
TreeHugger Robot
65e557754e Merge "onConnectedChanged should not update access points" 2017-08-10 23:35:07 +00:00
Eric Schwarzenbach
69fa528074 Fix issue where connected network sometimes doesn't update.
Ensures that the connected network Preference and WifiTracker have the
same reference so that updates to one propagate to the other.

Bug: 64124982
Test: manual
Change-Id: I1b838b1cf65da1b5aebf4f5f37f0df0c5e473dba
2017-08-08 16:08:19 -07:00
Sundeep Ghuman
45bb3a1a77 onConnectedChanged should not update access points
In WifiSettings, invocation of onConnectedChanged should not update
access points. This is controller by another callback,
onAccessPointsChanged. Furthermore, this is fired before any changes
have even been made to the AccessPoints.

This is exacerbating a problem where old scan results are not shown in
the WifiPicker, or sometimes the platform does not return any scan
results.

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

Change-Id: Ibbc067d9952525b4edd85389996509e9b17bb1bd
2017-07-31 13:23:02 -07:00
Eric Schwarzenbach
bc1cf7e260 Make only the "Add Network" WifiDialog fullscreen.
Fixes an issue where other instances of WifiDialog were being launched
fullscreen. Creates static methods for creating fullscreen and modal
WifiDialogs to make the style more explicit.

Bug: 63889135
Test: make -j40 RunSettingsRoboTests
Change-Id: I2200b5d7f817b9f69a6abb73bf2c04ea24556d19
2017-07-26 17:04:42 -07:00
Antony Sargent
1e69f27a41 Merge "Allow open password dialog for wrong-password wifi access points" into oc-dr1-dev
am: 9fb7a3b8b4

Change-Id: Ic44e0cf3972085439a603e25374d46447ebe7a8f
2017-07-26 16:18:50 +00:00
TreeHugger Robot
9fb7a3b8b4 Merge "Allow open password dialog for wrong-password wifi access points" into oc-dr1-dev 2017-07-26 10:53:30 +00:00
TreeHugger Robot
8eb816c940 Merge "Allow open password dialog for wrong-password wifi access points" 2017-07-26 07:23:37 +00:00
Antony Sargent
c00fedc639 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: I16c9c8b0d8380a0e26f9b23df6a8d012af6a2476
Merged-In: I929ca6892242059df157c01d6e9ea30e8d1c5e78
2017-07-26 07:00:51 +00:00