From 92432b6f64bc56fcb9f59eb40b65032eae18177b Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 8 Apr 2013 00:06:55 +0200 Subject: Fix status updates --- src/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/de') diff --git a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java index 9e6ac9f3..cab00599 100644 --- a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -72,6 +72,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { intent.setAction(OpenVpnService.START_SERVICE); bindService(intent, mConnection, Context.BIND_AUTO_CREATE); + mHandler.setService(this); } private final IOpenVPNAPIService.Stub mBinder = new IOpenVPNAPIService.Stub() { @@ -249,9 +250,17 @@ public class ExternalOpenVPNService extends Service implements StateListener { } - private static final Handler mHandler = new Handler() { + private static final OpenVPNServiceHandler mHandler = new OpenVPNServiceHandler(); + + + static class OpenVPNServiceHandler extends Handler { WeakReference service= null; + private void setService(ExternalOpenVPNService eos) + { + service = new WeakReference(eos); + } + @Override public void handleMessage(Message msg) { RemoteCallbackList callbacks; -- cgit v1.2.3