Commit Graph

138 Commits

Author SHA1 Message Date
Fan Zhang
78d5efdfea Refactor hotspot into a full page
- Deprecated WifiAPEnabler, and copied most of its logic into various
  controllers and WifiTetherSettings.
- Added tests

Fix: 37253404
Fix: 36181835

Test: make RunSettingsRoboTests
Change-Id: Iad994d61b694ad7f1113d045a3e7500eeaec178b
2017-06-14 12:32:44 -07:00
Fan Zhang
cc07043497 Ensure wifi ssid cannot exceed 32 bytes.
Change-Id: I5c2c50ca8599f6843da47c01b9a0447e2c85d763
Fix: 36898746
Test: make RunSettingsRoboTests
2017-06-05 16:21:09 -07:00
Shinji Sogo
8b23c35954 Show security info in saved network list
When an access point linked to a saved network is not found,
security info should be shown in dialog of saved network.
Notes that in Android N this list is created with saved networks
and scan result, and that causes security info is not shown for
access points seen around user, but in Android O only saved
networks are used to create a list. That means security info is
shown for all access points listed in the screen.

Bug: 38102896
Test: make RunSettingsRoboTests

Change-Id: Ia0c5184ae7a1325f2628f4c08e29350c5793a08f
(cherry-pick of a8382c11f58ecbfbc5b8d908b97c53d59cf774fe)
2017-05-12 10:35:08 -07:00
Glen Kuhne
3c5bd235f3 Fix null pointer exception in wifi settings
Fixes a null pointer exception that can occur during setup wizard.

Bug: 37873425
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER=WifiConfigControllerTest
Change-Id: I40de883fae6ccde13ad264f9b8b2d9da9745eb24
2017-05-03 15:53:16 -07:00
Glen Kuhne
92119d7f55 Disable submit button when PSK pass is invalid
Modified the logic of when to enable the 'connect'/'save'(submit)
button.
PSK is now also recognized as invalid when over 63 characters in length.
Removed the 'isSavedAp' check that only applied the invalid password
check to new networks. Users must now modify networks with a valid psk.

While I was here: Fixed WifiSettingsUiTest from failing due to invalid
WIFI_PREFERENCES string

Bug: 37152520
Bug: 36709852
Test: runtest WifiSettingsUiTest & m RunSettingsRoboTests pass
Change-Id: I273560cbf9124d16034962a2084f36c93973ee83
2017-04-26 13:04:56 -07:00
Paul Stewart
9b26496d03 Allow user to specify EAP-SIM under PEAP
Allow the user to select EAP-SIM methods as a second phase after
an outer PEAP authentication.  This hides the "identity" and
"password" fields if one of these methods is selected.

Bug: 34835771
Test: Manual: Connect to PEAP/EAP-SIM AP
Change-Id: I7e448fbebd352a4b0facbfafa74afaff6b704386
2017-04-07 10:28:49 -07:00
Peter Qiu
ae727fbb73 wifi: managed Passpoint configurations in "Saved Networks" page
Instead of going through WifiTracker to retrieve saved network
configurations (including both WiFi networks and Passpoint provider
configurations), use the WifiManager's APIs to retrieve the
configurations directly, to avoid any unnecessary complexities.

Also update to use the appropriate APIs for configuration removal
based on the configuration type.

Bug: 34207710
Test: manual test by removing a Passpoint configuration from
      "Saved Networks" page.

Change-Id: I549cc484d8825b6c38895428c1b7941390bb5f1f
2017-03-29 13:57:32 -07:00
Salvador Martinez
2b55d2f527 Fixed talkback feedback for wifi menu am: 7c59e7ab53
am: ce18d5ea14

Change-Id: I6f1fc0922cfab21da53219e560a46d94156e3533
2016-09-27 21:59:34 +00:00
Salvador Martinez
7c59e7ab53 Fixed talkback feedback for wifi menu
When you go to add a existing or new access
point for wifi talkback would say the
incorrect thing when you tapped on the
advanced options dropdown menu toggle.
This fixes what talkback says to more
accurately reflect what the widget does.

Test: Accessibility Scanner
Bug: 31623421
Change-Id: I9a00c4e8723014b0b3097f046dbcd1de01636e76
2016-09-27 14:51:10 -07:00
Paul Stewart
aa5afb18fe Merge "Display connect button in the wifi connection menu" am: 9126cfba19
am: ace9f52725

* commit 'ace9f527253a5464308f8dd3aa97f841d5d2d996':
  Display connect button in the wifi connection menu

