Commit Graph

194 Commits

Author SHA1 Message Date
PauloftheWest
d60f85daad Added WiFi Assistant settings.
+ Added ability to setup Wifi Assistant.
- Removed 'Avoid poor connections' from WiFi Advance Settings.
- Removed 'Optimize Wi-Fi' from WiFi Advance Settings.
+ Replaced checkboxes with switches in WifFI Advance Settings.
+ Added horizontal rule to seperate MAC/IP address text.

Bug: 15698824
Change-Id: Ia319ff5fb2566854666a07d0e77c8816a49fd3d6
2014-08-12 11:27:38 -07:00
Jeff Davidson
2e7162618d Clean up Wi-Fi Assistant card.
Use a ListView header instead of a Preference to display the card at
the top of the list.

Also clean some dead code.

Bug: 16378017
Change-Id: I5a7f1d197cde071c45395b6d7f6016aa7201187a
2014-08-11 14:07:55 -07:00
vandwalle
3b5e4e2421 The Settings app is listening to wpa_supplicant state change so as to update the state of the AccessPoint objects and present Wifi state to the user.
This is not right because wpa_supplicant states are transient (for instance when the WiFi Layer, at Layer 2, is going thru some harmless spurious disconnection cycle due to WiFi signal fluctuation). This cause the state of the WiFi Network to appear to be unstable to the user.

Hence, I removed dependencies on wpa_supplicant internal state.

In addition so as to improve debugging, I added the BSSID to the Wifi Verbose Logging string which is shown in wifi picker alongside the current network. This string only appear when a user goes into Developper Options and enable WiFi Verbose Logging.

The below bug is an example of situation where a spurious disconnect (a coupld seconds) handled by wpa_supplicant can cause the WiFi Settings to indicate that the link is unstable.

Bug:16140888 Wifi best network selection not smooth


Change-Id: I0e7c6b86262b88ed993c46fcdcdbab4d9b1f5ea1
2014-07-31 22:27:57 +00:00
PauloftheWest
fd19aff782 Fixed crash when changing orientation in the Add Networks dialog.
Bug: 16479540
Change-Id: Ib42977b72039f49b5d5ae688c0b0ded1094b44e2
2014-07-30 15:16:38 -07:00
PauloftheWest
0f8e031a34 Fixed a bug where Wi-Fi would should networks out of range.
Bug: 16569017
Change-Id: Ie2d094aed2fcb1b2471ae1105b6782105e6be5ce
2014-07-28 12:23:18 -07:00
Maurice Lam
2d4d9a9067 [WifiSetup] Don't show WiFi assistant card in WifiPickerActivity
Do not create the assistant card if we are in WifiPickerActivity,
which includes setup wizard and account login.

Bug: 16382431
Change-Id: Id5eaa8040eafe5222e1a5c9276a2a10bedebfd71
2014-07-25 17:55:49 -07:00
PauloftheWest
63a1affdae Fixed an illustrious NullPointer bug on Wifi Assistant
+ The class was never instantiated...

Bug: 16543506
Change-Id: I00882df31ee986116b8fa28a54796bb3b20f2e2b
2014-07-24 11:45:22 -07:00
Julia Reynolds
1a0297c544 Use restrictionsprovider framework in Settings.
Bug: 15305103

Change-Id: Ib0147e366fe90de3512d0cc06e2a47ee16012dff
2014-07-23 21:06:21 +00:00
Jeff Davidson
878ca0edb9 Merge "Link WifiAssistant card with actual settings." into lmp-dev 2014-07-17 21:04:20 +00:00
Maurice Lam
6a627652cb [WifiSetup] Mechanism for suspending auto finish
We have been using forget() to prevent auto-reconnection when the
user hits back to Wifi setup. This has the side effect of forgetting
networks, which is undesirable especially for password protected APs.

The new mechanism keeps a flag on whether the user has selected a
connection. Only auto-advance if the user has picked a network and
there is a valid WiFi connection.

The new EXTRA_REQUIRE_USER_SELECTION can specify whether a user
selection is required initially. That is, whether to auto finish if
the system connected to a network without user input. The default is
false so WiFi can be skipped if the user started setup wizard with
a valid WiFi connection (e.g. after System Update). Note that a user
selection is always required when the user goes back from the next
screen.

