Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F10018175
D87.1771550509.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D87.1771550509.diff
View Options
diff --git a/build.gradle b/build.gradle
--- a/build.gradle
+++ b/build.gradle
@@ -55,8 +55,8 @@
applicationId "it.reyboz.bustorino"
minSdkVersion 16
targetSdkVersion 31
- versionCode 40
- versionName "1.17"
+ versionCode 41
+ versionName "1.17.1"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
javaCompileOptions {
diff --git a/metadata/en-US/changelogs/41.txt b/metadata/en-US/changelogs/41.txt
new file mode 100644
--- /dev/null
+++ b/metadata/en-US/changelogs/41.txt
@@ -0,0 +1 @@
+* fix database update
diff --git a/metadata/it/changelogs/41.txt b/metadata/it/changelogs/41.txt
new file mode 100644
--- /dev/null
+++ b/metadata/it/changelogs/41.txt
@@ -0,0 +1 @@
+* fix aggiornamento database
diff --git a/src/it/reyboz/bustorino/ActivityPrincipal.java b/src/it/reyboz/bustorino/ActivityPrincipal.java
--- a/src/it/reyboz/bustorino/ActivityPrincipal.java
+++ b/src/it/reyboz/bustorino/ActivityPrincipal.java
@@ -86,9 +86,11 @@
final int old_version = PreferencesHolder.getGtfsDBVersion(theShPr);
Log.d(DEBUG_TAG, "GTFS Database: old version is "+old_version+ ", new version is "+db_version);
if (old_version < db_version){
- //request db update
- dataUpdateRequested = true;
- DatabaseUpdate.requestDBUpdateWithWork(this, true, true);
+ //decide update conditions in the future
+ if(old_version < 2 && db_version >= 2) {
+ dataUpdateRequested = true;
+ DatabaseUpdate.requestDBUpdateWithWork(this, true, true);
+ }
PreferencesHolder.setGtfsDBVersion(theShPr, db_version);
}
diff --git a/src/it/reyboz/bustorino/backend/Result.java b/src/it/reyboz/bustorino/backend/Result.java
--- a/src/it/reyboz/bustorino/backend/Result.java
+++ b/src/it/reyboz/bustorino/backend/Result.java
@@ -35,4 +35,8 @@
this.result = null;
this.exception = error;
}
+
+ public interface Callback<T>{
+ void onComplete(Result<T> result);
+ }
}
diff --git a/src/it/reyboz/bustorino/middleware/AppLocationManager.java b/src/it/reyboz/bustorino/middleware/AppLocationManager.java
--- a/src/it/reyboz/bustorino/middleware/AppLocationManager.java
+++ b/src/it/reyboz/bustorino/middleware/AppLocationManager.java
@@ -30,6 +30,8 @@
import android.widget.Toast;
import androidx.core.content.ContextCompat;
+import androidx.core.location.LocationManagerCompat;
+import androidx.core.location.LocationRequestCompat;
import it.reyboz.bustorino.util.LocationCriteria;
import it.reyboz.bustorino.util.Permissions;
@@ -54,15 +56,13 @@
private int oldGPSLocStatus = LOCATION_UNAVAILABLE;
private int minimum_time_milli = -1;
- private boolean isLocationPermissionGiven = false;
-
private final ArrayList<WeakReference<LocationRequester>> requestersRef = new ArrayList<>();
private AppLocationManager(Context context) {
this.appContext = context.getApplicationContext();
locMan = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
- isLocationPermissionGiven = checkLocationPermission(context);
+ boolean isLocationPermissionGiven = checkLocationPermission(context);
}
public static AppLocationManager getInstance(Context con) {
@@ -80,7 +80,12 @@
final int timeinterval = (minimum_time_milli>0 && minimum_time_milli<Integer.MAX_VALUE)? minimum_time_milli : 2000;
locMan.removeUpdates(this);
- locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, timeinterval, 5, this);
+ if(locMan.getAllProviders().contains("gps"))
+ locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, timeinterval, 5, this);
+ /*LocationManagerCompat.requestLocationUpdates(locMan, LocationManager.GPS_PROVIDER,
+ new LocationRequestCompat.Builder(timeinterval).setMinUpdateDistanceMeters(5.F).build(),this, );
+ TODO: find a way to do this
+ */
}
private void cleanAndUpdateRequesters(){
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 20, 02:21 (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1649843
Default Alt Text
D87.1771550509.diff (4 KB)
Attached To
Mode
D87: Fix version of db to trigger update
Attached
Detach File
Event Timeline
Log In to Comment