Change-Id: Ia72d92c7e50cfb316772609e561b34d0b8c62333
2016-05-27 15:06:06 +00:00
Pierre Imai
47f67c1ff7 Prevent multicast addresses in static Wifi config.
Change-Id: I1961b10d67d322fb863620813fe9039b63bb7895
2016-03-29 16:04:47 +09:00
Damien Vagner
41a57e23a3 Display connect button in the wifi connection menu
When you quickly try to reconnect after forgeting the AP, the connection
is in DISCONNECTED state and we may still display the connect button

Change-Id: I755a259fdf68fab470d7f69aa461f5bcedddfd5b
Signed-off-by: Damien Vagner <damienx.vagner@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2016-03-01 16:11:39 +08:00
Samuel Tan
18d9865388 WifiConfigController: set ca_path and ca_cert to null if unused
am: d147f0090c

* commit 'd147f0090ce28e1ad70f7a9b582dec91161139e8':
  WifiConfigController: set ca_path and ca_cert to null if unused
2016-02-20 00:12:03 +00:00
Samuel Tan
d147f0090c WifiConfigController: set ca_path and ca_cert to null if unused
The WPA supplicant ca_cert and ca_path directives should not
both be non-null, since our EAP settings logic only allows one
or the other to be used.

Modify logic in getConfig() to explicitly set ca_path or ca_cert
to null if it is not used. This explicit null value is necessary
to override a previously non-null value saved in an existing
configuration.

Also, always set the domain_suffix_match directive, which
will lead to this directive to be reset when the Domain
field is hidden.

BUG: 27194668
TEST: 1) Install custom ca certificate onto device as "testcert"
TEST: 2) Configure an EAP-TLS network with CA certificate
         "testcert", Domain "testdomain",
         User certificate "Do not provide", identity empty, and save.
TEST: 3) Read network variables in data/misc/wifi/wpa_supplicant.conf
         and ensure that ca_cert is "testcert", ca_path is not
         present, and domain_suffix_match is "testdomain".
TEST: 4) Modify that same EAP-TLS network configured in step 2 with
         CA certificate "Use system certificates", Domain "testdomain",
         User certificate "Do not provide", identity empty, and save.
TEST: 5) Read network variables in data/misc/wifi/wpa_supplicant.eonf
         and ensure that ca_cert is "keystore://CACERT_testcert",
         ca_path is not present, and domain_suffix_match is
         "testdomain".
TEST: 6) Modify that same EAP-TLS network configured in step 2 to be
         an EAP-PWD network. Leave Identity and Password blank, and
         save.
TEST: 7) Read network variables in data/misc/wifi/wpa_supplicant.eonf
         and ensure that ca_cert, ca_path, and domain_suffix_match are
         not present.

Change-Id: I547f3e359bc8e9b77e51e10e60356b857230636f
2016-02-19 09:01:21 -08:00
Samuel Tan
aedb058e1b Allow trusted system certificates to be used in EAP network configs
am: 2b16cd3920

* commit '2b16cd3920f95b2cd5c2426d81b5e1584ffc682d':
  Allow trusted system certificates to be used in EAP network configs
2016-02-09 18:24:20 +00:00
Samuel Tan
2b16cd3920 Allow trusted system certificates to be used in EAP network configs
Add an option to the "CA certificate" field of the EAP network
configuration menu, "Use system certificates". Choosing this option
will cause the trusted, pre-installed, system CA certificates
to be used to validate EAP servers during the authentication process.
This only applies to EAP-TLS, EAP-TTLS, and EAP-PEAP network
configurations, where the CA certificate option is available.

If the user selects "Use system certificates" and leaves the
"Domain" field empty, display a warning and prevent the
EAP network configuration from being saved. Such a configuration
would be insecure--the user should constrain the domain that
the system certificates can be used to validate.

BUG: 26879191
TEST: 1)  Set up AP connected to test RADIUS server.
TEST: 2)  Generate a self-signed cert (Cert 1)
TEST: 3)  Use Cert 1 to sign another cert (Cert 2) with common name
          "sub1.sub2.domain.com"
TEST: 4)  Setup RADIUS server, and configure it to present Cert 2 to EAP peer.
TEST: 5)  Build angler image with Cert 1 installed in
          /system/etc/security/cacerts/
TEST: 6)  Set up an AP connected to the RADIUS server to broadcast
          a WPA-Enterprise network.
TEST: 7)  On Angler, connect to this WPA-Enterprise network with settings:
            Network name: (AP SSID)
            Security: 802.1x EAP
            EAP method: TLS
            CA certificate: Use system certificates
            Domain: domain.com
            User certificate: (test certificate from RADIUS setup)
            Identity: (identity used for RADIUS setup)
