summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-01-11 17:59:16 +0100
committerFup Duck <fupduck@sacknagel.com>2018-01-11 17:59:16 +0100
commit6bba6816b3329a24254c7904fd6e9422b50bfe26 (patch)
tree0bb21b417407aa47fe539f130b99d4fa8a7214f6 /app/src/main/java
parent8b942c746b51410f334b7303699a5ac740513ae3 (diff)
parentf3de2025db7bf73cdfdaaedd63aa00a1bf020d80 (diff)
Merge remote-tracking branch '0xacab/0.9.8' into 8802_drawer
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java10
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/StartActivity.java8
2 files changed, 16 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
index 25c1f64e..dc58b865 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
@@ -405,13 +405,21 @@ public class Dashboard extends ButterKnifeActivity {
private void switchProvider() {
if (provider.hasEIP()) eip_fragment.stopEipIfPossible();
+ clearDataOfLastProvider();
+
+ switching_provider = false;
+ startActivityForResult(new Intent(this, ConfigurationWizard.class), REQUEST_CODE_SWITCH_PROVIDER);
+ }
+
+ private void clearDataOfLastProvider() {
Map<String, ?> allEntries = preferences.getAll();
List<String> lastProvidersKeys = new ArrayList<>();
for (Map.Entry<String, ?> entry : allEntries.entrySet()) {
//sort out all preferences that don't belong to the last provider
if (entry.getKey().startsWith(Provider.KEY + ".") ||
entry.getKey().startsWith(Provider.CA_CERT + ".") ||
- entry.getKey().startsWith(Provider.CA_CERT_FINGERPRINT + ".")
+ entry.getKey().startsWith(Provider.CA_CERT_FINGERPRINT + "." )||
+ entry.getKey().equals(Constants.PREFERENCES_APP_VERSION)
) {
continue;
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
index 856b104b..614c6b8d 100644
--- a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
@@ -48,6 +48,8 @@ public class StartActivity extends Activity {
break;
case FIRST:
+ storeAppVersion();
+ // TODO start ProfileCreation & replace below code
// (new Intent(getActivity(), ConfigurationWizard.class), Constants.REQUEST_CODE_SWITCH_PROVIDER);
break;
@@ -120,7 +122,7 @@ public class StartActivity extends Activity {
}
// ensure all upgrades have passed before storing new information
- preferences.edit().putInt(Constants.PREFERENCES_APP_VERSION, versionCode).apply();
+ storeAppVersion();
}
/**
@@ -132,4 +134,8 @@ public class StartActivity extends Activity {
return previousVersionCode < featureVersionCode && versionCode >= featureVersionCode;
}
+ private void storeAppVersion() {
+ preferences.edit().putInt(Constants.PREFERENCES_APP_VERSION, versionCode).apply();
+ }
+
}