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

Merging main to live to update docs #2043

Merged
merged 172 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
7b54620
Merge branch xamarin:main into dimonovdd:main
dimonovdd Oct 8, 2020
19c4b9c
Merge pull request #5 from xamarin/main
dimonovdd Oct 14, 2020
221b129
Merge xamarin:main into dimonovdd:main
dimonovdd Oct 14, 2020
d46ce2e
Merge xamarin:main into dimonovdd:main
dimonovdd Oct 19, 2020
d129f51
Merge Xamarin:main into dimonovdd:main
dimonovdd Oct 24, 2020
01aa686
merge xamarin:main into dimonovdd:main
dimonovdd Nov 7, 2020
c49f378
merge xamarin:main into dimonovdd:main
dimonovdd Nov 7, 2020
47fcaee
merge xamarin:main into dimonovdd:main
dimonovdd Nov 15, 2020
c6e9303
merge xamarin:main into dimonovdd:main
dimonovdd Nov 20, 2020
bf59618
merge xamarin:main into dimonovdd:main
dimonovdd Nov 22, 2020
a2950ec
merge xamarin:main into dimonovdd:main
dimonovdd Nov 24, 2020
637d91f
merge xamarin:main into dimonovdd:main
dimonovdd Nov 25, 2020
0175072
Implement the new ConnectivityManager.NetworkCallback for N+
jamesmontemagno Dec 3, 2020
5ca36a0
Merge branch 'main' into gh-512-spike
mattleibow Dec 6, 2020
7b88eca
merge xamarin:main into dimonovdd:main
dimonovdd Dec 19, 2020
29244c6
Merge pull request #18 from xamarin/main
dimonovdd Dec 22, 2020
bb65055
merge xamarin:main into dimonovdd:main
dimonovdd Dec 27, 2020
0868e1c
merge xamarin:main into dimonovdd:main
dimonovdd Jan 16, 2021
fa2cd60
merge xamarin:main into dimonovdd:main
dimonovdd Jan 24, 2021
18dd6c6
merge xamarin:main into dimonovdd:main
dimonovdd Jan 26, 2021
b0fc1bb
Ensure granted (#1658)
mattleibow Jan 27, 2021
66fb6ac
merge xamarin:main into dimonovdd:main
dimonovdd Jan 30, 2021
1bd8b65
Fix crash when using WebAuthenticator.AuthenticateAsync #1586 (#1687)
jgoyvaerts Feb 10, 2021
5f8314f
merge xamarin:main into dimonovdd:main
dimonovdd Feb 13, 2021
9139586
Make sure to clean the list
mattleibow Feb 16, 2021
fb37758
Only use known feeds (#1692)
mattleibow Feb 17, 2021
7218ab8
Update to 1.6.2
mattleibow Feb 17, 2021
65739e7
merge xamarin:main into dimonovdd:main
dimonovdd Feb 19, 2021
6c4495b
better UIColor conversion
tipa Mar 5, 2021
3c8f1ca
Fixes #1729 check for ios 13 on max frame rates
jamesmontemagno Mar 17, 2021
c1f9331
Update MediaPicker.ios.cs
AndyG74 Mar 18, 2021
3234099
Fixes #1748 - try/catch getting display info
jamesmontemagno Apr 13, 2021
82038f8
Fixed #1355 delay processing change so OS updates
jamesmontemagno Apr 13, 2021
f599f48
Fixes #1661 use passed in phone as fallback if can't format
jamesmontemagno Apr 13, 2021
cbc1b57
update FileBase docs
dimonovdd Apr 14, 2021
aee6b07
Controller's dismiss moved to Complete action
dimonovdd Apr 17, 2021
9282cd4
Bump AndroidX
jamesmontemagno Jun 9, 2021
856bde1
Implement prefersEphemeralWebBrowserSession Fixes #1712
jamesmontemagno Jun 24, 2021
1e3af17
Update WebAuthenticator.shared.cs
mattleibow Jun 24, 2021
465a6a9
Update AssemblyInfo.ios.tvos.watchos.macos.cs
mattleibow Jun 24, 2021
712aeae
Update AssemblyInfo.ios.tvos.watchos.macos.cs
mattleibow Jun 24, 2021
9c26bc4
Seems API 23 has a broken emulator that can't boot
mattleibow Jun 25, 2021
16099cb
Optimize iOS code to local function
jamesmontemagno Jun 25, 2021
065fb10
Put in check for iOS & ios 11
jamesmontemagno Jun 25, 2021
4365efb
Merge branch 'gh-1712' of https://github.com/xamarin/Essentials into …
jamesmontemagno Jun 25, 2021
d40ff56
Update AssemblyInfo.ios.tvos.watchos.macos.cs
mattleibow Jun 25, 2021
12177bc
Merge pull request #1837 from xamarin/gh-1712
Redth Jul 12, 2021
d6571a6
Merge branch 'main' into androidx-bump-6-2021
Redth Jul 12, 2021
6bca9da
Merge pull request #1826 from xamarin/androidx-bump-6-2021
Redth Jul 12, 2021
f8e98e9
Merge branch 'main' into fix1757
Redth Jul 12, 2021
5bc7af0
Merge pull request #1765 from dimonovdd/fix1757
Redth Jul 12, 2021
2980ea3
Merge branch 'main' into patch-1
Redth Jul 12, 2021
1ef03fb
Merge pull request #1734 from AndyG74/patch-1
Redth Jul 12, 2021
e64d84d
Merge branch 'main' into fileBaseSummary
Redth Jul 12, 2021
59d8c64
Merge pull request #1759 from dimonovdd/fileBaseSummary
Redth Jul 12, 2021
9a12755
Merge branch 'main' into gh-1748
Redth Jul 12, 2021
9684bc8
Merge pull request #1754 from xamarin/gh-1748
Redth Jul 12, 2021
dd041a3
Merge branch 'main' into gh-1661
Redth Jul 12, 2021
1dc7f97
Merge pull request #1756 from xamarin/gh-1661
Redth Jul 12, 2021
02ba4fa
Merge branch 'main' into jamesmontemagno-patch-2
mattleibow Jul 12, 2021
6601f73
Merge branch 'main' into gh-1355
mattleibow Jul 12, 2021
5d80a8a
Merge pull request #1731 from xamarin/jamesmontemagno-patch-2
Redth Jul 12, 2021
6b8816f
Merge branch 'main' into main
Redth Jul 12, 2021
ea31604
Merge pull request #1716 from tipa/main
Redth Jul 12, 2021
6912a2a
Update MediaPicker.ios.cs
mattleibow Jul 12, 2021
89fa9a3
Fix the build warning-error
mattleibow Jul 12, 2021
9cd845d
Merge branch 'main' into gh-1355
jamesmontemagno Jul 12, 2021
de7308e
Obsolete in some places
mattleibow Jul 12, 2021
29c862b
Bump that version as well
mattleibow Jul 12, 2021
3912bed
Merge branch 'main' into gh-1355
jamesmontemagno Jul 12, 2021
83e667d
Update Xamarin.Forms (#1847)
mattleibow Jul 13, 2021
521db2c
Merge branch 'main' into gh-1355
mattleibow Jul 13, 2021
fa41d13
Update LocationExtensions.ios.tvos.watchos.macos.cs
jamesmontemagno Jul 19, 2021
228e030
Update web sample to net5
Redth Sep 28, 2021
8657192
Merge pull request #1890 from xamarin/web-sample-dep-update
Redth Sep 28, 2021
987109f
Create the TaskCompletionSource before registering for cancellation
borigas Oct 6, 2021
98a69b1
Set the PopoverPresentationController for files too
jamesmontemagno Oct 7, 2021
5421b09
Await on async ios UIActivityViewController
Adam-Langley Oct 11, 2021
e157150
Merge pull request #1 from Adam-Langley/Adam-Langley-Fix-1899
Adam-Langley Oct 11, 2021
78bde07
prevent AppAction double handling on android
dmariogatto Nov 12, 2021
f1d8177
Fix #1912 - if coarse is provided instead of fine location, returned …
aritchie Dec 7, 2021
81832e5
Should not have been added 1912
aritchie Dec 7, 2021
414ce94
Fix #1936 - move bg permission to separate request on api30+
aritchie Dec 7, 2021
2d92ccd
Update feature-request.md (#1898)
jamesmontemagno Jan 5, 2022
85271e4
CI fixes (#1946)
jfversluis Jan 10, 2022
34db1f1
Merge branch 'main' into main
jfversluis Jan 10, 2022
afae843
Update README.md
Redth Jan 12, 2022
b9ad98b
Improving the operation of PresentationControllers (#1846)
dimonovdd Jan 13, 2022
4bff9fa
Merge branch 'main' into main
jfversluis Jan 14, 2022
198cb6b
Merge pull request #1937 from aritchie/main
jfversluis Jan 14, 2022
b5d1dc7
Merge branch 'main' into jamesmontemagno-patch-2
jfversluis Jan 18, 2022
66d4a60
Merge pull request #1857 from xamarin/jamesmontemagno-patch-2
jfversluis Jan 18, 2022
66d9441
Merge branch 'main' into appaction-droid-resume
jfversluis Jan 18, 2022
801f849
Merge branch 'main' into jamesmontemagno-patch-3
jfversluis Jan 18, 2022
7f07d01
Merge pull request #1897 from xamarin/jamesmontemagno-patch-3
jfversluis Jan 18, 2022
1a77144
Merge branch 'main' into gh-1355
jfversluis Jan 18, 2022
c6bc848
Merge pull request #1755 from xamarin/gh-1355
jfversluis Jan 18, 2022
7dfb78f
Merge branch 'main' into gh-512-spike
jfversluis Jan 18, 2022
20d627e
Merge pull request #1568 from xamarin/gh-512-spike
jfversluis Jan 18, 2022
8b83bf9
Merge branch 'main' into TextToSpeechCancelHang
jfversluis Jan 18, 2022
2627bf2
Merge pull request #1895 from borigas/TextToSpeechCancelHang
jfversluis Jan 18, 2022
72dda32
Update feature-request.md
jamesmontemagno Feb 14, 2022
de76775
Merge branch 'main' into appaction-droid-resume
jamesmontemagno Feb 15, 2022
dc8e32c
Merge branch 'main' into main
jamesmontemagno Feb 15, 2022
ae271c4
Add device unit tests for VersionTracking module
cpraehaus Feb 20, 2022
0495f86
Correctly handle version/build downgrades, fixes #1960
cpraehaus Feb 20, 2022
03a1ad2
Course increases clockwise (#1858)
Happypig375 Feb 22, 2022
f8cce99
Software Bill of Materials (SBOM) manifest generation
mjbond-msft Feb 11, 2022
836a5be
Fix: SBOM stage section: Syntax error & indentation
mjbond-msft Feb 11, 2022
38e42e0
Run SBOM job only on devdiv Xamarin.Essentials build (not Public)
mjbond-msft Feb 11, 2022
43f08e5
Set windowsImage for the components build job to windows-2019 as wind…
mjbond-msft Feb 11, 2022
1e71999
Comment with link to SBOM documentation
mjbond-msft Feb 15, 2022
b358daf
Fix: Remove duplicate windowsImage settings
mjbond-msft Feb 16, 2022
9aa8261
SBOM: Set packageVersionRegex to derive the SBOM package version numb…
mjbond-msft Feb 23, 2022
aaafc05
Use EO compliant pool in place of windows-2019
mjbond-msft Feb 22, 2022
0d9e0d3
Ensure the windowsImage setting is blanked out such that the windowsI…
mjbond-msft Feb 22, 2022
40d8f83
Target XamarinComponents production support for windowsImageOverride …
mjbond-msft Feb 24, 2022
336f503
Target in-progress XamarinComponents support for windowsImageOverride
mjbond-msft Feb 27, 2022
5b14d39
Target the AzurePipelines-EO pool when running in DevDiv and not Xama…
mjbond-msft Feb 27, 2022
95f291c
Apply devdiv condition check to template step and not to subset of pa…
mjbond-msft Feb 27, 2022
1dd3ca6
Apply condition to all jobs to only target AzurePipelines-EO when run…
mjbond-msft Feb 27, 2022
7bb3f1b
Fix: Restore original windowsImage empty setting signfying that the j…
mjbond-msft Feb 27, 2022
b89aa30
Target windows-2019 on Xamarin Public
mjbond-msft Feb 27, 2022
0ceea9a
Utilize the production XamarinComponents template providing support f…
mjbond-msft Feb 28, 2022
d82bed0
Fix: Avoid running Mac-only tests on Windows. Revert windowsImage set…
mjbond-msft Feb 28, 2022
16b0b81
Utilize the new build.v1 XamarinComponents template
mjbond-msft Feb 28, 2022
00c7df3
Utilize the new build.v1 XamarinComponents template
mjbond-msft Feb 28, 2022
e4c1216
Remove redundant comment
mjbond-msft Feb 28, 2022
33b55de
Merge pull request #1966 from xamarin/dev/bond/sbom
Redth Mar 1, 2022
fc2f091
Merge branch 'main' into eo-pool
Redth Mar 1, 2022
14b8d4f
Merge pull request #1973 from xamarin/eo-pool
Redth Mar 1, 2022
c0ea6b0
Update Sample.Server.WebAuthenticator.csproj
Redth Mar 2, 2022
244ff53
Merge branch 'main' into fix/gh-1960_version-track-downgrades
jfversluis Mar 3, 2022
0d2d65a
Add variable to run tests
rmarinho Mar 4, 2022
88c7461
[EO] Add target for EO compliance
rmarinho Mar 4, 2022
f412dbf
Fix cake
rmarinho Mar 4, 2022
c072e19
Don't run macOS on release
rmarinho Mar 4, 2022
68dba1e
use check tag
rmarinho Mar 4, 2022
dabaaa6
Use condition
rmarinho Mar 4, 2022
377f3d6
Merge pull request #1978 from xamarin/separate-tests
Redth Mar 4, 2022
e18d0ea
Don't require the storage read, isn't needed on Android.
jamesmontemagno Feb 14, 2022
52f29e2
Remove permissions from sample/test apps
jamesmontemagno Feb 14, 2022
afff2ed
Fix #1972 - allow restricted permissions for geolocation on android
aritchie Mar 1, 2022
162b072
Merge pull request #1968 from xamarin/gh-1961
jfversluis Apr 4, 2022
8c271e6
Merge branch 'main' into appaction-droid-resume
jfversluis Apr 4, 2022
7bb913f
Merge pull request #1923 from dmariogatto/appaction-droid-resume
jfversluis Apr 4, 2022
7c15655
set result after cleanup of locationmanager #1489
SiNeumann May 25, 2021
f96ef75
Merge pull request #1815 from SiNeumann/dev/fix_location_always
jfversluis Apr 4, 2022
73b5ea8
Merge branch 'main' into fix/gh-1960_version-track-downgrades
jfversluis Apr 4, 2022
731988e
Update PhoneDialer.ios.cs
jfversluis Apr 4, 2022
a3006b0
Rename method to EnsureGrantedOrRestrictedAsync
aritchie Apr 4, 2022
101971f
Merge pull request #1986 from xamarin/phonedialer-surface-exception
jfversluis Apr 5, 2022
ed8a612
Merge branch 'main' into fix/gh-1960_version-track-downgrades
jfversluis Apr 5, 2022
1d09035
Merge branch 'main' into issue-1972
jfversluis Apr 5, 2022
70ae013
Merge pull request #1976 from aritchie/issue-1972
jfversluis Apr 5, 2022
ca7f366
Merge branch 'main' into fix/gh-1960_version-track-downgrades
jfversluis Apr 5, 2022
ce57d0d
Merge pull request #1969 from cpraehaus/fix/gh-1960_version-track-dow…
jfversluis Apr 6, 2022
e8c0772
update with existing .openpublishing.publish.config.json
mimisasouvanh Apr 7, 2022
dedd7ea
Merge pull request #1987 from xamarin/branch-renaming-2022-04-07-08-0…
jfversluis Apr 8, 2022
362eb54
Update AppInfo.ios.tvos.watchos.macos.cs
jfversluis Apr 8, 2022
bc74dce
Merge pull request #1990 from xamarin/supress-obsolete
jfversluis Apr 8, 2022
f427156
Update WebAuthenticator.android.cs
Redth May 2, 2022
a9ad6e2
Update WebAuthenticator.android.cs
jfversluis May 2, 2022
e759d5e
Merge branch 'main' into main
jfversluis May 2, 2022
31f3de2
Merge pull request #2002 from xamarin/webauth-android-activity-check
jfversluis May 2, 2022
e8ce50d
Fix #1999 - checkasync should return restricted for locationinuse whe…
aritchie May 2, 2022
4066392
Merge branch 'main' into main
jfversluis May 4, 2022
29ad28d
Merge pull request #1900 from Adam-Langley/main
jfversluis May 4, 2022
cb328cb
Merge branch 'main' into issue-1999_droid_permission_checkstatusasync
jfversluis May 4, 2022
e054b7e
Merge pull request #2005 from aritchie/issue-1999_droid_permission_ch…
jfversluis May 6, 2022
55bcbc0
Update build pipeline to remove obsoletes (#2042)
jfversluis Sep 8, 2022
41169c1
[SEO][Rollout Monikered Canonical]Add URL moniker (#2039)
shawnwang-ms Sep 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 1 addition & 19 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,4 @@ labels: feature-request
assignees: ''

---

## Summary
Please provide a brief summary of your proposal. Two to three sentences is best here.

## API Changes

Include a list of all API changes, additions, subtractions as would be required by your proposal. These APIs should be considered placeholders, so the naming is not as important as getting the concepts correct. If possible you should include some "example" code of usage of your new API. You should also provide details of the level of availability for the feature on each of the supported platforms.

e.g.

In order to facilitate the new Shiny Button api, a bool is added to the Button class. This is done as a bool because it is simpler to data bind and other reasons...

var button = new Button ();
button.MakeShiny = true; // new API

The MakeShiny API works even if the button is already visible.

## Intended Use Case
Provide a detailed example of where your proposal would be used and for what purpose.
We are no longer accepting new feature request for Xamarin.Essentials. Please make your new feature requests in the .NET MAUI repo which contains .NET MAUI Essentials at https://github.com/dotnet/maui.
7 changes: 4 additions & 3 deletions .openpublishing.publish.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@
}
],
"notification_subscribers": [],
"sync_notification_subscribers": null,
"branches_to_filter": [],
"skip_source_output_uploading": false,
"need_preview_pull_request": false,
"contribution_branch_mappings": {},
"need_pr_comments": false,
"contribution_branch_mappings": {},
"dependent_repositories": [
{
"path_to_root": "_themes",
"url": "https://github.com/Microsoft/templates.docs.msft",
"branch": "master",
"branch": "main",
"branch_mapping": {}
}
],
Expand All @@ -84,4 +85,4 @@
"docs_build_engine": {
"name": "docfx_v3"
}
}
}
8 changes: 3 additions & 5 deletions DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<RootNamespace>DeviceTests.Droid</RootNamespace>
<AssemblyName>XamarinEssentialsDeviceTestsAndroid</AssemblyName>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<AndroidApplication>True</AndroidApplication>
<AndroidUseIntermediateDesignerFile>true</AndroidUseIntermediateDesignerFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
Expand All @@ -19,6 +18,7 @@
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -29,7 +29,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
Expand All @@ -47,7 +46,6 @@
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
</PropertyGroup>
Expand All @@ -59,11 +57,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1821" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.20602.1" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.21620.1" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.6" />
</ItemGroup>
Expand Down
35 changes: 32 additions & 3 deletions DeviceTests/DeviceTests.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,40 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<queries>
<!-- Email -->
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
</intent>
<!-- Browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
<!-- Browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<!-- Sms -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="smsto" />
</intent>
<!-- PhoneDialer -->
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<!-- MediaPicker -->
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</queries>
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/MainTheme"></application>
</manifest>
15 changes: 3 additions & 12 deletions DeviceTests/DeviceTests.Shared/DeviceTests.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.22">
<PropertyGroup>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">Xamarin.iOS10;MonoAndroid90;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">Xamarin.iOS10;MonoAndroid90;</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">Xamarin.iOS10;MonoAndroid10.0;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">Xamarin.iOS10;MonoAndroid10.0;</TargetFrameworks>
<AssemblyName>XamarinEssentialsDeviceTestsShared</AssemblyName>
<RootNamespace>DeviceTests.Shared</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
Expand All @@ -23,11 +23,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1821" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<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')) ">
Expand All @@ -37,14 +36,6 @@
</SDKReference>
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
Expand Down
146 changes: 146 additions & 0 deletions DeviceTests/DeviceTests.Shared/VersionTracking_Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
using System;
using System.Diagnostics;
using Xamarin.Essentials;
using Xunit;
using Xunit.Abstractions;

namespace DeviceTests
{
public class VersionTracking_Tests
{
/// <summary>
/// We cannot mock the app version but it should be constant value
/// </summary>
const string currentVersion = "1.0.1.0";
const string currentBuild = "1";

const string versionTrailKey = "VersionTracking.Trail";
const string versionsKey = "VersionTracking.Versions";
const string buildsKey = "VersionTracking.Builds";
static readonly string sharedName = Preferences.GetPrivatePreferencesSharedName("versiontracking");

readonly ITestOutputHelper output;

public VersionTracking_Tests(ITestOutputHelper output)
{
this.output = output;
}

[Fact]
public void First_Launch_Ever()
{
VersionTracking.Track();
Preferences.Clear(sharedName);

VersionTracking.InitVersionTracking();

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.True(VersionTracking.IsFirstLaunchEver);
Assert.True(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.True(VersionTracking.IsFirstLaunchForCurrentBuild);
}

[Fact]
public void First_Launch_For_Version()
{
VersionTracking.Track();
Preferences.Set(versionsKey, string.Join("|", new string[] { "0.8.0", "0.9.0", "1.0.0" }), sharedName);
Preferences.Set(buildsKey, string.Join("|", new string[] { currentBuild }), sharedName);

VersionTracking.InitVersionTracking();

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.Equal("1.0.0", VersionTracking.PreviousVersion);
Assert.Equal("0.8.0", VersionTracking.FirstInstalledVersion);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.True(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.False(VersionTracking.IsFirstLaunchForCurrentBuild);

VersionTracking.InitVersionTracking();

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.Equal("1.0.0", VersionTracking.PreviousVersion);
Assert.Equal("0.8.0", VersionTracking.FirstInstalledVersion);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.False(VersionTracking.IsFirstLaunchForCurrentBuild);
}

[Fact]
public void First_Launch_For_Build()
{
VersionTracking.Track();
Preferences.Set(versionsKey, string.Join("|", new string[] { currentVersion }), sharedName);
Preferences.Set(buildsKey, string.Join("|", new string[] { "10", "20" }), sharedName);

VersionTracking.InitVersionTracking();

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.Equal("20", VersionTracking.PreviousBuild);
Assert.Equal("10", VersionTracking.FirstInstalledBuild);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.True(VersionTracking.IsFirstLaunchForCurrentBuild);

VersionTracking.InitVersionTracking();

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.Equal("20", VersionTracking.PreviousBuild);
Assert.Equal("10", VersionTracking.FirstInstalledBuild);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.False(VersionTracking.IsFirstLaunchForCurrentBuild);
}

[Fact]
public void First_Launch_After_Downgrade()
{
VersionTracking.Track();
Preferences.Set(versionsKey, string.Join("|", new string[] { currentVersion, "1.0.2", "1.0.3" }), sharedName);

VersionTracking.InitVersionTracking();
output.WriteLine(VersionTracking.GetStatus());

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.Equal("1.0.3", VersionTracking.PreviousVersion);
Assert.Equal("1.0.2", VersionTracking.FirstInstalledVersion);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.True(VersionTracking.IsFirstLaunchForCurrentVersion);

VersionTracking.InitVersionTracking();

Assert.Equal(currentVersion, VersionTracking.CurrentVersion);
Assert.Equal("1.0.3", VersionTracking.PreviousVersion);
Assert.Equal("1.0.2", VersionTracking.FirstInstalledVersion);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion);
}

[Fact]
public void First_Launch_After_Build_Downgrade()
{
VersionTracking.Track();
Preferences.Set(versionsKey, string.Join("|", new string[] { currentVersion }), sharedName);
Preferences.Set(buildsKey, string.Join("|", new string[] { currentBuild, "10", "20" }), sharedName);

VersionTracking.InitVersionTracking();
output.WriteLine(VersionTracking.GetStatus());

Assert.Equal(currentBuild, VersionTracking.CurrentBuild);
Assert.Equal("20", VersionTracking.PreviousBuild);
Assert.Equal("10", VersionTracking.FirstInstalledBuild);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.True(VersionTracking.IsFirstLaunchForCurrentBuild);

VersionTracking.InitVersionTracking();

Assert.Equal(currentBuild, VersionTracking.CurrentBuild);
Assert.Equal("20", VersionTracking.PreviousBuild);
Assert.Equal("10", VersionTracking.FirstInstalledBuild);
Assert.False(VersionTracking.IsFirstLaunchEver);
Assert.False(VersionTracking.IsFirstLaunchForCurrentVersion);
Assert.False(VersionTracking.IsFirstLaunchForCurrentBuild);
}
}
}
2 changes: 1 addition & 1 deletion DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1821" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
Expand Down
4 changes: 2 additions & 2 deletions DeviceTests/DeviceTests.iOS/DeviceTests.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1821" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.20602.1" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.21620.1" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions DeviceTests/DeviceTests.iOS/Main.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using UIKit;
using System;
using UIKit;

namespace DeviceTests.iOS
{
public class Application
{
static void Main(string[] args)
{
if (args?.Length > 0) // usually means this is from xharness
UIApplication.Main(args, null, nameof(TestApplicationDelegate));
if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ci-run")))
UIApplication.Main(args, null, typeof(TestApplicationDelegate));
else
UIApplication.Main(args, null, nameof(AppDelegate));
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}