summaryrefslogtreecommitdiff
path: root/src/se/leap/openvpn/OpenVpnService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/leap/openvpn/OpenVpnService.java')
-rw-r--r--src/se/leap/openvpn/OpenVpnService.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/se/leap/openvpn/OpenVpnService.java b/src/se/leap/openvpn/OpenVpnService.java
index 620de204..b5c9c798 100644
--- a/src/se/leap/openvpn/OpenVpnService.java
+++ b/src/se/leap/openvpn/OpenVpnService.java
@@ -106,7 +106,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
String ns = Context.NOTIFICATION_SERVICE;
mNotificationManager = (NotificationManager) getSystemService(ns);
int icon;
- if (state.equals("NOPROCESS") || state.equals("AUTH_FAILED") || state.equals("NONETWORK")){
+ if (state.equals("NOPROCESS") || state.equals("AUTH_FAILED") || state.equals("NONETWORK") || state.equals("EXITING")){
icon = R.drawable.ic_vpn_disconnected;
}else{
icon = R.drawable.ic_stat_vpn;
@@ -114,7 +114,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
android.app.Notification.Builder nbuilder = new Notification.Builder(this);
- nbuilder.setContentTitle(getString(R.string.notifcation_title,mProfile.mName));
+ nbuilder.setContentTitle(getString(R.string.notifcation_title,mProfile.mLocation));
nbuilder.setContentText(msg);
nbuilder.setOnlyAlertOnce(true);
nbuilder.setOngoing(persistant);
@@ -350,12 +350,13 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
bconfig[4] = getString(R.string.routes_info, joinString(mRoutes));
bconfig[5] = getString(R.string.routes_info6, joinString(mRoutesv6));
- String session = mProfile.mName;
+ String session = mProfile.mLocation;
+ /* we don't want the IP address in the notification bar
if(mLocalIP!=null && mLocalIPv6!=null)
session = getString(R.string.session_ipv6string,session, mLocalIP, mLocalIPv6);
else if (mLocalIP !=null)
session= getString(R.string.session_ipv4string, session, mLocalIP);
-
+ */
builder.setSession(session);
@@ -478,9 +479,11 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
// CONNECTED
String ticker = getString(resid);
boolean persist = false;
- if (("NOPROCESS".equals(state) ) || ("EXIT").equals(state)){
+ if (("NOPROCESS".equals(state) ) || ("EXITING").equals(state)){
showNotification(state, getString(R.string.eip_state_not_connected), ticker, false, 0, persist);
}
+ else if (state.equals("GET_CONFIG") || state.equals("ASSIGN_IP")){ //don't show them in the notification message
+ }
else{
persist = true;
showNotification(state, getString(resid) +" " + logmessage,ticker,false,0,persist);