0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-24 04:05:13 +00:00

Apply preferences fix

This commit is contained in:
Oizaro 2020-10-10 23:53:41 +02:00
parent 42465a888c
commit f21b5b2740
2 changed files with 5 additions and 5 deletions

View file

@ -162,11 +162,11 @@ public class LoginActivity extends AssistantActivity {
super.onHuaweiButtonClicked(); super.onHuaweiButtonClicked();
state++; state++;
if (state == 1) { if (state == 1) {
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true); PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true).apply();
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(LoginButtonPreference, false)) { if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(LoginButtonPreference, false)) {
LastCheckinInfo.ClearCheckinInfo(this); LastCheckinInfo.ClearCheckinInfo(this);
CheckinClient.brandSpoof = true; CheckinClient.brandSpoof = true;
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(LoginButtonPreference, true); PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(LoginButtonPreference, true).apply();
} }
init(); init();
} }
@ -177,11 +177,11 @@ public class LoginActivity extends AssistantActivity {
super.onNextButtonClicked(); super.onNextButtonClicked();
state++; state++;
if (state == 1) { if (state == 1) {
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(LoginButtonPreference, true); PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(LoginButtonPreference, true).apply();
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(HuaweiButtonPreference, false)) { if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(HuaweiButtonPreference, false)) {
LastCheckinInfo.ClearCheckinInfo(this); LastCheckinInfo.ClearCheckinInfo(this);
CheckinClient.brandSpoof = false; CheckinClient.brandSpoof = false;
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true); PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true).apply();
} }
init(); init();
} else if (state == -1) { } else if (state == -1) {

View file

@ -216,7 +216,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
public static void setEnabled(Context context, boolean newStatus) { public static void setEnabled(Context context, boolean newStatus) {
boolean changed = GcmPrefs.get(context).isEnabled() != newStatus; boolean changed = GcmPrefs.get(context).isEnabled() != newStatus;
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(GcmPrefs.PREF_ENABLE_GCM, newStatus).commit(); PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(GcmPrefs.PREF_ENABLE_GCM, newStatus).apply();
if (!changed) return; if (!changed) return;
if (!newStatus) { if (!newStatus) {
McsService.stop(context); McsService.stop(context);