Since the new AP dialog does not have a connect button, the SKIP
button in the navigation bar also changes to NEXT when there is a
valid WiFi connection, so the user can hit NEXT if they decided not
to change the network.

Bug: 15333554
Bug: 15999487
Change-Id: I98e935b8e09e470a0c49c44bc299bb2eced98634
2014-07-17 20:47:04 -07:00
Jeff Davidson
873fa4f2ba Link WifiAssistant card with actual settings.
Only show the card if we haven't already enabled an assistant, and if
there's one available on the device to enable. (For now, we enable the
first one; in the future, we can offer a selection between
assistants).

When the user opts in, we either show the standard system activity or
the custom opt-in activity if the assistant has defined one. In either
case, we only dismiss the card if the child activity indicates that
opt-in was successful.

Bug: 16376277
Change-Id: Ic92c7676c563ab8c8fb695117a053004f15f7d25
2014-07-17 13:48:50 -07:00
PauloftheWest
060e01a93e Added Wifi Assistant Card
+ Show Wi-Fi Assistant card above network list that scroll under the action bar with the rest of the list
+ Display a promo image and text
+ Clicking "Setup" should link to the selected Wi-Fi assistant app (must be open to 3rd parties)
+ Touching "No, Thanks" should snooze this card for 30 days / 2nd time 90 / 3rd time 180 days / then forever

Bug: 15703202

Change-Id: If74101bea630246c6bda2de3ed79fee72eca4c0c
2014-07-16 15:46:09 -07:00
Fabrice Di Meglio
e6b336d1a0 FR #14318673 Search - add synonyms
- add synonyms to be indexed at the same time as titles and sub-titles
- fix Wi-Fi keywords

Change-Id: I1cb026775592c29c2b813153574c6695e3e90f31
2014-07-10 15:05:51 -07:00
PauloftheWest
7837b99986 Added Saved networks UI to Wifi
+ Added Saved networks to Overflow menu
+ Moved WPS Pin Entry from Overflow menu to Advance Setting Activity
+ "Automatically manage Wi-Fi : Let a Wi-Fi assistant manage your connection"
+ "Wi-Fi assistant : <selected assistant> [cog secondary hit target]
+ MAC address & IP address list items have the static italic style
- "Avoid poor connections" from Advance Settings
- "Wi-Fi optimization" from Advance Settings

Bug: 15698824

Change-Id: Ieb25b29874752db07398dcb200ec07862779f507
2014-07-08 11:26:22 -07:00
Fabrice Di Meglio
5bdf0423f9 Fix SettingsPreferenceFragment.startFragment()
- was always passing R.string.lock_settings_picker_title as a title res

Change-Id: Iab47ef3da00e91d5ce3b6dc50c50c943bd78b08f
2014-07-01 15:36:47 -07:00
PauloftheWest
b4564c39b7 Applied some minor UI changes (see below)
+ Changed wifi icons to teal
+ Removed “Secured with …” from network status
+ Added an empty state image above text when Wi-Fi is off
+ Removed Wi-Fi Direct and WPS Push button from overflow menu
+ Added Wi-Fi Direct and WPS Push button to Advance Activity
+ Input Password Dialog: Moved Signal Strength and Security to Advance
+ Input Password Dialog: Updated Password text to Material style

BugId: #15698824 #15702808
Change-Id: I542ab9aac2c098738330c92d9183d3907c4f0b38
2014-06-27 12:52:56 -07:00
Maurice Lam
9f59de930a [WifiSetup] Restore enableNext behavior
Partial revert of ag/475394 which moved enable-next-on-connect
behavior to setup wizard specific code. But account creation was
using it outside of setup wizard context.