TEST: 8)  Verify that we connect successfully to the AP.
TEST: 9)  Verify that connection still succeeds if Domain is set to
          "sub2.domain.com" and "sub1.sub2.domain.com".
TEST: 10) Verify that connection fails if Domain is set to
          "sub0.sub1.domain.com" and "otherdomain.com".
TEST: 11) Verify that network configuration cannot be saved, and an
          warning message "Must specify a domain" is displayed if Domain
          is left blank in the configuration in step 7
TEST: 12) Verify that the "Do not validate" option still appears in the
          CA certificate dropdown menu.

Change-Id: I346d4d301305719033b84ec4599bf3d57d9d4ee5
2016-02-08 08:54:42 -08:00
Samuel Tan
5e5038255c Correctly load saved EAP CA cert and user cert options
am: 3d8cdb10f6

* commit '3d8cdb10f6103a794e4cb68adb5de03a325d1c8f':
  Correctly load saved EAP CA cert and user cert options
2016-02-05 20:58:15 +00:00
Samuel Tan
3d8cdb10f6 Correctly load saved EAP CA cert and user cert options
Previously, we did not properly load the "Do not validate"
and "Do not provide" options for the CA certificate and
User certificate EAP network configuration fields respectively
when the user previously selected these options and saved the
configuration.

Fix this by properly checking the saved CA certificate and user
certificate aliases in the saved enterprise config.

BUG: 26686071
Change-Id: If180c611f7210718cfb11c0578545b6f027827b5
TEST: Saved EAP network with the abovementioned options.
TEST: Long-pressed saved network on Wifi menu and selected "Modify Network"
TEST: "Do not validate" and "Do not provide" options are re-loaded.
2016-02-03 13:29:54 -08:00
Samuel Tan
3848ddc1a0 Allow domain suffix match to be set in UI for EAP configurations
am: d54bbd5193

* commit 'd54bbd519303b8eb0a7822cea00c55ef5e4f6652':
  Allow domain suffix match to be set in UI for EAP configurations
2016-02-02 18:59:52 +00:00
Samuel Tan
d54bbd5193 Allow domain suffix match to be set in UI for EAP configurations
Add a "domain" field that allows the user to specify a domain
suffix match for an EAP network configuration. This field
will only be available when the user specifies a CA certificate for
an EAP-PEAP, EAP-TLS, or EAP-TTLS network. Under the hood, the
value entered into this field will be passed to WPA supplicant
as the |domain_suffix_match| configuration variable.

BUG: 25180141
Change-Id: Ib69b9519f475e90e40441ddff61c80be43cf624b
TEST: On angler, domain field appears for the EAP-PEAP, EAP-TLS
TEST: and EAP-TTLS networks.
2016-01-29 15:40:43 -08:00
Samuel Tan
57c329c9f9 Display warning if users does not provide CA cert in EAP config
Display an explicit warning in the WiFi configuration menu if
the user selects the option to not validate the EAP server (i.e.
does not provide a CA certificate) in an EAP configuration.

BUG: 26686071
Change-Id: I73620b60defdcf40865f8c67d5de24b5dad636f8
TEST: Warning appears when the abovementioned option is selected.
2016-01-27 14:10:40 -08:00
Samuel Tan
f827c929dd Add menu options for not specifying a EAP CA cert and User cert
Add the "Do not validate" and "Do not provide" menu
options for not providing a CA certificate and User certificate
respectively for EAP configurations.

Choosing these options are essentially equivalent to leaving
these fields alone as "(unspecified)" (when that option existed),
but now we require the user to make a conscious choice not to
provide these certificates.

BUG: 26686071
Change-Id: I4b9c07528d6d2ba3eb0787e7cfff69d05dd25679
TEST: Both the added options appear in the relevant menus.
TEST: Choosing both these added options in an EAP-TLS configuration
TEST: allows the configuration to be saved.
2016-01-27 14:10:34 -08:00
Samuel Tan
fffc5936b9 Disable configuring EAP-TLS without user certificate.
Disallow configuring EAP-TLS without a user certificate,
since this is probably an invalid configuration.

Also:
- change the wording of the default option for
  EAP CA and user certificates from "(unspecified)" to
  "Please select", to make it obvious that a choice
  needs to be made to proceed.
- Fix style issues found in WifiConfigController.java by checkstyle.py.

BUG: 26686071
Change-Id: I7ccfdf40db97328e3297a03cc43033ff2428980f
TEST: Save option is grayed out when configuring EAP-TLS network
TEST: while leaving "User Certificate" left at "Please select".
2016-01-27 14:10:25 -08:00
Samuel Tan
03a117bcfa Display warning if users does not provide CA cert in EAP config
Display an explicit warning in the WiFi configuration menu if
the user selects the option to not validate the EAP server (i.e.
does not provide a CA certificate) in an EAP configuration.

