From f8c2f76971f5a7f26d18e5e669d5e0ce9c560f3f Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Thu, 7 Dec 2017 12:52:29 +0100 Subject: Rename constants * renamed last constants * remove unnecessary updates/ConstantUnification --- app/src/main/java/se/leap/bitmaskclient/StartActivity.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/StartActivity.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java index ade43701..dd2be212 100644 --- a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java @@ -13,7 +13,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import de.blinkt.openvpn.core.VpnStatus; -import se.leap.bitmaskclient.updates.ConstantUnification; import se.leap.bitmaskclient.userstatus.User; /** @@ -113,15 +112,12 @@ public class StartActivity extends Activity { } /** - * execute necessary updates for version change + * execute necessary upgrades for version change */ private void executeUpgrade() { - if (passedMilestone(VersionMilestone.MULTIPLE_PROFILES)) { + if (hasNewFeature(FeatureVersionCode.MULTIPLE_PROFILES)) { // TODO prepare usage of multiple profiles } - if (passedMilestone(VersionMilestone.CONSTANT_UNIFICATION)) { - ConstantUnification.upgrade(preferences); - } // ensure all upgrades have passed before storing new information preferences.edit().putInt(Constants.PREFERENCES_APP_VERSION, versionCode).apply(); @@ -129,11 +125,11 @@ public class StartActivity extends Activity { /** * check if an upgrade passed or moved to given milestone - * @param milestone Version code of the Milestone VersionMilestone.MILE_STONE + * @param featureVersionCode Version code of the Milestone FeatureVersionCode.MILE_STONE * @return true if milestone is reached - false otherwise */ - private boolean passedMilestone(int milestone) { - return previousVersionCode < milestone && versionCode >= milestone; + private boolean hasNewFeature(int featureVersionCode) { + return previousVersionCode < featureVersionCode && versionCode >= featureVersionCode; } } -- cgit v1.2.3