From 8833649c3468fce9cc40a0e94371049093c5dd7d Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 5 Dec 2013 01:45:51 +0100 Subject: Show location in openvpn notification message (Feature #4665) --- src/se/leap/openvpn/OpenVpnService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/se/leap/openvpn/OpenVpnService.java b/src/se/leap/openvpn/OpenVpnService.java index 69dd56f4..f5b932f2 100644 --- a/src/se/leap/openvpn/OpenVpnService.java +++ b/src/se/leap/openvpn/OpenVpnService.java @@ -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); @@ -481,6 +481,9 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac boolean persist = false; 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")){ + } else{ persist = true; -- cgit v1.2.3 From 72f1d170adbaa08ca846a0e4ec77556c9a7ffc7d Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 16 Dec 2013 20:02:54 +0100 Subject: remove 'Assigning IP address' from the progress notification (#4661) --- src/se/leap/bitmaskclient/EipServiceFragment.java | 5 ++++- src/se/leap/openvpn/OpenVpnService.java | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/se/leap/bitmaskclient/EipServiceFragment.java b/src/se/leap/bitmaskclient/EipServiceFragment.java index e182b3fd..b409394b 100644 --- a/src/se/leap/bitmaskclient/EipServiceFragment.java +++ b/src/se/leap/bitmaskclient/EipServiceFragment.java @@ -202,7 +202,10 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli switchState = false; } else if (state.equals("NOPROCESS")){ statusMessage = logmessage; - } else { + } else if (state.equals("ASSIGN_IP")){ //don't show assigning message in eipStatus + statusMessage = (String) eipStatus.getText(); + } + else { statusMessage = prefix + " " + logmessage; } diff --git a/src/se/leap/openvpn/OpenVpnService.java b/src/se/leap/openvpn/OpenVpnService.java index f5b932f2..b5c9c798 100644 --- a/src/se/leap/openvpn/OpenVpnService.java +++ b/src/se/leap/openvpn/OpenVpnService.java @@ -482,8 +482,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac 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")){ - + else if (state.equals("GET_CONFIG") || state.equals("ASSIGN_IP")){ //don't show them in the notification message } else{ persist = true; -- cgit v1.2.3 From 4d9b896481594297421a157a5906b5a8ead48ab6 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 16 Dec 2013 23:11:41 +0100 Subject: Correct the location name in the notification (Bug #4660) --- src/se/leap/bitmaskclient/EIP.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java index ec2f6972..edd73e83 100644 --- a/src/se/leap/bitmaskclient/EIP.java +++ b/src/se/leap/bitmaskclient/EIP.java @@ -439,7 +439,8 @@ public final class EIP extends IntentService { String ports = "ports"; String protos = "protocols"; String capabilities = "capabilities"; - String location = "location"; + String location_key = "location"; + String locations = "locations"; Vector arg = new Vector(); Vector> args = new Vector>(); @@ -456,7 +457,6 @@ public final class EIP extends IntentService { arg.add(word); value.add( (Vector) arg.clone() ); options.put(key, (Vector>) value.clone()); - value.clear(); arg.clear(); } @@ -477,16 +477,22 @@ public final class EIP extends IntentService { arg.clear(); args.clear(); + try { - arg.add(location); - arg.add(mGateway.getString(location)); + + arg.add(location_key); + String locationText = ""; + locationText = eipDefinition.getJSONObject(locations).getJSONObject(mGateway.getString(location_key)).getString("name"); + arg.add(locationText); + } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } args.add((Vector) arg.clone()); options.put("location", (Vector>) args.clone() ); + arg.clear(); args.clear(); JSONArray protocolsJSON = null; -- cgit v1.2.3