kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix some PinState bugs.
rodzic
575caa53d3
commit
cca85bfee3
|
@ -181,6 +181,12 @@ public final class PinState {
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public static synchronized void onEnableRegistrationLockForUserWithPin() throws IOException {
|
public static synchronized void onEnableRegistrationLockForUserWithPin() throws IOException {
|
||||||
Log.i(TAG, "onEnableRegistrationLockForUserWithPin()");
|
Log.i(TAG, "onEnableRegistrationLockForUserWithPin()");
|
||||||
|
|
||||||
|
if (getState() == State.PIN_WITH_REGISTRATION_LOCK_ENABLED) {
|
||||||
|
Log.i(TAG, "Registration lock already enabled. Skipping.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assertState(State.PIN_WITH_REGISTRATION_LOCK_DISABLED);
|
assertState(State.PIN_WITH_REGISTRATION_LOCK_DISABLED);
|
||||||
|
|
||||||
SignalStore.kbsValues().setV2RegistrationLockEnabled(false);
|
SignalStore.kbsValues().setV2RegistrationLockEnabled(false);
|
||||||
|
@ -198,6 +204,12 @@ public final class PinState {
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public static synchronized void onDisableRegistrationLockForUserWithPin() throws IOException {
|
public static synchronized void onDisableRegistrationLockForUserWithPin() throws IOException {
|
||||||
Log.i(TAG, "onDisableRegistrationLockForUserWithPin()");
|
Log.i(TAG, "onDisableRegistrationLockForUserWithPin()");
|
||||||
|
|
||||||
|
if (getState() == State.PIN_WITH_REGISTRATION_LOCK_DISABLED) {
|
||||||
|
Log.i(TAG, "Registration lock already disabled. Skipping.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assertState(State.PIN_WITH_REGISTRATION_LOCK_ENABLED);
|
assertState(State.PIN_WITH_REGISTRATION_LOCK_ENABLED);
|
||||||
|
|
||||||
SignalStore.kbsValues().setV2RegistrationLockEnabled(true);
|
SignalStore.kbsValues().setV2RegistrationLockEnabled(true);
|
||||||
|
|
|
@ -194,6 +194,7 @@ public final class FeatureFlags {
|
||||||
public static boolean pinsForAll() {
|
public static boolean pinsForAll() {
|
||||||
return SignalStore.registrationValues().pinWasRequiredAtRegistration() ||
|
return SignalStore.registrationValues().pinWasRequiredAtRegistration() ||
|
||||||
SignalStore.kbsValues().isV2RegistrationLockEnabled() ||
|
SignalStore.kbsValues().isV2RegistrationLockEnabled() ||
|
||||||
|
SignalStore.kbsValues().hasPin() ||
|
||||||
pinsForAllMandatory() ||
|
pinsForAllMandatory() ||
|
||||||
getValue(PINS_FOR_ALL_LEGACY, false) ||
|
getValue(PINS_FOR_ALL_LEGACY, false) ||
|
||||||
getValue(PINS_FOR_ALL, false);
|
getValue(PINS_FOR_ALL, false);
|
||||||
|
|
Ładowanie…
Reference in New Issue