mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Reset Localizer on account deletion
This commit is contained in:
@@ -20,10 +20,12 @@ public class Localizer {
|
||||
// Locking: class
|
||||
@Nullable
|
||||
private static Localizer INSTANCE;
|
||||
private final Locale systemLocale;
|
||||
@Nullable
|
||||
private final Locale locale;
|
||||
private volatile Locale locale;
|
||||
|
||||
private Localizer(SharedPreferences sharedPreferences) {
|
||||
systemLocale = Locale.getDefault();
|
||||
locale = getLocaleFromTag(
|
||||
sharedPreferences.getString(LANGUAGE, "default"));
|
||||
}
|
||||
@@ -39,6 +41,11 @@ public class Localizer {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
// Reset to the system locale
|
||||
public synchronized void reset() {
|
||||
locale = systemLocale;
|
||||
}
|
||||
|
||||
// Get Locale from BCP-47 tag
|
||||
@Nullable
|
||||
public static Locale getLocaleFromTag(String tag) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.Localizer;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.android.activity.BaseActivity;
|
||||
import org.briarproject.briar.android.controller.BriarController;
|
||||
@@ -105,6 +106,7 @@ public class PasswordActivity extends BaseActivity {
|
||||
|
||||
private void deleteAccount() {
|
||||
passwordController.deleteAccount(this);
|
||||
Localizer.getInstance().reset();
|
||||
setResult(RESULT_CANCELED);
|
||||
Intent i = new Intent(this, SetupActivity.class);
|
||||
i.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK);
|
||||
|
||||
Reference in New Issue
Block a user