From 1b9a8b81428a8d9fc20da93d0e01c8bf8f674a03 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 18 Feb 2014 22:28:49 +0100 Subject: Fix not using low priority on CONNECTED state --- .../main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java | 2 +- main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'main/src') diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java index 08d28ca1..1937ffc0 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java @@ -429,7 +429,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement { return false; } - ParcelFileDescriptor pfd = mOpenVPNService.openTun(); + ParcelFileDescriptor pfd = mOpenVPNService.openTun(); if(pfd==null) return false; diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java index 1e9e14f1..0de791d6 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java @@ -638,6 +638,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac if (mProcessThread == null && !mNotificationAlwaysVisible) return; + boolean lowpriority = false; // Display byte count only after being connected { @@ -648,6 +649,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac } else if (level == LEVEL_CONNECTED) { mDisplayBytecount = true; mConnecttime = System.currentTimeMillis(); + lowpriority = true; } else { mDisplayBytecount = false; } @@ -655,8 +657,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac // Other notifications are shown, // This also mean we are no longer connected, ignore bytecount messages until next // CONNECTED - String ticker = getString(resid); - showNotification(getString(resid) + " " + logmessage, ticker, false, 0, level); + // Does not work :( + String msg = getString(resid); + String ticker = msg; + showNotification(msg + " " + logmessage, ticker, lowpriority , 0, level); } } -- cgit v1.2.3