From 4bd37041c3ace75e4ac5bfbd87fe6d1cfad8038a Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Mon, 11 Apr 2022 14:51:12 +0530 Subject: privacycentralapp: Add notification on 1st boot to tell us more about our app --- .../e/privacycentralapp/data/repositories/LocalStateRepository.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/foundation/e/privacycentralapp/data') 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(sharedPref.getBoolean(KEY_QUICK_PRIVACY, false)) + private val quickPrivacyEnabledMutableFlow = + MutableStateFlow(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() } -- cgit v1.2.3