Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Pull Latest Into Live for 0.9.0-preview (#435)
Browse files Browse the repository at this point in the history
* GH-343: Take into consideration VerticalAccuracy on iOS Altitude (#344)

* Fix for #343

Only set altitude if it's available (VerticalAccuracy is negative when it isn't according to iOS doc)

* Use: (double?)

* dotnet foundation CLA broken link (#349)

* Update ns-Xamarin.Essentials.xml

* Update README.md (#340)

* GH-365 Change to generic EventHandlers

* Clean up unit tests.

* GH-363 Enable C# 7.2 (#364)

* GH-363 Enable CD 7.3

* Update Xamarin.Essentials.csproj

* GH-367 Change Ui to UI & Ac to AC (#374)

* GH-367 Change Ui to UI

* Ensure proper Ui for Android

* Fix gryoscope

* Rename Ac to AC

* Update framework indexes

* Create Product Feedback page for Docs (#369)

* Create PRODUCT-FEEDBACK.md

* Update PRODUCT-FEEDBACK.md

* Fixed a typo from "chanaged" to "changed"

* Fixed a typo from "chanaged" to "changed"

* Fixed a typo from "chanaged" to "changed"

* GH-337 Android Low Pass Filter (#354)

* Implemented low pass filter as requested by issue 337

* Added value to sample page.

* Updated docs for ApplyLowPassFilter

* Enabled ApplyLowPassFilter Switch on Android, disabled on all other platforms

* Moved LowPassFilter to shared, removed unnecessary usings.

* Updated Docs

* Sample Project Tweaks and Optimizations (#353)

* Make sure orientation sensor stops on sample.

* Fix up all sensors page to start and stop correctly

* Only check permission if unknown status

* Update to latest sdk.extras

* fix back button press on TTS page. Check for null.

* Add samples sln for CI/CD

* Update readme and samples sln

* Don't use code sign key for simbuilds

* let's try this gain

* Update to projects

* Cleanup sample config

* bump sdk extras

* Add in readme for install with helpful information. Bump MSBuild.Sdk.Extras (#392)

* GH-368: Allow for unicode in host names and escape query (#393)

* Allow for unicode in host names and escape query

Previously we were passing the the url as is to each platform and letting it deal with how to parse into the platform specific url.

This handles unicode domain names (IDN Mapping aka PunyCode) for the domain, but also reconstructs the url based on the parsed System.Uri from the original string, and so the PathAndQuery will be the % escaped version which will account for unicode characters in it as well.

Finally, on iOS and Android we are using AbsoluteUri to end up with the fully IDN mapped and % encoded URL to pass to the system URL types.

* Extract Escape Uri logic into its own method

More testable.

* Add uri escaping tests

* Improve uri escape tests

* Update default iOS DeviceTests target

Also don’t allow picking a sim that’s unavailable (this was a bug since we were checking for contains `available` which of course `unavailable` also contains!)

* Update iOS DeviceInfo.Model to return specifid hw.machine for more control. (#395)

via:
https://github.com/xamarin/xamarin-macios/blob/bc492585d137d8c3d3a2ffc827db3cdaae3cc869/tests/linker/ios/link%20sdk/LinkSdkRegressionTest.cs#L603-L631

Added tests

* GH-380 Use Internal Preferences for Secure Storage consistency. (#386)

* Use Internal Preferences for Secure Storage consistency.
Save if we created key pre-M so we always use pre-M if device upgrades.

* Fix logic for pre-m key check

The logic was slightly off, I think this fixes it, but would be good to have another set of eyes...

1. We check to see if the device is pre-M (if it does _not_ have `M`, or if we already set the fact it's pre-M in the preference - aka from a previous install before an upgrade of the OS)
2. If we aren't pre-M, we can't use Symmetric Key from Keystore
3. If we make it down to using Asymmetric Key, we set the pre-M preference to `true` to persist the value for future invocations, which will make it 'stick' in the event of a pre-M to M+ OS upgrade.

* Address feedback on key naming.

* Added test for secure storage to simulate upgrade

From API < 23 to API >= 23 after storing data with an asymmetric key and then moving to a platform supporting symmetric keys.

* Ensure we always set flags when using specified keygen

* GH-388 If activity is required and null throw null exception with information. (#396)

* If activity is required and null throw null exception with information.

* Remove currentactivity and update getcurrentactivity.

* GH-250 Implement Launcher API (#356) (#405)

* GH-250 Implement Launcher API (#356)

* Initial commit for Launcher Api as discussed in Issue 250

* Fixed and refactored android launch code, fixed unit tests. Fixed namespaces.

* Refactored code, fixed uwp launcher. Added unit test

* Added sample launcher page and viewmodel.

* Fixed launcher Page typo

* Refactored launcher code. after testing exception behaviour I decided on rethrowing instead of swallowing the exception

* Refactored access modifiers. Also changed exception behaviour to enforce uri validity and exception behaviour across platforms.

* Updated docs, stripped even more code.

* Added validation. Adressed all other changes as required in pr

* Removed dead code

* Adressed last issues from pr

* Cleanup launcher

* cleanup iOS tests

* Early morning typos

* Name Alignment for BrowserLaunchMode (#408)

* Rename BrowserLaunchType to BrowserLaunchMode

* update nuget

* Rename parameter

* GH-287 OpenMaps Implementation (#361) (#404)

* GH-287 Maps Implementation (#361)

* Implemented maps as mentioned in branch name issue. also fixed a spelling mistake

* Added samples

* Added doc stubs

* Added comments for map types

* Refactored code

* Formatting of docs

* Added tests

* Changed coordinates to display something recognisable

* Added uri escaping, thus removing duplicate code. also had to turn off a warning due to inconsistent style cop and vs warning behaviour.

* Removed ref until in is added in c# 7.2

* Adressed issues in pr

* Updated launch code

* Adressed method to onliner

* Updated docs

* Removed ClearTop intent, added sample with adress

* Rename to align names. Added extensions and additional paramaters.

* Update tests

* Throw if options are null.

* Add overload for lat/long without options

* Enable multi-target for 25,26,27 (#411)

Alight nuget versions to xamarin.forms.

* No More Shared Projects (#410)

* Change to multi-targeted project for device tests :)

* Cleanup scripts

* Fix build error due to preprocessor directive (#417)

* Sync Sensor Speeds & Reset UWP to 0 (#419)

* Restore the default report interval to release resources while the sensor is not in use

* Cleanup sensor reading times.
Make them all the same and only in 1 place
Compass is still unique

* Create unique preference storage for each feature. (#434)

* Create unique preference storage for each feature.

* update storage per @Redth

* Update version
  • Loading branch information
jamesmontemagno committed Jul 31, 2018
1 parent c369697 commit feba753
Show file tree
Hide file tree
Showing 168 changed files with 2,811 additions and 1,068 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please see our [Code of Conduct](CODE_OF_CONDUCT.md).

## Prerequisite

You will need to complete a Contribution License Agreement before any pull request can be accepted. Complete the CLA at https://cla2.dotnetfoundation.org/.
You will need to complete a Contribution License Agreement before any pull request can be accepted. Complete the CLA at https://cla.dotnetfoundation.org/.

## Contributing Code

Expand Down
25 changes: 21 additions & 4 deletions DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>DeviceTests.Droid</RootNamespace>
<AssemblyName>DeviceTests.Android</AssemblyName>
<AssemblyName>XamarinEssentialsDeviceTestsAndroid</AssemblyName>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
Expand Down Expand Up @@ -43,6 +43,20 @@
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AndroidLinkSkip />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Samples|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Samples</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi;armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AndroidLinkSkip />
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
Expand All @@ -51,7 +65,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.1.0.583944" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.637273" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
Expand All @@ -60,7 +74,7 @@
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="27.0.2.1" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.devices" Version="2.3.3" />
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
</ItemGroup>
Expand All @@ -69,6 +83,10 @@
<Project>{63a4f6a1-48bf-4d32-aed7-82f605edb042}</Project>
<Name>Xamarin.Essentials</Name>
</ProjectReference>
<ProjectReference Include="..\DeviceTests.Shared\DeviceTests.Shared.csproj">
<Project>{be0de9a3-d92c-47c5-9ec4-dfb546bbdf77}</Project>
<Name>DeviceTests.Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down Expand Up @@ -114,6 +132,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\DeviceTests.Shared\DeviceTests.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
1 change: 1 addition & 0 deletions DeviceTests/DeviceTests.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected override void OnCreate(Bundle bundle)

// tests can be inside the main assembly
AddTestAssembly(Assembly.GetExecutingAssembly());
AddTestAssembly(typeof(Battery_Tests).Assembly);
AddExecutionAssembly(typeof(Battery_Tests).Assembly);

// or in any reference assemblies
Expand Down
6 changes: 3 additions & 3 deletions DeviceTests/DeviceTests.Shared/Accelerometer_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task Monitor(SensorSpeed sensorSpeed)
Accelerometer.ReadingChanged += Accelerometer_ReadingChanged;
Accelerometer.Start(sensorSpeed);

void Accelerometer_ReadingChanged(AccelerometerChangedEventArgs e)
void Accelerometer_ReadingChanged(object sender, AccelerometerChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand All @@ -51,7 +51,7 @@ public async Task IsMonitoring(SensorSpeed sensorSpeed)
Accelerometer.ReadingChanged += Accelerometer_ReadingChanged;
Accelerometer.Start(sensorSpeed);

void Accelerometer_ReadingChanged(AccelerometerChangedEventArgs e)
void Accelerometer_ReadingChanged(object sender, AccelerometerChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand All @@ -76,7 +76,7 @@ public async Task Stop_Monitor(SensorSpeed sensorSpeed)
Accelerometer.ReadingChanged += Accelerometer_ReadingChanged;
Accelerometer.Start(sensorSpeed);

void Accelerometer_ReadingChanged(AccelerometerChangedEventArgs e)
void Accelerometer_ReadingChanged(object sender, AccelerometerChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand Down
5 changes: 5 additions & 0 deletions DeviceTests/DeviceTests.Shared/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsAndroid")]
[assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsUWP")]
[assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsiOS")]
6 changes: 3 additions & 3 deletions DeviceTests/DeviceTests.Shared/Compass_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public async Task Monitor(SensorSpeed sensorSpeed)
var tcs = new TaskCompletionSource<CompassData>();

Compass.ReadingChanged += Compass_ReadingChanged;
void Compass_ReadingChanged(CompassChangedEventArgs e)
void Compass_ReadingChanged(object sender, CompassChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand All @@ -50,7 +50,7 @@ public async Task IsMonitoring(SensorSpeed sensorSpeed)

var tcs = new TaskCompletionSource<CompassData>();
Compass.ReadingChanged += Compass_ReadingChanged;
void Compass_ReadingChanged(CompassChangedEventArgs e)
void Compass_ReadingChanged(object sender, CompassChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand All @@ -74,7 +74,7 @@ public async Task Stop_Monitor(SensorSpeed sensorSpeed)

var tcs = new TaskCompletionSource<CompassData>();
Compass.ReadingChanged += Compass_ReadingChanged;
void Compass_ReadingChanged(CompassChangedEventArgs e)
void Compass_ReadingChanged(object sender, CompassChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand Down
25 changes: 25 additions & 0 deletions DeviceTests/DeviceTests.Shared/DeviceInfo_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,31 @@ public void AppName_Is_Correct()
Assert.Equal("Tests", AppInfo.Name);
}

[Fact]
public void DeviceModel_Is_Correct()
{
#if WINDOWS_UWP
// Nothing right now.
#elif __IOS__
if (DeviceInfo.DeviceType == DeviceType.Virtual)
{
Assert.Equal("x86_64", DeviceInfo.Model);
}
#elif __ANDROID__

if (DeviceInfo.DeviceType == DeviceType.Virtual)
{
var isEmulator = DeviceInfo.Model.Contains("google_sdk") ||
DeviceInfo.Model.Contains("Emulator") ||
DeviceInfo.Model.Contains("Android SDK built for x86");

Assert.True(isEmulator);
}
#else
throw new PlatformNotSupportedException();
#endif
}

[Fact]
public void AppPackageName_Is_Correct()
{
Expand Down
64 changes: 64 additions & 0 deletions DeviceTests/DeviceTests.Shared/DeviceTests.Shared.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<!--Work around so the conditions work below-->
<TargetFrameworks>
</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">Xamarin.iOS10;MonoAndroid81;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">Xamarin.iOS10;MonoAndroid81;</TargetFrameworks>
<AssemblyName>XamarinEssentialsDeviceTestsShared</AssemblyName>
<RootNamespace>DeviceTests.Shared</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0</Version>
<NeutralLanguage>en</NeutralLanguage>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<LangVersion>7.2</LangVersion>
<DefineConstants>$(DefineConstants);</DefineConstants>
<MDocDocumentationDirectory>$(MSBuildThisFileDirectory)..\docs\en</MDocDocumentationDirectory>
<Configurations>Debug;Release;Samples</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Samples'">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.6.41" PrivateAssets="All" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.637273" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.devices" Version="2.3.3" />
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.5" />
<SDKReference Include="WindowsMobile, Version=10.0.16299.0">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="27.0.2.1" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
<Import Project="$(MSBuildThisFileDirectory)..\..\CodeStyles.targets" />
</Project>
36 changes: 0 additions & 36 deletions DeviceTests/DeviceTests.Shared/DeviceTests.Shared.projitems

This file was deleted.

11 changes: 0 additions & 11 deletions DeviceTests/DeviceTests.Shared/DeviceTests.Shared.shproj

This file was deleted.

6 changes: 3 additions & 3 deletions DeviceTests/DeviceTests.Shared/Gyroscope_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task Monitor(SensorSpeed sensorSpeed)
Gyroscope.ReadingChanged += Gyroscope_ReadingChanged;
Gyroscope.Start(sensorSpeed);

void Gyroscope_ReadingChanged(GyroscopeChangedEventArgs e)
void Gyroscope_ReadingChanged(object sender, GyroscopeChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand All @@ -51,7 +51,7 @@ public async Task IsMonitoring(SensorSpeed sensorSpeed)
Gyroscope.ReadingChanged += Gyroscope_ReadingChanged;
Gyroscope.Start(sensorSpeed);

void Gyroscope_ReadingChanged(GyroscopeChangedEventArgs e)
void Gyroscope_ReadingChanged(object sender, GyroscopeChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand All @@ -76,7 +76,7 @@ public async Task Stop_Monitor(SensorSpeed sensorSpeed)
Gyroscope.ReadingChanged += Gyroscope_ReadingChanged;
Gyroscope.Start(sensorSpeed);

void Gyroscope_ReadingChanged(GyroscopeChangedEventArgs e)
void Gyroscope_ReadingChanged(object sender, GyroscopeChangedEventArgs e)
{
tcs.TrySetResult(e.Reading);
}
Expand Down

0 comments on commit feba753

Please sign in to comment.