summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-04-27 17:10:20 +0200
committerParménides GV <parmegv@sdf.org>2015-04-27 17:10:20 +0200
commit8707f9e9a07f8c53955df14ef9b26d13a0eb60da (patch)
treee39f6e0977439de8be63aebac34bc4daeee47fea /app/src/main
parentf349ab1a50d807afd49d8bef912438d64f6f6db8 (diff)
testEveryProvider also works
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java14
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/EipFragment.java34
-rw-r--r--app/src/main/res/values-es/strings.xml2
-rw-r--r--app/src/main/res/values/strings.xml2
4 files changed, 18 insertions, 34 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
index ddd03dbc..afc6b131 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
@@ -161,7 +161,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
providerToPreferences(provider);
buildDashboard(false);
- invalidateOptionsMenu();
+ invalidateOptionsMenuOnUiThread();
if (data.hasExtra(SessionDialog.TAG)) {
sessionDialog(Bundle.EMPTY);
}
@@ -322,7 +322,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
else
hideUserSessionProgressBar();
changeSessionStatusMessage(user_session_status.toString());
- invalidateOptionsMenu();
+ invalidateOptionsMenuOnUiThread();
}
}
@@ -432,7 +432,6 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
setResult(RESULT_CANCELED);
} else if (resultCode == ProviderAPI.CORRECTLY_DOWNLOADED_CERTIFICATE) {
eip_fragment.updateEipService();
- eip_fragment.handleNewVpnCertificate();
setResult(RESULT_OK);
} else if (resultCode == ProviderAPI.INCORRECTLY_DOWNLOADED_CERTIFICATE) {
setResult(RESULT_CANCELED);
@@ -453,4 +452,13 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
intent.putExtra(Dashboard.REQUEST_CODE, requestCode);
super.startActivityForResult(intent, requestCode);
}
+
+ public void invalidateOptionsMenuOnUiThread() {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ invalidateOptionsMenu();
+ }
+ });
+ }
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java
index a13cab09..6decacb7 100644
--- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java
@@ -111,10 +111,6 @@ public class EipFragment extends Fragment implements Observer {
saveStatus();
}
- void handleNewVpnCertificate() {
- handleIcon();
- }
-
private void handleSwitchOn() {
if (canStartEIP())
startEipFromScratch();
@@ -144,20 +140,20 @@ public class EipFragment extends Fragment implements Observer {
} else if (eip_status.isConnected()) {
askToStopEIP();
} else
- setDisconnectedUI();
+ updateIcon();
}
private void askPendingStartCancellation() {
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(dashboard);
alertBuilder.setTitle(dashboard.getString(R.string.eip_cancel_connect_title))
.setMessage(dashboard.getString(R.string.eip_cancel_connect_text))
- .setPositiveButton((R.string.yes), new DialogInterface.OnClickListener() {
+ .setPositiveButton((android.R.string.yes), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
askToStopEIP();
}
})
- .setNegativeButton(dashboard.getString(R.string.no), new DialogInterface.OnClickListener() {
+ .setNegativeButton(dashboard.getString(android.R.string.no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
@@ -193,13 +189,13 @@ public class EipFragment extends Fragment implements Observer {
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(dashboard);
alertBuilder.setTitle(dashboard.getString(R.string.eip_cancel_connect_title))
.setMessage(dashboard.getString(R.string.eip_warning_browser_inconsistency))
- .setPositiveButton((R.string.yes), new DialogInterface.OnClickListener() {
+ .setPositiveButton((android.R.string.yes), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
stopEipIfPossible();
}
})
- .setNegativeButton(dashboard.getString(R.string.no), new DialogInterface.OnClickListener() {
+ .setNegativeButton(dashboard.getString(android.R.string.no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
@@ -247,18 +243,10 @@ public class EipFragment extends Fragment implements Observer {
dashboard.showLog();
VoidVpnService.stop();
}
- adjustSwitch();
- }
-
- private void setConnectedUI() {
- adjustSwitch();
- }
-
- private void setDisconnectedUI() {
- adjustSwitch();
+ updateIcon();
}
- private void adjustSwitch() {
+ private void updateIcon() {
if (eip_status.isConnected() || eip_status.isConnecting()) {
if(eip_status.isConnecting()) {
vpn_status_image.showProgress(true);
@@ -273,13 +261,6 @@ public class EipFragment extends Fragment implements Observer {
}
}
- private void setInProgressUI(EipStatus eip_status) {
- adjustSwitch();
- }
-
- private void updatingCertificateUI() {
- }
-
protected class EIPReceiver extends ResultReceiver {
protected EIPReceiver(Handler handler) {
@@ -320,7 +301,6 @@ public class EipFragment extends Fragment implements Observer {
case Activity.RESULT_OK:
break;
case Activity.RESULT_CANCELED:
- updatingCertificateUI();
dashboard.downloadVpnCertificate();
break;
}
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 82ca44e9..42b8cce4 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -65,8 +65,6 @@
<string name="eip_cancel_connect_title">¿Abortar conexión?</string>
<string name="eip_cancel_connect_text">Hay una conexión iniciándose. ¿Quieres cancelarla?</string>
<string name="eip.warning.browser_inconsistency">Para salvaguardar la privacidad de tu información personal, te recomendamos que después de apagar la VPN cierres la sesión del navegador y abras una sesión privada en él. Gracias.</string>
- <string name="yes">Sí</string>
- <string name="no">No</string>
<string name="eip_state_not_connected">"¡Conexión no protegida!"</string>
<string name="eip_state_connected">Conexión protegida.</string>
<string name="provider_problem">Parece que hay un problema con el proveedor.</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index bcfd3a2c..07bc4770 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -63,8 +63,6 @@
<string name="eip_cancel_connect_title">Cancel connection?</string>
<string name="eip_cancel_connect_text">There is a connection attempt in progress. Do you wish to cancel it?</string>
<string name="eip.warning.browser_inconsistency">In order to avoid leaking your personal information, please close your browser and start a private window after disconnecting the Encrypted VPN Internet Access. Thanks.</string>
- <string name="yes">Yes</string>
- <string name="no">No</string>
<string name="eip_state_not_connected">"Not running! Connection not secure!"</string>
<string name="eip_state_connected">Connection Secure.</string>
<string name="provider_problem">It seems there is a problem with the provider.</string>