mirror of
https://github.com/bitwarden/android.git
synced 2025-03-16 03:08:50 +03:00
BIT-2247: Persists screen recording flag past a logout (#1280)
This commit is contained in:
parent
da277ed32a
commit
e58710b3e8
4 changed files with 9 additions and 6 deletions
|
@ -148,9 +148,12 @@ class SettingsDiskSourceImpl(
|
|||
isApprovePasswordlessLoginsEnabled = null,
|
||||
)
|
||||
storeLastSyncTime(userId = userId, lastSyncTime = null)
|
||||
storeScreenCaptureAllowed(userId = userId, isScreenCaptureAllowed = null)
|
||||
storeClearClipboardFrequencySeconds(userId = userId, frequency = null)
|
||||
removeWithPrefix(prefix = "${ACCOUNT_BIOMETRIC_INTEGRITY_VALID_KEY}_$userId")
|
||||
|
||||
// The following are intentionally not cleared so they can be
|
||||
// restored after logging out and back in:
|
||||
// - screen capture allowed
|
||||
}
|
||||
|
||||
override fun getAccountBiometricIntegrityValidity(
|
||||
|
|
|
@ -262,9 +262,9 @@ class SettingsRepositoryImpl(
|
|||
autofillEnabledManager.isAutofillEnabledStateFlow
|
||||
|
||||
override var isScreenCaptureAllowed: Boolean
|
||||
get() = activeUserId?.let {
|
||||
settingsDiskSource.getScreenCaptureAllowed(it)
|
||||
} ?: DEFAULT_IS_SCREEN_CAPTURE_ALLOWED
|
||||
get() = activeUserId
|
||||
?.let { settingsDiskSource.getScreenCaptureAllowed(it) }
|
||||
?: DEFAULT_IS_SCREEN_CAPTURE_ALLOWED
|
||||
set(value) {
|
||||
val userId = activeUserId ?: return
|
||||
settingsDiskSource.storeScreenCaptureAllowed(
|
||||
|
|
|
@ -158,7 +158,8 @@ class SettingsDiskSourceTest {
|
|||
assertNull(settingsDiskSource.getBlockedAutofillUris(userId = userId))
|
||||
assertNull(settingsDiskSource.getApprovePasswordlessLoginsEnabled(userId = userId))
|
||||
assertNull(settingsDiskSource.getLastSyncTime(userId = userId))
|
||||
assertNull(settingsDiskSource.getScreenCaptureAllowed(userId = userId))
|
||||
// We don't actually clear this setting, so it's still here
|
||||
assertEquals(true, settingsDiskSource.getScreenCaptureAllowed(userId = userId))
|
||||
assertNull(
|
||||
settingsDiskSource.getAccountBiometricIntegrityValidity(
|
||||
userId = userId,
|
||||
|
|
|
@ -130,7 +130,6 @@ class FakeSettingsDiskSource : SettingsDiskSource {
|
|||
storedPullToRefreshEnabled.remove(userId)
|
||||
storedInlineAutofillEnabled.remove(userId)
|
||||
storedBlockedAutofillUris.remove(userId)
|
||||
storedScreenCaptureAllowed.remove(userId)
|
||||
storedClearClipboardFrequency.remove(userId)
|
||||
|
||||
mutableVaultTimeoutActionsFlowMap.remove(userId)
|
||||
|
|
Loading…
Add table
Reference in a new issue