Change-Id: I575976207a3ba2b5dac7e5467036e6ec7f519d9d
2014-06-20 15:27:25 -07:00
Fabrice Di Meglio
204521626f resolved conflicts for merge of f9360dbc to master
Change-Id: I2e468d83a7ce5200c59f63b4362e7bee10d0a2eb
2014-06-12 15:46:41 -07:00
Fabrice Di Meglio
138ff8c045 Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden
- save its state
- remove the delay transition code

Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
2014-06-12 11:13:23 -07:00
Russell Brenner
d3446c5708 Refactor setup wizard-related code
Extracted setup-related code from WifiSettings, putting it into a new
derived class, WifiSettingsForSetupWizard.

Set taskAffinity to com.android.wizard, for alignment with other
setup wizard-related tasks.

Change-Id: If371f219dac5d3eff8f7899c16cc6f9475be47cf
2014-05-30 16:16:30 -07:00
vandwalle
653cfeeb0a when vervbose logging, keep track of a list of ScanResults per AP
Change-Id: Ib8f797de360f11eb9914a6aa44d418e1d0571973
2014-05-22 15:03:48 -07:00
vandwalle
c9a6698fd4 make verbose logging a wifimanager hidden API
Change-Id: I092b7f507ad4dfdab16658929f02584a1fc22ba4
2014-05-21 20:25:15 -07:00
Andres Morales
5fe81c7cc8 Merge "Fix issues in Wi-Fi NFC tag code" 2014-05-15 23:42:40 +00:00
Andres Morales
ae04155bbe Fix issues in Wi-Fi NFC tag code
An NPE + multiple comments

Change-Id: I04ffe10874cc2e9aa9f68bc551b8da98eb6f1640
2014-05-15 16:34:51 -07:00
Fabrice Di Meglio
1303dbd52a Code cleaning
- remove obsolete imports

Change-Id: I6878498047ced7fd6405b84b76bc808ee5ff49fc
2014-05-15 14:32:32 -07:00
Fabrice Di Meglio
4193776698 Introduce SwitchBar widget
- SwitchBar is a LinearLayout that containts a TextView and a Switch and
is intended to replace all Switches that are put in the ActionBar as a
custom view
- use the new SwitchBar for WifiSetting only for now (a later CL will
take care of all the other Setting that are using a Switch in the
ActionBar)

Related to bug #14898161 On/Off switches must move down from Action Bar

Change-Id: I5e98dbe995bba8f440d08459e09ca3ac09d3464b
2014-05-14 16:42:06 -07:00
Maurice Lam
a1ebae6f71 [WifiSettings] Fix NullPointerException during setup
The wifi setup activity that setup wizard uses does not have an
action bar.

bug: 14930301
Change-Id: I14f276c1932cb725bffd765faafc0edf6f1d54f6
2014-05-14 10:18:55 -07:00
Fabrice Di Meglio
15826d4ea1 Mode code cleaning: remove obsolete references to EXTRA_NO_HEADERS
- the EXTRA_NO_HEADERS flag as no more meaning as we are showing
the Tiles (previously named "Headers") only in the Dashboard
(which is the main Settings screen)

Change-Id: I55656de0d28ca9c84adbe6647d870838b4ac230b
2014-05-13 13:10:34 -07:00
Fabrice Di Meglio
255743990c Make the WiFi switch appear again
- use the ActionBar Theme context when creating the Switch for
getting the correct Theming

Change-Id: I1c44e1b1c28bf02af4c2ac9912295106d93a60e8
2014-04-18 16:18:26 -07:00
Andres Morales
a298f077c8 Merge "Write wifi config to NFC tag" 2014-04-16 17:19:05 +00:00
Fabrice Di Meglio
45f754e506 Add Indexable.SearchIndexProvider.getNonIndexableKeys(Context)
- getNonIndexableKeys(Context) allow a SearchIndexProvider to tell which data
he does not want to index by providing a list of the data keys
- use this new API for SoundSettings and removing KEY_EMERGENCY_TONE related
settings if the device is not CDMA
- add a BaseSearchIndexProvider for code simplification

Change-Id: I23633ace1d7e390ee05fac0a5458a33e04e72d8d
2014-04-11 11:16:33 -07:00
Andres Morales
ef7a40a0d6 Write wifi config to NFC tag
Configured networks expose the option to
write config to an NFC tag. This tag can be
then tapped to another device to configure
the same network. Implemented according to
WiFi Alliance WPS spec.

