Skip to content

Commit e57610d

Browse files
committed
Ensure a response to "Nearby Markers" even if there are none
This is a longstanding easy to fix bug. We now report "No nearby markers" rather than stay silent.
1 parent 73f25f8 commit e57610d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

app/src/main/java/org/scottishtecharmy/soundscape/geoengine/GeoEngine.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,16 @@ class GeoEngine {
848848
val gridFinishTime = timeSource.markNow()
849849
Log.e(GridState.TAG, "Time to calculate NearbyMarkers: ${gridFinishTime - gridStartTime}")
850850

851-
if(results.isEmpty())
852-
return null
851+
if(results.isEmpty()) {
852+
results.add(
853+
PositionedString(
854+
text = localizedContext.getString(R.string.callouts_no_nearby_markers),
855+
type = AudioType.STANDARD,
856+
earcon = NativeAudioEngine.EARCON_MODE_EXIT
857+
)
858+
)
859+
}
860+
853861

854862
return TrackedCallout(
855863
userGeometry = userGeometry,

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@
304304
<string name="callouts_nothing_to_call_out_now">"There is nothing to call out right now"</string>
305305
<!-- Button text for the hear my surroundings button which calls out nearby markers -->
306306
<string name="callouts_nearby_markers">"Nearby Markers"</string>
307+
<!-- Text read out when there are no markers nearby to report -->
308+
<string name="callouts_no_nearby_markers">"There are no nearby markers"</string>
307309
<!-- Sleep Title, Sleep. Putting the app in an idle state for a period of time. -->
308310
<string name="sleep_sleep">"Sleep"</string>
309311
<!-- App is currently Sleeping. Putting the app in an idle state for a period of time. -->

0 commit comments

Comments
 (0)