diff options
author | Fup Duck <fupduck@sacknagel.com> | 2018-02-25 15:47:49 +0100 |
---|---|---|
committer | Fup Duck <fupduck@sacknagel.com> | 2018-02-25 15:47:49 +0100 |
commit | 0bf176d8e925c71be7853c67f7c8b57d58df0ce3 (patch) | |
tree | a8fb1c4ef591a2dbaf6635f23878739cf212a918 /app/src/main | |
parent | 205c65cf94a9cc96e9b4d15e3ff60a3209cfbb60 (diff) |
8865 - set correct route as in 8824
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/EipFragment.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index 35693c9b..f80d15e7 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -44,8 +44,10 @@ import java.util.Observer; import butterknife.ButterKnife; import butterknife.InjectView; import butterknife.OnClick; +import de.blinkt.openvpn.VpnProfile; import de.blinkt.openvpn.core.IOpenVPNServiceInternal; import de.blinkt.openvpn.core.OpenVPNService; +import de.blinkt.openvpn.core.ProfileManager; import se.leap.bitmaskclient.eip.EipCommand; import se.leap.bitmaskclient.eip.EipStatus; import se.leap.bitmaskclient.views.VpnStateImage; @@ -376,7 +378,7 @@ public class EipFragment extends Fragment implements Observer { routedText.setText(R.string.vpn_securely_routed); routedText.setVisibility(VISIBLE); vpnRoute.setVisibility(VISIBLE); - vpnRoute.setText(ConfigHelper.getProviderName(preferences)); + setVpnRouteText(); colorBackground(); } else if(isOpenVpnRunningWithoutNetwork()){ mainButton.setText(activity.getString(R.string.vpn_button_turn_off)); @@ -385,7 +387,7 @@ public class EipFragment extends Fragment implements Observer { routedText.setText(R.string.vpn_securely_routed_no_internet); routedText.setVisibility(VISIBLE); vpnRoute.setVisibility(VISIBLE); - vpnRoute.setText(ConfigHelper.getProviderName(preferences)); + setVpnRouteText(); colorBackground(); } else { mainButton.setText(activity.getString(R.string.vpn_button_turn_on)); @@ -459,6 +461,15 @@ public class EipFragment extends Fragment implements Observer { } } + private void setVpnRouteText() { + String vpnRouteString = provider.getName(); + VpnProfile vpnProfile = ProfileManager.getLastConnectedVpn(); + if (vpnProfile != null && vpnProfile.mName != null) { + vpnRouteString += " (" + vpnProfile.mName + ")"; + } + vpnRoute.setText(vpnRouteString); + } + private class EipFragmentServiceConnection implements ServiceConnection { @Override public void onServiceConnected(ComponentName className, |