Permalink
Browse files

Update to WorkManager 1.0.0-alpha09

  • Loading branch information...
ianhanniballake committed Sep 21, 2018
1 parent 27c0404 commit 9a305201a4d2a0f65064144e9908e3bf13f1eb69
@@ -69,4 +69,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
@@ -17,6 +17,7 @@
package com.google.android.apps.muzei.sync
import android.content.ContentUris
import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.RemoteException
@@ -31,6 +32,7 @@ import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.google.android.apps.muzei.api.internal.ProtocolConstants
import com.google.android.apps.muzei.api.internal.ProtocolConstants.KEY_MAX_LOADED_ARTWORK_ID
import com.google.android.apps.muzei.api.internal.ProtocolConstants.KEY_RECENT_ARTWORK_IDS
@@ -55,7 +57,10 @@ import java.util.concurrent.TimeUnit
* Worker responsible for loading artwork from a [MuzeiArtProvider] and inserting it into
* the [MuzeiDatabase].
*/
class ArtworkLoadWorker : Worker() {
class ArtworkLoadWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
companion object {
private const val TAG = "ArtworkLoad"
@@ -32,6 +32,7 @@ import androidx.work.Constraints
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import com.google.android.apps.muzei.api.internal.ProtocolConstants
import com.google.android.apps.muzei.api.internal.ProtocolConstants.KEY_LAST_LOADED_TIME
@@ -53,7 +54,10 @@ import java.util.concurrent.TimeUnit
* kicking off an immediate load if the current artwork is invalid or we're overdue for loading
* artwork.
*/
class ProviderChangedWorker : Worker() {
class ProviderChangedWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
companion object {
private const val TAG = "ProviderChanged"
View
@@ -28,7 +28,7 @@ buildscript {
roomVersion = "1.1.1"
pagingVersion = "1.0.1"
navigationVersion = "1.0.0-alpha06"
workManagerVersion = "1.0.0-alpha08"
workManagerVersion = "1.0.0-alpha09"
playServicesWearableVersion = "15.0.1"
firebaseCoreVersion = "16.0.3"
firebasePerfVersion = "16.1.0"
@@ -39,4 +39,9 @@ android {
manifestPlaceholders = [unsplashAuthority: unsplashAuthorityValue]
buildConfigField "String", "UNSPLASH_AUTHORITY", "\"${unsplashAuthorityValue}\""
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
View
@@ -92,6 +92,11 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
kotlin.experimental.coroutines "enable"
@@ -57,4 +57,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
@@ -28,6 +28,7 @@ import androidx.work.NetworkType
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.google.android.apps.muzei.api.provider.Artwork
import com.google.android.apps.muzei.api.provider.ProviderContract
import com.google.android.apps.muzei.featuredart.BuildConfig.FEATURED_ART_AUTHORITY
@@ -45,7 +46,10 @@ import java.util.Random
import java.util.TimeZone
import java.util.concurrent.TimeUnit
class FeaturedArtWorker : Worker() {
class FeaturedArtWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
companion object {
private const val TAG = "FeaturedArtWorker"
@@ -70,4 +70,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
@@ -18,6 +18,7 @@ package com.google.android.apps.muzei.gallery
import android.annotation.SuppressLint
import android.content.ContentUris
import android.content.Context
import android.content.pm.PackageManager
import android.location.Geocoder
import android.net.Uri
@@ -34,6 +35,7 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import com.google.android.apps.muzei.api.provider.Artwork
import com.google.android.apps.muzei.api.provider.ProviderContract
@@ -45,7 +47,10 @@ import java.text.SimpleDateFormat
import java.util.LinkedList
import java.util.Random
class GalleryScanWorker : Worker() {
class GalleryScanWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
companion object {
private const val TAG = "GalleryScanWorker"
private const val INITIAL_SCAN_TAG = "initialScan"
@@ -53,4 +53,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
View
@@ -80,6 +80,11 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Workaround for WorkManager alpha09: https://developer.android.com/jetpack/docs/release-notes#september_19_2018
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
kotlin.experimental.coroutines "enable"
@@ -17,6 +17,7 @@
package com.google.android.apps.muzei.complications
import android.content.ComponentName
import android.content.Context
import android.os.Build
import android.preference.PreferenceManager
import android.support.annotation.RequiresApi
@@ -27,6 +28,7 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.google.android.apps.muzei.api.MuzeiContract
import net.nurik.roman.muzei.BuildConfig
import java.util.TreeSet
@@ -35,7 +37,10 @@ import java.util.TreeSet
* Worker which listens for artwork change events and updates the Artwork Complication
*/
@RequiresApi(Build.VERSION_CODES.N)
class ArtworkComplicationWorker : Worker() {
class ArtworkComplicationWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
companion object {
private const val TAG = "ArtworkComplication"
@@ -16,11 +16,13 @@
package com.google.android.apps.muzei.datalayer
import android.content.Context
import android.net.Uri
import android.util.Log
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.google.android.apps.muzei.api.provider.ProviderContract
import com.google.android.apps.muzei.wearable.toArtwork
import com.google.android.gms.tasks.Tasks
@@ -36,7 +38,10 @@ import java.util.concurrent.ExecutionException
/**
* Load artwork from the Wear Data Layer, writing it into [DataLayerArtProvider].
*/
class DataLayerLoadWorker : Worker() {
class DataLayerLoadWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
companion object {
private const val TAG = "DataLayerLoadJobService"

0 comments on commit 9a30520

Please sign in to comment.