Skip to content

Commit acfac1b

Browse files
authored
Merge pull request #7308 from MartinZikmund/dev/mazi/system-information
Add support for `EasClientDeviceInformation`, adjust `AnalyticsVersionInfo`
2 parents 399330b + 5b32742 commit acfac1b

File tree

43 files changed

+600
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+600
-299
lines changed

src/SamplesApp/UITests.Shared/UITests.Shared.projitems

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,15 @@
473473
<SubType>Designer</SubType>
474474
<Generator>MSBuild:Compile</Generator>
475475
</Page>
476-
<Page Include="$(MSBuildThisFileDirectory)Windows_Security_Authentication_Web\AuthenticationBroker_Demo.xaml">
476+
<Page Include="$(MSBuildThisFileDirectory)Windows_Security\Authentication_Web\AuthenticationBroker_Demo.xaml">
477477
<SubType>Designer</SubType>
478478
<Generator>MSBuild:Compile</Generator>
479479
</Page>
480-
<Page Include="$(MSBuildThisFileDirectory)Windows_Security_Credentials\PasswordVaultTests\CredentialsPersistence.xaml">
480+
<Page Include="$(MSBuildThisFileDirectory)Windows_Security\Credentials\PasswordVaultTests\CredentialsPersistence.xaml">
481+
<SubType>Designer</SubType>
482+
<Generator>MSBuild:Compile</Generator>
483+
</Page>
484+
<Page Include="$(MSBuildThisFileDirectory)Windows_Security\ExchangeActivesyncProvisioning\EasClientDeviceInformationTests.xaml">
481485
<SubType>Designer</SubType>
482486
<Generator>MSBuild:Compile</Generator>
483487
</Page>
@@ -4782,12 +4786,18 @@
47824786
<Compile Include="$(MSBuildThisFileDirectory)Windows_Phone\Devices_Notifications_VibrationDevice.xaml.cs">
47834787
<DependentUpon>Devices_Notifications_VibrationDevice.xaml</DependentUpon>
47844788
</Compile>
4789+
<Compile Include="$(MSBuildThisFileDirectory)Windows_Security\Authentication_Web\AuthenticationBroker_Demo.xaml.cs">
4790+
<DependentUpon>AuthenticationBroker_Demo.xaml</DependentUpon>
4791+
</Compile>
4792+
<Compile Include="$(MSBuildThisFileDirectory)Windows_Security\Credentials\PasswordVaultTests\CredentialsPersistence.xaml.cs">
4793+
<DependentUpon>CredentialsPersistence.xaml</DependentUpon>
4794+
</Compile>
4795+
<Compile Include="$(MSBuildThisFileDirectory)Windows_Security\ExchangeActivesyncProvisioning\EasClientDeviceInformationTests.xaml.cs">
4796+
<DependentUpon>EasClientDeviceInformationTests.xaml</DependentUpon>
4797+
</Compile>
47854798
<Compile Include="$(MSBuildThisFileDirectory)Windows_Storage\NativeStorageRuntimeTests.xaml.cs">
47864799
<DependentUpon>NativeStorageRuntimeTests.xaml</DependentUpon>
47874800
</Compile>
4788-
<Compile Include="$(MSBuildThisFileDirectory)Windows_Security_Authentication_Web\AuthenticationBroker_Demo.xaml.cs">
4789-
<DependentUpon>AuthenticationBroker_Demo.xaml</DependentUpon>
4790-
</Compile>
47914801
<Compile Include="$(MSBuildThisFileDirectory)Windows_Storage\Pickers\DownloadFileSavePickerTests.xaml.cs">
47924802
<DependentUpon>DownloadFileSavePickerTests.xaml</DependentUpon>
47934803
</Compile>
@@ -7242,9 +7252,6 @@
72427252
<Compile Include="$(MSBuildThisFileDirectory)Wasm\Wasm_CustomEvent.xaml.cs">
72437253
<DependentUpon>Wasm_CustomEvent.xaml</DependentUpon>
72447254
</Compile>
7245-
<Compile Include="$(MSBuildThisFileDirectory)Windows_Security_Credentials\PasswordVaultTests\CredentialsPersistence.xaml.cs">
7246-
<DependentUpon>CredentialsPersistence.xaml</DependentUpon>
7247-
</Compile>
72487255
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Core\SystemNavigationManagerTests\HardwareBackButton.xaml.cs">
72497256
<DependentUpon>HardwareBackButton.xaml</DependentUpon>
72507257
</Compile>
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace SamplesApp.UITests.Windows_Security_Authentication_Web
1212
{
13-
[Sample("Authentication", IsManualTest = true)]
13+
[Sample("Windows.Security", IsManualTest = true)]
1414
public sealed partial class AuthenticationBroker_Demo : Page
1515
{
1616
#if !NET6_0_OR_GREATER
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace UITests.Shared.Windows_Security_Credentials.PasswordVaultTests
1616
{
17-
[SampleControlInfo("PasswordVault", "CredentialsPersistence")]
17+
[Sample("Windows.Security", Name = "PasswordVault")]
1818
public sealed partial class CredentialsPersistence : UserControl
1919
{
2020
public CredentialsPersistence()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Page
2+
x:Class="UITests.Windows_Security.ExchangeActivesyncProvisioning.EasClientDeviceInformationTests"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
mc:Ignorable="d"
8+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
9+
10+
<Grid>
11+
<ListView ItemsSource="{x:Bind Properties}">
12+
<ListView.ItemTemplate>
13+
<DataTemplate>
14+
<StackPanel Margin="0,0,0,8">
15+
<TextBlock Text="{Binding Key}" FontWeight="SemiBold" />
16+
<TextBlock Text="{Binding Value}" />
17+
</StackPanel>
18+
</DataTemplate>
19+
</ListView.ItemTemplate>
20+
</ListView>
21+
</Grid>
22+
</Page>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Uno.UI.Samples.Controls;
4+
using Windows.Security.ExchangeActiveSyncProvisioning;
5+
using Windows.UI.Xaml.Controls;
6+
7+
namespace UITests.Windows_Security.ExchangeActivesyncProvisioning
8+
{
9+
[Sample("Windows.Security", Name = nameof(EasClientDeviceInformation), IsManualTest = true)]
10+
public sealed partial class EasClientDeviceInformationTests : Page
11+
{
12+
public EasClientDeviceInformationTests()
13+
{
14+
InitializeComponent();
15+
16+
var easClientDeviceInformation = new EasClientDeviceInformation();
17+
18+
Properties = new[]{
19+
new KeyValuePair<string, string>("Id", easClientDeviceInformation.Id.ToString()),
20+
new KeyValuePair<string, string>("Friendly name", easClientDeviceInformation.FriendlyName),
21+
new KeyValuePair<string, string>("Operating system", easClientDeviceInformation.OperatingSystem),
22+
new KeyValuePair<string, string>("System firmeware version", easClientDeviceInformation.SystemFirmwareVersion),
23+
new KeyValuePair<string, string>("System hardware version", easClientDeviceInformation.SystemHardwareVersion),
24+
new KeyValuePair<string, string>("System manufacturer", easClientDeviceInformation.SystemManufacturer),
25+
new KeyValuePair<string, string>("System product name", easClientDeviceInformation.SystemProductName),
26+
new KeyValuePair<string, string>("System SKU", easClientDeviceInformation.SystemSku)
27+
};
28+
}
29+
30+
public KeyValuePair<string, string>[] Properties { get; }
31+
}
32+
}

src/SamplesApp/UITests.Shared/Windows_System/Profile/AnalyticsInfoTests.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@
1616
<TextBlock x:Name="DeviceFamilyTextBlock" />
1717
<TextBlock Text="DeviceFamilyVersion" FontWeight="Bold" />
1818
<TextBlock x:Name="DeviceFamilyVersionTextBlock" />
19+
<TextBlock Text="Decoded DeviceFamilyVersion" FontWeight="Bold" />
20+
<TextBlock x:Name="DecodedDeviceFamilyVersionTextBlock" />
1921
</StackPanel>
2022
</UserControl>
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Runtime.InteropServices.WindowsRuntime;
6-
using Uno.UI.Samples.Controls;
7-
using Windows.Foundation;
8-
using Windows.Foundation.Collections;
1+
using Uno.UI.Samples.Controls;
92
using Windows.System.Profile;
10-
using Windows.UI.Xaml;
113
using Windows.UI.Xaml.Controls;
12-
using Windows.UI.Xaml.Controls.Primitives;
13-
using Windows.UI.Xaml.Data;
14-
using Windows.UI.Xaml.Input;
15-
using Windows.UI.Xaml.Media;
16-
using Windows.UI.Xaml.Navigation;
17-
18-
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
194

205
namespace UITests.Shared.Windows_System.Profile
216
{
@@ -29,6 +14,21 @@ public AnalyticsInfoTests()
2914
DeviceFormTextBlock.Text = AnalyticsInfo.DeviceForm;
3015
DeviceFamilyTextBlock.Text = AnalyticsInfo.VersionInfo.DeviceFamily;
3116
DeviceFamilyVersionTextBlock.Text = AnalyticsInfo.VersionInfo.DeviceFamilyVersion;
32-
}
17+
18+
try
19+
{
20+
ulong v = ulong.Parse(AnalyticsInfo.VersionInfo.DeviceFamilyVersion);
21+
var v1 = (ushort)((v & 0xFFFF000000000000L) >> 48);
22+
var v2 = (ushort)((v & 0x0000FFFF00000000L) >> 32);
23+
var v3 = (ushort)((v & 0x00000000FFFF0000L) >> 16);
24+
var v4 = (ushort)((v & 0x000000000000FFFFL));
25+
var decodedVersion = $"{v1}.{v2}.{v3}.{v4}";
26+
DecodedDeviceFamilyVersionTextBlock.Text = decodedVersion;
27+
}
28+
catch
29+
{
30+
DecodedDeviceFamilyVersionTextBlock.Text = "Invalid version string";
31+
}
32+
}
3333
}
3434
}

src/Uno.UI.Runtime.Skia.Gtk/GtkHost.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
using Uno.ApplicationModel.DataTransfer;
2323
using Uno.UI.Runtime.Skia.GTK.Extensions.ApplicationModel.DataTransfer;
2424
using Uno.Foundation.Logging;
25+
using Windows.System.Profile.Internal;
26+
using Uno.UI.Runtime.Skia.GTK.System.Profile;
2527

2628
namespace Uno.UI.Runtime.Skia
2729
{
@@ -65,6 +67,7 @@ public void Run()
6567
ApiExtensibility.Register<FolderPicker>(typeof(IFolderPickerExtension), o => new FolderPickerExtension(o));
6668
ApiExtensibility.Register(typeof(IClipboardExtension), o => new ClipboardExtensions(o));
6769
ApiExtensibility.Register<FileSavePicker>(typeof(IFileSavePickerExtension), o => new FileSavePickerExtension(o));
70+
ApiExtensibility.Register(typeof(IAnalyticsInfoExtension), o => new AnalyticsInfoExtension());
6871

6972
_isDispatcherThread = true;
7073
_window = new Gtk.Window("Uno Host");

0 commit comments

Comments
 (0)