Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Closes #2988: Remove all pocket references
Browse files Browse the repository at this point in the history
  • Loading branch information
psymoon committed Jun 26, 2020
1 parent 22ea453 commit 1ace39c
Show file tree
Hide file tree
Showing 33 changed files with 5 additions and 1,811 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def addSecretToBuildConfig(variant, fieldName, fileBaseName) {

android.applicationVariants.all { variant ->
addSecretToBuildConfig(variant, 'SENTRY_DSN', ".sentry_dsn")
addSecretToBuildConfig(variant, 'POCKET_KEY', ".pocket_key")
}

// -------------------------------------------------------------------------------------------------
Expand Down

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/java/org/mozilla/tv/firefox/IntentValidator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import mozilla.components.service.fretboard.ExperimentDescriptor
import mozilla.components.support.utils.SafeIntent
import org.mozilla.tv.firefox.components.locale.LocaleManager
import org.mozilla.tv.firefox.ext.serviceLocator
import org.mozilla.tv.firefox.pocket.PocketVideoFetchScheduler
import org.mozilla.tv.firefox.telemetry.TelemetryIntegration
import org.mozilla.tv.firefox.utils.UrlUtils

Expand Down Expand Up @@ -59,7 +58,6 @@ object IntentValidator {

fun validate(context: Context, intent: SafeIntent): ValidatedIntentData? {
setQAExperimentOverrides(intent, context)
setQAFetchDelayOverrides(intent, context.serviceLocator.pocketVideoFetchScheduler)
setQALocaleOverride(intent, context)

when (intent.action) {
Expand Down Expand Up @@ -102,12 +100,6 @@ object IntentValidator {
}
}

private fun setQAFetchDelayOverrides(intent: SafeIntent, pocketVideoFetchScheduler: PocketVideoFetchScheduler) {
intent.extras?.getLong(EXTRA_FETCH_DELAY_KEY)?.let { delay ->
pocketVideoFetchScheduler.setQAFetchDelayOverride(delay)
}
}

private fun setQALocaleOverride(intent: SafeIntent, context: Context) {
val selectedLocale = intent.extras?.getString(EXTRA_SELECTED_LOCALE) ?: return
val localeManager = LocaleManager.getInstance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.mozilla.tv.firefox.hint.HintContentFactory
import org.mozilla.tv.firefox.navigationoverlay.ChannelTitles
import org.mozilla.tv.firefox.navigationoverlay.NavigationOverlayViewModel
import org.mozilla.tv.firefox.navigationoverlay.OverlayHintViewModel
import org.mozilla.tv.firefox.pocket.PocketViewModel
import org.mozilla.tv.firefox.navigationoverlay.ToolbarViewModel
import org.mozilla.tv.firefox.settings.SettingsViewModel
import org.mozilla.tv.firefox.utils.ServiceLocator
Expand All @@ -40,11 +39,6 @@ class ViewModelFactory(
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
return when (modelClass) {
PocketViewModel::class.java -> PocketViewModel(
resources,
serviceLocator.pocketRepo
) as T

ToolbarViewModel::class.java -> ToolbarViewModel(
sessionRepo = serviceLocator.sessionRepo,
pinnedTileRepo = serviceLocator.pinnedTileRepo
Expand Down
13 changes: 0 additions & 13 deletions app/src/main/java/org/mozilla/tv/firefox/channels/ChannelConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ data class ChannelConfig(
val enabledInLocales: KillswitchLocales
) {
companion object {
fun getPocketConfig(context: Context): ChannelConfig = ChannelConfig(
onClickTelemetry = { tile ->
TELEMETRY.pocketVideoClickEvent(tile.id)
TELEMETRY.homeTileClickEvent(context, tile)
},
// TODO focus telemetry should probably only be sent on focus gain, but this is
// how our previous implementation worked. Keeping this to maintain data consistency
onFocusTelemetry = { tile, _ -> TELEMETRY.pocketVideoImpressionEvent(tile.id) },
isEnabledInCurrentExperiment = true,
// Pocket is enabled in all countries, for any English locale
enabledInLocales = KillswitchLocales.ActiveIn(Locale.ENGLISH)
)

fun getPinnedTileConfig(context: Context): ChannelConfig = ChannelConfig(
onClickTelemetry = { tile -> TELEMETRY.homeTileClickEvent(context, tile) },
itemsMayBeRemoved = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class ChannelRepo(
addBundleTileToBlackList(tileData.tileSource, tileData.id)
pinnedTileRepo.removePinnedTile(tileData.url)
}
TileSource.POCKET -> throw NotImplementedError("pocket shouldn't be able to remove tiles")
TileSource.NEWS, TileSource.SPORTS, TileSource.MUSIC -> {
addBundleTileToBlackList(tileData.tileSource, tileData.id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.mozilla.tv.firefox.ext.getDimenPixelSize
import org.mozilla.tv.firefox.utils.PicassoWrapper
import java.io.File

enum class TileSource { BUNDLED, CUSTOM, POCKET, NEWS, SPORTS, MUSIC }
enum class TileSource { BUNDLED, CUSTOM, NEWS, SPORTS, MUSIC }

/**
* Backing data for a [RecyclerView] item in a channel
Expand All @@ -42,7 +42,6 @@ data class ChannelTile(
return when (tileSource) {
TileSource.BUNDLED, TileSource.CUSTOM ->
context.resources.getString(R.string.pinned_tiles_channel_remove_title, title)
TileSource.POCKET -> throw NotImplementedError("pocket shouldn't be able to remove tiles")
TileSource.NEWS ->
context.resources.getString(R.string.news_channel_remove_title, title)
TileSource.SPORTS ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,7 @@ class DefaultChannelAdapter(
val tile = getItem(position)
tile.setImage.invoke(imageView)

// We handle Pocket tiles differently.
if (tile.subtitle != null) {
titleView.visibility = View.GONE

pocketTitle.text = tile.subtitle
pocketTitle.visibility = View.VISIBLE
pocketAuthor.text = tile.title
pocketAuthor.visibility = View.VISIBLE
} else {
titleView.text = tile.title
}
titleView.text = tile.title

itemView.setOnClickListener {
loadUrl(tile.url)
Expand Down Expand Up @@ -137,7 +127,5 @@ class DefaultChannelAdapter(

class DefaultChannelTileViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val titleView: TextView = itemView.findViewById(R.id.tile_title)
val pocketAuthor: TextView = itemView.findViewById(R.id.tile_pocket_author)
val pocketTitle: TextView = itemView.findViewById(R.id.tile_pocket_title)
val imageView: ImageView = itemView.findViewById(R.id.tile_icon)
}

This file was deleted.

Loading

0 comments on commit 1ace39c

Please sign in to comment.