BUG: 26686071
Change-Id: I73620b60defdcf40865f8c67d5de24b5dad636f8
TEST: Warning appears when the abovementioned option is selected.
2016-01-26 17:45:32 -08:00
Samuel Tan
30f7b5a7cf Add menu options for not specifying a EAP CA cert and User cert
Add the "Do not validate" and "Do not provide" menu
options for not providing a CA certificate and User certificate
respectively for EAP configurations.

Choosing these options are essentially equivalent to leaving
these fields alone as "(unspecified)" (when that option existed),
but now we require the user to make a conscious choice not to
provide these certificates.

BUG: 26686071
Change-Id: I4b9c07528d6d2ba3eb0787e7cfff69d05dd25679
TEST: Both the added options appear in the relevant menus.
TEST: Choosing both these added options in an EAP-TLS configuration
TEST: allows the configuration to be saved.
2016-01-26 17:45:32 -08:00
Samuel Tan
933b6ed98f Disable configuring EAP-TLS without user certificate.
Disallow configuring EAP-TLS without a user certificate,
since this is probably an invalid configuration.

Also:
- change the wording of the default option for
  EAP CA and user certificates from "(unspecified)" to
  "Please select", to make it obvious that a choice
  needs to be made to proceed.
- Fix style issues found in WifiConfigController.java by checkstyle.py.

BUG: 26686071
Change-Id: I7ccfdf40db97328e3297a03cc43033ff2428980f
TEST: Save option is grayed out when configuring EAP-TLS network
TEST: while leaving "User Certificate" left at "Please select".
2016-01-26 17:23:11 -08:00
Sanket Padawe
30e812b731 [DO NOT MERGE] Disable configuring EAP-TLS/TTLS/PEAP without CA certificates.
Bug: 15162357
Change-Id: I9b1be9837b104670adc1cc7ed47a5095ff38d335
2016-01-26 16:51:39 -08:00
Rubin Xu
b557817abc resolve merge conflicts of 55d7fcbfc2 to master.
Change-Id: Ib0876ea153e8a8f7c8ad5438915d39c9ae97e51b
2016-01-27 00:34:53 +00:00
Rubin Xu
e34ea11fca Support multiple CA certs when editing a saved Wifi network.
SSID with multiple CA certs can only be added programmtically. However it
can still be edited in the UI by long-pressing the item when currently
connected to the network. This change makes sure the UI shows up with
 meaningful indications that the SSID is configured with multiple CA certs.

Bug: 22547958
Change-Id: I5d42313efb141db521dd09ff3fbc520915b6fb79
2016-01-27 00:25:10 +00:00
Bartosz Fabianowski
1058c0cc3d Allow user to specify whether a new network is shared or private
* Add a check box to the WiFi configuration dialog that lets the user
  choose whether a newly created configuration is shared with other
  users (defaults to true)
* Disable the check box when modifying an existing network

BUG=25600871

Change-Id: Ifc6713602ee61b0407e55f45097c1b311fa19cb4
2016-01-25 18:47:39 +01:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Maurice Lam
771fac591f [WifiSettings] Add Wi-Fi dialog activity
Add a Wi-Fi dialog activity that can be started by setup wizard to
connect to a Wi-Fi access point.

Also refactored mEdit and mModify in WifiConfigController into an
int-enum mMode, with modes view, connect and modify. This is how the
new modes maps to the old flags:

MODE_VIEW     --  mEdit = false, mModify = *
MODE_CONNECT  --  mEdit = true, mModify = false
MODE_MODIFY   --  mEdit = true, mModify = true

Bug: 23426311
Change-Id: I8e2221fd3c42577068e07686dab245dd5888e0ae
2015-09-17 16:03:49 -07:00
Maurice Lam
2662df8433 [WifiSettings] Submit Wi-Fi dialog with enter key
Add a OnKeyListener for hardware keyboards and an
OnEditorActionListener for on-screen IMEs to submit the Wi-Fi dialog
with the currently entered information.

Before committing the action, check for whether the dialog is
submittable -- that is checking whether all necessary information has
been entered. If not the enter key behaves the same as it is before
the change.

