From b2bb1973fe32f2a52cb27155e525798c6a4eca6d Mon Sep 17 00:00:00 2001 From: Jeff Davidson Date: Fri, 22 Aug 2014 13:12:01 -0700 Subject: [PATCH] Restore legacy VPN stats dialog. Was originally removed in ag/522961, but restoring to keep legacy VPN behavior the same from within VpnSettings. This dialog is only accesible from VpnSettings and so should only ever be shown for legacy VPNs. Bug: 17164793 Change-Id: I06c4e136e1023b8f84edfd15a15264d2e41d325b --- src/com/android/settings/vpn2/VpnSettings.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index ab84654ad04..7516392732e 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -350,6 +350,15 @@ public class VpnSettings extends SettingsPreferenceFragment implements if (preference instanceof VpnPreference) { VpnProfile profile = ((VpnPreference) preference).getProfile(); + if (mInfo != null && profile.key.equals(mInfo.key) && + mInfo.state == LegacyVpnInfo.STATE_CONNECTED) { + try { + mInfo.intent.send(); + return true; + } catch (Exception e) { + // ignore + } + } mDialog = new VpnDialog(getActivity(), this, profile, false); } else { // Generate a new key. Here we just use the current time.