8000 Merge branch 'release/5.62.0' into main · chmodawk/Android@8a0d4ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a0d4ff

Browse files
committed
Merge branch 'release/5.62.0' into main
2 parents 79b30be + de154ca commit 8a0d4ff

File tree

6 files changed

+34
-20
lines changed

6 files changed

+34
-20
lines changed

app/src/androidTest/java/com/duckduckgo/app/statistics/VariantManagerTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class VariantManagerTest {
3232
@Test
3333
fun serpControlVariantHasExpectedWeightAndNoFeatures() {
3434
val variant = variants.first { it.key == "sc" }
35-
assertEqualsDouble(0.0, variant.weight)
35+
assertEqualsDouble(1.0, variant.weight)
3636
assertEquals(0, variant.features.size)
3737
}
3838

3939
@Test
4040
fun serpExperimentalVariantHasExpectedWeightAndNoFeatures() {
4141
val variant = variants.first { it.key == "se" }
42-
assertEqualsDouble(0.0, variant.weight)
42+
assertEqualsDouble(1.0, variant.weight)
4343
assertEquals(0, variant.features.size)
4444
}
4545

@@ -160,14 +160,14 @@ class VariantManagerTest {
160160
@Test
161161
fun inBrowserControlVariantHasExpectedWeightAndNoFeatures() {
162162
val variant = variants.first { it.key == "zj" }
163-
assertEqualsDouble(1.0, variant.weight)
163+
assertEqualsDouble(0.0, variant.weight)
164164
assertEquals(0, variant.features.size)
165165
}
166166

167167
@Test
168168
fun inBrowserSecondControlVariantHasExpectedWeightAndRemoveDay1And3NotificationsAndKillOnboardingFeatures() {
169169
val variant = variants.first { it.key == "zk" }
170-
assertEqualsDouble(1.0, variant.weight)
170+
assertEqualsDouble(0.0, variant.weight)
171171
assertEquals(2, variant.features.size)
172172
assertTrue(variant.hasFeature(KillOnboarding))
173173
assertTrue(variant.hasFeature(RemoveDay1AndDay3Notifications))
@@ -176,7 +176,7 @@ class VariantManagerTest {
176176
@Test
177177
fun inBrowserInAppUsageVariantHasExpectedWeightAndRemoveDay1And3NotificationsAndKillOnboardingAndInAppUsageFeatures() {
178178
val variant = variants.first { it.key == "zl" }
179-
assertEqualsDouble(1.0, variant.weight)
179+
assertEqualsDouble(0.0, variant.weight)
180180
assertEquals(3, variant.features.size)
181181
assertTrue(variant.hasFeature(KillOnboarding))
182182
assertTrue(variant.hasFeature(RemoveDay1AndDay3Notifications))

app/src/main/java/com/duckduckgo/app/cta/ui/Cta.kt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.duckduckgo.app.cta.ui
1818

19+
import android.annotation.SuppressLint
1920
import android.content.Context
2021
import android.net.Uri
2122
import android.view.View
@@ -212,21 +213,32 @@ sealed class DaxDialogCta(
212213
appInstallStore
213214
) {
214215

216+
@SuppressLint("StringFormatMatches")
215217
@ExperimentalStdlibApi
216218
override fun getDaxText(context: Context): String {
217219
val percentage = networkPropertyPercentages[network]
218220

219221
return if (isFromSameNetworkDomain()) {
220222
context.resources.getString(R.string.daxMainNetworkCtaText, network, percentage, network)
221223
} else {
222-
context.resources.getString(
223-
R.string.daxMainNetworkOwnedCtaText,
224-
Uri.parse(siteHost).baseHost?.removePrefix("m.")?.capitalize(Locale.getDefault()),
225-
network,
226-
network,
227-
percentage,
228-
network
229-
)
224+
val locale = Locale.getDefault()
225+
if (locale != null && locale.language == "en") {
226+
context.resources.getString(
227+
R.string.daxMainNetworkOwnedCtaText,
228+
network,
229+
Uri.parse(siteHost).baseHost?.removePrefix("m."),
230+
network
231+
)
232+
} else {
233+
context.resources.getString(
234+
R.string.daxMainNetworkOwnedCtaText,
235+
Uri.parse(siteHost).baseHost?.removePrefix("m.")?.capitalize(Locale.getDefault()),
236+
network,
237+
network,
238+
percentage,
239+
network
240+
)
241+
}
230242
}
231243
}
232244

app/src/main/java/com/duckduckgo/app/statistics/VariantManager.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ interface VariantManager {
5252
val ACTIVE_VARIANTS = listOf(
5353
// SERP variants. "sc" may also be used as a shared control for mobile experiments in
5454
// the future if we can filter by app version
55-
Variant(key = "sc", weight = 0.0, features = emptyList(), filterBy = { noFilter() }),
56-
Variant(key = "se", weight = 0.0, features = emptyList(), filterBy = { noFilter() }),
55+
Variant(key = "sc", weight = 1.0, features = emptyList(), filterBy = { noFilter() }),
56+
Variant(key = "se", weight = 1.0, features = emptyList(), filterBy = { noFilter() }),
5757

5858
// Notification Drip Experiment
5959
Variant(
@@ -93,15 +93,15 @@ interface VariantManager {
9393
Variant(key = "zi", weight = 0.0, features = listOf(VariantFeature.SerpHeaderRemoval), filterBy = { noFilter() }),
9494

9595
// InAppUsage Experiments
96-
Variant(key = "zj", weight = 1.0, features = emptyList(), filterBy = { isEnglishLocale() }),
96+
Variant(key = "zj", weight = 0.0, features = emptyList(), filterBy = { isEnglishLocale() }),
9797
Variant(
9898
key = "zk",
99-
weight = 1.0,
99+
weight = 0.0,
100100
features = listOf(VariantFeature.KillOnboarding, VariantFeature.RemoveDay1AndDay3Notifications),
101101
filterBy = { isEnglishLocale() }),
102102
Variant(
103103
key = "zl",
104-
weight = 1.0,
104+
weight = 0.0,
105105
features = listOf(VariantFeature.KillOnboarding, VariantFeature.InAppUsage, VariantFeature.RemoveDay1AndDay3Notifications),
106106
filterBy = { isEnglishLocale() })
107107

app/src/main/res/values/string-untranslated.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,7 @@
5454
<!-- Dos Attack error-->
5555
<string name="dosErrorMessage">Connection aborted. This website could be harmful to your device.</string>
5656

57+
<!-- Dax Dialog, this string has changed. We have to translate and replace it!! -->
58+
<string name="daxMainNetworkOwnedCtaText">Heads up! Since %s owns %s, I can\'t stop them from seeing your activity here.&lt;br/&gt;&lt;br/&gt;But browse with me, and I can reduce what %s knows about you overall by blocking their trackers on lots of other sites.</string>
59+
5760
</resources>

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@
404404
<item quantity="other"><![CDATA[&#160;were trying to track you here. <br/><br/>I blocked it!<br/><br/> ☝️You can check the URL bar to see who is trying to track you when you visit a new site.️]]></item>
405405
</plurals>
406406
<string name="daxNonSerpCtaText"><![CDATA[As you tap and scroll, I\'ll block pesky trackers. <br/><br/>Go ahead — keep browsing!]]></string>
407-
<string name="daxMainNetworkOwnedCtaText"><![CDATA[Heads up! %s is owned by %s.<br/><br/> %s\'s trackers lurk on about %s of top websites 😱 but don\'t worry!<br/><br/>I\'ll block %s from seeing your activity on those sites.]]></string>
408407
<string name="daxMainNetworkCtaText"><![CDATA[Heads up! %s is a major tracking network.<br/><br/> Their trackers lurk on about %s of top sites 😱 but don\'t worry!<br/><br/>I\'ll block %s from seeing your activity on those sites.]]></string>
409408

410409
<!-- Download Confirmation -->

app/version/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=5.61.2
1+
VERSION=5.62.0

0 commit comments

Comments
 (0)
0