diff options
Diffstat (limited to 'main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java index ce72f346..6d7e9a4b 100644 --- a/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -37,8 +37,8 @@ import de.blinkt.openvpn.VpnProfile; import de.blinkt.openvpn.core.ConfigParser;
import de.blinkt.openvpn.core.ConfigParser.ConfigParseError;
import de.blinkt.openvpn.core.ConnectionStatus;
+import de.blinkt.openvpn.core.IOpenVPNServiceInternal;
import de.blinkt.openvpn.core.OpenVPNService;
-import de.blinkt.openvpn.core.OpenVPNService.LocalBinder;
import de.blinkt.openvpn.core.ProfileManager;
import de.blinkt.openvpn.core.VPNLaunchHelper;
import de.blinkt.openvpn.core.VpnStatus;
@@ -52,7 +52,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { final RemoteCallbackList<IOpenVPNStatusCallback> mCallbacks =
new RemoteCallbackList<>();
- private OpenVPNService mService;
+ private IOpenVPNServiceInternal mService;
private ExternalAppDatabase mExtAppDb;
@@ -63,8 +63,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { public void onServiceConnected(ComponentName className,
IBinder service) {
// We've bound to LocalService, cast the IBinder and get LocalService instance
- LocalBinder binder = (LocalBinder) service;
- mService = binder.getService();
+ mService = (IOpenVPNServiceInternal) (service);
}
@Override
@@ -82,8 +81,12 @@ public class ExternalOpenVPNService extends Service implements StateListener { VpnProfile vp = ProfileManager.getLastConnectedVpn();
if (ProfileManager.isTempProfile()) {
if(intent.getPackage().equals(vp.mProfileCreator)) {
- if (mService != null && mService.getManagement() != null)
- mService.getManagement().stopVPN(false);
+ if (mService != null)
+ try {
+ mService.stopVPN(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
}
}
}
@@ -304,8 +307,8 @@ public class ExternalOpenVPNService extends Service implements StateListener { @Override
public void disconnect() throws RemoteException {
checkOpenVPNPermission();
- if (mService != null && mService.getManagement() != null)
- mService.getManagement().stopVPN(false);
+ if (mService != null)
+ mService.stopVPN(false);
}
@Override
@@ -347,9 +350,9 @@ public class ExternalOpenVPNService extends Service implements StateListener { public String state;
public String logmessage;
public ConnectionStatus level;
- public String vpnUUID;
+ String vpnUUID;
- public UpdateMessage(String state, String logmessage, ConnectionStatus level) {
+ UpdateMessage(String state, String logmessage, ConnectionStatus level) {
this.state = state;
this.logmessage = logmessage;
this.level = level;
@@ -367,6 +370,11 @@ public class ExternalOpenVPNService extends Service implements StateListener { }
+ @Override
+ public void setConnectedVPN(String uuid) {
+
+ }
+
private static final OpenVPNServiceHandler mHandler = new OpenVPNServiceHandler();
|