-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb7edc2
commit fb8ba79
Showing
7 changed files
with
161 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/Uno.UWP/Security/ExchangeActiveSyncProvisioning/EasClientDeviceInformation.Android.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Uno.UI; | ||
using Settings = Android.Provider.Settings; | ||
|
||
namespace Windows.Security.ExchangeActiveSyncProvisioning | ||
{ | ||
public partial class EasClientDeviceInformation | ||
{ | ||
partial void Initialize() | ||
{ | ||
OperatingSystem = "ANDROID"; | ||
SystemManufacturer = Android.OS.Build.Manufacturer; | ||
SystemProductName = Android.OS.Build.Model; | ||
FriendlyName = Settings.Global.GetString(ContextHelper.Current.ContentResolver, Settings.Global.DeviceName); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Uno.UWP/Security/ExchangeActiveSyncProvisioning/EasClientDeviceInformation.Skia.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Windows.Security.ExchangeActiveSyncProvisioning | ||
{ | ||
public partial class EasClientDeviceInformation | ||
{ | ||
partial void Initialize() | ||
{ | ||
OperatingSystem = Environment | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
src/Uno.UWP/Security/ExchangeActiveSyncProvisioning/EasClientDeviceInformation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using Uno; | ||
|
||
namespace Windows.Security.ExchangeActiveSyncProvisioning | ||
{ | ||
/// <summary> | ||
/// Provides the app with the ability to retrieve device information from the local device. | ||
/// </summary> | ||
public partial class EasClientDeviceInformation | ||
{ | ||
/// <summary> | ||
/// Creates an instance of an object that allows the caller | ||
/// app to retrieve device information from the local device. | ||
/// </summary> | ||
public EasClientDeviceInformation() => Initialize(); | ||
|
||
partial void Initialize(); | ||
|
||
/// <summary> | ||
/// Gets the friendly name of the local device. | ||
/// This value might come from a NetBIOS computer name. | ||
/// </summary> | ||
[NotImplemented("__ANDROID__", "__IOS__", "__WASM__", "__SKIA__", "__MACOS__")] | ||
public string FriendlyName { get; private set; } = ""; | ||
|
||
/// <summary> | ||
/// Returns the identifier of the local device. | ||
/// </summary> | ||
[NotImplemented("__ANDROID__", "__IOS__", "__WASM__", "__SKIA__", "__MACOS__")] | ||
public Guid Id { get; private set; } = Guid.Empty; | ||
|
||
/// <summary> | ||
/// Gets the name of the operating system of the local device. | ||
/// </summary> | ||
public string OperatingSystem { get; private set; } = ""; | ||
|
||
/// <summary> | ||
/// Gets the system manufacturer of the local device. | ||
/// Use SystemManufacturer only if the value of SystemSku is empty. | ||
/// </summary> | ||
[NotImplemented("__WASM__")] | ||
public string SystemManufacturer { get; private set; } = ""; | ||
|
||
/// <summary> | ||
/// Gets the system product name of the local device. | ||
/// Use SystemProductName only if the value of SystemSku is empty. | ||
/// </summary> | ||
[NotImplemented("__IOS__", "__WASM__", "__SKIA__", "__MACOS__")] | ||
public string SystemProductName { get; private set; } = ""; | ||
|
||
/// <summary> | ||
/// Gets the system SKU of the local device. | ||
/// </summary> | ||
public string SystemSku { get; private set; } = ""; | ||
|
||
/// <summary> | ||
/// Gets the system firmware version of the local device. | ||
/// </summary> | ||
public string SystemFirmwareVersion { get; private set; } = ""; | ||
|
||
/// <summary> | ||
/// Gets the system hardware version of the local device. | ||
/// </summary> | ||
public string SystemHardwareVersion { get; private set; } = ""; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Uno.UWP/Security/ExchangeActiveSyncProvisioning/EasClientDeviceInformation.iOS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Windows.Security.ExchangeActiveSyncProvisioning | ||
{ | ||
public partial class EasClientDeviceInformation | ||
{ | ||
partial void Initialize() | ||
{ | ||
OperatingSystem = "IOS"; | ||
SystemManufacturer = "Apple inc."; | ||
SystemProductName = Android.OS.Build.Model; | ||
FriendlyName = Settings.Global.GetString(ContextHelper.Current.ContentResolver, Settings.Global.DeviceName); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Uno.UWP/Security/ExchangeActiveSyncProvisioning/EasClientDeviceInformation.macOS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Windows.Security.ExchangeActiveSyncProvisioning | ||
{ | ||
public partial class EasClientDeviceInformation | ||
{ | ||
partial void Initialize() | ||
{ | ||
OperatingSystem = "MACOS"; | ||
SystemManufacturer = "Apple inc."; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Uno.UWP/Security/ExchangeActiveSyncProvisioning/EasClientDeviceInformation.wasm.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using static Uno.Foundation.WebAssemblyRuntime; | ||
|
||
namespace Windows.Security.ExchangeActiveSyncProvisioning | ||
{ | ||
public partial class EasClientDeviceInformation | ||
{ | ||
private const string BrowserVersionFallback = "Unknown"; | ||
private const string JsType = "Windows.System.Profile.AnalyticsVersionInfo"; | ||
|
||
partial void Initialize() | ||
{ | ||
OperatingSystem = "Browser"; | ||
SystemSku = GetUserAgent(); | ||
} | ||
|
||
private string GetUserAgent() | ||
{ | ||
var userAgent = InvokeJS(JsType + ".getUserAgent()"); | ||
if (!string.IsNullOrEmpty(userAgent)) | ||
{ | ||
return userAgent; | ||
} | ||
return BrowserVersionFallback; | ||
} | ||
} | ||
} |