From 7e3671e2bd04c0695d8b5bbdb1fe33b888253552 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 16 Apr 2013 20:17:45 +0200 Subject: Add states when requiring user input --- src/de/blinkt/openvpn/core/OpenVPN.java | 3 ++- src/de/blinkt/openvpn/core/OpenVpnService.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/de/blinkt/openvpn/core') diff --git a/src/de/blinkt/openvpn/core/OpenVPN.java b/src/de/blinkt/openvpn/core/OpenVPN.java index 2bc4cf6b..982a1e62 100644 --- a/src/de/blinkt/openvpn/core/OpenVPN.java +++ b/src/de/blinkt/openvpn/core/OpenVPN.java @@ -44,7 +44,8 @@ public class OpenVPN { public enum ConnectionStatus { LEVEL_NONETWORK (3), LEVEL_NOTCONNECTED (4), - LEVEL_AUTH_FAILED ( 5), + LEVEL_AUTH_FAILED (5), + LEVEL_WAITING_FOR_USER_INPUT (6), LEVEL_CONNECTING_SERVER_REPLIED ( 1), LEVEL_CONNECTING_NO_SERVER_REPLY_YET (2), LEVEL_CONNECTED (0), UNKNOWN_LEVEL(-1); diff --git a/src/de/blinkt/openvpn/core/OpenVpnService.java b/src/de/blinkt/openvpn/core/OpenVpnService.java index 4dba80f1..d86ae92b 100644 --- a/src/de/blinkt/openvpn/core/OpenVpnService.java +++ b/src/de/blinkt/openvpn/core/OpenVpnService.java @@ -541,7 +541,11 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac // Display byte count only after being connected { - if(level == ConnectionStatus.LEVEL_CONNECTED) { + if (level == ConnectionStatus.LEVEL_WAITING_FOR_USER_INPUT) { + // The user is presented a dialog of some kind, no need to inform the user + // with a notifcation + return; + } else if(level == ConnectionStatus.LEVEL_CONNECTED) { mDisplayBytecount = true; mConnecttime = System.currentTimeMillis(); } else { -- cgit v1.2.3