diff options
Diffstat (limited to 'src/de/blinkt')
-rw-r--r-- | src/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 16 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java index cab00599..2eee8d82 100644 --- a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -190,7 +190,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { checkOpenVPNPermission();
if (cb != null) {
- cb.newStatus(mMostRecentState.state,
+ cb.newStatus(mMostRecentState.vpnUUID, mMostRecentState.state,
mMostRecentState.logmessage, mMostRecentState.level.name());
mCallbacks.register(cb);
}
@@ -234,6 +234,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { public String state;
public String logmessage;
public ConnectionStatus level;
+ public String vpnUUID;
public UpdateMessage(String state, String logmessage, ConnectionStatus level) {
this.state = state;
@@ -245,14 +246,17 @@ public class ExternalOpenVPNService extends Service implements StateListener { @Override
public void updateState (String state, String logmessage, int resid, ConnectionStatus level) {
mMostRecentState = new UpdateMessage(state, logmessage, level);
+ if (ProfileManager.getLastConnectedVpn()!=null)
+ mMostRecentState.vpnUUID = ProfileManager.getLastConnectedVpn().getUUIDString();
+
Message msg = mHandler.obtainMessage(SEND_TOALL, mMostRecentState);
msg.sendToTarget();
-
+
}
private static final OpenVPNServiceHandler mHandler = new OpenVPNServiceHandler();
-
-
+
+
static class OpenVPNServiceHandler extends Handler {
WeakReference<ExternalOpenVPNService> service= null;
@@ -260,7 +264,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { {
service = new WeakReference<ExternalOpenVPNService>(eos);
}
-
+
@Override public void handleMessage(Message msg) {
RemoteCallbackList<IOpenVPNStatusCallback> callbacks;
@@ -290,7 +294,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { private void sendUpdate(IOpenVPNStatusCallback broadcastItem,
UpdateMessage um) throws RemoteException
{
- broadcastItem.newStatus(um.state, um.logmessage, um.level.name());
+ broadcastItem.newStatus(um.vpnUUID, um.state, um.logmessage, um.level.name());
}
};
diff --git a/src/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl b/src/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl index e1903485..1dfa1381 100644 --- a/src/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl +++ b/src/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl @@ -9,5 +9,5 @@ oneway interface IOpenVPNStatusCallback { /**
* Called when the service has a new status for you.
*/
- void newStatus(String state, String message, String level);
+ void newStatus(String uuid, String state, String message, String level);
}
|