Bug: 22211604
Change-Id: Idede4233a7385d3bcd8fd6614948270280536bf1
2015-09-14 12:07:06 -07:00
Sanket Padawe
a1423547cf Disable configuring EAP-TLS/TTLS/PEAP without CA certificates.
Bug: 15162357
Change-Id: I9b1be9837b104670adc1cc7ed47a5095ff38d335
2015-09-11 01:08:53 +00:00
Sanket Padawe
f1165c14c5 Avoid sending identity along with EAP sim, aka & aka'.
Bug: 22358498
Change-Id: I829b3f9fe688efc933483506e1b5944195e1975f
2015-08-11 18:42:36 -07:00
Sanket Padawe
3bf0db8d10 Fix issues in AP dialog arising after clicking on AP preferences.
+Added a new flag to keep track if user wanted to modify AP by hard
pressing on AP.

Bug: 22485686
Change-Id: Ia60a564a5344393f5e5340a3493ae7c660ead3d7
2015-07-24 13:52:03 -07:00
Sanket Padawe
8c5d5c8c56 Disable CA certificate for EAP-SIM, AKA & AKA'
Bug: 21877800
Change-Id: I66dbb12ebcf94c094d2a71d91d8b2eeef8cf6f48
2015-07-06 16:14:43 -07:00
Sanket Padawe
52dce9d334 Merge "Hide EAP SIM, AKA & AKA' choices in wifi Settings if device doesn't support." into mnc-dev 2015-06-28 02:45:48 +00:00
Sanket Padawe
94c0b0d436 Hide EAP SIM, AKA & AKA' choices in wifi Settings if device doesn't support.
Bug: 22014309
Change-Id: I606649cb4d2e13330afa89075ad074e7dc525f87
2015-06-26 15:57:43 -07:00
Shirish Kalele
1bcf050bf0 Use the ephemeral flag in the AccessPoint to mark a
connection as a Wifi Assistant connection.

Change-Id: Ife26f6799a5b9e4640181d150edb7455adf38f0f
2015-06-25 13:56:33 -07:00
Jason Monk
c68b46c1f2 Handle switch of ssid to CharSequence (for spans)
Change to reference the string directly for places like search,
etc.

Bug: 20059794
Change-Id: I3305c9833e8aeea52b968c094d0a1881a3e6699e
2015-06-15 10:09:55 -04:00
Alex Klyubin
3848407d0c Switch from KeyStore.saw to KeyStore.list.
KeyStore.saw was renamed to KeyStore.list for clarity. The
implementation of both methods is exactly the same.

Bug: 18088752
Change-Id: I2f171a4b7479683d5af898ebdf1b6f8a741536d1
2015-06-08 09:30:08 -07:00
Sanket Padawe
2816e4e3e0 Fix wifi network strings shown in Settings.
Bug: 21575915
Change-Id: I09d938aa03790119ebf6dc28fb6e00accab7d11d
2015-06-05 18:49:12 -07:00
Sanket Padawe
ecf4339bc7 Fix Eap method selection on screen rotation.
Bug: 19903254
Change-Id: I84322a785f9a4121c7885ada889a04129590e4ed
2015-05-27 18:04:23 -07:00
Sanket Padawe
b212629d92 Hotspot 2.0 UI for saved network.
Bug: 20182930
Change-Id: I455773f446dad323ed9cb559c2f2d69ca53af46c
2015-05-12 10:26:43 -07:00
Vinit Deshpande
a2fd307651 Implement 'Available via Passpoint' feature [DO NOT MERGE]
This also fixes the issues related to explicit connection
to passpoint AP, and fixes occassional mention of
'connected via Wi-Fi Assistent'

Change-Id: I152cebafa6259194f1d09a6972a3508156335cb6
(cherry picked from commit 08b5b5d439)
2015-04-29 19:32:50 +00:00
Zoltan Szatmary-Ban
89403529ad Show dialog when user tries to edit a locked down WiFi config
Also, 'FORGET' button is not shown on WifiDialogs of locked down configs.
Context menu only shows 'Connect' for them.

Bug: 20117316
Change-Id: I3fa986c10b6ff47d1a897794213c225c8c6f579b
2015-04-20 16:04:15 +01:00
Prerepa Viswanadham
1d7dc74b45 Merge commit '0507524' into merge_work 2015-04-10 15:43:14 -07:00
Vinit Deshpande
05075242db Enable UI for EAP-SIM/AKA/AKA'
We hide identity field for these; since dynamic
identities are now supported.

Change-Id: I5c6816b005ffbcdfa9aad953f5167d3dfd9de055
2015-03-31 12:36:35 -07:00
Prerepa Viswanadham
77eb8880e8 Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release' into master_merge
Fix build in DevelopmentSettings.java

Change-Id: I8d89fd46482fae8e708398f749e480b8a06f5f03
2015-03-24 19:08:43 -07:00