Commit Graph

35 Commits

Author SHA1 Message Date
Weng Su
3cdc1a58a7 Fixed accessibility issues in VPN Settings
- Show "(required)" and errors in required fields to alert users

- Show "(optional)" below each optional field

Bug: 386025633
Flag: EXEMPT bugfix
Test: Manual testing
  atest WifiConfigController2Test
Change-Id: Iefbd68e6658af7b073db219b3e04e94805092759
2025-03-06 16:19:47 +08:00
Hansen Kurli
e49454db98 Create a new string to alert unsupported vpn start.
Test: Manual test
Change-Id: Ic32db48671335a59c3bf8b43065cfef7c39c2936
2023-11-21 13:29:27 +08:00
Hansen Kurli
1fd7fe6373 Use AlertDialog to alert Unsupported VPN type.
Follow up of aosp/2822270. Show an AlertDialog instead of a Toast
when starting an unsupported VPN type.

Test: Manual test
Change-Id: I2ffb1bd48dcb91624012c404b8a6eed1df9b0b8d
2023-11-13 20:46:38 +08:00
Hansen Kurli
eea7c3c8d5 Catch UnsupportedOperationException of startLegacyVpn
startLegacyVpn may throw UnsupportedOperationException. Instead
of crashing Settings, catch the exception and show a Toast.

Bug: 161776767
Test: Manual test, connect legacy vpn profile and observe Toast.
Change-Id: I5947f2043aa68478f659b34531202f225eab4568
2023-11-08 20:39:00 +08:00
Janis Danisevskis
146a0dab01 Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0
Keystore 2.0 no longer stores vpn profiles. It still offers a
Legacy VPN profile store, to access existing profiles.

Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
Change-Id: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
2021-03-03 22:30:48 -08:00
Lorenzo Colitti
1434c08600 Stop using ConnectivityManager for VPNs.
These methods have all moved to VpnManager.

Bug: 173331190
Test: atest SettingsRoboTests
Change-Id: I1dd57fa2213b1785a94ec9d6ab4cce3a5d2684ff
Merged-In: I1dd57fa2213b1785a94ec9d6ab4cce3a5d2684ff
2021-02-18 23:50:59 +09:00
Lorenzo Colitti
04d34ced59 Switch Settings from IConnectivityManager to VpnManager.
The VPN code is moving out of ConnectivityService to a new
VpnManagerService. Update Settings to call into the VpnManager
class instead of using the AIDL interface directly. This way,
the VPN code can be moved without touching Settings.

Bug: 173331190
Test: builds, boots
Test: manually verified VPN settings page
Change-Id: Id2731a166b5d6783acb1c711a54604b69aa8c0d7
2021-02-08 16:50:25 +09:00
sj.cha
26412bb907 Merge "Fix code for NPE when click add and cancel repeatly VPN profile" am: 70cae1ce8d
am: 2c0ba8b48e

Change-Id: I853372683440048c16141b0fb2b46bbc6f27e972
2019-04-09 11:44:05 -07:00
sj.cha
36b314c6e0 Fix code for NPE when click add and cancel repeatly VPN profile
Symptom: NPE is happened when click add and cancel repeatly VPN profile

Root Cause: Exception handling for ConfigDialog object

Steps to reproduce :
1. Go to VPN menu in Settings without Secure LockScreen
2. Click add VPN profile button
3. Keyguard dialog show
4. Click cancel button
5. Repeat 2 - 4 step

Test: refer a "Steps to reproduce"

Solution: Add exception handling for ConfigDialog object. This is a very rare case. But exception handling code should be needed.

Signed-off-by: SangJin Cha <sj.cha@lge.com>
Change-Id: I4c680b383f94c86a1c806d986e56f9f00d2be10e
2019-03-27 09:19:33 +09:00
Pavel Grafov
e1dd64ef2e Merge "Update to use new ConnectivityManager API." am: 70b1830e7e am: 7c47743851
am: 3184142cbe

