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

Commit 5f25a63

Browse files
committed
Issue #2325: Deprecate Pocket code moving to a-c.
The code is already available in a-c: it just needs to be exposed and perhaps refactored a little bit to support being exposed.
1 parent 7665503 commit 5f25a63

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

app/src/androidTest/java/org/mozilla/tv/firefox/helpers/CustomPocketFeedStateProvider.kt

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
@file:Suppress("DEPRECATION") // PocketVideoParser.
6+
57
package org.mozilla.tv.firefox.helpers
68

79
import android.app.Application

app/src/main/java/org/mozilla/tv/firefox/pocket/PocketEndpointRaw.kt

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import java.util.concurrent.TimeoutException
1717
private const val LOGTAG = "PocketEndpointRaw"
1818

1919
/** Make requests to the Pocket endpoint and returns raw data: see [PocketEndpoint] for more. */
20+
@Deprecated("Move to android-components implementation #1976")
2021
class PocketEndpointRaw(
2122
private val appVersion: String,
2223
private val pocketGlobalVideoEndpoint: Uri?

app/src/main/java/org/mozilla/tv/firefox/pocket/PocketVideoParser.kt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ private const val LOGTAG = "PocketVideoParser"
1414
/**
1515
* Handles marshalling [PocketViewModel.FeedItem.Video] objects from JSON.
1616
*/
17+
@Deprecated("Move to android-components implementation #1976")
1718
object PocketVideoParser {
1819

1920
// Ideally, this functionality would be in a separate class but 1) we're short on time and 2) this

app/src/main/java/org/mozilla/tv/firefox/pocket/PocketViewModel.kt

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class PocketViewModel(
4141
val authors: String
4242
) : FeedItem() {
4343
companion object {
44+
@Suppress("DEPRECATION") // We need PocketVideoParser until we move to a-c's impl.
4445
fun fromJSONObject(jsonObject: JSONObject) = PocketVideoParser.parse(jsonObject)
4546
}
4647
}

app/src/main/java/org/mozilla/tv/firefox/utils/ServiceLocator.kt

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
// We want the Pocket code from a-c: #1976. Unfortunately, the compiler won't let
6+
// us suppress individual lines so we have to suppress the file.
7+
@file:Suppress("DEPRECATION")
8+
59
package org.mozilla.tv.firefox.utils
610

711
import android.app.Application
@@ -87,6 +91,7 @@ open class ServiceLocator(val app: Application) {
8791
val screenshotStoreWrapper by lazy { PinnedTileImageUtilWrapper(app) }
8892
val formattedDomainWrapper by lazy { FormattedDomainWrapper(app) }
8993
val channelRepo by lazy { ChannelRepo(pinnedTileRepo) }
94+
@Suppress("DEPRECATION") // We need PocketEndpointRaw until we move to a-c's impl.
9095
val pocketEndpointRaw by lazy { PocketEndpointRaw(appVersion, buildConfigDerivables.globalPocketVideoEndpoint) }
9196
val pocketVideoStore by lazy { PocketVideoStore(app, app.assets, pocketVideoParser::convertVideosJSON) }
9297
val pocketVideoFetchScheduler by lazy { PocketVideoFetchScheduler(isPocketEnabledByLocale) }

app/src/test/java/org/mozilla/tv/firefox/pocket/PocketVideoParserTest.kt

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
@file:Suppress("DEPRECATION") // The class under test is deprecated.
6+
57
package org.mozilla.tv.firefox.pocket
68

79
import org.json.JSONObject

0 commit comments

Comments
 (0)