Merge pull request #2228 from open-keychain/fix-notify

Do not re-enable contacts sync if first time wizard is not finished
This commit is contained in:
Dominik Schürmann
2017-11-28 16:20:39 +01:00
committed by GitHub
5 changed files with 96 additions and 62 deletions

View File

@@ -118,16 +118,22 @@ public class Preferences {
}
public boolean isFirstTime() {
return mSharedPreferences.getBoolean(Constants.Pref.FIRST_TIME, true);
}
public boolean useNumKeypadForSecurityTokenPin() {
return mSharedPreferences.getBoolean(Pref.USE_NUMKEYPAD_FOR_SECURITY_TOKEN_PIN, true);
return mSharedPreferences.getBoolean(Constants.Pref.FIRST_TIME_WIZARD, true);
}
public void setFirstTime(boolean value) {
SharedPreferences.Editor editor = mSharedPreferences.edit();
editor.putBoolean(Constants.Pref.FIRST_TIME, value);
editor.putBoolean(Constants.Pref.FIRST_TIME_WIZARD, value);
editor.commit();
}
public boolean isAppExecutedFirstTime() {
return mSharedPreferences.getBoolean(Pref.FIRST_TIME_APP, true);
}
public void setAppExecutedFirstTime(boolean value) {
SharedPreferences.Editor editor = mSharedPreferences.edit();
editor.putBoolean(Constants.Pref.FIRST_TIME_APP, value);
editor.commit();
}
@@ -215,6 +221,10 @@ public class Preferences {
editor.commit();
}
public boolean useNumKeypadForSecurityTokenPin() {
return mSharedPreferences.getBoolean(Pref.USE_NUMKEYPAD_FOR_SECURITY_TOKEN_PIN, true);
}
public void setUseNumKeypadForSecurityTokenPin(boolean useNumKeypad) {
SharedPreferences.Editor editor = mSharedPreferences.edit();
editor.putBoolean(Pref.USE_NUMKEYPAD_FOR_SECURITY_TOKEN_PIN, useNumKeypad);
@@ -410,6 +420,12 @@ public class Preferences {
return mSharedPreferences.getBoolean(Pref.EXPERIMENTAL_SMARTPGP_VERIFY_AUTHORITY, false);
}
public void setPrefVersionToCurrentVersion() {
SharedPreferences.Editor editor = mSharedPreferences.edit();
editor.putInt(Pref.PREF_VERSION, Constants.Defaults.PREF_CURRENT_VERSION);
editor.commit();
}
public void upgradePreferences(Context context) {
Log.d(Constants.TAG, "Upgrading preferences…");
int oldVersion = mSharedPreferences.getInt(Constants.Pref.PREF_VERSION, 0);