mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 12:48:35 +00:00
Fix some PinState bugs.
This commit is contained in:
parent
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user