Skip to content

Commit

Permalink
Prune WorkManager completed tasks before login
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Jun 7, 2019
1 parent 9dca148 commit 5ca1548
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.work.WorkManager;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;

Expand Down Expand Up @@ -194,6 +196,9 @@ public void onClick(DialogInterface dialog, int which) {
// if token is not expired, then skip the login module
if (!UserUtility.getInstance(getApplicationContext()).isTokenExpired()) {
skipLogin();
} else {
// temporarily prune complete work on every login to ensure our unique work is rescheduled
WorkManager.getInstance().pruneWork();
}

// no title bar
Expand Down

0 comments on commit 5ca1548

Please sign in to comment.