Change-Id: I6bc7277d0f1db1576b369443719c449fc8eeed75
2019-01-28 22:14:17 -08:00
Pavel Grafov
6a0a7be9a2 Update to use new ConnectivityManager API.
Bug: 77468593
Test: builds
Change-Id: I1fa542e015add2dd8b0e8620f2021c1a5c1c9f1a
2019-01-25 18:58:17 +00:00
Dan Albert
6e91f68ae4 Revert "Update to use new ConnectivityManager API."
This reverts commit 9a9f6f313b.

Reason for revert: broke pi-dev-plus-aosp

Change-Id: Ia0ff7cdf77b4edf3bdf5e4c54376b730df48373e
2019-01-24 21:06:02 +00:00
Eran Messeri
1e9bd27e2b Further Credentials-related clean-up
Additional clean-up work related to removal of screenlock dependency
from the credentials installation flow:
* Move the CredentialStorage class to security/ so that Enterprise team
  owners could review changes to it.
* Remove the ConfigureKeyGuardDialog class as it is no longer used.
* Remove attempt to unlock KeyStore from VPN settings.
* Remove intents that will no longer be sent from the manifest.

Bug: 120901345
Test: m -j RunSettingsRoboTests
Test: Manual with CtsVerifier
Change-Id: Ia708ede3366892d74c148f3712a63858d5ab53b7
2019-01-24 16:26:25 +00:00
Pavel Grafov
9a9f6f313b Update to use new ConnectivityManager API.
Bug: 77468593
Test: builds
Change-Id: I614c20b9a1c6748614163766866bb59b15d794f1
Merged-In: I614c20b9a1c6748614163766866bb59b15d794f1
2019-01-23 19:53:01 +00:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Robin Lee
edfeaace61 resolve merge conflicts of cb1968148a to master
Test: make RunSettingsRoboTests
Change-Id: I436af9f0415b9ad7ea0ea53f4f68d337fdbaa0aa
2017-01-19 23:58:30 +00:00
insight.lee
03159e4c85 Clear VPN after Clear credentials if VPN is being established
1. There is no way to disconnect VPN after 'Clear credentials'
without removing whole Internet connection because VPN profile to
disconnect is removed when Clear credentials.

2. This commit checks whether VPN is being established or not when
Clear credentials and disconnect VPN if VPN is being established.
Lastly, this shows a toast message to inform VPN disconnected.

Test: manual - took a photo

Signed-off-by : Sungmin Lee <insight.lee@lge.com>
Bug: 29093779

Change-Id: Id5ea01c8731b3b0fca2a31d9d84e8c103952b377
2017-01-18 10:44:57 +09:00
Robin Lee
e7347dd8c0 Implement always-on VPN separate lockdown setting
Allows Settings to control whether always-on VPN is required for the
connection to complete, or if it is offered on a best-efforts basis.

Change-Id: I5eb273a99e7559adc66b05e647c9130a819f99d4
Test: runtest -x tests/app/src/com/android/settings/vpn2/VpnTests.java
Fix: 32420810
2016-12-20 15:20:43 +00:00
Robin Lee
4f0a0d0a40 VpnSettings: slightly more robust callback context
Test: runtest -x com/android/settings/vpn2/VpnTests.java
Change-Id: I45fa0509c56211602f6abd55a2f44cdf76f28829
2016-11-28 17:42:43 +00:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Robin Lee
b6f787c4df Show a disclaimer about enabling vpn lockdown
Lockdown is now the default option, not best-effort mode. It's easier
to shoot oneself in the foot now so we'll show a warning to explain that
before switching it on.

Bug: 29052115
Bug: 29076208
Test: com.android.settings.vpn2.AppSettingsTest
Change-Id: Ia6845e6a7d57baa5476b8a021fb1255fd74aabea
2016-10-07 16:27:27 +01:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -07:00
Robin Lee
23e53b39c4 Be more defensive on failure to disconnect legacy VPNs
Failing to disconnect but deleting the keystore entry anyway makes
it difficult to do anything about a still-running connection.

Also switching over from prepareVpn(x,x) to prepareVpn(null,x) which
helps avoid race conditions where in between the getLegacyVpnInfo and
prepareVpn calls a 3rd-party app started a connection, which would break
the disconnect but still register as success.

