NTP-29566 | OTP auto read changes (#15387)
Co-authored-by: shaurya-rehan <shaurya.rehan@navi.com>
This commit is contained in:
@@ -291,6 +291,20 @@ object PreferenceManager {
|
||||
} else setIntPreference(key, value)
|
||||
}
|
||||
|
||||
fun setBooleanSecurely(key: String, value: Boolean) {
|
||||
if (shouldUseEncryptedSharedPref()) {
|
||||
val editor = secureSharedPreferencesForSession?.edit()
|
||||
editor?.putBoolean(key, value)
|
||||
editor?.apply()
|
||||
} else setBooleanPreference(key, value)
|
||||
}
|
||||
|
||||
fun getBooleanSecurely(key: String, defValue: Boolean = false): Boolean {
|
||||
return if (shouldUseEncryptedSharedPref()) {
|
||||
secureSharedPreferencesForSession?.getBoolean(key, defValue) ?: defValue
|
||||
} else getBooleanPreference(key, defValue)
|
||||
}
|
||||
|
||||
fun getSecureString(key: String): String? {
|
||||
return if (shouldUseEncryptedSharedPref()) {
|
||||
secureSharedPreferencesForSession?.getString(key, null)
|
||||
|
||||
Reference in New Issue
Block a user