Skip to content

Commit 6206eea

Browse files
Remove https pixels (#1164)
1 parent 96bb97e commit 6206eea

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

app/src/androidTest/java/com/duckduckgo/app/httpsupgrade/HttpsUpgraderTest.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package com.duckduckgo.app.httpsupgrade
1818

1919
import android.net.Uri
2020
import com.duckduckgo.app.httpsupgrade.store.HttpsFalsePositivesDao
21-
import com.duckduckgo.app.pixels.AppPixelName
2221
import com.duckduckgo.app.privacy.db.UserWhitelistDao
2322
import com.duckduckgo.app.statistics.pixels.Pixel
2423
import com.nhaarman.mockitokotlin2.mock
@@ -52,35 +51,30 @@ class HttpsUpgraderTest {
5251
fun whenHttpUriIsInBloomThenShouldUpgrade() {
5352
bloomFilter.add("www.local.url")
5453
assertTrue(testee.shouldUpgrade(Uri.parse("http://www.local.url")))
55-
mockPixel.fire(AppPixelName.HTTPS_LOCAL_UPGRADE)
5654
}
5755

5856
@Test
5957
fun whenHttpUriIsNotInBloomThenShouldNotUpgrade() {
6058
bloomFilter.add("www.local.url")
6159
assertFalse(testee.shouldUpgrade(Uri.parse("http://www.differentlocal.url")))
62-
mockPixel.fire(AppPixelName.HTTPS_NO_UPGRADE)
6360
}
6461

6562
@Test
6663
fun whenHttpsUriThenShouldNotUpgrade() {
6764
bloomFilter.add("www.local.url")
6865
assertFalse(testee.shouldUpgrade(Uri.parse("https://www.local.url")))
69-
mockPixel.fire(AppPixelName.HTTPS_NO_UPGRADE)
7066
}
7167

7268
@Test
7369
fun whenHttpUriHasOnlyPartDomainInLocalListThenShouldNotUpgrade() {
7470
bloomFilter.add("local.url")
7571
assertFalse(testee.shouldUpgrade(Uri.parse("http://www.local.url")))
76-
mockPixel.fire(AppPixelName.HTTPS_NO_LOOKUP)
7772
}
7873

7974
@Test
8075
fun whenHttpDomainIsUserWhitelistedThenShouldNotUpgrade() {
8176
bloomFilter.add("www.local.url")
8277
whenever(mockUserAllowlistDao.contains("www.local.url")).thenReturn(true)
8378
assertFalse(testee.shouldUpgrade(Uri.parse("http://www.local.url")))
84-
mockPixel.fire(AppPixelName.HTTPS_NO_LOOKUP)
8579
}
8680
}

app/src/main/java/com/duckduckgo/app/httpsupgrade/HttpsUpgrader.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,23 @@ class HttpsUpgraderImpl(
5454
override fun shouldUpgrade(uri: Uri): Boolean {
5555

5656
if (uri.isHttps) {
57-
pixel.fire(HTTPS_NO_LOOKUP)
5857
return false
5958
}
6059

61-
val host = uri.host
62-
if (host == null) {
63-
pixel.fire(HTTPS_NO_LOOKUP)
64-
return false
65-
}
60+
val host = uri.host ?: return false
6661

6762
if (userAllowListDao.contains(host)) {
68-
pixel.fire(HTTPS_NO_LOOKUP)
6963
Timber.d("$host is in user allowlist and so not upgradable")
7064
return false
7165
}
7266

7367
if (bloomFalsePositiveDao.contains(host)) {
74-
pixel.fire(HTTPS_NO_LOOKUP)
7568
Timber.d("$host is in https whitelist and so not upgradable")
7669
return false
7770
}
7871

7972
val isUpgradable = isInUpgradeList(host)
8073
Timber.d("$host ${if (isUpgradable) "is" else "is not"} upgradable")
81-
pixel.fire(if (isUpgradable) HTTPS_LOCAL_UPGRADE else HTTPS_NO_UPGRADE)
8274
return isUpgradable
8375
}
8476

app/src/main/java/com/duckduckgo/app/pixels/AppPixelName.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ enum class AppPixelName(override val pixelName: String) : Pixel.PixelName {
5353
BROWSER_MENU_WHITELIST_ADD("mb_wla"),
5454
BROWSER_MENU_WHITELIST_REMOVE("mb_wlr"),
5555

56-
HTTPS_NO_LOOKUP("m_https_nl"),
57-
HTTPS_LOCAL_UPGRADE("m_https_lu"),
58-
HTTPS_NO_UPGRADE("m_https_nu"),
59-
6056
DEFAULT_BROWSER_SET("m_db_s"),
6157
DEFAULT_BROWSER_NOT_SET("m_db_ns"),
6258
DEFAULT_BROWSER_UNSET("m_db_u"),

0 commit comments

Comments
 (0)