Bug: 23529835
Bug: 29032008
Change-Id: Iedce784cb0eafbf75fe015dd2b3d355fcd887abf
2016-08-12 15:59:01 +00:00
Robin Lee
dfd2fc6d06 Don't crash trying to disable lockdown VPN
Bug: 28624328
Change-Id: I2b726453da43feaf5f46d45679a702a52e6f4df0
2016-05-17 14:58:32 +01:00
Robin Lee
cdebe28c15 Add lockdownEnabled parameter to always-on VPN API
Allows callers to opt-out of blockading network traffic during boot and
on VPN app failure.

Bug: 26694104
Change-Id: Ic2c25b79d8a17917025eb37be7de929fe156e2a3
2016-05-03 13:27:05 +01:00
Robin Lee
20ddd1c57b Include login/alwayson in legacy VPN editor dialog
A little more consistent with the new app VPNs' dialogs. To make this
work it was also necessary to restart the lockdown VPN every time it is
edited, which makes sense because the expected action after editing a
VPN is that it reconnects with the new settings.

Bug: 28072644
Change-Id: I4b6a6f0a6ed96d2ec6f62889fdae4abb60d0646c
2016-04-13 14:57:54 +01:00
Victor Chang
6005aefd44 Remove VPN Overflow menu
- Move always-on option for legacy vpn into the legacy vpn config page
- This implementation doesn't show dialogue when replacing existing always-on vpn
- Continue to disable lockdown option for legacy vpn when "persist.radio.imsregrequired" is true.
  Not applying to vpn app
- Force to save account info when legacy vpn is always-on
- When legacy vpn is always-on, don't try to connect. (Otherwise, an exception is thrown)

TODO: Remove EXTRA_PICK_LOCKDOWN in LockdownVpnTracker in framework

Bug: 26950700
Change-Id: Ia80669359c0b7cdb955c84937156c020ac6e9af5
2016-03-29 17:28:36 +01:00
Robin Lee
4c85639733 [VPN] save public legacy VPN details publicly
This does not include certificates, private keys etc. which are still
saved in the KeyStore with the encryption the user requested for them.

Makes connecting to lockdown vpn before user unlock possible.

Bug: 26108660
Change-Id: I56c1672c7a41e761c2791584b99900aff51b59e4
2016-01-05 18:48:46 +00:00
Lorenzo Colitti
c311c94af5 Unconfigure the lockdown VPN if the user forgets its profile.
Currently, if the user clicks "forget" on the configuration
dialog for the profile that is currently being used by the
always-on VPN, we don't disable the lockdown VPN, and we crash
on next boot because ConnectivityService tries to start
LockdownVpnTracker with an invalid configuration.

Fix this by removing the LOCKDOWN_VPN variable in the keystore
(which disables the always-on VPN), and notifying
ConnectivityService.

Bug: 23625458
Change-Id: I3545286c9fc23517306aa94607a4b2cb55cc56c4
2015-10-13 15:23:38 +09:00
Robin Lee
290784afde Match getLegacyVpn calls to changed interface
The userId argument is now explicit. Pre-requisite for bug 21499103

Change-Id: Ib83e9615326ea484ef6d63fb1a1d9c1659999dab
2015-07-07 12:35:14 -07:00
Robin Lee
01b35bcae3 VPN: UI for forgetting disconnected VPNs
Made possible by expanded internal VPN APIs.

Bug: 20872408
Bug: 20692490
Bug: 20747154
Change-Id: Idc87084a130afa18b27c85cc9d4b5033dcedaabe
2015-05-18 22:55:15 +01:00
Robin Lee
2bd92d5d06 vpn2: show third-party VPN services
VPN apps are shown alongside configured VPNs now. The requirement that
a password is set is now only enforced when setting up a configured
VPN as this is not necessary for apps.

Some UI redesign.

Bug: 19573824
Bug: 17474682
Bug: 19575658
Change-Id: I02bd977136929647d65b9784fb4cc5df24b45428
2015-04-21 19:42:53 +01:00