diff --git a/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj b/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj index ab77826064ef..8361e710fdb1 100644 --- a/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj +++ b/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj @@ -16,8 +16,7 @@ Resources\Resource.Designer.cs Off v12.0 - true - Properties\AndroidManifest.xml + Properties\AndroidManifest.xml True ..\SamplesApp.Shared\Strings true @@ -258,4 +257,4 @@ <_ExplicitReference Remove="@(_FilteredExplicitReference)" /> - + \ No newline at end of file diff --git a/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml b/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml index d98b5f49030b..1e0a0b7ae75a 100644 --- a/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml @@ -23,6 +23,8 @@ + + diff --git a/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml.cs index f6da07f0f744..7cc25af7d532 100644 --- a/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Windows_Devices/GeolocatorTests.xaml.cs @@ -47,6 +47,8 @@ internal class GeolocatorTestsViewModel : ViewModelBase public GeolocatorTestsViewModel(CoreDispatcher dispatcher) : base(dispatcher) { PositionStatus = _geolocator.LocationStatus; + timeout = TimeSpan.FromSeconds(10); + maximumAge = TimeSpan.FromSeconds(15); } public Geoposition Geoposition @@ -59,6 +61,9 @@ public Geoposition Geoposition } } + public TimeSpan timeout { get; set; } + public TimeSpan maximumAge { get; set; } + public Geoposition TrackedGeoposition { get => _trackedGeoposition; @@ -95,6 +100,8 @@ public uint? DesiredAccuracyInMeters set => _geolocator.DesiredAccuracyInMeters = value; } + + public PositionStatus PositionStatus { get => _positionStatus; @@ -105,6 +112,7 @@ public PositionStatus PositionStatus } } + public string Error { get => _error; @@ -164,7 +172,24 @@ private async void GetGeoposition() { try { - Geoposition = await _geolocator.GetGeopositionAsync(); + var timeout1 = new TimeSpan(0, 0, timeout.Hours, timeout.Seconds); + var maximumAge1 = new TimeSpan(0, 0, maximumAge.Hours, maximumAge.Seconds); + + var startTime = DateTimeOffset.Now; + + Geoposition = await _geolocator.GetGeopositionAsync(maximumAge1, timeout1); + + if(Geoposition.Coordinate.Timestamp < DateTimeOffset.Now - maximumAge) + { + Error = "Implementation error: Position data is too old"; + } + + if (startTime < DateTimeOffset.Now - timeout) + { + Error = "Implementation error: no reaction for TimeOut parameter"; + } + + } catch (Exception ex) {