Change-Id: I33a1be1610aab71cf1ab864418d494027370ebca
2014-04-10 10:25:50 -07:00
Fabrice Di Meglio
86ea97f452 Re-enable on/off switch for Wi-Fi and Bluetooth Settings
- the switch was no more there when launching from an Intent (it was a regression)

Change-Id: I1fc95cad4523a1d3812323fb26908f925a9e623e
2014-04-03 13:57:56 -07:00
Fabrice Di Meglio
d25314d330 Settings - update for new UI (no more Drawer)
- follow the UX spec by no more using a Drawer
- the Dashboard is now a Fragment that contains the list of Headers
- the search results are also put into a Fragment that is replacing
the initial one (Dashboard or other) when expanding the SearchView
- use a SearchView for query input
- when tapping on a Header or a Search Result, re-launch Settings as
an Activity so that we are benefiting from the Activity stack for
UP affordance and BACK button
- manage UP affordance to show it only when needed
- move some Actions to the Menu in the ActionBar for allowing space
to the Search action and removing some clutter
- fix an issue with the Index and WiFiEnabler and their cached Context
that was not updated when there was a Configuration change
- simplify the SettingsActivity code by extracting some inner classes

Change-Id: I50b5f77bb44a7fade1886114dbbc820609a5e63d
2014-03-28 15:51:29 -07:00
Fabrice Di Meglio
5f3442af6f Use SearchIndexableData enable state for WiFi Settings
- same as for Bluetooth
- now the remembered WiFi networks names can be indexed when
WiFi is turned on

Change-Id: I904ce6a425c21ee07ce3ee8fdc0cd71ab5a18d12
2014-03-21 13:50:25 -07:00
Fabrice Di Meglio
51bfee595c Add dynamic Preferences indexing (part 2)
- change the Index SQL model. Add a new "enabled" column.
- use that column for issuing a more restrictive search query
- change the SearchIndexProvider API to pass the "enable" state
- apply it to Bluetooth settings
- refactor the list of indexable resources (SearchIndexableResources)

Change-Id: Ic900fb27cb12a285a80d953aa1aa88f0070cd986
2014-03-20 20:40:04 -07:00
Fabrice Di Meglio
fa7dc240e9 Add external Preferences indexing
- define SettingsSearchIndexablesProvider as an internal
SearchIndexablesProvider
- protect access thru using android.permission.READ_SEARCH_INDEXABLES
- update WallpaperTypeSettings and WifiSettings for taking care of
the new model
- update the Dashboard for taking care about external Icons for the
search result
- update sqlite model/version for taking care about Intents
(enable launching external applications for showing the settings)

Change-Id: I2e38599327e6480f1754f52666becce0884cee9d
2014-03-19 14:56:09 -07:00
Fabrice Di Meglio
6c9e03fd6d More code cleaning
- use var for context.getResources()
- rename var

Change-Id: I8b8b7ffdd2c83bdbec7a4f162757597032aa9fb0
2014-03-12 17:19:39 -07:00
Fabrice Di Meglio
757450247d Merge "Add dynamic Preferences indexing" 2014-03-12 19:58:06 +00:00
Fabrice Di Meglio
b8dfbf1409 Add dynamic Preferences indexing
- introduce a new private interface "Indexable".
- refactor Wallpaper and Wi-Fi settings to support this new
interface.
- only index saved/remembered Wi-Fi networks
- also add the capability to remove some data from the Index.

Fragments that want to publish some dynamic indexable data should
implement the "Indexable" interface and provide a static final field
named "INDEX_DATA_PROVIDER" with is the Indexable.IndexDataProvider
interface for providing the data for indexing.

Thru this interface the Index can ask what are the data chuncks to
index.

Change-Id: I31e7212c87b8218efe1a8f3028147cb19e119be6
2014-03-12 11:34:59 -07:00
Fabrice Di Meglio
565d8b7bcc Fix bug #13327889 Launching Wifi setting using available wifi network
...notification does not show ON/OFF button for wifi

- the notification was launching the WifiPickerActivity which is
a PreferenceActivity, so take care of this case too.

