Compare commits

..

No commits in common. '9e3612469b035b0fc02cf9ba0fffbabe9a762725' and 'db092616c0c7bc0cfb8d79eab0dceb9e66840f83' have entirely different histories.

  1. 5
      app/build.gradle
  2. BIN
      app/libs/org.apache.http.legacy.jar
  3. 11
      app/src/main/java/org/transdroid/core/service/AppUpdateJobRunner.java

5
app/build.gradle

@ -103,9 +103,4 @@ dependencies {
annotationProcessor 'org.androidannotations:androidannotations:4.8.0' annotationProcessor 'org.androidannotations:androidannotations:4.8.0'
annotationProcessor 'org.androidannotations:ormlite:4.8.0' annotationProcessor 'org.androidannotations:ormlite:4.8.0'
// Copied From androidSdkPath/platforms/android-31/optional/org.apache.http.legacy.jar
// Using it as a compileOnly so this helps while developing, but is not compiled into the final
// app, see https://developer.android.com/studio/build/dependencies#dependency_configurations
compileOnly files('libs/org.apache.http.legacy.jar')
} }

BIN
app/libs/org.apache.http.legacy.jar

Binary file not shown.

11
app/src/main/java/org/transdroid/core/service/AppUpdateJobRunner.java

@ -26,6 +26,7 @@ import android.net.Uri;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.work.ListenableWorker;
import androidx.work.Worker; import androidx.work.Worker;
import org.androidannotations.annotations.Bean; import org.androidannotations.annotations.Bean;
@ -90,7 +91,7 @@ public class AppUpdateJobRunner {
lastDay.add(Calendar.DAY_OF_MONTH, -1); lastDay.add(Calendar.DAY_OF_MONTH, -1);
if (lastChecked != null && lastChecked.after(lastDay.getTime())) { if (lastChecked != null && lastChecked.after(lastDay.getTime())) {
log.d(this, "Skip the update service, as we already checked the last 24 hours (or to be exact at " log.d(this, "Skip the update service, as we already checked the last 24 hours (or to be exact at "
+ lastChecked + ")."); + lastChecked.toString() + ").");
return Worker.Result.retry(); return Worker.Result.retry();
} }
@ -108,9 +109,9 @@ public class AppUpdateJobRunner {
// New version of the app? // New version of the app?
try { try {
PackageInfo appPackage = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); PackageInfo appPackage = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
log.d(this, "Local Transdroid is at " + appPackage.versionCode + " and the reported latest version is " log.d(this, "Local Transdroid is at " + appPackage.getLongVersionCode() + " and the reported latest version is "
+ appVersion); + appVersion);
if (appPackage.versionCode < appVersion) { if (appPackage.getLongVersionCode() < appVersion) {
// New version available! Notify the user. // New version available! Notify the user.
newNotification(context.getString(R.string.update_app_newversion), newNotification(context.getString(R.string.update_app_newversion),
context.getString(R.string.update_app_newversion), context.getString(R.string.update_app_newversion),
@ -124,9 +125,9 @@ public class AppUpdateJobRunner {
// New version of the search module? // New version of the search module?
try { try {
PackageInfo searchPackage = context.getPackageManager().getPackageInfo("org.transdroid.search", 0); PackageInfo searchPackage = context.getPackageManager().getPackageInfo("org.transdroid.search", 0);
log.d(this, "Local Transdroid Search is at " + searchPackage.versionCode log.d(this, "Local Transdroid Search is at " + searchPackage.getLongVersionCode()
+ " and the reported latest version is " + searchVersion); + " and the reported latest version is " + searchVersion);
if (searchPackage.versionCode < searchVersion) { if (searchPackage.getLongVersionCode() < searchVersion) {
// New version available! Notify the user. // New version available! Notify the user.
newNotification(context.getString(R.string.update_search_newversion), newNotification(context.getString(R.string.update_search_newversion),
context.getString(R.string.update_search_newversion), context.getString(R.string.update_search_newversion),

Loading…
Cancel
Save