Commit Graph

23 Commits

Author SHA1 Message Date
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
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
Aurimas Liutikas
b1af85d155 Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
2018-08-28 11:48:56 -07:00
Fan Zhang
615563db0c Migrate more subsetting launching to SubSettingLauncher
Bug: 73250851
Test: robotests
Change-Id: Ic0bf23f6ac6f717bdd3d477fdb84af68badae8e6
2018-02-15 15:39:56 -08:00
Charles He
fc1ce57b13 Disable always-on VPN options if an app has opted out.
The user can turn on / off always-on for individual VPN apps in
Settings > Network > VPN. Now that we're providing an opt-out of the
always-on feature for VPN apps, we should disabled the toggles if the
VPN app has an explicit opt-out.

Related unit tests are also removed as the check is now performed in the
frameworks, not in Settings.

Bug: 36650087
Test: CTS Verifier

Change-Id: I486fec14a1f8b86e7120dbdbfed3885801ab4dd7
2017-06-27 14:14:31 +01:00
Robin Lee
b8b310df17 VPN: uncheck lockdown if always-on is off
Change-Id: I00933e0c8567997d800f9f31f78c7b19922a52b8
Fix: 36713605
Test: make RunSettingsRoboTests -j30
2017-03-30 16:01:02 +00:00
Charles He
cce4e61260 VPN settings: update strings for always-on VPN
To conform with UX guidelines and conventions, the following changes are
made to the UI of app VPN's PreferenceFragment:
(1. Always-on toggle title stays the same)
2. Always-on toggle subtext changes from "active"/"inactive" to an
explanation of the feature
3. Lockdown toggle title is shortened
4. Lockdown toggle subtext is removed completely

And the following changes are made to the legacy VPN's ConfigDialog:
5. Error message that is displayed below the "Always-on VPN" checkbox
6. Replacing \u2019 with \'

Bug: 36382729
Test: manually navigate through VPN settings
Test: make SettingsRoboTests
Change-Id: If1b4faec8743dfbf6e3f8062b53190ad63700d25
2017-03-24 16:02:57 +00:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08: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
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
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Robin Lee
490849b391 VpnSettings stub unit tests
For:
 - enforcing minimum target SDK
 - enforcing that only actual vpn apps are shown

Bug: 30355704
Change-Id: I4fcbea8ce0d0417c089a637d999ea83299cea5d0
2016-07-28 12:45:03 +00:00
Victor Chang
fcb0d74a3c Fix always-on is not turned off when user forgets vpn
Change-Id: Iad285ff06abde71ef040cbb29f740bcf20c3bbb7
Fix: 29991174
2016-07-06 18:27:55 +01:00
Victor Chang
52247f69a5 Add explanatory text displayed when 'Always-on' switch is greyed-out for VPN apps w/targetSdk<24
Bug: 28413917
Change-Id: I3e7c079b4f91c02e5d0c0e8fda4ac6775dd0247b
2016-06-27 18:07:35 +01:00
Robin Lee
cfc0fb02c1 Restrict Settings always-on to NYC+
Bug: 28413917
Change-Id: I1c40bdc94bb05d21daf589840adbbf04abe6c10f
2016-06-06 17:04:36 +00:00
Robin Lee
52541536d0 Disable restricted VPN actions onResume
Otherwise it's pretty easy to circumvent any future restrictions by
keeping VPN settings for a particular app open and continuing to use
it even after DISALLOW_CONFIG_VPN is applied.

Two checks:
 1) in onResume (catches almost every case)
 2) in setAlwaysOn (catches every remaining case)

Bug: 28733079
Change-Id: I1c67bb14891ef620df5ed65fbd32678e417b4a65
2016-06-01 11:32: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
2821067709 Change VPN failure notification to dialog
It's pointless, verging on antipattern, to pop up a notification that
points to the screen we're already on, especially when that notification
is telling us something really high-priority ("your connection failed").

Change-Id: Idf0c219adcefd64b235960f3239a70b059213f7d
Fix: 27374485
2016-04-22 15:04:43 +01:00
Robin Lee
c9bf2ac95e Update "you're already connected to VPN" strings
Change-Id: I0e64a612b47655a0d74880bc45987c8cd2272ea8
Fix: 28303500
(cherry picked from commit 3e293cb63f)
2016-04-22 13:59:44 +00:00
Victor Chang
1b8855b211 Show notification when failing to turn on always-on vpn
- Notification icon is Settings icon
- VpnName is obtained as the same way as AppPreference
- Post notification as the current user with PendingIntent to VpnSettings to parent user
- Auto-cancel when user taps on the notification
- This implementation posts notification only when the failure happens sychronously
  (Assume ConnectivityService only unset always-on package immediately after calling setAlwaysOnVpnPackageForUser)

Bug:27374485
Change-Id: I0aee38498c8cc300dd8eb9687adcae5f9dc4f8af
2016-03-31 16:40:22 +01:00
Victor Chang
16da2aa450 Vpn settings per vpn
This CL adds a setting for each VPN
- When no_config_vpn user restriction is applied, user can't change anything in the page
- Launch the subsetting activity in the corresponding user to unlock keystore and force work challenge
- Show dialog when user replace always-on-VPN package
- When forget VPN, unset always-on-vpn

TODO: show per-VPN status in VPN list

Change-Id: Ica360ea44117db6a4ecfaed1eec6c188189c246c
2016-03-21 12:36:23 +00:00