aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/foundation/e/privacycentralapp/data
diff options
context:
space:
mode:
authorTheScarastic <warabhishek@e.email>2022-04-11 14:51:12 +0530
committerTheScarastic <warabhishek@e.email>2022-04-11 18:39:36 +0530
commit4bd37041c3ace75e4ac5bfbd87fe6d1cfad8038a (patch)
tree60e942f86caa6137ccf1b59a05a4f5c8e59a2242 /app/src/main/java/foundation/e/privacycentralapp/data
parent58b435916b5fffea33600009d648ed7a5cc594ea (diff)
downloadadvanced-privacy-4bd37041c3ace75e4ac5bfbd87fe6d1cfad8038a.tar.gz
privacycentralapp: Add notification on 1st boot to tell us more about our app
Diffstat (limited to 'app/src/main/java/foundation/e/privacycentralapp/data')
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt b/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt
index 145ff32..9a7fd15 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt
@@ -28,11 +28,13 @@ class LocalStateRepository(context: Context) {
private const val KEY_IP_SCRAMBLING = "ipScrambling"
private const val KEY_FAKE_LATITUDE = "fakeLatitude"
private const val KEY_FAKE_LONGITUDE = "fakeLongitude"
+ private const val KEY_FIRST_BOOT = "firstBoot"
}
private val sharedPref = context.getSharedPreferences(SHARED_PREFS_FILE, Context.MODE_PRIVATE)
- private val quickPrivacyEnabledMutableFlow = MutableStateFlow<Boolean>(sharedPref.getBoolean(KEY_QUICK_PRIVACY, false))
+ private val quickPrivacyEnabledMutableFlow =
+ MutableStateFlow<Boolean>(sharedPref.getBoolean(KEY_QUICK_PRIVACY, false))
var isQuickPrivacyEnabled: Boolean
get() = quickPrivacyEnabledMutableFlow.value
set(value) {
@@ -70,6 +72,10 @@ class LocalStateRepository(context: Context) {
get() = sharedPref.getBoolean(KEY_IP_SCRAMBLING, false)
set(value) = set(KEY_IP_SCRAMBLING, value)
+ var firstBoot: Boolean
+ get() = sharedPref.getBoolean(KEY_FIRST_BOOT, true)
+ set(value) = set(KEY_FIRST_BOOT, value)
+
private fun set(key: String, value: Boolean) {
sharedPref.edit().putBoolean(key, value).commit()
}