Change-Id: I64f58d4b9f75141626bb6f0266cf2f17fbb39fc7
2014-03-05 17:27:50 -08:00
Fabrice Di Meglio
263bcc8b73 Use Drawer in Settings app
- get rid of PreferenceActivity as much as we can and use fragments instead
- add Drawer widget
- add Dashboard high level entry into the Drawer (but this is work in progress and would be done in another CL)
- add bypass of fragment's Header  validation when launched from the Drawer but *force* validation if external
call thru an Intent

Be aware that WifiPickerActivity should remain for now a PreferenceActivity. It is used by SetupWizard and should
not trigger running the SettingsActivity's header building code. SetupWizard is a Home during the provisionnig process
and then deactivate itself as a Home but would make the Home header to appear in the Drawer (because momentarily we
would have two Home).

Also, verified that:

- the WiFi settings still work when called from SetupWizard
- when you have multiple Launchers, the Home header will appear in the list of Headers in the Drawer

Change-Id: I407a5e0fdd843ad7615d3d511c416a44e3d97c90
2014-02-03 16:36:46 -08:00
Russell Brenner
ac57f3e1eb Add resources for light theme
Bug: 10407819
Change-Id: Ie232b2d48a8d67355d7c31a878ebaa79aae7c44d
2013-08-30 10:10:02 -07:00
Geoffrey Borggaard
e38ea38002 Adds a base class for restricted settings
Creates an easy way to ask for the restriction pin before
allowing access to a settings page.  Does this to the WiFiSettings.

Change-Id: I49734f66e09b6449596412ecf6fc1113bf57ce7f
2013-08-02 17:07:21 -04:00
Birdson_Chen
2dcf6083f7 Fix "Add Network" show last selected WiFi AP Dialog
When user taps Wi-Fi add network button, the pop-up dialog is not empty (it shows last selected WiFi AP Dialog).
The above is observed after the following steps:
- Launch Settings application
- Turn on Wi-Fi
- Select any Wi-Fi Access Point which is not connected previously and change to portrait mode
- Press Cancel from the pop-up and select Add Network icon in menu

Because the "Rotation" operation will cause WifiDialog re-creating and the current settings
of selected Wi-Fi Access Point is saved before WifiDialog destroyed.
Then, the saved Wi-Fi Access Point is displayed when user tap on "Add Network".

It need to clear the saved Wi-Fi Access Point when WifiDialog re-creating.

Change-Id: I3e93943e5bee405329e309c3ec88a35ee9cafc43
2013-07-29 10:37:36 +08:00
Robert Greenwalt
5ac904321d Don't show scan-always text if it is off.
bug:9206410
Change-Id: If7e06f50d3d8db6ea198f437d4d268e65ec96c16
2013-05-30 11:33:36 -07:00
Russell Brenner
765f55f52a Improved logic for Skip warning message
Use ConnectivityManager instead of TelephonyManager to determine
how device is connected.

Bug: 9118704
Change-Id: I5c1db90500591ca67e927976066a46e1f66e2e60
2013-05-24 16:09:39 -07:00
Robert Greenwalt
7e59f73e9c Remove wifi scan-always dialog.
When wifi is switched off we no longer want a notification dialog
about scan-always, instead using in-panel text.

bug:8907190
Change-Id: I707f306a056068d92f69070873f1e6330b598b1e
2013-05-13 11:39:08 -07:00
Maggie Benthall
91c016de41 UI compliance for WifiSettings
Rename and reword string that appears in WifiSettings when user is 
restricted from modifying the networks.

Bug: 8696370
Change-Id: I1945550c05163ebff9602e4ba8ba890fece61265
2013-04-24 19:21:10 +00:00
Maggie Benthall
7e61c23306 Implement Settings app UX for when a user has wifi config locked down.
When the user is restricted from configuring wifi:
- Leave the on/off button enabled
- Hide all menu options
- Hide all networks, and display a message saying:
 "This user is not allowed to configure wireless networks."

Change-Id: I20193b552ea071740686bd9091637459e9b668b5
2013-04-11 15:45:58 -04:00