Skip to content

Commit

Permalink
remove admin password dialog even on location fetch failure when vali…
Browse files Browse the repository at this point in the history
…date_far_structures flag is set to false
  • Loading branch information
lindagcaba committed Feb 7, 2023
1 parent c9f2c3e commit f80a798
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions opensrp-reveal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ android {
minSdkVersion 26
targetSdkVersion 28
versionCode 75
versionName "10.4.4"
versionName "10.4.5"
multiDexEnabled true
buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l"
buildConfigField "boolean", "TIME_CHECK", "false"
Expand Down Expand Up @@ -155,13 +155,13 @@ android {
}

debug {
resValue "string", 'opensrp_base_url', '"https://api-isg-mz-uat.akros.online/"'
resValue "string", 'opensrp_base_url', '"https://api-ef-ke-uat.akros.online/"'
buildConfigField "Integer", "DATABASE_VERSION", '14'
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '250'
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100'
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2'
buildConfigField "long", "SYNC_INTERVAL_IN_MINUTES", '480'
buildConfigField "org.smartregister.reveal.util.Country", "BUILD_COUNTRY", "org.smartregister.reveal.util.Country.MOZAMBIQUE"
buildConfigField "org.smartregister.reveal.util.Country", "BUILD_COUNTRY", "org.smartregister.reveal.util.Country.KENYA"
buildConfigField "long", "PULL_UNIQUE_IDS_MINUTES", '15'
buildConfigField "String", "ADMIN_PASSWORD_NOT_NEAR_STRUCTURES", '"AdminPass1"'
buildConfigField "float", "MY_LOCATION_BUFFER", '25'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public void validateUserLocation() {
@Override
public void onGetUserLocation(Location location) {
Feature userFeature = getFeatureUserIsIn(location);
if (userFeature == null || !Objects.equals(userFeature.id(), selectedFeature.id())) {
if (validateFarStructures() && userFeature == null || !Objects.equals(userFeature.id(), selectedFeature.id())) {
requestUserPassword();
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onGetUserLocation(Location location) {
double offset = callback.getTargetCoordinates().distanceTo(
new LatLng(location.getLatitude(), location.getLongitude()));
appExecutors.diskIO().execute(() -> logAdminPassRequiredEvent(location,offset > Utils.getLocationBuffer(isCurrentTargetLevelStructure()) && validateFarStructures()));
if (offset > Utils.getLocationBuffer(isCurrentTargetLevelStructure()) && validateFarStructures()) {
if (validateFarStructures() && offset > Utils.getLocationBuffer(isCurrentTargetLevelStructure())) {
callback.requestUserPassword();
} else {
callback.onLocationValidated();
Expand All @@ -66,7 +66,9 @@ public void onGetUserLocation(Location location) {
@Override
public void onGetUserLocationFailed() {
locationView.hideProgressDialog();
callback.requestUserPassword();
if(validateFarStructures()){
callback.requestUserPassword();
}
}

@Override
Expand Down

0 comments on commit f80a798

Please sign in to comment.