Skip to content

Commit

Permalink
Remove references to Priority JobQueue, switched over to WorkManager
Browse files Browse the repository at this point in the history
  • Loading branch information
mendhak committed Mar 17, 2024
1 parent 4e8a83b commit 43a9068
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 195 deletions.
7 changes: 1 addition & 6 deletions gpslogger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,9 @@ dependencies {
//Progress button
implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'

//Android Priority Jobqueue
implementation ('com.birbit:android-priority-jobqueue:2.0.1'){
exclude group: 'com.google.android', module: 'android'
}

//Android's WorkManager
implementation 'androidx.work:work-runtime:2.9.0'
// It needs Gson
// We need to use Gson to help with WorkManager limitations
implementation 'com.google.code.gson:gson:2.10.1'

//Event bus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@

import android.app.Application;

import com.birbit.android.jobqueue.JobManager;
import com.birbit.android.jobqueue.config.Configuration;
import com.birbit.android.jobqueue.log.CustomLogger;

import com.mendhak.gpslogger.BuildConfig;
import com.mendhak.gpslogger.common.slf4j.Logs;
import de.greenrobot.event.EventBus;
import org.slf4j.Logger;

public class AppSettings extends Application {

private static JobManager jobManager;

private static AppSettings instance;
private static Logger LOG;

Expand All @@ -50,25 +48,10 @@ public void onCreate() {
EventBus.builder().logNoSubscriberMessages(false).sendNoSubscriberEvent(false).installDefaultEventBus();
LOG.debug("EventBus configured");

//Configure the Job Queue
Configuration config = new Configuration.Builder(getInstance())
.networkUtil(new WifiNetworkUtil(getInstance()))
.consumerKeepAlive(60)
.minConsumerCount(0)
.maxConsumerCount(1)
// .customLogger(jobQueueLogger)
.build();
jobManager = new JobManager(config);
LOG.debug("Job Queue configured");
}

/**
* Returns a configured Job Queue Manager
*/
public static JobManager getJobManager() {
return jobManager;
}


public AppSettings() {
instance = this;
}
Expand All @@ -81,35 +64,4 @@ public static AppSettings getInstance() {
}


private final CustomLogger jobQueueLogger = new CustomLogger() {
@Override
public boolean isDebugEnabled() {
return BuildConfig.DEBUG;
}

@Override
public void d(String text, Object... args) {

LOG.debug(String.format(text, args));
}

@Override
public void e(Throwable t, String text, Object... args) {
LOG.error(String.format(text, args), t);
}

@Override
public void e(String text, Object... args) {

LOG.error(String.format(text, args));
}

@Override
public void v(String text, Object... args) {
LOG.debug(String.format(text,args));
}
};



}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;

import com.birbit.android.jobqueue.CancelResult;
import com.birbit.android.jobqueue.JobManager;
import com.birbit.android.jobqueue.TagConstraint;
import com.mendhak.gpslogger.common.AppSettings;
import com.mendhak.gpslogger.common.PreferenceHelper;
import com.mendhak.gpslogger.common.Strings;
Expand Down

0 comments on commit 43a9068

Please sign in to comment.