Merge branch 'fix-bg' of s416084/find-my-tutor-android into develop
This commit is contained in:
commit
59c28e35d8
@ -10,7 +10,7 @@ android {
|
||||
applicationId "com.uam.wmi.findmytutor"
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 27
|
||||
versionCode 50
|
||||
versionCode 52
|
||||
versionName "1.0.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
@ -186,18 +186,19 @@ public class BackgroundLocalizationService extends Service {
|
||||
private void changeBackgroundMode() {
|
||||
Integer prevInterval = notify_interval;
|
||||
Boolean shouldExtendTimeInterval = Stream.of(coordinatesHistory)
|
||||
.map(MapUtils::checkIfCoordinateIsValid).takeWhile(s -> !s).toList().size() == coordinatesHistory.size();
|
||||
.map(MapUtils::checkIfCoordinateIsValid).takeWhile(s -> !s).toList().size() == coordinatesHistoryLength;
|
||||
|
||||
Boolean shouldAbbreviateTimeInterval = Stream.of(coordinatesHistory).
|
||||
map(MapUtils::checkIfCoordinateIsValid).filter(x -> x).toList().size() > 0;
|
||||
|
||||
if (shouldExtendTimeInterval) {
|
||||
notify_interval = notify_interval_outside_building;
|
||||
}
|
||||
|
||||
if (shouldAbbreviateTimeInterval) {
|
||||
notify_interval = notify_interval_inside_building;
|
||||
}
|
||||
|
||||
if (coordinatesHistory.size() > coordinatesHistoryLength && shouldExtendTimeInterval) {
|
||||
notify_interval = notify_interval_outside_building;
|
||||
}
|
||||
|
||||
Integer changedMode = Long.valueOf(prevInterval).compareTo(Long.valueOf(notify_interval));
|
||||
if (changedMode != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user