mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
MVP of PIN lock feature
This only shows the settings if a screen lock is available. If the setting is activated, it shows a drawer item for locking. Once locked, the screen lock secret needs to be entered to enter the app again. First part of #1247
This commit is contained in:
@@ -45,6 +45,7 @@ class AccountManagerImpl implements AccountManager {
|
||||
|
||||
@Nullable
|
||||
private volatile SecretKey databaseKey = null;
|
||||
private volatile boolean locked = false;
|
||||
|
||||
@Inject
|
||||
AccountManagerImpl(DatabaseConfig databaseConfig, CryptoComponent crypto,
|
||||
@@ -218,4 +219,16 @@ class AccountManagerImpl implements AccountManager {
|
||||
return key != null && encryptAndStoreDatabaseKey(key, newPassword);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocked() {
|
||||
return locked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLocked(boolean locked) {
|
||||
synchronized (stateChangeLock) {
|
||||
this.locked = locked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user