Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import com.duckduckgo.app.global.events.db.UserEventsStore
import com.duckduckgo.app.pixels.AppPixelName
import com.duckduckgo.app.runBlocking
import com.duckduckgo.app.settings.db.SettingsDataStore
import com.duckduckgo.app.statistics.Variant
import com.duckduckgo.app.statistics.VariantManager
import com.duckduckgo.app.statistics.pixels.Pixel
import com.nhaarman.mockitokotlin2.mock
Expand Down Expand Up @@ -168,17 +167,14 @@ class BrowserTabFireproofDialogsEventHandlerTest {
}

@Test
fun whenExpVariantUserDismissedFireproofLoginDialogwThenRegisterEvent() = coroutineRule.runBlocking {
givenFireproofLoginExperimentEnabled()

fun whenUserDismissedFireproofLoginDialogThenRegisterEvent() = coroutineRule.runBlocking {
testee.onUserDismissedFireproofLoginDialog()

verify(mockUserEventsStore).registerUserEvent(FIREPROOF_LOGIN_DIALOG_DISMISSED)
}

@Test
fun whenExpVariantUserDismissedFireproofLoginDialogTwiceInRowThenAskToDisableLoginDetection() = coroutineRule.runBlocking {
givenFireproofLoginExperimentEnabled()
fun whenUserDismissedFireproofLoginDialogTwiceInRowThenAskToDisableLoginDetection() = coroutineRule.runBlocking {
givenUserPreviouslyDismissedDialog()

testee.onUserDismissedFireproofLoginDialog()
Expand All @@ -188,8 +184,7 @@ class BrowserTabFireproofDialogsEventHandlerTest {
}

@Test
fun whenExpVariantUserEnabledFireproofLoginDetectionThenNeverAskToDisableIt() = coroutineRule.runBlocking {
givenFireproofLoginExperimentEnabled()
fun whenUserEnabledFireproofLoginDetectionThenNeverAskToDisableIt() = coroutineRule.runBlocking {
givenUserEnabledFireproofLoginDetection()
givenUserPreviouslyDismissedDialog()

Expand All @@ -200,8 +195,7 @@ class BrowserTabFireproofDialogsEventHandlerTest {
}

@Test
fun whenExpVariantUserDidNotDisableLoginDetectionThenNeverAskToDisableItAgain() = coroutineRule.runBlocking {
givenFireproofLoginExperimentEnabled()
fun whenUserDidNotDisableLoginDetectionThenNeverAskToDisableItAgain() = coroutineRule.runBlocking {
givenUserDidNotDisableLoginDetection()
givenUserPreviouslyDismissedDialog()

Expand Down Expand Up @@ -294,16 +288,6 @@ class BrowserTabFireproofDialogsEventHandlerTest {
.thenReturn(UserEventEntity(FIREPROOF_LOGIN_DIALOG_DISMISSED))
}

private fun givenFireproofLoginExperimentEnabled() {
whenever(mockVariantManager.getVariant()).thenReturn(
Variant(
key = "",
features = listOf(VariantManager.VariantFeature.LoginDetectionEnabled),
filterBy = { true }
)
)
}

private suspend fun givenUserTriedFireButton() {
whenever(mockUserEventsStore.getUserEvent(FIRE_BUTTON_EXECUTED)).thenReturn(UserEventEntity(FIRE_BUTTON_EXECUTED))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,6 @@ class VariantManagerTest {
}
}

// Fireproof Login experiment
@Test
fun fireproofLoginDetectionControlVariantHasExpectedWeightAndFeatures() {
val variant = variants.first { it.key == "zq" }
assertEqualsDouble(1.0, variant.weight)
assertEquals(0, variant.features.size)
}

@Test
fun fireproofLoginDetectionExperimentVariantHasExpectedWeightAndFeatures() {
val variant = variants.first { it.key == "zw" }
assertEqualsDouble(1.0, variant.weight)
assertEquals(1, variant.features.size)
assertEquals(LoginDetectionEnabled, variant.features[0])
}

@Suppress("SameParameterValue")
private fun assertEqualsDouble(expected: Double, actual: Double) {
val comparison = expected.compareTo(actual)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.duckduckgo.app.global.events.db.UserEventsStore
import com.duckduckgo.app.pixels.AppPixelName
import com.duckduckgo.app.settings.db.SettingsDataStore
import com.duckduckgo.app.statistics.VariantManager
import com.duckduckgo.app.statistics.loginDetectionExperimentEnabled
import com.duckduckgo.app.statistics.pixels.Pixel
import kotlinx.coroutines.withContext

Expand Down Expand Up @@ -111,8 +110,6 @@ class BrowserTabFireproofDialogsEventHandler constructor(

@Suppress("UnnecessaryVariable")
private suspend fun allowUserToDisableFireproofLoginActive(): Boolean {
if (!variantManager.loginDetectionExperimentEnabled()) return false

val userEnabledLoginDetection = userEventsStore.getUserEvent(UserEventKey.USER_ENABLED_FIREPROOF_LOGIN) != null
val userDismissedDisableFireproofLoginDialog = userEventsStore.getUserEvent(UserEventKey.FIREPROOF_DISABLE_DIALOG_DISMISSED) != null
if (userEnabledLoginDetection || userDismissedDisableFireproofLoginDialog) return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.duckduckgo.app.settings.clear.ClearWhatOption
import com.duckduckgo.app.settings.clear.ClearWhenOption
import com.duckduckgo.app.settings.clear.FireAnimation
import com.duckduckgo.app.statistics.VariantManager
import com.duckduckgo.app.statistics.loginDetectionExperimentEnabled

interface SettingsDataStore {

Expand Down Expand Up @@ -91,7 +90,7 @@ class SettingsSharedPreferences constructor(private val context: Context, privat
set(enabled) = preferences.edit { putBoolean(KEY_AUTOCOMPLETE_ENABLED, enabled) }

override var appLoginDetection: Boolean
get() = preferences.getBoolean(KEY_LOGIN_DETECTION_ENABLED, variantManager.loginDetectionExperimentEnabled())
get() = preferences.getBoolean(KEY_LOGIN_DETECTION_ENABLED, true)
set(enabled) = preferences.edit { putBoolean(KEY_LOGIN_DETECTION_ENABLED, enabled) }

override var appLocationPermission: Boolean
Expand Down
24 changes: 7 additions & 17 deletions app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<string name="appName" translatable="false">DuckDuckGo</string>
<string name="appDescription" translatable="false">DuckDuckGo </string>
<string name="duckDuckGoLogoDescription">Лого на DuckDuckGo</string>
<string name="duckDuckGoPrivacySimplified">Privacy, simplified</string>
<string name="duckDuckGoPrivacySimplified">Постижима поверителност</string>
<string name="yes">Да</string>
<string name="no">Не</string>
<string name="open">Отваряне</string>
Expand Down Expand Up @@ -223,6 +207,7 @@
<string name="noBookmarks">Все още няма добавени отметки</string>
<string name="bookmarkOverflowContentDescription">Още опции за отметка %1$s</string>
<string name="bookmarkEdited">Добавена е отметка</string>
<string name="bookmarkDeleteConfirmationMessage">Изтрито &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Dialogs -->
<string name="dialogConfirmTitle">Потвърдете</string>
Expand Down Expand Up @@ -484,6 +469,11 @@
<string name="fireproofWebsiteLoginDialogNegative">Не сега</string>
<string name="fireproofWebsiteItemsSectionTitle">Уебсайтове</string>
<string name="fireproofWebsiteToogleText">Питай при влизане</string>
<string name="disableLoginDetectionDialogTitle">Да се деактивира ли напомняне за огнеустойчивост при вход в сайтове?</string>
<string name="disableLoginDetectionDialogDescription">Можете да промените това предпочитание по всяко време в настройките.</string>
<string name="disableLoginDetectionDialogPositive">ЗАБРАНИ</string>
<string name="disableLoginDetectionDialogNegative">ОТМЕНИ</string>
<string name="fireproofWebsiteRemovalConfirmation">Премахната огнеустойчивост за &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Fire Animation settings -->
<string name="settingsFireAnimation">Анимация на огнения бутон</string>
Expand Down
22 changes: 6 additions & 16 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<string name="appName" translatable="false">DuckDuckGo</string>
Expand Down Expand Up @@ -231,6 +215,7 @@
<string name="noBookmarks">Zatím nebyly přidány žádné záložky.</string>
<string name="bookmarkOverflowContentDescription">Další možnosti záložky %1$s</string>
<string name="bookmarkEdited">Záložka přidána</string>
<string name="bookmarkDeleteConfirmationMessage">Odstraněno &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Dialogs -->
<string name="dialogConfirmTitle">Potvrdit</string>
Expand Down Expand Up @@ -496,6 +481,11 @@
<string name="fireproofWebsiteLoginDialogNegative">Teď ne</string>
<string name="fireproofWebsiteItemsSectionTitle">Webové stránky</string>
<string name="fireproofWebsiteToogleText">Zeptat se při přihlašování</string>
<string name="disableLoginDetectionDialogTitle">Zakázat připomenutí ochrany při přihlašování k webovým stránkám?</string>
<string name="disableLoginDetectionDialogDescription">Tuto předvolbu můžete v Nastavení kdykoli změnit.</string>
<string name="disableLoginDetectionDialogPositive">VYPNOUT</string>
<string name="disableLoginDetectionDialogNegative">ZRUŠIT</string>
<string name="fireproofWebsiteRemovalConfirmation">Ochrana odstraněna pro &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Fire Animation settings -->
<string name="settingsFireAnimation">Animace tlačítka pro mazání</string>
Expand Down
22 changes: 6 additions & 16 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<string name="appName" translatable="false">DuckDuckGo</string>
Expand Down Expand Up @@ -223,6 +207,7 @@
<string name="noBookmarks">Ingen bogmærker tilføjet endnu</string>
<string name="bookmarkOverflowContentDescription">Flere muligheder for bogmærke %1$s</string>
<string name="bookmarkEdited">Bogmærke tilføjet</string>
<string name="bookmarkDeleteConfirmationMessage">Slettet &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Dialogs -->
<string name="dialogConfirmTitle">Bekræft</string>
Expand Down Expand Up @@ -484,6 +469,11 @@
<string name="fireproofWebsiteLoginDialogNegative">Ikke nu</string>
<string name="fireproofWebsiteItemsSectionTitle">Websider</string>
<string name="fireproofWebsiteToogleText">Spørg, når der logges ind</string>
<string name="disableLoginDetectionDialogTitle">Vil du deaktivere brandsikker-påmindelse, når du logger ind på websteder?</string>
<string name="disableLoginDetectionDialogDescription">Du kan ændre denne præference til enhver tid i Indstillinger.</string>
<string name="disableLoginDetectionDialogPositive">Deaktiver</string>
<string name="disableLoginDetectionDialogNegative">Afbestil</string>
<string name="fireproofWebsiteRemovalConfirmation">Brandsikring fjernet for &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Fire Animation settings -->
<string name="settingsFireAnimation">Ildknap-animation</string>
Expand Down
22 changes: 6 additions & 16 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<string name="appName" translatable="false">DuckDuckGo</string>
Expand Down Expand Up @@ -223,6 +207,7 @@
<string name="noBookmarks">Noch keine Lesezeichen hinzugefügt</string>
<string name="bookmarkOverflowContentDescription">Mehr Optionen für Lesezeichen %1$s</string>
<string name="bookmarkEdited">Lesezeichen hinzugefügt</string>
<string name="bookmarkDeleteConfirmationMessage">&lt;b&gt;%1$s&lt;/b&gt; wurde gelöscht</string>

<!-- Dialogs -->
<string name="dialogConfirmTitle">Bestätigen</string>
Expand Down Expand Up @@ -484,6 +469,11 @@
<string name="fireproofWebsiteLoginDialogNegative">Jetzt nicht</string>
<string name="fireproofWebsiteItemsSectionTitle">Websites</string>
<string name="fireproofWebsiteToogleText">Beim Anmelden fragen</string>
<string name="disableLoginDetectionDialogTitle">Erinnerung zur Feuerfest-Einstellung bei der Anmeldung auf Websites deaktivieren?</string>
<string name="disableLoginDetectionDialogDescription">Diese Auswahl kann in den Einstellungen jederzeit rückgängig gemacht werden.</string>
<string name="disableLoginDetectionDialogPositive">DEAKTIVIEREN</string>
<string name="disableLoginDetectionDialogNegative">ABBRECHEN</string>
<string name="fireproofWebsiteRemovalConfirmation">Feuerfest-Einstellung für &lt;b&gt;%1$s&lt;/b&gt; deaktiviert</string>

<!-- Fire Animation settings -->
<string name="settingsFireAnimation">Animation der Schaltfläche „Feuer“</string>
Expand Down
22 changes: 6 additions & 16 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<string name="appName" translatable="false">DuckDuckGo</string>
Expand Down Expand Up @@ -223,6 +207,7 @@
<string name="noBookmarks">Δεν προστέθηκαν σελιδοδείκτες ακόμα</string>
<string name="bookmarkOverflowContentDescription">Περισσότερες επιλογές για σελιδοδείκτη %1$s</string>
<string name="bookmarkEdited">Προστέθηκε σελιδοδείκτης</string>
<string name="bookmarkDeleteConfirmationMessage">Διαγράφηκε &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Dialogs -->
<string name="dialogConfirmTitle">Επιβεβαίωση</string>
Expand Down Expand Up @@ -484,6 +469,11 @@
<string name="fireproofWebsiteLoginDialogNegative">Όχι τώρα</string>
<string name="fireproofWebsiteItemsSectionTitle">Ιστότοποι</string>
<string name="fireproofWebsiteToogleText">Ερώτηση κατά τη σύνδεση</string>
<string name="disableLoginDetectionDialogTitle">Απενεργοποίηση της υπενθύμισης Διαγραφής δραστηριότητας κατά τη σύνδεση σε ιστότοπους;</string>
<string name="disableLoginDetectionDialogDescription">Μπορείτε να αλλάξετε την προτίμηση αυτή οποιαδήποτε στιγμή από τις Ρυθμίσεις.</string>
<string name="disableLoginDetectionDialogPositive">ΑΠΕΝΕΡΓΟΠΟΙΗΣΗ</string>
<string name="disableLoginDetectionDialogNegative">ΑΚΥΡΩΣΗ</string>
<string name="fireproofWebsiteRemovalConfirmation">Η διαγραφή δραστηριότητας αφαιρέθηκε για το &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Fire Animation settings -->
<string name="settingsFireAnimation">Κινούμενο κουμπί φωτιάς</string>
Expand Down
22 changes: 6 additions & 16 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<string name="appName" translatable="false">DuckDuckGo</string>
Expand Down Expand Up @@ -223,6 +207,7 @@
<string name="noBookmarks">Aún no se han añadido marcadores</string>
<string name="bookmarkOverflowContentDescription">Más opciones para el marcador %1$s</string>
<string name="bookmarkEdited">Marcador añadido</string>
<string name="bookmarkDeleteConfirmationMessage">&lt;b&gt;%1$s&lt;/b&gt; eliminado</string>

<!-- Dialogs -->
<string name="dialogConfirmTitle">Confirmar</string>
Expand Down Expand Up @@ -484,6 +469,11 @@
<string name="fireproofWebsiteLoginDialogNegative">Ahora no</string>
<string name="fireproofWebsiteItemsSectionTitle">Sitios web</string>
<string name="fireproofWebsiteToogleText">Preguntar al iniciar sesión</string>
<string name="disableLoginDetectionDialogTitle">¿Deshabilitar recordatorio de a prueba de fuego al iniciar sesión en los sitios?</string>
<string name="disableLoginDetectionDialogDescription">Puedes cambiar esta preferencia en cualquier momento en Ajustes.</string>
<string name="disableLoginDetectionDialogPositive">DESHABILITAR</string>
<string name="disableLoginDetectionDialogNegative">CANCELAR</string>
<string name="fireproofWebsiteRemovalConfirmation">A prueba de fuego desactivado para &lt;b&gt;%1$s&lt;/b&gt;</string>

<!-- Fire Animation settings -->
<string name="settingsFireAnimation">Animación del botón Fuego</string>
Expand Down
Loading