summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java10
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java3
2 files changed, 8 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
index 07057d6e..dfa45614 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
@@ -416,14 +416,14 @@ public class EipFragment extends Fragment implements Observer {
}
Log.d(TAG, "eip fragment eipStatus state: " + eipStatus.getState() + " - level: " + eipStatus.getLevel() + " - is reconnecting: " + eipStatus.isReconnecting());
- if (eipStatus.isConnecting() ) {
+ if (eipStatus.isConnecting()) {
setMainButtonEnabled(true);
showConnectionTransitionLayout(true);
locationButton.setText(getString(R.string.eip_status_start_pending));
locationButton.setLocationLoad(UNKNOWN);
locationButton.showBridgeIndicator(false);
locationButton.showRecommendedIndicator(false);
- mainDescription.setText(R.string.eip_state_insecure);
+ mainDescription.setText(null);
subDescription.setText(null);
} else if (eipStatus.isConnected()) {
setMainButtonEnabled(true);
@@ -436,7 +436,7 @@ public class EipFragment extends Fragment implements Observer {
mainDescription.setText(R.string.eip_state_connected);
subDescription.setText(null);
colorBackground();
- } else if(isOpenVpnRunningWithoutNetwork()){
+ } else if(isOpenVpnRunningWithoutNetwork()) {
Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork");
setMainButtonEnabled(true);
mainButton.updateState(true, false, true);
@@ -454,7 +454,7 @@ public class EipFragment extends Fragment implements Observer {
locationButton.setLocationLoad(UNKNOWN);
locationButton.showBridgeIndicator(false);
locationButton.showRecommendedIndicator(false);
- mainDescription.setText(R.string.eip_state_insecure);
+ mainDescription.setText(null);
subDescription.setText(R.string.reconnecting);
} else if (eipStatus.isDisconnecting()) {
setMainButtonEnabled(false);
@@ -515,7 +515,7 @@ public class EipFragment extends Fragment implements Observer {
}
private void showConnectionTransitionLayout(boolean isConnecting) {
- mainButton.updateState(true, true, false);
+ mainButton.updateState(true, isConnecting, false);
if (isConnecting) {
colorBackgroundALittle();
} else {
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
index 060e69f2..0dd4c26c 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
@@ -211,6 +211,9 @@ public class GatewaysManager {
public Load getLoadForLocation(@Nullable String name, TransportType transportType) {
Location location = getLocation(name);
+ if (location == null) {
+ return Load.UNKNOWN;
+ }
return Load.getLoadByValue(location.getAverageLoad(transportType));
}